Ah tra l'altro sono scemo, il sorgente di quella funzione si trovava tranquillamente in glibc
:
codice:
void
_exit (status)
int status;
{
while (1)
{
#ifdef __NR_exit_group
INLINE_SYSCALL (exit_group, 1, status);
#endif
INLINE_SYSCALL (exit, 1, status);
#ifdef ABORT_INSTRUCTION
ABORT_INSTRUCTION;
#endif
}
}
che più o meno corrisponde a quanto avevo scritto, dato che si ha:
codice:
# define INLINE_SYSCALL(name, nr, args...) \
({ \
unsigned long int resultvar = INTERNAL_SYSCALL (name, , nr, args); \
if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (resultvar, ), 0)) \
{ \
__set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, )); \
resultvar = (unsigned long int) -1; \
} \
(long int) resultvar; })
con
codice:
# define INTERNAL_SYSCALL_ERROR_P(val, err) \
((unsigned long int) (long int) (val) >= -4095L)
# define INTERNAL_SYSCALL_ERRNO(val, err) (-(val))
e
codice:
/* An instruction which should crash any program is `hlt'. */
#define ABORT_INSTRUCTION asm ("hlt")
(e questo commento tra l'altro mi dice che non si usa hlt per non bruciare la CPU, ma semplicemente per crashare in user-mode)