aboutsummaryrefslogtreecommitdiff
path: root/std/dynamic_library.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-05-29 23:45:28 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-05-30 00:04:11 -0400
commit8ca294c430ecc4e878d9e5cfb178c20c07b83514 (patch)
treeb9d4e1616de6417c172bfadfb39e36b922c70d1e /std/dynamic_library.zig
parent8eaf1387c712c62e96fa165ac3390c8f8f924daa (diff)
downloadzig-8ca294c430ecc4e878d9e5cfb178c20c07b83514.tar.gz
zig-8ca294c430ecc4e878d9e5cfb178c20c07b83514.zip
update load dynamic library test for std lib changes
Diffstat (limited to 'std/dynamic_library.zig')
-rw-r--r--std/dynamic_library.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/std/dynamic_library.zig b/std/dynamic_library.zig
index 79e325b81e..3413788019 100644
--- a/std/dynamic_library.zig
+++ b/std/dynamic_library.zig
@@ -108,11 +108,12 @@ pub const LinuxDynLib = struct {
const fd = try os.open(path, 0, os.O_RDONLY | os.O_CLOEXEC);
errdefer os.close(fd);
+ // TODO remove this @intCast
const size = @intCast(usize, (try os.fstat(fd)).size);
const bytes = try os.mmap(
null,
- size,
+ mem.alignForward(size, mem.page_size),
os.PROT_READ | os.PROT_EXEC,
os.MAP_PRIVATE,
fd,