#Would std.os.mmap work on Windows
1 messages · Page 1 of 1 (latest)
I believe it should work if you're linking libc?
but otherwise, I don't see any code for it to work on windows
Last I checked you have to define the extern functions required for it yourself, and if you want crossplatform compatibility then you have to wrap that yourself too
what are you referring to?
the functions to map memory are exposed in std.os.windows and std.os.linux afaik
it's just std.os.mmap specifically that only works on posixy systems or while linking libc
oh, are they actually defined (in std.os.windows) now? I had to declare CreateFileMappingW and friends because I didn't see it when I looked, though that was last month
Oh, suppose those aren't there then
that is a bit odd
have you considered PRing them?
Anyway, the windows C interface doesn't declare mmap, so std.os.mmap is only posix-portable
that seems like those should be in the stdlib
How do I link libc?
I should probably PR the actual declarations, yeah. I also have a very basic interface for wrapping it and std.os.mmap together into one interface at https://github.com/DagothGares/kTools/blob/main/src/util/FileMap.zig
ye, sounds a worthwhile endeavour