mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-09 12:25:48 +01:00
add __APPLE__ to the list of operating systems that can use sysconf() to get open file limits
This commit is contained in:
parent
1b7509c09b
commit
b23811a234
@ -1273,7 +1273,7 @@ safe_fdwalk (int (*cb)(void *data, int fd), void *data)
|
|||||||
if (getrlimit (RLIMIT_NOFILE, &rl) == 0 && rl.rlim_max != RLIM_INFINITY)
|
if (getrlimit (RLIMIT_NOFILE, &rl) == 0 && rl.rlim_max != RLIM_INFINITY)
|
||||||
open_max = rl.rlim_max;
|
open_max = rl.rlim_max;
|
||||||
#endif
|
#endif
|
||||||
#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
|
||||||
/* Use sysconf() function provided by the system if it is known to be
|
/* Use sysconf() function provided by the system if it is known to be
|
||||||
* async-signal safe.
|
* async-signal safe.
|
||||||
*
|
*
|
||||||
@ -1282,6 +1282,9 @@ safe_fdwalk (int (*cb)(void *data, int fd), void *data)
|
|||||||
*
|
*
|
||||||
* OpenBSD: sysconf() is included in the list of async-signal safe functions
|
* OpenBSD: sysconf() is included in the list of async-signal safe functions
|
||||||
* found in https://man.openbsd.org/sigaction.2.
|
* found in https://man.openbsd.org/sigaction.2.
|
||||||
|
*
|
||||||
|
* Apple: sysconf() is included in the list of async-signal safe functions
|
||||||
|
* found in https://opensource.apple.com/source/xnu/xnu-517.12.7/bsd/man/man2/sigaction.2
|
||||||
*/
|
*/
|
||||||
if (open_max < 0)
|
if (open_max < 0)
|
||||||
open_max = sysconf (_SC_OPEN_MAX);
|
open_max = sysconf (_SC_OPEN_MAX);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user