mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-01 22:57:29 -04:00
unix: add fanotify API on Linux
This teaches unix/mksyscall.go about mapping uint64 to syscall arguments, similar to existing handling of int64. Change-Id: I536b4b09bbf6a8e3016565a4a04d2b9d32cbc624 Reviewed-on: https://go-review.googlesource.com/c/164664 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
@@ -39,6 +39,20 @@ func Creat(path string, mode uint32) (fd int, err error) {
|
||||
return Open(path, O_CREAT|O_WRONLY|O_TRUNC, mode)
|
||||
}
|
||||
|
||||
//sys FanotifyInit(flags uint, event_f_flags uint) (fd int, err error)
|
||||
//sys fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error)
|
||||
|
||||
func FanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname string) (err error) {
|
||||
if pathname == "" {
|
||||
return fanotifyMark(fd, flags, mask, dirFd, nil)
|
||||
}
|
||||
p, err := BytePtrFromString(pathname)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return fanotifyMark(fd, flags, mask, dirFd, p)
|
||||
}
|
||||
|
||||
//sys fchmodat(dirfd int, path string, mode uint32) (err error)
|
||||
|
||||
func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||
|
||||
Reference in New Issue
Block a user