about summary refs log tree commit diff
path: root/src/stdio/fopen.c
Commit message (Collapse)AuthorAgeFilesLines
* clean up stdio_impl.hRich Felker2012-11-081-0/+3
| | | | | | | | | | | this header evolved to facilitate the extremely lazy practice of omitting explicit includes of the necessary headers in individual stdio source files; not only was this sloppy, but it also increased build time. now, stdio_impl.h is only including the headers it needs for its own use; any further headers needed by source files are included directly where needed.
* greatly improve freopen behaviorRich Felker2012-10-241-8/+1
| | | | | | | | | | | | | 1. don't open /dev/null just as a basis to copy flags; use shared __fmodeflags function to get the right file flags for the mode. 2. handle the case (probably invalid, but whatever) case where the original stream's file descriptor was closed; previously, the logic re-closed it. 3. accept the "e" mode flag for close-on-exec; update dup3 to fallback to using dup2 so we can simply call __dup3 instead of putting fallback logic in freopen itself.
* add 'e' modifier (close-on-exec) to fopen and fdopenRich Felker2012-09-291-0/+1
| | | | | | this feature will be in the next version of POSIX, and can be used internally immediately. there are many internal uses of fopen where close-on-exec is needed to fix bugs.
* use restrict everywhere it's required by c99 and/or posix 2008Rich Felker2012-09-061-1/+1
| | | | | | | | to deal with the fact that the public headers may be used with pre-c99 compilers, __restrict is used in place of restrict, and defined appropriately for any supported compiler. we also avoid the form [restrict] since older versions of gcc rejected it due to a bug in the original c99 standard, and instead use the form *restrict.
* implement "low hanging fruit" from C11Rich Felker2012-08-251-2/+2
| | | | | | | | based on Gregor's patch sent to the list. includes: - stdalign.h - removing gets in C11 mode - adding aligned_alloc and adjusting other functions to use it - adding 'x' flag to fopen for exclusive mode
* make stdio open, read, and write operations cancellation pointsRich Felker2012-02-021-1/+1
| | | | | | | | | | it should be noted that only the actual underlying buffer flush and fill operations are cancellable, not reads from or writes to the buffer. this behavior is compatible with POSIX, which makes all cancellation points in stdio optional, and it achieves the goal of allowing cancellation of a thread that's "stuck" on IO (due to a non-responsive socket/pipe peer, slow/stuck hardware, etc.) without imposing any measurable performance cost.
* debloat: use __syscall instead of syscall where possibleRich Felker2011-04-171-1/+1
| | | | | | don't waste time (and significant code size due to function call overhead!) setting errno when the result of a syscall does not matter or when it can't fail.
* global cleanup to use the new syscall interfaceRich Felker2011-03-201-2/+2
|
* initial check-in, version 0.5.0 v0.5.0Rich Felker2011-02-121-0/+34