Description: partially reverts "3714 Implement pipe2()" This keeps pipe() to call real syscall, not pipe2. So new libc will work on older kernel. Index: b/usr/src/lib/libc/port/gen/pipe.c =================================================================== --- a/usr/src/lib/libc/port/gen/pipe.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2013 OmniTI Computer Consulting, Inc. All rights reserved. - */ - -#pragma weak _pipe = pipe - -#include "lint.h" -#include - -int -pipe(int *fds) -{ - return (pipe2(fds, 0)); -} Index: b/usr/src/lib/libc/amd64/sys/pipe.s =================================================================== --- /dev/null +++ b/usr/src/lib/libc/amd64/sys/pipe.s @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + .file "pipe.s" + +#include + + ANSI_PRAGMA_WEAK(pipe,function) + +#include "SYS.h" + + ENTRY(pipe) + pushq %rdi /* preserve the pointer */ + SYSTRAP_2RVALS(pipe) + popq %rdi + SYSCERROR + movl %eax, (%rdi) + movl %edx, 4(%rdi) + RETC + SET_SIZE(pipe) Index: b/usr/src/lib/libc/i386/sys/pipe.s =================================================================== --- /dev/null +++ b/usr/src/lib/libc/i386/sys/pipe.s @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + .file "pipe.s" + +#include + + ANSI_PRAGMA_WEAK(pipe,function) + +#include "SYS.h" + + ENTRY(pipe) + SYSTRAP_2RVALS(pipe) + SYSCERROR + movl 4(%esp), %ecx + movl %eax, (%ecx) + movl %edx, 4(%ecx) + RETC + SET_SIZE(pipe) Index: b/usr/src/lib/libc/sparc/sys/pipe.s =================================================================== --- /dev/null +++ b/usr/src/lib/libc/sparc/sys/pipe.s @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* Copyright (c) 1988 AT&T */ +/* All Rights Reserved */ + + +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + .ident "%Z%%M% %I% %E% SMI" + +/* C library -- pipe */ +/* int pipe (int fildes[2]); */ + + .file "pipe.s" + +#include + + ANSI_PRAGMA_WEAK(pipe,function) + +#include "SYS.h" + + ENTRY(pipe) + mov %o0, %o2 /* save ptr to array */ + SYSTRAP_2RVALS(pipe) + SYSCERROR + st %o0, [%o2] + st %o1, [%o2 + 4] + RETC + + SET_SIZE(pipe) Index: b/usr/src/lib/libc/amd64/Makefile =================================================================== --- a/usr/src/lib/libc/amd64/Makefile +++ b/usr/src/lib/libc/amd64/Makefile @@ -296,6 +296,7 @@ SYSOBJS= \ gettimeofday.o \ lwp_private.o \ nuname.o \ + pipe.o \ syscall.o \ sysi86.o \ tls_get_addr.o \ @@ -491,7 +492,6 @@ PORTGEN= \ pfmt.o \ pfmt_data.o \ pfmt_print.o \ - pipe.o \ plock.o \ poll.o \ posix_fadvise.o \ Index: b/usr/src/lib/libc/i386/Makefile.com =================================================================== --- a/usr/src/lib/libc/i386/Makefile.com +++ b/usr/src/lib/libc/i386/Makefile.com @@ -319,6 +319,7 @@ SYSOBJS= \ gettimeofday.o \ lwp_private.o \ nuname.o \ + pipe.o \ ptrace.o \ syscall.o \ sysi86.o \ @@ -524,7 +525,6 @@ PORTGEN= \ pfmt.o \ pfmt_data.o \ pfmt_print.o \ - pipe.o \ plock.o \ poll.o \ posix_fadvise.o \ Index: b/usr/src/lib/libc/common/sys/pipe2.s =================================================================== --- a/usr/src/lib/libc/common/sys/pipe2.s +++ b/usr/src/lib/libc/common/sys/pipe2.s @@ -27,6 +27,6 @@ .file "pipe2.s" - SYSCALL2(pipe2,pipe); + SYSCALL2(pipe2,pipe2); RET SET_SIZE(pipe2)