[PATCH] _exit.c, exit vs. exit_group
Carlos O'Donell
carlos@baldric.uwo.ca
Wed Dec 17 18:45:00 GMT 2003
libc-alpha,
Compiling with 2.6 headers, and booting into a 2.4 kernel without
exit_group should be allowed. Although ABORT_INSTRUCTION does end the
execution of the process, it's architecture dependant and not always a
pretty thing.
c.
2003-12-17 Carlos O'Donell <carlos@baldric.uwo.ca>
* sysdeps/unix/sysv/linux/_exit.c (_exit): Fallback to exit
syscall.
Index: sysdeps/unix/sysv/linux/_exit.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/_exit.c,v
retrieving revision 1.6
diff -u -p -r1.6 _exit.c
--- sysdeps/unix/sysv/linux/_exit.c 3 Sep 2003 03:21:26 -0000 1.6
+++ sysdeps/unix/sysv/linux/_exit.c 17 Dec 2003 15:19:24 -0000
@@ -30,9 +30,12 @@ _exit (status)
while (1)
{
#ifdef __NR_exit_group
- INLINE_SYSCALL (exit_group, 1, status);
+ INTERNAL_SYSCALL_DECL (err);
+ int r = INTERNAL_SYSCALL (exit_group, err, 1, status);
+ /* Fall back on the old syscall if -ENOSYS */
+ if (INTERNAL_SYSCALL_ERRNO (r, err) == ENOSYS)
#endif
- INLINE_SYSCALL (exit, 1, status);
+ INLINE_SYSCALL (exit, 1, status);
#ifdef ABORT_INSTRUCTION
ABORT_INSTRUCTION;
More information about the Libc-alpha
mailing list