X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Ffopen.c;h=e1b91e12d826357fd5058b913ba75b386be8a606;hb=e1a51185ceb4386481491e11f6dd39569b9e54f7;hp=da17ce8b48dc431d6aa70539bbb136841e8f727d;hpb=c6d441e3a246370d9c459396ec22b096db93850e;p=musl diff --git a/src/stdio/fopen.c b/src/stdio/fopen.c index da17ce8b..e1b91e12 100644 --- a/src/stdio/fopen.c +++ b/src/stdio/fopen.c @@ -18,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; @@ -28,4 +30,4 @@ FILE *fopen(const char *restrict filename, const char *restrict mode) return 0; } -LFS64(fopen); +weak_alias(fopen, fopen64);