Re: Help Adding system call 2.6.19

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

 



On 2/6/07, Erik Mouw <mouw@xxxxxxxxxxxx> wrote:
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-----


Thanks for your quick replies.
In the end I moved to syscall() but still thinking why has this been
put within __KERNEL__ block. May be its a step towards promoting
sysenter /_kernel_vsyscall interface rather than int 0x80.

Regards,
Amit Dang
--

Regards,
Dang

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux