__sys_fcntl() definition ?

Saifi Khan saifi at twincling.org
Wed Aug 1 02:37:58 UTC 2007


On Tue, 31 Jul 2007, youshi10 at u.washington.edu wrote:

> Date: Tue, 31 Jul 2007 14:00:06 -0700 (PDT)
> From:  <youshi10 at u.washington.edu>
> To: Saifi Khan <saifi at twincling.org>
> Cc:  <freebsd-questions at freebsd.org>
> Subject: Re: __sys_fcntl() definition ?
> 
> On Wed, 1 Aug 2007, Saifi Khan wrote:
> 
> > Hi:
> >
> > While working through the FreeBSD 6.2 codebase,
> > I saw the following functions referred at multiple places.
> >
> > __sys_fcntl()
> > __sys_open()
> > __sys_write()
> > ...
> >
> > Can somebody point out the file which contains the implementation
> > of the __sys_* functions ?
> >
> > Thanks in advance.
> >
> > thanks
> > Saifi.
> 
> They're standard C library headers:
> 
> man 2 fcntl
> man 2 open
> man 2 write
> 
> Cheers,
> -Garrett
> 

Hello Garrett:

In src/lib/libc/include/namespace.h (on line 64)
#define     fcntl               _fcntl    

If you look at the _fcntl() definition on line 43 in
src/lib/libc_r/uthread/uthread_fcntl.c
you will see on line 66 the following code

     /* Initialise the file descriptor table entry: */
             if ((ret = __sys_fcntl(fd, cmd, oldfd)) < 0) {

My question is that where is the function definition 
for this  __sys_fcntl() ?

Thanks in advance.

thanks
Saifi.


TWINCLING Society
freedom of innovation
http://www.twincling.org/


More information about the freebsd-questions mailing list