Commit Graph

517 Commits

Author SHA1 Message Date
Andrew Kelley
67726e36b0
extract posix functions from std/os.zig to std/os/posix.zig
See #2380
2019-05-26 18:32:40 -04:00
emekoi
1c73c08298 ran zig fmt on stdlib 2019-05-19 16:33:31 -04:00
LemonBoy
232bc1bdee Remove more 64bit-centric assumptions from stdlib 2019-05-18 11:08:04 +02:00
LemonBoy
51aaa02679 VDSO calls must use the C CC 2019-05-16 22:10:38 -04:00
daurnimator
e30cd800e2 std: update linux syscalls to 5.1 2019-05-16 12:38:40 -04:00
Andrew Kelley
c1793d6106
zig fmt on the standard library 2019-05-12 12:56:01 -04:00
Andrew Kelley
32efa68f90
Merge pull request #2449 from Sahnvour/directallocator
Rework of windows' DirectAllocator
2019-05-11 13:04:20 -04:00
Sahnvour
a2d5b0fabe Implement Windows' DirectAllocator on top of VirtualAlloc and VirtualFree. 2019-05-11 16:41:13 +02:00
LemonBoy
1b23348f30 linux: Minor zig fmt induced reformatting 2019-05-11 10:34:22 +02:00
LemonBoy
715d808f14 linux: Fix clock_gettime on systems w/o VDSO 2019-05-11 10:33:41 +02:00
Andrew Kelley
9c0596e627
Merge pull request #2427 from LemonBoy/linux-tls
Proper support for TLS on linux
2019-05-07 12:26:26 -04:00
Andrew Kelley
097a62555e
Merge pull request #2439 from LemonBoy/fixes-fixes-fixes
A batch of miscellaneous fixes
2019-05-07 12:26:02 -04:00
LemonBoy
043bd71621 Add ARCH_SET_* definitions for x86_64 2019-05-07 13:19:38 +02:00
LemonBoy
b1db696c10 Less error messages
Decrease the overall size of the binary, programming errors are caught
with unreachable.
2019-05-07 13:09:20 +02:00
LemonBoy
cfcf02489d std: Implement on-demand TLS allocation 2019-05-07 13:09:19 +02:00
LemonBoy
d8ab301aa8 std: Implement TLS support for Linux
Tested on x86_64, i386, ARM, AARCH64
2019-05-07 13:09:18 +02:00
Andrew Kelley
7432fb04d6
Merge pull request #2354 from LemonBoy/iterate_phdr_impl
dl_iterate_phdr implementation
2019-05-06 15:48:37 -04:00
LemonBoy
60242e96df Fix definition of epoll_* struct on non x86_64 arches 2019-05-06 21:39:02 +02:00
LemonBoy
a095db0df7 Add a test case 2019-05-06 18:30:49 +02:00
LemonBoy
07dfccf967 Review 2019-05-05 13:00:20 +02:00
Andrew Kelley
5d347c01cf
Merge pull request #2374 from LemonBoy/fileszoff-reform
Make io offsets/sizes u64 instead of usize
2019-05-04 15:20:42 -04:00
Andrew Kelley
09cbcf8841
std lib sleep APIs: add doc comments and no @intCast
The sleep APIs are now documented as having spurious wakeups and no
precision of timing guaranteed. They also cannot fail. This commit makes
the entire range of u64 legal values to pass to std.os.time.sleep and
std.os.time.posixSleep. Values that do not fit in the native system APIs
will cause a sleep for the longest possible duration and then be handled
as a spurious wakeup.
2019-05-04 15:16:39 -04:00
Andrew Kelley
70a9ee3dd6
Merge branch 'stdlib-32b' of https://github.com/LemonBoy/zig into LemonBoy-stdlib-32b 2019-05-04 14:46:35 -04:00
Andrew Kelley
21c8d57fca
Merge pull request #2326 from daurnimator/sendmmsg
Add sendmmsg syscall wrapper
2019-05-04 14:05:55 -04:00
LemonBoy
98bc2b73bf Implement failsafe logic for posixSleep
Now we'll sleep for the specified amount of time even though the number
of seconds doesn't fit in a `isize` field.
2019-05-04 09:03:01 +02:00
LemonBoy
b612512bb5 std: Remove some assumptions about the host platform
The stdlib is now 32-bit friendly.
2019-05-04 08:44:26 +02:00
Shritesh Bhattarai
f4798297de wasi: Implement read and write with err checking 2019-05-03 17:35:42 -04:00
LemonBoy
077216b582 Address the comments of the first review round 2019-05-03 22:42:45 +02:00
Shritesh Bhattarai
a530a111a5 wasi: remove posix-y exit 2019-05-02 11:33:10 -05:00
Shritesh Bhattarai
7bbc8eb16c wasi: import all core exports 2019-04-30 23:53:17 -04:00
Shritesh Bhattarai
f53abf4063 wasi: import all constants and their types 2019-04-30 22:58:41 -04:00
Shritesh Bhattarai
d395ed2d40 wasi: implement timestamp 2019-04-30 20:43:43 -05:00
Shritesh Bhattarai
0ce05fa621 wasi: import clock and timestamp function/types 2019-04-30 20:06:39 -05:00
Shritesh Bhattarai
1fabd6bbf3 wasi: implement getRandomBytes 2019-04-30 20:50:41 -04:00
Shritesh Bhattarai
20458f56d8 wasi: add getEnvMap 2019-04-30 18:18:20 -05:00
Shritesh Bhattarai
8e700bf92a wasi: import environ_get and environ_sizes_get 2019-04-30 16:35:27 -05:00
daurnimator
fd056752da
std: add sendmmsg on linux 2019-04-30 16:47:09 +10:00
Shritesh Bhattarai
01365be82f WASI: implement argsAlloc and argsFree (#2364)
* wasi: change URL to canon WASI-core.md

* wasi: import args_get and args_sizes_get

* wasi: Implement argsAlloc and argsFree

* test return value for wasi arg syscalls

* wasi: return unexpectedErrorPosix in argsAlloc

* wasi: Add TODO for ArgIterator
2019-04-29 21:54:30 -04:00
LemonBoy
fbcc559cdb Make io offsets/sizes u64 instead of usize
Decouple the concepts of address-space size and file size.

Closes #637
2019-04-28 18:07:40 +02:00
emekoi
66f3ef06e8 fixed syntax error 2019-04-27 11:16:33 -04:00
LemonBoy
074ddf1ac6 Implementation of dl_phdr_info 2019-04-24 20:53:46 +02:00
daurnimator
217b95da31
std: add msghdr_const
As `iovec_const` is to `iovec`, `msghdr_const` is to `msghdr`
2019-04-21 21:53:24 +10:00
daurnimator
9babcac7a6
std: improve msghdr definition 2019-04-21 21:50:48 +10:00
Shritesh Bhattarai
f5d84250a3 wasi: switch to "standard" wasi_unstable module fn 2019-04-15 18:44:33 -04:00
Shritesh Bhattarai
22960a5fdf wasi: better comments 2019-04-13 22:45:31 -05:00
Shritesh Bhattarai
a2d8f03092 support extern "wasi" functions 2019-04-13 22:28:58 -05:00
Shritesh Bhattarai
93528be6b1 wasi: sigabrt at panic 2019-04-13 21:54:50 -05:00
Shritesh Bhattarai
fe9cd0b4bc wasi: use __wasi_proc_exit instead of posix.exit 2019-04-13 21:36:53 -05:00
Shritesh Bhattarai
72bcd5a4a5 WIP: hello world 2019-04-13 15:15:39 -05:00
Shritesh Bhattarai
895e6eabc2 Fix getCurrentId test for pthreads (#2197)
* Fix getCurrentId test for pthreads
2019-04-05 18:12:46 -04:00