mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-14 19:48:05 +02:00
gspawn: safe_closefrom for Solaris 11.3/11.4
When F_CLOSEFROM is defined, we know that closefrom() is signal safe.
This commit is contained in:
parent
6549a36535
commit
790571a2cd
@ -1487,7 +1487,8 @@ safe_fdwalk (int (*cb)(void *data, int fd), void *data)
|
|||||||
static void
|
static void
|
||||||
safe_closefrom (int lowfd)
|
safe_closefrom (int lowfd)
|
||||||
{
|
{
|
||||||
#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
#if defined(__FreeBSD__) || defined(__OpenBSD__) || \
|
||||||
|
(defined(__sun__) && defined(F_CLOSEFROM))
|
||||||
/* Use closefrom function provided by the system if it is known to be
|
/* Use closefrom function provided by the system if it is known to be
|
||||||
* async-signal safe.
|
* async-signal safe.
|
||||||
*
|
*
|
||||||
@ -1496,6 +1497,9 @@ safe_closefrom (int lowfd)
|
|||||||
*
|
*
|
||||||
* OpenBSD: closefrom is not included in the list, but a direct system call
|
* OpenBSD: closefrom is not included in the list, but a direct system call
|
||||||
* should be safe to use.
|
* should be safe to use.
|
||||||
|
*
|
||||||
|
* In Solaris as of 11.3 SRU 31, closefrom() is also a direct system call.
|
||||||
|
* On such systems, F_CLOSEFROM is defined.
|
||||||
*/
|
*/
|
||||||
(void) closefrom (lowfd);
|
(void) closefrom (lowfd);
|
||||||
#elif defined(__DragonFly__)
|
#elif defined(__DragonFly__)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user