musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/stdio/fopen.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015年06月13日 20:53:02 +0000
committerRich Felker <dalias@aerifal.cx>2015年06月13日 20:53:02 +0000
commit4ef9b828c1f39553a69e0635ac91f0fcadd6e8c6 (patch)
tree4f673b8ddbae50ca7072b600466051c347df1fc2 /src/stdio/fopen.c
parent536c6d5a4205e2a3f161f2983ce1e0ac3082187d (diff)
downloadmusl-4ef9b828c1f39553a69e0635ac91f0fcadd6e8c6.tar.gz
remove cancellation points in stdio
commit 58165923890865a6ac042fafce13f440ee986fd9 added these optional cancellation points on the basis that cancellable stdio could be useful, to unblock threads stuck on stdio operations that will never complete. however, the only way to ensure that cancellation can achieve this is to violate the rules for side effects when cancellation is acted upon, discarding knowledge of any partial data transfer already completed. our implementation exhibited this behavior and was thus non-conforming. in addition to improving correctness, removing these cancellation points moderately reduces code size, and should significantly improve performance on i386, where sysenter/syscall instructions can be used instead of "int 128ドル" for non-cancellable syscalls.
Diffstat (limited to 'src/stdio/fopen.c')
-rw-r--r--src/stdio/fopen.c 2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdio/fopen.c b/src/stdio/fopen.c
index 07bdb6e8..252f0824 100644
--- a/src/stdio/fopen.c
+++ b/src/stdio/fopen.c
@@ -18,7 +18,7 @@ FILE *fopen(const char *restrict filename, const char *restrict mode)
/* Compute the flags to pass to open() */
flags = __fmodeflags(mode);
- fd = sys_open_cp(filename, flags, 0666);
+ fd = sys_open(filename, flags, 0666);
if (fd < 0) return 0;
if (flags & O_CLOEXEC)
__syscall(SYS_fcntl, fd, F_SETFD, FD_CLOEXEC);
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月11日 23:35:50 +0000

AltStyle によって変換されたページ (->オリジナル) /