Skip to content
Snippets Groups Projects
Commit c5a9c8d0 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Gopher Robot
Browse files

syscall: add O_DIRECTORY for wasip1

Change-Id: Iadd69360fb09714a280c4dae26639834df28a7dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/606659


LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: default avatarIan Lance Taylor <iant@google.com>
Reviewed-by: default avatarTobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: default avatarCherry Mui <cherryyz@google.com>
parent f0f4e2d0
No related branches found
No related tags found
No related merge requests found
......@@ -542,6 +542,14 @@ func Open(path string, openmode int, perm uint32) (int, error) {
rights = fileRights
}
if (openmode & O_DIRECTORY) != 0 {
if openmode&(O_WRONLY|O_RDWR) != 0 {
return -1, EISDIR
}
oflags |= OFLAG_DIRECTORY
rights &= dirRights
}
var fdflags fdflags
if (openmode & O_APPEND) != 0 {
fdflags |= FDFLAG_APPEND
......
......@@ -216,12 +216,13 @@ const (
O_WRONLY = 1
O_RDWR = 2
O_CREAT = 0100
O_CREATE = O_CREAT
O_TRUNC = 01000
O_APPEND = 02000
O_EXCL = 0200
O_SYNC = 010000
O_CREAT = 0100
O_CREATE = O_CREAT
O_TRUNC = 01000
O_APPEND = 02000
O_EXCL = 0200
O_SYNC = 010000
O_DIRECTORY = 020000
O_CLOEXEC = 0
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment