Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › os › linux › getsockopt Public Function getsockopt Doc Source Public Function std.os.linux.getsockopt
pub fn getsockopt (fd : fd_t , level : i32 , optname : u32 , noalias optval : [*]u8 , noalias optlen : *socklen_t ) usize Params fd : fd_t level : i32 optname : u32 optval : [*]u8 optlen : *socklen_t File os/linux.zig: 2528
2528
2529
2530
2531
2532
2533 pub fn getsockopt (fd : fd_t , level : i32 , optname : u32 , noalias optval : [*]u8 , noalias optlen : *socklen_t ) usize {
if (native_arch == .x86 ) {
return socketcall (SC .getsockopt , &[5 ]usize { @as (u32 , @bitCast (fd )), @as (usize , @bitCast (@as (isize , level ))), optname , @intFromPtr (optval ), @intFromPtr (optlen ) });
}
return syscall5 (.getsockopt , @as (u32 , @bitCast (fd )), @as (usize , @bitCast (@as (isize , level ))), optname , @intFromPtr (optval ), @intFromPtr (optlen ));
}