This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] _exit.c, exit vs. exit_group
- From: Carlos O'Donell <carlos at baldric dot uwo dot ca>
- To: libc-alpha <libc-alpha at sources dot redhat dot com>
- Date: Wed, 17 Dec 2003 13:38:11 -0500
- Subject: [PATCH] _exit.c, exit vs. exit_group
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;