This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] _exit.c, exit vs. exit_group


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]