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
signature.asc
Description: Digital signature