Module Name: src Committed By: kamil Date: Tue Dec 26 08:30:58 UTC 2017
Modified Files: src/sys/compat/linux/arch/alpha: linux_pipe.c src/sys/compat/linux/common: linux_pipe.c src/sys/compat/linux32/common: linux32_unistd.c src/sys/compat/netbsd32: netbsd32_netbsd.c src/sys/kern: sys_descrip.c sys_pipe.c uipc_syscalls.c src/sys/sys: filedesc.h Log Message: Refactor pipe1() and correct a bug in sys_pipe2() (SYS_pipe2) sys_pipe2() returns two integers (values), the 2nd one is a copy of the 2nd file descriptor that lands in fildes[2]. This is a side effect of reusing the code for sys_pipe() (SYS_pipe) and not cleaning it up. The first returned value is (on success) 0. Introduced a small refactoring in pipe1() that it does not operate over retval[], but on an array int[2]. A user sets retval[] for pipe() when desired and needed. This refactoring touches compat code: netbsd32, linux, linux32. Before the changes on NetBSD/amd64: $ ktruss -i ./a.out [...] 15131 1 a.out pipe2(0x7f7fff2e62b8, 0) = 0, 4 [...] After the changes: $ ktruss -i ./a.out [...] 782 1 a.out pipe2(0x7f7fff97e850, 0) = 0 [...] There should not be a visible change for current users. Sponsored by <The NetBSD Foundation> To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/compat/linux/arch/alpha/linux_pipe.c cvs rdiff -u -r1.67 -r1.68 src/sys/compat/linux/common/linux_pipe.c cvs rdiff -u -r1.39 -r1.40 src/sys/compat/linux32/common/linux32_unistd.c cvs rdiff -u -r1.211 -r1.212 src/sys/compat/netbsd32/netbsd32_netbsd.c cvs rdiff -u -r1.30 -r1.31 src/sys/kern/sys_descrip.c cvs rdiff -u -r1.142 -r1.143 src/sys/kern/sys_pipe.c cvs rdiff -u -r1.187 -r1.188 src/sys/kern/uipc_syscalls.c cvs rdiff -u -r1.63 -r1.64 src/sys/sys/filedesc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.