Timon Kruiper
bbff6bd675
Eventloop: Enable basic event loop test, fixed by previous commit
...
Closes #4922
2020-09-23 18:38:28 +02:00
Timon Kruiper
0eed7ec9d5
Eventloop: Fix deadlock in linux event loop implementation
...
A simple empty main with evented-io would not quit, because some
threads were still waiting to be resumed (by the os). The os.write to
the eventfd only wakes up one thread and thus there are multiple writes
needed to wake up all the other threads.
2020-09-23 11:41:31 +02:00
Andrew Kelley
800a4a6ceb
eliminate dependency of libzigcpp.a on libzigstage1.a
...
This allows us to create a build of self-hosted with LLVM extensions
enabled but without the stage1 backend.
2020-09-23 00:00:24 -07:00
Andrew Kelley
0638a020cf
stage2: implement --pkg-begin and --pkg-end CLI args
2020-09-22 23:00:33 -07:00
Andrew Kelley
c2b1cd7c45
stage2: implement zig build
...
As part of this:
* add std.process.cleanExit. closes #6395
- use it in several places
* adjust the alignment of text in `zig build --help` menu
* Cache: support the concept of "unhit" so that we properly keep track
of the cache when we find out using the secondary hash that the cache
"hit" was actually a miss. Use this to fix false negatives of caching
of stage1 build artifacts.
* fix not deleting the symlink hash for stage1 build artifacts causing
false positives.
* implement support for Package arguments in stage1 build artifacts
* update and add missing usage text
* add --override-lib-dir and --enable-cache CLI options
- `--enable-cache` takes the place of `--cache on`
* CLI supports -femit-bin=foo combined with --enable-cache to do an
"update file" operation. --enable-cache without that argument
will build the output into a cache directory and then print the path
to stdout (matching master branch behavior).
* errors surfacing from main() now print "error: Foo" instead of
"error: error.Foo".
2020-09-22 22:18:19 -07:00
Andrew Kelley
250664bea4
build runner: allow for a bit longer -D options
...
so they can display in the --help menu without getting squished.
2020-09-22 14:56:52 -07:00
Andrew Kelley
e2d1f9874d
Merge remote-tracking branch 'origin/master' into llvm11
2020-09-22 11:41:21 -07:00
Bhargav Srinivasan
84406d98e4
removing redundant assert
2020-09-22 05:12:21 -07:00
Bhargav Srinivasan
778bb4b324
return not found error correctly
2020-09-22 03:50:28 -07:00
Bhargav Srinivasan
983830a4ae
replace linearSearch with mem.indexOfScalar, return not found error, factor out siftUp from addUnchecked, use compareFn to decide siftUp/siftDown
2020-09-22 03:46:13 -07:00
Bhargav Srinivasan
a5140cc902
implemented efficient heapreplace
2020-09-22 02:12:35 -07:00
Bhargav Srinivasan
1345f87f4e
items are not sorted, using linear search
2020-09-22 01:50:22 -07:00
Bhargav Srinivasan
69f0fc513a
sorry, local compiler using different version of zig
2020-09-22 01:36:41 -07:00
Bhargav Srinivasan
f083ea88d8
using binary search function from std.sort
2020-09-22 01:05:33 -07:00
Bhargav Srinivasan
26de64be13
adding a function to update the priority of an element
2020-09-21 23:09:22 -07:00
Andrew Kelley
0c70bb4fce
Merge remote-tracking branch 'origin/master' into stage2-zig-cc
2020-09-21 21:16:46 -07:00
Joran Dirk Greef
5f99d2c240
Define SPLICE, PROVIDE_BUFFERS, REMOVE_BUFFERS and TEE opcodes and flags
2020-09-21 20:15:14 +02:00
Joran Dirk Greef
2d8df2b745
Use @intCast instead of @truncate
2020-09-21 12:03:52 +02:00
Joran Dirk Greef
7719abbf54
Add flags to queue_fsync() signature as per liburing
2020-09-21 11:09:37 +02:00
Joran Dirk Greef
57603fd26d
Use @intCast instead of @truncate on io_uring_enter() result
2020-09-21 11:09:09 +02:00
Joran Dirk Greef
575ed941d7
Cache mask instead of dereferencing mask pointer
2020-09-21 11:07:11 +02:00
Joran Dirk Greef
843c104fc9
Add io_uring syscalls to os.bits.linux.mips.SYS
...
As per lib/libc/musl/arch/mips/bits/syscall.h.in:
```c
```
2020-09-21 10:39:58 +02:00
Joran Dirk Greef
a853f00410
Add IORING_FEAT_FAST_POLL
2020-09-20 19:51:23 +02:00
Joran Dirk Greef
77903f8d4e
Test structs and offsets
2020-09-20 18:45:44 +02:00
Joran Dirk Greef
e51728a1b4
Make enter(), flush_sq(), sq_ring_needs_enter(), cq_ring_needs_flush() public
...
These will also be needed by any custom helpers
2020-09-20 15:54:31 +02:00
Joran Dirk Greef
40293a0643
Add safety checks
2020-09-20 15:41:22 +02:00
Joran Dirk Greef
f22eea82c4
Fix opcode support detection for read/write test
2020-09-20 15:33:48 +02:00
Joran Dirk Greef
b672dc7abf
Use os.fd_t instead of i32 and assert against c_int for syscall safety
2020-09-20 14:59:40 +02:00
Joran Dirk Greef
abebacda32
Handle all possible syscall errors and bring errors in line with os.zig
2020-09-20 14:21:44 +02:00
LemonBoy
58ee5f4e61
std: Fix metadata corruption in HeapAllocator
...
HeapAllocator stores the pointer returned by HeapAlloc right after the
data block and, after the recent allocator refactoring, the space for
this pointer was not taken into account in the calculation of the final
block size.
Fixes #5830
2020-09-20 01:21:29 -04:00
Joran Dirk Greef
4bc1b7a7ac
Fix io_uring_sqe to use the names of the first member of each union
...
Now we're really future-proof... no more `opflags` creeping in.
When anonymous unions land, we can start using `accept_flags` etc.
Until then, code using this struct won't break when the kernel adds features.
Refs: https://github.com/ziglang/zig/issues/6349
Refs: https://github.com/ziglang/zig/issues/985
2020-09-19 18:50:24 +02:00
Joran Dirk Greef
92407bfcd7
Upgrade check_errno() to an exhaustive switch (safer)
2020-09-19 18:29:50 +02:00
Joran Dirk Greef
ba18420b27
Zero the SQE slot and assign, instead of initializing with default values
2020-09-19 18:17:06 +02:00
Joran Dirk Greef
e7ae6f2fad
Remove default values from io_uring_sqe struct
2020-09-19 18:14:41 +02:00
Joran Dirk Greef
f4df2f091a
Allow the kernel to drive feature detection
2020-09-19 17:31:39 +02:00
Joran Dirk Greef
64ae9a6a87
Rename to error.SubmissionQueueFull
2020-09-19 16:54:44 +02:00
Joran Dirk Greef
c1f9d10b6a
Remove unused import aliases
2020-09-19 16:51:35 +02:00
Joran Dirk Greef
9fabae2a28
Return error.UnsupportedKernel for ENOSYS
2020-09-19 16:47:05 +02:00
Joran Dirk Greef
0d8c6a960f
Remove dangling @import from std
2020-09-19 16:45:52 +02:00
Joran Dirk Greef
cb591285d7
Use linux.IORING_SQ_CQ_OVERFLOW
2020-09-19 16:20:21 +02:00
Joran Dirk Greef
31533eb743
Move to std/os/linux
2020-09-19 16:18:04 +02:00
Joran Dirk Greef
873d1c80b3
Add splice_fd_in to io_uring_sqe and future-proof for anonymous unions
2020-09-19 16:15:17 +02:00
Joran Dirk Greef
09f2f4aeb3
Fix std @import
2020-09-19 15:14:47 +02:00
Joran Dirk Greef
b2a54b9581
Test IORING_REGISTER_FILES but avoid sparse fd sets
2020-09-19 15:07:10 +02:00
Joran Dirk Greef
5df0d284d0
Do not register /dev/zero as an fd when testing queue_readv()
2020-09-19 14:29:23 +02:00
Joran Dirk Greef
ee5931908e
@ptrCast fds.ptr to *const c_void for io_uring_register()
2020-09-19 13:25:59 +02:00
zenith391
4fbf9f7f79
Add "emit_docs" field to LibExeObjStep.
2020-09-19 00:39:43 +03:00
Lachlan Easton
4496a6c9cc
zig fmt: Special case un-indent comma after multiline string in param list
2020-09-18 20:34:00 +10:00
Lachlan Easton
1aacedf6e1
zig fmt: Fix regression in ArrayInitializers
2020-09-18 20:34:00 +10:00
Lachlan Easton
40b6e86a99
zig fmt: fix #6171
2020-09-18 20:34:00 +10:00