| OLD | NEW |
| 1 #include "stdio_impl.h" | 1 #include "stdio_impl.h" |
| 2 #include <fcntl.h> | 2 #include <fcntl.h> |
| 3 #include <string.h> | 3 #include <string.h> |
| 4 #include <errno.h> | 4 #include <errno.h> |
| 5 | 5 |
| 6 FILE* fopen(const char* restrict filename, const char* restrict mode) { | 6 FILE* fopen(const char* restrict filename, const char* restrict mode) { |
| 7 FILE* f; | 7 FILE* f; |
| 8 int fd; | 8 int fd; |
| 9 int flags; | 9 int flags; |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 if (flags & O_CLOEXEC) | 23 if (flags & O_CLOEXEC) |
| 24 __syscall(SYS_fcntl, fd, F_SETFD, FD_CLOEXEC); | 24 __syscall(SYS_fcntl, fd, F_SETFD, FD_CLOEXEC); |
| 25 | 25 |
| 26 f = __fdopen(fd, mode); | 26 f = __fdopen(fd, mode); |
| 27 if (f) | 27 if (f) |
| 28 return f; | 28 return f; |
| 29 | 29 |
| 30 __syscall(SYS_close, fd); | 30 __syscall(SYS_close, fd); |
| 31 return 0; | 31 return 0; |
| 32 } | 32 } |
| 33 | |
| 34 LFS64(fopen); | |
| OLD | NEW |