diff options
author | Christian Franke <christian.franke@t-online.de> | 2024-01-15 12:13:30 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2024-01-15 12:52:56 +0100 |
commit | d8c0fb090ca637bba5337fb3b0a1f3ee107b21dd (patch) | |
tree | b70b4361eb285af0f5d25a3594e5a02a0897b162 /newlib/libc | |
parent | 4ecfb5b7292af4baf0a2f199f5351b67c8faf4cc (diff) | |
download | newlib-d8c0fb090ca637bba5337fb3b0a1f3ee107b21dd.zip newlib-d8c0fb090ca637bba5337fb3b0a1f3ee107b21dd.tar.gz newlib-d8c0fb090ca637bba5337fb3b0a1f3ee107b21dd.tar.bz2 |
Cygwin: introduce close_range(2)
This function closes or sets the close-on-exec flag for a specified
range of file descriptors. It is available on FreeBSD and Linux.
Signed-off-by: Christian Franke <christian.franke@t-online.de>
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/include/sys/unistd.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h index 2553225..0090154 100644 --- a/newlib/libc/include/sys/unistd.h +++ b/newlib/libc/include/sys/unistd.h @@ -26,6 +26,12 @@ int chown (const char *__path, uid_t __owner, gid_t __group); int chroot (const char *__path); #endif int close (int __fildes); +#if defined(__CYGWIN__) && (__BSD_VISIBLE || __GNU_VISIBLE) +/* Available on FreeBSD (__BSD_VISIBLE) and Linux (__GNU_VISIBLE). */ +int close_range (unsigned int __firstfd, unsigned int __lastfd, int __flags); +/* CLOSE_RANGE_UNSHARE (1 << 1) */ /* Linux-specific, not supported. */ +#define CLOSE_RANGE_CLOEXEC (1 << 2) +#endif #if __POSIX_VISIBLE >= 199209 size_t confstr (int __name, char *__buf, size_t __len); #endif |