Skip to content

Commit ebca8de

Browse files
devnexennikic
authored andcommitted
posix: adding freebsd specific rlimit constants
Respectively number of kqueues, pty limits per user. Closes GH-6608.
1 parent 35dece0 commit ebca8de

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

UPGRADING

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ PHP 8.1 UPGRADE NOTES
120120
echo $h, "\n";
121121
```
122122

123+
- Posix:
124+
. Added POSIX_RLIMIT_KQUEUES and POSIX_RLIMIT_NPTS. These rlimits are only
125+
available on FreeBSD.
126+
123127
========================================
124128
3. Changes in SAPI modules
125129
========================================

ext/posix/posix.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ static PHP_MINIT_FUNCTION(posix)
138138
#ifdef RLIMIT_STACK
139139
REGISTER_LONG_CONSTANT("POSIX_RLIMIT_STACK", RLIMIT_STACK, CONST_CS | CONST_PERSISTENT);
140140
#endif
141+
#ifdef RLIMIT_KQUEUES
142+
REGISTER_LONG_CONSTANT("POSIX_RLIMIT_KQUEUES", RLIMIT_KQUEUES, CONST_CS | CONST_PERSISTENT);
143+
#endif
144+
#ifdef RLIMIT_NPTS
145+
REGISTER_LONG_CONSTANT("POSIX_RLIMIT_NPTS", RLIMIT_NPTS, CONST_CS | CONST_PERSISTENT);
146+
#endif
141147
#ifdef HAVE_SETRLIMIT
142148
REGISTER_LONG_CONSTANT("POSIX_RLIMIT_INFINITY", RLIM_INFINITY, CONST_CS | CONST_PERSISTENT);
143149
#endif
@@ -1096,6 +1102,14 @@ static const struct limitlist {
10961102
{ RLIMIT_OFILE, "openfiles" },
10971103
#endif
10981104

1105+
#ifdef RLIMIT_KQUEUES
1106+
{ RLIMIT_KQUEUES, "kqueues" },
1107+
#endif
1108+
1109+
#ifdef RLIMIT_NPTS
1110+
{ RLIMIT_NPTS, "npts" },
1111+
#endif
1112+
10991113
{ 0, NULL }
11001114
};
11011115
/* }}} */

0 commit comments

Comments
 (0)