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>
diff --git a/unix/linux/types.go b/unix/linux/types.go
index 1cf247a..a1828ad 100644
--- a/unix/linux/types.go
+++ b/unix/linux/types.go
@@ -48,6 +48,7 @@
 #include <sys/utsname.h>
 #include <sys/wait.h>
 #include <linux/errqueue.h>
+#include <linux/fanotify.h>
 #include <linux/filter.h>
 #include <linux/icmpv6.h>
 #include <linux/if_pppox.h>
@@ -1680,3 +1681,9 @@
 // Socket error queue
 
 type SockExtendedErr C.struct_sock_extended_err
+
+// Fanotify
+
+type FanotifyEventMetadata C.struct_fanotify_event_metadata
+
+type FanotifyResponse C.struct_fanotify_response
diff --git a/unix/mkerrors.sh b/unix/mkerrors.sh
index 6a23484..cfb61ba 100755
--- a/unix/mkerrors.sh
+++ b/unix/mkerrors.sh
@@ -192,6 +192,7 @@
 #include <linux/if_packet.h>
 #include <linux/if_addr.h>
 #include <linux/falloc.h>
+#include <linux/fanotify.h>
 #include <linux/filter.h>
 #include <linux/fs.h>
 #include <linux/kexec.h>
@@ -501,6 +502,7 @@
 		$2 !~ "WMESGLEN" &&
 		$2 ~ /^W[A-Z0-9]+$/ ||
 		$2 ~/^PPPIOC/ ||
+		$2 ~ /^FAN_|FANOTIFY_/ ||
 		$2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)}
 		$2 ~ /^__WCOREFLAG$/ {next}
 		$2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)}
diff --git a/unix/mksyscall.go b/unix/mksyscall.go
index e06e425..bed93d4 100644
--- a/unix/mksyscall.go
+++ b/unix/mksyscall.go
@@ -228,7 +228,7 @@
 					} else {
 						args = append(args, fmt.Sprintf("uintptr(%s)", p.Name))
 					}
-				} else if p.Type == "int64" && endianness != "" {
+				} else if (p.Type == "int64" || p.Type == "uint64") && endianness != "" {
 					if len(args)%2 == 1 && *arm {
 						// arm abi specifies 64-bit argument uses
 						// (even, odd) pair
diff --git a/unix/syscall_linux.go b/unix/syscall_linux.go
index 4bb86aa..6f03b86 100644
--- a/unix/syscall_linux.go
+++ b/unix/syscall_linux.go
@@ -39,6 +39,20 @@
 	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) {
diff --git a/unix/zerrors_linux_386.go b/unix/zerrors_linux_386.go
index cb89df8..70e29b0 100644
--- a/unix/zerrors_linux_386.go
+++ b/unix/zerrors_linux_386.go
@@ -486,6 +486,48 @@
 	FALLOC_FL_PUNCH_HOLE                 = 0x2
 	FALLOC_FL_UNSHARE_RANGE              = 0x40
 	FALLOC_FL_ZERO_RANGE                 = 0x10
+	FANOTIFY_METADATA_VERSION            = 0x3
+	FAN_ACCESS                           = 0x1
+	FAN_ACCESS_PERM                      = 0x20000
+	FAN_ALLOW                            = 0x1
+	FAN_ALL_CLASS_BITS                   = 0xc
+	FAN_ALL_EVENTS                       = 0x3b
+	FAN_ALL_INIT_FLAGS                   = 0x3f
+	FAN_ALL_MARK_FLAGS                   = 0xff
+	FAN_ALL_OUTGOING_EVENTS              = 0x3403b
+	FAN_ALL_PERM_EVENTS                  = 0x30000
+	FAN_AUDIT                            = 0x10
+	FAN_CLASS_CONTENT                    = 0x4
+	FAN_CLASS_NOTIF                      = 0x0
+	FAN_CLASS_PRE_CONTENT                = 0x8
+	FAN_CLOEXEC                          = 0x1
+	FAN_CLOSE                            = 0x18
+	FAN_CLOSE_NOWRITE                    = 0x10
+	FAN_CLOSE_WRITE                      = 0x8
+	FAN_DENY                             = 0x2
+	FAN_ENABLE_AUDIT                     = 0x40
+	FAN_EVENT_METADATA_LEN               = 0x18
+	FAN_EVENT_ON_CHILD                   = 0x8000000
+	FAN_MARK_ADD                         = 0x1
+	FAN_MARK_DONT_FOLLOW                 = 0x4
+	FAN_MARK_FILESYSTEM                  = 0x100
+	FAN_MARK_FLUSH                       = 0x80
+	FAN_MARK_IGNORED_MASK                = 0x20
+	FAN_MARK_IGNORED_SURV_MODIFY         = 0x40
+	FAN_MARK_INODE                       = 0x0
+	FAN_MARK_MOUNT                       = 0x10
+	FAN_MARK_ONLYDIR                     = 0x8
+	FAN_MARK_REMOVE                      = 0x2
+	FAN_MODIFY                           = 0x2
+	FAN_NOFD                             = -0x1
+	FAN_NONBLOCK                         = 0x2
+	FAN_ONDIR                            = 0x40000000
+	FAN_OPEN                             = 0x20
+	FAN_OPEN_PERM                        = 0x10000
+	FAN_Q_OVERFLOW                       = 0x4000
+	FAN_REPORT_TID                       = 0x100
+	FAN_UNLIMITED_MARKS                  = 0x20
+	FAN_UNLIMITED_QUEUE                  = 0x10
 	FD_CLOEXEC                           = 0x1
 	FD_SETSIZE                           = 0x400
 	FF0                                  = 0x0
diff --git a/unix/zerrors_linux_amd64.go b/unix/zerrors_linux_amd64.go
index 73c9b88..49c05e3 100644
--- a/unix/zerrors_linux_amd64.go
+++ b/unix/zerrors_linux_amd64.go
@@ -486,6 +486,48 @@
 	FALLOC_FL_PUNCH_HOLE                 = 0x2
 	FALLOC_FL_UNSHARE_RANGE              = 0x40
 	FALLOC_FL_ZERO_RANGE                 = 0x10
+	FANOTIFY_METADATA_VERSION            = 0x3
+	FAN_ACCESS                           = 0x1
+	FAN_ACCESS_PERM                      = 0x20000
+	FAN_ALLOW                            = 0x1
+	FAN_ALL_CLASS_BITS                   = 0xc
+	FAN_ALL_EVENTS                       = 0x3b
+	FAN_ALL_INIT_FLAGS                   = 0x3f
+	FAN_ALL_MARK_FLAGS                   = 0xff
+	FAN_ALL_OUTGOING_EVENTS              = 0x3403b
+	FAN_ALL_PERM_EVENTS                  = 0x30000
+	FAN_AUDIT                            = 0x10
+	FAN_CLASS_CONTENT                    = 0x4
+	FAN_CLASS_NOTIF                      = 0x0
+	FAN_CLASS_PRE_CONTENT                = 0x8
+	FAN_CLOEXEC                          = 0x1
+	FAN_CLOSE                            = 0x18
+	FAN_CLOSE_NOWRITE                    = 0x10
+	FAN_CLOSE_WRITE                      = 0x8
+	FAN_DENY                             = 0x2
+	FAN_ENABLE_AUDIT                     = 0x40
+	FAN_EVENT_METADATA_LEN               = 0x18
+	FAN_EVENT_ON_CHILD                   = 0x8000000
+	FAN_MARK_ADD                         = 0x1
+	FAN_MARK_DONT_FOLLOW                 = 0x4
+	FAN_MARK_FILESYSTEM                  = 0x100
+	FAN_MARK_FLUSH                       = 0x80
+	FAN_MARK_IGNORED_MASK                = 0x20
+	FAN_MARK_IGNORED_SURV_MODIFY         = 0x40
+	FAN_MARK_INODE                       = 0x0
+	FAN_MARK_MOUNT                       = 0x10
+	FAN_MARK_ONLYDIR                     = 0x8
+	FAN_MARK_REMOVE                      = 0x2
+	FAN_MODIFY                           = 0x2
+	FAN_NOFD                             = -0x1
+	FAN_NONBLOCK                         = 0x2
+	FAN_ONDIR                            = 0x40000000
+	FAN_OPEN                             = 0x20
+	FAN_OPEN_PERM                        = 0x10000
+	FAN_Q_OVERFLOW                       = 0x4000
+	FAN_REPORT_TID                       = 0x100
+	FAN_UNLIMITED_MARKS                  = 0x20
+	FAN_UNLIMITED_QUEUE                  = 0x10
 	FD_CLOEXEC                           = 0x1
 	FD_SETSIZE                           = 0x400
 	FF0                                  = 0x0
diff --git a/unix/zerrors_linux_arm.go b/unix/zerrors_linux_arm.go
index f1ef82f..e2785d7 100644
--- a/unix/zerrors_linux_arm.go
+++ b/unix/zerrors_linux_arm.go
@@ -486,6 +486,48 @@
 	FALLOC_FL_PUNCH_HOLE                 = 0x2
 	FALLOC_FL_UNSHARE_RANGE              = 0x40
 	FALLOC_FL_ZERO_RANGE                 = 0x10
+	FANOTIFY_METADATA_VERSION            = 0x3
+	FAN_ACCESS                           = 0x1
+	FAN_ACCESS_PERM                      = 0x20000
+	FAN_ALLOW                            = 0x1
+	FAN_ALL_CLASS_BITS                   = 0xc
+	FAN_ALL_EVENTS                       = 0x3b
+	FAN_ALL_INIT_FLAGS                   = 0x3f
+	FAN_ALL_MARK_FLAGS                   = 0xff
+	FAN_ALL_OUTGOING_EVENTS              = 0x3403b
+	FAN_ALL_PERM_EVENTS                  = 0x30000
+	FAN_AUDIT                            = 0x10
+	FAN_CLASS_CONTENT                    = 0x4
+	FAN_CLASS_NOTIF                      = 0x0
+	FAN_CLASS_PRE_CONTENT                = 0x8
+	FAN_CLOEXEC                          = 0x1
+	FAN_CLOSE                            = 0x18
+	FAN_CLOSE_NOWRITE                    = 0x10
+	FAN_CLOSE_WRITE                      = 0x8
+	FAN_DENY                             = 0x2
+	FAN_ENABLE_AUDIT                     = 0x40
+	FAN_EVENT_METADATA_LEN               = 0x18
+	FAN_EVENT_ON_CHILD                   = 0x8000000
+	FAN_MARK_ADD                         = 0x1
+	FAN_MARK_DONT_FOLLOW                 = 0x4
+	FAN_MARK_FILESYSTEM                  = 0x100
+	FAN_MARK_FLUSH                       = 0x80
+	FAN_MARK_IGNORED_MASK                = 0x20
+	FAN_MARK_IGNORED_SURV_MODIFY         = 0x40
+	FAN_MARK_INODE                       = 0x0
+	FAN_MARK_MOUNT                       = 0x10
+	FAN_MARK_ONLYDIR                     = 0x8
+	FAN_MARK_REMOVE                      = 0x2
+	FAN_MODIFY                           = 0x2
+	FAN_NOFD                             = -0x1
+	FAN_NONBLOCK                         = 0x2
+	FAN_ONDIR                            = 0x40000000
+	FAN_OPEN                             = 0x20
+	FAN_OPEN_PERM                        = 0x10000
+	FAN_Q_OVERFLOW                       = 0x4000
+	FAN_REPORT_TID                       = 0x100
+	FAN_UNLIMITED_MARKS                  = 0x20
+	FAN_UNLIMITED_QUEUE                  = 0x10
 	FD_CLOEXEC                           = 0x1
 	FD_SETSIZE                           = 0x400
 	FF0                                  = 0x0
diff --git a/unix/zerrors_linux_arm64.go b/unix/zerrors_linux_arm64.go
index cf17c99..b093a10 100644
--- a/unix/zerrors_linux_arm64.go
+++ b/unix/zerrors_linux_arm64.go
@@ -488,6 +488,48 @@
 	FALLOC_FL_PUNCH_HOLE                 = 0x2
 	FALLOC_FL_UNSHARE_RANGE              = 0x40
 	FALLOC_FL_ZERO_RANGE                 = 0x10
+	FANOTIFY_METADATA_VERSION            = 0x3
+	FAN_ACCESS                           = 0x1
+	FAN_ACCESS_PERM                      = 0x20000
+	FAN_ALLOW                            = 0x1
+	FAN_ALL_CLASS_BITS                   = 0xc
+	FAN_ALL_EVENTS                       = 0x3b
+	FAN_ALL_INIT_FLAGS                   = 0x3f
+	FAN_ALL_MARK_FLAGS                   = 0xff
+	FAN_ALL_OUTGOING_EVENTS              = 0x3403b
+	FAN_ALL_PERM_EVENTS                  = 0x30000
+	FAN_AUDIT                            = 0x10
+	FAN_CLASS_CONTENT                    = 0x4
+	FAN_CLASS_NOTIF                      = 0x0
+	FAN_CLASS_PRE_CONTENT                = 0x8
+	FAN_CLOEXEC                          = 0x1
+	FAN_CLOSE                            = 0x18
+	FAN_CLOSE_NOWRITE                    = 0x10
+	FAN_CLOSE_WRITE                      = 0x8
+	FAN_DENY                             = 0x2
+	FAN_ENABLE_AUDIT                     = 0x40
+	FAN_EVENT_METADATA_LEN               = 0x18
+	FAN_EVENT_ON_CHILD                   = 0x8000000
+	FAN_MARK_ADD                         = 0x1
+	FAN_MARK_DONT_FOLLOW                 = 0x4
+	FAN_MARK_FILESYSTEM                  = 0x100
+	FAN_MARK_FLUSH                       = 0x80
+	FAN_MARK_IGNORED_MASK                = 0x20
+	FAN_MARK_IGNORED_SURV_MODIFY         = 0x40
+	FAN_MARK_INODE                       = 0x0
+	FAN_MARK_MOUNT                       = 0x10
+	FAN_MARK_ONLYDIR                     = 0x8
+	FAN_MARK_REMOVE                      = 0x2
+	FAN_MODIFY                           = 0x2
+	FAN_NOFD                             = -0x1
+	FAN_NONBLOCK                         = 0x2
+	FAN_ONDIR                            = 0x40000000
+	FAN_OPEN                             = 0x20
+	FAN_OPEN_PERM                        = 0x10000
+	FAN_Q_OVERFLOW                       = 0x4000
+	FAN_REPORT_TID                       = 0x100
+	FAN_UNLIMITED_MARKS                  = 0x20
+	FAN_UNLIMITED_QUEUE                  = 0x10
 	FD_CLOEXEC                           = 0x1
 	FD_SETSIZE                           = 0x400
 	FF0                                  = 0x0
diff --git a/unix/zerrors_linux_mips.go b/unix/zerrors_linux_mips.go
index 380913c..c7798d8 100644
--- a/unix/zerrors_linux_mips.go
+++ b/unix/zerrors_linux_mips.go
@@ -486,6 +486,48 @@
 	FALLOC_FL_PUNCH_HOLE                 = 0x2
 	FALLOC_FL_UNSHARE_RANGE              = 0x40
 	FALLOC_FL_ZERO_RANGE                 = 0x10
+	FANOTIFY_METADATA_VERSION            = 0x3
+	FAN_ACCESS                           = 0x1
+	FAN_ACCESS_PERM                      = 0x20000
+	FAN_ALLOW                            = 0x1
+	FAN_ALL_CLASS_BITS                   = 0xc
+	FAN_ALL_EVENTS                       = 0x3b
+	FAN_ALL_INIT_FLAGS                   = 0x3f
+	FAN_ALL_MARK_FLAGS                   = 0xff
+	FAN_ALL_OUTGOING_EVENTS              = 0x3403b
+	FAN_ALL_PERM_EVENTS                  = 0x30000
+	FAN_AUDIT                            = 0x10
+	FAN_CLASS_CONTENT                    = 0x4
+	FAN_CLASS_NOTIF                      = 0x0
+	FAN_CLASS_PRE_CONTENT                = 0x8
+	FAN_CLOEXEC                          = 0x1
+	FAN_CLOSE                            = 0x18
+	FAN_CLOSE_NOWRITE                    = 0x10
+	FAN_CLOSE_WRITE                      = 0x8
+	FAN_DENY                             = 0x2
+	FAN_ENABLE_AUDIT                     = 0x40
+	FAN_EVENT_METADATA_LEN               = 0x18
+	FAN_EVENT_ON_CHILD                   = 0x8000000
+	FAN_MARK_ADD                         = 0x1
+	FAN_MARK_DONT_FOLLOW                 = 0x4
+	FAN_MARK_FILESYSTEM                  = 0x100
+	FAN_MARK_FLUSH                       = 0x80
+	FAN_MARK_IGNORED_MASK                = 0x20
+	FAN_MARK_IGNORED_SURV_MODIFY         = 0x40
+	FAN_MARK_INODE                       = 0x0
+	FAN_MARK_MOUNT                       = 0x10
+	FAN_MARK_ONLYDIR                     = 0x8
+	FAN_MARK_REMOVE                      = 0x2
+	FAN_MODIFY                           = 0x2
+	FAN_NOFD                             = -0x1
+	FAN_NONBLOCK                         = 0x2
+	FAN_ONDIR                            = 0x40000000
+	FAN_OPEN                             = 0x20
+	FAN_OPEN_PERM                        = 0x10000
+	FAN_Q_OVERFLOW                       = 0x4000
+	FAN_REPORT_TID                       = 0x100
+	FAN_UNLIMITED_MARKS                  = 0x20
+	FAN_UNLIMITED_QUEUE                  = 0x10
 	FD_CLOEXEC                           = 0x1
 	FD_SETSIZE                           = 0x400
 	FF0                                  = 0x0
diff --git a/unix/zerrors_linux_mips64.go b/unix/zerrors_linux_mips64.go
index fb82529..5fac3aa 100644
--- a/unix/zerrors_linux_mips64.go
+++ b/unix/zerrors_linux_mips64.go
@@ -486,6 +486,48 @@
 	FALLOC_FL_PUNCH_HOLE                 = 0x2
 	FALLOC_FL_UNSHARE_RANGE              = 0x40
 	FALLOC_FL_ZERO_RANGE                 = 0x10
+	FANOTIFY_METADATA_VERSION            = 0x3
+	FAN_ACCESS                           = 0x1
+	FAN_ACCESS_PERM                      = 0x20000
+	FAN_ALLOW                            = 0x1
+	FAN_ALL_CLASS_BITS                   = 0xc
+	FAN_ALL_EVENTS                       = 0x3b
+	FAN_ALL_INIT_FLAGS                   = 0x3f
+	FAN_ALL_MARK_FLAGS                   = 0xff
+	FAN_ALL_OUTGOING_EVENTS              = 0x3403b
+	FAN_ALL_PERM_EVENTS                  = 0x30000
+	FAN_AUDIT                            = 0x10
+	FAN_CLASS_CONTENT                    = 0x4
+	FAN_CLASS_NOTIF                      = 0x0
+	FAN_CLASS_PRE_CONTENT                = 0x8
+	FAN_CLOEXEC                          = 0x1
+	FAN_CLOSE                            = 0x18
+	FAN_CLOSE_NOWRITE                    = 0x10
+	FAN_CLOSE_WRITE                      = 0x8
+	FAN_DENY                             = 0x2
+	FAN_ENABLE_AUDIT                     = 0x40
+	FAN_EVENT_METADATA_LEN               = 0x18
+	FAN_EVENT_ON_CHILD                   = 0x8000000
+	FAN_MARK_ADD                         = 0x1
+	FAN_MARK_DONT_FOLLOW                 = 0x4
+	FAN_MARK_FILESYSTEM                  = 0x100
+	FAN_MARK_FLUSH                       = 0x80
+	FAN_MARK_IGNORED_MASK                = 0x20
+	FAN_MARK_IGNORED_SURV_MODIFY         = 0x40
+	FAN_MARK_INODE                       = 0x0
+	FAN_MARK_MOUNT                       = 0x10
+	FAN_MARK_ONLYDIR                     = 0x8
+	FAN_MARK_REMOVE                      = 0x2
+	FAN_MODIFY                           = 0x2
+	FAN_NOFD                             = -0x1
+	FAN_NONBLOCK                         = 0x2
+	FAN_ONDIR                            = 0x40000000
+	FAN_OPEN                             = 0x20
+	FAN_OPEN_PERM                        = 0x10000
+	FAN_Q_OVERFLOW                       = 0x4000
+	FAN_REPORT_TID                       = 0x100
+	FAN_UNLIMITED_MARKS                  = 0x20
+	FAN_UNLIMITED_QUEUE                  = 0x10
 	FD_CLOEXEC                           = 0x1
 	FD_SETSIZE                           = 0x400
 	FF0                                  = 0x0
diff --git a/unix/zerrors_linux_mips64le.go b/unix/zerrors_linux_mips64le.go
index 677d904..31bd798 100644
--- a/unix/zerrors_linux_mips64le.go
+++ b/unix/zerrors_linux_mips64le.go
@@ -486,6 +486,48 @@
 	FALLOC_FL_PUNCH_HOLE                 = 0x2
 	FALLOC_FL_UNSHARE_RANGE              = 0x40
 	FALLOC_FL_ZERO_RANGE                 = 0x10
+	FANOTIFY_METADATA_VERSION            = 0x3
+	FAN_ACCESS                           = 0x1
+	FAN_ACCESS_PERM                      = 0x20000
+	FAN_ALLOW                            = 0x1
+	FAN_ALL_CLASS_BITS                   = 0xc
+	FAN_ALL_EVENTS                       = 0x3b
+	FAN_ALL_INIT_FLAGS                   = 0x3f
+	FAN_ALL_MARK_FLAGS                   = 0xff
+	FAN_ALL_OUTGOING_EVENTS              = 0x3403b
+	FAN_ALL_PERM_EVENTS                  = 0x30000
+	FAN_AUDIT                            = 0x10
+	FAN_CLASS_CONTENT                    = 0x4
+	FAN_CLASS_NOTIF                      = 0x0
+	FAN_CLASS_PRE_CONTENT                = 0x8
+	FAN_CLOEXEC                          = 0x1
+	FAN_CLOSE                            = 0x18
+	FAN_CLOSE_NOWRITE                    = 0x10
+	FAN_CLOSE_WRITE                      = 0x8
+	FAN_DENY                             = 0x2
+	FAN_ENABLE_AUDIT                     = 0x40
+	FAN_EVENT_METADATA_LEN               = 0x18
+	FAN_EVENT_ON_CHILD                   = 0x8000000
+	FAN_MARK_ADD                         = 0x1
+	FAN_MARK_DONT_FOLLOW                 = 0x4
+	FAN_MARK_FILESYSTEM                  = 0x100
+	FAN_MARK_FLUSH                       = 0x80
+	FAN_MARK_IGNORED_MASK                = 0x20
+	FAN_MARK_IGNORED_SURV_MODIFY         = 0x40
+	FAN_MARK_INODE                       = 0x0
+	FAN_MARK_MOUNT                       = 0x10
+	FAN_MARK_ONLYDIR                     = 0x8
+	FAN_MARK_REMOVE                      = 0x2
+	FAN_MODIFY                           = 0x2
+	FAN_NOFD                             = -0x1
+	FAN_NONBLOCK                         = 0x2
+	FAN_ONDIR                            = 0x40000000
+	FAN_OPEN                             = 0x20
+	FAN_OPEN_PERM                        = 0x10000
+	FAN_Q_OVERFLOW                       = 0x4000
+	FAN_REPORT_TID                       = 0x100
+	FAN_UNLIMITED_MARKS                  = 0x20
+	FAN_UNLIMITED_QUEUE                  = 0x10
 	FD_CLOEXEC                           = 0x1
 	FD_SETSIZE                           = 0x400
 	FF0                                  = 0x0
diff --git a/unix/zerrors_linux_mipsle.go b/unix/zerrors_linux_mipsle.go
index 7ddd09d..36150d3 100644
--- a/unix/zerrors_linux_mipsle.go
+++ b/unix/zerrors_linux_mipsle.go
@@ -486,6 +486,48 @@
 	FALLOC_FL_PUNCH_HOLE                 = 0x2
 	FALLOC_FL_UNSHARE_RANGE              = 0x40
 	FALLOC_FL_ZERO_RANGE                 = 0x10
+	FANOTIFY_METADATA_VERSION            = 0x3
+	FAN_ACCESS                           = 0x1
+	FAN_ACCESS_PERM                      = 0x20000
+	FAN_ALLOW                            = 0x1
+	FAN_ALL_CLASS_BITS                   = 0xc
+	FAN_ALL_EVENTS                       = 0x3b
+	FAN_ALL_INIT_FLAGS                   = 0x3f
+	FAN_ALL_MARK_FLAGS                   = 0xff
+	FAN_ALL_OUTGOING_EVENTS              = 0x3403b
+	FAN_ALL_PERM_EVENTS                  = 0x30000
+	FAN_AUDIT                            = 0x10
+	FAN_CLASS_CONTENT                    = 0x4
+	FAN_CLASS_NOTIF                      = 0x0
+	FAN_CLASS_PRE_CONTENT                = 0x8
+	FAN_CLOEXEC                          = 0x1
+	FAN_CLOSE                            = 0x18
+	FAN_CLOSE_NOWRITE                    = 0x10
+	FAN_CLOSE_WRITE                      = 0x8
+	FAN_DENY                             = 0x2
+	FAN_ENABLE_AUDIT                     = 0x40
+	FAN_EVENT_METADATA_LEN               = 0x18
+	FAN_EVENT_ON_CHILD                   = 0x8000000
+	FAN_MARK_ADD                         = 0x1
+	FAN_MARK_DONT_FOLLOW                 = 0x4
+	FAN_MARK_FILESYSTEM                  = 0x100
+	FAN_MARK_FLUSH                       = 0x80
+	FAN_MARK_IGNORED_MASK                = 0x20
+	FAN_MARK_IGNORED_SURV_MODIFY         = 0x40
+	FAN_MARK_INODE                       = 0x0
+	FAN_MARK_MOUNT                       = 0x10
+	FAN_MARK_ONLYDIR                     = 0x8
+	FAN_MARK_REMOVE                      = 0x2
+	FAN_MODIFY                           = 0x2
+	FAN_NOFD                             = -0x1
+	FAN_NONBLOCK                         = 0x2
+	FAN_ONDIR                            = 0x40000000
+	FAN_OPEN                             = 0x20
+	FAN_OPEN_PERM                        = 0x10000
+	FAN_Q_OVERFLOW                       = 0x4000
+	FAN_REPORT_TID                       = 0x100
+	FAN_UNLIMITED_MARKS                  = 0x20
+	FAN_UNLIMITED_QUEUE                  = 0x10
 	FD_CLOEXEC                           = 0x1
 	FD_SETSIZE                           = 0x400
 	FF0                                  = 0x0
diff --git a/unix/zerrors_linux_ppc64.go b/unix/zerrors_linux_ppc64.go
index ebaca41..69e8871 100644
--- a/unix/zerrors_linux_ppc64.go
+++ b/unix/zerrors_linux_ppc64.go
@@ -486,6 +486,48 @@
 	FALLOC_FL_PUNCH_HOLE                 = 0x2
 	FALLOC_FL_UNSHARE_RANGE              = 0x40
 	FALLOC_FL_ZERO_RANGE                 = 0x10
+	FANOTIFY_METADATA_VERSION            = 0x3
+	FAN_ACCESS                           = 0x1
+	FAN_ACCESS_PERM                      = 0x20000
+	FAN_ALLOW                            = 0x1
+	FAN_ALL_CLASS_BITS                   = 0xc
+	FAN_ALL_EVENTS                       = 0x3b
+	FAN_ALL_INIT_FLAGS                   = 0x3f
+	FAN_ALL_MARK_FLAGS                   = 0xff
+	FAN_ALL_OUTGOING_EVENTS              = 0x3403b
+	FAN_ALL_PERM_EVENTS                  = 0x30000
+	FAN_AUDIT                            = 0x10
+	FAN_CLASS_CONTENT                    = 0x4
+	FAN_CLASS_NOTIF                      = 0x0
+	FAN_CLASS_PRE_CONTENT                = 0x8
+	FAN_CLOEXEC                          = 0x1
+	FAN_CLOSE                            = 0x18
+	FAN_CLOSE_NOWRITE                    = 0x10
+	FAN_CLOSE_WRITE                      = 0x8
+	FAN_DENY                             = 0x2
+	FAN_ENABLE_AUDIT                     = 0x40
+	FAN_EVENT_METADATA_LEN               = 0x18
+	FAN_EVENT_ON_CHILD                   = 0x8000000
+	FAN_MARK_ADD                         = 0x1
+	FAN_MARK_DONT_FOLLOW                 = 0x4
+	FAN_MARK_FILESYSTEM                  = 0x100
+	FAN_MARK_FLUSH                       = 0x80
+	FAN_MARK_IGNORED_MASK                = 0x20
+	FAN_MARK_IGNORED_SURV_MODIFY         = 0x40
+	FAN_MARK_INODE                       = 0x0
+	FAN_MARK_MOUNT                       = 0x10
+	FAN_MARK_ONLYDIR                     = 0x8
+	FAN_MARK_REMOVE                      = 0x2
+	FAN_MODIFY                           = 0x2
+	FAN_NOFD                             = -0x1
+	FAN_NONBLOCK                         = 0x2
+	FAN_ONDIR                            = 0x40000000
+	FAN_OPEN                             = 0x20
+	FAN_OPEN_PERM                        = 0x10000
+	FAN_Q_OVERFLOW                       = 0x4000
+	FAN_REPORT_TID                       = 0x100
+	FAN_UNLIMITED_MARKS                  = 0x20
+	FAN_UNLIMITED_QUEUE                  = 0x10
 	FD_CLOEXEC                           = 0x1
 	FD_SETSIZE                           = 0x400
 	FF0                                  = 0x0
diff --git a/unix/zerrors_linux_ppc64le.go b/unix/zerrors_linux_ppc64le.go
index 02938cb..462e81a 100644
--- a/unix/zerrors_linux_ppc64le.go
+++ b/unix/zerrors_linux_ppc64le.go
@@ -486,6 +486,48 @@
 	FALLOC_FL_PUNCH_HOLE                 = 0x2
 	FALLOC_FL_UNSHARE_RANGE              = 0x40
 	FALLOC_FL_ZERO_RANGE                 = 0x10
+	FANOTIFY_METADATA_VERSION            = 0x3
+	FAN_ACCESS                           = 0x1
+	FAN_ACCESS_PERM                      = 0x20000
+	FAN_ALLOW                            = 0x1
+	FAN_ALL_CLASS_BITS                   = 0xc
+	FAN_ALL_EVENTS                       = 0x3b
+	FAN_ALL_INIT_FLAGS                   = 0x3f
+	FAN_ALL_MARK_FLAGS                   = 0xff
+	FAN_ALL_OUTGOING_EVENTS              = 0x3403b
+	FAN_ALL_PERM_EVENTS                  = 0x30000
+	FAN_AUDIT                            = 0x10
+	FAN_CLASS_CONTENT                    = 0x4
+	FAN_CLASS_NOTIF                      = 0x0
+	FAN_CLASS_PRE_CONTENT                = 0x8
+	FAN_CLOEXEC                          = 0x1
+	FAN_CLOSE                            = 0x18
+	FAN_CLOSE_NOWRITE                    = 0x10
+	FAN_CLOSE_WRITE                      = 0x8
+	FAN_DENY                             = 0x2
+	FAN_ENABLE_AUDIT                     = 0x40
+	FAN_EVENT_METADATA_LEN               = 0x18
+	FAN_EVENT_ON_CHILD                   = 0x8000000
+	FAN_MARK_ADD                         = 0x1
+	FAN_MARK_DONT_FOLLOW                 = 0x4
+	FAN_MARK_FILESYSTEM                  = 0x100
+	FAN_MARK_FLUSH                       = 0x80
+	FAN_MARK_IGNORED_MASK                = 0x20
+	FAN_MARK_IGNORED_SURV_MODIFY         = 0x40
+	FAN_MARK_INODE                       = 0x0
+	FAN_MARK_MOUNT                       = 0x10
+	FAN_MARK_ONLYDIR                     = 0x8
+	FAN_MARK_REMOVE                      = 0x2
+	FAN_MODIFY                           = 0x2
+	FAN_NOFD                             = -0x1
+	FAN_NONBLOCK                         = 0x2
+	FAN_ONDIR                            = 0x40000000
+	FAN_OPEN                             = 0x20
+	FAN_OPEN_PERM                        = 0x10000
+	FAN_Q_OVERFLOW                       = 0x4000
+	FAN_REPORT_TID                       = 0x100
+	FAN_UNLIMITED_MARKS                  = 0x20
+	FAN_UNLIMITED_QUEUE                  = 0x10
 	FD_CLOEXEC                           = 0x1
 	FD_SETSIZE                           = 0x400
 	FF0                                  = 0x0
diff --git a/unix/zerrors_linux_riscv64.go b/unix/zerrors_linux_riscv64.go
index 5aea4b9..ae5e61c 100644
--- a/unix/zerrors_linux_riscv64.go
+++ b/unix/zerrors_linux_riscv64.go
@@ -486,6 +486,48 @@
 	FALLOC_FL_PUNCH_HOLE                 = 0x2
 	FALLOC_FL_UNSHARE_RANGE              = 0x40
 	FALLOC_FL_ZERO_RANGE                 = 0x10
+	FANOTIFY_METADATA_VERSION            = 0x3
+	FAN_ACCESS                           = 0x1
+	FAN_ACCESS_PERM                      = 0x20000
+	FAN_ALLOW                            = 0x1
+	FAN_ALL_CLASS_BITS                   = 0xc
+	FAN_ALL_EVENTS                       = 0x3b
+	FAN_ALL_INIT_FLAGS                   = 0x3f
+	FAN_ALL_MARK_FLAGS                   = 0xff
+	FAN_ALL_OUTGOING_EVENTS              = 0x3403b
+	FAN_ALL_PERM_EVENTS                  = 0x30000
+	FAN_AUDIT                            = 0x10
+	FAN_CLASS_CONTENT                    = 0x4
+	FAN_CLASS_NOTIF                      = 0x0
+	FAN_CLASS_PRE_CONTENT                = 0x8
+	FAN_CLOEXEC                          = 0x1
+	FAN_CLOSE                            = 0x18
+	FAN_CLOSE_NOWRITE                    = 0x10
+	FAN_CLOSE_WRITE                      = 0x8
+	FAN_DENY                             = 0x2
+	FAN_ENABLE_AUDIT                     = 0x40
+	FAN_EVENT_METADATA_LEN               = 0x18
+	FAN_EVENT_ON_CHILD                   = 0x8000000
+	FAN_MARK_ADD                         = 0x1
+	FAN_MARK_DONT_FOLLOW                 = 0x4
+	FAN_MARK_FILESYSTEM                  = 0x100
+	FAN_MARK_FLUSH                       = 0x80
+	FAN_MARK_IGNORED_MASK                = 0x20
+	FAN_MARK_IGNORED_SURV_MODIFY         = 0x40
+	FAN_MARK_INODE                       = 0x0
+	FAN_MARK_MOUNT                       = 0x10
+	FAN_MARK_ONLYDIR                     = 0x8
+	FAN_MARK_REMOVE                      = 0x2
+	FAN_MODIFY                           = 0x2
+	FAN_NOFD                             = -0x1
+	FAN_NONBLOCK                         = 0x2
+	FAN_ONDIR                            = 0x40000000
+	FAN_OPEN                             = 0x20
+	FAN_OPEN_PERM                        = 0x10000
+	FAN_Q_OVERFLOW                       = 0x4000
+	FAN_REPORT_TID                       = 0x100
+	FAN_UNLIMITED_MARKS                  = 0x20
+	FAN_UNLIMITED_QUEUE                  = 0x10
 	FD_CLOEXEC                           = 0x1
 	FD_SETSIZE                           = 0x400
 	FF0                                  = 0x0
diff --git a/unix/zerrors_linux_s390x.go b/unix/zerrors_linux_s390x.go
index 7f7c2e3..a2f8108 100644
--- a/unix/zerrors_linux_s390x.go
+++ b/unix/zerrors_linux_s390x.go
@@ -486,6 +486,48 @@
 	FALLOC_FL_PUNCH_HOLE                 = 0x2
 	FALLOC_FL_UNSHARE_RANGE              = 0x40
 	FALLOC_FL_ZERO_RANGE                 = 0x10
+	FANOTIFY_METADATA_VERSION            = 0x3
+	FAN_ACCESS                           = 0x1
+	FAN_ACCESS_PERM                      = 0x20000
+	FAN_ALLOW                            = 0x1
+	FAN_ALL_CLASS_BITS                   = 0xc
+	FAN_ALL_EVENTS                       = 0x3b
+	FAN_ALL_INIT_FLAGS                   = 0x3f
+	FAN_ALL_MARK_FLAGS                   = 0xff
+	FAN_ALL_OUTGOING_EVENTS              = 0x3403b
+	FAN_ALL_PERM_EVENTS                  = 0x30000
+	FAN_AUDIT                            = 0x10
+	FAN_CLASS_CONTENT                    = 0x4
+	FAN_CLASS_NOTIF                      = 0x0
+	FAN_CLASS_PRE_CONTENT                = 0x8
+	FAN_CLOEXEC                          = 0x1
+	FAN_CLOSE                            = 0x18
+	FAN_CLOSE_NOWRITE                    = 0x10
+	FAN_CLOSE_WRITE                      = 0x8
+	FAN_DENY                             = 0x2
+	FAN_ENABLE_AUDIT                     = 0x40
+	FAN_EVENT_METADATA_LEN               = 0x18
+	FAN_EVENT_ON_CHILD                   = 0x8000000
+	FAN_MARK_ADD                         = 0x1
+	FAN_MARK_DONT_FOLLOW                 = 0x4
+	FAN_MARK_FILESYSTEM                  = 0x100
+	FAN_MARK_FLUSH                       = 0x80
+	FAN_MARK_IGNORED_MASK                = 0x20
+	FAN_MARK_IGNORED_SURV_MODIFY         = 0x40
+	FAN_MARK_INODE                       = 0x0
+	FAN_MARK_MOUNT                       = 0x10
+	FAN_MARK_ONLYDIR                     = 0x8
+	FAN_MARK_REMOVE                      = 0x2
+	FAN_MODIFY                           = 0x2
+	FAN_NOFD                             = -0x1
+	FAN_NONBLOCK                         = 0x2
+	FAN_ONDIR                            = 0x40000000
+	FAN_OPEN                             = 0x20
+	FAN_OPEN_PERM                        = 0x10000
+	FAN_Q_OVERFLOW                       = 0x4000
+	FAN_REPORT_TID                       = 0x100
+	FAN_UNLIMITED_MARKS                  = 0x20
+	FAN_UNLIMITED_QUEUE                  = 0x10
 	FD_CLOEXEC                           = 0x1
 	FD_SETSIZE                           = 0x400
 	FF0                                  = 0x0
diff --git a/unix/zerrors_linux_sparc64.go b/unix/zerrors_linux_sparc64.go
index 968e21f..10ffe35 100644
--- a/unix/zerrors_linux_sparc64.go
+++ b/unix/zerrors_linux_sparc64.go
@@ -490,6 +490,48 @@
 	FALLOC_FL_PUNCH_HOLE                 = 0x2
 	FALLOC_FL_UNSHARE_RANGE              = 0x40
 	FALLOC_FL_ZERO_RANGE                 = 0x10
+	FANOTIFY_METADATA_VERSION            = 0x3
+	FAN_ACCESS                           = 0x1
+	FAN_ACCESS_PERM                      = 0x20000
+	FAN_ALLOW                            = 0x1
+	FAN_ALL_CLASS_BITS                   = 0xc
+	FAN_ALL_EVENTS                       = 0x3b
+	FAN_ALL_INIT_FLAGS                   = 0x3f
+	FAN_ALL_MARK_FLAGS                   = 0xff
+	FAN_ALL_OUTGOING_EVENTS              = 0x3403b
+	FAN_ALL_PERM_EVENTS                  = 0x30000
+	FAN_AUDIT                            = 0x10
+	FAN_CLASS_CONTENT                    = 0x4
+	FAN_CLASS_NOTIF                      = 0x0
+	FAN_CLASS_PRE_CONTENT                = 0x8
+	FAN_CLOEXEC                          = 0x1
+	FAN_CLOSE                            = 0x18
+	FAN_CLOSE_NOWRITE                    = 0x10
+	FAN_CLOSE_WRITE                      = 0x8
+	FAN_DENY                             = 0x2
+	FAN_ENABLE_AUDIT                     = 0x40
+	FAN_EVENT_METADATA_LEN               = 0x18
+	FAN_EVENT_ON_CHILD                   = 0x8000000
+	FAN_MARK_ADD                         = 0x1
+	FAN_MARK_DONT_FOLLOW                 = 0x4
+	FAN_MARK_FILESYSTEM                  = 0x100
+	FAN_MARK_FLUSH                       = 0x80
+	FAN_MARK_IGNORED_MASK                = 0x20
+	FAN_MARK_IGNORED_SURV_MODIFY         = 0x40
+	FAN_MARK_INODE                       = 0x0
+	FAN_MARK_MOUNT                       = 0x10
+	FAN_MARK_ONLYDIR                     = 0x8
+	FAN_MARK_REMOVE                      = 0x2
+	FAN_MODIFY                           = 0x2
+	FAN_NOFD                             = -0x1
+	FAN_NONBLOCK                         = 0x2
+	FAN_ONDIR                            = 0x40000000
+	FAN_OPEN                             = 0x20
+	FAN_OPEN_PERM                        = 0x10000
+	FAN_Q_OVERFLOW                       = 0x4000
+	FAN_REPORT_TID                       = 0x100
+	FAN_UNLIMITED_MARKS                  = 0x20
+	FAN_UNLIMITED_QUEUE                  = 0x10
 	FD_CLOEXEC                           = 0x1
 	FD_SETSIZE                           = 0x400
 	FF0                                  = 0x0
diff --git a/unix/zsyscall_linux_386.go b/unix/zsyscall_linux_386.go
index c8b4510..9855afa 100644
--- a/unix/zsyscall_linux_386.go
+++ b/unix/zsyscall_linux_386.go
@@ -14,6 +14,27 @@
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) {
+	r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0)
+	fd = int(r0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) {
+	_, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(mask>>32), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)))
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func fchmodat(dirfd int, path string, mode uint32) (err error) {
 	var _p0 *byte
 	_p0, err = BytePtrFromString(path)
diff --git a/unix/zsyscall_linux_amd64.go b/unix/zsyscall_linux_amd64.go
index 2aac318..773e251 100644
--- a/unix/zsyscall_linux_amd64.go
+++ b/unix/zsyscall_linux_amd64.go
@@ -14,6 +14,27 @@
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) {
+	r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0)
+	fd = int(r0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) {
+	_, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func fchmodat(dirfd int, path string, mode uint32) (err error) {
 	var _p0 *byte
 	_p0, err = BytePtrFromString(path)
diff --git a/unix/zsyscall_linux_arm.go b/unix/zsyscall_linux_arm.go
index 13c06c2..370b656 100644
--- a/unix/zsyscall_linux_arm.go
+++ b/unix/zsyscall_linux_arm.go
@@ -14,6 +14,27 @@
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) {
+	r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0)
+	fd = int(r0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) {
+	_, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(mask>>32), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)))
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func fchmodat(dirfd int, path string, mode uint32) (err error) {
 	var _p0 *byte
 	_p0, err = BytePtrFromString(path)
diff --git a/unix/zsyscall_linux_arm64.go b/unix/zsyscall_linux_arm64.go
index 737fa8d..7214e3f 100644
--- a/unix/zsyscall_linux_arm64.go
+++ b/unix/zsyscall_linux_arm64.go
@@ -14,6 +14,27 @@
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) {
+	r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0)
+	fd = int(r0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) {
+	_, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func fchmodat(dirfd int, path string, mode uint32) (err error) {
 	var _p0 *byte
 	_p0, err = BytePtrFromString(path)
diff --git a/unix/zsyscall_linux_mips.go b/unix/zsyscall_linux_mips.go
index 0a85f3f..68b3251 100644
--- a/unix/zsyscall_linux_mips.go
+++ b/unix/zsyscall_linux_mips.go
@@ -14,6 +14,27 @@
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) {
+	r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0)
+	fd = int(r0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) {
+	_, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask>>32), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)))
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func fchmodat(dirfd int, path string, mode uint32) (err error) {
 	var _p0 *byte
 	_p0, err = BytePtrFromString(path)
diff --git a/unix/zsyscall_linux_mips64.go b/unix/zsyscall_linux_mips64.go
index ec7007e..a8be407 100644
--- a/unix/zsyscall_linux_mips64.go
+++ b/unix/zsyscall_linux_mips64.go
@@ -14,6 +14,27 @@
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) {
+	r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0)
+	fd = int(r0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) {
+	_, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func fchmodat(dirfd int, path string, mode uint32) (err error) {
 	var _p0 *byte
 	_p0, err = BytePtrFromString(path)
diff --git a/unix/zsyscall_linux_mips64le.go b/unix/zsyscall_linux_mips64le.go
index c5bb25d..1351028 100644
--- a/unix/zsyscall_linux_mips64le.go
+++ b/unix/zsyscall_linux_mips64le.go
@@ -14,6 +14,27 @@
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) {
+	r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0)
+	fd = int(r0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) {
+	_, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func fchmodat(dirfd int, path string, mode uint32) (err error) {
 	var _p0 *byte
 	_p0, err = BytePtrFromString(path)
diff --git a/unix/zsyscall_linux_mipsle.go b/unix/zsyscall_linux_mipsle.go
index 26ada04..327b4f9 100644
--- a/unix/zsyscall_linux_mipsle.go
+++ b/unix/zsyscall_linux_mipsle.go
@@ -14,6 +14,27 @@
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) {
+	r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0)
+	fd = int(r0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) {
+	_, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(mask>>32), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)))
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func fchmodat(dirfd int, path string, mode uint32) (err error) {
 	var _p0 *byte
 	_p0, err = BytePtrFromString(path)
diff --git a/unix/zsyscall_linux_ppc64.go b/unix/zsyscall_linux_ppc64.go
index 2da9cb7..c145bd3 100644
--- a/unix/zsyscall_linux_ppc64.go
+++ b/unix/zsyscall_linux_ppc64.go
@@ -14,6 +14,27 @@
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) {
+	r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0)
+	fd = int(r0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) {
+	_, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func fchmodat(dirfd int, path string, mode uint32) (err error) {
 	var _p0 *byte
 	_p0, err = BytePtrFromString(path)
diff --git a/unix/zsyscall_linux_ppc64le.go b/unix/zsyscall_linux_ppc64le.go
index 772733d..cd8179c 100644
--- a/unix/zsyscall_linux_ppc64le.go
+++ b/unix/zsyscall_linux_ppc64le.go
@@ -14,6 +14,27 @@
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) {
+	r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0)
+	fd = int(r0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) {
+	_, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func fchmodat(dirfd int, path string, mode uint32) (err error) {
 	var _p0 *byte
 	_p0, err = BytePtrFromString(path)
diff --git a/unix/zsyscall_linux_riscv64.go b/unix/zsyscall_linux_riscv64.go
index 996eba5..928b600 100644
--- a/unix/zsyscall_linux_riscv64.go
+++ b/unix/zsyscall_linux_riscv64.go
@@ -14,6 +14,27 @@
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) {
+	r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0)
+	fd = int(r0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) {
+	_, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func fchmodat(dirfd int, path string, mode uint32) (err error) {
 	var _p0 *byte
 	_p0, err = BytePtrFromString(path)
diff --git a/unix/zsyscall_linux_s390x.go b/unix/zsyscall_linux_s390x.go
index cb9072a..fe9c7e1 100644
--- a/unix/zsyscall_linux_s390x.go
+++ b/unix/zsyscall_linux_s390x.go
@@ -14,6 +14,27 @@
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) {
+	r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0)
+	fd = int(r0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) {
+	_, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func fchmodat(dirfd int, path string, mode uint32) (err error) {
 	var _p0 *byte
 	_p0, err = BytePtrFromString(path)
diff --git a/unix/zsyscall_linux_sparc64.go b/unix/zsyscall_linux_sparc64.go
index 5e48a10..d4a2100 100644
--- a/unix/zsyscall_linux_sparc64.go
+++ b/unix/zsyscall_linux_sparc64.go
@@ -14,6 +14,27 @@
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) {
+	r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0)
+	fd = int(r0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) {
+	_, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0)
+	if e1 != 0 {
+		err = errnoErr(e1)
+	}
+	return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func fchmodat(dirfd int, path string, mode uint32) (err error) {
 	var _p0 *byte
 	_p0, err = BytePtrFromString(path)
diff --git a/unix/ztypes_linux_386.go b/unix/ztypes_linux_386.go
index 1872467..25a3be6 100644
--- a/unix/ztypes_linux_386.go
+++ b/unix/ztypes_linux_386.go
@@ -2043,3 +2043,18 @@
 	Info   uint32
 	Data   uint32
 }
+
+type FanotifyEventMetadata struct {
+	Event_len    uint32
+	Vers         uint8
+	Reserved     uint8
+	Metadata_len uint16
+	Mask         uint64
+	Fd           int32
+	Pid          int32
+}
+
+type FanotifyResponse struct {
+	Fd       int32
+	Response uint32
+}
diff --git a/unix/ztypes_linux_amd64.go b/unix/ztypes_linux_amd64.go
index 6ddbf06..9f6b975 100644
--- a/unix/ztypes_linux_amd64.go
+++ b/unix/ztypes_linux_amd64.go
@@ -2056,3 +2056,18 @@
 	Info   uint32
 	Data   uint32
 }
+
+type FanotifyEventMetadata struct {
+	Event_len    uint32
+	Vers         uint8
+	Reserved     uint8
+	Metadata_len uint16
+	Mask         uint64
+	Fd           int32
+	Pid          int32
+}
+
+type FanotifyResponse struct {
+	Fd       int32
+	Response uint32
+}
diff --git a/unix/ztypes_linux_arm.go b/unix/ztypes_linux_arm.go
index b8e3ec1..c944db2 100644
--- a/unix/ztypes_linux_arm.go
+++ b/unix/ztypes_linux_arm.go
@@ -2034,3 +2034,18 @@
 	Info   uint32
 	Data   uint32
 }
+
+type FanotifyEventMetadata struct {
+	Event_len    uint32
+	Vers         uint8
+	Reserved     uint8
+	Metadata_len uint16
+	Mask         uint64
+	Fd           int32
+	Pid          int32
+}
+
+type FanotifyResponse struct {
+	Fd       int32
+	Response uint32
+}
diff --git a/unix/ztypes_linux_arm64.go b/unix/ztypes_linux_arm64.go
index 2f73f00..e6f4bad 100644
--- a/unix/ztypes_linux_arm64.go
+++ b/unix/ztypes_linux_arm64.go
@@ -2035,3 +2035,18 @@
 	Info   uint32
 	Data   uint32
 }
+
+type FanotifyEventMetadata struct {
+	Event_len    uint32
+	Vers         uint8
+	Reserved     uint8
+	Metadata_len uint16
+	Mask         uint64
+	Fd           int32
+	Pid          int32
+}
+
+type FanotifyResponse struct {
+	Fd       int32
+	Response uint32
+}
diff --git a/unix/ztypes_linux_mips.go b/unix/ztypes_linux_mips.go
index 4a2a18b..205d1c5 100644
--- a/unix/ztypes_linux_mips.go
+++ b/unix/ztypes_linux_mips.go
@@ -2040,3 +2040,18 @@
 	Info   uint32
 	Data   uint32
 }
+
+type FanotifyEventMetadata struct {
+	Event_len    uint32
+	Vers         uint8
+	Reserved     uint8
+	Metadata_len uint16
+	Mask         uint64
+	Fd           int32
+	Pid          int32
+}
+
+type FanotifyResponse struct {
+	Fd       int32
+	Response uint32
+}
diff --git a/unix/ztypes_linux_mips64.go b/unix/ztypes_linux_mips64.go
index 41e4513..d055d44 100644
--- a/unix/ztypes_linux_mips64.go
+++ b/unix/ztypes_linux_mips64.go
@@ -2037,3 +2037,18 @@
 	Info   uint32
 	Data   uint32
 }
+
+type FanotifyEventMetadata struct {
+	Event_len    uint32
+	Vers         uint8
+	Reserved     uint8
+	Metadata_len uint16
+	Mask         uint64
+	Fd           int32
+	Pid          int32
+}
+
+type FanotifyResponse struct {
+	Fd       int32
+	Response uint32
+}
diff --git a/unix/ztypes_linux_mips64le.go b/unix/ztypes_linux_mips64le.go
index 4a3d74b..cb6a1f7 100644
--- a/unix/ztypes_linux_mips64le.go
+++ b/unix/ztypes_linux_mips64le.go
@@ -2037,3 +2037,18 @@
 	Info   uint32
 	Data   uint32
 }
+
+type FanotifyEventMetadata struct {
+	Event_len    uint32
+	Vers         uint8
+	Reserved     uint8
+	Metadata_len uint16
+	Mask         uint64
+	Fd           int32
+	Pid          int32
+}
+
+type FanotifyResponse struct {
+	Fd       int32
+	Response uint32
+}
diff --git a/unix/ztypes_linux_mipsle.go b/unix/ztypes_linux_mipsle.go
index 8ae3ca4..93cd4a4 100644
--- a/unix/ztypes_linux_mipsle.go
+++ b/unix/ztypes_linux_mipsle.go
@@ -2040,3 +2040,18 @@
 	Info   uint32
 	Data   uint32
 }
+
+type FanotifyEventMetadata struct {
+	Event_len    uint32
+	Vers         uint8
+	Reserved     uint8
+	Metadata_len uint16
+	Mask         uint64
+	Fd           int32
+	Pid          int32
+}
+
+type FanotifyResponse struct {
+	Fd       int32
+	Response uint32
+}
diff --git a/unix/ztypes_linux_ppc64.go b/unix/ztypes_linux_ppc64.go
index 50294c9..a502c8e 100644
--- a/unix/ztypes_linux_ppc64.go
+++ b/unix/ztypes_linux_ppc64.go
@@ -2045,3 +2045,18 @@
 	Info   uint32
 	Data   uint32
 }
+
+type FanotifyEventMetadata struct {
+	Event_len    uint32
+	Vers         uint8
+	Reserved     uint8
+	Metadata_len uint16
+	Mask         uint64
+	Fd           int32
+	Pid          int32
+}
+
+type FanotifyResponse struct {
+	Fd       int32
+	Response uint32
+}
diff --git a/unix/ztypes_linux_ppc64le.go b/unix/ztypes_linux_ppc64le.go
index d2acf3a..fd7582f 100644
--- a/unix/ztypes_linux_ppc64le.go
+++ b/unix/ztypes_linux_ppc64le.go
@@ -2045,3 +2045,18 @@
 	Info   uint32
 	Data   uint32
 }
+
+type FanotifyEventMetadata struct {
+	Event_len    uint32
+	Vers         uint8
+	Reserved     uint8
+	Metadata_len uint16
+	Mask         uint64
+	Fd           int32
+	Pid          int32
+}
+
+type FanotifyResponse struct {
+	Fd       int32
+	Response uint32
+}
diff --git a/unix/ztypes_linux_riscv64.go b/unix/ztypes_linux_riscv64.go
index 675c596..56e5a72 100644
--- a/unix/ztypes_linux_riscv64.go
+++ b/unix/ztypes_linux_riscv64.go
@@ -2062,3 +2062,18 @@
 	Info   uint32
 	Data   uint32
 }
+
+type FanotifyEventMetadata struct {
+	Event_len    uint32
+	Vers         uint8
+	Reserved     uint8
+	Metadata_len uint16
+	Mask         uint64
+	Fd           int32
+	Pid          int32
+}
+
+type FanotifyResponse struct {
+	Fd       int32
+	Response uint32
+}
diff --git a/unix/ztypes_linux_s390x.go b/unix/ztypes_linux_s390x.go
index 9f2cf0d..c3a1cbd 100644
--- a/unix/ztypes_linux_s390x.go
+++ b/unix/ztypes_linux_s390x.go
@@ -2059,3 +2059,18 @@
 	Info   uint32
 	Data   uint32
 }
+
+type FanotifyEventMetadata struct {
+	Event_len    uint32
+	Vers         uint8
+	Reserved     uint8
+	Metadata_len uint16
+	Mask         uint64
+	Fd           int32
+	Pid          int32
+}
+
+type FanotifyResponse struct {
+	Fd       int32
+	Response uint32
+}
diff --git a/unix/ztypes_linux_sparc64.go b/unix/ztypes_linux_sparc64.go
index 6864390..75021e7 100644
--- a/unix/ztypes_linux_sparc64.go
+++ b/unix/ztypes_linux_sparc64.go
@@ -2040,3 +2040,18 @@
 	Info   uint32
 	Data   uint32
 }
+
+type FanotifyEventMetadata struct {
+	Event_len    uint32
+	Vers         uint8
+	Reserved     uint8
+	Metadata_len uint16
+	Mask         uint64
+	Fd           int32
+	Pid          int32
+}
+
+type FanotifyResponse struct {
+	Fd       int32
+	Response uint32
+}