Discussion:
where syscall(?) in libc
三輪晋( Miwa Susumu )
2014-06-07 15:27:30 UTC
Permalink
hi.

I'm studying for NetBSD.

I think libc implmented system call (e.g. chmod(2)).
src/lib/libc/sys/Makefile.inc:

ASM= access.S acct.S \
bind.S \
chdir.S chflags.S chmod.S chown.S chroot.S __clock_getres50.S \
__clock_gettime50.S \
dup.S dup2.S dup3.S \
:

but I can't found chmod.S.
Where can I find chmod.S?

by the way, I use i386.
--
miwarin
Martin Husemann
2014-06-07 15:47:15 UTC
Permalink
Post by 三輪晋( Miwa Susumu )
I think libc implmented system call (e.g. chmod(2)).
The assembler file is generated on the fly when building libc,
you can find them in the libc objdir after building. Very boring.

The main magic, and probably what you are actually looking for, are the
macros in src/lib/libc/arch/i386/SYS.h

Martin
三輪晋( Miwa Susumu )
2014-06-07 15:56:53 UTC
Permalink
hi.
Post by Martin Husemann
Post by 三輪晋( Miwa Susumu )
I think libc implmented system call (e.g. chmod(2)).
The assembler file is generated on the fly when building libc,
you can find them in the libc objdir after building. Very boring.
The main magic, and probably what you are actually looking for, are the
macros in src/lib/libc/arch/i386/SYS.h
thanks. I can find it.
( e.g. /usr/obj/lib/libc/chmod.S )

wrote in chmod.S :

#include "SYS.h"
RSYSCALL(chmod)

wow...

I'll read src/lib/libc/arch/i386/SYS.h .
--
miwarin
Loading...