[glib/wip/mattrose/apple-sysconf] add __APPLE__ to the list of operating systems that can use sysconf() to get open file limits
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/mattrose/apple-sysconf] add __APPLE__ to the list of operating systems that can use sysconf() to get open file limits
- Date: Wed, 18 Nov 2020 10:49:59 +0000 (UTC)
commit b23811a23432b3f15eeebf00afd5ef68d4807bae
Author: Matt Rose <mattrose folkwolf net>
Date: Tue Nov 17 14:42:06 2020 -0500
add __APPLE__ to the list of operating systems that can use sysconf() to get open file limits
glib/gspawn.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/glib/gspawn.c b/glib/gspawn.c
index af76629f8..e720635db 100644
--- a/glib/gspawn.c
+++ b/glib/gspawn.c
@@ -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)
open_max = rl.rlim_max;
#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
* 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
* 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)
open_max = sysconf (_SC_OPEN_MAX);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]