Commit Graph

22 Commits (4dafdc00d5c0d73511d64c5edf7481c8fe254a61)

Author SHA1 Message Date
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 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 24d74cbf44 fix Thread impl on Linux and add docs 2018-08-06 17:31:52 -04:00
Andrew Kelley d2dd29e80c separate os.Thread.Id and os.Thread.Handle because of windows 2018-08-06 17:25:24 -04:00
Andrew Kelley 0a3ae9dc6e fix std.os.Thread.getCurrentId for linux 2018-08-06 16:48:49 -04:00
Matthew D. Steele 7a2401ef1e Don't compare ?Thread.Id == Thread.Id in the test
It doesn't work, because of issue #1332.
2018-08-04 21:47:13 -04:00
Matthew D. Steele 86d1cc8e2f Add thread ID support to std.os.Thread (fixes #1316) 2018-08-03 21:36:04 -04:00
Andrew Kelley d767fae47e self-hosted: add first compare-output test 2018-07-23 00:35:53 -04:00
Andrew Kelley c15a6fa9d0 add std.os.cpuCount and have std.event.Loop use it for thread pool size 2018-07-07 01:23:18 -04:00
Andrew Kelley 3dd9af9948 implement std.os.Dir for windows
improve std.os.File.access so that it does not depend on shlwapi.dll

closes #1084
2018-06-12 01:57:09 -04:00
Andrew Kelley fcbb7426fa use * for pointer type instead of &
See #770

To help automatically translate code, see the
zig-fmt-pointer-reform-2 branch.

This will convert all & into *. Due to the syntax
ambiguity (which is why we are making this change),
even address-of & will turn into *, so you'll have
to manually fix thes instances. You will be guaranteed
to get compile errors for them - expected 'type', found 'foo'
2018-05-31 17:28:07 -04:00
Andrew Kelley 43085417be update github.com/zig-lang to github.com/ziglang 2018-05-24 21:27:44 -04:00
Andrew Kelley 6376d96824 support kernel threads for windows
* remove std.os.spawnThreadAllocator - windows does not support
   an explicit stack, so using an allocator for a thread stack
   space does not work.
 * std.os.spawnThread - instead of accepting a stack argument, the
   implementation will directly allocate using OS-specific APIs.
2018-04-29 02:40:22 -04:00
Andrew Kelley a425420993 make pthreads threads work on darwin
darwin pthreads adds a restriction that the stack start and end
must be page aligned
2018-04-29 00:07:32 -04:00
Andrew Kelley 998e25a01e pthread support working 2018-04-28 23:47:39 -04:00
Andrew Kelley a344cb03bc *WIP* use pthreads when linking libc 2018-04-28 23:30:13 -04:00
Andrew Kelley b7af9edb8a add std.os.createThread
this adds kernel thread support to the standard library for
linux.

See #174
2018-04-14 02:24:05 -04:00
Marc Tiehuis 03bec631bd Replace File.exists with File.access 2018-04-13 21:27:09 +12:00
Andrew Kelley abd389209b fix up logic for macos std.os.deleteTree 2018-04-04 00:08:10 -04:00
hellerve 7e951e5043 st/os: address @andrewrk concerns 2018-03-29 10:23:44 +02:00
Andrew Kelley f5b43ada46 std/os: getting dir entries works on OS X 2018-03-28 12:06:48 +02:00