summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/syscalls/linux/flags.go
diff options
context:
space:
mode:
authorIan Gudger <igudger@google.com>2018-06-21 10:52:33 -0700
committerShentubot <shentubot@google.com>2018-06-21 10:53:21 -0700
commitd571a4359cebbcf8a9b201bb125f1cdc9fb126e4 (patch)
tree53d993db5ab045897c4ad50bb73670e3f018ffea /pkg/sentry/syscalls/linux/flags.go
parentf2a687001ded18a4343c1aa3bfba18b08c6a816a (diff)
Implement ioctl(FIOASYNC)
FIOASYNC and friends are used to send signals when a file is ready for IO. This may or may not be needed by Nginx. While Nginx does use it, it is unclear if the code that uses it has any effect. PiperOrigin-RevId: 201550828 Change-Id: I7ba05a7db4eb2dfffde11e9bd9a35b65b98d7f50
Diffstat (limited to 'pkg/sentry/syscalls/linux/flags.go')
-rw-r--r--pkg/sentry/syscalls/linux/flags.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/sentry/syscalls/linux/flags.go b/pkg/sentry/syscalls/linux/flags.go
index 82bfd7c2a..3d39a20f4 100644
--- a/pkg/sentry/syscalls/linux/flags.go
+++ b/pkg/sentry/syscalls/linux/flags.go
@@ -61,6 +61,9 @@ func flagsToLinux(flags fs.FileFlags) (mask uint) {
if flags.Directory {
mask |= syscall.O_DIRECTORY
}
+ if flags.Async {
+ mask |= syscall.O_ASYNC
+ }
switch {
case flags.Read && flags.Write:
mask |= syscall.O_RDWR
@@ -82,6 +85,7 @@ func linuxToFlags(mask uint) (flags fs.FileFlags) {
Write: (mask & syscall.O_ACCMODE) != syscall.O_RDONLY,
Append: mask&syscall.O_APPEND != 0,
Directory: mask&syscall.O_DIRECTORY != 0,
+ Async: mask&syscall.O_ASYNC != 0,
}
}
@@ -91,5 +95,6 @@ func linuxToSettableFlags(mask uint) fs.SettableFileFlags {
Direct: mask&syscall.O_DIRECT != 0,
NonBlocking: mask&syscall.O_NONBLOCK != 0,
Append: mask&syscall.O_APPEND != 0,
+ Async: mask&syscall.O_ASYNC != 0,
}
}