summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-05-15 15:28:46 -0400
committerUlrich Drepper <drepper@gmail.com>2011-05-15 15:28:46 -0400
commit94b7cc3711b0b74c1d3ae18b9a2e019e51a8e0bf (patch)
tree2ddc8ca200024ecca3faf0f2efffaea15e21a04f /include
parentbd25564e1e98910ed69043ed6a6f884ce60e5780 (diff)
downloadglibc-94b7cc3711b0b74c1d3ae18b9a2e019e51a8e0bf.tar.gz
glibc-94b7cc3711b0b74c1d3ae18b9a2e019e51a8e0bf.tar.xz
glibc-94b7cc3711b0b74c1d3ae18b9a2e019e51a8e0bf.zip
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).
Diffstat (limited to 'include')
-rw-r--r--include/unistd.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/unistd.h b/include/unistd.h
index 0ad2983280..5014e2e772 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;