Subject: Re: libc/syscall relationship
To: Matthew Mondor <mmondor@gobot.ca>
From: Matt Thomas <matt@3am-software.com>
List: tech-kern
Date: 10/24/2002 00:44:02
At 04:28 PM 10/23/2002, Matthew Mondor wrote:
>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?

Look at <lib/arch/$ARCH/SYS.h> for your architecture for the definition of
SYSCALL.


-- 
Matt Thomas               Internet:   matt@3am-software.com
3am Software Foundry      WWW URL:    http://www.3am-software.com/bio/matt/
Cupertino, CA             Disclaimer: I avow all knowledge of this message