Re: Location of syscall wrappers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 07, 2008 at 02:12:38PM +0530, Rajat Jain wrote:
> Hi,
> 
> > 
> > Use syscall(SYSTEM_CALL_NUMBER, arg1, arg2, arg3);
> > 
> > _syscall3() macro are are not supported nowadays.
> > 
> > http://lkml.org/lkml/2007/7/5/314
> > 
> 
> Who is supposed to provide syscall()?? C library? Where do I find its
> definition (not declaration)?

libc provides syscall(). Definition can be found in syscall(2).

Use is like this (implementing inotify_add_watch()):

#include <sys/syscall.h>
#include <unistd.h>
#include <linux/inotify.h>

static int inotify_add_watch(int fd, const char *path, unsigned int mask)
{
        return syscall(__NR_inotify_add_watch, fd, path, mask);
}


> What is an application supposed to do if it does not want to use the
> library?

The same as an application should do if it wants to use printf() but
not libc: implement it yourself.


Erik

-- 
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Audio]     [Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Fedora Users]

  Powered by Linux