#include <sys/types.h>
#include <sys/epoll.h>
+#include <sys/inotify.h>
#include <linux/ptrace.h>
#include <linux/wait.h>
'
$2 ~ /^E[A-Z0-9_]+$/ ||
$2 ~ /^SIG[^_]/ ||
+ $2 ~ /^IN_/ ||
$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|EVFILT|EV|SHUT|PROT|MAP)_/ ||
$2 == "SOMAXCONN" ||
$2 == "NAME_MAX" ||
//sys Getrlimit(resource int, rlim *Rlimit) (errno int)
//sys Getrusage(who int, rusage *Rusage) (errno int)
//sys Gettid() (tid int)
+//sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, errno int)
+//sys InotifyInit() (fd int, errno int)
+//sys InotifyInit1(flags int) (fd int, errno int)
+//sys InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int)
//sys Kill(pid int, sig int) (errno int)
//sys Klogctl(typ int, buf []byte) (n int, errno int) = SYS_SYSLOG
//sys Link(oldpath string, newpath string) (errno int)
// Getpmsg
// Getpriority
// Getxattr
-// InotifyAddWatch
-// InotifyInit
-// InotifyRmWatch
// IoCancel
// IoDestroy
// IoGetevents
#include <signal.h>
#include <stdio.h>
#include <sys/epoll.h>
+#include <sys/inotify.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/param.h>
};
+// Inotify
+typedef struct inotify_event $InotifyEvent;
+
+enum {
+ $SizeofInotifyEvent = sizeof(struct inotify_event)
+};
+
+
// Ptrace
// Register structures
F_ULOCK = 0
F_UNLCK = 0x2
F_WRLCK = 0x1
+ IN_ACCESS = 0x1
+ IN_ALL_EVENTS = 0xfff
+ IN_ATTRIB = 0x4
+ IN_CLASSA_HOST = 0xffffff
+ IN_CLASSA_MAX = 0x80
+ IN_CLASSA_NET = 0xff000000
+ IN_CLASSA_NSHIFT = 0x18
+ IN_CLASSB_HOST = 0xffff
+ IN_CLASSB_MAX = 0x10000
+ IN_CLASSB_NET = 0xffff0000
+ IN_CLASSB_NSHIFT = 0x10
+ IN_CLASSC_HOST = 0xff
+ IN_CLASSC_NET = 0xffffff00
+ IN_CLASSC_NSHIFT = 0x8
+ IN_CLOEXEC = 0x80000
+ IN_CLOSE = 0x18
+ IN_CLOSE_NOWRITE = 0x10
+ IN_CLOSE_WRITE = 0x8
+ IN_CREATE = 0x100
+ IN_DELETE = 0x200
+ IN_DELETE_SELF = 0x400
+ IN_DONT_FOLLOW = 0x2000000
+ IN_IGNORED = 0x8000
+ IN_ISDIR = 0x40000000
+ IN_LOOPBACKNET = 0x7f
+ IN_MASK_ADD = 0x20000000
+ IN_MODIFY = 0x2
+ IN_MOVE = 0xc0
+ IN_MOVED_FROM = 0x40
+ IN_MOVED_TO = 0x80
+ IN_MOVE_SELF = 0x800
+ IN_NONBLOCK = 0x800
+ IN_ONESHOT = 0x80000000
+ IN_ONLYDIR = 0x1000000
+ IN_OPEN = 0x20
+ IN_Q_OVERFLOW = 0x4000
+ IN_UNMOUNT = 0x2000
IPPROTO_AH = 0x33
IPPROTO_COMP = 0x6c
IPPROTO_DCCP = 0x21
F_ULOCK = 0
F_UNLCK = 0x2
F_WRLCK = 0x1
+ IN_ACCESS = 0x1
+ IN_ALL_EVENTS = 0xfff
+ IN_ATTRIB = 0x4
+ IN_CLASSA_HOST = 0xffffff
+ IN_CLASSA_MAX = 0x80
+ IN_CLASSA_NET = 0xff000000
+ IN_CLASSA_NSHIFT = 0x18
+ IN_CLASSB_HOST = 0xffff
+ IN_CLASSB_MAX = 0x10000
+ IN_CLASSB_NET = 0xffff0000
+ IN_CLASSB_NSHIFT = 0x10
+ IN_CLASSC_HOST = 0xff
+ IN_CLASSC_NET = 0xffffff00
+ IN_CLASSC_NSHIFT = 0x8
+ IN_CLOEXEC = 0x80000
+ IN_CLOSE = 0x18
+ IN_CLOSE_NOWRITE = 0x10
+ IN_CLOSE_WRITE = 0x8
+ IN_CREATE = 0x100
+ IN_DELETE = 0x200
+ IN_DELETE_SELF = 0x400
+ IN_DONT_FOLLOW = 0x2000000
+ IN_IGNORED = 0x8000
+ IN_ISDIR = 0x40000000
+ IN_LOOPBACKNET = 0x7f
+ IN_MASK_ADD = 0x20000000
+ IN_MODIFY = 0x2
+ IN_MOVE = 0xc0
+ IN_MOVED_FROM = 0x40
+ IN_MOVED_TO = 0x80
+ IN_MOVE_SELF = 0x800
+ IN_NONBLOCK = 0x800
+ IN_ONESHOT = 0x80000000
+ IN_ONLYDIR = 0x1000000
+ IN_OPEN = 0x20
+ IN_Q_OVERFLOW = 0x4000
+ IN_UNMOUNT = 0x2000
IPPROTO_AH = 0x33
IPPROTO_COMP = 0x6c
IPPROTO_DCCP = 0x21
F_ULOCK = 0
F_UNLCK = 0x2
F_WRLCK = 0x1
+ IN_ACCESS = 0x1
+ IN_ALL_EVENTS = 0xfff
+ IN_ATTRIB = 0x4
+ IN_CLASSA_HOST = 0xffffff
+ IN_CLASSA_MAX = 0x80
+ IN_CLASSA_NET = 0xff000000
+ IN_CLASSA_NSHIFT = 0x18
+ IN_CLASSB_HOST = 0xffff
+ IN_CLASSB_MAX = 0x10000
+ IN_CLASSB_NET = 0xffff0000
+ IN_CLASSB_NSHIFT = 0x10
+ IN_CLASSC_HOST = 0xff
+ IN_CLASSC_NET = 0xffffff00
+ IN_CLASSC_NSHIFT = 0x8
+ IN_CLOEXEC = 0x80000
+ IN_CLOSE = 0x18
+ IN_CLOSE_NOWRITE = 0x10
+ IN_CLOSE_WRITE = 0x8
+ IN_CREATE = 0x100
+ IN_DELETE = 0x200
+ IN_DELETE_SELF = 0x400
+ IN_DONT_FOLLOW = 0x2000000
+ IN_IGNORED = 0x8000
+ IN_ISDIR = 0x40000000
+ IN_LOOPBACKNET = 0x7f
+ IN_MASK_ADD = 0x20000000
+ IN_MODIFY = 0x2
+ IN_MOVE = 0xc0
+ IN_MOVED_FROM = 0x40
+ IN_MOVED_TO = 0x80
+ IN_MOVE_SELF = 0x800
+ IN_NONBLOCK = 0x800
+ IN_ONESHOT = 0x80000000
+ IN_ONLYDIR = 0x1000000
+ IN_OPEN = 0x20
+ IN_Q_OVERFLOW = 0x4000
+ IN_UNMOUNT = 0x2000
IPPROTO_AH = 0x33
IPPROTO_COMP = 0x6c
IPPROTO_DCCP = 0x21
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, errno int) {
+ r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(StringBytePtr(pathname))), uintptr(mask))
+ watchdesc = int(r0)
+ errno = int(e1)
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func InotifyInit() (fd int, errno int) {
+ r0, _, e1 := Syscall(SYS_INOTIFY_INIT, 0, 0, 0)
+ fd = int(r0)
+ errno = int(e1)
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func InotifyInit1(flags int) (fd int, errno int) {
+ r0, _, e1 := Syscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)
+ fd = int(r0)
+ errno = int(e1)
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int) {
+ r0, _, e1 := Syscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)
+ success = int(r0)
+ errno = int(e1)
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Kill(pid int, sig int) (errno int) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)
errno = int(e1)
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, errno int) {
+ r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(StringBytePtr(pathname))), uintptr(mask))
+ watchdesc = int(r0)
+ errno = int(e1)
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func InotifyInit() (fd int, errno int) {
+ r0, _, e1 := Syscall(SYS_INOTIFY_INIT, 0, 0, 0)
+ fd = int(r0)
+ errno = int(e1)
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func InotifyInit1(flags int) (fd int, errno int) {
+ r0, _, e1 := Syscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)
+ fd = int(r0)
+ errno = int(e1)
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int) {
+ r0, _, e1 := Syscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)
+ success = int(r0)
+ errno = int(e1)
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Kill(pid int, sig int) (errno int) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)
errno = int(e1)
return
}
+func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, errno int) {
+ r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(StringBytePtr(pathname))), uintptr(mask))
+ watchdesc = int(r0)
+ errno = int(e1)
+ return
+}
+
+func InotifyInit() (fd int, errno int) {
+ r0, _, e1 := Syscall(SYS_INOTIFY_INIT, 0, 0, 0)
+ fd = int(r0)
+ errno = int(e1)
+ return
+}
+
+func InotifyInit1(flags int) (fd int, errno int) {
+ r0, _, e1 := Syscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)
+ fd = int(r0)
+ errno = int(e1)
+ return
+}
+
+func InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int) {
+ r0, _, e1 := Syscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)
+ success = int(r0)
+ errno = int(e1)
+ return
+}
+
func Kill(pid int, sig int) (errno int) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)
errno = int(e1)
SizeofLinger = 0x8
SizeofMsghdr = 0x1c
SizeofCmsghdr = 0xc
+ SizeofInotifyEvent = 0x10
)
// Types
Type int32
}
+type InotifyEvent struct {
+ Wd int32
+ Mask uint32
+ Cookie uint32
+ Len uint32
+}
+
type PtraceRegs struct {
Ebx int32
Ecx int32
SizeofLinger = 0x8
SizeofMsghdr = 0x38
SizeofCmsghdr = 0x10
+ SizeofInotifyEvent = 0x10
)
// Types
Type int32
}
+type InotifyEvent struct {
+ Wd int32
+ Mask uint32
+ Cookie uint32
+ Len uint32
+}
+
type PtraceRegs struct {
R15 uint64
R14 uint64
SizeofLinger = 0x8
SizeofMsghdr = 0x1c
SizeofCmsghdr = 0xc
+ SizeofInotifyEvent = 0x10
)
// Types
Type int32
}
+type InotifyEvent struct {
+ Wd int32
+ Mask uint32
+ Cookie uint32
+ Len uint32
+}
+
type PtraceRegs struct{}
type FdSet struct {