From 4ef9b828c1f39553a69e0635ac91f0fcadd6e8c6 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 13 Jun 2015 20:53:02 +0000 Subject: 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. --- src/stdio/fopen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/stdio/fopen.c') 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); -- cgit v1.2.1