mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
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.
25 lines
707 B
Zig
25 lines
707 B
Zig
// SPDX-License-Identifier: MIT
|
|
// Copyright (c) 2015-2021 Zig Contributors
|
|
// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
|
|
// The MIT license requires this copyright notice to be included in all copies
|
|
// and substantial portions of the software.
|
|
|
|
const std = @import("std.zig");
|
|
|
|
pub const os = struct {
|
|
pub const Socket = @import("x/os/socket.zig").Socket;
|
|
pub usingnamespace @import("x/os/io.zig");
|
|
pub usingnamespace @import("x/os/net.zig");
|
|
};
|
|
|
|
pub const net = struct {
|
|
pub const ip = @import("x/net/ip.zig");
|
|
pub const tcp = @import("x/net/tcp.zig");
|
|
};
|
|
|
|
test {
|
|
inline for (.{ os, net }) |module| {
|
|
std.testing.refAllDecls(module);
|
|
}
|
|
}
|