On Tue, Feb 06, 2007 at 01:05:56PM +0100, Arjan van de Ven wrote:
> On Tue, 2007-02-06 at 11:32 +0100, Erik Mouw wrote:
> > This is what I use:
> >
> > /* stupid hack to get _syscall0() and _syscall3() macros */
> > #define __KERNEL__
> > #include <linux/unistd.h>
> > #undef __KERNEL__
> >
> > Not nice, but it works.
>
> man syscall
Oh, nice, didn't know about that. Works like a charm in my inotify test
program:
#include <sys/syscall.h>
#include <unistd.h>
int inotify_init(void)
{
return syscall(__NR_inotify_init, 0);
}
int inotify_add_watch(int fd, const char *path, unsigned int mask)
{
return syscall(__NR_inotify_add_watch, fd, path, mask);
}
> why not use that?
Cause I've been using the _syscall() macros since Linux-1.0.9 or so :)
Erik
--
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFFyHmA/PlVHJtIto0RAhyRAJ4tOu/oyQoXILYSiPmbYSjxEqkH+wCbBSZ+
d6wf6bS4StamnDSmkfxLHQI=
=kfPd
-----END PGP SIGNATURE-----