[PATCH] _exit.c, exit vs. exit_group
Daniel Jacobowitz
drow@mvista.com
Wed Dec 17 18:51:00 GMT 2003
On Wed, Dec 17, 2003 at 01:38:11PM -0500, Carlos O'Donell wrote:
>
> 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.
What do you think this patch accomplishes?
> #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;
Here it is from before your patch:
> #ifdef __NR_exit_group
> - INLINE_SYSCALL (exit_group, 1, status);
> #endif
> - INLINE_SYSCALL (exit, 1, status);
>
> #ifdef ABORT_INSTRUCTION
> ABORT_INSTRUCTION;
If exit_group returns it calls exit.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
More information about the Libc-alpha
mailing list