aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os/bits/freebsd.zig
AgeCommit message (Collapse)Author
2021-09-01std: reorganize std.c to eliminate `usingnamespace`Andrew Kelley
Behavior tests pass on x86_64-linux with -lc
2021-09-01std.os reorganization, avoiding `usingnamespace`Andrew Kelley
The main purpose of this branch is to explore avoiding the `usingnamespace` feature of the zig language, specifically with regards to `std.os` and related functionality. If this experiment is successful, it will provide a data point on whether or not it would be practical to entirely remove `usingnamespace` from the language. In this commit, `usingnamespace` has been completely eliminated from the Linux x86_64 compilation path, aside from io_uring. The behavior tests pass, however that's as far as this branch goes. It is very breaking, and a lot more work is needed before it could be considered mergeable. I wanted to put a pull requset up early so that zig programmers have time to provide feedback. This is progress towards closing #6600 since it clarifies where the actual "owner" of each declaration is, and reduces the number of different ways to import the same declarations. One of the main organizational strategies used here is to do namespacing with real namespaces (e.g. structs) rather than by having declarations share a common prefix (the C strategy). It's no coincidence that `usingnamespace` has similar semantics to `#include` and becomes much less necessary when using proper namespaces.
2021-08-31std: Use truncating cast in WIFSTOPPED for Linux, FreeBSD and DragonFlyPhilip Ã…kesson
The intermediate value can be larger than an u16, so @truncate is needed to match the behavior of musl.
2021-08-24remove redundant license headers from zig standard libraryAndrew Kelley
We already have a LICENSE file that covers the Zig Standard Library. We no longer need to remind everyone that the license is MIT in every single file. Previously this was introduced to clarify the situation for a fork of Zig that made Zig's LICENSE file harder to find, and replaced it with their own license that required annual payments to their company. However that fork now appears to be dead. So there is no need to reinforce the copyright notice in every single file.
2021-08-24std: [breaking] move errno to become an nonexhaustive enumAndrew Kelley
The primary purpose of this change is to eliminate one usage of `usingnamespace` in the standard library - specifically the usage for errno values in `std.os.linux`. This is accomplished by truncating the `E` prefix from error values, and making errno a proper enum. A similar strategy can be used to eliminate some other `usingnamespace` sites in the std lib.
2021-08-22std.os: (p)writev should perform partial writes if iov.len > IOV_MAXdaurnimator
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2021-08-02Move iovec and log levels to bits/posix.zigN00byEdge
This lets only the OSes that uses them to import them, and removes dependencies on bits.zig for the os/<os>/<arch>.zig files
2021-06-12Make std.ChildProcess exit code u8 to match std.process.exitGarrett Squire
This patch adjusts the exit code for a child process to be a u8. Since the WEXITSTATUS macro returns the lower eight bits, it's safe to assume that we can truncate the returned u32.
2021-06-01os: make msghdr, msghdr_const, and sockaddr_storage backwards-compatibleKenta Iwasaki
`msghdr` and `msghdr_const` definitions have been added back the way they were in std.os. std.os.sendmsg has also been modified to accept a msghdr_const again to ensure backwards-compatibility with this PR. Underneath the hood, std.os.sendmsg will @ptrCast the provided msghdr_const into a std.x.os.Socket.Message. `sockaddr_storage` definitions have been added back the way they were in std.os, except that it now simply aliases std.x.os.Socket.Address.Native.Storage as all of std.x.os.Socket.Address.Native.Storage's fields are equivalent to the fields that were previously defined for std.x.os.bits.sockaddr_storage. std.x.os.Socket.sendMessage now no longer is a stub that aliases std.os.sendmsg, but instead calls and handles errors from std.os.system.sendmsg directly. Addresses feedback to urge backwards compatibility from @andrewrk.
2021-06-01os: `sockaddr_storage` -> `std.x.os.Socket.Address.Native.Storage`Kenta Iwasaki
2021-06-01x/io, x/os: async i/o reactor, cross-platform socket syscalls and bitslithdew
Cross-platform versions of msghdr, sendmsg, recvmsg, linger, and iovec were provided based on findings from glibc, musl, and Microsoft's documentation. Implemented initial Reactor interface for epoll (linux) which wraps around I/O reactor subsystems such as epoll, kqueue, select, etc. across different platforms. The Reactor interface allows for driving async I/O in Zig applications. A test was added for the Reactor interface to drive a TCP client/listener socket pair. A greatest-common-subset of possible socket initialization flags (close socket on exec syscalls, initialize socket to be non-blocking) were implemented. A test was added for using sendmsg/recvmsg syscalls across different platforms for a TCP client/listener socket pair.
2021-05-24dragonfly: pass `zig build test`Michael Dusan
2021-05-20Run `zig fmt` on src/ and lib/std/Isaac Freund
This replaces callconv(.Inline) with the more idiomatic inline keyword.
2021-05-18std: update freebsd bits to new builtinAndrew Kelley
2021-05-12Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
Conflicts: * lib/std/os/linux.zig * lib/std/os/windows/bits.zig * src/Module.zig * src/Sema.zig * test/stage2/test.zig Mainly I wanted Jakub's new macOS code for respecting stack size, since we now depend on it for debug builds able to pass one of the test cases for recursive comptime function calls with `@setEvalBranchQuota`. The conflicts were all trivial.
2021-05-10std/os: add missing sockaddr_storage defslithdew
2021-04-22std: fix compile errors caught by stage2 AstGenAndrew Kelley
* `comptime const` is redundant * don't use `extern enum`; specify a tag type. `extern enum` is only when you need tags to alias. But aliasing tags is a smell. I will be making a proposal shortly to remove `extern enum` from the language. * there is no such thing as `packed enum`. * instead of `catch |_|`, omit the capture entirely. * unused function definition with missing parameter name * using `try` outside of a function or test
2021-02-10Convert inline fn to callconv(.Inline) everywhereTadeo Kondrak
2021-01-11Merge pull request #7134 from alexnask/fix_std_fs_watchAndrew Kelley
The std.fs.Watch rewrite PR
2021-01-05freebsd, netbsd, dragonfly: add struct timevalxackus
2020-12-31Year++Frank Denis
2020-12-30std: Add more standard type definitions for FreeBSDLemonBoy
Closes #7550
2020-12-29std: Fix compilation on FreeBSD/DarwinLemonBoy
2020-12-29std: Fix poll definitions for FreeBSD/DarwinLemonBoy
2020-12-23Enable segfault handling on FreeBSD.Alex Cameron
2020-12-17Add EV_ERROR to FreeBSD bitsAlexandros Naskos
2020-12-13Fix compilation error on FreeBSDLemonBoy
2020-12-13std: Drop struct prefixes in FreeBSD siginfoLemonBoy
I'm not sure this prefix-free style is a good idea, but let's roll with it for the moment.
2020-12-13Fix Sigaction struct on FreeBSD.Alex Cameron
2020-12-12std: Further siginfo refinementsLemonBoy
* Define siginfo and sigaction for Darwin * Define sigaction/handler union for maximum libc compatibility * Minor correction to some type definitions
2020-11-30add std.os.shutdown function for socketsJonathan Marler
2020-11-05std: Split kernel&libc definitions of stat structLemonBoy
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-01std: add {set,get}rlimit bits and improve testxackus
2020-09-03std: fix linux uid_t, use uid_t/gid_t in std.osIsaac Freund
- correct uid_t from i32 to u32 on linux - define uid_t and gid_t for OSes missing definitions - use uid_t/gid_t instead of plain u32s throughout std.os
2020-08-20add license header to all std lib filesAndrew Kelley
add SPDX license identifier copyright ownership is zig contributors
2020-05-24os/bits/freebsd auditJethro Nederhof
2020-05-24FreeBSD: missing networking constantsJethro Nederhof
2020-05-05zig fmtTadeo Kondrak
2020-04-02Add LOCK_* constants to BSD `os/bits`LeRoyce Pearson
2020-03-23Merge branch 'master' into feature-file-locksLeRoyce Pearson
2020-03-23Add O_SHLOCK and O_EXLOCK to freebsd and netbsdLeRoyce Pearson
2020-03-18std: Introduce fnctl wrapperLemonBoy
2020-03-14Define Flock for all posix systemsLeRoyce Pearson
2020-03-08Define ino_t for systems not yet defining itLeRoyce Pearson
Also, use ino_t instead of u64 in fs.File.INode
2020-02-06more std lib async I/O integrationAndrew Kelley
* `zig test` gainst `--test-evented-io` parameter and gains the ability to seamlessly run async tests. * `std.ChildProcess` opens its child process pipe with O_NONBLOCK when using evented I/O * `std.io.getStdErr()` gives a File that is blocking even in evented I/O mode. * Delete `std.event.fs`. The functionality is now merged into `std.fs` and async file system access (using a dedicated thread) is automatically handled. * `std.fs.File` can be configured to specify whether its handle is expected to block, and whether that is OK to block even when in async I/O mode. This makes async I/O work correctly for e.g. the file system as well as network. * `std.fs.File` has some deprecated functions removed. * Missing readv,writev,pread,pwrite,preadv,pwritev functions are added to `std.os` and `std.fs.File`. They are all integrated with async I/O. * `std.fs.Watch` is still bit rotted and needs to be audited in light of the new async/await syntax. * `std.io.OutStream` integrates with async I/O * linked list nodes in the std lib have default `null` values for `prev` and `next`. * Windows async I/O integration is enabled for reading/writing file handles. * Added `std.os.mode_t`. Integer sizes need to be audited. * Fixed #4403 which was causing compiler to crash. This is working towards: ./zig test ../test/stage1/behavior.zig --test-evented-io Which does not successfully build yet. I'd like to enable behavioral tests and std lib tests with --test-evented-io in the test matrix in the future, to prevent regressions.
2020-01-14Correct dlpi_name field typeLemonBoy
2019-12-22freebsd: add missing OS and libc bitsJethro Nederhof
2019-11-21add std.fs.Dir.openReadAndrew Kelley
This is progress towards file system APIs that encourage avoiding Time Of Check, Time Of Use bugs.
2019-11-08fixups and zig fmtAndrew Kelley
2019-10-31DragonFlyBSD tidyupTse