From 94b7cc3711b0b74c1d3ae18b9a2e019e51a8e0bf Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 15 May 2011 15:28:46 -0400 Subject: Fix a few problems in fopen and freopen fopen should set the FD_CLOEXEC flag if requested evenif the kernel does not support an aotmic operation. freopen should reuse the file descriptor for the stream. This is especially important for calls to change the standard streams (stin, stdout, stderr). --- include/unistd.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/unistd.h b/include/unistd.h index 0ad2983..5014e2e 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -79,6 +79,7 @@ char *__canonicalize_directory_name_internal (__const char *__thisdir, extern int __dup (int __fd); extern int __dup2 (int __fd, int __fd2); libc_hidden_proto (__dup2) +libc_hidden_proto (dup3) extern int __execve (__const char *__path, char *__const __argv[], char *__const __envp[]); extern long int __pathconf (__const char *__path, int __name); @@ -175,6 +176,7 @@ extern int __have_sock_cloexec; SOCK_CLOEXEC. Avoid defining separate variables for all of them unless it is really necessary. */ #define __have_pipe2 __have_sock_cloexec +#define __have_dup3 __have_sock_cloexec extern int __getlogin_r_loginuid (char *name, size_t namesize) attribute_hidden; -- cgit v1.1