Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorChristian Franke <christian.franke@t-online.de>2024-01-15 14:13:30 +0300
committerCorinna Vinschen <corinna@vinschen.de>2024-01-15 14:52:56 +0300
commitd8c0fb090ca637bba5337fb3b0a1f3ee107b21dd (patch)
treeb70b4361eb285af0f5d25a3594e5a02a0897b162 /newlib
parent4ecfb5b7292af4baf0a2f199f5351b67c8faf4cc (diff)
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')
-rw-r--r--newlib/libc/include/sys/unistd.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h
index 25532251c..00901540f 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