diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-05-28 12:46:44 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-05-28 12:46:44 -0400 |
| commit | c518b7b8bf71ad77adc96b5c9dabea277fe3ee43 (patch) | |
| tree | cc5d15a0a272ac17b50ad98eb8a22fb3131049d9 /std/os.zig | |
| parent | 381f845287c8aef25a5351be81dfdfad055f0785 (diff) | |
| download | zig-c518b7b8bf71ad77adc96b5c9dabea277fe3ee43.tar.gz zig-c518b7b8bf71ad77adc96b5c9dabea277fe3ee43.zip | |
thread.spawn: bubble up mprotect error.OutOfMemory
Diffstat (limited to 'std/os.zig')
| -rw-r--r-- | std/os.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/std/os.zig b/std/os.zig index 14f205c1aa..6f1f0135ce 100644 --- a/std/os.zig +++ b/std/os.zig @@ -1883,7 +1883,16 @@ pub fn inotify_rm_watch(inotify_fd: i32, wd: i32) void { } pub const MProtectError = error{ + /// The memory cannot be given the specified access. This can happen, for example, if you + /// mmap(2) a file to which you have read-only access, then ask mprotect() to mark it + /// PROT_WRITE. AccessDenied, + + /// Changing the protection of a memory region would result in the total number of map‐ + /// pings with distinct attributes (e.g., read versus read/write protection) exceeding the + /// allowed maximum. (For example, making the protection of a range PROT_READ in the mid‐ + /// dle of a region currently protected as PROT_READ|PROT_WRITE would result in three map‐ + /// pings: two read/write mappings at each end and a read-only mapping in the middle.) OutOfMemory, Unexpected, }; |
