where to find exit(int) function implementation
Yuri Pankov
yuripv at gmx.com
Wed Jan 10 13:49:44 UTC 2018
On Wed, Jan 10, 2018 at 02:16:16PM +0100, Matthias Apitz:
> Am 10.01.2018 14:01, schrieb Vitalio D:
>> Hello,
>>
>> How and where void _exit(int) is implemented? I've started
>> with exit(int) defined in exit.c un stdlib, but I've got stuck at
>> unistd.h where void _exit(int) __dead2;
>> After that I couldn't find anything by running
>> find /usr/src -name "*.c" -exec grep " _exit(int" /dev/null {} \;
>
> $ find /usr/src -name *.c | grep exit
> /usr/src/sys/kern/kern_exit.c
> /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c
> /usr/src/lib/libc/arm/aeabi/aeabi_atexit.c
> /usr/src/lib/libc/stdlib/cxa_thread_atexit.c
> /usr/src/lib/libc/stdlib/cxa_thread_atexit_impl.c
> /usr/src/lib/libc/stdlib/exit.c
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The original question was about _exit(2) syscall, not exit(3).
WRT the _exit(2), it's marked as "PSEUDO" and relevant PSEUDO macro is
defined in lib/libc/<arch>/SYS.h (if I'm reading it all correctly).
More information about the freebsd-questions
mailing list