Andrew Kelley
d5648d2640
remove implicit cast from T to *const T
...
closes #1465
2018-10-15 18:23:47 -04:00
Jimmi Holst Christensen
378d3e4403
Solve the return type ambiguity ( #1628 )
...
Changed container and initializer syntax
* <container> { ... } -> <container> . { ... }
* <exrp> { ... } -> <expr> . { ...}
2018-10-15 09:51:15 -04:00
Marc Tiehuis
67fb4d1359
Improve time.sleep api
2018-10-11 11:57:59 -04:00
Andrew Kelley
66cb75d114
std.Mutex: implement blocking mutexes on linux
...
closes #1463
Thanks to Shawn Landden for the original pull request.
This commit is based on that code.
2018-10-03 13:19:10 -04:00
Andrew Kelley
af229c1fdc
std lib (breaking): posixRead can return less than buffer size
...
closes #1414
std.io.InStream.read now can return less than buffer size
introduce std.io.InStream.readFull for previous behavior
add std.os.File.openWriteNoClobberC
rename std.os.deleteFileWindows to std.os.deleteFileW
remove std.os.deleteFilePosix
add std.os.deleteFileC
std.os.copyFile no longer takes an allocator
std.os.copyFileMode no longer takes an allocator
std.os.AtomicFile no longer takes an allocator
add std.os.renameW
add windows support for std.os.renameC
add a test for std.os.AtomicFile
2018-10-01 13:50:55 -04:00
Andrew Kelley
d1ec8377d1
std lib: flesh out the async I/O streaming API a bit
2018-10-01 10:53:39 -04:00
Andrew Kelley
9d4eaf1e07
update std lib API for I/O
...
std.io.FileInStream -> std.os.File.InStream
std.io.FileInStream.init(file) -> file.inStream()
std.io.FileOutStream -> std.os.File.OutStream
std.io.FileOutStream.init(file) -> file.outStream()
remove a lot of error code possibilities from os functions
std.event.net.socketRead -> std.event.net.read
std.event.net.socketWrite -> std.event.net.write
add std.event.net.readv
add std.event.net.writev
add std.event.net.readvPosix
add std.event.net.writevPosix
add std.event.net.OutStream
add std.event.net.InStream
add std.event.io.InStream
add std.event.io.OutStream
2018-09-30 17:28:35 -04:00
Andrew Kelley
57c4d38c55
rename std.event.tcp to std.event.net
2018-09-30 10:37:58 -04:00
Andrew Kelley
9485043b3c
fix implicit casting to *c_void
...
closes #1588
also some small std lib changes regarding posix sockets
and one doc typo fix
2018-09-26 11:06:09 -04:00
Andrew Kelley
c06a61e9bf
remove `this`. add `@This()`.
...
closes #1283
2018-09-13 16:34:33 -04:00
Andrew Kelley
a757533386
fix zig fmt on windows
...
closes #1069
2018-09-12 14:26:21 -04:00
Andrew Kelley
178d69191b
windows: std.fs functions support concurrent ops
...
when reading and writing the same file descriptors
2018-09-12 13:55:35 -04:00
Andrew Kelley
ab387bb4c7
Merge pull request #1460 from ziglang/Sahnvour-windows-coff-issue721
...
Stack traces for Windows
2018-09-02 18:47:48 -04:00
Andrew Kelley
832caefc2a
fix regressions
2018-09-02 18:35:32 -04:00
Shawn Landden
528e3b43a6
these all use futex() (inaccurate comments)
2018-09-01 23:52:52 -07:00
Andrew Kelley
fb6d3859e8
zig fmt
2018-08-27 19:25:40 -04:00
Andrew Kelley
6b31b178a6
fix regression from 2f7f7d815d
2018-08-24 12:59:31 -04:00
Shawn Landden
2f7f7d815d
missing PATH_MAX change
2018-08-23 17:00:50 -07:00
Andrew Kelley
ea1b21dbdb
fix linux
...
* error.BadFd is not a valid error code. it would always be a bug to
get this error code.
* merge error.Io with existing error.InputOutput
* merge error.PathNotFound with existing error.FileNotFound.
Not all OS's support both.
* add os.File.openReadC
* add error.BadPathName for windows file operations with invalid
characters
* add os.toPosixPath to help stack allocate a null terminating byte
* add some TODOs for other functions to investigate removing the
allocator requirement
* optimize some implementations to use the alternate functions when
a null byte is already available
* add a missing error.SkipZigTest
* os.selfExePath uses a non-allocating API
* os.selfExeDirPath uses a non-allocating API
* os.path.real uses a non-allocating API
* add os.path.realAlloc and os.path.realC
* convert many windows syscalls to use the W versions (See #534 )
2018-08-21 20:31:50 -04:00
Andrew Kelley
51852d2587
fix windows
2018-08-21 16:07:28 -04:00
Andrew Kelley
598e80957e
windows: call CancelIo when canceling an fs watch
2018-08-10 13:19:07 -04:00
Andrew Kelley
23af36c54f
windows fs watching: fix not initializing table value
2018-08-09 21:48:25 -04:00
Andrew Kelley
26a842c264
windows: only create io completion port once
2018-08-09 20:12:46 -04:00
Andrew Kelley
b219feb3f1
initial windows implementation of std.event.fs.Watch
2018-08-09 16:48:44 -04:00
Andrew Kelley
c63ec9886a
std.event.fs.preadv windows implementation
2018-08-08 16:55:19 -04:00
Andrew Kelley
8b456927be
std.event.fs.pwritev windows implementation
...
also fix 2 bugs where the function didn't call allocator.shrink:
* std.mem.join
* std.os.path.resolve
2018-08-08 15:06:32 -04:00
Andrew Kelley
ac12f0df71
fix linux regressions
2018-08-07 22:23:26 -04:00
Andrew Kelley
60955feab8
std.event.fs.Watch distinguishes between Delete and CloseWrite on darwin
...
TODO: after 1 event emitted for a deleted file, the file is no longer
watched
2018-08-07 22:14:30 -04:00
Andrew Kelley
5cbfe392be
implement std.event.fs.Watch for macos
2018-08-07 21:06:21 -04:00
Andrew Kelley
fd50a6896b
std.event.fs support for macos
...
The file I/O stuff is working, but the fs watching
stuff is not yet.
2018-08-07 00:49:09 -04:00
Andrew Kelley
5dfcd09e49
self-hosted: watch files and trigger a rebuild
2018-08-03 17:22:17 -04:00
Andrew Kelley
7f6e97cb26
fixups from the merge
2018-08-02 17:36:08 -04:00
Andrew Kelley
65140b2fba
Merge remote-tracking branch 'origin/master' into async-fs
2018-08-02 17:29:31 -04:00
Andrew Kelley
821805aa92
WIP: Channel.getOrNull
2018-08-02 17:04:17 -04:00
kristopher tate
96a94e7da9
std/event: directly return @handle();
...
Tracking Issue #1296 ;
2018-08-02 17:52:40 +09:00
kristopher tate
9fe140abad
std/event/tcp.zig: remove promise_symbol from suspend and use @handle();
...
Tracking Issue #1296 ;
2018-08-02 16:59:11 +09:00
kristopher tate
a3705b4251
std/event/loop.zig: remove promise_symbol from suspend and use @handle();
...
Tracking Issue #1296 ;
2018-08-02 16:59:11 +09:00
kristopher tate
efec3a0e34
std/event/lock.zig: remove promise_symbol from suspend and use @handle();
...
Tracking Issue #1296 ;
2018-08-02 16:59:11 +09:00
kristopher tate
b4ff464d39
std/event/group.zig: remove promise_symbol from suspend and use @handle();
...
Tracking Issue #1296 ;
2018-08-02 16:59:11 +09:00
kristopher tate
244a7fdafb
std/event/future.zig: remove promise_symbol from suspend and use @handle();
...
Tracking Issue #1296 ;
2018-08-02 16:59:11 +09:00
kristopher tate
29057e5511
std/event/channel.zig: remove promise_symbol from suspend and use @handle();
...
Tracking Issue #1296 ;
2018-08-02 16:59:11 +09:00
Andrew Kelley
e3ae2cfb52
add std.event.RwLock and a few more std changes
...
* add std.event.RwLock and std.event.RwLocked
* std.debug.warn does its printing locked
* add std.Mutex, however it's currently implemented as a spinlock
* rename std.event.Group.cancelAll to std.event.Group.deinit and change
the docs and assumptions.
* add std.HashMap.clone
2018-08-01 16:26:37 -04:00
Andrew Kelley
de949b72c7
simpler std.event.Lock implementation
2018-07-31 19:57:46 -04:00
Andrew Kelley
3c8d4e04ea
std: file system watching for linux
2018-07-30 13:46:09 -04:00
Andrew Kelley
a870228ab4
self-hosted: use std.event.fs.readFile
2018-07-30 13:44:36 -04:00
Andrew Kelley
cc45527333
introduce std.event.fs for async file system functions
...
only works on linux so far
2018-07-30 13:44:36 -04:00
Andrew Kelley
05456eb275
make some functions in std.event.Loop public
2018-07-28 12:53:33 -04:00
Andrew Kelley
02713e8d8a
fix race conditions in self-hosted compiler; add test
...
* fix race condition in std.event.Channel deinit
* add support to zig build for --no-rosegment
* add passing self-hosted compare-output test for calling a function
* put a global lock on LLD linking because it's not thread safe
2018-07-24 21:28:54 -04:00
Andrew Kelley
5a919dd82d
Merge remote-tracking branch 'origin/master' into self-hosted-libc-hello-world
2018-07-23 14:32:13 -04:00
Andrew Kelley
93e78ee722
self-hosted can compile libc hello world
2018-07-22 23:28:53 -04:00