This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] _exit.c, exit vs. exit_group
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Carlos O'Donell <carlos at baldric dot uwo dot ca>
- Cc: libc-alpha <libc-alpha at sources dot redhat dot com>
- Date: Wed, 17 Dec 2003 13:51:28 -0500
- Subject: Re: [PATCH] _exit.c, exit vs. exit_group
- References: <20031217183811.GG24083@systemhalted>
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