diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r-- | sysdeps/unix/sysv/linux/alpha/brk.S | 17 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/netinet/in_systm.h | 42 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/poll.c | 52 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/syscalls.list | 1 |
4 files changed, 104 insertions, 8 deletions
diff --git a/sysdeps/unix/sysv/linux/alpha/brk.S b/sysdeps/unix/sysv/linux/alpha/brk.S index 3d9f6dca5f..f44686b9a4 100644 --- a/sysdeps/unix/sysv/linux/alpha/brk.S +++ b/sysdeps/unix/sysv/linux/alpha/brk.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Brendan Kehoe <brendan@zen.org>, 1993. @@ -50,20 +50,23 @@ LEAF(__brk, 0) ldiq v0, __NR_brk call_pal PAL_callsys + /* Be prepared for an OSF-style brk. */ + bne a3, $err1 + beq v0, $ok + /* Correctly handle the brk(0) query case. */ cmoveq a0, v0, a0 - - subq a0, v0, t0 - bne t0, error + xor a0, v0, t0 + bne t0, $err0 /* Update __curbrk and return cleanly. */ - stq a0, __curbrk mov zero, v0 +$ok: stq a0, __curbrk ret /* What a horrible way to die. */ -error: ldi v0, ENOMEM - jmp zero, __syscall_error +$err0: ldi v0, ENOMEM +$err1: jmp zero, __syscall_error END(__brk) diff --git a/sysdeps/unix/sysv/linux/netinet/in_systm.h b/sysdeps/unix/sysv/linux/netinet/in_systm.h index f481c5511a..902fe6ea0e 100644 --- a/sysdeps/unix/sysv/linux/netinet/in_systm.h +++ b/sysdeps/unix/sysv/linux/netinet/in_systm.h @@ -1 +1,41 @@ -#include <linux/in_systm.h> +/* System specific type definitions for networking code. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _NETINET_IN_SYSTM_H +#define _NETINET_IN_SYSTM_H 1 + +#include <sys/cdefs.h> +#include <sys/types.h> + +__BEGIN_DECLS + +/* + * Network order versions of various data types. Unfortunately, BSD + * assumes specific sizes for shorts (16 bit) and longs (32 bit) which + * don't hold in general. As a consequence, the network order versions + * may not reflect the actual size of the native data types. + */ + +typedef u_int16_t n_short; /* short as received from the net */ +typedef u_int32_t n_long; /* long as received from the net */ +typedef u_int32_t n_time; /* ms since 00:00 GMT, byte rev */ + +__END_DECLS + +#endif /* netinet/in_systm.h */ diff --git a/sysdeps/unix/sysv/linux/poll.c b/sysdeps/unix/sysv/linux/poll.c index 198819970a..337b85005f 100644 --- a/sysdeps/unix/sysv/linux/poll.c +++ b/sysdeps/unix/sysv/linux/poll.c @@ -1 +1,53 @@ +/* Poll system call, with emulation if it is not available. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include <errno.h> +#include <sys/poll.h> + +extern int __syscall_poll __P ((struct pollfd *fds, unsigned int nfds, + int timeout)); +extern int __emulate_poll __P ((struct pollfd *fds, unsigned long int nfds, + int timeout)); + +/* The real implementation. */ +int +poll (fds, nfds, timeout) + struct pollfd *fds; + unsigned long int nfds; + int timeout; +{ + static int must_emulate = 0; + + if (!must_emulate) + { + int retval = __syscall_poll (fds, nfds, timeout); + + if (retval >= 0 || errno != ENOSYS) + return retval; + + must_emulate = 1; + } + + return __emulate_poll (fds, nfds, timeout); +} + + +/* Get the emulation code. */ +#define poll(fds, nfds, timeout) __emulate_poll (fds, nfds, timeout) #include <sysdeps/unix/bsd/poll.c> diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index 20ac94ae26..867e3bce3e 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -30,6 +30,7 @@ nanosleep - nanosleep 2 __libc_nanosleep __nanosleep nanosleep pause - pause 0 __libc_pause pause personality init-first personality 1 __personality personality pipe - pipe 1 __pipe pipe +s_poll EXTRA poll 3 __syscall_poll query_module EXTRA query_module 5 query_module s_getdents EXTRA getdents 3 __getdents s_getpriority getpriority getpriority 2 __syscall_getpriority |