about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1996-10-17 01:51:38 +0000
committerUlrich Drepper <drepper@redhat.com>1996-10-17 01:51:38 +0000
commit0d204b0a522b9fef2168e1808a0566c9209d0893 (patch)
tree70ea6e1aec8f2cc5ab9b53f4ef15f24a9503fd5a /sysdeps/unix/sysv/linux
parentb207ff4bd88564215ef7c68e61ec46aa4cb461c1 (diff)
downloadglibc-0d204b0a522b9fef2168e1808a0566c9209d0893.tar.gz
glibc-0d204b0a522b9fef2168e1808a0566c9209d0893.tar.xz
glibc-0d204b0a522b9fef2168e1808a0566c9209d0893.zip
update from main archive 961016 cvs/libc-961019 cvs/libc-961018 cvs/libc-961017
Thu Oct 17 01:55:34 1996  Ulrich Drepper  <drepper@cygnus.com>

	* sunrpc/Makefile ($(objpfx)rpcsvc/%.h, $(objpfx)x%.c): Write
	output to $@T and move to $@ later since the new rpcgen will not
	overwrite existing files.

	* po/Makefile (libc.pot): Fix typo.

Sun Oct 13 20:52:07 1996  Thorsten Kukuk  <kukuk@weber.uni-paderborn.de>

	Update rpcgen program to TI-rpc code.
	* sunrpc/Makefile (rpcgen-objs): Add rpc_tblout.o and rpc_sample.o.
	(distribute): Add proto.h.
	* sunrpc/proto.h: New file.  Prototypes for all the RPC functions.
	* sunrpc/rpc_clntout.c: Change to allow generation of ISO C code.
	* sunrpc/rpc_cout.c: Likewise.
	* sunrpc/rpc_hout.c: Likewise.
	* sunrpc/rpc_main.c: Likewise.
	* sunrpc/rpc_parse.c: Likewise.
	* sunrpc/rpc_parse.h: Likewise.
	* sunrpc/rpc_scan.c: Likewise.
	* sunrpc/rpc_scan.h: Likewise.
	* sunrpc/rpc_svcout.c: Likewise.
	* sunrpc/rpc_util.c: Likewise.
	* sunrpc/rpc_util.h: Likewise.

	* sunrpc/rpc_tblout.c: New file.
	* sunrpc/rpc_sample.c: Likewise.

Thu Oct 17 00:26:20 1996  NIIBE Yutaka  <gniibe@mri.co.jp>

	* sysdeps/unix/opendir.c: Add semicolon for consistency.

Wed Oct 16 12:26:53 1996  Sven Verdoolaege  <skimo@breughel.ufsia.ac.be>

	* locale/progams/localedef.c (main): Test with -1 to find out
 	whether read failed.

Wed Oct 16 14:54:59 1996  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/i386/clone.S: Use JUMPTARGET and
 	PSEUDO_END macro.

Tue Oct 15 21:27:42 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/m68k/sigcontext.h: Removed.

Tue Oct 15 15:52:29 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/m68k/clone.S: Add CALL_MCOUNT.
	* sysdeps/unix/sysv/linux/m68k/mmap.S: Likewise.
	* sysdeps/unix/sysv/linux/m68k/sigreturn.S: Likewise.
	* sysdeps/unix/sysv/linux/m68k/socket.S: Likewise.
	* sysdeps/unix/sysv/linux/m68k/sysdep.S (__errno_location):
	Likewise.
	* sysdeps/unix/sysv/linux/m68k/syscall.S: Likewise.
	Correct generation of system call.

Tue Oct 15 15:13:16 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* Makerules (sysd-Makefile): Fix command so that it works in the
	subdirectories.
	(BUILD_CFLAGS): Change back using $(..) instead of
	$(common-objpfx), the latter fails in the toplevel directory when
	$(objdir) is relative.
	(common-objdir-compile): Run compiler in $(objdir).
	* sysdeps/posix/Makefile (mk-stdiolim): Likewise.

Tue Oct 15 23:39:48 1996  Ulrich Drepper  <drepper@cygnus.com>

	* string/string.h [__USE_SVID]: Add prototype for swab.
	* time/sys/time.h [__USE_BSD]: Add prototype for ualarm.
	Reported by Andreas Jaeger.

	The available nlist implementation is not generally usable.
  	Especially on the currently supported ELF systems the nlist
 	function comes with the libelf.
	* misc/Makefile (headers): Remove nlist.h.
	(routines): Remove nlist.

	* Makefile ($(objpfx)version-info.h): Include information about
	system the libc is built on in version-info.h file.

	* po/Makefile (distribute): Add header.pot.

Tue Oct 15 16:34:15 1996  Andreas Jaeger  <aj@arthur.pfalz.de>

	* sysdeps/unix/sysv/linux/sleep.c: Include file with prototype.
	* sysdeps/unix/sysv/linux/reboot.c: Likewise.
	* misc/error.c: Likewise.

Tue Oct 15 22:41:27 1996  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/syscalls.list: Add {get,set}resuid.

Tue Oct 15 08:06:02 1996  Andreas Jaeger  <aj@arthur.pfalz.de>

	* crypt/Makefiel (rpath-link): Extend search path to current directory.

Fri Oct 11 09:18:06 1996  Sven Verdoolaege  <skimo@breughel.ufsia.ac.be>

	* sysdeps/i386/i586/strlen.S: Correct handling of prolog for
	aligning pointer.

Tue Oct 15 02:13:21 1996  Ulrich Drepper  <drepper@cygnus.com>

	* stdio-common/vfprintf.c: Don't declare __flockfile as weak.

	* crypt/md5-crypt.c (md5_crypt_r): Add cast to prevent warning.

Sun Oct 13 19:16:10 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/m68k/sysdep.h (POUND): Macro removed,
	replaced by `&'.
	(PSEUDO_END): Provide definition to use .size directive.
	(PSEUDO): Don't interpret negative return values less than -128 as
	syscall error.
	* sysdeps/unix/sysv/linux/m68k/syscall.S (syscall): Likewise.

	* sysdeps/m68k/bsd-_setjmp.S: Use PSEUDO_END macro to provide
	.size directive.
	* sysdeps/m68k/bsd-setjmp.S: Likewise.
	* sysdeps/unix/sysv/linux/m68k/clone.S: Likewise.
	* sysdeps/unix/sysv/linux/m68k/mmap.S: Likewise.
	* sysdeps/unix/sysv/linux/m68k/sigreturn.S: Likewise.
	* sysdeps/unix/sysv/linux/m68k/socket.S: Likewise.
	* sysdeps/unix/sysv/linux/m68k/syscall.S: Likewise.
	* sysdeps/unix/sysv/linux/m68k/sysdep.S: Use PSEUDO_END instead of
	explicit .size directive.

	* libio/iogets.c: Warn when gets is used.
cd	* time/strptime.c: Recognize %s, %u, %g, and %G format.
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/i386/clone.S8
-rw-r--r--sysdeps/unix/sysv/linux/m68k/clone.S3
-rw-r--r--sysdeps/unix/sysv/linux/m68k/mmap.S2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sigcontext.h31
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sigreturn.S3
-rw-r--r--sysdeps/unix/sysv/linux/m68k/socket.S2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/syscall.S20
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sysdep.S9
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sysdep.h28
-rw-r--r--sysdeps/unix/sysv/linux/reboot.c2
-rw-r--r--sysdeps/unix/sysv/linux/sleep.c1
-rw-r--r--sysdeps/unix/sysv/linux/syscalls.list2
12 files changed, 53 insertions, 58 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/clone.S b/sysdeps/unix/sysv/linux/i386/clone.S
index 0742cc5f74..d213b80539 100644
--- a/sysdeps/unix/sysv/linux/i386/clone.S
+++ b/sysdeps/unix/sysv/linux/i386/clone.S
@@ -66,7 +66,7 @@ ENTRY(__clone)
 	jz	thread_start
 
 	ret
-	.size	__clone,.-__clone
+PSEUDO_END (__clone)
 
 	SYSCALL_ERROR_HANDLER
 
@@ -74,10 +74,6 @@ thread_start:
 	subl	%ebp,%ebp	/* terminate the stack frame */
 	call	*%ebx
 	pushl	%eax
-#ifdef PIC
-	call	_exit@PLT
-#else
-	call	_exit
-#endif
+	call	JUMPTARGET (_exit)
 
 weak_alias(__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/m68k/clone.S b/sysdeps/unix/sysv/linux/m68k/clone.S
index 07280031a5..4dcd90e96c 100644
--- a/sysdeps/unix/sysv/linux/m68k/clone.S
+++ b/sysdeps/unix/sysv/linux/m68k/clone.S
@@ -27,6 +27,8 @@ Cambridge, MA 02139, USA.  */
 
         .text
 ENTRY (__clone)
+	CALL_MCOUNT
+
 	/* Sanity check arguments.  */
 	movel	#-EINVAL, %d0
 	movel	4(%sp), %a0		/* no NULL function pointers */
@@ -72,5 +74,6 @@ thread_start:
 #else
 	jbsr	_exit
 #endif
+PSEUDO_END (__clone)
 
 weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/m68k/mmap.S b/sysdeps/unix/sysv/linux/m68k/mmap.S
index ed0480dfd7..9bac533d44 100644
--- a/sysdeps/unix/sysv/linux/m68k/mmap.S
+++ b/sysdeps/unix/sysv/linux/m68k/mmap.S
@@ -22,6 +22,7 @@ Cambridge, MA 02139, USA.  */
 	SYSCALL_ERROR_HANDLER
 
 ENTRY (__mmap)
+	CALL_MCOUNT
 
 	move.l #SYS_ify (mmap), %d0	/* System call number in %d0.  */
 
@@ -40,5 +41,6 @@ ENTRY (__mmap)
 	   mmap is declared to return a pointer.  */
 	move.l %d0, %a0
 	rts
+PSEUDO_END (__mmap)
 
 weak_alias (__mmap, mmap)
diff --git a/sysdeps/unix/sysv/linux/m68k/sigcontext.h b/sysdeps/unix/sysv/linux/m68k/sigcontext.h
deleted file mode 100644
index 585b47993a..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/sigcontext.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Structure describing state saved while handling a signal.  Linux/m68k version.
-Copyright (C) 1996 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., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
-
-/* State of this thread when the signal was taken.  */
-struct sigcontext
-{
-  __sigset_t sc_mask;
-  unsigned long sc_usp;
-  unsigned long sc_d0;
-  unsigned long sc_d1;
-  unsigned long sc_a0;
-  unsigned long sc_a1;
-  unsigned short sc_sr;
-  unsigned long sc_pc;
-};
diff --git a/sysdeps/unix/sysv/linux/m68k/sigreturn.S b/sysdeps/unix/sysv/linux/m68k/sigreturn.S
index 7f6d643cb9..04f0db553c 100644
--- a/sysdeps/unix/sysv/linux/m68k/sigreturn.S
+++ b/sysdeps/unix/sysv/linux/m68k/sigreturn.S
@@ -20,9 +20,12 @@ Cambridge, MA 02139, USA.  */
 
 .text
 ENTRY (__sigreturn)
+	CALL_MCOUNT
+
 	addq.l #4, %sp		/* Pop the return PC.  */
 	DO_CALL (#SYS_ify (sigreturn), 0)
 				/* Do the system call; it never returns.  */
 	/* NOTREACHED */
+PSEUDO_END (__sigreturn)
 
 weak_alias (__sigreturn, sigreturn)
diff --git a/sysdeps/unix/sysv/linux/m68k/socket.S b/sysdeps/unix/sysv/linux/m68k/socket.S
index a85f41c334..1294287cce 100644
--- a/sysdeps/unix/sysv/linux/m68k/socket.S
+++ b/sysdeps/unix/sysv/linux/m68k/socket.S
@@ -35,6 +35,7 @@ Cambridge, MA 02139, USA.  */
 
 .globl P(__,socket)
 ENTRY (P(__,socket))
+	CALL_MCOUNT
 
 	/* Save registers.  */
 	move.l %d2, %a0
@@ -58,5 +59,6 @@ ENTRY (P(__,socket))
 
 	/* Successful; return the syscall's value.  */
 	rts
+PSEUDO_END (P(__,socket))
 
 weak_alias (P(__,socket), socket)
diff --git a/sysdeps/unix/sysv/linux/m68k/syscall.S b/sysdeps/unix/sysv/linux/m68k/syscall.S
index 2cc451c58b..1c7bd6bbd1 100644
--- a/sysdeps/unix/sysv/linux/m68k/syscall.S
+++ b/sysdeps/unix/sysv/linux/m68k/syscall.S
@@ -18,14 +18,20 @@ Cambridge, MA 02139, USA.  */
 
 #include <sysdep.h>
 
+/* Please consult the file sysdeps/unix/sysv/linux/m68k/sysdep.h for
+   more information about the value -128 used below.*/
+
 	.text
 	SYSCALL_ERROR_HANDLER
 ENTRY (syscall)
-	move.l (%sp)+, %a0	/* Pop return address.  */
-	DO_CALL ((%sp), 5)	/* Frob the args and do the system call.  */
-	tst.l %d0		/* Check %d0 for error.  */
-	jmi error		/* Jump to error handler if negative.  */
-	jmp (%a0)		/* Return to caller.  */
+	CALL_MCOUNT
 
-error:	pea (%a0)
-	jra syscall_error
+	move.l 4(%sp), %d0	/* Load syscall number.  */
+	_DOARGS_5 (24)		/* Frob arguments.  */
+	trap &0			/* Do the system call.  */
+	UNDOARGS_5		/* Unfrob arguments.  */
+	moveq.l &-128, %d1
+	cmp.l %d1, %d0		/* Check %d0 for error.  */
+	jcc syscall_error	/* Jump to error handler if negative.  */
+	rts			/* Return to caller.  */
+PSEUDO_END (syscall)
diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.S b/sysdeps/unix/sysv/linux/m68k/sysdep.S
index 407c2d393c..31fa20f55d 100644
--- a/sysdeps/unix/sysv/linux/m68k/sysdep.S
+++ b/sysdeps/unix/sysv/linux/m68k/sysdep.S
@@ -46,7 +46,7 @@ __errno = errno	/* This name is expected by the MT code.  */
 
 /* The syscall stubs jump here when they detect an error.  */
 
-ENTRY(__syscall_error)
+ENTRY (__syscall_error)
 	neg.l %d0
 	move.l %d0, errno
 #ifdef _LIBC_REENTRANT
@@ -59,14 +59,15 @@ ENTRY(__syscall_error)
 	   return a pointer.  */
 	move.l %d0, %a0
 	rts
-	.size	__syscall_error, . - __syscall_error
+PSEUDO_END (__syscall_error)
 #endif /* PIC */
 
-ERRNO(__errno_location)
+ENTRY (__errno_location)
+	CALL_MCOUNT
 #ifdef PIC
 	move.l	(%pc, errno@GOTPC), %a0
 #else
 	lea	errno, %a0
 #endif
 	rts
-	.size	__errno_location, . - __errno_location
+PSEUDO_END (__errno_location)
diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.h b/sysdeps/unix/sysv/linux/m68k/sysdep.h
index cfc9b04af0..9cddd20552 100644
--- a/sysdeps/unix/sysv/linux/m68k/sysdep.h
+++ b/sysdeps/unix/sysv/linux/m68k/sysdep.h
@@ -33,8 +33,6 @@ Cambridge, MA 02139, USA.  */
 
 #ifdef ASSEMBLER
 
-#define POUND #
-
 /* Define an entry point visible from C.  */
 #define	ENTRY(name)							      \
   .globl name;								      \
@@ -67,14 +65,26 @@ Cambridge, MA 02139, USA.  */
 #define	syscall_error	__syscall_error
 
 /* Linux uses a negative return value to indicate syscall errors, unlike
-   most Unices, which use the condition codes' carry flag.  */
+   most Unices, which use the condition codes' carry flag.
+
+   Since version 2.1 the return value of a system call might be negative
+   even if the call succeeded.  E.g., the `lseek' system call might return
+   a large offset.  Therefore we must not anymore test for < 0, but test
+   for a real error by making sure the value in %d0 is a real error
+   number.  For now (as of 2.1.1) 122 is the largest defined error number.
+   We allow for a bit of room for development and treat -128 to -1 as
+   error values.  */
 #define	PSEUDO(name, syscall_name, args)				      \
   .text;								      \
   SYSCALL_ERROR_HANDLER							      \
   ENTRY (name)								      \
-    DO_CALL (POUND SYS_ify (syscall_name), args);			      \
-    tst.l %d0;								      \
-    jmi syscall_error;
+    DO_CALL (&SYS_ify (syscall_name), args);				      \
+    moveq.l &-128, %d1;							      \
+    cmp.l %d1, %d0;							      \
+    jcc syscall_error
+
+#undef PSEUDO_END
+#define PSEUDO_END(name) .size name, . - name
 
 #ifdef PIC
 /* Store (- %d0) into errno through the GOT.  */
@@ -88,7 +98,7 @@ syscall_error:								      \
     move.l %d0, -(%sp);							      \
     jbsr __errno_location@PLTPC;					      \
     move.l (%sp)+, (%a0);						      \
-    move.l POUND -1, %d0;						      \
+    move.l &-1, %d0;							      \
     /* Copy return value to %a0 for syscalls that are declared to return      \
        a pointer (e.g., mmap).  */					      \
     move.l %d0, %a0;							      \
@@ -100,7 +110,7 @@ syscall_error:								      \
     move.l (errno@GOTPC, %pc), %a0;					      \
     neg.l %d0;								      \
     move.l %d0, (%a0);							      \
-    move.l POUND -1, %d0;						      \
+    move.l &-1, %d0;							      \
     /* Copy return value to %a0 for syscalls that are declared to return      \
        a pointer (e.g., mmap).  */					      \
     move.l %d0, %a0;							      \
@@ -138,7 +148,7 @@ syscall_error:								      \
 #define DO_CALL(syscall, args)				      		      \
     move.l syscall, %d0;						      \
     DOARGS_##args							      \
-    trap POUND 0;							      \
+    trap &0;								      \
     UNDOARGS_##args
 
 #define	DOARGS_0	/* No arguments to frob.  */
diff --git a/sysdeps/unix/sysv/linux/reboot.c b/sysdeps/unix/sysv/linux/reboot.c
index ecda522444..f1b915354e 100644
--- a/sysdeps/unix/sysv/linux/reboot.c
+++ b/sysdeps/unix/sysv/linux/reboot.c
@@ -16,7 +16,7 @@ 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 <unistd.h>
+#include <sys/reboot.h>
 
 extern int __syscall_reboot (int magic, int magic_too, int flag);
 
diff --git a/sysdeps/unix/sysv/linux/sleep.c b/sysdeps/unix/sysv/linux/sleep.c
index a4cf47bb0b..e669541eed 100644
--- a/sysdeps/unix/sysv/linux/sleep.c
+++ b/sysdeps/unix/sysv/linux/sleep.c
@@ -19,6 +19,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
 #include <time.h>
+#include <unistd.h>
 
 unsigned int
 sleep (unsigned int seconds)
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index 1dd2f4d7e7..d6165608a1 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -13,6 +13,7 @@ geteuid		-	geteuid		0	__geteuid	geteuid
 getpgid		-	getpgid		1	__getpgid	getpgid
 getpgrp		-	getpgrp		0	getpgrp
 getppid		-	getppid		0	__getppid	getppid
+getresuid	-	getresuid	3	getresuid
 getsid		-	getsid		1	getsid
 init_module	EXTRA	init_module	5	init_module
 ioperm		-	ioperm		3	ioperm
@@ -46,6 +47,7 @@ select		-	_newselect	5	__select	select
 setfsgid	EXTRA	setfsgid	1	setfsgid
 setfsuid	EXTRA	setfsuid	1	setfsuid
 setpgid		-	setpgid		2	__setpgid	setpgid
+setresuid	-	setresuid	3	setresuid
 sigpending	-	sigpending	1	sigpending
 sigprocmask	-	sigprocmask	3	__sigprocmask	sigprocmask
 s_sysctl	sysctl	_sysctl		1	__syscall__sysctl