From 82fd76bb0676ba935bb6bc015fe5920a44ef6dcd Mon Sep 17 00:00:00 2001 From: kleink Date: Thu, 28 Sep 2000 08:38:53 +0000 Subject: [PATCH] Need an internal name for pipe(2). --- lib/libc/arch/alpha/sys/pipe.S | 9 ++++-- lib/libc/arch/arm26/sys/pipe.S | 8 ++++-- lib/libc/arch/arm32/sys/pipe.S | 8 ++++-- lib/libc/arch/i386/sys/pipe.S | 10 +++++-- lib/libc/arch/m68k/sys/pipe.S | 10 +++++-- lib/libc/arch/mips/sys/pipe.S | 10 +++++-- lib/libc/arch/ns32k/sys/pipe.S | 6 ++-- lib/libc/arch/powerpc/sys/pipe.S | 8 ++++-- lib/libc/arch/sh3/sys/pipe.S | 10 +++++-- lib/libc/arch/sparc/sys/pipe.S | 10 +++++-- lib/libc/arch/sparc64/sys/pipe.S | 10 +++++-- lib/libc/arch/vax/sys/pipe.S | 8 ++++-- lib/libc/include/namespace.h | 3 +- lib/libc/sys/Makefile.inc | 4 +-- lib/libc/sys/_pipe.c | 47 ++++++++++++++++++++++++++++++++ 15 files changed, 127 insertions(+), 34 deletions(-) create mode 100644 lib/libc/sys/_pipe.c diff --git a/lib/libc/arch/alpha/sys/pipe.S b/lib/libc/arch/alpha/sys/pipe.S index c9a5eff4f7eb..38468f04c3a0 100644 --- a/lib/libc/arch/alpha/sys/pipe.S +++ b/lib/libc/arch/alpha/sys/pipe.S @@ -1,4 +1,4 @@ -/* $NetBSD: pipe.S,v 1.2 2000/06/14 06:49:03 cgd Exp $ */ +/* $NetBSD: pipe.S,v 1.3 2000/09/28 08:38:53 kleink Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -29,7 +29,12 @@ #include "SYS.h" -SYSCALL(pipe) +#ifdef WEAK_ALIAS +WEAK_ALIAS(pipe, _pipe) +#endif + +LEAF(_pipe, 0) + CALLSYS_ERROR(pipe) stl v0, 0(a0) stl a4, 4(a0) mov zero, v0 diff --git a/lib/libc/arch/arm26/sys/pipe.S b/lib/libc/arch/arm26/sys/pipe.S index 5499c13ffa1f..625ed53059c1 100644 --- a/lib/libc/arch/arm26/sys/pipe.S +++ b/lib/libc/arch/arm26/sys/pipe.S @@ -1,4 +1,4 @@ -/* $NetBSD: pipe.S,v 1.1 2000/05/09 21:55:51 bjh21 Exp $ */ +/* $NetBSD: pipe.S,v 1.2 2000/09/28 08:38:54 kleink Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -37,7 +37,11 @@ #include "SYS.h" -ENTRY(pipe) +#ifdef WEAK_ALIAS +WEAK_ALIAS(pipe, _pipe) +#endif + +ENTRY(_pipe) mov r2, r0 swi SYS_pipe bcs cerror diff --git a/lib/libc/arch/arm32/sys/pipe.S b/lib/libc/arch/arm32/sys/pipe.S index ffeb42c4eba0..2e956024ff12 100644 --- a/lib/libc/arch/arm32/sys/pipe.S +++ b/lib/libc/arch/arm32/sys/pipe.S @@ -1,4 +1,4 @@ -/* $NetBSD: pipe.S,v 1.3 1997/10/06 00:07:14 mark Exp $ */ +/* $NetBSD: pipe.S,v 1.4 2000/09/28 08:38:54 kleink Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -37,7 +37,11 @@ #include "SYS.h" -ENTRY(pipe) +#ifdef WEAK_ALIAS +WEAK_ALIAS(pipe, _pipe) +#endif + +ENTRY(_pipe) mov r2, r0 swi SYS_pipe bcs cerror diff --git a/lib/libc/arch/i386/sys/pipe.S b/lib/libc/arch/i386/sys/pipe.S index a6477ff2497c..45f6a62075be 100644 --- a/lib/libc/arch/i386/sys/pipe.S +++ b/lib/libc/arch/i386/sys/pipe.S @@ -1,4 +1,4 @@ -/* $NetBSD: pipe.S,v 1.4 1997/07/16 14:37:30 christos Exp $ */ +/* $NetBSD: pipe.S,v 1.5 2000/09/28 08:38:54 kleink Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -40,12 +40,16 @@ #include #if defined(SYSLIBC_SCCS) && !defined(lint) - RCSID("$NetBSD: pipe.S,v 1.4 1997/07/16 14:37:30 christos Exp $") + RCSID("$NetBSD: pipe.S,v 1.5 2000/09/28 08:38:54 kleink Exp $") #endif /* SYSLIBC_SCCS and not lint */ #include "SYS.h" -SYSCALL(pipe) +#ifdef WEAK_ALIAS +WEAK_ALIAS(pipe, _pipe) +#endif + +_SYSCALL(_pipe,pipe) movl 4(%esp),%ecx movl %eax,(%ecx) movl %edx,4(%ecx) diff --git a/lib/libc/arch/m68k/sys/pipe.S b/lib/libc/arch/m68k/sys/pipe.S index bf1f772fc84f..b4da6598beff 100644 --- a/lib/libc/arch/m68k/sys/pipe.S +++ b/lib/libc/arch/m68k/sys/pipe.S @@ -1,4 +1,4 @@ -/* $NetBSD: pipe.S,v 1.3 1999/10/25 23:48:17 thorpej Exp $ */ +/* $NetBSD: pipe.S,v 1.4 2000/09/28 08:38:54 kleink Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -43,11 +43,15 @@ #if 0 RCSID("from: @(#)pipe.s 5.1 (Berkeley) 5/12/90") #else - RCSID("$NetBSD: pipe.S,v 1.3 1999/10/25 23:48:17 thorpej Exp $") + RCSID("$NetBSD: pipe.S,v 1.4 2000/09/28 08:38:54 kleink Exp $") #endif #endif /* LIBC_SCCS and not lint */ -SYSCALL(pipe) +#ifdef WEAK_ALIAS +WEAK_ALIAS(pipe, _pipe) +#endif + +_SYSCALL(_pipe, pipe) movl %sp@(4),%a0 movl %d0,%a0@+ movl %d1,%a0@ diff --git a/lib/libc/arch/mips/sys/pipe.S b/lib/libc/arch/mips/sys/pipe.S index 47ee342cfa2e..d1780650658e 100644 --- a/lib/libc/arch/mips/sys/pipe.S +++ b/lib/libc/arch/mips/sys/pipe.S @@ -1,4 +1,4 @@ -/* $NetBSD: pipe.S,v 1.6 1999/01/14 22:48:21 kleink Exp $ */ +/* $NetBSD: pipe.S,v 1.7 2000/09/28 08:38:54 kleink Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -40,14 +40,18 @@ #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)pipe.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: pipe.S,v 1.6 1999/01/14 22:48:21 kleink Exp $") + ASMSTR("$NetBSD: pipe.S,v 1.7 2000/09/28 08:38:54 kleink Exp $") #endif /* LIBC_SCCS and not lint */ #ifdef ABICALLS .abicalls #endif -LEAF(pipe) +#ifdef WEAK_ALIAS +WEAK_ALIAS(pipe, _pipe) +#endif + +LEAF(_pipe) #ifdef ABICALLS .set noreorder .cpload t9 diff --git a/lib/libc/arch/ns32k/sys/pipe.S b/lib/libc/arch/ns32k/sys/pipe.S index a8b657671bbe..3e075c9c598f 100644 --- a/lib/libc/arch/ns32k/sys/pipe.S +++ b/lib/libc/arch/ns32k/sys/pipe.S @@ -1,4 +1,4 @@ -/* $NetBSD: pipe.S,v 1.3 1997/05/08 13:39:05 matthias Exp $ */ +/* $NetBSD: pipe.S,v 1.4 2000/09/28 08:38:54 kleink Exp $ */ /* * Copyright (c) 1992 Helsinki University of Technology @@ -24,10 +24,10 @@ #include "SYS.h" #if defined(LIBC_SCCS) - RCSID("$NetBSD: pipe.S,v 1.3 1997/05/08 13:39:05 matthias Exp $") + RCSID("$NetBSD: pipe.S,v 1.4 2000/09/28 08:38:54 kleink Exp $") #endif -SYSCALL(pipe) +_SYSCALL(pipe,_pipe) movd S_ARG0,r2 movd r0,0(r2) movd r1,4(r2) diff --git a/lib/libc/arch/powerpc/sys/pipe.S b/lib/libc/arch/powerpc/sys/pipe.S index 7e8afc8e7a80..423da09f22d1 100644 --- a/lib/libc/arch/powerpc/sys/pipe.S +++ b/lib/libc/arch/powerpc/sys/pipe.S @@ -1,8 +1,12 @@ -/* $NetBSD: pipe.S,v 1.5 1999/01/14 22:48:21 kleink Exp $ */ +/* $NetBSD: pipe.S,v 1.6 2000/09/28 08:38:54 kleink Exp $ */ #include "SYS.h" -ENTRY(pipe) +#ifdef WEAK_ALIAS +WEAK_ALIAS(pipe, _pipe) +#endif + +ENTRY(_pipe) mr 5,3 # save pointer li 0,SYS_pipe sc # assume, that r5 is kept diff --git a/lib/libc/arch/sh3/sys/pipe.S b/lib/libc/arch/sh3/sys/pipe.S index baa11fab2140..3ebd78c12057 100644 --- a/lib/libc/arch/sh3/sys/pipe.S +++ b/lib/libc/arch/sh3/sys/pipe.S @@ -1,4 +1,4 @@ -/* $NetBSD: pipe.S,v 1.2 2000/03/27 16:27:16 msaitoh Exp $ */ +/* $NetBSD: pipe.S,v 1.3 2000/09/28 08:38:55 kleink Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -40,12 +40,16 @@ #include #if defined(SYSLIBC_SCCS) && !defined(lint) - RCSID("$NetBSD: pipe.S,v 1.2 2000/03/27 16:27:16 msaitoh Exp $") + RCSID("$NetBSD: pipe.S,v 1.3 2000/09/28 08:38:55 kleink Exp $") #endif /* SYSLIBC_SCCS and not lint */ #include "SYS.h" -SYSCALL(pipe) +#ifdef WEAK_ALIAS +WEAK_ALIAS(pipe, _pipe) +#endif + +_SYSCALL(_pipe,pipe) mov r4, r2 mov.l r0, @r2 mov.l r1, @(4,r2) diff --git a/lib/libc/arch/sparc/sys/pipe.S b/lib/libc/arch/sparc/sys/pipe.S index b07d97c4f443..bb679f224463 100644 --- a/lib/libc/arch/sparc/sys/pipe.S +++ b/lib/libc/arch/sparc/sys/pipe.S @@ -1,4 +1,4 @@ -/* $NetBSD: pipe.S,v 1.2 1997/07/16 14:37:58 christos Exp $ */ +/* $NetBSD: pipe.S,v 1.3 2000/09/28 08:38:55 kleink Exp $ */ /* * Copyright (c) 1992, 1993 @@ -44,13 +44,17 @@ #if 0 .asciz "@(#)pipe.s 8.1 (Berkeley) 6/4/93" #else - RCSID("$NetBSD: pipe.S,v 1.2 1997/07/16 14:37:58 christos Exp $") + RCSID("$NetBSD: pipe.S,v 1.3 2000/09/28 08:38:55 kleink Exp $") #endif #endif /* SYSLIBC_SCCS and not lint */ #include "SYS.h" -ENTRY(pipe) +#ifdef WEAK_ALIAS +WEAK_ALIAS(pipe, _pipe) +#endif + +ENTRY(_pipe) mov %o0, %o2 ! save pointer mov SYS_pipe, %g1 t ST_SYSCALL ! pipe() diff --git a/lib/libc/arch/sparc64/sys/pipe.S b/lib/libc/arch/sparc64/sys/pipe.S index e5287864edaf..5dcc577b0d94 100644 --- a/lib/libc/arch/sparc64/sys/pipe.S +++ b/lib/libc/arch/sparc64/sys/pipe.S @@ -1,4 +1,4 @@ -/* $NetBSD: pipe.S,v 1.2 2000/07/25 15:14:46 mycroft Exp $ */ +/* $NetBSD: pipe.S,v 1.3 2000/09/28 08:38:55 kleink Exp $ */ /* * Copyright (c) 1992, 1993 @@ -44,13 +44,17 @@ #if 0 .asciz "@(#)pipe.s 8.1 (Berkeley) 6/4/93" #else - RCSID("$NetBSD: pipe.S,v 1.2 2000/07/25 15:14:46 mycroft Exp $") + RCSID("$NetBSD: pipe.S,v 1.3 2000/09/28 08:38:55 kleink Exp $") #endif #endif /* SYSLIBC_SCCS and not lint */ #include "SYS.h" -ENTRY(pipe) +#ifdef WEAK_ALIAS +WEAK_ALIAS(pipe, _pipe) +#endif + +ENTRY(_pipe) mov %o0, %o2 /* save pointer */ mov SYS_pipe, %g1 t ST_SYSCALL /* pipe() */ diff --git a/lib/libc/arch/vax/sys/pipe.S b/lib/libc/arch/vax/sys/pipe.S index 4e9018f8a10b..75f71c3f0810 100644 --- a/lib/libc/arch/vax/sys/pipe.S +++ b/lib/libc/arch/vax/sys/pipe.S @@ -33,12 +33,16 @@ #if defined(SYSLIBC_SCCS) && !defined(lint) /* .asciz "@(#)pipe.s 8.1 (Berkeley) 6/4/93" */ - .asciz "$NetBSD: pipe.S,v 1.1 1995/04/17 12:24:02 ragge Exp $" + .asciz "$NetBSD: pipe.S,v 1.2 2000/09/28 08:38:55 kleink Exp $" #endif /* SYSLIBC_SCCS and not lint */ #include "SYS.h" -SYSCALL(pipe) +#ifdef WEAK_ALIAS +WEAK_ALIAS(pipe, _pipe) +#endif + +_SYSCALL(_pipe,pipe) movl 4(ap),r2 movl r0,(r2)+ movl r1,(r2) diff --git a/lib/libc/include/namespace.h b/lib/libc/include/namespace.h index 9d47f04ff165..28c50868940f 100644 --- a/lib/libc/include/namespace.h +++ b/lib/libc/include/namespace.h @@ -1,4 +1,4 @@ -/* $NetBSD: namespace.h,v 1.57 2000/07/08 13:46:34 kleink Exp $ */ +/* $NetBSD: namespace.h,v 1.58 2000/09/28 08:38:55 kleink Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -49,6 +49,7 @@ #define ftello _ftello #define inet_aton _inet_aton #define inet_pton _inet_pton +#define pipe _pipe #define sbrk _sbrk #define strtoll _strtoll #define strtoull _strtoull diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 46bfc09fde06..8ee121c22904 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.106 2000/07/08 00:53:39 enami Exp $ +# $NetBSD: Makefile.inc,v 1.107 2000/09/28 08:38:55 kleink Exp $ # @(#)Makefile.inc 8.3 (Berkeley) 10/24/94 # sys sources @@ -36,7 +36,7 @@ SRCS+= timer_create.c timer_delete.c timer_gettime.c timer_settime.c \ timer_getoverrun.c # namespace purity wrappers -SRCS+= _brk.c _fork.c _sbrk.c +SRCS+= _brk.c _fork.c _pipe.c _sbrk.c # modules with default implementations on all architectures: ASM= accept.o access.o acct.o adjtime.o bind.o chdir.o chflags.o \ diff --git a/lib/libc/sys/_pipe.c b/lib/libc/sys/_pipe.c new file mode 100644 index 000000000000..1bebe0c24c99 --- /dev/null +++ b/lib/libc/sys/_pipe.c @@ -0,0 +1,47 @@ +/* $NetBSD: _pipe.c,v 1.1 2000/09/28 08:38:55 kleink Exp $ */ + +/* + * Copyright (c) 1996 Christos Zoulas. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Christos Zoulas. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include + +#ifdef __indr_reference +__indr_reference(_pipe, pipe) +#else + +#include +int _pipe __P((int *)); /* XXX */ + +int +pipe(fildes) + int *fildes; +{ + + return _pipe(fildes); +} +#endif