1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

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).
This commit is contained in:
Ulrich Drepper
2011-05-15 15:28:46 -04:00
parent bd25564e1e
commit 94b7cc3711
9 changed files with 143 additions and 39 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2008 Free Software Foundation, Inc.
/* Copyright (C) 2008, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -43,6 +43,7 @@ dup3 (fd, fd2, flags)
__set_errno (ENOSYS);
return -1;
}
libc_hidden_def (dup3)
stub_warning (dup3)
#include <stub-tag.h>