Commit Graph

8 Commits (a32d3a85d21d614e5960b9eadcd85374954b910f)

Author SHA1 Message Date
Michael Dusan d31b65e762 std: fix sendfile on macOS and FreeBSD
- fix std.os.sendfile/FreeBSD use correct in/out fd_t
- fix std.os.sendfile/macOS use correct in/out fd_t
- undo 1141bfb21b (no longer needed)
- fix c.freebsd.sendfile use off_t value
- fix c.freebsd.sendfile decl correct in/out fd_t
- fix c.darwin.sendfile decl correct in/out fd_t

fix signature param names
2020-03-05 20:46:28 -05:00
Andrew Kelley 859fc856d3
fix macosx and freebsd build failures 2020-03-03 02:57:11 -05:00
Andrew Kelley c81345c8ae
breaking: std.os read/write functions + sendfile
* rework os.sendfile and add macosx support, and a fallback
   implementation for any OS.
 * fix sendto compile error
 * std.os write functions support partial writes. closes #3443.
 * std.os pread / pwrite functions can now return `error.Unseekable`.
 * std.fs.File read/write functions now have readAll/writeAll variants
   which loop to complete operations even when partial reads/writes
   happen.
 * Audit std.os read/write functions with respect to Linux returning
   EINVAL for lengths greater than 0x7fff0000.
 * std.os read/write shim functions do not unnecessarily loop. Since
   partial reads/writes are part of the API, the caller will be forced
   to loop anyway, and so that would just be code bloat.
 * Improve doc comments
 * Add a non-trivial test for std.os.sendfile
 * Fix std.os.pread on 32 bit Linux
 * Add missing SYS_sendfile bit on aarch64
2020-03-03 02:25:26 -05:00
Terin Stock bd287dd194
std: implement sendfile on linux
This changset adds a `sendfile(2)` syscall bindings to the linux bits
component. Where available, the `sendfile64(2)` syscall will be
transparently called.

A wrapping function has also been added to the std.os to transform
errno returns to Zig errors.

Change-Id: I86769fc4382c0771e3656e7b21137bafd99a4411
2020-03-02 12:54:50 -05:00
daurnimator 72ec445677 std: turn EAI_ constants into a non-exhaustive enum 2020-01-18 17:46:44 -05:00
Jethro Nederhof ba1d213f48 freebsd: add missing OS and libc bits 2019-12-22 02:27:23 -05:00
Andrew Kelley 2723ffc2b2
fixups and zig fmt 2019-11-08 01:52:23 -05:00
Andrew Kelley ed36dbbd9c
mv std/ lib/
that's all this commit does. further commits will fix cli flags and
such.

see #2221
2019-09-25 23:35:41 -04:00