Commit Graph

1874 Commits

Author SHA1 Message Date
Andrew Kelley 55ab50efbd Merge branch 'piepiepie' of https://github.com/LemonBoy/zig into pie
Conflicts:
 lib/std/dynamic_library.zig (fixed in this commit)
 src/all_types.hpp
 src/codegen.cpp
 src/link.cpp
 src/main.cpp

Will manually apply the diffs to these deleted files to the new zig
code in a followup commit.
2020-11-22 12:39:44 -07:00
Aransentin c8723beda8 UnregisterClassW needs WINAPI as well 2020-11-22 14:58:10 +00:00
Aransentin 6fd536a50c Fixed bugs, style suggestions 2020-11-22 14:51:32 +00:00
Jens Goldberg bbc2c7c268 Ensure the dynamic function has the same type as the static one
Co-authored-by: daurnimator <quae@daurnimator.com>
2020-11-22 14:24:36 +00:00
Aransentin fcf3f61c28 user32 cleanup, added wrappers and additional functions 2020-11-22 13:00:57 +00:00
Žiga Željko 2fbe9519ac std: add support for ppoll 2020-11-21 14:06:04 -08:00
Andrew Kelley bf0cc32aa6 Merge pull request #7165 from LemonBoy/ppc64final
Make the PPC64 port usable
2020-11-20 17:40:17 -08:00
Isaac Freund 8cf319d206 std/os: define and use dev_t for linux x86_64 2020-11-20 17:35:52 -08:00
Isaac Freund f473b3e87c std/os: add time_t definiton for x86_64 linux 2020-11-20 17:23:43 -08:00
LemonBoy e374ae3598 std: Use newfstatat on PPC64
One more variation in the syscall table, hooray!
2020-11-20 08:38:10 +01:00
Veikka Tuominen cf819b95fe Merge pull request #6829 from tadeokondrak/error-unsupported-callconv
stage1: Compile error instead of falling back to C for unsupported cc
2020-11-19 19:03:08 +02:00
Tadeo Kondrak 25ec2dbc1e Add builtin.Signedness, use it instead of is_signed 2020-11-19 18:59:21 +02:00
Tadeo Kondrak c002a5026a Update code to not use unsupported calling conventions for target 2020-11-19 14:01:07 +02:00
Jakub Konka 663e112773 std: add chdir smoke test 2020-11-18 15:37:44 +01:00
Lee Cannon 64feae3ac3 Move utf8->utf16 up one level into os.zig 2020-11-18 15:37:44 +01:00
Lee Cannon 32c998e03c Switch to RtlSetCurrentDirectory_U 2020-11-18 15:37:44 +01:00
Lee Cannon 80b1e82b1b Implement chdir and chdirZ for Windows 2020-11-18 15:37:44 +01:00
LemonBoy 36c869dc14 std: Make windows.ReadFile allow short reads
Make it behave like the read() wrapper for unix systems.
Reading the whole buffer breaks some use-cases like buffered readers
over sockets.

Closes #7121
2020-11-16 13:35:06 -08:00
Sébastien Marie 8784c7b581 openbsd: proper implementation for Thread.cpuCount() 2020-11-10 05:25:59 +00:00
Sébastien Marie 20b19d0092 openbsd: add time definitions for gettimeofday() 2020-11-10 05:24:56 +00:00
Sébastien Marie e4bc595bc6 openbsd: add sockets constants 2020-11-10 05:24:03 +00:00
Sébastien Marie 17276df488 openbsd: add dlfcn.h definitions for dlopen() 2020-11-10 05:23:13 +00:00
Andrew Kelley c9551652b0 Merge pull request #6978 from LemonBoy/statshit
Decouple kernel and libc stat definitions
2020-11-05 17:27:22 -05:00
Andrew Kelley cf7505da1f Merge pull request #6974 from daurnimator/prctl-cleanup
prctl improvements
2020-11-05 17:25:24 -05:00
Andrew Kelley f85d719952 Merge pull request #6895 from jorangreef/fallocate
linux: add fallocate()
2020-11-05 17:23:00 -05:00
LemonBoy cca6b11138 Label WASI stat as kernel_stat
We're using WASI syscalls, it makes sense to put the kernel_ prefix.
2020-11-05 12:44:43 +01:00
LemonBoy 0e95fa455c std: Split kernel&libc definitions of stat struct
There's no guarantee for the kernel definition to be ABI compatible with
the libc one (and vice versa).
There's also no guarantee of ABI compatibility between musl/glibc.

Fun, isn't it?
2020-11-05 09:38:50 +01:00
rageoholic e5100605e9 Add missing LONG_PTR type 2020-11-04 18:30:48 -06:00
rageoholic 04267fb1ba Fix CoInitializeEx so it can take a null pointer 2020-11-04 16:53:05 -06:00
LemonBoy 346a686b9d std: Correct stack_t definition for mips 2020-11-04 15:55:06 +01:00
LemonBoy f313c88428 std: Fix pipe syscall stub for sparc64 2020-11-04 15:54:38 +01:00
daurnimator b42ffbe9e8 std: use PR enum as only location of opcode numbers 2020-11-04 22:39:35 +11:00
daurnimator b90fb1e96b std: add PR enum for the prctl opcode 2020-11-04 22:32:57 +11:00
Jakub Konka 5060497174 Merge pull request #6921 from xackus/gimmeMoreOfThoseSweetSweetFileDescriptors
stage2: ask for more file descriptors
2020-11-03 10:07:39 +01:00
Joran Dirk Greef 8193f55820 Support 32-bit big-endian targets 2020-11-03 06:03:38 +02:00
Jakub Konka 8dda64fa3e Fix Darwin codepath
On Darwin, according to the man pages for setrlimit(), when adjusting
max number of open fds, the reported hard max by getrlimit() is only
theoretical, while the actual maximum, set in the kernel, is hardcoded
in the header file. Therefore, the reported max has to be adjusted
as `min(OPEN_MAX, lim.max)`.

Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-11-03 00:38:43 +01:00
LemonBoy dc872a221d std: Fix syscall stubs passing 64bit offsets for BE targets 2020-11-02 12:11:07 +01:00
Joran Dirk Greef 78e9e131e0 Pending #5127 2020-11-02 12:37:55 +02:00
Joran Dirk Greef 067bd7e424 Switch back to writing Zig 2020-11-02 09:55:25 +02:00
Joran Dirk Greef 9dec310826 Debug unhandled errno 2020-11-02 09:52:42 +02:00
Andrew Kelley 909aae8153 Merge pull request #6792 from koachan/sparc64-linux
Initial sparc64-linux bringup
2020-11-01 22:14:56 -05:00
xackus 6418284680 std: add {set,get}rlimit bits and improve test 2020-11-01 15:47:46 -05:00
Joran Dirk Greef c910f03a7b Swap endianness 2020-11-01 13:14:32 +02:00
Joran Dirk Greef a67f140d2f Add test 2020-11-01 11:55:27 +02:00
Joran Dirk Greef 2dd8613adc "The Traveling Wilburys' - Handle With Care"
Both `offset` and `len` are `off_t`.

Like the rest of the std lib we assume that `_FILE_OFFSET_BITS == 64`
is always true, so that `off_t` is a `u64`.

When passing to 32-bit kernels, we split these into two `u32`
parameters.
2020-11-01 11:49:08 +02:00
Joran Dirk Greef 2fdb30a571 Add definitions for FALLOC_FL_ mode flags 2020-11-01 11:47:09 +02:00
Joran Dirk Greef 8fd88fdb31 linux: add fallocate() 2020-10-31 13:39:33 +02:00
Joran Dirk Greef ab1ed93ad9 Add close_range, faccessat2 and process_madvise 2020-10-30 12:39:01 +02:00
Joran Dirk Greef 9423ed1671 Add more mips syscall numbers
As per: lib/libc/musl/arch/mips/bits/syscall.h.in

...and as promised: https://github.com/ziglang/zig/pull/6356#issuecomment-696023349

Thanks @daurnimator again for the help with #6356.
2020-10-30 11:53:45 +02:00
Koakuma 891c6ddd5f Select stat struct type based on whether we are linking with libc 2020-10-30 11:46:33 +07:00