X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Ffopen.c;h=e1b91e12d826357fd5058b913ba75b386be8a606;hb=59b64ff686cef2a87e9552658b2c8d2531f87176;hp=c741aede152d55e076fb564ba6320a6918d65e5d;hpb=892cafff665b44d238e3b664f61ca38dd965cba6;p=musl diff --git a/src/stdio/fopen.c b/src/stdio/fopen.c index c741aede..e1b91e12 100644 --- a/src/stdio/fopen.c +++ b/src/stdio/fopen.c @@ -1,4 +1,7 @@ #include "stdio_impl.h" +#include +#include +#include FILE *fopen(const char *restrict filename, const char *restrict mode) { @@ -15,8 +18,10 @@ FILE *fopen(const char *restrict filename, const char *restrict mode) /* Compute the flags to pass to open() */ flags = __fmodeflags(mode); - fd = syscall_cp(SYS_open, filename, flags|O_LARGEFILE, 0666); + fd = sys_open(filename, flags, 0666); if (fd < 0) return 0; + if (flags & O_CLOEXEC) + __syscall(SYS_fcntl, fd, F_SETFD, FD_CLOEXEC); f = __fdopen(fd, mode); if (f) return f; @@ -25,4 +30,4 @@ FILE *fopen(const char *restrict filename, const char *restrict mode) return 0; } -LFS64(fopen); +weak_alias(fopen, fopen64);