Subject: libc/syscall relationship
To: None <tech-kern@netbsd.org>
From: Matthew Mondor <mmondor@gobot.ca>
List: tech-kern
Date: 10/23/2002 19:28:27
Hi all,
I have been reading src/sys/kern/ and src/lib/libc/, and have noticed that
some syscall functions (eg sys_getegid() in kern_prot.c) return their
results directly using the retval pointer, while some others seem to only
return their int return code (eg sys_setpgid() in kern_prot.c). In an
attempt to have a better view of what's going on I have been searching
libc for those (which I unfortunately didn't find yet)
% find . -name '*.[c|h|S]' | xargs grep setegid
./libc/net/rcmd.c: (void)setegid(pwd->pw_gid);
./libc/net/rcmd.c: (void)setegid(gid);
%
So I find part of the code calling those syscalls, but not their origin...
Then in src/sys/lib/libc/arch/ I find the asm stubs, but I don't seem to
find the libc code calling these... The C->asm interface. It has to be
there however, hence:
% nm /usr/lib/libc.so | grep getegid
00051204 T getegid
%
would that code be outside of src/lib/ finally?
Thanks,
Matt