跳转到内容
标准库Zig 0.17.0官方原文
源码std/c.zig

第 1 行

std.c.__getdirentries64

别名

第 11780 行

别名目标 std.c.darwin.__getdirentries64

std.c.__ulock_wait

别名

第 11781 行

别名目标 std.c.darwin.__ulock_wait

std.c.__ulock_wait2

别名

第 11782 行

别名目标 std.c.darwin.__ulock_wait2

std.c.__ulock_wake

别名

第 11783 行

别名目标 std.c.darwin.__ulock_wake

std.c._dyld_get_image_header

别名

第 11784 行

别名目标 std.c.darwin._dyld_get_image_header

std.c._dyld_get_image_header_containing_address

别名

第 11788 行

别名目标 std.c.darwin._dyld_get_image_header_containing_address

std.c._dyld_get_image_name

别名

第 11785 行

别名目标 std.c.darwin._dyld_get_image_name

std.c._dyld_get_image_vmaddr_slide

别名

第 11786 行

别名目标 std.c.darwin._dyld_get_image_vmaddr_slide

std.c._dyld_image_count

别名

第 11787 行

别名目标 std.c.darwin._dyld_image_count

std.c._errno

常量

第 7335 行

std.c._exit

函数

第 11066 行

pub extern "c" fn _exit(code: c_int) noreturn

参数

code: c_int

std.c._Exit

函数

第 11065 行

pub extern "c" fn _Exit(code: c_int) noreturn

参数

code: c_int

std.c._host_page_size

别名

第 11790 行

别名目标 std.c.darwin._host_page_size

std.c._kern_acquire_sem_etc

别名

第 11652 行

别名目标 std.c.haiku._kern_acquire_sem_etc

std.c._kern_create_sem

别名

第 11653 行

别名目标 std.c.haiku._kern_create_sem

std.c._kern_delete_sem

别名

第 11654 行

别名目标 std.c.haiku._kern_delete_sem

std.c._kern_open_dir

别名

第 11655 行

别名目标 std.c.haiku._kern_open_dir

std.c._kern_read_dir

别名

第 11656 行

别名目标 std.c.haiku._kern_read_dir

std.c._kern_read_stat

别名

第 11657 行

别名目标 std.c.haiku._kern_read_stat

std.c._kern_release_sem_etc

别名

第 11658 行

别名目标 std.c.haiku._kern_release_sem_etc

std.c._kern_rewind_dir

别名

第 11659 行

别名目标 std.c.haiku._kern_rewind_dir

std.c._ksiginfo

别名

第 11950 行

别名目标 std.c.netbsd._ksiginfo

std.c._lwp_park

别名

第 11952 行

别名目标 std.c.netbsd.___lwp_park60

std.c._lwp_self

别名

第 11951 行

别名目标 std.c.netbsd._lwp_self

std.c._lwp_unpark

别名

第 11953 行

别名目标 std.c.netbsd._lwp_unpark

std.c._lwp_unpark_all

别名

第 11954 行

别名目标 std.c.netbsd._lwp_unpark_all

std.c._mh_execute_header

变量

第 42 行

链接编辑器定义的符号 _MH_EXECUTE_SYM 的值,是 Mach-O 可执行文件中 mach 头部的地址。它不会出现在 MH_EXECUTE 之外的文件类型中。该符号的类型为 绝对符号,因为头部不属于任何节。 链接系统 libc 时会填充此符号,而此操作系统保证 会链接系统 libc。不过,构建目标文件或库时, 直到最终可执行文件才会链接系统 libc。因此这里 导出弱符号,以便由真正的符号覆盖。

mach_hdr

std.c._msize

常量

第 11013 行

std.c._NSGetExecutablePath

别名

第 11779 行

别名目标 std.c.darwin._NSGetExecutablePath

std.c._SC

类型

第 2681 行

std.c._umtx_op

别名

第 11738 行

别名目标 std.c.freebsd._umtx_op

std.c._umtx_time

别名

第 11739 行

别名目标 std.c.freebsd._umtx_time

std.c.@"close$NOCANCEL"

别名

第 11795 行

别名目标 std.c.darwin.@"close$NOCANCEL"

std.c.abort

函数

第 11063 行

pub extern "c" fn abort() noreturn

std.c.abs

函数

第 11577 行

pub extern "c" fn abs(a: c_int) c_int

参数

a: c_int

std.c.accept

函数

第 11158 行

pub extern "c" fn accept(sockfd: fd_t, noalias addr: ?*sockaddr, noalias addrlen: ?*socklen_t) c_int

参数

sockfd: fd_t
addr: ?*sockaddr
addrlen: ?*socklen_t

std.c.accept_filter_arg

类型

第 4141 行

std.c.accept4

函数

第 11159 行

pub extern "c" fn accept4(sockfd: fd_t, noalias addr: ?*sockaddr, noalias addrlen: ?*socklen_t, flags: c_uint) c_int

参数

sockfd: fd_t
addr: ?*sockaddr
addrlen: ?*socklen_t
flags: c_uint

std.c.access

函数

第 11116 行

pub extern "c" fn access(path: [*:0]const u8, mode: c_uint) c_int

参数

path: [*:0]const u8
mode: c_uint

std.c.addrinfo

类型

第 4992 行

std.c.AF

类型

第 5417 行

std.c.AF_SUN

别名

第 11620 行

别名目标 std.c.illumos.AF_SUN

std.c.AF.@"802"

常量

第 5573 行

std.c.AF.ALG

常量

第 5456 行

std.c.AF.APPLETALK

常量

第 5424 行

std.c.AF.APPLETALK

常量

第 5485 行

std.c.AF.APPLETALK

常量

第 5525 行

std.c.AF.APPLETALK

常量

第 5571 行

std.c.AF.APPLETALK

常量

第 5610 行

std.c.AF.APPLETALK

常量

第 5647 行

std.c.AF.APPLETALK

常量

第 5666 行

std.c.AF.APPLETALK

常量

第 5683 行

std.c.AF.ARP

常量

第 5545 行

std.c.AF.ARP

常量

第 5620 行

std.c.AF.ASH

常量

第 5438 行

std.c.AF.ATM

常量

第 5540 行

std.c.AF.ATM

常量

第 5657 行

std.c.AF.ATMPVC

常量

第 5427 行

std.c.AF.ATMSVC

常量

第 5440 行

std.c.AF.AX25

常量

第 5422 行

std.c.AF.BLUETOOTH

常量

第 5449 行

std.c.AF.BLUETOOTH

常量

第 5546 行

std.c.AF.BLUETOOTH

常量

第 5621 行

std.c.AF.BLUETOOTH

常量

第 5659 行

std.c.AF.BLUETOOTH

常量

第 5675 行

std.c.AF.BLUETOOTH

常量

第 5689 行

std.c.AF.BRIDGE

常量

第 5426 行

std.c.AF.CAIF

常量

第 5455 行

std.c.AF.CAN

常量

第 5447 行

std.c.AF.CAN

常量

第 5625 行

std.c.AF.CCITT

常量

第 5479 行

std.c.AF.CCITT

常量

第 5519 行

std.c.AF.CCITT

常量

第 5565 行

std.c.AF.CCITT

常量

第 5604 行

std.c.AF.CCITT

常量

第 5642 行

std.c.AF.CHAOS

常量

第 5473 行

std.c.AF.CHAOS

常量

第 5513 行

std.c.AF.CHAOS

常量

第 5560 行

std.c.AF.CHAOS

常量

第 5598 行

std.c.AF.CHAOS

常量

第 5637 行

std.c.AF.CNT

常量

第 5490 行

std.c.AF.CNT

常量

第 5530 行

std.c.AF.CNT

常量

第 5614 行

std.c.AF.CNT

常量

第 5651 行

std.c.AF.COIP

常量

第 5489 行

std.c.AF.COIP

常量

第 5529 行

std.c.AF.COIP

常量

第 5613 行

std.c.AF.COIP

常量

第 5650 行

std.c.AF.DATAKIT

常量

第 5478 行

std.c.AF.DATAKIT

常量

第 5518 行

std.c.AF.DATAKIT

常量

第 5564 行

std.c.AF.DATAKIT

常量

第 5603 行

std.c.AF.DATAKIT

常量

第 5641 行

std.c.AF.DECnet

常量

第 5431 行

std.c.AF.DECnet

常量

第 5481 行

std.c.AF.DECnet

常量

第 5521 行

std.c.AF.DECnet

常量

第 5567 行

std.c.AF.DECnet

常量

第 5606 行

std.c.AF.DLI

常量

第 5482 行

std.c.AF.DLI

常量

第 5522 行

std.c.AF.DLI

常量

第 5568 行

std.c.AF.DLI

常量

第 5607 行

std.c.AF.DLI

常量

第 5644 行

std.c.AF.DLI

常量

第 5670 行

std.c.AF.E164

别名

第 5496 行

别名目标 std.c.AF.ISDN

std.c.AF.E164

别名

第 5536 行

别名目标 std.c.AF.ISDN

std.c.AF.E164

别名

第 5618 行

别名目标 std.c.AF.ISDN

std.c.AF.ECMA

常量

第 5477 行

std.c.AF.ECMA

常量

第 5517 行

std.c.AF.ECMA

常量

第 5563 行

std.c.AF.ECMA

常量

第 5602 行

std.c.AF.ECMA

常量

第 5640 行

std.c.AF.ECONET

常量

第 5439 行

std.c.AF.ETHER

常量

第 5626 行

std.c.AF.FILE

别名

第 5509 行

别名目标 std.c.AF.LOCAL

std.c.AF.FILE

别名

第 5556 行

别名目标 std.c.AF.UNIX

std.c.AF.GOSIP

常量

第 5577 行

std.c.AF.HYLINK

常量

第 5484 行

std.c.AF.HYLINK

常量

第 5524 行

std.c.AF.HYLINK

常量

第 5570 行

std.c.AF.HYLINK

常量

第 5609 行

std.c.AF.HYLINK

常量

第 5646 行

std.c.AF.IEEE80211

常量

第 5547 行

std.c.AF.IEEE80211

常量

第 5622 行

std.c.AF.IEEE802154

常量

第 5454 行

std.c.AF.IMPLINK

常量

第 5471 行

std.c.AF.IMPLINK

常量

第 5511 行

std.c.AF.IMPLINK

常量

第 5558 行

std.c.AF.IMPLINK

常量

第 5596 行

std.c.AF.IMPLINK

常量

第 5635 行

std.c.AF.INET

常量

第 5421 行

std.c.AF.INET

常量

第 5469 行

std.c.AF.INET

常量

第 5510 行

std.c.AF.INET

常量

第 5557 行

std.c.AF.INET

常量

第 5595 行

std.c.AF.INET

常量

第 5634 行

std.c.AF.INET

常量

第 5665 行

std.c.AF.INET

常量

第 5682 行

std.c.AF.INET

常量

第 5698 行

std.c.AF.INET_OFFLOAD

常量

第 5585 行

std.c.AF.INET_SDP

常量

第 5548 行

std.c.AF.INET6

常量

第 5429 行

std.c.AF.INET6

常量

第 5498 行

std.c.AF.INET6

常量

第 5538 行

std.c.AF.INET6

常量

第 5581 行

std.c.AF.INET6

常量

第 5616 行

std.c.AF.INET6

常量

第 5655 行

std.c.AF.INET6

常量

第 5669 行

std.c.AF.INET6

常量

第 5684 行

std.c.AF.INET6

常量

第 5699 行

std.c.AF.INET6_SDP

常量

第 5549 行

std.c.AF.IPX

常量

第 5423 行

std.c.AF.IPX

常量

第 5492 行

std.c.AF.IPX

常量

第 5532 行

std.c.AF.IPX

常量

第 5578 行

std.c.AF.IPX

常量

第 5615 行

std.c.AF.IPX

常量

第 5652 行

std.c.AF.IPX

常量

第 5671 行

std.c.AF.IRDA

常量

第 5443 行

std.c.AF.ISDN

常量

第 5452 行

std.c.AF.ISDN

常量

第 5495 行

std.c.AF.ISDN

常量

第 5535 行

std.c.AF.ISDN

常量

第 5617 行

std.c.AF.ISDN

常量

第 5654 行

std.c.AF.ISDN

常量

第 5690 行

std.c.AF.ISO

常量

第 5475 行

std.c.AF.ISO

常量

第 5515 行

std.c.AF.ISO

常量

第 5600 行

std.c.AF.ISO

常量

第 5639 行

std.c.AF.IUCV

常量

第 5450 行

std.c.AF.KCM

常量

第 5459 行

std.c.AF.KEY

常量

第 5434 行

std.c.AF.KEY

常量

第 5497 行

std.c.AF.KEY

常量

第 5582 行

std.c.AF.KEY

常量

第 5685 行

std.c.AF.LAT

常量

第 5483 行

std.c.AF.LAT

常量

第 5523 行

std.c.AF.LAT

常量

第 5569 行

std.c.AF.LAT

常量

第 5608 行

std.c.AF.LAT

常量

第 5645 行

std.c.AF.LINK

常量

第 5487 行

std.c.AF.LINK

常量

第 5527 行

std.c.AF.LINK

常量

第 5580 行

std.c.AF.LINK

常量

第 5612 行

std.c.AF.LINK

常量

第 5649 行

std.c.AF.LINK

常量

第 5668 行

std.c.AF.LLC

常量

第 5446 行

std.c.AF.LOCAL

常量

第 5420 行

std.c.AF.LOCAL

常量

第 5467 行

std.c.AF.LOCAL

别名

第 5508 行

别名目标 std.c.AF.UNIX

std.c.AF.LOCAL

别名

第 5555 行

别名目标 std.c.AF.UNIX

std.c.AF.LOCAL

常量

第 5593 行

std.c.AF.LOCAL

常量

第 5633 行

std.c.AF.LOCAL

常量

第 5673 行

std.c.AF.LOCAL

别名

第 5681 行

别名目标 std.c.AF.UNIX

std.c.AF.LOCAL

常量

第 5696 行

std.c.AF.LX_NETLINK

常量

第 5588 行

std.c.AF.MAX

常量

第 5461 行

std.c.AF.MAX

常量

第 5503 行

std.c.AF.MAX

常量

第 5550 行

std.c.AF.MAX

常量

第 5589 行

std.c.AF.MAX

常量

第 5627 行

std.c.AF.MAX

常量

第 5661 行

std.c.AF.MAX

常量

第 5676 行

std.c.AF.MAX

常量

第 5691 行

std.c.AF.MAX

常量

第 5700 行

std.c.AF.MPLS

常量

第 5623 行

std.c.AF.MPLS

常量

第 5660 行

std.c.AF.MPLS

常量

第 5688 行

std.c.AF.NATM

常量

第 5499 行

std.c.AF.NATM

常量

第 5539 行

std.c.AF.NATM

常量

第 5619 行

std.c.AF.NATM

常量

第 5656 行

std.c.AF.NBS

常量

第 5562 行

std.c.AF.NCA

常量

第 5583 行

std.c.AF.NETBEUI

常量

第 5432 行

std.c.AF.NETBIOS

常量

第 5501 行

std.c.AF.NETBIOS

常量

第 5514 行

std.c.AF.NETBIOS

常量

第 5638 行

std.c.AF.NETGRAPH

常量

第 5542 行

std.c.AF.NETGRAPH

常量

第 5658 行

std.c.AF.NETLINK

常量

第 5435 行

std.c.AF.NETROM

常量

第 5425 行

std.c.AF.NFC

常量

第 5457 行

std.c.AF.NIT

常量

第 5572 行

std.c.AF.NOTIFY

常量

第 5672 行

std.c.AF.NS

常量

第 5474 行

std.c.AF.NS

常量

第 5561 行

std.c.AF.NS

常量

第 5599 行

std.c.AF.OROUTE

常量

第 5611 行

std.c.AF.OSI

别名

第 5476 行

别名目标 std.c.AF.ISO

std.c.AF.OSI

别名

第 5516 行

别名目标 std.c.AF.ISO

std.c.AF.OSI

常量

第 5574 行

std.c.AF.OSI

别名

第 5601 行

别名目标 std.c.AF.ISO

std.c.AF.OSI

别名

第 5631 行

别名目标 std.c.AF.ISO

std.c.AF.OSINET

常量

第 5576 行

std.c.AF.PACKET

常量

第 5437 行

std.c.AF.PACKET

常量

第 5587 行

std.c.AF.PHONET

常量

第 5453 行

std.c.AF.PIP

常量

第 5494 行

std.c.AF.POLICY

常量

第 5584 行

std.c.AF.PPP

常量

第 5502 行

std.c.AF.PPPOX

常量

第 5444 行

std.c.AF.pseudo_HDRCMPLT

常量

第 5541 行

std.c.AF.pseudo_KEY

常量

第 5537 行

std.c.AF.pseudo_PIP

常量

第 5534 行

std.c.AF.pseudo_RTIP

常量

第 5531 行

std.c.AF.pseudo_XTP

常量

第 5528 行

std.c.AF.PUP

常量

第 5472 行

std.c.AF.PUP

常量

第 5512 行

std.c.AF.PUP

常量

第 5559 行

std.c.AF.PUP

常量

第 5597 行

std.c.AF.PUP

常量

第 5636 行

std.c.AF.QIPCRTR

常量

第 5460 行

std.c.AF.RDS

常量

第 5441 行

std.c.AF.ROSE

常量

第 5430 行

std.c.AF.ROUTE

别名

第 5436 行

别名目标 std.c.AF.NETLINK

std.c.AF.ROUTE

常量

第 5486 行

std.c.AF.ROUTE

常量

第 5526 行

std.c.AF.ROUTE

常量

第 5579 行

std.c.AF.ROUTE

常量

第 5624 行

std.c.AF.ROUTE

常量

第 5648 行

std.c.AF.ROUTE

常量

第 5667 行

std.c.AF.ROUTE

常量

第 5686 行

std.c.AF.RTIP

常量

第 5491 行

std.c.AF.RXRPC

常量

第 5451 行

std.c.AF.SCLUSTER

常量

第 5544 行

std.c.AF.SECURITY

常量

第 5433 行

std.c.AF.SIP

常量

第 5493 行

std.c.AF.SIP

常量

第 5533 行

std.c.AF.SIP

常量

第 5653 行

std.c.AF.SLOW

常量

第 5543 行

std.c.AF.SNA

常量

第 5442 行

std.c.AF.SNA

常量

第 5480 行

std.c.AF.SNA

常量

第 5520 行

std.c.AF.SNA

常量

第 5566 行

std.c.AF.SNA

常量

第 5605 行

std.c.AF.SNA

常量

第 5643 行

std.c.AF.SNA

常量

第 5687 行

std.c.AF.SYS_CONTROL

常量

第 5470 行

std.c.AF.SYSTEM

常量

第 5500 行

std.c.AF.TIPC

常量

第 5448 行

std.c.AF.TRILL

常量

第 5586 行

std.c.AF.UNIX

常量

第 5419 行

std.c.AF.UNIX

别名

第 5468 行

别名目标 std.c.AF.LOCAL

std.c.AF.UNIX

常量

第 5507 行

std.c.AF.UNIX

常量

第 5554 行

std.c.AF.UNIX

别名

第 5594 行

别名目标 std.c.AF.LOCAL

std.c.AF.UNIX

别名

第 5632 行

别名目标 std.c.AF.LOCAL

std.c.AF.UNIX

别名

第 5674 行

别名目标 std.c.AF.LOCAL

std.c.AF.UNIX

常量

第 5680 行

std.c.AF.UNIX

别名

第 5697 行

别名目标 std.c.AF.LOCAL

std.c.AF.UNSPEC

常量

第 5418 行

std.c.AF.UNSPEC

常量

第 5466 行

std.c.AF.UNSPEC

常量

第 5506 行

std.c.AF.UNSPEC

常量

第 5553 行

std.c.AF.UNSPEC

常量

第 5592 行

std.c.AF.UNSPEC

常量

第 5630 行

std.c.AF.UNSPEC

常量

第 5664 行

std.c.AF.UNSPEC

常量

第 5679 行

std.c.AF.UNSPEC

常量

第 5695 行

std.c.AF.VSOCK

常量

第 5458 行

std.c.AF.WANPIPE

常量

第 5445 行

std.c.AF.X25

常量

第 5428 行

std.c.AF.X25

常量

第 5575 行

std.c.AF.XTP

常量

第 5488 行

std.c.AI

类型

第 7536 行

std.c.alarm

函数

第 10577 行

pub extern "c" fn alarm(seconds: c_uint) c_uint

参数

seconds: c_uint

std.c.anon_create

别名

第 11970 行

别名目标 std.c.serenity.anon_create

std.c.arc4random_buf

常量

第 10641 行

std.c.ARCH

类型

第 271 行

std.c.area_id

别名

第 11660 行

别名目标 std.c.haiku.area_id

std.c.assert

别名

第 10 行

别名目标 std.debug.assert

std.c.AT

类型

第 8523 行

std.c.AT_SUN

别名

第 11621 行

别名目标 std.c.illumos.AT_SUN

std.c.AT.BENEATH

常量

第 8554 行

不位于 dirfd 下时失败

std.c.AT.EACCESS

常量

第 8532 行

在访问检查中使用有效标识符

std.c.AT.EACCESS

常量

第 8546 行

使用有效用户 ID 及组 ID 检查访问权限。

std.c.AT.EACCESS

常量

第 8562 行

使用有效用户 ID 及组 ID 检查访问权限。

std.c.AT.EACCESS

常量

第 8574 行

std.c.AT.EACCESS

常量

第 8583 行

使用有效用户 ID 及组 ID 检查访问权限。

std.c.AT.EACCESS

常量

第 8596 行

std.c.AT.EACCESS

常量

第 8611 行

使用有效用户 ID 及组 ID 检查访问权限。

std.c.AT.EACCESS

常量

第 8628 行

std.c.AT.EACCESS

常量

第 8644 行

std.c.AT.EMPTY_PATH

常量

第 8619 行

std.c.AT.FDCWD

常量

第 8530 行

std.c.AT.FDCWD

常量

第 8544 行

指定在 openat() 及类似系统调用中使用当前工作目录来确定相对文件路径目标的特殊值。

std.c.AT.FDCWD

常量

第 8560 行

指定在 openat() 及类似系统调用中使用当前工作目录来确定相对文件路径目标的特殊值。

std.c.AT.FDCWD

常量

第 8571 行

std.c.AT.FDCWD

常量

第 8581 行

指定在 openat() 及类似系统调用中使用当前工作目录来确定相对文件路径目标的特殊值。

std.c.AT.FDCWD

常量

第 8592 行

std.c.AT.FDCWD

常量

第 8602 行

指定在 openat() 及类似系统调用中使用当前工作目录来确定相对文件路径目标的特殊值。

fd_t

std.c.AT.FDCWD

常量

第 8614 行

std.c.AT.FDCWD

常量

第 8637 行

链接 libc 时,遵循其约定,以 -2 表示当前工作目录。 不链接 libc 时,Zig 采用不同约定:假定 当前工作目录是第一个预打开目录。可以通过 根源码文件中名为 wasi_cwd 的公开函数 覆盖此行为。

fd_t

std.c.AT.FDCWD

常量

第 8641 行

std.c.AT.NO_AUTOMOUNT

常量

第 8618 行

std.c.AT.RECURSIVE

常量

第 8624 行

std.c.AT.REMOVEDIR

常量

第 8527 行

移除目录,而非解除文件链接

std.c.AT.REMOVEDIR

常量

第 8538 行

路径指向目录

std.c.AT.REMOVEDIR

常量

第 8552 行

移除目录,而非文件

std.c.AT.REMOVEDIR

常量

第 8568 行

移除目录,而非文件

std.c.AT.REMOVEDIR

常量

第 8573 行

std.c.AT.REMOVEDIR

常量

第 8589 行

移除目录,而非文件

std.c.AT.REMOVEDIR

常量

第 8595 行

std.c.AT.REMOVEDIR

常量

第 8608 行

移除目录,而非文件

std.c.AT.REMOVEDIR

常量

第 8616 行

std.c.AT.REMOVEDIR

常量

第 8631 行

std.c.AT.REMOVEDIR

常量

第 8643 行

std.c.AT.STATX_DONT_SYNC

常量

第 8623 行

std.c.AT.STATX_FORCE_SYNC

常量

第 8622 行

std.c.AT.STATX_SYNC_AS_STAT

常量

第 8621 行

std.c.AT.STATX_SYNC_TYPE

常量

第 8620 行

std.c.AT.SYMLINK_FOLLOW

常量

第 8536 行

作用于符号链接的目标

std.c.AT.SYMLINK_FOLLOW

常量

第 8550 行

跟随符号链接

std.c.AT.SYMLINK_FOLLOW

常量

第 8566 行

跟随符号链接

std.c.AT.SYMLINK_FOLLOW

常量

第 8575 行

std.c.AT.SYMLINK_FOLLOW

常量

第 8587 行

跟随符号链接

std.c.AT.SYMLINK_FOLLOW

常量

第 8594 行

std.c.AT.SYMLINK_FOLLOW

常量

第 8606 行

跟随符号链接

std.c.AT.SYMLINK_FOLLOW

常量

第 8617 行

std.c.AT.SYMLINK_FOLLOW

常量

第 8630 行

std.c.AT.SYMLINK_NOFOLLOW

常量

第 8534 行

操作符号链接本身而非目标

std.c.AT.SYMLINK_NOFOLLOW

常量

第 8548 行

不跟随符号链接

std.c.AT.SYMLINK_NOFOLLOW

常量

第 8564 行

不跟随符号链接

std.c.AT.SYMLINK_NOFOLLOW

常量

第 8572 行

std.c.AT.SYMLINK_NOFOLLOW

常量

第 8585 行

不跟随符号链接

std.c.AT.SYMLINK_NOFOLLOW

常量

第 8593 行

std.c.AT.SYMLINK_NOFOLLOW

常量

第 8604 行

不跟随符号链接

std.c.AT.SYMLINK_NOFOLLOW

常量

第 8615 行

std.c.AT.SYMLINK_NOFOLLOW

常量

第 8629 行

std.c.AT.SYMLINK_NOFOLLOW

常量

第 8642 行

std.c.AT.TRIGGER

常量

第 8609 行

std.c.atan

函数

第 11605 行

pub extern "c" fn atan(x: f64) f64

参数

x: f64

std.c.atoi

函数

第 11585 行

pub extern "c" fn atoi(str: [*:0]const c_char) c_int

参数

str: [*:0]const c_char

std.c.atol

函数

第 11586 行

pub extern "c" fn atol(str: [*:0]const c_char) c_long

参数

str: [*:0]const c_char

std.c.atoll

函数

第 11587 行

pub extern "c" fn atoll(str: [*:0]const c_char) c_longlong

参数

str: [*:0]const c_char

std.c.AUTH

别名

第 11673 行

别名目标 std.c.openbsd.AUTH

std.c.auth_approval

别名

第 11678 行

别名目标 std.c.openbsd.auth_approval

std.c.auth_call

别名

第 11679 行

别名目标 std.c.openbsd.auth_call

std.c.auth_cat

别名

第 11680 行

别名目标 std.c.openbsd.auth_cat

std.c.auth_challenge

别名

第 11681 行

别名目标 std.c.openbsd.auth_challenge

std.c.auth_check_change

别名

第 11682 行

别名目标 std.c.openbsd.auth_check_change

std.c.auth_check_expire

别名

第 11683 行

别名目标 std.c.openbsd.auth_check_expire

std.c.auth_checknologin

别名

第 11684 行

别名目标 std.c.openbsd.auth_checknologin

std.c.auth_clean

别名

第 11685 行

别名目标 std.c.openbsd.auth_clean

std.c.auth_close

别名

第 11686 行

别名目标 std.c.openbsd.auth_close

std.c.auth_clrenv

别名

第 11687 行

别名目标 std.c.openbsd.auth_clrenv

std.c.auth_clroption

别名

第 11688 行

别名目标 std.c.openbsd.auth_clroption

std.c.auth_clroptions

别名

第 11689 行

别名目标 std.c.openbsd.auth_clroptions

std.c.auth_getitem

别名

第 11690 行

别名目标 std.c.openbsd.auth_getitem

std.c.auth_getpwd

别名

第 11691 行

别名目标 std.c.openbsd.auth_getpwd

std.c.auth_getstate

别名

第 11692 行

别名目标 std.c.openbsd.auth_getstate

std.c.auth_getvalue

别名

第 11693 行

别名目标 std.c.openbsd.auth_getvalue

std.c.auth_item_t

别名

第 11694 行

别名目标 std.c.openbsd.auth_item_t

std.c.auth_mkvalue

别名

第 11695 行

别名目标 std.c.openbsd.auth_mkvalue

std.c.auth_open

别名

第 11696 行

别名目标 std.c.openbsd.auth_open

std.c.auth_session_t

别名

第 11697 行

别名目标 std.c.openbsd.auth_session_t

std.c.auth_setdata

别名

第 11698 行

别名目标 std.c.openbsd.auth_setdata

std.c.auth_setenv

别名

第 11699 行

别名目标 std.c.openbsd.auth_setenv

std.c.auth_setitem

别名

第 11700 行

别名目标 std.c.openbsd.auth_setitem

std.c.auth_setoption

别名

第 11701 行

别名目标 std.c.openbsd.auth_setoption

std.c.auth_setpwd

别名

第 11702 行

别名目标 std.c.openbsd.auth_setpwd

std.c.auth_setstate

别名

第 11703 行

别名目标 std.c.openbsd.auth_setstate

std.c.auth_userchallenge

别名

第 11704 行

别名目标 std.c.openbsd.auth_userchallenge

std.c.auth_usercheck

别名

第 11705 行

别名目标 std.c.openbsd.auth_usercheck

std.c.auth_userokay

别名

第 11706 行

别名目标 std.c.openbsd.auth_userokay

std.c.auth_userresponse

别名

第 11707 行

别名目标 std.c.openbsd.auth_userresponse

std.c.auth_verify

别名

第 11708 行

别名目标 std.c.openbsd.auth_verify

std.c.B_ABSOLUTE_TIMEOUT

别名

第 11648 行

别名目标 std.c.haiku.B_ABSOLUTE_TIMEOUT

std.c.B_OS_NAME_LENGTH

别名

第 11649 行

别名目标 std.c.haiku.B_OS_NAME_LENGTH

std.c.B_TIMEOUT_REAL_TIME_BASE

别名

第 11650 行

别名目标 std.c.haiku.B_TIMEOUT_REAL_TIME_BASE

std.c.bcrypt

别名

第 11709 行

别名目标 std.c.openbsd.bcrypt

std.c.bcrypt_checkpass

别名

第 11710 行

别名目标 std.c.openbsd.bcrypt_checkpass

std.c.bcrypt_gensalt

别名

第 11711 行

别名目标 std.c.openbsd.bcrypt_gensalt

std.c.bcrypt_newhash

别名

第 11712 行

别名目标 std.c.openbsd.bcrypt_newhash

std.c.BI

别名

第 11674 行

别名目标 std.c.openbsd.BI

std.c.bind

函数

第 11153 行

pub extern "c" fn bind(socket: fd_t, address: ?*const sockaddr, address_len: socklen_t) c_int

参数

socket: fd_t
address: ?*const sockaddr
address_len: socklen_t

std.c.blkcnt_t

类型

第 254 行

std.c.blksize_t

类型

第 196 行

std.c.boolean_t

别名

第 11791 行

别名目标 std.c.darwin.boolean_t

std.c.bsearch

函数

第 11596 行

pub extern "c" fn bsearch( key: *const anyopaque, base: *const anyopaque, n: usize, size: usize, compare: *const fn (a: *const anyopaque, b: *const anyopaque) callconv(.c) c_int, ) ?*anyopaque

参数

key: *const anyopaque
base: *const anyopaque
n: usize
size: usize
compare: *const fn (a: *const anyopaque, b: *const anyopaque) callconv(.c) c_int

std.c.builtin

常量

第 1 行

std.c.bzero

函数

第 11541 行

pub extern "c" fn bzero(s: *anyopaque, n: usize) void

参数

s: *anyopaque
n: usize

std.c.c

别名

第 8 行

别名目标 std.c

std.c.caddr_t

类型

第 11283 行

std.c.CALENDAR_CLOCK

别名

第 11747 行

别名目标 std.c.darwin.CALENDAR_CLOCK

std.c.calloc

函数

第 11213 行

pub extern "c" fn calloc(usize, usize) ?*anyopaque

参数

calloc: usize
usize: usize

std.c.cap_rights

别名

第 11740 行

别名目标 std.c.freebsd.cap_rights

std.c.CAP_RIGHTS_VERSION

别名

第 11734 行

别名目标 std.c.freebsd.CAP_RIGHTS_VERSION

std.c.cc_t

类型

第 9054 行

std.c.chdir

函数

第 11125 行

pub extern "c" fn chdir(path: [*:0]const u8) c_int

参数

path: [*:0]const u8

std.c.chmod

函数

第 11134 行

pub extern "c" fn chmod(path: [*:0]const u8, mode: mode_t) c_int

参数

path: [*:0]const u8
mode: mode_t

std.c.CLOCK

别名

第 293 行

别名目标 std.c.clockid_t

std.c.clock_get_time

别名

第 11792 行

别名目标 std.c.darwin.clock_get_time

std.c.clock_getres

常量

第 10584 行

std.c.clock_gettime

常量

第 10589 行

std.c.clock_nanosleep

常量

第 11531 行

std.c.clock_res_t

别名

第 11794 行

别名目标 std.c.darwin.clock_res_t

std.c.clock_serv_t

别名

第 11793 行

别名目标 std.c.darwin.clock_serv_t

std.c.clock_t

类型

第 4152 行

std.c.clockid_t

类型

第 294 行

std.c.close

常量

第 10579 行

std.c.closedir

函数

第 10571 行

pub extern "c" fn closedir(dp: *DIR) c_int

参数

dp: *DIR

std.c.closelog

函数

第 11444 行

pub extern "c" fn closelog() void

std.c.cmsg_align

常量

第 4450 行

std.c.cmsghdr

类型

第 4409 行

std.c.common_linux_Sigaction

容器

第 3317 行

多种 Linux 变体通用的 Sigaction 结构体格式。

字段

handler: extern union {
    handler: ?handler_fn,
    sigaction: ?sigaction_fn,
}
mask: sigset_t
flags: c_uint
restorer: ?*const fn () callconv(.c) void = null

std.c.common_linux_Sigaction.handler_fn

类型

第 3318 行

std.c.common_linux_Sigaction.sigaction_fn

类型

第 3319 行

std.c.connect

函数

第 11157 行

pub extern "c" fn connect(sockfd: fd_t, sock_addr: *const sockaddr, addrlen: socklen_t) c_int

参数

sockfd: fd_t
sock_addr: *const sockaddr
addrlen: socklen_t

std.c.copy_file_range

常量

第 10842 行

std.c.COPYFILE

别名

第 11748 行

别名目标 std.c.darwin.COPYFILE

std.c.copysign

函数

第 11606 行

pub extern "c" fn copysign(x: f64, y: f64) f64

参数

x: f64
y: f64

std.c.CPU

类型

第 1389 行

std.c.CPU_COUNT

类型

第 381 行

std.c.cpu_set_t

类型

第 4164 行

std.c.CPU.AA64PFR0

常量

第 1399 行

std.c.CPU.AA64PFR1

常量

第 1400 行

std.c.CPU.AA64SMFR0

常量

第 1401 行

std.c.CPU.AA64ZFR0

常量

第 1402 行

std.c.CPU.COMPATIBLE

常量

第 1392 行

std.c.CPU.ID_AA64ISAR0

常量

第 1393 行

std.c.CPU.ID_AA64ISAR1

常量

第 1394 行

std.c.CPU.ID_AA64ISAR2

常量

第 1395 行

std.c.CPU.ID_AA64MMFR0

常量

第 1396 行

std.c.CPU.ID_AA64MMFR1

常量

第 1397 行

std.c.CPU.ID_AA64MMFR2

常量

第 1398 行

std.c.CPU.LED_BLINK

常量

第 1404 行

std.c.CPU.LIDACTION

常量

第 1403 行

std.c.CPUFAMILY

别名

第 11749 行

别名目标 std.c.darwin.CPUFAMILY

std.c.CSIZE

类型

第 9441 行

std.c.ctid_t

别名

第 11631 行

别名目标 std.c.illumos.ctid_t

std.c.CTL

类型

第 1331 行

std.c.CTL.DDB

常量

第 1372 行

std.c.CTL.DEBUG

常量

第 1338 行

std.c.CTL.DEBUG

常量

第 1346 行

std.c.CTL.DEBUG

常量

第 1354 行

std.c.CTL.DEBUG

常量

第 1368 行

std.c.CTL.DEBUG

常量

第 1381 行

std.c.CTL.FS

常量

第 1366 行

std.c.CTL.HW

常量

第 1339 行

std.c.CTL.HW

常量

第 1355 行

std.c.CTL.HW

常量

第 1369 行

std.c.CTL.HW

常量

第 1382 行

std.c.CTL.KERN

常量

第 1334 行

std.c.CTL.KERN

常量

第 1345 行

std.c.CTL.KERN

常量

第 1350 行

std.c.CTL.KERN

常量

第 1364 行

std.c.CTL.KERN

常量

第 1377 行

std.c.CTL.LWKT

常量

第 1358 行

std.c.CTL.MACHDEP

常量

第 1340 行

std.c.CTL.MACHDEP

常量

第 1356 行

std.c.CTL.MACHDEP

常量

第 1370 行

std.c.CTL.MACHDEP

常量

第 1383 行

std.c.CTL.MAXID

常量

第 1359 行

std.c.CTL.MAXID

常量

第 1385 行

std.c.CTL.MAXNAME

常量

第 1360 行

std.c.CTL.NET

常量

第 1337 行

std.c.CTL.NET

常量

第 1353 行

std.c.CTL.NET

常量

第 1367 行

std.c.CTL.NET

常量

第 1380 行

std.c.CTL.P1003_1B

常量

第 1342 行

std.c.CTL.SYSCTL

常量

第 1333 行

std.c.CTL.UNSPEC

常量

第 1349 行

std.c.CTL.UNSPEC

常量

第 1363 行

std.c.CTL.UNSPEC

常量

第 1376 行

std.c.CTL.USER

常量

第 1341 行

std.c.CTL.USER

常量

第 1357 行

std.c.CTL.USER

常量

第 1384 行

std.c.CTL.VFS

常量

第 1336 行

std.c.CTL.VFS

常量

第 1352 行

std.c.CTL.VFS

常量

第 1373 行

std.c.CTL.VFS

常量

第 1379 行

std.c.CTL.VM

常量

第 1335 行

std.c.CTL.VM

常量

第 1351 行

std.c.CTL.VM

常量

第 1365 行

std.c.CTL.VM

常量

第 1378 行

std.c.darwin

别名

第 17 行

别名目标 std.c.darwin

std.c.DB_RECORDTYPE

别名

第 11751 行

别名目标 std.c.darwin.DB_RECORDTYPE

std.c.dev_t

类型

第 150 行

std.c.DIR

容器

第 10567 行

std.c.dirent

类型

第 7438 行

std.c.DirEnt

别名

第 11651 行

别名目标 std.c.haiku.DirEnt

std.c.dirent.reclen

函数

第 7495 行

pub fn reclen(self: dirent) u16

参数

self: dirent

std.c.dirent64

类型

第 7525 行

std.c.disown

别名

第 11962 行

别名目标 std.c.serenity.disown

std.c.dispatch

别名

第 11796 行

别名目标 std.c.darwin.dispatch

std.c.div

函数

第 11581 行

pub extern "c" fn div(a: c_int, b: c_int) div_t

参数

a: c_int
b: c_int

std.c.div_t

容器

第 11485 行

字段

quot: c_int
rem: c_int

std.c.dl_info

类型

第 11428 行

std.c.dl_iterate_phdr

函数

第 10830 行

pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int

参数

callback: dl_iterate_phdr_callback
data: ?*anyopaque

std.c.dl_iterate_phdr_callback

类型

第 7856 行

std.c.dl_phdr_info

类型

第 4169 行

std.c.dladdr

常量

第 11427 行

std.c.dlclose

函数

第 11423 行

pub extern "c" fn dlclose(handle: *anyopaque) c_int

参数

handle: *anyopaque

std.c.dlerror

函数

第 11425 行

pub extern "c" fn dlerror() ?[*:0]u8

std.c.dlopen

函数

第 11422 行

pub extern "c" fn dlopen(path: ?[*:0]const u8, mode: RTLD) ?*anyopaque

参数

path: ?[*:0]const u8
mode: RTLD

std.c.dlsym

函数

第 11424 行

pub extern "c" fn dlsym(handle: ?*anyopaque, symbol: [*:0]const u8) ?*anyopaque

参数

handle: ?*anyopaque
symbol: [*:0]const u8

std.c.dn_expand

函数

第 11374 行

pub extern "c" fn dn_expand( msg: [*:0]const u8, eomorig: [*:0]const u8, comp_dn: [*:0]const u8, exp_dn: [*:0]u8, length: c_int, ) c_int

参数

msg: [*:0]const u8
eomorig: [*:0]const u8
comp_dn: [*:0]const u8
exp_dn: [*:0]u8
length: c_int

std.c.dragonfly

别名

第 21 行

别名目标 std.c.dragonfly

std.c.DT

类型

第 5982 行

std.c.DT.BLK

常量

第 5990 行

std.c.DT.BLK

常量

第 6001 行

std.c.DT.CHR

常量

第 5988 行

std.c.DT.CHR

常量

第 5999 行

std.c.DT.DBF

常量

第 6006 行

std.c.DT.DIR

常量

第 5989 行

std.c.DT.DIR

常量

第 6000 行

std.c.DT.FIFO

常量

第 5987 行

std.c.DT.FIFO

常量

第 5998 行

std.c.DT.LNK

常量

第 5992 行

std.c.DT.LNK

常量

第 6003 行

std.c.DT.REG

常量

第 5991 行

std.c.DT.REG

常量

第 6002 行

std.c.DT.SOCK

常量

第 5993 行

std.c.DT.SOCK

常量

第 6004 行

std.c.DT.UNKNOWN

常量

第 5986 行

std.c.DT.UNKNOWN

常量

第 5997 行

std.c.DT.WHT

常量

第 5994 行

std.c.DT.WHT

常量

第 6005 行

std.c.dummy_execute_header

变量

第 43 行

mach_hdr

std.c.dup

函数

第 11129 行

pub extern "c" fn dup(fd: fd_t) c_int

参数

fd: fd_t

std.c.dup2

函数

第 11130 行

pub extern "c" fn dup2(old_fd: fd_t, new_fd: fd_t) c_int

参数

old_fd: fd_t
new_fd: fd_t

std.c.dup3

函数

第 11131 行

pub extern "c" fn dup3(old: c_int, new: c_int, flags: c_uint) c_int

参数

old: c_int
new: c_int
flags: c_uint

std.c.dyld_image_path_containing_address

别名

第 11789 行

别名目标 std.c.darwin.dyld_image_path_containing_address

std.c.E

类型

第 386 行

std.c.EAI

类型

第 7688 行

std.c.elf_aux_info

函数

第 10703 行

pub extern "c" fn elf_aux_info(aux: c_int, buf: *anyopaque, buflen: c_int) c_int

参数

aux: c_int
buf: *anyopaque
buflen: c_int

std.c.Elf_Symndx

类型

第 840 行

std.c.emscripten

别名

第 13 行

别名目标 std.os.emscripten

std.c.endgrent

函数

第 10624 行

pub extern "c" fn endgrent() void

std.c.endpwent

函数

第 10616 行

pub extern "c" fn endpwent() void

std.c.environ

变量

第 11055 行

[*:null]?[*:0]u8

std.c.epoll_create1

函数

第 10668 行

pub extern "c" fn epoll_create1(flags: c_uint) c_int

参数

flags: c_uint

std.c.epoll_ctl

函数

第 10667 行

pub extern "c" fn epoll_ctl(epfd: fd_t, op: c_uint, fd: fd_t, event: ?*epoll_event) c_int

参数

epfd: fd_t
op: c_uint
fd: fd_t
event: ?*epoll_event

std.c.epoll_event

类型

第 4207 行

std.c.epoll_pwait

函数

第 10670 行

pub extern "c" fn epoll_pwait( epfd: fd_t, events: [*]epoll_event, maxevents: c_int, timeout: c_int, sigmask: *const sigset_t, ) c_int

参数

epfd: fd_t
events: [*]epoll_event
maxevents: c_int
timeout: c_int
sigmask: *const sigset_t

std.c.epoll_wait

函数

第 10669 行

pub extern "c" fn epoll_wait(epfd: fd_t, events: [*]epoll_event, maxevents: c_uint, timeout: c_int) c_int

参数

epfd: fd_t
events: [*]epoll_event
maxevents: c_uint
timeout: c_int

std.c.erand48

函数

第 11567 行

pub extern "c" fn erand48(xsubi: *[3]c_ushort) f64

参数

xsubi: *[3]c_ushort

std.c.errno

函数

第 76 行

rc 为 -1 时获取 errno;rc 不为 -1 时返回 SUCCESS。

pub fn errno(rc: anytype) E

std.c.EV

类型

第 9986 行

std.c.EV.ADD

常量

第 9990 行

将事件添加到 kq(隐含启用)

std.c.EV.ADD

常量

第 10035 行

std.c.EV.ADD

常量

第 10051 行

将事件添加到 kq(隐含启用)

std.c.EV.ADD

常量

第 10076 行

将事件添加到 kq(隐含启用)

std.c.EV.ADD

常量

第 10112 行

std.c.EV.ADD

常量

第 10126 行

将事件添加到 kq(隐含启用)

std.c.EV.CLEAR

常量

第 10000 行

报告后清除事件状态

std.c.EV.CLEAR

常量

第 10040 行

std.c.EV.CLEAR

常量

第 10061 行

报告后清除事件状态

std.c.EV.CLEAR

常量

第 10090 行

报告后清除事件状态

std.c.EV.CLEAR

常量

第 10117 行

std.c.EV.CLEAR

常量

第 10136 行

报告后清除事件状态

std.c.EV.DELETE

常量

第 9992 行

从 kq 删除事件

std.c.EV.DELETE

常量

第 10036 行

std.c.EV.DELETE

常量

第 10053 行

从 kq 删除事件

std.c.EV.DELETE

常量

第 10078 行

从 kq 删除事件

std.c.EV.DELETE

常量

第 10113 行

std.c.EV.DELETE

常量

第 10128 行

从 kq 删除事件

std.c.EV.DISABLE

常量

第 9996 行

禁用事件(不予报告)

std.c.EV.DISABLE

常量

第 10038 行

std.c.EV.DISABLE

常量

第 10057 行

禁用事件(不予报告)

std.c.EV.DISABLE

常量

第 10082 行

禁用事件(不予报告)

std.c.EV.DISABLE

常量

第 10115 行

std.c.EV.DISABLE

常量

第 10132 行

禁用事件(不予报告)

std.c.EV.DISPATCH

常量

第 10007 行

报告后禁用事件

std.c.EV.DISPATCH

常量

第 10042 行

std.c.EV.DISPATCH

常量

第 10065 行

报告后禁用事件

std.c.EV.DISPATCH

常量

第 10097 行

报告后禁用事件

std.c.EV.DISPATCH

常量

第 10119 行

std.c.EV.DISPATCH

常量

第 10143 行

报告后禁用事件

std.c.EV.DISPATCH2

常量

第 10014 行

……与 DELETE 组合使用时,会延迟删除,直到启用特定于 udata 的事件。 返回 EINPROGRESS 以表示延迟处理

std.c.EV.DROP

常量

第 10101 行

应丢弃备注

std.c.EV.ENABLE

常量

第 9994 行

启用事件

std.c.EV.ENABLE

常量

第 10037 行

std.c.EV.ENABLE

常量

第 10055 行

启用事件

std.c.EV.ENABLE

常量

第 10080 行

启用事件

std.c.EV.ENABLE

常量

第 10114 行

std.c.EV.ENABLE

常量

第 10130 行

启用事件

std.c.EV.EOF

常量

第 10025 行

检测到 EOF(返回值)

std.c.EV.EOF

常量

第 10046 行

std.c.EV.EOF

常量

第 10071 行

检测到 EOF

std.c.EV.EOF

常量

第 10107 行

检测到 EOF(返回值)

std.c.EV.EOF

常量

第 10122 行

std.c.EV.ERROR

常量

第 10027 行

发生错误,data 包含 errno(返回值)

std.c.EV.ERROR

常量

第 10045 行

std.c.EV.ERROR

常量

第 10069 行

发生错误,data 包含 errno

std.c.EV.ERROR

常量

第 10109 行

发生错误时,事件数据包含 errno(返回值)

std.c.EV.ERROR

常量

第 10121 行

std.c.EV.FLAG0

常量

第 10021 行

筛选器专用标志

std.c.EV.FLAG1

常量

第 10023 行

筛选器专用标志

std.c.EV.FLAG1

常量

第 10044 行

std.c.EV.FLAG1

常量

第 10067 行

筛选器专用标志

std.c.EV.FLAG1

常量

第 10103 行

过滤器专用标志 1

std.c.EV.FLAG1

常量

第 10120 行

std.c.EV.FLAG2

常量

第 10105 行

过滤器专用标志 2

std.c.EV.FORCEONESHOT

常量

第 10084 行

启用 _ONESHOT 并强制触发

std.c.EV.KEEPUDATA

常量

第 10086 行

不更新 udata 字段

std.c.EV.NODATA

常量

第 10043 行

std.c.EV.ONESHOT

常量

第 9998 行

仅报告一次

std.c.EV.ONESHOT

常量

第 10039 行

std.c.EV.ONESHOT

常量

第 10059 行

仅报告一次

std.c.EV.ONESHOT

常量

第 10088 行

仅报告一次

std.c.EV.ONESHOT

常量

第 10116 行

std.c.EV.ONESHOT

常量

第 10134 行

仅报告一次

std.c.EV.OOBAND

别名

第 10032 行

输入时,描述符存在带外数据时过滤器应主动返回 输出时,表示描述符上存在带外数据

别名目标 std.c.EV.FLAG1

std.c.EV.POLL

别名

第 10029 行

对 EVFILT.READ 使用 poll(2) 语义

别名目标 std.c.EV.FLAG0

std.c.EV.RECEIPT

常量

第 10005 行

强制立即输出事件 ……无论是否存在 ERROR ……对于支持标志的系统调用, 使用 KEVENT_FLAG_ERROR_EVENTS

std.c.EV.RECEIPT

常量

第 10041 行

std.c.EV.RECEIPT

常量

第 10063 行

成功时强制 EV_ERROR,data=0

std.c.EV.RECEIPT

常量

第 10095 行

强制立即输出事件 ……无论是否存在 ERROR ……对于支持标志的系统调用, 使用 KEVENT_FLAG_ERROR_EVENTS

std.c.EV.RECEIPT

常量

第 10118 行

std.c.EV.RECEIPT

常量

第 10141 行

强制立即输出事件 ……无论是否存在 ERROR ……对于支持标志的系统调用, 使用 KEVENT_FLAG_ERROR_EVENTS

std.c.EV.SYSFLAGS

常量

第 10019 行

系统预留

std.c.EV.SYSFLAGS

常量

第 10047 行

std.c.EV.SYSFLAGS

常量

第 10099 行

系统预留

std.c.EV.UDATA_SPECIFIC

常量

第 10009 行

每个 udata 值对应唯一 kevent

std.c.EV.VANISHED

常量

第 10017 行

报告源已消失 ……仅与 DISPATCH2 配合时有效

std.c.eventfd

函数

第 10665 行

pub extern "c" fn eventfd(initval: c_uint, flags: c_uint) c_int

参数

initval: c_uint
flags: c_uint

std.c.EVFILT

类型

第 10148 行

std.c.EVFILT.AIO

常量

第 10153 行

已附加到 aio 请求

std.c.EVFILT.AIO

常量

第 10178 行

已附加到 aio 请求

std.c.EVFILT.AIO

常量

第 10206 行

std.c.EVFILT.AIO

常量

第 10216 行

已附加到 aio 请求

std.c.EVFILT.AIO

常量

第 10237 行

已附加到 aio 请求

std.c.EVFILT.AIO

常量

第 10266 行

std.c.EVFILT.DEVICE

常量

第 10271 行

std.c.EVFILT.EMPTY

常量

第 10196 行

std.c.EVFILT.EMPTY

常量

第 10230 行

空过滤器

std.c.EVFILT.EMPTY

常量

第 10257 行

清空发送套接字缓冲区

std.c.EVFILT.EXCEPT

常量

第 10171 行

异常事件

std.c.EVFILT.EXCEPT

常量

第 10201 行

std.c.EVFILT.EXCEPT

常量

第 10272 行

std.c.EVFILT.FS

常量

第 10165 行

文件系统事件

std.c.EVFILT.FS

常量

第 10190 行

文件系统事件

std.c.EVFILT.FS

常量

第 10199 行

std.c.EVFILT.FS

常量

第 10226 行

文件系统事件

std.c.EVFILT.FS

常量

第 10249 行

文件系统事件

std.c.EVFILT.JAIL

常量

第 10259 行

附加到 struct prison

std.c.EVFILT.JAILDESC

常量

第 10261 行

附加到 jail 描述符

std.c.EVFILT.LIO

常量

第 10191 行

std.c.EVFILT.LIO

常量

第 10251 行

附加到 lio 请求

std.c.EVFILT.MACHPORT

常量

第 10163 行

Mach 端口集合

std.c.EVFILT.MARKER

常量

第 10210 行

std.c.EVFILT.PROC

常量

第 10157 行

附加到 struct proc

std.c.EVFILT.PROC

常量

第 10182 行

附加到 struct proc

std.c.EVFILT.PROC

常量

第 10204 行

std.c.EVFILT.PROC

常量

第 10220 行

附加到 struct proc

std.c.EVFILT.PROC

常量

第 10241 行

附加到 struct proc

std.c.EVFILT.PROC

常量

第 10268 行

std.c.EVFILT.PROCDESC

常量

第 10188 行

进程描述符

std.c.EVFILT.PROCDESC

常量

第 10247 行

进程描述符

std.c.EVFILT.READ

常量

第 10150 行

std.c.EVFILT.READ

常量

第 10175 行

std.c.EVFILT.READ

常量

第 10208 行

std.c.EVFILT.READ

常量

第 10213 行

std.c.EVFILT.READ

常量

第 10234 行

std.c.EVFILT.READ

常量

第 10264 行

std.c.EVFILT.SENDFILE

常量

第 10195 行

Sendfile 事件

std.c.EVFILT.SENDFILE

常量

第 10255 行

Sendfile 事件

std.c.EVFILT.SIGNAL

常量

第 10159 行

附加到 struct proc

std.c.EVFILT.SIGNAL

常量

第 10184 行

附加到 struct proc

std.c.EVFILT.SIGNAL

常量

第 10203 行

std.c.EVFILT.SIGNAL

常量

第 10222 行

附加到 struct proc

std.c.EVFILT.SIGNAL

常量

第 10243 行

附加到 struct proc

std.c.EVFILT.SIGNAL

常量

第 10269 行

std.c.EVFILT.SYSCOUNT

常量

第 10172 行

std.c.EVFILT.SYSCOUNT

常量

第 10209 行

std.c.EVFILT.TIMER

常量

第 10161 行

定时器

std.c.EVFILT.TIMER

常量

第 10186 行

定时器

std.c.EVFILT.TIMER

常量

第 10202 行

std.c.EVFILT.TIMER

常量

第 10224 行

定时器

std.c.EVFILT.TIMER

常量

第 10245 行

定时器

std.c.EVFILT.TIMER

常量

第 10270 行

std.c.EVFILT.USER

常量

第 10167 行

用户事件

std.c.EVFILT.USER

常量

第 10193 行

用户事件

std.c.EVFILT.USER

常量

第 10200 行

std.c.EVFILT.USER

常量

第 10228 行

用户事件

std.c.EVFILT.USER

常量

第 10253 行

用户事件

std.c.EVFILT.USER

常量

第 10273 行

std.c.EVFILT.VM

常量

第 10169 行

虚拟内存事件

std.c.EVFILT.VNODE

常量

第 10155 行

附加到 vnode

std.c.EVFILT.VNODE

常量

第 10180 行

附加到 vnode

std.c.EVFILT.VNODE

常量

第 10205 行

std.c.EVFILT.VNODE

常量

第 10218 行

附加到 vnode

std.c.EVFILT.VNODE

常量

第 10239 行

附加到 vnode

std.c.EVFILT.VNODE

常量

第 10267 行

std.c.EVFILT.WRITE

常量

第 10151 行

std.c.EVFILT.WRITE

常量

第 10176 行

std.c.EVFILT.WRITE

常量

第 10207 行

std.c.EVFILT.WRITE

常量

第 10214 行

std.c.EVFILT.WRITE

常量

第 10235 行

std.c.EVFILT.WRITE

常量

第 10265 行

std.c.EXC

别名

第 11752 行

别名目标 std.c.darwin.EXC

std.c.EXCEPTION

别名

第 11753 行

别名目标 std.c.darwin.EXCEPTION

std.c.exception_behavior_array_t

别名

第 11908 行

别名目标 std.c.darwin.exception_behavior_array_t

std.c.exception_behavior_t

别名

第 11909 行

别名目标 std.c.darwin.exception_behavior_t

std.c.exception_data_t

别名

第 11910 行

别名目标 std.c.darwin.exception_data_t

std.c.exception_data_type_t

别名

第 11911 行

别名目标 std.c.darwin.exception_data_type_t

std.c.exception_flavor_array_t

别名

第 11912 行

别名目标 std.c.darwin.exception_flavor_array_t

std.c.exception_handler_array_t

别名

第 11913 行

别名目标 std.c.darwin.exception_handler_array_t

std.c.exception_handler_t

别名

第 11914 行

别名目标 std.c.darwin.exception_handler_t

std.c.exception_mask_array_t

别名

第 11915 行

别名目标 std.c.darwin.exception_mask_array_t

std.c.exception_mask_t

别名

第 11916 行

别名目标 std.c.darwin.exception_mask_t

std.c.exception_port_array_t

别名

第 11917 行

别名目标 std.c.darwin.exception_port_array_t

std.c.exception_port_t

别名

第 11918 行

别名目标 std.c.darwin.exception_port_t

std.c.exception_type_t

别名

第 11919 行

别名目标 std.c.darwin.exception_type_t

std.c.execve

函数

第 11127 行

pub extern "c" fn execve(path: [*:0]const u8, argv: [*:null]const ?[*:0]const u8, envp: [*:null]const ?[*:0]const u8) c_int

参数

path: [*:0]const u8
argv: [*:null]const ?[*:0]const u8
envp: [*:null]const ?[*:0]const u8

std.c.execveat

函数

第 11128 行

pub extern "c" fn execveat(dirfd: fd_t, path: [*:0]const u8, argv: [*:null]const ?[*:0]const u8, envp: [*:null]const ?[*:0]const u8, flags: EXECVEAT) c_int

参数

dirfd: fd_t
path: [*:0]const u8
argv: [*:null]const ?[*:0]const u8
envp: [*:null]const ?[*:0]const u8
flags: EXECVEAT

std.c.EXECVEAT

类型

第 8887 行

std.c.exit

函数

第 11064 行

pub extern "c" fn exit(code: c_int) noreturn

参数

code: c_int

std.c.F

类型

第 845 行

fcntl(2) 的命令标志。

std.c.F_OK

常量

第 1238 行

测试文件是否存在。

std.c.F.ADD_SEALS

常量

第 994 行

std.c.F.ADDFILESIGS

常量

第 908 行

从同一文件添加签名(由 dyld 用于共享库)。

std.c.F.ADDFILESIGS_FOR_DYLD_SIM

常量

第 940 行

仅当由 Apple 签名时,添加同一文件中的签名(由 dyld 用于模拟器)

std.c.F.ADDFILESIGS_RETURN

常量

第 944 行

从同一文件添加签名,成功时返回结构体中的结束偏移

std.c.F.ADDSIGS

常量

第 906 行

添加分离签名

std.c.F.ALLOCSP

常量

第 1084 行

分配文件空间

std.c.F.BADFD

常量

第 1100 行

创建毒化 FD

std.c.F.BARRIERFSYNC

常量

第 942 行

fsync 并向驱动器发出屏障

std.c.F.BLKSIZE

常量

第 1069 行

获取最优 I/O 块大小

std.c.F.BLOCKS

常量

第 1067 行

获取已分配的 BLKSIZE 大小块的数量

std.c.F.CANCEL

常量

第 1019 行

取消异步加锁请求。

std.c.F.CHECK_LV

常量

第 946 行

检查 Library Validation 是否允许将此 Mach-O 文件映射到调用进程

std.c.F.CHKCLEAN

常量

第 880 行

用于回归测试

std.c.F.CHKFL

常量

第 1050 行

未使用

std.c.F.CLOSEM

常量

第 1142 行

std.c.F.DUP2FD

常量

第 1052 行

从第三个参数起复制 fildes

std.c.F.DUP2FD

常量

第 1172 行

std.c.F.DUP2FD_CLOEXEC

常量

第 992 行

设置 FD_CLOEXEC 的 DUP2FD。

std.c.F.DUP2FD_CLOEXEC

常量

第 1054 行

类似于设置了 O_CLOEXEC 的 DUP2FD;若 fildes 与 arg1 相同则返回 EINVAL

std.c.F.DUP2FD_CLOEXEC

常量

第 1174 行

std.c.F.DUPFD

常量

第 857 行

复制文件描述符

std.c.F.DUPFD

常量

第 962 行

重复的文件描述符。

std.c.F.DUPFD

常量

第 1037 行

复制 fildes

std.c.F.DUPFD

常量

第 1132 行

std.c.F.DUPFD

常量

第 1159 行

std.c.F.DUPFD

常量

第 1178 行

std.c.F.DUPFD

常量

第 1194 行

std.c.F.DUPFD

常量

第 1213 行

std.c.F.DUPFD_CLOEXEC

常量

第 952 行

为副本设置 FD_CLOEXEC

std.c.F.DUPFD_CLOEXEC

常量

第 990 行

设置了 FD_CLOEXEC 的 DUPFD。

std.c.F.DUPFD_CLOEXEC

常量

第 1056 行

类似 DUPFD,但设置了 O_CLOEXEC

std.c.F.DUPFD_CLOEXEC

常量

第 1144 行

std.c.F.DUPFD_CLOEXEC

常量

第 1173 行

std.c.F.DUPFD_CLOEXEC

常量

第 1187 行

std.c.F.DUPFD_CLOEXEC

常量

第 1222 行

std.c.F.FINDSIGS

常量

第 938 行

添加分离的代码签名(由 dyld 用于共享库)。

std.c.F.FLUSH_DATA

常量

第 878 行

std.c.F.FREESP

常量

第 1086 行

释放文件空间

std.c.F.FREEZE_FS

常量

第 900 行

“冻结”所有文件系统操作

std.c.F.FULLFSYNC

常量

第 896 行

fsync + 请求驱动器将数据刷新到介质

std.c.F.GET_SEALS

常量

第 995 行

std.c.F.GETCODEDIR

常量

第 925 行

将代码目录及其关联哈希返回给调用方

std.c.F.GETFD

常量

第 850 行

std.c.F.GETFD

常量

第 859 行

获取文件描述符标志

std.c.F.GETFD

常量

第 964 行

获取文件描述符标志。

std.c.F.GETFD

常量

第 1039 行

获取 fildes 标志

std.c.F.GETFD

常量

第 1133 行

std.c.F.GETFD

常量

第 1160 行

std.c.F.GETFD

常量

第 1179 行

std.c.F.GETFD

常量

第 1195 行

std.c.F.GETFD

常量

第 1214 行

std.c.F.GETFL

常量

第 852 行

std.c.F.GETFL

常量

第 863 行

获取文件状态标志

std.c.F.GETFL

常量

第 968 行

获取文件状态标志。

std.c.F.GETFL

常量

第 1043 行

获取文件标志

std.c.F.GETFL

常量

第 1135 行

std.c.F.GETFL

常量

第 1165 行

std.c.F.GETFL

常量

第 1181 行

std.c.F.GETFL

常量

第 1197 行

std.c.F.GETFL

常量

第 1216 行

std.c.F.GETLK

常量

第 871 行

获取记录锁信息

std.c.F.GETLK

常量

第 978 行

获取记录锁定信息。

std.c.F.GETLK

常量

第 1088 行

获取文件锁

std.c.F.GETLK

常量

第 1139 行

std.c.F.GETLK

常量

第 1169 行

std.c.F.GETLK

常量

第 1184 行

std.c.F.GETLK

常量

第 1203 行

std.c.F.GETLK

常量

第 1219 行

std.c.F.GETLKPID

常量

第 919 行

获取每个进程的记录锁信息

std.c.F.GETNOSIGPIPE

常量

第 929 行

此文件描述符的 SIGPIPE 状态

std.c.F.GETNOSIGPIPE

常量

第 1145 行

std.c.F.GETOWN

常量

第 867 行

获取 SIGIO/SIGURG 的进程或进程组

std.c.F.GETOWN

常量

第 973 行

获取 SIGIO/SIGURG 的进程或进程组。

std.c.F.GETOWN

常量

第 1071 行

获取所有者(套接字仿真)

std.c.F.GETOWN

常量

第 1137 行

std.c.F.GETOWN

常量

第 1167 行

std.c.F.GETOWN

常量

第 1200 行

std.c.F.GETOWN_EX

常量

第 1022 行

std.c.F.GETOWNER_UIDS

常量

第 1024 行

std.c.F.GETPATH

常量

第 894 行

返回文件描述符对应的完整路径

std.c.F.GETPATH

常量

第 1147 行

std.c.F.GETPATH

常量

第 1175 行

std.c.F.GETPATH_MTMINFO

常量

第 923 行

返回 FD 的完整路径,但在特定 mtmd 情况下报错

std.c.F.GETPROTECTIONCLASS

常量

第 913 行

从扩展属性获取文件的保护类,返回 int

std.c.F.GETPROTECTIONLEVEL

常量

第 936 行

获取此文件系统的保护版本号。

std.c.F.GETXFL

常量

第 1045 行

获取文件标志,包括仅打开时有效的标志

std.c.F.GLOBAL_NOCACHE

常量

第 904 行

对此文件全局关闭或开启数据缓存。

std.c.F.HASREMOTELOCKS

常量

第 1077 行

vp 是否具有锁管理器私有的 NFS 锁

std.c.F.ISSTREAM

常量

第 1059 行

文件描述符是否为流?

std.c.F.ISTTY

常量

第 1218 行

std.c.F.KINFO

常量

第 997 行

返回文件描述符的 kinfo_file。

std.c.F.LOCK

常量

第 1030 行

锁定一个区域供独占使用

std.c.F.LOCK

常量

第 1155 行

std.c.F.LOG2PHYS

常量

第 892 行

文件偏移转换为设备偏移

std.c.F.LOG2PHYS_EXT

常量

第 917 行

文件偏移量到设备偏移量,扩展形式

std.c.F.MAXFD

常量

第 1143 行

std.c.F.NOCACHE

常量

第 890 行

为此 fd 关闭或开启数据缓存

std.c.F.NODIRECT

常量

第 911 行

与 F.NOCACHE 配合使用,表示不应使用 DIRECT 同步写入 (即可暂时创建缓存页)

std.c.F.NODNY

常量

第 1121 行

不要拒绝他人访问

std.c.F.NPRIV

常量

第 1063 行

关闭对文件的私有访问

std.c.F.OFD_GETLK

常量

第 1090 行

获取文件拥有的文件锁

std.c.F.OFD_SETLK

常量

第 1092 行

设置由文件持有的文件锁

std.c.F.OFD_SETLKW

常量

第 1094 行

设置由文件持有的文件锁并等待

std.c.F.PATHPKG_CHECK

常量

第 898 行

查找哪个分量是包(若有)

std.c.F.PREALLOCATE

常量

第 882 行

预分配存储空间

std.c.F.PRIV

常量

第 1061 行

启用对文件的私有访问

std.c.F.PUNCHHOLE

常量

第 948 行

释放文件的一个范围

std.c.F.QUOTACTL

常量

第 1065 行

UFS 配额调用

std.c.F.RDACC

常量

第 1113 行

只读共享访问

std.c.F.RDADVISE

常量

第 886 行

异步发起建议性读取,不将数据复制到用户空间

std.c.F.RDAHEAD

常量

第 888 行

为此 fd 关闭或开启预读

std.c.F.RDDNY

常量

第 1123 行

拒绝其他方的共享读访问

std.c.F.RDLCK

常量

第 954 行

共享锁或读锁

std.c.F.RDLCK

常量

第 1011 行

共享锁或读锁。

std.c.F.RDLCK

常量

第 1103 行

读锁

std.c.F.RDLCK

常量

第 1149 行

std.c.F.RDLCK

常量

第 1161 行

std.c.F.RDLCK

常量

第 1189 行

std.c.F.RDLCK

常量

第 1207 行

std.c.F.RDLCK

常量

第 1225 行

std.c.F.READAHEAD

常量

第 987 行

预读。

std.c.F.REVOKE

常量

第 1075 行

对象复用时撤销文件描述符访问权限。

std.c.F.RMDNY

常量

第 1129 行

私有标志:拒绝共享删除访问

std.c.F.RWACC

常量

第 1117 行

共享读写访问

std.c.F.RWDNY

常量

第 1127 行

拒绝其他人共享读取或写入访问

std.c.F.SEAL_GROW

常量

第 1005 行

不可增长。

std.c.F.SEAL_SEAL

常量

第 1001 行

禁止添加封印。

std.c.F.SEAL_SHRINK

常量

第 1003 行

不可收缩

std.c.F.SEAL_WRITE

常量

第 1007 行

不可写入。

std.c.F.SETBACKINGSTORE

常量

第 921 行

将文件标记为另一个文件系统的底层存储。

std.c.F.SETFD

常量

第 851 行

std.c.F.SETFD

常量

第 861 行

设置文件描述符标志

std.c.F.SETFD

常量

第 966 行

设置文件描述符标志。

std.c.F.SETFD

常量

第 1041 行

设置 fildes 标志

std.c.F.SETFD

常量

第 1134 行

std.c.F.SETFD

常量

第 1162 行

std.c.F.SETFD

常量

第 1180 行

std.c.F.SETFD

常量

第 1196 行

std.c.F.SETFD

常量

第 1215 行

std.c.F.SETFL

常量

第 853 行

std.c.F.SETFL

常量

第 865 行

设置文件状态标志

std.c.F.SETFL

常量

第 970 行

设置文件状态标志。

std.c.F.SETFL

常量

第 1047 行

设置文件标志

std.c.F.SETFL

常量

第 1136 行

std.c.F.SETFL

常量

第 1166 行

std.c.F.SETFL

常量

第 1182 行

std.c.F.SETFL

常量

第 1198 行

std.c.F.SETFL

常量

第 1217 行

std.c.F.SETLK

常量

第 873 行

设置记录锁定信息

std.c.F.SETLK

常量

第 980 行

设置记录锁信息。

std.c.F.SETLK

常量

第 1080 行

设置文件锁

std.c.F.SETLK

常量

第 1140 行

std.c.F.SETLK

常量

第 1170 行

std.c.F.SETLK

常量

第 1185 行

std.c.F.SETLK

常量

第 1204 行

std.c.F.SETLK

常量

第 1220 行

std.c.F.SETLK_REMOTE

常量

第 985 行

远程锁的调试支持。

std.c.F.SETLKW

常量

第 875 行

F.SETLK;被阻塞时等待

std.c.F.SETLKW

常量

第 982 行

设置记录锁定信息,若被阻塞则等待。

std.c.F.SETLKW

常量

第 1082 行

设置文件锁并等待

std.c.F.SETLKW

常量

第 1141 行

std.c.F.SETLKW

常量

第 1171 行

std.c.F.SETLKW

常量

第 1186 行

std.c.F.SETLKW

常量

第 1205 行

std.c.F.SETLKW

常量

第 1221 行

std.c.F.SETLKWTIMEOUT

常量

第 877 行

F.SETLK;受阻时等待,超时返回

std.c.F.SETNOSIGPIPE

常量

第 927 行

EPIPE 时不生成 SIGPIPE

std.c.F.SETNOSIGPIPE

常量

第 1146 行

std.c.F.SETOWN

常量

第 869 行

设置 SIGIO/SIGURG 的进程/进程组

std.c.F.SETOWN

常量

第 975 行

设置 SIGIO/SIGURG 的进程/进程组。

std.c.F.SETOWN

常量

第 1073 行

设置所有者(套接字模拟)

std.c.F.SETOWN

常量

第 1138 行

std.c.F.SETOWN

常量

第 1168 行

std.c.F.SETOWN

常量

第 1201 行

std.c.F.SETOWN_EX

常量

第 1021 行

std.c.F.SETPROTECTIONCLASS

常量

第 915 行

为 EA 设置文件的保护类别,要求 int 类型

std.c.F.SETSIZE

常量

第 884 行

截断文件但不将空间清零

std.c.F.SHARE

常量

第 1096 行

设置文件共享预留

std.c.F.SINGLE_WRITER

常量

第 934 行

文件由单个写入者写入……若启用限速,写入 可能被拆分成更小的块,并在块之间限速

std.c.F.TEST

常量

第 1034 行

测试某个区域是否被其他进程加锁

std.c.F.TEST

常量

第 1157 行

std.c.F.THAW_FS

常量

第 902 行

“解冻”所有文件系统操作

std.c.F.TLOCK

常量

第 1032 行

测试并锁定一个区域以供独占使用

std.c.F.TLOCK

常量

第 1156 行

std.c.F.TRANSCODEKEY

常量

第 931 行

某些情况下,需要为 AKS/MKB 重新封装密钥

std.c.F.TRIM_ACTIVE_FILE

常量

第 950 行

裁剪活动文件

std.c.F.ULOCK

常量

第 1028 行

解锁先前锁定的区域

std.c.F.ULOCK

常量

第 1154 行

std.c.F.UNLCK

常量

第 956 行

解锁

std.c.F.UNLCK

常量

第 1013 行

解锁。

std.c.F.UNLCK

常量

第 1107 行

移除锁

std.c.F.UNLCK

常量

第 1151 行

std.c.F.UNLCK

常量

第 1163 行

std.c.F.UNLCK

常量

第 1190 行

std.c.F.UNLCK

常量

第 1208 行

std.c.F.UNLCK

常量

第 1227 行

std.c.F.UNLCKSYS

常量

第 1017 行

清除给定系统 ID 的锁。

std.c.F.UNLKSYS

常量

第 1109 行

移除指定系统的远程锁

std.c.F.UNSHARE

常量

第 1098 行

移除文件共享预留

std.c.F.WRACC

常量

第 1115 行

仅写共享访问

std.c.F.WRDNY

常量

第 1125 行

拒绝其他方的共享写访问

std.c.F.WRLCK

常量

第 958 行

独占锁或写锁

std.c.F.WRLCK

常量

第 1015 行

独占锁或写锁。

std.c.F.WRLCK

常量

第 1105 行

写锁

std.c.F.WRLCK

常量

第 1150 行

std.c.F.WRLCK

常量

第 1164 行

std.c.F.WRLCK

常量

第 1191 行

std.c.F.WRLCK

常量

第 1209 行

std.c.F.WRLCK

常量

第 1226 行

std.c.faccessat

函数

第 11117 行

pub extern "c" fn faccessat(dirfd: fd_t, path: [*:0]const u8, mode: c_uint, flags: c_uint) c_int

参数

dirfd: fd_t
path: [*:0]const u8
mode: c_uint
flags: c_uint

std.c.fallocate

函数

第 10694 行

pub extern "c" fn fallocate(fd: fd_t, mode: c_int, offset: off_t, len: off_t) c_int

参数

fd: fd_t
mode: c_int
offset: off_t
len: off_t

std.c.fallocate64

函数

第 10691 行

pub extern "c" fn fallocate64(fd: fd_t, mode: c_int, offset: off_t, len: off_t) c_int

参数

fd: fd_t
mode: c_int
offset: off_t
len: off_t

std.c.fchdir

函数

第 11126 行

pub extern "c" fn fchdir(fd: fd_t) c_int

参数

fd: fd_t

std.c.fchmod

函数

第 11135 行

pub extern "c" fn fchmod(fd: fd_t, mode: mode_t) c_int

参数

fd: fd_t
mode: mode_t

std.c.fchmodat

函数

第 11136 行

pub extern "c" fn fchmodat(fd: fd_t, path: [*:0]const u8, mode: mode_t, flags: c_uint) c_int

参数

fd: fd_t
path: [*:0]const u8
mode: mode_t
flags: c_uint

std.c.fchown

函数

第 11137 行

pub extern "c" fn fchown(fd: fd_t, owner: uid_t, group: gid_t) c_int

参数

fd: fd_t
owner: uid_t
group: gid_t

std.c.fchownat

函数

第 11138 行

pub extern "c" fn fchownat(fd: fd_t, path: [*:0]const u8, owner: uid_t, group: gid_t, flags: c_uint) c_int

参数

fd: fd_t
path: [*:0]const u8
owner: uid_t
group: gid_t
flags: c_uint

std.c.fclose

函数

第 11058 行

pub extern "c" fn fclose(stream: *FILE) c_int

参数

stream: *FILE

std.c.fcntl

函数

第 11148 行

pub extern "c" fn fcntl(fd: fd_t, cmd: c_int, ...) c_int

参数

fd: fd_t
cmd: c_int

std.c.fcopyfile

别名

第 11797 行

别名目标 std.c.darwin.fcopyfile

std.c.FD_CLOEXEC

常量

第 1231 行

std.c.fd_t

类型

第 263 行

std.c.fdatasync

函数

第 11433 行

pub extern "c" fn fdatasync(fd: c_int) c_int

参数

fd: c_int

std.c.fdim

函数

第 11607 行

pub extern "c" fn fdim(x: f64, y: f64) f64

参数

x: f64
y: f64

std.c.fdopendir

函数

第 10569 行

pub extern "c" fn fdopendir(fd: c_int) ?*DIR

参数

fd: c_int

std.c.fflags_t

别名

第 11741 行

别名目标 std.c.freebsd.fflags_t

std.c.ffs

函数

第 11563 行

pub extern "c" fn ffs(i: c_int) c_int

参数

i: c_int

std.c.ffsl

函数

第 11564 行

pub extern "c" fn ffsl(i: c_long) c_long

参数

i: c_long

std.c.ffsll

函数

第 11565 行

pub extern "c" fn ffsll(i: c_longlong) c_longlong

参数

i: c_longlong

std.c.FILE

容器

第 11420 行

std.c.FILE_EVENT

别名

第 11622 行

别名目标 std.c.illumos.FILE_EVENT

std.c.file_obj

别名

第 11632 行

别名目标 std.c.illumos.file_obj

std.c.find_thread

别名

第 11661 行

别名目标 std.c.haiku.find_thread

std.c.flock

常量

第 11044 行

std.c.Flock

类型

第 1262 行

std.c.fmemopen

函数

第 11440 行

pub extern "c" fn fmemopen(noalias buf: ?*anyopaque, size: usize, noalias mode: [*:0]const u8) ?*FILE

参数

buf: ?*anyopaque
size: usize
mode: [*:0]const u8

std.c.fopen

函数

第 11057 行

pub extern "c" fn fopen(noalias filename: [*:0]const u8, noalias modes: [*:0]const u8) ?*FILE

参数

filename: [*:0]const u8
modes: [*:0]const u8

std.c.fopen64

函数

第 10692 行

pub extern "c" fn fopen64(noalias filename: [*:0]const u8, noalias modes: [*:0]const u8) ?*FILE

参数

filename: [*:0]const u8
modes: [*:0]const u8

std.c.fork

常量

第 11097 行

std.c.fread

函数

第 11060 行

pub extern "c" fn fread(noalias ptr: [*]u8, size_of_type: usize, item_count: usize, noalias stream: *FILE) usize

参数

ptr: [*]u8
size_of_type: usize
item_count: usize
stream: *FILE

std.c.free

函数

第 11215 行

pub extern "c" fn free(?*anyopaque) void

参数

free: ?*anyopaque

std.c.freeaddrinfo

函数

第 11357 行

pub extern "c" fn freeaddrinfo(res: *addrinfo) void

参数

res: *addrinfo

std.c.freebsd

别名

第 18 行

别名目标 std.c.freebsd

std.c.frexp

函数

第 11608 行

pub extern "c" fn frexp(x: f64, e: *c_int) f64

参数

x: f64
e: *c_int

std.c.fsblkcnt_t

别名

第 11742 行

别名目标 std.c.freebsd.fsblkcnt_t

std.c.fsfilcnt_t

别名

第 11743 行

别名目标 std.c.freebsd.fsfilcnt_t

std.c.fstat

常量

第 10594 行

std.c.fstatat

常量

第 10604 行

std.c.fsync

函数

第 11432 行

pub extern "c" fn fsync(fd: c_int) c_int

参数

fd: c_int

std.c.ftruncate

函数

第 11071 行

pub extern "c" fn ftruncate(fd: c_int, length: off_t) c_int

参数

fd: c_int
length: off_t

std.c.ftruncate64

函数

第 10693 行

pub extern "c" fn ftruncate64(fd: c_int, length: off_t) c_int

参数

fd: c_int
length: off_t

std.c.futex

常量

第 11049 行

std.c.FUTEX

类型

第 10554 行

std.c.futimens

函数

第 11221 行

pub extern "c" fn futimens(fd: fd_t, times: ?*const [2]timespec) c_int

参数

fd: fd_t
times: ?*const [2]timespec

std.c.futimes

函数

第 11217 行

pub extern "c" fn futimes(fd: fd_t, times: ?*[2]timeval) c_int

参数

fd: fd_t
times: ?*[2]timeval

std.c.fwrite

函数

第 11059 行

pub extern "c" fn fwrite(noalias ptr: [*]const u8, size_of_type: usize, item_count: usize, noalias stream: *FILE) usize

参数

ptr: [*]const u8
size_of_type: usize
item_count: usize
stream: *FILE

std.c.gai_strerror

函数

第 11369 行

pub extern "c" fn gai_strerror(errcode: EAI) [*:0]const u8

参数

errcode: EAI

std.c.get_stack_bounds

别名

第 11969 行

别名目标 std.c.serenity.get_stack_bounds

std.c.get_system_info

别名

第 11662 行

别名目标 std.c.haiku.get_system_info

std.c.getaddrinfo

函数

第 11348 行

pub extern "c" fn getaddrinfo( noalias node: ?[*:0]const u8, noalias service: ?[*:0]const u8, noalias hints: ?*const addrinfo, noalias res: *?*addrinfo, ) EAI

参数

node: ?[*:0]const u8
service: ?[*:0]const u8
hints: ?*const addrinfo
res: *?*addrinfo

在 Linux 上,出错时不会修改 res; 向 freeaddrinfo 传入未定义指针可能导致崩溃。

std.c.getauxval

函数

第 10702 行

pub extern "c" fn getauxval(type: c_ulong) c_ulong

参数

type: c_ulong

std.c.GETCONTEXT

别名

第 11623 行

别名目标 std.c.illumos.GETCONTEXT

std.c.getcwd

函数

第 11089 行

pub extern "c" fn getcwd(buf: [*]u8, size: usize) ?[*]u8

参数

buf: [*]u8
size: usize

std.c.getdents

常量

第 10868 行

std.c.getdirentries

常量

第 10863 行

std.c.getegid

函数

第 11208 行

pub extern "c" fn getegid() gid_t

std.c.getentropy

常量

第 10649 行

std.c.getenv

函数

第 11142 行

pub extern "c" fn getenv(name: [*:0]const u8) ?[*:0]u8

参数

name: [*:0]const u8

std.c.geteuid

函数

第 11207 行

pub extern "c" fn geteuid() uid_t

std.c.getgid

函数

第 11206 行

pub extern "c" fn getgid() gid_t

std.c.getgrent

函数

第 10622 行

pub extern "c" fn getgrent() ?*group

std.c.getgrgid

函数

第 10627 行

pub extern "c" fn getgrgid(gid: gid_t) ?*group

参数

gid: gid_t

std.c.getgrgid_r

函数

第 10628 行

pub extern "c" fn getgrgid_r(gid: gid_t, grp: *group, buf: [*]u8, buflen: usize, result: *?*group) c_int

参数

gid: gid_t
grp: *group
buf: [*]u8
buflen: usize
result: *?*group

std.c.getgrnam

函数

第 10625 行

pub extern "c" fn getgrnam(name: [*:0]const u8) ?*group

参数

name: [*:0]const u8

std.c.getgrnam_r

函数

第 10626 行

pub extern "c" fn getgrnam_r(name: [*:0]const u8, grp: *group, buf: [*]u8, buflen: usize, result: *?*group) c_int

参数

name: [*:0]const u8
grp: *group
buf: [*]u8
buflen: usize
result: *?*group

std.c.gethostname

函数

第 11151 行

pub extern "c" fn gethostname(name: [*]u8, len: usize) c_int

参数

name: [*]u8
len: usize

std.c.getkeymap

别名

第 11971 行

别名目标 std.c.serenity.getkeymap

std.c.getnameinfo

函数

第 11359 行

pub extern "c" fn getnameinfo( noalias addr: *const sockaddr, addrlen: socklen_t, noalias host: ?[*]u8, hostlen: socklen_t, noalias serv: ?[*]u8, servlen: socklen_t, flags: NI, ) EAI

参数

addr: *const sockaddr
addrlen: socklen_t
host: ?[*]u8
hostlen: socklen_t
serv: ?[*]u8
servlen: socklen_t
flags: NI

std.c.getpeername

函数

第 11156 行

pub extern "c" fn getpeername(sockfd: fd_t, noalias addr: *sockaddr, noalias addrlen: *socklen_t) c_int

参数

sockfd: fd_t
addr: *sockaddr
addrlen: *socklen_t

std.c.getpid

函数

第 11449 行

pub extern "c" fn getpid() pid_t

std.c.getppid

函数

第 11450 行

pub extern "c" fn getppid() pid_t

std.c.getpwent

函数

第 10615 行

pub extern "c" fn getpwent() ?*passwd

std.c.getpwnam

函数

第 10618 行

pub extern "c" fn getpwnam(name: [*:0]const u8) ?*passwd

参数

name: [*:0]const u8

std.c.getpwnam_r

函数

第 10619 行

pub extern "c" fn getpwnam_r(name: [*:0]const u8, pwd: *passwd, buf: [*]u8, buflen: usize, result: *?*passwd) c_int

参数

name: [*:0]const u8
pwd: *passwd
buf: [*]u8
buflen: usize
result: *?*passwd

std.c.getpwnam_shadow

别名

第 11713 行

别名目标 std.c.openbsd.getpwnam_shadow

std.c.getpwuid

函数

第 10620 行

pub extern "c" fn getpwuid(uid: uid_t) ?*passwd

参数

uid: uid_t

std.c.getpwuid_r

函数

第 10621 行

pub extern "c" fn getpwuid_r(uid: uid_t, pwd: *passwd, buf: [*]u8, buflen: usize, result: *?*passwd) c_int

参数

uid: uid_t
pwd: *passwd
buf: [*]u8
buflen: usize
result: *?*passwd

std.c.getpwuid_shadow

别名

第 11714 行

别名目标 std.c.openbsd.getpwuid_shadow

std.c.getrandom

常量

第 10654 行

std.c.getresgid

函数

第 11210 行

pub extern "c" fn getresgid(rgid: *gid_t, egid: *gid_t, sgid: *gid_t) c_int

参数

rgid: *gid_t
egid: *gid_t
sgid: *gid_t

std.c.getresuid

函数

第 11209 行

pub extern "c" fn getresuid(ruid: *uid_t, euid: *uid_t, suid: *uid_t) c_int

参数

ruid: *uid_t
euid: *uid_t
suid: *uid_t

std.c.getrlimit

函数

第 11437 行

pub extern "c" fn getrlimit(resource: rlimit_resource, rlim: *rlimit) c_int

参数

resource: rlimit_resource
rlim: *rlimit

std.c.getrlimit64

函数

第 10629 行

pub extern "c" fn getrlimit64(resource: rlimit_resource, rlim: *rlimit) c_int

参数

resource: rlimit_resource
rlim: *rlimit

std.c.getrusage

常量

第 10873 行

std.c.getsockname

函数

第 11155 行

pub extern "c" fn getsockname(sockfd: fd_t, noalias addr: *sockaddr, noalias addrlen: *socklen_t) c_int

参数

sockfd: fd_t
addr: *sockaddr
addrlen: *socklen_t

std.c.getsockopt

函数

第 11160 行

pub extern "c" fn getsockopt(sockfd: fd_t, level: i32, optname: u32, noalias optval: ?*anyopaque, noalias optlen: *socklen_t) c_int

参数

sockfd: fd_t
level: i32
optname: u32
optval: ?*anyopaque
optlen: *socklen_t

std.c.getthrid

别名

第 11715 行

别名目标 std.c.openbsd.getthrid

std.c.gettimeofday

常量

第 10878 行

std.c.getuid

函数

第 11205 行

pub extern "c" fn getuid() uid_t

std.c.GETUSTACK

别名

第 11624 行

别名目标 std.c.illumos.GETUSTACK

std.c.gid_t

类型

第 189 行

std.c.group

类型

第 244 行

std.c.haiku

别名

第 22 行

别名目标 std.c.haiku

std.c.HOST_NAME_MAX

常量

第 1314 行

std.c.host_t

别名

第 11799 行

别名目标 std.c.darwin.host_t

std.c.HW

类型

第 1410 行

std.c.HW.ALLOWPOWERDOWN

常量

第 1447 行

std.c.HW.BYTEORDER

常量

第 1415 行

std.c.HW.BYTEORDER

常量

第 1429 行

std.c.HW.CPUSPEED

常量

第 1437 行

std.c.HW.DISKCOUNT

常量

第 1435 行

std.c.HW.DISKNAMES

常量

第 1419 行

std.c.HW.DISKNAMES

常量

第 1433 行

std.c.HW.DISKSTATS

常量

第 1420 行

std.c.HW.DISKSTATS

常量

第 1434 行

std.c.HW.FLOATINGPT

常量

第 1421 行

std.c.HW.MACHINE

常量

第 1412 行

std.c.HW.MACHINE

常量

第 1426 行

std.c.HW.MACHINE_ARCH

常量

第 1422 行

std.c.HW.MODEL

常量

第 1413 行

std.c.HW.MODEL

常量

第 1427 行

std.c.HW.NCPU

常量

第 1414 行

std.c.HW.NCPU

常量

第 1428 行

std.c.HW.NCPUFOUND

常量

第 1446 行

std.c.HW.NCPUONLINE

常量

第 1450 行

std.c.HW.PAGESIZE

常量

第 1418 行

std.c.HW.PAGESIZE

常量

第 1432 行

std.c.HW.PERFPOLICY

常量

第 1448 行

std.c.HW.PHYSMEM

常量

第 1416 行

std.c.HW.PHYSMEM

常量

第 1430 行

std.c.HW.PHYSMEM64

常量

第 1444 行

std.c.HW.POWER

常量

第 1451 行

std.c.HW.PRODUCT

常量

第 1440 行

std.c.HW.REALMEM

常量

第 1423 行

std.c.HW.SENSORS

常量

第 1436 行

std.c.HW.SERIALNO

常量

第 1442 行

std.c.HW.SETPERF

常量

第 1438 行

std.c.HW.SMT

常量

第 1449 行

std.c.HW.USERMEM

常量

第 1417 行

std.c.HW.USERMEM

常量

第 1431 行

std.c.HW.USERMEM64

常量

第 1445 行

std.c.HW.UUID

常量

第 1443 行

std.c.HW.VENDOR

常量

第 1439 行

std.c.HW.VERSION

常量

第 1441 行

std.c.HWCAP

类型

第 10705 行

std.c.HWCAP.@"2"

命名空间

第 10758 行

std.c.HWCAP.@"2"

命名空间

第 10807 行

std.c.HWCAP.@"2".ADX

常量

第 10765 行

std.c.HWCAP.@"2".AVX2

常量

第 10764 行

std.c.HWCAP.@"2".AVX512_4FMAPS

常量

第 10778 行

std.c.HWCAP.@"2".AVX512_4NNIW

常量

第 10777 行

std.c.HWCAP.@"2".AVX512_VNNI

常量

第 10785 行

std.c.HWCAP.@"2".AVX512BW

常量

第 10773 行

std.c.HWCAP.@"2".AVX512CD

常量

第 10772 行

std.c.HWCAP.@"2".AVX512DQ

常量

第 10768 行

std.c.HWCAP.@"2".AVX512ER

常量

第 10771 行

std.c.HWCAP.@"2".AVX512F

常量

第 10767 行

std.c.HWCAP.@"2".AVX512IFMA

常量

第 10769 行

std.c.HWCAP.@"2".AVX512PF

常量

第 10770 行

std.c.HWCAP.@"2".AVX512VBMI

常量

第 10775 行

std.c.HWCAP.@"2".AVX512VL

常量

第 10774 行

std.c.HWCAP.@"2".AVX512VPOPCDQ

常量

第 10776 行

std.c.HWCAP.@"2".BMI1

常量

第 10761 行

std.c.HWCAP.@"2".BMI2

常量

第 10762 行

std.c.HWCAP.@"2".CLFLUSHOPT

常量

第 10781 行

std.c.HWCAP.@"2".CLWB

常量

第 10782 行

std.c.HWCAP.@"2".CLZERO

常量

第 10784 行

std.c.HWCAP.@"2".F16C

常量

第 10759 行

std.c.HWCAP.@"2".FMA

常量

第 10763 行

std.c.HWCAP.@"2".FSGSBASE

常量

第 10780 行

std.c.HWCAP.@"2".ISA_ZBA

常量

第 10808 行

std.c.HWCAP.@"2".ISA_ZBB

常量

第 10809 行

std.c.HWCAP.@"2".ISA_ZBC

常量

第 10810 行

std.c.HWCAP.@"2".ISA_ZBS

常量

第 10811 行

std.c.HWCAP.@"2".ISA_ZFH

常量

第 10812 行

std.c.HWCAP.@"2".ISA_ZKT

常量

第 10813 行

std.c.HWCAP.@"2".ISA_ZVBB

常量

第 10814 行

std.c.HWCAP.@"2".ISA_ZVBC

常量

第 10815 行

std.c.HWCAP.@"2".ISA_ZVFH

常量

第 10816 行

std.c.HWCAP.@"2".ISA_ZVKG

常量

第 10817 行

std.c.HWCAP.@"2".ISA_ZVKNED

常量

第 10818 行

std.c.HWCAP.@"2".ISA_ZVKNHA

常量

第 10819 行

std.c.HWCAP.@"2".ISA_ZVKNHB

常量

第 10820 行

std.c.HWCAP.@"2".ISA_ZVKSED

常量

第 10821 行

std.c.HWCAP.@"2".ISA_ZVKSH

常量

第 10822 行

std.c.HWCAP.@"2".ISA_ZVKT

常量

第 10823 行

std.c.HWCAP.@"2".MONITORX

常量

第 10783 行

std.c.HWCAP.@"2".RDRAND

常量

第 10760 行

std.c.HWCAP.@"2".RDSEED

常量

第 10766 行

std.c.HWCAP.@"2".SHA

常量

第 10779 行

std.c.HWCAP.@"2".VAES

常量

第 10787 行

std.c.HWCAP.@"2".VPCLMULQDQ

常量

第 10786 行

std.c.HWCAP.AES

常量

第 10751 行

std.c.HWCAP.AHF

常量

第 10742 行

std.c.HWCAP.AMD_3DNow

常量

第 10733 行

std.c.HWCAP.AMD_3DNowx

常量

第 10734 行

std.c.HWCAP.AMD_LZCNT

常量

第 10746 行

std.c.HWCAP.AMD_MMX

常量

第 10732 行

std.c.HWCAP.AMD_SSE4A

常量

第 10744 行

std.c.HWCAP.AMD_SVM

常量

第 10756 行

std.c.HWCAP.AMD_SYSC

常量

第 10729 行

std.c.HWCAP.AVX

常量

第 10754 行

std.c.HWCAP.CMOV

常量

第 10730 行

std.c.HWCAP.CX16

常量

第 10741 行

std.c.HWCAP.CX8

常量

第 10727 行

std.c.HWCAP.FPU

常量

第 10725 行

std.c.HWCAP.FXSR

常量

第 10735 行

std.c.HWCAP.ISA_A

常量

第 10712 行

std.c.HWCAP.ISA_A

常量

第 10797 行

std.c.HWCAP.ISA_B

常量

第 10713 行

std.c.HWCAP.ISA_B

常量

第 10798 行

std.c.HWCAP.ISA_C

常量

第 10714 行

std.c.HWCAP.ISA_C

常量

第 10799 行

std.c.HWCAP.ISA_D

常量

第 10715 行

std.c.HWCAP.ISA_D

常量

第 10800 行

std.c.HWCAP.ISA_F

常量

第 10716 行

std.c.HWCAP.ISA_F

常量

第 10801 行

std.c.HWCAP.ISA_H

常量

第 10717 行

std.c.HWCAP.ISA_H

常量

第 10802 行

std.c.HWCAP.ISA_I

常量

第 10718 行

std.c.HWCAP.ISA_I

常量

第 10803 行

std.c.HWCAP.ISA_M

常量

第 10719 行

std.c.HWCAP.ISA_M

常量

第 10804 行

std.c.HWCAP.ISA_V

常量

第 10720 行

std.c.HWCAP.ISA_V

常量

第 10805 行

std.c.HWCAP.MMX

常量

第 10731 行

std.c.HWCAP.MON

常量

第 10740 行

std.c.HWCAP.MOVBE

常量

第 10750 行

std.c.HWCAP.PAUSE

常量

第 10738 行

std.c.HWCAP.PCLMULQDQ

常量

第 10752 行

std.c.HWCAP.POPCNT

常量

第 10745 行

std.c.HWCAP.SEP

常量

第 10728 行

std.c.HWCAP.SSE

常量

第 10736 行

std.c.HWCAP.SSE2

常量

第 10737 行

std.c.HWCAP.SSE3

常量

第 10739 行

std.c.HWCAP.SSE4_1

常量

第 10748 行

std.c.HWCAP.SSE4_2

常量

第 10749 行

std.c.HWCAP.SSSE3

常量

第 10747 行

std.c.HWCAP.TSC

常量

第 10726 行

std.c.HWCAP.TSCP

常量

第 10743 行

std.c.HWCAP.VMX

常量

第 10755 行

std.c.HWCAP.XSAVE

常量

第 10753 行

std.c.hypot

函数

第 11609 行

pub extern "c" fn hypot(x: f64, y: f64) f64

参数

x: f64
y: f64

std.c.id_t

别名

第 11633 行

别名目标 std.c.illumos.id_t

std.c.if_nametoindex

函数

第 11447 行

pub extern "c" fn if_nametoindex([*:0]const u8) c_int

参数

if_nametoindex: [*:0]const u8

std.c.IFNAMESIZE

常量

第 7211 行

std.c.ifreq

类型

第 4211 行

std.c.illumos

别名

第 19 行

别名目标 std.c.illumos

std.c.imaxabs

函数

第 11574 行

pub extern "c" fn imaxabs(a: intmax_t) intmax_t

参数

std.c.imaxdiv

函数

第 11575 行

pub extern "c" fn imaxdiv(a: intmax_t, b: intmax_t) imaxdiv_t

参数

std.c.imaxdiv_t

容器

第 11500 行

字段

quot: intmax_t
rem: intmax_t

std.c.in_pktinfo

类型

第 4237 行

std.c.in_port_t

类型

第 5408 行

std.c.in6_pktinfo

类型

第 4248 行

std.c.ino_t

类型

第 80 行

std.c.inotify_add_watch

函数

第 10688 行

pub extern "c" fn inotify_add_watch(fd: fd_t, pathname: [*:0]const u8, mask: u32) c_int

参数

fd: fd_t
pathname: [*:0]const u8
mask: u32

std.c.inotify_init1

函数

第 10687 行

pub extern "c" fn inotify_init1(flags: c_uint) c_int

参数

flags: c_uint

std.c.inotify_rm_watch

函数

第 10689 行

pub extern "c" fn inotify_rm_watch(fd: fd_t, wd: c_int) c_int

参数

fd: fd_t
wd: c_int

std.c.insque

函数

第 11571 行

pub extern "c" fn insque(element: *anyopaque, pred: ?*anyopaque) void

参数

element: *anyopaque
pred: ?*anyopaque

std.c.integer_t

别名

第 11800 行

别名目标 std.c.darwin.integer_t

std.c.intmax_t

类型

第 11505 行

std.c.IOCPARM_MASK

类型

第 3869 行

std.c.ioctl

常量

第 11536 行

std.c.IOV_MAX

常量

第 1322 行

std.c.iovec

别名

第 29 行

别名目标 std.posix.iovec

std.c.iovec_const

别名

第 30 行

别名目标 std.posix.iovec_const

std.c.IP

类型

第 6848 行

std.c.ipc_space_port_t

别名

第 11802 行

别名目标 std.c.darwin.ipc_space_port_t

std.c.ipc_space_t

别名

第 11801 行

别名目标 std.c.darwin.ipc_space_t

std.c.IPPROTO

类型

第 6249 行

std.c.IPPROTO.@"3PC"

常量

第 6337 行

第三方连接

std.c.IPPROTO.@"3PC"

常量

第 6667 行

std.c.IPPROTO.ADFS

常量

第 6403 行

任意分布式文件系统

std.c.IPPROTO.ADFS

常量

第 6700 行

std.c.IPPROTO.AH

常量

第 6369 行

IP6 认证首部

std.c.IPPROTO.AH

常量

第 6529 行

IPsec 认证头。

std.c.IPPROTO.AH

常量

第 6595 行

身份验证头

std.c.IPPROTO.AH

常量

第 6683 行

std.c.IPPROTO.AH

常量

第 6754 行

std.c.IPPROTO.AH

常量

第 6802 行

身份验证头

std.c.IPPROTO.AH

常量

第 6842 行

std.c.IPPROTO.AHIP

常量

第 6389 行

任意主机内部协议

std.c.IPPROTO.AHIP

常量

第 6693 行

std.c.IPPROTO.APES

常量

第 6465 行

任何私有加密方案

std.c.IPPROTO.APES

常量

第 6731 行

std.c.IPPROTO.ARGUS

常量

第 6297 行

Argus

std.c.IPPROTO.ARGUS

常量

第 6647 行

std.c.IPPROTO.AX25

常量

第 6453 行

AX.25 帧

std.c.IPPROTO.AX25

常量

第 6725 行

std.c.IPPROTO.BHA

常量

第 6365 行

BHA

std.c.IPPROTO.BHA

常量

第 6681 行

std.c.IPPROTO.BLT

常量

第 6329 行

批量数据传输

std.c.IPPROTO.BLT

常量

第 6663 行

std.c.IPPROTO.BRSATMON

常量

第 6419 行

BackRoom SATNET 监视

std.c.IPPROTO.BRSATMON

常量

第 6708 行

std.c.IPPROTO.CARP

常量

第 6483 行

CARP

std.c.IPPROTO.CARP

常量

第 6619 行

公共地址冗余协议

std.c.IPPROTO.CARP

常量

第 6735 行

std.c.IPPROTO.CARP

常量

第 6826 行

公共地址冗余协议

std.c.IPPROTO.CFTP

常量

第 6391 行

CFTP

std.c.IPPROTO.CFTP

常量

第 6694 行

std.c.IPPROTO.CHAOS

常量

第 6303 行

Chaos

std.c.IPPROTO.CHAOS

常量

第 6650 行

std.c.IPPROTO.CMTP

常量

第 6345 行

控制消息传输

std.c.IPPROTO.CMTP

常量

第 6671 行

std.c.IPPROTO.CPHB

常量

第 6413 行

Comp. Prot. 心跳

std.c.IPPROTO.CPHB

常量

第 6705 行

std.c.IPPROTO.CPNX

常量

第 6411 行

计算机协议网络执行程序

std.c.IPPROTO.CPNX

常量

第 6704 行

std.c.IPPROTO.DCCP

常量

第 6335 行

数据报拥塞控制协议

std.c.IPPROTO.DCCP

常量

第 6581 行

DCCP

std.c.IPPROTO.DDP

常量

第 6343 行

数据报传送

std.c.IPPROTO.DDP

常量

第 6670 行

std.c.IPPROTO.DGP

常量

第 6439 行

异构网关协议。

std.c.IPPROTO.DGP

常量

第 6718 行

std.c.IPPROTO.DIVERT

常量

第 6738 行

std.c.IPPROTO.DONE

常量

第 6740 行

std.c.IPPROTO.DSTOPTS

常量

第 6387 行

IP6 目标选项

std.c.IPPROTO.DSTOPTS

常量

第 6535 行

目标选项

std.c.IPPROTO.DSTOPTS

常量

第 6605 行

IP6 目标选项

std.c.IPPROTO.DSTOPTS

常量

第 6692 行

std.c.IPPROTO.DSTOPTS

常量

第 6757 行

std.c.IPPROTO.DSTOPTS

常量

第 6812 行

IP6 目标选项

std.c.IPPROTO.EGP

常量

第 6287 行

外部网关协议

std.c.IPPROTO.EGP

常量

第 6511 行

外部网关协议

std.c.IPPROTO.EGP

常量

第 6571 行

外部网关协议

std.c.IPPROTO.EGP

常量

第 6642 行

std.c.IPPROTO.EGP

常量

第 6780 行

外部网关协议

std.c.IPPROTO.EMCON

常量

第 6299 行

EMCON

std.c.IPPROTO.EMCON

常量

第 6648 行

std.c.IPPROTO.ENCAP

常量

第 6463 行

封装首部

std.c.IPPROTO.ENCAP

常量

第 6507 行

IP 中的 IP 封装

std.c.IPPROTO.ENCAP

常量

第 6611 行

封装首部

std.c.IPPROTO.ENCAP

常量

第 6730 行

std.c.IPPROTO.ENCAP

常量

第 6818 行

封装首部

std.c.IPPROTO.EON

常量

第 6427 行

ISO cnlp

std.c.IPPROTO.EON

常量

第 6541 行

ISO clnp

std.c.IPPROTO.EON

常量

第 6607 行

ISO cnlp

std.c.IPPROTO.EON

常量

第 6712 行

std.c.IPPROTO.EON

常量

第 6814 行

ISO cnlp

std.c.IPPROTO.ESP

常量

第 6367 行

IP6 封装安全载荷

std.c.IPPROTO.ESP

常量

第 6527 行

IPsec 封装安全载荷

std.c.IPPROTO.ESP

常量

第 6593 行

封装安全载荷

std.c.IPPROTO.ESP

常量

第 6682 行

std.c.IPPROTO.ESP

常量

第 6753 行

std.c.IPPROTO.ESP

常量

第 6800 行

封装安全载荷

std.c.IPPROTO.ESP

常量

第 6841 行

std.c.IPPROTO.ETHERIP

常量

第 6461 行

以太网 IP 封装

std.c.IPPROTO.ETHERIP

常量

第 6609 行

封装在 IP 中的以太网

std.c.IPPROTO.ETHERIP

常量

第 6729 行

std.c.IPPROTO.ETHERIP

常量

第 6758 行

std.c.IPPROTO.ETHERIP

常量

第 6816 行

封装在 IP 中的以太网

std.c.IPPROTO.FRAGMENT

常量

第 6355 行

IP6 分片头

std.c.IPPROTO.FRAGMENT

常量

第 6523 行

IPv6 分片头

std.c.IPPROTO.FRAGMENT

常量

第 6587 行

IP6 分片头

std.c.IPPROTO.FRAGMENT

常量

第 6676 行

std.c.IPPROTO.FRAGMENT

常量

第 6752 行

std.c.IPPROTO.FRAGMENT

常量

第 6794 行

IP6 分片头

std.c.IPPROTO.GGP

常量

第 6279 行

gateway^2(已弃用)

std.c.IPPROTO.GGP

常量

第 6505 行

gateway^2(已弃用)

std.c.IPPROTO.GGP

常量

第 6563 行

gateway^2(已弃用)

std.c.IPPROTO.GGP

常量

第 6638 行

std.c.IPPROTO.GGP

常量

第 6772 行

gateway^2(已弃用)

std.c.IPPROTO.GMTP

常量

第 6467 行

GMTP

std.c.IPPROTO.GMTP

常量

第 6732 行

std.c.IPPROTO.GRE

常量

第 6361 行

通用路由封装

std.c.IPPROTO.GRE

常量

第 6591 行

GRE 封装 RFC 1701

std.c.IPPROTO.GRE

常量

第 6679 行

std.c.IPPROTO.GRE

常量

第 6798 行

GRE 封装 RFC 1701

std.c.IPPROTO.HELLO

常量

第 6393 行

“hello”路由协议

std.c.IPPROTO.HELLO

常量

第 6537 行

“hello”路由协议

std.c.IPPROTO.HELLO

常量

第 6695 行

std.c.IPPROTO.HIP

常量

第 6477 行

IP6 主机标识协议

std.c.IPPROTO.HMP

常量

第 6309 行

主机监控

std.c.IPPROTO.HMP

常量

第 6653 行

std.c.IPPROTO.HOPOPTS

常量

第 6275 行

IPv6 逐跳选项

std.c.IPPROTO.HOPOPTS

常量

第 6499 行

IPv6 逐跳选项头

std.c.IPPROTO.HOPOPTS

常量

第 6557 行

IPv6 逐跳选项

std.c.IPPROTO.HOPOPTS

常量

第 6636 行

std.c.IPPROTO.HOPOPTS

常量

第 6745 行

std.c.IPPROTO.HOPOPTS

常量

第 6766 行

IPv6 逐跳选项

std.c.IPPROTO.ICMP

常量

第 6253 行

std.c.IPPROTO.ICMP

常量

第 6265 行

控制消息协议

std.c.IPPROTO.ICMP

常量

第 6501 行

控制消息协议

std.c.IPPROTO.ICMP

常量

第 6559 行

控制消息协议

std.c.IPPROTO.ICMP

常量

第 6631 行

std.c.IPPROTO.ICMP

常量

第 6746 行

std.c.IPPROTO.ICMP

常量

第 6768 行

控制消息协议

std.c.IPPROTO.ICMP

常量

第 6835 行

std.c.IPPROTO.ICMPV6

常量

第 6254 行

std.c.IPPROTO.ICMPV6

常量

第 6383 行

ICMP6

std.c.IPPROTO.ICMPV6

常量

第 6531 行

IPv6 的 ICMP

std.c.IPPROTO.ICMPV6

常量

第 6601 行

ICMP6

std.c.IPPROTO.ICMPV6

常量

第 6690 行

std.c.IPPROTO.ICMPV6

常量

第 6755 行

std.c.IPPROTO.ICMPV6

常量

第 6808 行

ICMP6

std.c.IPPROTO.ICMPV6

常量

第 6843 行

std.c.IPPROTO.IDP

常量

第 6313 行

xns idp

std.c.IPPROTO.IDP

常量

第 6517 行

xns idp

std.c.IPPROTO.IDP

常量

第 6577 行

xns idp

std.c.IPPROTO.IDP

常量

第 6655 行

std.c.IPPROTO.IDP

常量

第 6786 行

xns idp

std.c.IPPROTO.IDPR

常量

第 6339 行

域间策略路由

std.c.IPPROTO.IDPR

常量

第 6668 行

std.c.IPPROTO.IDRP

常量

第 6357 行

域间路由

std.c.IPPROTO.IDRP

常量

第 6677 行

std.c.IPPROTO.IGMP

常量

第 6277 行

组管理协议

std.c.IPPROTO.IGMP

常量

第 6503 行

组控制协议

std.c.IPPROTO.IGMP

常量

第 6561 行

组管理协议

std.c.IPPROTO.IGMP

常量

第 6637 行

std.c.IPPROTO.IGMP

常量

第 6747 行

std.c.IPPROTO.IGMP

常量

第 6770 行

组管理协议

std.c.IPPROTO.IGMP

常量

第 6836 行

std.c.IPPROTO.IGP

常量

第 6437 行

NSFNET-IGP

std.c.IPPROTO.IGP

常量

第 6717 行

std.c.IPPROTO.IGRP

常量

第 6443 行

Cisco/GXS IGRP

std.c.IPPROTO.IGRP

常量

第 6720 行

std.c.IPPROTO.IL

常量

第 6349 行

IL 传输协议

std.c.IPPROTO.IL

常量

第 6673 行

std.c.IPPROTO.INLSP

常量

第 6371 行

集成网络层安全

std.c.IPPROTO.INLSP

常量

第 6684 行

std.c.IPPROTO.INP

常量

第 6333 行

Merit 节点间协议

std.c.IPPROTO.INP

常量

第 6665 行

std.c.IPPROTO.IP

常量

第 6257 行

std.c.IPPROTO.IP

常量

第 6263 行

IP 占位项

std.c.IPPROTO.IP

常量

第 6497 行

IP 占位项

std.c.IPPROTO.IP

常量

第 6555 行

IP 占位项

std.c.IPPROTO.IP

常量

第 6630 行

std.c.IPPROTO.IP

常量

第 6744 行

std.c.IPPROTO.IP

常量

第 6764 行

IP 占位项

std.c.IPPROTO.IP

常量

第 6834 行

std.c.IPPROTO.IPCOMP

常量

第 6469 行

载荷压缩(IPComp)

std.c.IPPROTO.IPCOMP

常量

第 6615 行

IP 载荷压缩协议

std.c.IPPROTO.IPCOMP

常量

第 6733 行

std.c.IPPROTO.IPCOMP

常量

第 6822 行

IP 载荷压缩协议

std.c.IPPROTO.IPCV

常量

第 6409 行

分组核心实用协议

std.c.IPPROTO.IPCV

常量

第 6703 行

std.c.IPPROTO.IPEIP

常量

第 6455 行

封装在 IP 中的 IP

std.c.IPPROTO.IPEIP

常量

第 6726 行

std.c.IPPROTO.IPIP

别名

第 6283 行

用于兼容

别名目标 std.c.IPPROTO.IPV4

std.c.IPPROTO.IPIP

常量

第 6567 行

IP 内封装 IP

std.c.IPPROTO.IPIP

别名

第 6640 行

别名目标 std.c.IPPROTO.IPV4

std.c.IPPROTO.IPIP

常量

第 6776 行

IP 内封装 IP

std.c.IPPROTO.IPIP

常量

第 6837 行

std.c.IPPROTO.IPPC

常量

第 6401 行

Pluribus 分组核心协议

std.c.IPPROTO.IPPC

常量

第 6699 行

std.c.IPPROTO.IPV4

常量

第 6281 行

IPv4 封装

std.c.IPPROTO.IPV4

常量

第 6565 行

IP 头部

std.c.IPPROTO.IPV4

常量

第 6639 行

std.c.IPPROTO.IPV4

别名

第 6774 行

IP 头部

别名目标 std.c.IPPROTO.IPIP

std.c.IPPROTO.IPV6

常量

第 6258 行

std.c.IPPROTO.IPV6

常量

第 6271 行

IP6 头

std.c.IPPROTO.IPV6

常量

第 6519 行

封装在 IP 中的 IPv6

std.c.IPPROTO.IPV6

常量

第 6583 行

IP6 头

std.c.IPPROTO.IPV6

常量

第 6634 行

std.c.IPPROTO.IPV6

常量

第 6750 行

std.c.IPPROTO.IPV6

常量

第 6790 行

IP6 头

std.c.IPPROTO.IPV6

常量

第 6840 行

std.c.IPPROTO.IPV6_ICMP

常量

第 6599 行

IPv6 的 ICMP

std.c.IPPROTO.IPV6_ICMP

常量

第 6806 行

IPv6 的 ICMP

std.c.IPPROTO.IRTP

常量

第 6325 行

可靠事务

std.c.IPPROTO.IRTP

常量

第 6661 行

std.c.IPPROTO.KRYPTOLAN

常量

第 6397 行

Kryptolan

std.c.IPPROTO.KRYPTOLAN

常量

第 6697 行

std.c.IPPROTO.L2TP

常量

第 6621 行

L2TPv3

std.c.IPPROTO.LARP

常量

第 6449 行

Locus 地址解析

std.c.IPPROTO.LARP

常量

第 6723 行

std.c.IPPROTO.LEAF1

常量

第 6319 行

Leaf-1 协议

std.c.IPPROTO.LEAF1

常量

第 6658 行

std.c.IPPROTO.LEAF2

常量

第 6321 行

Leaf-2

std.c.IPPROTO.LEAF2

常量

第 6659 行

std.c.IPPROTO.MAX

常量

第 6739 行

std.c.IPPROTO.MAX

常量

第 6760 行

std.c.IPPROTO.MEAS

常量

第 6307 行

DCN 测量子系统

std.c.IPPROTO.MEAS

常量

第 6652 行

std.c.IPPROTO.MH

常量

第 6473 行

IPv6 移动性头

std.c.IPPROTO.MHRP

常量

第 6363 行

移动主机路由

std.c.IPPROTO.MHRP

常量

第 6680 行

std.c.IPPROTO.MICP

常量

第 6457 行

移动互连控制

std.c.IPPROTO.MICP

常量

第 6727 行

std.c.IPPROTO.MOBILE

常量

第 6377 行

IP 移动性

std.c.IPPROTO.MOBILE

常量

第 6597 行

IP 移动性 RFC 2004

std.c.IPPROTO.MOBILE

常量

第 6687 行

std.c.IPPROTO.MOBILE

常量

第 6804 行

IP 移动性 RFC 2004

std.c.IPPROTO.MPLS

常量

第 6487 行

封装在 IP 中的 MPLS

std.c.IPPROTO.MTP

常量

第 6451 行

组播传输

std.c.IPPROTO.MTP

常量

第 6724 行

std.c.IPPROTO.MUX

常量

第 6305 行

多路复用

std.c.IPPROTO.MUX

常量

第 6651 行

std.c.IPPROTO.ND

常量

第 6421 行

Sun 网络磁盘协议(临时)

std.c.IPPROTO.ND

常量

第 6539 行

非官方网络磁盘协议

std.c.IPPROTO.ND

常量

第 6709 行

std.c.IPPROTO.NHRP

常量

第 6375 行

下一跳解析

std.c.IPPROTO.NHRP

常量

第 6686 行

std.c.IPPROTO.NONE

常量

第 6385 行

IPv6 无下一头部

std.c.IPPROTO.NONE

常量

第 6533 行

IPv6 无下一个首部

std.c.IPPROTO.NONE

常量

第 6603 行

IPv6 无下一头部

std.c.IPPROTO.NONE

常量

第 6691 行

std.c.IPPROTO.NONE

常量

第 6756 行

std.c.IPPROTO.NONE

常量

第 6810 行

IPv6 无下一头部

std.c.IPPROTO.NSP

常量

第 6331 行

网络服务

std.c.IPPROTO.NSP

常量

第 6664 行

std.c.IPPROTO.NVPII

常量

第 6293 行

网络语音协议

std.c.IPPROTO.NVPII

常量

第 6645 行

std.c.IPPROTO.OSPF

常量

第 6543 行

OSPF

std.c.IPPROTO.OSPFIGP

常量

第 6445 行

OSPFIGP

std.c.IPPROTO.OSPFIGP

常量

第 6721 行

std.c.IPPROTO.PFSYNC

常量

第 6489 行

PFSYNC

std.c.IPPROTO.PFSYNC

常量

第 6625 行

PFSYNC

std.c.IPPROTO.PFSYNC

常量

第 6737 行

std.c.IPPROTO.PFSYNC

常量

第 6828 行

PFSYNC

std.c.IPPROTO.PGM

常量

第 6485 行

PGM

std.c.IPPROTO.PGM

常量

第 6736 行

std.c.IPPROTO.PIGP

常量

第 6289 行

私有内部网关

std.c.IPPROTO.PIGP

常量

第 6643 行

std.c.IPPROTO.PIM

常量

第 6481 行

与协议无关的多播

std.c.IPPROTO.PIM

常量

第 6545 行

PIM 路由协议

std.c.IPPROTO.PIM

常量

第 6613 行

与协议无关的多播

std.c.IPPROTO.PIM

常量

第 6734 行

std.c.IPPROTO.PIM

常量

第 6820 行

与协议无关的多播

std.c.IPPROTO.PRM

常量

第 6311 行

分组无线电测量

std.c.IPPROTO.PRM

常量

第 6654 行

std.c.IPPROTO.PROTO_SDP

常量

第 6551 行

套接字直连协议

std.c.IPPROTO.PUP

常量

第 6295 行

pup

std.c.IPPROTO.PUP

常量

第 6513 行

pup

std.c.IPPROTO.PUP

常量

第 6573 行

pup

std.c.IPPROTO.PUP

常量

第 6646 行

std.c.IPPROTO.PUP

常量

第 6782 行

pup

std.c.IPPROTO.PVP

常量

第 6417 行

分组视频协议

std.c.IPPROTO.PVP

常量

第 6707 行

std.c.IPPROTO.RAW

常量

第 6259 行

std.c.IPPROTO.RAW

常量

第 6273 行

原始 IP 数据包

std.c.IPPROTO.RAW

常量

第 6549 行

原始 IP 数据包

std.c.IPPROTO.RAW

常量

第 6627 行

原始 IP 数据包

std.c.IPPROTO.RAW

常量

第 6635 行

std.c.IPPROTO.RAW

常量

第 6759 行

std.c.IPPROTO.RAW

常量

第 6830 行

原始 IP 数据包

std.c.IPPROTO.RAW

常量

第 6844 行

std.c.IPPROTO.RCCMON

常量

第 6291 行

BBN RCC 监控

std.c.IPPROTO.RCCMON

常量

第 6644 行

std.c.IPPROTO.RDP

常量

第 6323 行

可靠数据

std.c.IPPROTO.RDP

常量

第 6660 行

std.c.IPPROTO.RESERVED_253

常量

第 6491 行

保留

std.c.IPPROTO.RESERVED_254

常量

第 6493 行

保留

std.c.IPPROTO.ROUTING

常量

第 6353 行

IP6 路由头

std.c.IPPROTO.ROUTING

常量

第 6521 行

IPv6 路由头

std.c.IPPROTO.ROUTING

常量

第 6585 行

IP6 路由头

std.c.IPPROTO.ROUTING

常量

第 6675 行

std.c.IPPROTO.ROUTING

常量

第 6751 行

std.c.IPPROTO.ROUTING

常量

第 6792 行

IP6 路由头

std.c.IPPROTO.RSVP

常量

第 6359 行

资源预留

std.c.IPPROTO.RSVP

常量

第 6525 行

rsvp

std.c.IPPROTO.RSVP

常量

第 6589 行

资源预留

std.c.IPPROTO.RSVP

常量

第 6678 行

std.c.IPPROTO.RSVP

常量

第 6796 行

资源预留

std.c.IPPROTO.RVD

常量

第 6399 行

远程虚拟磁盘

std.c.IPPROTO.RVD

常量

第 6698 行

std.c.IPPROTO.SATEXPAK

常量

第 6395 行

SATNET/Backroom EXPAK

std.c.IPPROTO.SATEXPAK

常量

第 6696 行

std.c.IPPROTO.SATMON

常量

第 6405 行

Satnet 监控

std.c.IPPROTO.SATMON

常量

第 6701 行

std.c.IPPROTO.SCCSP

常量

第 6459 行

Semaphore 通信安全性

std.c.IPPROTO.SCCSP

常量

第 6728 行

std.c.IPPROTO.SCTP

常量

第 6471 行

SCTP

std.c.IPPROTO.SCTP

常量

第 6547 行

流控制

std.c.IPPROTO.SCTP

常量

第 6623 行

SCTP

std.c.IPPROTO.SDRP

常量

第 6351 行

源按需路由

std.c.IPPROTO.SDRP

常量

第 6674 行

std.c.IPPROTO.SEP

常量

第 6666 行

std.c.IPPROTO.SHIM6

常量

第 6479 行

IP6 Shim6 协议

std.c.IPPROTO.SKIP

常量

第 6381 行

SKIP

std.c.IPPROTO.SKIP

常量

第 6689 行

std.c.IPPROTO.SRPC

常量

第 6447 行

Strite RPC 协议

std.c.IPPROTO.SRPC

常量

第 6722 行

std.c.IPPROTO.ST

常量

第 6285 行

流协议 II

std.c.IPPROTO.ST

常量

第 6641 行

std.c.IPPROTO.SVMTP

常量

第 6431 行

安全 VMTP

std.c.IPPROTO.SVMTP

常量

第 6714 行

std.c.IPPROTO.SWIPE

常量

第 6373 行

带加密的 IP

std.c.IPPROTO.SWIPE

常量

第 6685 行

std.c.IPPROTO.TCF

常量

第 6441 行

TCF

std.c.IPPROTO.TCF

常量

第 6719 行

std.c.IPPROTO.TCP

常量

第 6255 行

std.c.IPPROTO.TCP

常量

第 6267 行

tcp

std.c.IPPROTO.TCP

常量

第 6509 行

tcp

std.c.IPPROTO.TCP

常量

第 6569 行

tcp

std.c.IPPROTO.TCP

常量

第 6632 行

std.c.IPPROTO.TCP

常量

第 6748 行

std.c.IPPROTO.TCP

常量

第 6778 行

tcp

std.c.IPPROTO.TCP

常量

第 6838 行

std.c.IPPROTO.TLSP

常量

第 6379 行

传输层安全性

std.c.IPPROTO.TLSP

常量

第 6688 行

std.c.IPPROTO.TP

常量

第 6327 行

带类别协商的 tp-4

std.c.IPPROTO.TP

常量

第 6579 行

带类别协商的 tp-4

std.c.IPPROTO.TP

常量

第 6662 行

std.c.IPPROTO.TP

常量

第 6788 行

带类别协商的 tp-4

std.c.IPPROTO.TPXX

常量

第 6347 行

TP++ 传输

std.c.IPPROTO.TPXX

常量

第 6672 行

std.c.IPPROTO.TRUNK1

常量

第 6315 行

Trunk-1

std.c.IPPROTO.TRUNK1

常量

第 6656 行

std.c.IPPROTO.TRUNK2

常量

第 6317 行

Trunk-2

std.c.IPPROTO.TRUNK2

常量

第 6657 行

std.c.IPPROTO.TTP

常量

第 6435 行

TTP

std.c.IPPROTO.TTP

常量

第 6716 行

std.c.IPPROTO.UDP

常量

第 6256 行

std.c.IPPROTO.UDP

常量

第 6269 行

用户数据报协议

std.c.IPPROTO.UDP

常量

第 6515 行

用户数据报协议

std.c.IPPROTO.UDP

常量

第 6575 行

用户数据报协议

std.c.IPPROTO.UDP

常量

第 6633 行

std.c.IPPROTO.UDP

常量

第 6749 行

std.c.IPPROTO.UDP

常量

第 6784 行

用户数据报协议

std.c.IPPROTO.UDP

常量

第 6839 行

std.c.IPPROTO.UDPLITE

常量

第 6475 行

UDP-Lite

std.c.IPPROTO.UNKNOWN

常量

第 6741 行

std.c.IPPROTO.VINES

常量

第 6433 行

Banyon VINES

std.c.IPPROTO.VINES

常量

第 6715 行

std.c.IPPROTO.VISA

常量

第 6407 行

VISA 协议

std.c.IPPROTO.VISA

常量

第 6702 行

std.c.IPPROTO.VMTP

常量

第 6429 行

VMTP

std.c.IPPROTO.VMTP

常量

第 6713 行

std.c.IPPROTO.VRRP

常量

第 6617 行

VRRP 协议,RFC 2338

std.c.IPPROTO.VRRP

常量

第 6824 行

VRRP 协议,RFC 2338

std.c.IPPROTO.WBEXPAK

常量

第 6425 行

WIDEBAND EXPAK

std.c.IPPROTO.WBEXPAK

常量

第 6711 行

std.c.IPPROTO.WBMON

常量

第 6423 行

宽带监控

std.c.IPPROTO.WBMON

常量

第 6710 行

std.c.IPPROTO.WSN

常量

第 6415 行

Wang Span 网络

std.c.IPPROTO.WSN

常量

第 6706 行

std.c.IPPROTO.XNET

常量

第 6301 行

跨网络调试器

std.c.IPPROTO.XNET

常量

第 6649 行

std.c.IPPROTO.XTP

常量

第 6341 行

XTP

std.c.IPPROTO.XTP

常量

第 6669 行

std.c.IPTOS

类型

第 6872 行

std.c.IPV6

类型

第 6860 行

std.c.isatty

函数

第 11067 行

pub extern "c" fn isatty(fd: fd_t) c_int

参数

fd: fd_t

std.c.itimerspec

类型

第 4264 行

std.c.jrand48

函数

第 11568 行

pub extern "c" fn jrand48(xsubi: *[3]c_ushort) c_long

参数

xsubi: *[3]c_ushort

std.c.KERN

类型

第 1455 行

std.c.kern_return_t

别名

第 11803 行

别名目标 std.c.darwin.kern_return_t

std.c.KERN.AFFINITY

常量

第 1669 行

std.c.KERN.AIOMAX

常量

第 1674 行

std.c.KERN.AIOPROCMAX

常量

第 1675 行

std.c.KERN.AIOTHREADS

常量

第 1676 行

std.c.KERN.ALLOWDT

常量

第 1586 行

std.c.KERN.ALLOWKMEM

常量

第 1573 行

std.c.KERN.ARGMAX

常量

第 1488 行

std.c.KERN.ARGMAX

常量

第 1532 行

std.c.KERN.ARGMAX

常量

第 1635 行

std.c.KERN.AUDIO

常量

第 1605 行

std.c.KERN.BOOTFILE

常量

第 1511 行

std.c.KERN.BOOTFILE

常量

第 1656 行

std.c.KERN.BOOTTIME

常量

第 1506 行

std.c.KERN.BOOTTIME

常量

第 1543 行

std.c.KERN.BOOTTIME

常量

第 1648 行

std.c.KERN.CACHEPCT

常量

第 1593 行

std.c.KERN.CCPU

常量

第 1566 行

std.c.KERN.CHECKOPENEVT

常量

第 1696 行

std.c.KERN.CLASSIC

常量

第 1671 行

std.c.KERN.CLASSICHANDLER

常量

第 1673 行

std.c.KERN.CLOCKRATE

常量

第 1495 行

std.c.KERN.CLOCKRATE

常量

第 1536 行

std.c.KERN.CLOCKRATE

常量

第 1639 行

std.c.KERN.CONSBUF

常量

第 1604 行

std.c.KERN.CONSBUFSIZE

常量

第 1603 行

std.c.KERN.CONSDEV

常量

第 1596 行

std.c.KERN.COREDUMP

常量

第 1679 行

std.c.KERN.COREFILE

常量

第 1678 行

std.c.KERN.CPTIME

常量

第 1561 行

std.c.KERN.CPTIME2

常量

第 1592 行

std.c.KERN.CPUSTATS

常量

第 1606 行

std.c.KERN.DOMAINNAME

常量

第 1544 行

std.c.KERN.DOMAINNAME

常量

第 1650 行

std.c.KERN.DUMMY

常量

第 1516 行

std.c.KERN.DUMMY

常量

第 1661 行

std.c.KERN.DUMPDEV

常量

第 1514 行

std.c.KERN.DUMPDEV

常量

第 1659 行

std.c.KERN.EVCOUNT

常量

第 1589 行

std.c.KERN.EXEC

常量

第 1672 行

std.c.KERN.FILE

常量

第 1498 行

std.c.KERN.FILE

常量

第 1594 行

std.c.KERN.FILE

常量

第 1642 行

std.c.KERN.FORKSTAT

常量

第 1563 行

std.c.KERN.FSCALE

常量

第 1567 行

std.c.KERN.FSYNC

常量

第 1554 行

std.c.KERN.GLOBAL_PTRACE

常量

第 1602 行

std.c.KERN.HOSTID

常量

第 1494 行

std.c.KERN.HOSTID

常量

第 1535 行

std.c.KERN.HOSTID

常量

第 1638 行

std.c.KERN.HOSTNAME

常量

第 1493 行

std.c.KERN.HOSTNAME

常量

第 1534 行

std.c.KERN.HOSTNAME

常量

第 1637 行

std.c.KERN.INTRCNT

常量

第 1584 行

std.c.KERN.IOV_MAX

常量

第 1463 行

std.c.KERN.IOV_MAX

常量

第 1470 行

std.c.KERN.IOV_MAX

常量

第 1520 行

std.c.KERN.IPC

常量

第 1515 行

std.c.KERN.IPC

常量

第 1660 行

std.c.KERN.JOB_CONTROL

常量

第 1504 行

std.c.KERN.JOB_CONTROL

常量

第 1541 行

std.c.KERN.JOB_CONTROL

常量

第 1646 行

std.c.KERN.KDEBUG

常量

第 1652 行

std.c.KERN.LOGSIGEXIT

常量

第 1519 行

std.c.KERN.LOGSIGEXIT

常量

第 1664 行

std.c.KERN.LOW_PRI_DELAY

常量

第 1684 行

std.c.KERN.LOW_PRI_WINDOW

常量

第 1683 行

std.c.KERN.MALLOCSTATS

常量

第 1560 行

std.c.KERN.MAXCLUSTERS

常量

第 1588 行

std.c.KERN.MAXFILES

常量

第 1486 行

std.c.KERN.MAXFILES

常量

第 1531 行

std.c.KERN.MAXFILES

常量

第 1634 行

std.c.KERN.MAXFILESPERPROC

常量

第 1512 行

std.c.KERN.MAXFILESPERPROC

常量

第 1657 行

std.c.KERN.MAXID

常量

第 1522 行

std.c.KERN.MAXID

常量

第 1698 行

std.c.KERN.MAXLOCKSPERUID

常量

第 1591 行

std.c.KERN.MAXPARTITIONS

常量

第 1545 行

std.c.KERN.MAXPARTITIONS

常量

第 1651 行

std.c.KERN.MAXPOSIXLOCKSPERUID

常量

第 1521 行

std.c.KERN.MAXPROC

常量

第 1484 行

std.c.KERN.MAXPROC

常量

第 1530 行

std.c.KERN.MAXPROC

常量

第 1633 行

std.c.KERN.MAXPROCPERUID

常量

第 1513 行

std.c.KERN.MAXPROCPERUID

常量

第 1658 行

std.c.KERN.MAXTHREAD

常量

第 1547 行

std.c.KERN.MAXVNODES

常量

第 1482 行

std.c.KERN.MAXVNODES

常量

第 1529 行

std.c.KERN.MAXVNODES

常量

第 1632 行

std.c.KERN.MBSTAT

常量

第 1580 行

std.c.KERN.MSGBUF

常量

第 1569 行

std.c.KERN.MSGBUFSIZE

常量

第 1559 行

std.c.KERN.NCHSTATS

常量

第 1562 行

std.c.KERN.NETBOOT

常量

第 1667 行

std.c.KERN.NETLIVELOCKS

常量

第 1597 行

std.c.KERN.NFILES

常量

第 1577 行

std.c.KERN.NGROUPS

常量

第 1503 行

std.c.KERN.NGROUPS

常量

第 1540 行

std.c.KERN.NGROUPS

常量

第 1645 行

std.c.KERN.NISDOMAINNAME

常量

第 1507 行

std.c.KERN.NISDOMAINNAME

常量

第 1649 行

std.c.KERN.NOSUIDCOREDUMP

常量

第 1553 行

std.c.KERN.NPROCS

常量

第 1568 行

std.c.KERN.NSELCOLL

常量

第 1564 行

std.c.KERN.NTHREADS

常量

第 1548 行

std.c.KERN.NTP_PLL

常量

第 1510 行

std.c.KERN.NTP_PLL

常量

第 1655 行

std.c.KERN.NUMVNODES

常量

第 1579 行

std.c.KERN.NX_PROTECTION

常量

第 1687 行

std.c.KERN.OSRELDATE

常量

第 1509 行

std.c.KERN.OSRELDATE

常量

第 1654 行

std.c.KERN.OSRELEASE

常量

第 1476 行

std.c.KERN.OSRELEASE

常量

第 1526 行

std.c.KERN.OSRELEASE

常量

第 1629 行

std.c.KERN.OSREV

常量

第 1478 行

std.c.KERN.OSREV

常量

第 1527 行

std.c.KERN.OSREV

常量

第 1630 行

std.c.KERN.OSTYPE

常量

第 1474 行

std.c.KERN.OSTYPE

常量

第 1525 行

std.c.KERN.OSTYPE

常量

第 1628 行

std.c.KERN.OSVERSION

常量

第 1549 行

std.c.KERN.OSVERSION

常量

第 1692 行

std.c.KERN.PFSTATUS

常量

第 1607 行

std.c.KERN.POOL

常量

第 1570 行

std.c.KERN.POOL_DEBUG

常量

第 1598 行

std.c.KERN.POSIX

常量

第 1685 行

std.c.KERN.POSIX1

常量

第 1502 行

std.c.KERN.POSIX1

常量

第 1539 行

std.c.KERN.POSIX1

常量

第 1644 行

std.c.KERN.PROC

常量

第 1458 行

结构体:进程条目

std.c.KERN.PROC

常量

第 1497 行

std.c.KERN.PROC

常量

第 1587 行

std.c.KERN.PROC

常量

第 1641 行

std.c.KERN.PROC_ALL

常量

第 1473 行

std.c.KERN.PROC_ALL

常量

第 1612 行

std.c.KERN.PROC_ARGS

常量

第 1467 行

结构体:进程 argv/env

std.c.KERN.PROC_ARGS

常量

第 1487 行

std.c.KERN.PROC_ARGS

常量

第 1576 行

std.c.KERN.PROC_ARGV

常量

第 1622 行

std.c.KERN.PROC_CWD

常量

第 1489 行

std.c.KERN.PROC_CWD

常量

第 1599 行

std.c.KERN.PROC_ENV

常量

第 1624 行

std.c.KERN.PROC_FILEDESC

常量

第 1462 行

进程的文件描述符

std.c.KERN.PROC_FLAG_LWP

常量

第 1501 行

std.c.KERN.PROC_FLAGMASK

常量

第 1499 行

std.c.KERN.PROC_KTHREAD

常量

第 1619 行

std.c.KERN.PROC_NARGV

常量

第 1623 行

std.c.KERN.PROC_NENV

常量

第 1625 行

std.c.KERN.PROC_NOBROADCASTKILL

常量

第 1600 行

std.c.KERN.PROC_PATHNAME

常量

第 1460 行

可执行文件路径

std.c.KERN.PROC_PATHNAME

常量

第 1469 行

可执行文件路径

std.c.KERN.PROC_PATHNAME

常量

第 1490 行

std.c.KERN.PROC_PGRP

常量

第 1477 行

std.c.KERN.PROC_PGRP

常量

第 1614 行

std.c.KERN.PROC_PID

常量

第 1475 行

std.c.KERN.PROC_PID

常量

第 1613 行

std.c.KERN.PROC_RUID

常量

第 1485 行

std.c.KERN.PROC_RUID

常量

第 1618 行

std.c.KERN.PROC_SESSION

常量

第 1479 行

std.c.KERN.PROC_SESSION

常量

第 1615 行

std.c.KERN.PROC_SHOW_THREADS

常量

第 1620 行

std.c.KERN.PROC_SIGTRAMP

常量

第 1492 行

std.c.KERN.PROC_TTY

常量

第 1481 行

std.c.KERN.PROC_TTY

常量

第 1616 行

std.c.KERN.PROC_UID

常量

第 1483 行

std.c.KERN.PROC_UID

常量

第 1617 行

std.c.KERN.PROC_VMMAP

常量

第 1601 行

std.c.KERN.PROCARGS

常量

第 1666 行

std.c.KERN.PROCARGS2

常量

第 1677 行

std.c.KERN.PROCDELAYTERM

常量

第 1681 行

std.c.KERN.PROCNAME

常量

第 1689 行

std.c.KERN.PROF

常量

第 1500 行

std.c.KERN.PROF

常量

第 1538 行

std.c.KERN.PROF

常量

第 1643 行

std.c.KERN.PS_STRINGS

常量

第 1517 行

std.c.KERN.PS_STRINGS

常量

第 1662 行

std.c.KERN.RAGEVNODE

常量

第 1694 行

std.c.KERN.RAWPARTITION

常量

第 1546 行

std.c.KERN.SAFEBOOT

常量

第 1693 行

std.c.KERN.SAVED_IDS

常量

第 1505 行

std.c.KERN.SAVED_IDS

常量

第 1542 行

std.c.KERN.SAVED_IDS

常量

第 1647 行

std.c.KERN.SECURELVL

常量

第 1491 行

std.c.KERN.SECURELVL

常量

第 1533 行

std.c.KERN.SECURELVL

常量

第 1636 行

std.c.KERN.SEMINFO

常量

第 1582 行

std.c.KERN.SHMINFO

常量

第 1583 行

std.c.KERN.SHREG_PRIVATIZABLE

常量

第 1682 行

std.c.KERN.SOMAXCONN

常量

第 1550 行

std.c.KERN.SOMINCONN

常量

第 1551 行

std.c.KERN.SPECULATIVE_READS

常量

第 1691 行

std.c.KERN.SPLASSERT

常量

第 1575 行

std.c.KERN.STACKGAPRANDOM

常量

第 1571 行

std.c.KERN.SUGID_COREDUMP

常量

第 1680 行

std.c.KERN.SYMFILE

常量

第 1665 行

std.c.KERN.SYSV

常量

第 1668 行

std.c.KERN.SYSVIPC_INFO

常量

第 1572 行

std.c.KERN.SYSVMSG

常量

第 1555 行

std.c.KERN.SYSVSEM

常量

第 1556 行

std.c.KERN.SYSVSHM

常量

第 1557 行

std.c.KERN.TFP

常量

第 1688 行

std.c.KERN.THALTSTACK

常量

第 1690 行

std.c.KERN.THREADNAME

常量

第 1697 行

std.c.KERN.TIMECOUNTER

常量

第 1590 行

std.c.KERN.TIMEOUT_STATS

常量

第 1608 行

std.c.KERN.TRANSLATE

常量

第 1670 行

std.c.KERN.TTY

常量

第 1565 行

std.c.KERN.TTY

常量

第 1695 行

std.c.KERN.TTYCOUNT

常量

第 1578 行

std.c.KERN.UPDATEINTERVAL

常量

第 1508 行

std.c.KERN.UPDATEINTERVAL

常量

第 1653 行

std.c.KERN.USRSTACK

常量

第 1518 行

std.c.KERN.USRSTACK32

常量

第 1663 行

std.c.KERN.USRSTACK64

常量

第 1686 行

std.c.KERN.UTC_OFFSET

常量

第 1609 行

std.c.KERN.VERSION

常量

第 1480 行

std.c.KERN.VERSION

常量

第 1528 行

std.c.KERN.VERSION

常量

第 1631 行

std.c.KERN.VIDEO

常量

第 1610 行

std.c.KERN.VNODE

常量

第 1496 行

std.c.KERN.VNODE

常量

第 1640 行

std.c.KERN.WATCHDOG

常量

第 1585 行

std.c.KERN.WITNESS

常量

第 1581 行

std.c.KERN.WITNESSWATCH

常量

第 1574 行

std.c.KERN.WXABORT

常量

第 1595 行

std.c.kevent

函数

第 11312 行

pub extern "c" fn kevent( kq: c_int, changelist: [*]const Kevent, nchanges: c_int, eventlist: [*]Kevent, nevents: c_int, timeout: ?*const timespec, ) c_int

参数

kq: c_int
changelist: [*]const Kevent
nchanges: c_int
eventlist: [*]Kevent
nevents: c_int
timeout: ?*const timespec

std.c.Kevent

类型

第 8440 行

从 kevent 重命名为 Kevent,以避免与函数名冲突。

std.c.KEVENT

别名

第 11754 行

别名目标 std.c.darwin.KEVENT

std.c.kevent64

别名

第 11805 行

别名目标 std.c.darwin.kevent64

std.c.kevent64_s

别名

第 11806 行

别名目标 std.c.darwin.kevent64_s

std.c.kill

函数

第 11194 行

pub extern "c" fn kill(pid: pid_t, sig: SIG) c_int

参数

pid: pid_t
sig: SIG

std.c.kinfo_file

别名

第 11744 行

别名目标 std.c.freebsd.kinfo_file

std.c.KINFO_FILE_SIZE

别名

第 11735 行

别名目标 std.c.freebsd.KINFO_FILE_SIZE

std.c.kinfo_getfile

别名

第 11745 行

别名目标 std.c.freebsd.kinfo_getfile

std.c.kqueue

函数

第 11311 行

pub extern "c" fn kqueue() c_int

std.c.labs

函数

第 11578 行

pub extern "c" fn labs(a: c_long) c_long

参数

a: c_long

std.c.LC

容器

第 11456 行

字段

CTYPE = 0
NUMERIC = 1
TIME = 2
COLLATE = 3
MONETARY = 4
MESSAGES = 5
ALL = 6
PAPER = 7
NAME = 8
ADDRESS = 9
TELEPHONE = 10
MEASUREMENT = 11
IDENTIFICATION = 12
_

std.c.ldiv

函数

第 11582 行

pub extern "c" fn ldiv(a: c_long, b: c_long) ldiv_t

参数

a: c_long
b: c_long

std.c.ldiv_t

容器

第 11490 行

字段

quot: c_long
rem: c_long

std.c.lif_ifinfo_req

别名

第 11634 行

别名目标 std.c.illumos.lif_ifinfo_req

std.c.lif_nd_req

别名

第 11635 行

别名目标 std.c.illumos.lif_nd_req

std.c.lifreq

别名

第 11636 行

别名目标 std.c.illumos.lifreq

std.c.linger

类型

第 4272 行

std.c.link

函数

第 11085 行

pub extern "c" fn link(oldpath: [*:0]const u8, newpath: [*:0]const u8) c_int

参数

oldpath: [*:0]const u8
newpath: [*:0]const u8

std.c.linkat

函数

第 11086 行

pub extern "c" fn linkat(oldfd: fd_t, oldpath: [*:0]const u8, newfd: fd_t, newpath: [*:0]const u8, flags: c_uint) c_int

参数

oldfd: fd_t
oldpath: [*:0]const u8
newfd: fd_t
newpath: [*:0]const u8
flags: c_uint

std.c.linux

别名

第 12 行

别名目标 std.os.linux

std.c.listen

函数

第 11154 行

pub extern "c" fn listen(sockfd: fd_t, backlog: c_uint) c_int

参数

sockfd: fd_t
backlog: c_uint

std.c.llabs

函数

第 11579 行

pub extern "c" fn llabs(a: c_longlong) c_longlong

参数

a: c_longlong

std.c.lldiv

函数

第 11583 行

pub extern "c" fn lldiv(a: c_longlong, b: c_longlong) lldiv_t

参数

a: c_longlong
b: c_longlong

std.c.lldiv_t

容器

第 11495 行

字段

quot: c_longlong
rem: c_longlong

std.c.LOCK

别名

第 31 行

别名目标 std.posix.LOCK

std.c.login_cap_t

别名

第 11716 行

别名目标 std.c.openbsd.login_cap_t

std.c.login_close

别名

第 11717 行

别名目标 std.c.openbsd.login_close

std.c.login_getcapbool

别名

第 11718 行

别名目标 std.c.openbsd.login_getcapbool

std.c.login_getcapnum

别名

第 11719 行

别名目标 std.c.openbsd.login_getcapnum

std.c.login_getcapsize

别名

第 11720 行

别名目标 std.c.openbsd.login_getcapsize

std.c.login_getcapstr

别名

第 11721 行

别名目标 std.c.openbsd.login_getcapstr

std.c.login_getcaptime

别名

第 11722 行

别名目标 std.c.openbsd.login_getcaptime

std.c.login_getclass

别名

第 11723 行

别名目标 std.c.openbsd.login_getclass

std.c.login_getstyle

别名

第 11724 行

别名目标 std.c.openbsd.login_getstyle

std.c.lseek

函数

第 11068 行

pub extern "c" fn lseek(fd: fd_t, offset: off_t, whence: whence_t) off_t

参数

fd: fd_t
offset: off_t
whence: whence_t

std.c.lseek64

函数

第 10630 行

pub extern "c" fn lseek64(fd: fd_t, offset: i64, whence: c_int) i64

参数

fd: fd_t
offset: i64
whence: c_int

std.c.lwp_gettid

别名

第 11957 行

别名目标 std.c.dragonfly.lwp_gettid

std.c.lwpid_t

别名

第 11955 行

别名目标 std.c.netbsd.lwpid_t

std.c.MACH

别名

第 11755 行

别名目标 std.c.darwin.MACH

std.c.mach_absolute_time

别名

第 11807 行

别名目标 std.c.darwin.mach_absolute_time

std.c.mach_continuous_time

别名

第 11808 行

别名目标 std.c.darwin.mach_continuous_time

std.c.mach_exception_data_t

别名

第 11920 行

别名目标 std.c.darwin.mach_exception_data_t

std.c.mach_exception_data_type_t

别名

第 11921 行

别名目标 std.c.darwin.mach_exception_data_type_t

std.c.mach_hdr

别名

第 11809 行

别名目标 std.c.darwin.mach_hdr

std.c.mach_host_self

别名

第 11810 行

别名目标 std.c.darwin.mach_host_self

std.c.mach_msg

别名

第 11811 行

别名目标 std.c.darwin.mach_msg

std.c.mach_msg_bits_t

别名

第 11922 行

别名目标 std.c.darwin.mach_msg_bits_t

std.c.mach_msg_header_t

别名

第 11924 行

别名目标 std.c.darwin.mach_msg_header_t

std.c.mach_msg_id_t

别名

第 11923 行

别名目标 std.c.darwin.mach_msg_id_t

std.c.mach_msg_option_t

别名

第 11925 行

别名目标 std.c.darwin.mach_msg_option_t

std.c.mach_msg_return_t

别名

第 11812 行

别名目标 std.c.darwin.mach_msg_return_t

std.c.mach_msg_size_t

别名

第 11926 行

别名目标 std.c.darwin.mach_msg_size_t

std.c.mach_msg_timeout_t

别名

第 11927 行

别名目标 std.c.darwin.mach_msg_timeout_t

std.c.MACH_MSG_TYPE

别名

第 11756 行

别名目标 std.c.darwin.MACH_MSG_TYPE

std.c.mach_msg_type_name_t

别名

第 11928 行

别名目标 std.c.darwin.mach_msg_type_name_t

std.c.mach_msg_type_number_t

别名

第 11813 行

别名目标 std.c.darwin.mach_msg_type_number_t

std.c.mach_port_allocate

别名

第 11814 行

别名目标 std.c.darwin.mach_port_allocate

std.c.mach_port_array_t

别名

第 11815 行

别名目标 std.c.darwin.mach_port_array_t

std.c.mach_port_deallocate

别名

第 11816 行

别名目标 std.c.darwin.mach_port_deallocate

std.c.mach_port_insert_right

别名

第 11817 行

别名目标 std.c.darwin.mach_port_insert_right

std.c.mach_port_name_t

别名

第 11818 行

别名目标 std.c.darwin.mach_port_name_t

std.c.MACH_PORT_RIGHT

别名

第 11757 行

别名目标 std.c.darwin.MACH_PORT_RIGHT

std.c.mach_port_right_t

别名

第 11929 行

别名目标 std.c.darwin.mach_port_right_t

std.c.mach_port_t

别名

第 11819 行

别名目标 std.c.darwin.mach_port_t

std.c.mach_task_basic_info

别名

第 11820 行

别名目标 std.c.darwin.mach_task_basic_info

std.c.MACH_TASK_BASIC_INFO

别名

第 11758 行

别名目标 std.c.darwin.MACH_TASK_BASIC_INFO

std.c.MACH_TASK_BASIC_INFO_COUNT

别名

第 11759 行

别名目标 std.c.darwin.MACH_TASK_BASIC_INFO_COUNT

std.c.mach_task_self

别名

第 11821 行

别名目标 std.c.darwin.mach_task_self

std.c.mach_timebase_info

别名

第 11822 行

别名目标 std.c.darwin.mach_timebase_info

std.c.mach_timebase_info_data

别名

第 11823 行

别名目标 std.c.darwin.mach_timebase_info_data

std.c.mach_timespec_t

别名

第 11824 行

别名目标 std.c.darwin.mach_timespec_t

std.c.mach_vm_address_t

别名

第 11825 行

别名目标 std.c.darwin.mach_vm_address_t

std.c.mach_vm_protect

别名

第 11826 行

别名目标 std.c.darwin.mach_vm_protect

std.c.mach_vm_read

别名

第 11827 行

别名目标 std.c.darwin.mach_vm_read

std.c.mach_vm_region

别名

第 11828 行

别名目标 std.c.darwin.mach_vm_region

std.c.mach_vm_region_recurse

别名

第 11829 行

别名目标 std.c.darwin.mach_vm_region_recurse

std.c.mach_vm_size_t

别名

第 11830 行

别名目标 std.c.darwin.mach_vm_size_t

std.c.mach_vm_write

别名

第 11831 行

别名目标 std.c.darwin.mach_vm_write

std.c.MADV

类型

第 1702 行

std.c.MADV.ACCESS_DEFAULT

常量

第 1746 行

默认访问权限

std.c.MADV.ACCESS_LWP

常量

第 1748 行

下一个需要频繁访问的 LWP

std.c.MADV.ACCESS_MANY

常量

第 1750 行

大量进程会频繁访问

std.c.MADV.AUTOSYNC

常量

第 1727 行

std.c.MADV.AUTOSYNC

常量

第 1764 行

std.c.MADV.CAN_REUSE

常量

第 1715 行

std.c.MADV.CONTROL_END

别名

第 1756 行

别名目标 std.c.MADV.SETMAP

std.c.MADV.CONTROL_START

别名

第 1761 行

别名目标 std.c.MADV.INVAL

std.c.MADV.CORE

常量

第 1729 行

std.c.MADV.CORE

常量

第 1766 行

std.c.MADV.DONTNEED

常量

第 1710 行

std.c.MADV.DONTNEED

常量

第 1724 行

std.c.MADV.DONTNEED

常量

第 1742 行

不需要这些页面

std.c.MADV.DONTNEED

常量

第 1757 行

std.c.MADV.DONTNEED

常量

第 1775 行

std.c.MADV.DONTNEED

常量

第 1785 行

std.c.MADV.FREE

常量

第 1711 行

std.c.MADV.FREE

常量

第 1725 行

std.c.MADV.FREE

常量

第 1744 行

内容可被释放

std.c.MADV.FREE

常量

第 1762 行

std.c.MADV.FREE

常量

第 1787 行

std.c.MADV.FREE_REUSABLE

常量

第 1713 行

std.c.MADV.FREE_REUSE

常量

第 1714 行

std.c.MADV.INVAL

常量

第 1767 行

std.c.MADV.NOCORE

常量

第 1728 行

std.c.MADV.NOCORE

常量

第 1765 行

std.c.MADV.NORMAL

常量

第 1706 行

std.c.MADV.NORMAL

常量

第 1720 行

std.c.MADV.NORMAL

常量

第 1734 行

不再进行特殊处理

std.c.MADV.NORMAL

常量

第 1760 行

std.c.MADV.NORMAL

常量

第 1772 行

std.c.MADV.NORMAL

常量

第 1781 行

std.c.MADV.NOSYNC

常量

第 1726 行

std.c.MADV.NOSYNC

常量

第 1763 行

std.c.MADV.PAGEOUT

常量

第 1716 行

std.c.MADV.PROTECT

常量

第 1730 行

std.c.MADV.PURGE

常量

第 1752 行

内容将被清除

std.c.MADV.RANDOM

常量

第 1707 行

std.c.MADV.RANDOM

常量

第 1721 行

std.c.MADV.RANDOM

常量

第 1736 行

预期随机页面访问

std.c.MADV.RANDOM

常量

第 1758 行

std.c.MADV.RANDOM

常量

第 1778 行

std.c.MADV.RANDOM

常量

第 1782 行

std.c.MADV.SEQUENTIAL

常量

第 1708 行

std.c.MADV.SEQUENTIAL

常量

第 1722 行

std.c.MADV.SEQUENTIAL

常量

第 1738 行

预计顺序引用页面

std.c.MADV.SEQUENTIAL

常量

第 1755 行

std.c.MADV.SEQUENTIAL

常量

第 1777 行

std.c.MADV.SEQUENTIAL

常量

第 1783 行

std.c.MADV.SET_NONVOLATILE

常量

第 1774 行

std.c.MADV.SET_VOLATILE

常量

第 1773 行

std.c.MADV.SETMAP

常量

第 1768 行

std.c.MADV.SPACEAVAIL

常量

第 1786 行

std.c.MADV.WILLNEED

常量

第 1709 行

std.c.MADV.WILLNEED

常量

第 1723 行

std.c.MADV.WILLNEED

常量

第 1740 行

将需要这些页面

std.c.MADV.WILLNEED

常量

第 1759 行

std.c.MADV.WILLNEED

常量

第 1776 行

std.c.MADV.WILLNEED

常量

第 1784 行

std.c.MADV.ZERO

常量

第 1717 行

std.c.MADV.ZERO_WIRED_PAGES

常量

第 1712 行

std.c.madvise

函数

第 10857 行

pub extern "c" fn madvise( addr: *align(page_size) anyopaque, length: usize, advice: u32, ) c_int

参数

addr: *align(page_size) anyopaque
length: usize
advice: u32

std.c.major_t

别名

第 11637 行

别名目标 std.c.illumos.major_t

std.c.malloc

函数

第 11212 行

pub extern "c" fn malloc(usize) ?*anyopaque

参数

malloc: usize

std.c.malloc_size

常量

第 11017 行

std.c.malloc_usable_size

常量

第 11021 行

std.c.MAP

类型

第 8892 行

std.c.MAP_FAILED

常量

第 9052 行

由 libc 用于传达失败。实际上不是底层系统调用的一部分。

*anyopaque

std.c.MATTR

别名

第 11760 行

别名目标 std.c.darwin.MATTR

std.c.max_align_t

类型

第 11475 行

std.c.maxInt

别名

第 9 行

别名目标 std.math.maxInt

std.c.MAXNAMLEN

常量

第 7518 行

std.c.MCL

类型

第 1791 行

std.c.memfd_create

函数

第 10837 行

pub extern "c" fn memfd_create(name: [*:0]const u8, flags: c_uint) c_int

参数

name: [*:0]const u8
flags: c_uint

std.c.memory_object_offset_t

别名

第 11930 行

别名目标 std.c.darwin.memory_object_offset_t

std.c.MFD

类型

第 10560 行

std.c.mincore

函数

第 10851 行

pub extern "c" fn mincore( addr: *align(page_size) anyopaque, length: usize, vec: [*]u8, ) c_int

参数

addr: *align(page_size) anyopaque
length: usize
vec: [*]u8

std.c.minor_t

别名

第 11638 行

别名目标 std.c.illumos.minor_t

std.c.MINSIGSTKSZ

常量

第 9948 行

std.c.mkdir

函数

第 11119 行

pub extern "c" fn mkdir(path: [*:0]const u8, mode: mode_t) c_int

参数

path: [*:0]const u8
mode: mode_t

std.c.mkdirat

函数

第 11120 行

pub extern "c" fn mkdirat(dirfd: fd_t, path: [*:0]const u8, mode: mode_t) c_int

参数

dirfd: fd_t
path: [*:0]const u8
mode: mode_t

std.c.mlock

常量

第 10883 行

std.c.MLOCK

类型

第 1805 行

std.c.mlock2

常量

第 10888 行

std.c.mlockall

常量

第 10898 行

std.c.mmap

函数

第 11081 行

pub extern "c" fn mmap(addr: ?*align(page_size) anyopaque, len: usize, prot: PROT, flags: MAP, fd: fd_t, offset: off_t) *anyopaque

参数

addr: ?*align(page_size) anyopaque
len: usize
prot: PROT
flags: MAP
fd: fd_t
offset: off_t

std.c.mmap64

函数

第 10631 行

pub extern "c" fn mmap64(addr: ?*align(page_size) anyopaque, len: usize, prot: PROT, flags: MAP, fd: fd_t, offset: i64) *anyopaque

参数

addr: ?*align(page_size) anyopaque
len: usize
prot: PROT
flags: MAP
fd: fd_t
offset: i64

std.c.mmsghdr

类型

第 4401 行

std.c.mode_t

类型

第 160 行

std.c.modf

函数

第 11611 行

pub extern "c" fn modf(x: f64, iptr: *f64) f64

参数

x: f64
iptr: *f64

std.c.modff

函数

第 11610 行

pub extern "c" fn modff(x: f32, iptr: *f32) f32

参数

x: f32
iptr: *f32

std.c.modfl

函数

第 11612 行

pub extern "c" fn modfl(x: c_longdouble, iptr: *c_longdouble) c_longdouble

参数

x: c_longdouble
iptr: *c_longdouble

std.c.mprotect

函数

第 11084 行

pub extern "c" fn mprotect(addr: *align(page_size) anyopaque, len: usize, prot: PROT) c_int

参数

addr: *align(page_size) anyopaque
len: usize
prot: PROT

std.c.mremap

函数

第 11083 行

pub extern "c" fn mremap(addr: ?*align(page_size) const anyopaque, old_len: usize, new_len: usize, flags: MREMAP, ...) *anyopaque

参数

addr: ?*align(page_size) const anyopaque
old_len: usize
new_len: usize
flags: MREMAP

std.c.MREMAP

类型

第 9046 行

std.c.MSF

类型

第 1809 行

std.c.MSF.ASYNC

常量

第 1813 行

std.c.MSF.ASYNC

常量

第 1823 行

std.c.MSF.ASYNC

常量

第 1827 行

std.c.MSF.ASYNC

常量

第 1832 行

std.c.MSF.ASYNC

常量

第 1839 行

std.c.MSF.DEACTIVATE

常量

第 1818 行

停用,但保持映射

std.c.MSF.INVALIDATE

常量

第 1814 行

std.c.MSF.INVALIDATE

常量

第 1824 行

std.c.MSF.INVALIDATE

常量

第 1829 行

std.c.MSF.INVALIDATE

常量

第 1833 行

std.c.MSF.INVALIDATE

常量

第 1840 行

std.c.MSF.KILLPAGES

常量

第 1816 行

使之失效,保留映射

std.c.MSF.SYNC

常量

第 1819 行

std.c.MSF.SYNC

常量

第 1822 行

std.c.MSF.SYNC

常量

第 1828 行

std.c.MSF.SYNC

常量

第 1834 行

std.c.MSF.SYNC

常量

第 1838 行

std.c.MSG

类型

第 6010 行

std.c.MSG.BCAST

常量

第 6024 行

std.c.MSG.BCAST

常量

第 6070 行

std.c.MSG.BCAST

常量

第 6088 行

std.c.MSG.CMSG_CLOEXEC

常量

第 6056 行

std.c.MSG.CMSG_CLOEXEC

常量

第 6073 行

std.c.MSG.CMSG_CLOEXEC

常量

第 6091 行

std.c.MSG.CMSG_CLOEXEC

常量

第 6106 行

std.c.MSG.CMSG_CLOEXEC

常量

第 6122 行

std.c.MSG.CMSG_CLOFORK

常量

第 6093 行

std.c.MSG.CMSG_CLOFORK

常量

第 6107 行

std.c.MSG.CMSG_CLOFORK

常量

第 6123 行

std.c.MSG.COMPAT

常量

第 6053 行

std.c.MSG.CTRUNC

常量

第 6021 行

std.c.MSG.CTRUNC

常量

第 6032 行

std.c.MSG.CTRUNC

常量

第 6047 行

std.c.MSG.CTRUNC

常量

第 6067 行

std.c.MSG.CTRUNC

常量

第 6085 行

std.c.MSG.CTRUNC

常量

第 6101 行

std.c.MSG.CTRUNC

常量

第 6116 行

std.c.MSG.DONTROUTE

常量

第 6018 行

std.c.MSG.DONTROUTE

常量

第 6035 行

std.c.MSG.DONTROUTE

常量

第 6044 行

std.c.MSG.DONTROUTE

常量

第 6064 行

std.c.MSG.DONTROUTE

常量

第 6082 行

std.c.MSG.DONTROUTE

常量

第 6098 行

std.c.MSG.DONTROUTE

常量

第 6114 行

std.c.MSG.DONTWAIT

常量

第 6023 行

std.c.MSG.DONTWAIT

常量

第 6037 行

std.c.MSG.DONTWAIT

常量

第 6049 行

std.c.MSG.DONTWAIT

常量

第 6069 行

std.c.MSG.DONTWAIT

常量

第 6087 行

std.c.MSG.DONTWAIT

常量

第 6103 行

std.c.MSG.DONTWAIT

常量

第 6119 行

std.c.MSG.EOF

常量

第 6026 行

std.c.MSG.EOF

常量

第 6050 行

std.c.MSG.EOR

常量

第 6019 行

std.c.MSG.EOR

常量

第 6039 行

std.c.MSG.EOR

常量

第 6045 行

std.c.MSG.EOR

常量

第 6065 行

std.c.MSG.EOR

常量

第 6083 行

std.c.MSG.EOR

常量

第 6099 行

std.c.MSG.EOR

常量

第 6115 行

std.c.MSG.FBLOCKING

常量

第 6108 行

std.c.MSG.FNONBLOCKING

常量

第 6109 行

std.c.MSG.MCAST

常量

第 6025 行

std.c.MSG.MCAST

常量

第 6071 行

std.c.MSG.MCAST

常量

第 6089 行

std.c.MSG.MORETOCOME

常量

第 6058 行

std.c.MSG.NBIO

常量

第 6052 行

std.c.MSG.NBIO

常量

第 6074 行

std.c.MSG.NOSIGNAL

常量

第 6027 行

std.c.MSG.NOSIGNAL

常量

第 6038 行

std.c.MSG.NOSIGNAL

常量

第 6055 行

std.c.MSG.NOSIGNAL

常量

第 6072 行

std.c.MSG.NOSIGNAL

常量

第 6090 行

std.c.MSG.NOSIGNAL

常量

第 6104 行

std.c.MSG.NOSIGNAL

常量

第 6121 行

std.c.MSG.NOTIFICATION

常量

第 6051 行

std.c.MSG.NOTIFICATION

常量

第 6076 行

std.c.MSG.NOTIFICATION

常量

第 6120 行

std.c.MSG.OOB

常量

第 6016 行

std.c.MSG.OOB

常量

第 6034 行

std.c.MSG.OOB

常量

第 6042 行

std.c.MSG.OOB

常量

第 6062 行

std.c.MSG.OOB

常量

第 6080 行

std.c.MSG.OOB

常量

第 6096 行

std.c.MSG.OOB

常量

第 6112 行

std.c.MSG.PEEK

常量

第 6017 行

std.c.MSG.PEEK

常量

第 6033 行

std.c.MSG.PEEK

常量

第 6043 行

std.c.MSG.PEEK

常量

第 6063 行

std.c.MSG.PEEK

常量

第 6081 行

std.c.MSG.PEEK

常量

第 6097 行

std.c.MSG.PEEK

常量

第 6113 行

std.c.MSG.SOCALLBCK

常量

第 6054 行

std.c.MSG.SYNC

常量

第 6105 行

std.c.MSG.TLSAPPDATA

常量

第 6059 行

std.c.MSG.TRUNC

常量

第 6020 行

std.c.MSG.TRUNC

常量

第 6031 行

std.c.MSG.TRUNC

常量

第 6046 行

std.c.MSG.TRUNC

常量

第 6066 行

std.c.MSG.TRUNC

常量

第 6084 行

std.c.MSG.TRUNC

常量

第 6100 行

std.c.MSG.TRUNC

常量

第 6117 行

std.c.MSG.WAITALL

常量

第 6022 行

std.c.MSG.WAITALL

常量

第 6036 行

std.c.MSG.WAITALL

常量

第 6048 行

std.c.MSG.WAITALL

常量

第 6068 行

std.c.MSG.WAITALL

常量

第 6086 行

std.c.MSG.WAITALL

常量

第 6102 行

std.c.MSG.WAITALL

常量

第 6118 行

std.c.MSG.WAITFORONE

常量

第 6057 行

std.c.MSG.WAITFORONE

常量

第 6075 行

std.c.MSG.WAITFORONE

常量

第 6092 行

std.c.msghdr

类型

第 4303 行

std.c.msghdr_const

类型

第 4366 行

std.c.msync

常量

第 10908 行

std.c.munlock

常量

第 10893 行

std.c.munlockall

常量

第 10903 行

std.c.munmap

函数

第 11082 行

pub extern "c" fn munmap(addr: *align(page_size) const anyopaque, len: usize) c_int

参数

addr: *align(page_size) const anyopaque
len: usize

std.c.MuslOnlyPadding

类型函数

第 4347 行

POSIX 将若干结构体字段定义为 int 或 socklen_t,但 Linux 将其定义为 size_t。glibc 不遵循 POSIX,而采用 Linux 内核的定义;musl 则致力于遵循 POSIX,按 POSIX 方式定义这些字段。

musl 根据宿主字节序在字段前后添加填充字段,以解决 64 位 Linux ABI 与 POSIX 规范之间的不兼容:

#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN int __pad2; #endif socklen_t msg_controllen; #if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN int __pad2; #endif

为模拟 musl 的这一特殊行为,这些结构体使用 MuslOnlyPadding 字段:

pad0: MuslOnlyPadding(.big) = 0, msg_controllen: socklen_t, pad1: MuslOnlyPadding(.little) = 0,

在 32 位系统以及非 musl 系统中,这些字段的大小为零,会被忽略。

fn MuslOnlyPadding(endian: std.builtin.Endian) type

参数

endian: std.builtin.Endian

std.c.NAME_MAX

常量

第 1844 行

std.c.nanosleep

常量

第 10913 行

std.c.native_abi

常量

第 2 行

std.c.native_arch

常量

第 3 行

std.c.native_endian

常量

第 5 行

std.c.native_os

常量

第 4 行

std.c.natural_t

别名

第 11832 行

别名目标 std.c.darwin.natural_t

std.c.NCCS

类型

第 9177 行

std.c.netbsd

别名

第 20 行

别名目标 std.c.netbsd

std.c.nfds_t

类型

第 4510 行

std.c.NI

类型

第 7618 行

std.c.nlink_t

类型

第 170 行

std.c.NOTE

类型

第 10278 行

std.c.NOTE.ABSOLUTE

常量

第 10350 行

绝对超时时间

std.c.NOTE.ABSTIME

常量

第 10454 行

超时为绝对时间

std.c.NOTE.ABSTIME

常量

第 10514 行

超时为绝对时间

std.c.NOTE.ATTRIB

常量

第 10305 行

属性已更改

std.c.NOTE.ATTRIB

常量

第 10374 行

std.c.NOTE.ATTRIB

常量

第 10413 行

属性已更改

std.c.NOTE.ATTRIB

常量

第 10481 行

属性已更改

std.c.NOTE.ATTRIB

常量

第 10526 行

std.c.NOTE.BACKGROUND

常量

第 10356 行

系统执行最大程度的定时器合并

std.c.NOTE.CHANGE

常量

第 10541 行

std.c.NOTE.CHILD

常量

第 10373 行

std.c.NOTE.CHILD

常量

第 10442 行

我是子进程

std.c.NOTE.CHILD

常量

第 10539 行

std.c.NOTE.CLOSE

常量

第 10423 行

文件已关闭(无 FWRITE)

std.c.NOTE.CLOSE

常量

第 10491 行

文件已关闭,fd 不允许写入

std.c.NOTE.CLOSE_WRITE

常量

第 10425 行

文件已关闭(FWRITE)

std.c.NOTE.CLOSE_WRITE

常量

第 10493 行

文件已关闭,该文件描述符此前允许写入

std.c.NOTE.CRITICAL

常量

第 10354 行

系统仅进行最少量的定时器合并

std.c.NOTE.DELETE

常量

第 10299 行

vnode 已移除

std.c.NOTE.DELETE

常量

第 10367 行

std.c.NOTE.DELETE

常量

第 10407 行

vnode 已移除

std.c.NOTE.DELETE

常量

第 10475 行

vnode 已移除

std.c.NOTE.DELETE

常量

第 10523 行

std.c.NOTE.EOF

常量

第 10519 行

std.c.NOTE.EXEC

常量

第 10321 行

进程执行了 exec

std.c.NOTE.EXEC

常量

第 10381 行

std.c.NOTE.EXEC

常量

第 10433 行

进程执行了 exec

std.c.NOTE.EXEC

常量

第 10501 行

进程执行了 exec

std.c.NOTE.EXEC

常量

第 10534 行

std.c.NOTE.EXIT

常量

第 10317 行

进程已退出

std.c.NOTE.EXIT

常量

第 10384 行

std.c.NOTE.EXIT

常量

第 10429 行

进程已退出

std.c.NOTE.EXIT

常量

第 10497 行

进程已退出

std.c.NOTE.EXIT

常量

第 10532 行

std.c.NOTE.EXIT_CSERROR

常量

第 10334 行

std.c.NOTE.EXIT_DECRYPTFAIL

常量

第 10332 行

std.c.NOTE.EXIT_DETAIL

常量

第 10327 行

提供退出原因的详细信息

std.c.NOTE.EXIT_DETAIL_MASK

常量

第 10331 行

std.c.NOTE.EXIT_MEMORY

常量

第 10333 行

std.c.NOTE.EXITSTATUS

常量

第 10325 行

要返回的退出状态,仅对子进程有效。

std.c.NOTE.EXTEND

常量

第 10303 行

大小已增加

std.c.NOTE.EXTEND

常量

第 10372 行

std.c.NOTE.EXTEND

常量

第 10411 行

大小已增加

std.c.NOTE.EXTEND

常量

第 10479 行

大小已增加

std.c.NOTE.EXTEND

常量

第 10525 行

std.c.NOTE.FFAND

常量

第 10286 行

与 fflags 按位与

std.c.NOTE.FFAND

常量

第 10382 行

std.c.NOTE.FFAND

常量

第 10394 行

对 fflags 按位与

std.c.NOTE.FFAND

常量

第 10462 行

与 fflags 按位与

std.c.NOTE.FFAND

常量

第 10544 行

std.c.NOTE.FFCOPY

常量

第 10290 行

复制 fflags

std.c.NOTE.FFCOPY

常量

第 10387 行

std.c.NOTE.FFCOPY

常量

第 10398 行

复制 fflags

std.c.NOTE.FFCOPY

常量

第 10466 行

复制 fflags

std.c.NOTE.FFCOPY

常量

第 10546 行

std.c.NOTE.FFCTRLMASK

常量

第 10292 行

操作掩码

std.c.NOTE.FFCTRLMASK

常量

第 10386 行

std.c.NOTE.FFCTRLMASK

常量

第 10400 行

操作掩码

std.c.NOTE.FFCTRLMASK

常量

第 10468 行

操作掩码

std.c.NOTE.FFCTRLMASK

常量

第 10547 行

std.c.NOTE.FFLAGSMASK

常量

第 10293 行

std.c.NOTE.FFLAGSMASK

常量

第 10379 行

std.c.NOTE.FFLAGSMASK

常量

第 10401 行

std.c.NOTE.FFLAGSMASK

常量

第 10469 行

std.c.NOTE.FFLAGSMASK

常量

第 10548 行

std.c.NOTE.FFNOP

常量

第 10284 行

忽略输入 fflags

std.c.NOTE.FFNOP

常量

第 10365 行

std.c.NOTE.FFNOP

常量

第 10392 行

忽略输入 fflags

std.c.NOTE.FFNOP

常量

第 10460 行

忽略输入 fflags

std.c.NOTE.FFNOP

常量

第 10543 行

std.c.NOTE.FFOR

常量

第 10288 行

与 fflags 按位或

std.c.NOTE.FFOR

常量

第 10385 行

std.c.NOTE.FFOR

常量

第 10396 行

对 fflags 按位或

std.c.NOTE.FFOR

常量

第 10464 行

与 fflags 按位或

std.c.NOTE.FFOR

常量

第 10545 行

std.c.NOTE.FILE_POLL

常量

第 10473 行

行为与 poll() 类似

std.c.NOTE.FORK

常量

第 10319 行

进程已派生

std.c.NOTE.FORK

常量

第 10383 行

std.c.NOTE.FORK

常量

第 10431 行

进程已派生

std.c.NOTE.FORK

常量

第 10499 行

进程已派生

std.c.NOTE.FORK

常量

第 10533 行

std.c.NOTE.FUNLOCK

常量

第 10315 行

vnode 已被 flock(2) 解锁

std.c.NOTE.LEEWAY

常量

第 10352 行

ext[1] 保存节能定时器允许的偏差

std.c.NOTE.LINK

常量

第 10307 行

链接计数已更改

std.c.NOTE.LINK

常量

第 10375 行

std.c.NOTE.LINK

常量

第 10415 行

链接计数已更改

std.c.NOTE.LINK

常量

第 10483 行

链接计数已更改

std.c.NOTE.LINK

常量

第 10527 行

std.c.NOTE.LOWAT

常量

第 10295 行

低水位线

std.c.NOTE.LOWAT

常量

第 10368 行

std.c.NOTE.LOWAT

常量

第 10405 行

低水位线

std.c.NOTE.LOWAT

常量

第 10471 行

低水位线

std.c.NOTE.LOWAT

常量

第 10518 行

std.c.NOTE.MACH_CONTINUOUS_TIME

常量

第 10360 行

带 ABSOLUTE:休眠期间计时器继续计时,仍使用 gettimeofday 纪元。 同时带 MACHTIME 和 ABSOLUTE:使用 Mach 连续时间纪元。 不带 ABSOLUTE:休眠期间继续计时。

std.c.NOTE.MACHTIME

常量

第 10362 行

data 以 mach 绝对时间为单位

std.c.NOTE.MSECONDS

常量

第 10446 行

data 的单位为毫秒

std.c.NOTE.MSECONDS

常量

第 10508 行

data 的单位为毫秒

std.c.NOTE.NONE

常量

第 10313 行

无特定 vnode 事件:用于测试 EVFILT_READ 激活。

std.c.NOTE.NSECONDS

常量

第 10348 行

data 的单位为纳秒

std.c.NOTE.NSECONDS

常量

第 10452 行

data 的单位为纳秒

std.c.NOTE.NSECONDS

常量

第 10512 行

data 的单位为纳秒

std.c.NOTE.OOB

常量

第 10297 行

带外数据

std.c.NOTE.OOB

常量

第 10370 行

std.c.NOTE.OOB

常量

第 10521 行

std.c.NOTE.OPEN

常量

第 10421 行

vnode 已打开

std.c.NOTE.OPEN

常量

第 10489 行

vnode 已打开

std.c.NOTE.PCTRLMASK

常量

第 10330 行

std.c.NOTE.PCTRLMASK

常量

第 10388 行

std.c.NOTE.PCTRLMASK

常量

第 10436 行

std.c.NOTE.PCTRLMASK

常量

第 10504 行

std.c.NOTE.PCTRLMASK

常量

第 10536 行

std.c.NOTE.PDATAMASK

常量

第 10329 行

信号与退出状态的掩码

std.c.NOTE.PDATAMASK

常量

第 10378 行

std.c.NOTE.PDATAMASK

常量

第 10435 行

信号与退出状态的掩码

std.c.NOTE.PDATAMASK

常量

第 10503 行

信号与退出状态的掩码

std.c.NOTE.PDATAMASK

常量

第 10535 行

std.c.NOTE.READ

常量

第 10427 行

文件被读取

std.c.NOTE.READ

常量

第 10495 行

文件被读取

std.c.NOTE.RENAME

常量

第 10309 行

vnode 已重命名

std.c.NOTE.RENAME

常量

第 10376 行

std.c.NOTE.RENAME

常量

第 10417 行

vnode 已重命名

std.c.NOTE.RENAME

常量

第 10485 行

vnode 已重命名

std.c.NOTE.RENAME

常量

第 10528 行

std.c.NOTE.REVOKE

常量

第 10311 行

vnode 访问权限已撤销

std.c.NOTE.REVOKE

常量

第 10377 行

std.c.NOTE.REVOKE

常量

第 10419 行

vnode 访问权限已撤销

std.c.NOTE.REVOKE

常量

第 10487 行

vnode 访问权限已撤销

std.c.NOTE.REVOKE

常量

第 10529 行

std.c.NOTE.SECONDS

常量

第 10344 行

data 的单位为秒

std.c.NOTE.SECONDS

常量

第 10448 行

data 的单位为秒

std.c.NOTE.SECONDS

常量

第 10506 行

data 的单位为秒

std.c.NOTE.SIGNAL

常量

第 10323 行

与 EVFILT_SIGNAL 共享

std.c.NOTE.SIGNAL

常量

第 10444 行

与 EVFILT_SIGNAL 共享

std.c.NOTE.TRACK

常量

第 10366 行

std.c.NOTE.TRACK

常量

第 10438 行

跨 fork 跟踪

std.c.NOTE.TRACK

常量

第 10537 行

std.c.NOTE.TRACKERR

常量

第 10369 行

std.c.NOTE.TRACKERR

常量

第 10440 行

无法跟踪子进程

std.c.NOTE.TRACKERR

常量

第 10538 行

std.c.NOTE.TRIGGER

常量

第 10282 行

输入时,TRIGGER 使事件被触发以供输出。

std.c.NOTE.TRIGGER

常量

第 10380 行

std.c.NOTE.TRIGGER

常量

第 10403 行

输入时,TRIGGER 使事件被触发以供输出。

std.c.NOTE.TRIGGER

常量

第 10458 行

输入时,TRIGGER 使事件被触发以供输出。

std.c.NOTE.TRIGGER

常量

第 10549 行

std.c.NOTE.TRUNCATE

常量

第 10530 行

std.c.NOTE.USECONDS

常量

第 10346 行

data 的单位为微秒

std.c.NOTE.USECONDS

常量

第 10450 行

data 的单位为微秒

std.c.NOTE.USECONDS

常量

第 10510 行

data 的单位为微秒

std.c.NOTE.VM_ERROR

常量

第 10342 行

发生了错误

std.c.NOTE.VM_PRESSURE

常量

第 10336 行

将对内存压力做出响应

std.c.NOTE.VM_PRESSURE_SUDDEN_TERMINATE

常量

第 10340 行

内存压力出现时立即退出

std.c.NOTE.VM_PRESSURE_TERMINATE

常量

第 10338 行

出现内存压力时退出,可能先清理脏状态。

std.c.NOTE.WRITE

常量

第 10301 行

数据内容已更改

std.c.NOTE.WRITE

常量

第 10371 行

std.c.NOTE.WRITE

常量

第 10409 行

数据内容已更改

std.c.NOTE.WRITE

常量

第 10477 行

数据内容已更改

std.c.NOTE.WRITE

常量

第 10524 行

std.c.nrand48

函数

第 11569 行

pub extern "c" fn nrand48(xsubi: *[3]c_ushort) c_long

参数

xsubi: *[3]c_ushort

std.c.NSIG

常量

第 9935 行

最大信号编号 + 1

std.c.NSVersionOfRunTimeLibrary

别名

第 11761 行

别名目标 std.c.darwin.NSVersionOfRunTimeLibrary

std.c.O

类型

第 8649 行

std.c.off_t

类型

第 90 行

std.c.on_exit_thread

别名

第 11663 行

别名目标 std.c.haiku.on_exit_thread

std.c.open

函数

第 11069 行

pub extern "c" fn open(path: [*:0]const u8, oflag: O, ...) c_int

参数

path: [*:0]const u8
oflag: O

std.c.OPEN_MAX

别名

第 11762 行

别名目标 std.c.darwin.OPEN_MAX

std.c.open64

函数

第 10632 行

pub extern "c" fn open64(path: [*:0]const u8, oflag: O, ...) c_int

参数

path: [*:0]const u8
oflag: O

std.c.openat

函数

第 11070 行

pub extern "c" fn openat(fd: c_int, path: [*:0]const u8, oflag: O, ...) c_int

参数

fd: c_int
path: [*:0]const u8
oflag: O

std.c.openat64

函数

第 10633 行

pub extern "c" fn openat64(fd: c_int, path: [*:0]const u8, oflag: O, ...) c_int

参数

fd: c_int
path: [*:0]const u8
oflag: O

std.c.openbsd

别名

第 23 行

别名目标 std.c.openbsd

std.c.opendir

函数

第 10568 行

pub extern "c" fn opendir(pathname: [*:0]const u8) ?*DIR

参数

pathname: [*:0]const u8

std.c.openlog

函数

第 11443 行

pub extern "c" fn openlog(ident: [*:0]const u8, logopt: c_int, facility: c_int) void

参数

ident: [*:0]const u8
logopt: c_int
facility: c_int

std.c.OS

别名

第 11763 行

别名目标 std.c.darwin.OS

std.c.os_log_create

别名

第 11833 行

别名目标 std.c.darwin.os_log_create

std.c.os_log_t

别名

第 11834 行

别名目标 std.c.darwin.os_log_t

std.c.os_log_type_enabled

别名

第 11835 行

别名目标 std.c.darwin.os_log_type_enabled

std.c.os_log_type_t

别名

第 11836 行

别名目标 std.c.darwin.os_log_type_t

std.c.os_signpost_enabled

别名

第 11837 行

别名目标 std.c.darwin.os_signpost_enabled

std.c.os_signpost_id_generate

别名

第 11838 行

别名目标 std.c.darwin.os_signpost_id_generate

std.c.os_signpost_id_make_with_pointer

别名

第 11839 行

别名目标 std.c.darwin.os_signpost_id_make_with_pointer

std.c.os_signpost_id_t

别名

第 11840 行

别名目标 std.c.darwin.os_signpost_id_t

std.c.os_signpost_interval_begin

别名

第 11841 行

别名目标 std.c.darwin.os_signpost_interval_begin

std.c.os_signpost_interval_end

别名

第 11842 行

别名目标 std.c.darwin.os_signpost_interval_end

std.c.os_unfair_lock

别名

第 11843 行

别名目标 std.c.darwin.os_unfair_lock

std.c.os_unfair_lock_assert_not_owner

别名

第 11844 行

别名目标 std.c.darwin.os_unfair_lock_assert_not_owner

std.c.os_unfair_lock_assert_owner

别名

第 11845 行

别名目标 std.c.darwin.os_unfair_lock_assert_owner

std.c.os_unfair_lock_lock

别名

第 11846 行

别名目标 std.c.darwin.os_unfair_lock_lock

std.c.os_unfair_lock_t

别名

第 11847 行

别名目标 std.c.darwin.os_unfair_lock_t

std.c.os_unfair_lock_trylock

别名

第 11848 行

别名目标 std.c.darwin.os_unfair_lock_trylock

std.c.os_unfair_lock_unlock

别名

第 11849 行

别名目标 std.c.darwin.os_unfair_lock_unlock

std.c.padded_pthread_spin_t

类型

第 8378 行

std.c.page_size

别名

第 11 行

别名目标 std.heap.page_size_min

std.c.passwd

类型

第 205 行

std.c.PATH_MAX

常量

第 1854 行

std.c.perf_event

别名

第 11967 行

别名目标 std.c.serenity.perf_event

std.c.PERF_EVENT

别名

第 11961 行

别名目标 std.c.serenity.PERF_EVENT

std.c.perf_event_attr

类型

第 4520 行

std.c.perf_register_string

别名

第 11968 行

别名目标 std.c.serenity.perf_register_string

std.c.PF

类型

第 5704 行

std.c.PF.@"802"

常量

第 5853 行

std.c.PF.APPLETALK

常量

第 5711 行

std.c.PF.APPLETALK

常量

第 5770 行

std.c.PF.APPLETALK

常量

第 5807 行

std.c.PF.APPLETALK

常量

第 5851 行

std.c.PF.APPLETALK

常量

第 5889 行

std.c.PF.APPLETALK

常量

第 5916 行

std.c.PF.APPLETALK

常量

第 5960 行

std.c.PF.ARP

常量

第 5825 行

std.c.PF.ARP

常量

第 5899 行

std.c.PF.ATM

常量

第 5821 行

std.c.PF.ATM

常量

第 5936 行

std.c.PF.ATMPVC

常量

第 5714 行

std.c.PF.AX25

常量

第 5709 行

std.c.PF.BLUETOOTH

常量

第 5826 行

std.c.PF.BLUETOOTH

常量

第 5900 行

std.c.PF.BLUETOOTH

常量

第 5930 行

std.c.PF.BLUETOOTH

常量

第 5953 行

std.c.PF.BLUETOOTH

常量

第 5967 行

std.c.PF.BRIDGE

常量

第 5713 行

std.c.PF.CAN

常量

第 5903 行

std.c.PF.CCITT

常量

第 5764 行

std.c.PF.CCITT

常量

第 5802 行

std.c.PF.CCITT

常量

第 5845 行

std.c.PF.CCITT

常量

第 5883 行

std.c.PF.CCITT

常量

第 5937 行

std.c.PF.CHAOS

常量

第 5758 行

std.c.PF.CHAOS

常量

第 5796 行

std.c.PF.CHAOS

常量

第 5840 行

std.c.PF.CHAOS

常量

第 5877 行

std.c.PF.CHAOS

常量

第 5913 行

std.c.PF.CNT

常量

第 5775 行

std.c.PF.CNT

常量

第 5812 行

std.c.PF.CNT

常量

第 5893 行

std.c.PF.CNT

常量

第 5919 行

std.c.PF.COIP

常量

第 5774 行

std.c.PF.COIP

常量

第 5811 行

std.c.PF.COIP

常量

第 5892 行

std.c.PF.COIP

常量

第 5925 行

std.c.PF.DATAKIT

常量

第 5763 行

std.c.PF.DATAKIT

常量

第 5801 行

std.c.PF.DATAKIT

常量

第 5844 行

std.c.PF.DATAKIT

常量

第 5882 行

std.c.PF.DATAKIT

常量

第 5914 行

std.c.PF.DECnet

常量

第 5766 行

std.c.PF.DECnet

常量

第 5803 行

std.c.PF.DECnet

常量

第 5847 行

std.c.PF.DECnet

常量

第 5885 行

std.c.PF.DECnet

常量

第 5943 行

std.c.PF.DECnet

常量

第 5962 行

std.c.PF.DLI

常量

第 5767 行

std.c.PF.DLI

常量

第 5804 行

std.c.PF.DLI

常量

第 5848 行

std.c.PF.DLI

常量

第 5886 行

std.c.PF.DLI

常量

第 5935 行

std.c.PF.E164

常量

第 5897 行

std.c.PF.ECMA

常量

第 5762 行

std.c.PF.ECMA

常量

第 5800 行

std.c.PF.ECMA

常量

第 5843 行

std.c.PF.ECMA

常量

第 5881 行

std.c.PF.ECMA

常量

第 5933 行

std.c.PF.ETHER

常量

第 5904 行

std.c.PF.FILE

别名

第 5836 行

别名目标 std.c.PF.UNIX

std.c.PF.GOSIP

常量

第 5857 行

std.c.PF.HYLINK

常量

第 5769 行

std.c.PF.HYLINK

常量

第 5806 行

std.c.PF.HYLINK

常量

第 5850 行

std.c.PF.HYLINK

常量

第 5888 行

std.c.PF.HYLINK

常量

第 5921 行

std.c.PF.IEEE80211

常量

第 5827 行

std.c.PF.IMPLINK

常量

第 5756 行

std.c.PF.IMPLINK

常量

第 5794 行

std.c.PF.IMPLINK

常量

第 5838 行

std.c.PF.IMPLINK

常量

第 5875 行

std.c.PF.IMPLINK

常量

第 5909 行

std.c.PF.INET

常量

第 5708 行

std.c.PF.INET

常量

第 5755 行

std.c.PF.INET

常量

第 5793 行

std.c.PF.INET

常量

第 5837 行

std.c.PF.INET

常量

第 5874 行

std.c.PF.INET

常量

第 5915 行

std.c.PF.INET

常量

第 5947 行

std.c.PF.INET

常量

第 5959 行

std.c.PF.INET

常量

第 5975 行

std.c.PF.INET_SDP

常量

第 5828 行

std.c.PF.INET6

常量

第 5782 行

std.c.PF.INET6

常量

第 5819 行

std.c.PF.INET6

常量

第 5861 行

std.c.PF.INET6

常量

第 5894 行

std.c.PF.INET6

常量

第 5908 行

std.c.PF.INET6

常量

第 5950 行

std.c.PF.INET6

常量

第 5961 行

std.c.PF.INET6

常量

第 5976 行

std.c.PF.INET6_SDP

常量

第 5829 行

std.c.PF.IPX

常量

第 5710 行

std.c.PF.IPX

常量

第 5777 行

std.c.PF.IPX

常量

第 5814 行

std.c.PF.IPX

常量

第 5858 行

std.c.PF.IPX

常量

第 5895 行

std.c.PF.IPX

常量

第 5934 行

std.c.PF.ISDN

常量

第 5780 行

std.c.PF.ISDN

常量

第 5817 行

std.c.PF.ISDN

常量

第 5896 行

std.c.PF.ISDN

常量

第 5938 行

std.c.PF.ISDN

常量

第 5968 行

std.c.PF.ISO

常量

第 5760 行

std.c.PF.ISO

常量

第 5798 行

std.c.PF.ISO

常量

第 5879 行

std.c.PF.ISO

常量

第 5911 行

std.c.PF.KEY

常量

第 5781 行

std.c.PF.KEY

常量

第 5818 行

std.c.PF.KEY

常量

第 5862 行

std.c.PF.KEY

常量

第 5923 行

std.c.PF.KEY

常量

第 5963 行

std.c.PF.LAT

常量

第 5768 行

std.c.PF.LAT

常量

第 5805 行

std.c.PF.LAT

常量

第 5849 行

std.c.PF.LAT

常量

第 5887 行

std.c.PF.LAT

常量

第 5940 行

std.c.PF.LINK

常量

第 5772 行

std.c.PF.LINK

常量

第 5809 行

std.c.PF.LINK

常量

第 5860 行

std.c.PF.LINK

常量

第 5891 行

std.c.PF.LINK

常量

第 5920 行

std.c.PF.LINK

常量

第 5949 行

std.c.PF.LOCAL

常量

第 5707 行

std.c.PF.LOCAL

常量

第 5753 行

std.c.PF.LOCAL

常量

第 5791 行

std.c.PF.LOCAL

别名

第 5835 行

别名目标 std.c.PF.UNIX

std.c.PF.LOCAL

常量

第 5872 行

std.c.PF.LOCAL

常量

第 5927 行

std.c.PF.LOCAL

常量

第 5951 行

std.c.PF.LOCAL

常量

第 5957 行

std.c.PF.LOCAL

常量

第 5973 行

std.c.PF.LX_NETLINK

常量

第 5867 行

std.c.PF.MAX

常量

第 5787 行

std.c.PF.MAX

常量

第 5830 行

std.c.PF.MAX

常量

第 5868 行

std.c.PF.MAX

常量

第 5905 行

std.c.PF.MAX

常量

第 5922 行

std.c.PF.MAX

常量

第 5969 行

std.c.PF.MAX

常量

第 5978 行

std.c.PF.MPLS

常量

第 5901 行

std.c.PF.MPLS

常量

第 5966 行

std.c.PF.NATM

常量

第 5783 行

std.c.PF.NATM

常量

第 5820 行

std.c.PF.NATM

常量

第 5898 行

std.c.PF.NATM

常量

第 5929 行

std.c.PF.NBS

常量

第 5842 行

std.c.PF.NCA

常量

第 5863 行

std.c.PF.NETBIOS

常量

第 5785 行

std.c.PF.NETBIOS

常量

第 5797 行

std.c.PF.NETBIOS

常量

第 5928 行

std.c.PF.NETGRAPH

常量

第 5822 行

std.c.PF.NETGRAPH

常量

第 5932 行

std.c.PF.NETROM

常量

第 5712 行

std.c.PF.NIT

常量

第 5852 行

std.c.PF.NS

常量

第 5759 行

std.c.PF.NS

常量

第 5841 行

std.c.PF.NS

常量

第 5878 行

std.c.PF.OROUTE

常量

第 5890 行

std.c.PF.OSI

常量

第 5761 行

std.c.PF.OSI

常量

第 5799 行

std.c.PF.OSI

常量

第 5854 行

std.c.PF.OSI

常量

第 5880 行

std.c.PF.OSI

常量

第 5918 行

std.c.PF.OSINET

常量

第 5856 行

std.c.PF.PACKET

常量

第 5866 行

std.c.PF.PF_ALG

常量

第 5743 行

std.c.PF.PF_ASH

常量

第 5725 行

std.c.PF.PF_ATMSVC

常量

第 5727 行

std.c.PF.PF_BLUETOOTH

常量

第 5736 行

std.c.PF.PF_CAIF

常量

第 5742 行

std.c.PF.PF_CAN

常量

第 5734 行

std.c.PF.PF_DECnet

常量

第 5718 行

std.c.PF.PF_ECONET

常量

第 5726 行

std.c.PF.PF_IEEE802154

常量

第 5741 行

std.c.PF.PF_INET6

常量

第 5716 行

std.c.PF.PF_IRDA

常量

第 5730 行

std.c.PF.PF_ISDN

常量

第 5739 行

std.c.PF.PF_IUCV

常量

第 5737 行

std.c.PF.PF_KCM

常量

第 5746 行

std.c.PF.PF_KEY

常量

第 5721 行

std.c.PF.PF_LLC

常量

第 5733 行

std.c.PF.PF_MAX

常量

第 5748 行

std.c.PF.PF_NETBEUI

常量

第 5719 行

std.c.PF.PF_NETLINK

常量

第 5722 行

std.c.PF.PF_NFC

常量

第 5744 行

std.c.PF.PF_PACKET

常量

第 5724 行

std.c.PF.PF_PHONET

常量

第 5740 行

std.c.PF.PF_PPPOX

常量

第 5731 行

std.c.PF.PF_QIPCRTR

常量

第 5747 行

std.c.PF.PF_RDS

常量

第 5728 行

std.c.PF.PF_ROSE

常量

第 5717 行

std.c.PF.PF_ROUTE

常量

第 5723 行

std.c.PF.PF_RXRPC

常量

第 5738 行

std.c.PF.PF_SECURITY

常量

第 5720 行

std.c.PF.PF_SNA

常量

第 5729 行

std.c.PF.PF_TIPC

常量

第 5735 行

std.c.PF.PF_VSOCK

常量

第 5745 行

std.c.PF.PF_WANPIPE

常量

第 5732 行

std.c.PF.PIP

常量

第 5779 行

std.c.PF.PIP

常量

第 5816 行

std.c.PF.PIP

常量

第 5912 行

std.c.PF.POLICY

常量

第 5864 行

std.c.PF.PPP

常量

第 5786 行

std.c.PF.PUP

常量

第 5757 行

std.c.PF.PUP

常量

第 5795 行

std.c.PF.PUP

常量

第 5839 行

std.c.PF.PUP

常量

第 5876 行

std.c.PF.PUP

常量

第 5924 行

std.c.PF.ROUTE

常量

第 5771 行

std.c.PF.ROUTE

常量

第 5808 行

std.c.PF.ROUTE

常量

第 5859 行

std.c.PF.ROUTE

常量

第 5902 行

std.c.PF.ROUTE

常量

第 5910 行

std.c.PF.ROUTE

常量

第 5948 行

std.c.PF.ROUTE

常量

第 5964 行

std.c.PF.RTIP

常量

第 5778 行

std.c.PF.RTIP

常量

第 5815 行

std.c.PF.RTIP

常量

第 5939 行

std.c.PF.SCLUSTER

常量

第 5824 行

std.c.PF.SIP

常量

第 5776 行

std.c.PF.SIP

常量

第 5813 行

std.c.PF.SIP

常量

第 5917 行

std.c.PF.SLOW

常量

第 5823 行

std.c.PF.SNA

常量

第 5765 行

std.c.PF.SNA

常量

第 5846 行

std.c.PF.SNA

常量

第 5884 行

std.c.PF.SNA

常量

第 5926 行

std.c.PF.SNA

常量

第 5965 行

std.c.PF.SYSTEM

常量

第 5784 行

std.c.PF.TRILL

常量

第 5865 行

std.c.PF.UNIX

常量

第 5706 行

std.c.PF.UNIX

常量

第 5754 行

std.c.PF.UNIX

常量

第 5792 行

std.c.PF.UNIX

常量

第 5834 行

std.c.PF.UNIX

常量

第 5873 行

std.c.PF.UNIX

常量

第 5941 行

std.c.PF.UNIX

常量

第 5952 行

std.c.PF.UNIX

常量

第 5958 行

std.c.PF.UNIX

常量

第 5974 行

std.c.PF.UNSPEC

常量

第 5705 行

std.c.PF.UNSPEC

常量

第 5752 行

std.c.PF.UNSPEC

常量

第 5790 行

std.c.PF.UNSPEC

常量

第 5833 行

std.c.PF.UNSPEC

常量

第 5871 行

std.c.PF.UNSPEC

常量

第 5931 行

std.c.PF.UNSPEC

常量

第 5946 行

std.c.PF.UNSPEC

常量

第 5956 行

std.c.PF.UNSPEC

常量

第 5977 行

std.c.PF.X25

常量

第 5715 行

std.c.PF.X25

常量

第 5855 行

std.c.PF.XTP

常量

第 5773 行

std.c.PF.XTP

常量

第 5810 行

std.c.PF.XTP

常量

第 5942 行

std.c.pid_for_task

别名

第 11850 行

别名目标 std.c.darwin.pid_for_task

std.c.pid_t

类型

第 4524 行

std.c.pipe

函数

第 11118 行

pub extern "c" fn pipe(fds: *[2]fd_t) c_int

参数

fds: *[2]fd_t

std.c.pipe2

常量

第 10838 行

std.c.pledge

别名

第 11725 行

别名目标 std.c.openbsd.pledge

std.c.policy_t

别名

第 11931 行

别名目标 std.c.darwin.policy_t

std.c.poll

函数

第 11371 行

pub extern "c" fn poll(fds: [*]pollfd, nfds: nfds_t, timeout: c_int) c_int

参数

fds: [*]pollfd
nfds: nfds_t
timeout: c_int

std.c.POLL

类型

第 1863 行

std.c.POLL.ATTRIB

常量

第 1886 行

std.c.POLL.ERR

常量

第 1871 行

std.c.POLL.ERR

常量

第 1890 行

std.c.POLL.ERR

常量

第 1914 行

发生了某种 poll 错误。

std.c.POLL.ERR

常量

第 1934 行

不可测试事件(不能在 events 中指定)。

std.c.POLL.ERR

常量

第 1954 行

不可测试事件(不能在 events 字段中指定)。

std.c.POLL.ERR

常量

第 1973 行

存在待处理错误

std.c.POLL.ERR

常量

第 1983 行

std.c.POLL.ERR

常量

第 1997 行

std.c.POLL.ET

常量

第 1941 行

std.c.POLL.EXTEND

常量

第 1885 行

std.c.POLL.HUP

常量

第 1872 行

std.c.POLL.HUP

常量

第 1891 行

std.c.POLL.HUP

常量

第 1916 行

文件描述符已挂断。

std.c.POLL.HUP

常量

第 1935 行

std.c.POLL.HUP

常量

第 1955 行

std.c.POLL.HUP

常量

第 1975 行

已断开连接

std.c.POLL.HUP

常量

第 1984 行

std.c.POLL.HUP

常量

第 1998 行

std.c.POLL.IN

别名

第 1869 行

别名目标 std.c.POLL.RDNORM

std.c.POLL.IN

常量

第 1877 行

std.c.POLL.IN

常量

第 1898 行

存在任何可读数据。

std.c.POLL.IN

常量

第 1923 行

std.c.POLL.IN

常量

第 1945 行

可测试事件(可在 events 字段中指定)。

std.c.POLL.IN

常量

第 1960 行

有任意可读数据可用

std.c.POLL.IN

常量

第 1980 行

std.c.POLL.IN

常量

第 1994 行

std.c.POLL.INIGNEOF

常量

第 1912 行

类似 IN,但忽略 EOF。

std.c.POLL.NLINK

常量

第 1887 行

std.c.POLL.NORM

别名

第 1987 行

别名目标 std.c.POLL.RDNORM

std.c.POLL.NVAL

常量

第 1873 行

std.c.POLL.NVAL

常量

第 1892 行

std.c.POLL.NVAL

常量

第 1918 行

请求的事件为 "invalid"。

std.c.POLL.NVAL

常量

第 1936 行

std.c.POLL.NVAL

常量

第 1956 行

std.c.POLL.NVAL

常量

第 1977 行

无效的文件描述符

std.c.POLL.NVAL

常量

第 1985 行

std.c.POLL.NVAL

常量

第 1999 行

std.c.POLL.ONESHOT

常量

第 1940 行

std.c.POLL.OUT

别名

第 1870 行

别名目标 std.c.POLL.WRNORM

std.c.POLL.OUT

常量

第 1879 行

std.c.POLL.OUT

常量

第 1902 行

文件描述符可写。

std.c.POLL.OUT

常量

第 1925 行

std.c.POLL.OUT

常量

第 1947 行

std.c.POLL.OUT

常量

第 1962 行

文件描述符可写

std.c.POLL.OUT

常量

第 1982 行

std.c.POLL.OUT

常量

第 1996 行

std.c.POLL.PRI

常量

第 1878 行

std.c.POLL.PRI

常量

第 1900 行

带外/紧急可读数据。

std.c.POLL.PRI

常量

第 1924 行

std.c.POLL.PRI

常量

第 1946 行

std.c.POLL.PRI

常量

第 1970 行

高优先级可读数据

std.c.POLL.PRI

常量

第 1981 行

std.c.POLL.PRI

常量

第 1995 行

std.c.POLL.RDBAND

常量

第 1882 行

std.c.POLL.RDBAND

常量

第 1908 行

带外/紧急可读数据。

std.c.POLL.RDBAND

常量

第 1928 行

std.c.POLL.RDBAND

常量

第 1950 行

std.c.POLL.RDBAND

常量

第 1966 行

高优先级可读数据

std.c.POLL.RDBAND

常量

第 1989 行

std.c.POLL.RDHUP

常量

第 1931 行

读取端挂断。

std.c.POLL.RDHUP

常量

第 2003 行

std.c.POLL.RDNORM

常量

第 1867 行

std.c.POLL.RDNORM

常量

第 1880 行

std.c.POLL.RDNORM

常量

第 1904 行

非带外/紧急数据可用。

std.c.POLL.RDNORM

常量

第 1926 行

std.c.POLL.RDNORM

常量

第 1948 行

std.c.POLL.RDNORM

别名

第 1963 行

别名目标 std.c.POLL.IN

std.c.POLL.RDNORM

常量

第 1986 行

std.c.POLL.RDNORM

别名

第 2000 行

别名目标 std.c.POLL.IN

std.c.POLL.REMOVE

常量

第 1939 行

控制 /dev/poll 的事件(不在 revents 中指定)。

std.c.POLL.STANDARD

常量

第 1894 行

std.c.POLL.STANDARD

常量

第 1920 行

std.c.POLL.WRBAND

常量

第 1883 行

std.c.POLL.WRBAND

常量

第 1910 行

可写入带外/紧急数据。

std.c.POLL.WRBAND

常量

第 1929 行

std.c.POLL.WRBAND

常量

第 1951 行

std.c.POLL.WRBAND

常量

第 1968 行

可写入优先数据

std.c.POLL.WRBAND

常量

第 1990 行

std.c.POLL.WRBAND

常量

第 2002 行

std.c.POLL.WRITE

常量

第 1888 行

std.c.POLL.WRNORM

常量

第 1868 行

std.c.POLL.WRNORM

别名

第 1881 行

别名目标 std.c.POLL.OUT

std.c.POLL.WRNORM

别名

第 1906 行

不区分写入类型。

别名目标 std.c.POLL.OUT

std.c.POLL.WRNORM

常量

第 1927 行

std.c.POLL.WRNORM

别名

第 1949 行

别名目标 std.c.POLL.OUT

std.c.POLL.WRNORM

别名

第 1964 行

别名目标 std.c.POLL.OUT

std.c.POLL.WRNORM

别名

第 1988 行

别名目标 std.c.POLL.OUT

std.c.POLL.WRNORM

别名

第 2001 行

别名目标 std.c.POLL.OUT

std.c.pollfd

类型

第 4532 行

std.c.poolid_t

别名

第 11639 行

别名目标 std.c.illumos.poolid_t

std.c.port_alert

函数

第 11346 行

pub extern "c" fn port_alert(port: port_t, flags: u32, events: u32, user_var: ?*anyopaque) c_int

参数

port: port_t
flags: u32
events: u32
user_var: ?*anyopaque

std.c.PORT_ALERT

别名

第 11625 行

别名目标 std.c.illumos.PORT_ALERT

std.c.port_associate

函数

第 11322 行

pub extern "c" fn port_associate( port: port_t, source: u32, object: usize, events: u32, user_var: ?*anyopaque, ) c_int

参数

port: port_t
source: u32
object: usize
events: u32
user_var: ?*anyopaque

std.c.port_create

函数

第 11321 行

pub extern "c" fn port_create() port_t

std.c.port_dissociate

函数

第 11329 行

pub extern "c" fn port_dissociate(port: port_t, source: u32, object: usize) c_int

参数

port: port_t
source: u32
object: usize

std.c.port_event

类型

第 8509 行

std.c.port_get

函数

第 11338 行

pub extern "c" fn port_get(port: port_t, event: *port_event, timeout: ?*timespec) c_int

参数

port: port_t
event: *port_event
timeout: ?*timespec

std.c.port_getn

函数

第 11339 行

pub extern "c" fn port_getn( port: port_t, event_list: []port_event, max_events: u32, events_retrieved: *u32, timeout: ?*timespec, ) c_int

参数

port: port_t
event_list: []port_event
max_events: u32
events_retrieved: *u32
timeout: ?*timespec

std.c.port_id

别名

第 11664 行

别名目标 std.c.haiku.port_id

std.c.port_notify

别名

第 11640 行

别名目标 std.c.illumos.port_notify

std.c.port_send

函数

第 11330 行

pub extern "c" fn port_send(port: port_t, events: u32, user_var: ?*anyopaque) c_int

参数

port: port_t
events: u32
user_var: ?*anyopaque

std.c.port_sendn

函数

第 11331 行

pub extern "c" fn port_sendn( ports: [*]port_t, errors: []u32, num_ports: u32, events: u32, user_var: ?*anyopaque, ) c_int

参数

ports: [*]port_t
errors: []u32
num_ports: u32
events: u32
user_var: ?*anyopaque

std.c.PORT_SOURCE

别名

第 11626 行

别名目标 std.c.illumos.PORT_SOURCE

std.c.port_t

类型

第 8504 行

std.c.posix_cmsghdr

容器

第 4440 行

字段

pad0: MuslOnlyPadding(.big) = 0
len: socklen_t
pad1: MuslOnlyPadding(.little) = 0
level: c_int
type: c_int

std.c.POSIX_FADV

别名

第 11627 行

别名目标 std.c.illumos.POSIX_FADV

std.c.posix_memalign

常量

第 11025 行

std.c.posix_msghdr

容器

第 4352 行

字段

name: ?*sockaddr
namelen: socklen_t
iov: [*]iovec
pad0: MuslOnlyPadding(.big) = 0
iovlen: u32
pad1: MuslOnlyPadding(.little) = 0
control: ?*anyopaque
pad2: MuslOnlyPadding(.big) = 0
controllen: socklen_t
pad3: MuslOnlyPadding(.little) = 0
flags: u32

std.c.posix_msghdr_const

容器

第 4387 行

字段

name: ?*const sockaddr
namelen: socklen_t
iov: [*]const iovec_const
pad0: MuslOnlyPadding(.big) = 0
iovlen: u32
pad1: MuslOnlyPadding(.little) = 0
control: ?*const anyopaque
pad2: MuslOnlyPadding(.big) = 0
controllen: socklen_t
pad3: MuslOnlyPadding(.little) = 0
flags: u32

std.c.posix_spawn

别名

第 11851 行

别名目标 std.c.darwin.posix_spawn

std.c.POSIX_SPAWN

别名

第 11764 行

别名目标 std.c.darwin.POSIX_SPAWN

std.c.posix_spawn_file_actions_addchdir_np

别名

第 11852 行

别名目标 std.c.darwin.posix_spawn_file_actions_addchdir_np

std.c.posix_spawn_file_actions_addclose

别名

第 11853 行

别名目标 std.c.darwin.posix_spawn_file_actions_addclose

std.c.posix_spawn_file_actions_adddup2

别名

第 11854 行

别名目标 std.c.darwin.posix_spawn_file_actions_adddup2

std.c.posix_spawn_file_actions_addfchdir_np

别名

第 11855 行

别名目标 std.c.darwin.posix_spawn_file_actions_addfchdir_np

std.c.posix_spawn_file_actions_addinherit_np

别名

第 11856 行

别名目标 std.c.darwin.posix_spawn_file_actions_addinherit_np

std.c.posix_spawn_file_actions_addopen

别名

第 11857 行

别名目标 std.c.darwin.posix_spawn_file_actions_addopen

std.c.posix_spawn_file_actions_destroy

别名

第 11858 行

别名目标 std.c.darwin.posix_spawn_file_actions_destroy

std.c.posix_spawn_file_actions_init

别名

第 11859 行

别名目标 std.c.darwin.posix_spawn_file_actions_init

std.c.posix_spawn_file_actions_t

别名

第 11860 行

别名目标 std.c.darwin.posix_spawn_file_actions_t

std.c.posix_spawnattr_destroy

别名

第 11861 行

别名目标 std.c.darwin.posix_spawnattr_destroy

std.c.posix_spawnattr_getflags

别名

第 11862 行

别名目标 std.c.darwin.posix_spawnattr_getflags

std.c.posix_spawnattr_getpgroup

别名

第 11863 行

别名目标 std.c.darwin.posix_spawnattr_getpgroup

std.c.posix_spawnattr_init

别名

第 11864 行

别名目标 std.c.darwin.posix_spawnattr_init

std.c.posix_spawnattr_setflags

别名

第 11865 行

别名目标 std.c.darwin.posix_spawnattr_setflags

std.c.posix_spawnattr_setpgroup

别名

第 11866 行

别名目标 std.c.darwin.posix_spawnattr_setpgroup

std.c.posix_spawnattr_t

别名

第 11867 行

别名目标 std.c.darwin.posix_spawnattr_t

std.c.posix_spawnp

别名

第 11868 行

别名目标 std.c.darwin.posix_spawnp

std.c.ppoll

函数

第 11372 行

pub extern "c" fn ppoll(fds: [*]pollfd, nfds: nfds_t, timeout: ?*const timespec, sigmask: ?*const sigset_t) c_int

参数

fds: [*]pollfd
nfds: nfds_t
timeout: ?*const timespec
sigmask: ?*const sigset_t

std.c.PR

类型

第 7331 行

std.c.prctl

函数

第 11435 行

pub extern "c" fn prctl(option: c_int, ...) c_int

参数

option: c_int

std.c.pread

函数

第 11075 行

pub extern "c" fn pread(fd: fd_t, buf: [*]u8, nbyte: usize, offset: off_t) isize

参数

fd: fd_t
buf: [*]u8
nbyte: usize
offset: off_t

std.c.pread64

函数

第 10634 行

pub extern "c" fn pread64(fd: fd_t, buf: [*]u8, nbyte: usize, offset: i64) isize

参数

fd: fd_t
buf: [*]u8
nbyte: usize
offset: i64

std.c.preadv

函数

第 11076 行

pub extern "c" fn preadv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint, offset: off_t) isize

参数

fd: c_int
iov: [*]const iovec
iovcnt: c_uint
offset: off_t

std.c.preadv64

函数

第 10635 行

pub extern "c" fn preadv64(fd: c_int, iov: [*]const iovec, iovcnt: c_uint, offset: i64) isize

参数

fd: c_int
iov: [*]const iovec
iovcnt: c_uint
offset: i64

std.c.printf

函数

第 11062 行

pub extern "c" fn printf(format: [*:0]const u8, ...) c_int

参数

format: [*:0]const u8

std.c.priority

别名

第 11641 行

别名目标 std.c.illumos.priority

std.c.private

命名空间

第 11975 行

由两个或多个操作系统共享的外部定义。

std.c.private.___errno

函数

第 12087 行

extern "c" fn ___errno() *c_int

std.c.private.__clock_getres50

函数

第 12060 行

NetBSD 的现代化符号。

extern "c" fn __clock_getres50(clk_id: clockid_t, tp: *timespec) c_int

参数

clk_id: clockid_t
tp: *timespec

std.c.private.__clock_gettime50

函数

第 12061 行

extern "c" fn __clock_gettime50(clk_id: clockid_t, tp: *timespec) c_int

参数

clk_id: clockid_t
tp: *timespec

std.c.private.__errno

函数

第 12088 行

extern "c" fn __errno() *c_int

std.c.private.__errno_location

函数

第 12089 行

extern "c" fn __errno_location() *c_int

std.c.private.__error

函数

第 12090 行

extern "c" fn __error() *c_int

std.c.private.__fstat50

函数

第 12062 行

extern "c" fn __fstat50(fd: fd_t, buf: *Stat) c_int

参数

fd: fd_t
buf: *Stat

std.c.private.__getdents30

函数

第 12074 行

extern "c" fn __getdents30(fd: c_int, buf_ptr: [*]u8, nbytes: usize) c_int

参数

fd: c_int
buf_ptr: [*]u8
nbytes: usize

std.c.private.__getdirentries64

函数

第 12055 行

extern "c" fn __getdirentries64(fd: fd_t, buf_ptr: [*]u8, buf_len: usize, basep: *i64) isize

参数

fd: fd_t
buf_ptr: [*]u8
buf_len: usize
basep: *i64

std.c.private.__getrusage50

函数

第 12063 行

extern "c" fn __getrusage50(who: c_int, usage: *rusage) c_int

参数

who: c_int
usage: *rusage

std.c.private.__gettimeofday50

函数

第 12064 行

extern "c" fn __gettimeofday50(noalias tv: ?*timeval, noalias tz: ?*timezone) c_int

参数

tv: ?*timeval
tz: ?*timezone

std.c.private.__libc_current_sigrtmax

函数

第 12079 行

extern "c" fn __libc_current_sigrtmax() c_int

std.c.private.__libc_current_sigrtmin

函数

第 12078 行

extern "c" fn __libc_current_sigrtmin() c_int

std.c.private.__libc_thr_yield

函数

第 12065 行

extern "c" fn __libc_thr_yield() c_int

std.c.private.__msync13

函数

第 12066 行

extern "c" fn __msync13(addr: *align(page_size) const anyopaque, len: usize, flags: c_int) c_int

参数

addr: *align(page_size) const anyopaque
len: usize
flags: c_int

std.c.private.__nanosleep50

函数

第 12067 行

extern "c" fn __nanosleep50(rqtp: *const timespec, rmtp: ?*timespec) c_int

参数

rqtp: *const timespec
rmtp: ?*timespec

std.c.private.__sigaction14

函数

第 12068 行

extern "c" fn __sigaction14(sig: SIG, noalias act: ?*const Sigaction, noalias oact: ?*Sigaction) c_int

参数

sig: SIG
act: ?*const Sigaction
oact: ?*Sigaction

std.c.private.__sigaltstack14

函数

第 12075 行

extern "c" fn __sigaltstack14(ss: ?*const stack_t, old_ss: ?*stack_t) c_int

参数

ss: ?*const stack_t
old_ss: ?*stack_t

std.c.private.__sigemptyset14

函数

第 12069 行

extern "c" fn __sigemptyset14(set: ?*sigset_t) c_int

参数

set: ?*sigset_t

std.c.private.__sigfillset14

函数

第 12070 行

extern "c" fn __sigfillset14(set: ?*sigset_t) c_int

参数

set: ?*sigset_t

std.c.private.__signal_get_sigrtmax

函数

第 12081 行

extern "c" fn __signal_get_sigrtmax() c_int

std.c.private.__signal_get_sigrtmin

函数

第 12080 行

extern "c" fn __signal_get_sigrtmin() c_int

std.c.private.__sigprocmask14

函数

第 12071 行

extern "c" fn __sigprocmask14(how: c_int, noalias set: ?*const sigset_t, noalias oset: ?*sigset_t) c_int

参数

how: c_int
set: ?*const sigset_t
oset: ?*sigset_t

std.c.private.__socket30

函数

第 12072 行

extern "c" fn __socket30(domain: c_uint, sock_type: c_uint, protocol: c_uint) c_int

参数

domain: c_uint
sock_type: c_uint
protocol: c_uint

std.c.private.__stat50

函数

第 12073 行

extern "c" fn __stat50(path: [*:0]const u8, buf: *Stat) c_int

参数

path: [*:0]const u8
buf: *Stat

std.c.private.__wait450

函数

第 12076 行

extern "c" fn __wait450(pid: pid_t, status: ?*c_int, options: c_int, ru: ?*rusage) pid_t

参数

pid: pid_t
status: ?*c_int
options: c_int
ru: ?*rusage

std.c.private._errno

函数

第 12091 行

extern "c" fn _errno() *c_int

std.c.private._msize

函数

第 12030 行

extern "c" fn _msize(?*const anyopaque) usize

参数

_msize: ?*const anyopaque

std.c.private._strdup

函数

第 11977 行

pub extern "c" fn _strdup(s: [*:0]const c_char) ?[*:0]c_char

参数

s: [*:0]const c_char

std.c.private._swab

函数

第 11982 行

pub extern "c" fn _swab(noalias from: *const anyopaque, noalias to: *anyopaque, n: isize) void

参数

from: *const anyopaque
to: *anyopaque
n: isize

std.c.private._wcsdup

函数

第 11979 行

pub extern "c" fn _wcsdup(s: [*:0]const wchar_t) ?[*:0]wchar_t

参数

s: [*:0]const wchar_t

std.c.private.@"fstat$INODE64"

函数

第 12047 行

macOS 现代化符号。 x86_64 链接到带 $INODE64 后缀的符号,以支持 64 位。 注意,aarch64 不需要这些符号。

extern "c" fn @"fstat$INODE64"(fd: fd_t, buf: *Stat) c_int

参数

fd: fd_t
buf: *Stat

std.c.private.@"fstatat$INODE64"

函数

第 12048 行

extern "c" fn @"fstatat$INODE64"(dirfd: fd_t, path: [*:0]const u8, buf: *Stat, flag: u32) c_int

参数

dirfd: fd_t
path: [*:0]const u8
buf: *Stat
flag: u32

std.c.private.@"readdir$INODE64"

函数

第 12049 行

extern "c" fn @"readdir$INODE64"(dir: *DIR) ?*dirent

参数

dir: *DIR

std.c.private.@"realpath$DARWIN_EXTSN"

函数

第 12054 行

macOS 的现代化符号。

extern "c" fn @"realpath$DARWIN_EXTSN"(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8

参数

file_name: [*:0]const u8
resolved_name: [*]u8

std.c.private.@"stat$INODE64"

函数

第 12050 行

extern "c" fn @"stat$INODE64"(noalias path: [*:0]const u8, noalias buf: *Stat) c_int

参数

path: [*:0]const u8
buf: *Stat

std.c.private.arc4random_buf

函数

第 12028 行

extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void

参数

buf: [*]u8
len: usize

std.c.private.clock_getres

函数

第 11985 行

extern "c" fn clock_getres(clk_id: clockid_t, tp: *timespec) c_int

参数

clk_id: clockid_t
tp: *timespec

std.c.private.clock_gettime

函数

第 11986 行

extern "c" fn clock_gettime(clk_id: clockid_t, tp: *timespec) c_int

参数

clk_id: clockid_t
tp: *timespec

std.c.private.clock_nanosleep

函数

第 12003 行

extern "c" fn clock_nanosleep(clockid: clockid_t, flags: TIMER, t: *const timespec, remain: ?*timespec) c_int

参数

clockid: clockid_t
flags: TIMER
t: *const timespec
remain: ?*timespec

std.c.private.close

函数

第 11984 行

extern "c" fn close(fd: fd_t) c_int

参数

fd: fd_t

std.c.private.copy_file_range

函数

第 11987 行

extern "c" fn copy_file_range(fd_in: fd_t, off_in: ?*i64, fd_out: fd_t, off_out: ?*i64, len: usize, flags: c_uint) isize

参数

fd_in: fd_t
off_in: ?*i64
fd_out: fd_t
off_out: ?*i64
len: usize
flags: c_uint

std.c.private.errno

变量

第 12093 行

c_int

std.c.private.errnoFromThreadLocal

函数

第 12095 行

fn errnoFromThreadLocal() *c_int

std.c.private.flock

函数

第 11988 行

extern "c" fn flock(fd: fd_t, operation: c_int) c_int

参数

fd: fd_t
operation: c_int

std.c.private.fork

函数

第 11989 行

extern "c" fn fork() c_int

std.c.private.fstat

函数

第 11990 行

extern "c" fn fstat(fd: fd_t, buf: *Stat) c_int

参数

fd: fd_t
buf: *Stat

std.c.private.fstatat

函数

第 11991 行

extern "c" fn fstatat(dirfd: fd_t, path: [*:0]const u8, buf: *Stat, flag: u32) c_int

参数

dirfd: fd_t
path: [*:0]const u8
buf: *Stat
flag: u32

std.c.private.getdents

函数

第 11993 行

extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) switch (native_os) { .freebsd => isize, .illumos => usize, else => c_int, }

参数

fd: c_int
buf_ptr: [*]u8
nbytes: usize

std.c.private.getdirentries

函数

第 11992 行

extern "c" fn getdirentries(fd: fd_t, buf_ptr: [*]u8, nbytes: usize, basep: *i64) isize

参数

fd: fd_t
buf_ptr: [*]u8
nbytes: usize
basep: *i64

std.c.private.getentropy

函数

第 12027 行

extern "c" fn getentropy(buffer: [*]u8, size: usize) c_int

参数

buffer: [*]u8
size: usize

std.c.private.getrandom

函数

第 12026 行

extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize

参数

buf_ptr: [*]u8
buf_len: usize
flags: c_uint

std.c.private.getrusage

函数

第 11998 行

extern "c" fn getrusage(who: c_int, usage: *rusage) c_int

参数

who: c_int
usage: *rusage

std.c.private.gettimeofday

函数

第 11999 行

extern "c" fn gettimeofday(noalias tv: ?*timeval, noalias tz: ?*timezone) c_int

参数

tv: ?*timeval
tz: ?*timezone

std.c.private.ioctl

函数

第 12000 行

extern "c" fn ioctl(fd: fd_t, request: c_int, ...) c_int

参数

fd: fd_t
request: c_int

std.c.private.malloc_size

函数

第 12031 行

extern "c" fn malloc_size(?*const anyopaque) usize

参数

malloc_size: ?*const anyopaque

std.c.private.malloc_usable_size

函数

第 12032 行

extern "c" fn malloc_usable_size(?*const anyopaque) usize

参数

malloc_usable_size: ?*const anyopaque

std.c.private.mlock

函数

第 12035 行

extern "c" fn mlock(addr: *align(page_size) const anyopaque, len: usize) c_int

参数

addr: *align(page_size) const anyopaque
len: usize

std.c.private.mlock2

函数

第 12036 行

extern "c" fn mlock2(addr: *align(page_size) const anyopaque, len: usize, flags: MLOCK) c_int

参数

addr: *align(page_size) const anyopaque
len: usize
flags: MLOCK

std.c.private.mlockall

函数

第 12038 行

extern "c" fn mlockall(flags: MCL) c_int

参数

flags: MCL

std.c.private.msync

函数

第 12001 行

extern "c" fn msync(addr: *align(page_size) const anyopaque, len: usize, flags: c_int) c_int

参数

addr: *align(page_size) const anyopaque
len: usize
flags: c_int

std.c.private.munlock

函数

第 12037 行

extern "c" fn munlock(addr: *align(page_size) const anyopaque, len: usize) c_int

参数

addr: *align(page_size) const anyopaque
len: usize

std.c.private.munlockall

函数

第 12039 行

extern "c" fn munlockall() c_int

std.c.private.nanosleep

函数

第 12002 行

extern "c" fn nanosleep(rqtp: *const timespec, rmtp: ?*timespec) c_int

参数

rqtp: *const timespec
rmtp: ?*timespec

std.c.private.pipe2

函数

第 12004 行

extern "c" fn pipe2(fds: *[2]fd_t, flags: O) c_int

参数

fds: *[2]fd_t
flags: O

std.c.private.posix_memalign

函数

第 12033 行

extern "c" fn posix_memalign(memptr: *?*anyopaque, alignment: usize, size: usize) c_int

参数

memptr: *?*anyopaque
alignment: usize
size: usize

std.c.private.pthread_setname_np

函数

第 12024 行

extern "c" fn pthread_setname_np(thread: pthread_t, name: [*:0]const u8) c_int

参数

thread: pthread_t
name: [*:0]const u8

std.c.private.pthread_threadid_np

函数

第 12057 行

extern "c" fn pthread_threadid_np(thread: ?pthread_t, thread_id: *u64) c_int

参数

thread: ?pthread_t
thread_id: *u64

std.c.private.ptrace

函数

第 12042 行

extern "c" fn ptrace(request: c_int, pid: pid_t, addr: ?*anyopaque, data: ?*anyopaque) c_long

参数

request: c_int
pid: pid_t
addr: ?*anyopaque
data: ?*anyopaque

std.c.private.readdir

函数

第 12005 行

extern "c" fn readdir(dir: *DIR) ?*dirent

参数

dir: *DIR

std.c.private.realpath

函数

第 12006 行

extern "c" fn realpath(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8

参数

file_name: [*:0]const u8
resolved_name: [*]u8

std.c.private.recvmsg

函数

第 12007 行

extern "c" fn recvmsg(sockfd: fd_t, msg: *msghdr, flags: u32) isize

参数

sockfd: fd_t
msg: *msghdr
flags: u32

std.c.private.sched_yield

函数

第 12008 行

extern "c" fn sched_yield() c_int

std.c.private.sendfile

函数

第 12009 行

extern "c" fn sendfile(out_fd: fd_t, in_fd: fd_t, offset: ?*off_t, count: usize) isize

参数

out_fd: fd_t
in_fd: fd_t
offset: ?*off_t
count: usize

std.c.private.shm_open

函数

第 12021 行

extern "c" fn shm_open(name: [*:0]const u8, flag: c_int, mode: mode_t) c_int

参数

name: [*:0]const u8
flag: c_int
mode: mode_t

std.c.private.sigaction

函数

第 12010 行

extern "c" fn sigaction(sig: SIG, noalias act: ?*const Sigaction, noalias oact: ?*Sigaction) c_int

参数

sig: SIG
act: ?*const Sigaction
oact: ?*Sigaction

std.c.private.sigaddset

函数

第 12012 行

extern "c" fn sigaddset(set: ?*sigset_t, signo: SIG) c_int

参数

set: ?*sigset_t
signo: SIG

std.c.private.sigaltstack

函数

第 12019 行

extern "c" fn sigaltstack(ss: ?*const stack_t, old_ss: ?*stack_t) c_int

参数

ss: ?*const stack_t
old_ss: ?*stack_t

std.c.private.sigdelset

函数

第 12011 行

extern "c" fn sigdelset(set: ?*sigset_t, signo: SIG) c_int

参数

set: ?*sigset_t
signo: SIG

std.c.private.sigemptyset

函数

第 12014 行

extern "c" fn sigemptyset(set: ?*sigset_t) c_int

参数

set: ?*sigset_t

std.c.private.sigfillset

函数

第 12013 行

extern "c" fn sigfillset(set: ?*sigset_t) c_int

参数

set: ?*sigset_t

std.c.private.sigismember

函数

第 12015 行

extern "c" fn sigismember(set: ?*const sigset_t, signo: SIG) c_int

参数

set: ?*const sigset_t
signo: SIG

std.c.private.sigprocmask

函数

第 12016 行

extern "c" fn sigprocmask(how: c_int, noalias set: ?*const sigset_t, noalias oset: ?*sigset_t) c_int

参数

how: c_int
set: ?*const sigset_t
oset: ?*sigset_t

std.c.private.socket

函数

第 12017 行

extern "c" fn socket(domain: c_uint, sock_type: c_uint, protocol: c_uint) c_int

参数

domain: c_uint
sock_type: c_uint
protocol: c_uint

std.c.private.socketpair

函数

第 12018 行

extern "c" fn socketpair(domain: c_uint, sock_type: c_uint, protocol: c_uint, sv: *[2]fd_t) c_int

参数

domain: c_uint
sock_type: c_uint
protocol: c_uint
sv: *[2]fd_t

std.c.private.stat

函数

第 12051 行

extern "c" fn stat(noalias path: [*:0]const u8, noalias buf: *Stat) c_int

参数

path: [*:0]const u8
buf: *Stat

std.c.private.strdup

函数

第 11976 行

pub extern "c" fn strdup(s: [*:0]const c_char) ?[*:0]c_char

参数

s: [*:0]const c_char

std.c.private.swab

函数

第 11981 行

pub extern "c" fn swab(noalias from: *const anyopaque, noalias to: *anyopaque, n: isize) void

参数

from: *const anyopaque
to: *anyopaque
n: isize

std.c.private.sysconf

函数

第 12020 行

extern "c" fn sysconf(sc: c_int) c_long

参数

sc: c_int

std.c.private.wait4

函数

第 12022 行

extern "c" fn wait4(pid: pid_t, status: ?*c_int, options: c_int, ru: ?*rusage) pid_t

参数

pid: pid_t
status: ?*c_int
options: c_int
ru: ?*rusage

std.c.private.wcsdup

函数

第 11978 行

pub extern "c" fn wcsdup(s: [*:0]const wchar_t) ?[*:0]wchar_t

参数

s: [*:0]const wchar_t

std.c.prlimit

函数

第 10850 行

pub extern "c" fn prlimit(pid: pid_t, resource: rlimit_resource, new_limit: *const rlimit, old_limit: *rlimit) c_int

参数

pid: pid_t
resource: rlimit_resource
new_limit: *const rlimit
old_limit: *rlimit

std.c.procfs

别名

第 11642 行

别名目标 std.c.illumos.procfs

std.c.profiling_disable

别名

第 11964 行

别名目标 std.c.serenity.profiling_disable

std.c.profiling_enable

别名

第 11963 行

别名目标 std.c.serenity.profiling_enable

std.c.profiling_free_buffer

别名

第 11965 行

别名目标 std.c.serenity.profiling_free_buffer

std.c.projid_t

别名

第 11643 行

别名目标 std.c.illumos.projid_t

std.c.PROT

类型

第 2009 行

基本内存保护标志

std.c.PT

别名

第 11750 行

别名目标 std.c.darwin.PT

std.c.pthread_atfork

函数

第 11254 行

pub extern "c" fn pthread_atfork( prepare: ?*const fn () callconv(.c) void, parent: ?*const fn () callconv(.c) void, child: ?*const fn () callconv(.c) void, ) c_int

参数

prepare: ?*const fn () callconv(.c) void
parent: ?*const fn () callconv(.c) void
child: ?*const fn () callconv(.c) void

std.c.pthread_attr_destroy

函数

第 11250 行

pub extern "c" fn pthread_attr_destroy(attr: *pthread_attr_t) E

参数

std.c.pthread_attr_get_qos_class_np

别名

第 11869 行

别名目标 std.c.darwin.pthread_attr_get_qos_class_np

std.c.pthread_attr_init

函数

第 11246 行

pub extern "c" fn pthread_attr_init(attr: *pthread_attr_t) E

参数

std.c.pthread_attr_set_qos_class_np

别名

第 11870 行

别名目标 std.c.darwin.pthread_attr_set_qos_class_np

std.c.pthread_attr_setguardsize

函数

第 11249 行

pub extern "c" fn pthread_attr_setguardsize(attr: *pthread_attr_t, guardsize: usize) E

参数

attr: *pthread_attr_t
guardsize: usize

std.c.pthread_attr_setstack

函数

第 11247 行

pub extern "c" fn pthread_attr_setstack(attr: *pthread_attr_t, stackaddr: *anyopaque, stacksize: usize) E

参数

attr: *pthread_attr_t
stackaddr: *anyopaque
stacksize: usize

std.c.pthread_attr_setstacksize

函数

第 11248 行

pub extern "c" fn pthread_attr_setstacksize(attr: *pthread_attr_t, stacksize: usize) E

参数

attr: *pthread_attr_t
stacksize: usize

std.c.pthread_attr_t

类型

第 8339 行

std.c.pthread_cancel

函数

第 11245 行

pub extern "c" fn pthread_cancel(pthread_t) E

参数

pthread_cancel: pthread_t

std.c.pthread_cancelstate

类型

第 11229 行

std.c.pthread_cond_broadcast

函数

第 11405 行

pub extern "c" fn pthread_cond_broadcast(cond: *pthread_cond_t) E

参数

std.c.pthread_cond_destroy

函数

第 11406 行

pub extern "c" fn pthread_cond_destroy(cond: *pthread_cond_t) E

参数

std.c.PTHREAD_COND_INITIALIZER

常量

第 11401 行

pthread_cond_t

std.c.pthread_cond_signal

函数

第 11404 行

pub extern "c" fn pthread_cond_signal(cond: *pthread_cond_t) E

参数

std.c.pthread_cond_t

类型

第 8229 行

std.c.pthread_cond_t.data_len

常量

第 8236 行

std.c.pthread_cond_timedwait

函数

第 11403 行

pub extern "c" fn pthread_cond_timedwait(noalias cond: *pthread_cond_t, noalias mutex: *pthread_mutex_t, noalias abstime: *const timespec) E

参数

cond: *pthread_cond_t
mutex: *pthread_mutex_t
abstime: *const timespec

std.c.pthread_cond_wait

函数

第 11402 行

pub extern "c" fn pthread_cond_wait(noalias cond: *pthread_cond_t, noalias mutex: *pthread_mutex_t) E

参数

std.c.pthread_create

函数

第 11223 行

pub extern "c" fn pthread_create( noalias newthread: *pthread_t, noalias attr: ?*const pthread_attr_t, start_routine: *const fn (?*anyopaque) callconv(.c) ?*anyopaque, noalias arg: ?*anyopaque, ) E

参数

newthread: *pthread_t
attr: ?*const pthread_attr_t
start_routine: *const fn (?*anyopaque) callconv(.c) ?*anyopaque
arg: ?*anyopaque

std.c.pthread_detach

函数

第 11253 行

pub extern "c" fn pthread_detach(thread: pthread_t) E

参数

thread: pthread_t

std.c.pthread_exit

函数

第 11276 行

pub extern "c" fn pthread_exit(ptr: ?*anyopaque) noreturn

参数

ptr: ?*anyopaque

std.c.pthread_get_name_np

函数

第 11520 行

pub extern "c" fn pthread_get_name_np(thread: pthread_t, name: [*:0]u8, len: usize) void

参数

thread: pthread_t
name: [*:0]u8
len: usize

std.c.pthread_get_qos_class_np

别名

第 11871 行

别名目标 std.c.darwin.pthread_get_qos_class_np

std.c.pthread_getname_np

函数

第 11274 行

pub extern "c" fn pthread_getname_np(thread: pthread_t, name: [*:0]u8, len: usize) c_int

参数

thread: pthread_t
name: [*:0]u8
len: usize

std.c.pthread_getspecific

函数

第 11264 行

pub extern "c" fn pthread_getspecific(key: pthread_key_t) ?*anyopaque

参数

std.c.pthread_getthreadid_np

函数

第 11518 行

pub extern "c" fn pthread_getthreadid_np() c_int

std.c.pthread_join

函数

第 11252 行

pub extern "c" fn pthread_join(thread: pthread_t, arg_return: ?*?*anyopaque) E

参数

thread: pthread_t
arg_return: ?*?*anyopaque

std.c.pthread_key_create

函数

第 11259 行

pub extern "c" fn pthread_key_create( key: *pthread_key_t, destructor: ?*const fn (value: *anyopaque) callconv(.c) void, ) E

参数

key: *pthread_key_t
destructor: ?*const fn (value: *anyopaque) callconv(.c) void

std.c.pthread_key_delete

函数

第 11263 行

pub extern "c" fn pthread_key_delete(key: pthread_key_t) E

参数

std.c.pthread_key_t

类型

第 8370 行

std.c.pthread_kill

函数

第 11275 行

pub extern "c" fn pthread_kill(pthread_t, signal: SIG) c_int

参数

pthread_kill: pthread_t
signal: SIG

std.c.pthread_mutex_destroy

函数

第 11399 行

pub extern "c" fn pthread_mutex_destroy(mutex: *pthread_mutex_t) E

参数

mutex: *pthread_mutex_t

std.c.PTHREAD_MUTEX_INITIALIZER

常量

第 11395 行

pthread_mutex_t

std.c.pthread_mutex_lock

函数

第 11396 行

pub extern "c" fn pthread_mutex_lock(mutex: *pthread_mutex_t) E

参数

mutex: *pthread_mutex_t

std.c.pthread_mutex_t

类型

第 8160 行

std.c.pthread_mutex_t.data_len

常量

第 8164 行

std.c.pthread_mutex_t.data_len

常量

第 8180 行

std.c.pthread_mutex_trylock

函数

第 11398 行

pub extern "c" fn pthread_mutex_trylock(mutex: *pthread_mutex_t) E

参数

mutex: *pthread_mutex_t

std.c.pthread_mutex_unlock

函数

第 11397 行

pub extern "c" fn pthread_mutex_unlock(mutex: *pthread_mutex_t) E

参数

mutex: *pthread_mutex_t

std.c.PTHREAD_PROCESS_PRIVATE

常量

第 11382 行

c_int

std.c.PTHREAD_PROCESS_SHARED

常量

第 11387 行

c_int

std.c.pthread_rwlock_destroy

函数

第 11408 行

pub extern "c" fn pthread_rwlock_destroy(rwl: *pthread_rwlock_t) callconv(.c) E

参数

std.c.pthread_rwlock_rdlock

函数

第 11409 行

pub extern "c" fn pthread_rwlock_rdlock(rwl: *pthread_rwlock_t) callconv(.c) E

参数

std.c.pthread_rwlock_t

类型

第 8277 行

std.c.pthread_rwlock_tryrdlock

函数

第 11411 行

pub extern "c" fn pthread_rwlock_tryrdlock(rwl: *pthread_rwlock_t) callconv(.c) E

参数

std.c.pthread_rwlock_trywrlock

函数

第 11412 行

pub extern "c" fn pthread_rwlock_trywrlock(rwl: *pthread_rwlock_t) callconv(.c) E

参数

std.c.pthread_rwlock_unlock

函数

第 11413 行

pub extern "c" fn pthread_rwlock_unlock(rwl: *pthread_rwlock_t) callconv(.c) E

参数

std.c.pthread_rwlock_wrlock

函数

第 11410 行

pub extern "c" fn pthread_rwlock_wrlock(rwl: *pthread_rwlock_t) callconv(.c) E

参数

std.c.pthread_self

函数

第 11251 行

pub extern "c" fn pthread_self() pthread_t

std.c.pthread_set_name_np

函数

第 11519 行

pub extern "c" fn pthread_set_name_np(thread: pthread_t, name: [*:0]const u8) void

参数

thread: pthread_t
name: [*:0]const u8

std.c.pthread_set_qos_class_self_np

别名

第 11872 行

别名目标 std.c.darwin.pthread_set_qos_class_self_np

std.c.pthread_setcancelstate

函数

第 11244 行

pub extern "c" fn pthread_setcancelstate(pthread_cancelstate, ?*pthread_cancelstate) E

参数

pthread_setcancelstate: pthread_cancelstate
pthread_cancelstate: ?*pthread_cancelstate

std.c.pthread_setname_np

常量

第 11267 行

std.c.pthread_setspecific

函数

第 11265 行

pub extern "c" fn pthread_setspecific(key: pthread_key_t, value: ?*anyopaque) c_int

参数

key: pthread_key_t
value: ?*anyopaque

std.c.pthread_sigmask

函数

第 11266 行

pub extern "c" fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *sigset_t) c_int

参数

how: c_int
set: *const sigset_t
oldset: *sigset_t

std.c.pthread_spin_destroy

函数

第 11393 行

pub extern "c" fn pthread_spin_destroy(spin: *pthread_spinlock_t) c_int

参数

std.c.pthread_spin_init

函数

第 11389 行

pub extern "c" fn pthread_spin_init(spin: *pthread_spinlock_t, pshared: c_int) c_int

参数

spin: *pthread_spinlock_t
pshared: c_int

std.c.pthread_spin_lock

函数

第 11390 行

pub extern "c" fn pthread_spin_lock(spin: *pthread_spinlock_t) c_int

参数

std.c.pthread_spin_t

类型

第 8387 行

std.c.pthread_spin_trylock

函数

第 11392 行

pub extern "c" fn pthread_spin_trylock(spin: *pthread_spinlock_t) c_int

参数

std.c.pthread_spin_unlock

函数

第 11391 行

pub extern "c" fn pthread_spin_unlock(spin: *pthread_spinlock_t) c_int

参数

std.c.pthread_spinlock_t

类型

第 8146 行

std.c.PTHREAD_STACK_MIN

别名

第 11675 行

别名目标 std.c.openbsd.PTHREAD_STACK_MIN

std.c.pthread_t

类型

第 11415 行

std.c.pthread_threadid_np

常量

第 11278 行

std.c.ptrace

常量

第 11285 行

std.c.purge

别名

第 11966 行

别名目标 std.c.serenity.purge

std.c.pw_dup

别名

第 11726 行

别名目标 std.c.openbsd.pw_dup

std.c.pwrite

函数

第 11080 行

pub extern "c" fn pwrite(fd: fd_t, buf: [*]const u8, nbyte: usize, offset: off_t) isize

参数

fd: fd_t
buf: [*]const u8
nbyte: usize
offset: off_t

std.c.pwrite64

函数

第 10636 行

pub extern "c" fn pwrite64(fd: fd_t, buf: [*]const u8, nbyte: usize, offset: i64) isize

参数

fd: fd_t
buf: [*]const u8
nbyte: usize
offset: i64

std.c.pwritev

函数

第 11078 行

pub extern "c" fn pwritev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint, offset: off_t) isize

参数

fd: c_int
iov: [*]const iovec_const
iovcnt: c_uint
offset: off_t

std.c.pwritev64

函数

第 10637 行

pub extern "c" fn pwritev64(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint, offset: i64) isize

参数

fd: c_int
iov: [*]const iovec_const
iovcnt: c_uint
offset: i64

std.c.qos_class_t

别名

第 11873 行

别名目标 std.c.darwin.qos_class_t

std.c.R_OK

常量

第 1256 行

测试读取权限。

std.c.raise

函数

第 11072 行

pub extern "c" fn raise(sig: SIG) c_int

参数

sig: SIG

std.c.read

函数

第 11073 行

pub extern "c" fn read(fd: fd_t, buf: [*]u8, nbyte: usize) isize

参数

fd: fd_t
buf: [*]u8
nbyte: usize

std.c.readdir

常量

第 10918 行

std.c.readlink

函数

第 11132 行

pub extern "c" fn readlink(noalias path: [*:0]const u8, noalias buf: [*]u8, bufsize: usize) isize

参数

path: [*:0]const u8
buf: [*]u8
bufsize: usize

std.c.readlinkat

函数

第 11133 行

pub extern "c" fn readlinkat(dirfd: fd_t, noalias path: [*:0]const u8, noalias buf: [*]u8, bufsize: usize) isize

参数

dirfd: fd_t
path: [*:0]const u8
buf: [*]u8
bufsize: usize

std.c.readv

函数

第 11074 行

pub extern "c" fn readv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint) isize

参数

fd: c_int
iov: [*]const iovec
iovcnt: c_uint

std.c.readv_pos

别名

第 11665 行

别名目标 std.c.haiku.readv_pos

std.c.realloc

函数

第 11214 行

pub extern "c" fn realloc(?*anyopaque, usize) ?*anyopaque

参数

realloc: ?*anyopaque
anyopaque: usize

std.c.realpath

常量

第 10927 行

std.c.recv

函数

第 11174 行

pub extern "c" fn recv( sockfd: fd_t, arg1: ?*anyopaque, arg2: usize, arg3: c_int, ) if (native_os == .windows) c_int else isize

参数

sockfd: fd_t
arg1: ?*anyopaque
arg2: usize
arg3: c_int

std.c.recvfrom

函数

第 11180 行

pub extern "c" fn recvfrom( sockfd: fd_t, noalias buf: *anyopaque, len: usize, flags: u32, noalias src_addr: ?*sockaddr, noalias addrlen: ?*socklen_t, ) if (native_os == .windows) c_int else isize

参数

sockfd: fd_t
buf: *anyopaque
len: usize
flags: u32
src_addr: ?*sockaddr
addrlen: ?*socklen_t

std.c.recvmsg

常量

第 11189 行

std.c.remque

函数

第 11572 行

pub extern "c" fn remque(element: *anyopaque) void

参数

element: *anyopaque

std.c.rename

函数

第 11123 行

pub extern "c" fn rename(old: [*:0]const u8, new: [*:0]const u8) c_int

参数

old: [*:0]const u8
new: [*:0]const u8

std.c.renameat

函数

第 11124 行

pub extern "c" fn renameat(olddirfd: fd_t, old: [*:0]const u8, newdirfd: fd_t, new: [*:0]const u8) c_int

参数

olddirfd: fd_t
old: [*:0]const u8
newdirfd: fd_t
new: [*:0]const u8

std.c.renameatx_np

别名

第 11798 行

别名目标 std.c.darwin.renameatx_np

std.c.rewinddir

函数

第 10570 行

pub extern "c" fn rewinddir(dp: *DIR) void

参数

dp: *DIR

std.c.rint

函数

第 11614 行

pub extern "c" fn rint(x: f64) f64

参数

x: f64

std.c.rintf

函数

第 11613 行

pub extern "c" fn rintf(x: f32) f32

参数

x: f32

std.c.rintl

函数

第 11615 行

pub extern "c" fn rintl(x: c_longdouble) c_longdouble

参数

x: c_longdouble

std.c.RLIM

类型

第 2023 行

std.c.rlim_t

类型

第 4548 行

std.c.RLIM.INFINITY

常量

第 2029 行

无限制

rlim_t

std.c.RLIM.INFINITY

常量

第 2036 行

无限制

rlim_t

std.c.RLIM.SAVED_CUR

别名

第 2032 行

别名目标 std.c.RLIM.INFINITY

std.c.RLIM.SAVED_CUR

常量

第 2038 行

rlim_t

std.c.RLIM.SAVED_MAX

别名

第 2031 行

别名目标 std.c.RLIM.INFINITY

std.c.RLIM.SAVED_MAX

常量

第 2037 行

rlim_t

std.c.rlimit

类型

第 4557 行

std.c.rlimit_resource

类型

第 4568 行

std.c.rlimit_resource.AS

常量

第 4583 行

rlimit_resource

std.c.rlimit_resource.AS

常量

第 4603 行

rlimit_resource

std.c.rlimit_resource.AS

常量

第 4615 行

rlimit_resource

std.c.rlimit_resource.AS

常量

第 4632 行

rlimit_resource

std.c.rlimit_resource.AS

常量

第 4649 行

rlimit_resource

std.c.rmdir

函数

第 11141 行

pub extern "c" fn rmdir(path: [*:0]const u8) c_int

参数

path: [*:0]const u8

std.c.RTLD

类型

第 7352 行

std.c.rusage

类型

第 4675 行

std.c.rusage.CHILDREN

常量

第 4697 行

std.c.rusage.CHILDREN

常量

第 4718 行

std.c.rusage.CHILDREN

常量

第 4741 行

std.c.rusage.CHILDREN

常量

第 4762 行

std.c.rusage.CHILDREN

常量

第 4784 行

std.c.rusage.SELF

常量

第 4696 行

std.c.rusage.SELF

常量

第 4717 行

std.c.rusage.SELF

常量

第 4740 行

std.c.rusage.SELF

常量

第 4761 行

std.c.rusage.SELF

常量

第 4783 行

std.c.rusage.THREAD

常量

第 4719 行

std.c.rusage.THREAD

常量

第 4763 行

std.c.S

类型

第 2042 行

std.c.S.BLKSIZE

常量

第 2363 行

std.c.S.BLKSIZE

常量

第 2484 行

std.c.S.IEXEC

别名

第 2360 行

别名目标 std.c.S.IXUSR

std.c.S.IEXEC

别名

第 2533 行

别名目标 std.c.S.IXUSR

std.c.S.IFBLK

常量

第 2047 行

std.c.S.IFBLK

常量

第 2090 行

std.c.S.IFBLK

常量

第 2150 行

std.c.S.IFBLK

常量

第 2210 行

std.c.S.IFBLK

常量

第 2277 行

std.c.S.IFBLK

常量

第 2337 行

std.c.S.IFBLK

常量

第 2402 行

std.c.S.IFBLK

常量

第 2463 行

std.c.S.IFBLK

常量

第 2519 行

std.c.S.IFCHR

常量

第 2048 行

std.c.S.IFCHR

常量

第 2088 行

std.c.S.IFCHR

常量

第 2148 行

std.c.S.IFCHR

常量

第 2208 行

std.c.S.IFCHR

常量

第 2275 行

std.c.S.IFCHR

常量

第 2335 行

std.c.S.IFCHR

常量

第 2404 行

std.c.S.IFCHR

常量

第 2461 行

std.c.S.IFCHR

常量

第 2518 行

std.c.S.IFDIR

常量

第 2049 行

std.c.S.IFDIR

常量

第 2089 行

std.c.S.IFDIR

常量

第 2149 行

std.c.S.IFDIR

常量

第 2209 行

std.c.S.IFDIR

常量

第 2276 行

std.c.S.IFDIR

常量

第 2336 行

std.c.S.IFDIR

常量

第 2403 行

std.c.S.IFDIR

常量

第 2462 行

std.c.S.IFDIR

常量

第 2517 行

std.c.S.IFDOOR

常量

第 2215 行

SunOS 2.6 的 Door

std.c.S.IFIFO

常量

第 2050 行

std.c.S.IFIFO

常量

第 2087 行

std.c.S.IFIFO

常量

第 2147 行

std.c.S.IFIFO

常量

第 2207 行

std.c.S.IFIFO

常量

第 2274 行

std.c.S.IFIFO

常量

第 2334 行

std.c.S.IFIFO

常量

第 2405 行

std.c.S.IFIFO

常量

第 2460 行

std.c.S.IFIFO

常量

第 2521 行

std.c.S.IFLNK

常量

第 2051 行

std.c.S.IFLNK

常量

第 2092 行

std.c.S.IFLNK

常量

第 2152 行

std.c.S.IFLNK

常量

第 2212 行

std.c.S.IFLNK

常量

第 2279 行

std.c.S.IFLNK

常量

第 2339 行

std.c.S.IFLNK

常量

第 2400 行

std.c.S.IFLNK

常量

第 2465 行

std.c.S.IFLNK

常量

第 2522 行

std.c.S.IFMT

常量

第 2052 行

std.c.S.IFMT

常量

第 2085 行

std.c.S.IFMT

常量

第 2145 行

std.c.S.IFMT

常量

第 2205 行

std.c.S.IFMT

常量

第 2272 行

std.c.S.IFMT

常量

第 2332 行

std.c.S.IFMT

常量

第 2398 行

std.c.S.IFMT

常量

第 2458 行

std.c.S.IFMT

常量

第 2516 行

std.c.S.IFPORT

常量

第 2217 行

Solaris 10 事件端口

std.c.S.IFREG

常量

第 2053 行

std.c.S.IFREG

常量

第 2091 行

std.c.S.IFREG

常量

第 2151 行

std.c.S.IFREG

常量

第 2211 行

std.c.S.IFREG

常量

第 2278 行

std.c.S.IFREG

常量

第 2338 行

std.c.S.IFREG

常量

第 2401 行

std.c.S.IFREG

常量

第 2464 行

std.c.S.IFREG

常量

第 2520 行

std.c.S.IFSOCK

常量

第 2054 行

std.c.S.IFSOCK

常量

第 2093 行

std.c.S.IFSOCK

常量

第 2153 行

std.c.S.IFSOCK

常量

第 2213 行

std.c.S.IFSOCK

常量

第 2280 行

std.c.S.IFSOCK

常量

第 2340 行

std.c.S.IFSOCK

常量

第 2399 行

std.c.S.IFSOCK

常量

第 2466 行

std.c.S.IFSOCK

常量

第 2523 行

std.c.S.IFWHT

常量

第 2094 行

std.c.S.IFWHT

常量

第 2154 行

std.c.S.IFWHT

常量

第 2281 行

std.c.S.IFWHT

常量

第 2341 行

std.c.S.INDEX_DIR

常量

第 2406 行

std.c.S.IREAD

别名

第 2359 行

别名目标 std.c.S.IRUSR

std.c.S.IREAD

别名

第 2531 行

别名目标 std.c.S.IRUSR

std.c.S.IRGRP

常量

第 2104 行

std.c.S.IRGRP

常量

第 2164 行

std.c.S.IRGRP

常量

第 2227 行

std.c.S.IRGRP

常量

第 2291 行

std.c.S.IRGRP

常量

第 2351 行

std.c.S.IRGRP

常量

第 2417 行

std.c.S.IRGRP

常量

第 2476 行

std.c.S.IRGRP

常量

第 2534 行

std.c.S.IROTH

常量

第 2108 行

std.c.S.IROTH

常量

第 2168 行

std.c.S.IROTH

常量

第 2231 行

std.c.S.IROTH

常量

第 2295 行

std.c.S.IROTH

常量

第 2355 行

std.c.S.IROTH

常量

第 2421 行

std.c.S.IROTH

常量

第 2480 行

std.c.S.IROTH

常量

第 2537 行

std.c.S.IRUSR

常量

第 2100 行

std.c.S.IRUSR

常量

第 2160 行

std.c.S.IRUSR

常量

第 2223 行

std.c.S.IRUSR

常量

第 2287 行

std.c.S.IRUSR

常量

第 2347 行

std.c.S.IRUSR

常量

第 2413 行

std.c.S.IRUSR

常量

第 2472 行

std.c.S.IRUSR

常量

第 2528 行

std.c.S.IRWXG

常量

第 2103 行

std.c.S.IRWXG

常量

第 2163 行

std.c.S.IRWXG

常量

第 2226 行

std.c.S.IRWXG

常量

第 2290 行

std.c.S.IRWXG

常量

第 2350 行

std.c.S.IRWXG

常量

第 2416 行

std.c.S.IRWXG

常量

第 2475 行

std.c.S.IRWXG

常量

第 2543 行

std.c.S.IRWXO

常量

第 2107 行

std.c.S.IRWXO

常量

第 2167 行

std.c.S.IRWXO

常量

第 2230 行

std.c.S.IRWXO

常量

第 2294 行

std.c.S.IRWXO

常量

第 2354 行

std.c.S.IRWXO

常量

第 2420 行

std.c.S.IRWXO

常量

第 2479 行

std.c.S.IRWXO

常量

第 2544 行

std.c.S.IRWXU

常量

第 2099 行

std.c.S.IRWXU

常量

第 2159 行

std.c.S.IRWXU

常量

第 2222 行

std.c.S.IRWXU

常量

第 2286 行

std.c.S.IRWXU

常量

第 2346 行

std.c.S.IRWXU

常量

第 2412 行

std.c.S.IRWXU

常量

第 2471 行

std.c.S.IRWXU

常量

第 2541 行

std.c.S.ISBLK

函数

第 2056 行

pub fn ISBLK(m: u32) bool

参数

m: u32

std.c.S.ISBLK

函数

第 2124 行

pub fn ISBLK(m: u32) bool

参数

m: u32

std.c.S.ISBLK

函数

第 2184 行

pub fn ISBLK(m: u32) bool

参数

m: u32

std.c.S.ISBLK

函数

第 2247 行

pub fn ISBLK(m: u32) bool

参数

m: u32

std.c.S.ISBLK

函数

第 2311 行

pub fn ISBLK(m: u32) bool

参数

m: u32

std.c.S.ISBLK

函数

第 2377 行

pub fn ISBLK(m: u32) bool

参数

m: u32

std.c.S.ISBLK

函数

第 2433 行

pub fn ISBLK(m: u32) bool

参数

m: u32

std.c.S.ISBLK

函数

第 2498 行

pub fn ISBLK(m: u32) bool

参数

m: u32

std.c.S.ISBLK

函数

第 2554 行

pub fn ISBLK(m: u32) bool

参数

m: u32

std.c.S.ISCHR

函数

第 2060 行

pub fn ISCHR(m: u32) bool

参数

m: u32

std.c.S.ISCHR

函数

第 2116 行

pub fn ISCHR(m: u32) bool

参数

m: u32

std.c.S.ISCHR

函数

第 2176 行

pub fn ISCHR(m: u32) bool

参数

m: u32

std.c.S.ISCHR

函数

第 2239 行

pub fn ISCHR(m: u32) bool

参数

m: u32

std.c.S.ISCHR

函数

第 2303 行

pub fn ISCHR(m: u32) bool

参数

m: u32

std.c.S.ISCHR

函数

第 2369 行

pub fn ISCHR(m: u32) bool

参数

m: u32

std.c.S.ISCHR

函数

第 2441 行

pub fn ISCHR(m: u32) bool

参数

m: u32

std.c.S.ISCHR

函数

第 2490 行

pub fn ISCHR(m: u32) bool

参数

m: u32

std.c.S.ISCHR

函数

第 2550 行

pub fn ISCHR(m: u32) bool

参数

m: u32

std.c.S.ISDIR

函数

第 2064 行

pub fn ISDIR(m: u32) bool

参数

m: u32

std.c.S.ISDIR

函数

第 2120 行

pub fn ISDIR(m: u32) bool

参数

m: u32

std.c.S.ISDIR

函数

第 2180 行

pub fn ISDIR(m: u32) bool

参数

m: u32

std.c.S.ISDIR

函数

第 2243 行

pub fn ISDIR(m: u32) bool

参数

m: u32

std.c.S.ISDIR

函数

第 2307 行

pub fn ISDIR(m: u32) bool

参数

m: u32

std.c.S.ISDIR

函数

第 2373 行

pub fn ISDIR(m: u32) bool

参数

m: u32

std.c.S.ISDIR

函数

第 2437 行

pub fn ISDIR(m: u32) bool

参数

m: u32

std.c.S.ISDIR

函数

第 2494 行

pub fn ISDIR(m: u32) bool

参数

m: u32

std.c.S.ISDIR

函数

第 2546 行

pub fn ISDIR(m: u32) bool

参数

m: u32

std.c.S.ISDOOR

函数

第 2263 行

pub fn ISDOOR(m: u32) bool

参数

m: u32

std.c.S.ISFIFO

函数

第 2068 行

pub fn ISFIFO(m: u32) bool

参数

m: u32

std.c.S.ISFIFO

函数

第 2112 行

pub fn ISFIFO(m: u32) bool

参数

m: u32

std.c.S.ISFIFO

函数

第 2172 行

pub fn ISFIFO(m: u32) bool

参数

m: u32

std.c.S.ISFIFO

函数

第 2235 行

pub fn ISFIFO(m: u32) bool

参数

m: u32

std.c.S.ISFIFO

函数

第 2299 行

pub fn ISFIFO(m: u32) bool

参数

m: u32

std.c.S.ISFIFO

函数

第 2365 行

pub fn ISFIFO(m: u32) bool

参数

m: u32

std.c.S.ISFIFO

函数

第 2445 行

pub fn ISFIFO(m: u32) bool

参数

m: u32

std.c.S.ISFIFO

函数

第 2486 行

pub fn ISFIFO(m: u32) bool

参数

m: u32

std.c.S.ISFIFO

函数

第 2562 行

pub fn ISFIFO(m: u32) bool

参数

m: u32

std.c.S.ISGID

常量

第 2097 行

std.c.S.ISGID

常量

第 2157 行

std.c.S.ISGID

常量

第 2220 行

std.c.S.ISGID

常量

第 2284 行

std.c.S.ISGID

常量

第 2344 行

std.c.S.ISGID

常量

第 2410 行

std.c.S.ISGID

常量

第 2469 行

std.c.S.ISGID

常量

第 2526 行

std.c.S.ISINDEX

函数

第 2453 行

pub fn ISINDEX(m: u32) bool

参数

m: u32

std.c.S.ISLNK

函数

第 2072 行

pub fn ISLNK(m: u32) bool

参数

m: u32

std.c.S.ISLNK

函数

第 2132 行

pub fn ISLNK(m: u32) bool

参数

m: u32

std.c.S.ISLNK

函数

第 2192 行

pub fn ISLNK(m: u32) bool

参数

m: u32

std.c.S.ISLNK

函数

第 2255 行

pub fn ISLNK(m: u32) bool

参数

m: u32

std.c.S.ISLNK

函数

第 2319 行

pub fn ISLNK(m: u32) bool

参数

m: u32

std.c.S.ISLNK

函数

第 2385 行

pub fn ISLNK(m: u32) bool

参数

m: u32

std.c.S.ISLNK

函数

第 2429 行

pub fn ISLNK(m: u32) bool

参数

m: u32

std.c.S.ISLNK

函数

第 2506 行

pub fn ISLNK(m: u32) bool

参数

m: u32

std.c.S.ISLNK

函数

第 2566 行

pub fn ISLNK(m: u32) bool

参数

m: u32

std.c.S.ISPORT

函数

第 2267 行

pub fn ISPORT(m: u32) bool

参数

m: u32

std.c.S.ISREG

函数

第 2076 行

pub fn ISREG(m: u32) bool

参数

m: u32

std.c.S.ISREG

函数

第 2128 行

pub fn ISREG(m: u32) bool

参数

m: u32

std.c.S.ISREG

函数

第 2188 行

pub fn ISREG(m: u32) bool

参数

m: u32

std.c.S.ISREG

函数

第 2251 行

pub fn ISREG(m: u32) bool

参数

m: u32

std.c.S.ISREG

函数

第 2315 行

pub fn ISREG(m: u32) bool

参数

m: u32

std.c.S.ISREG

函数

第 2381 行

pub fn ISREG(m: u32) bool

参数

m: u32

std.c.S.ISREG

函数

第 2425 行

pub fn ISREG(m: u32) bool

参数

m: u32

std.c.S.ISREG

函数

第 2502 行

pub fn ISREG(m: u32) bool

参数

m: u32

std.c.S.ISREG

函数

第 2558 行

pub fn ISREG(m: u32) bool

参数

m: u32

std.c.S.ISSOCK

函数

第 2080 行

pub fn ISSOCK(m: u32) bool

参数

m: u32

std.c.S.ISSOCK

函数

第 2136 行

pub fn ISSOCK(m: u32) bool

参数

m: u32

std.c.S.ISSOCK

函数

第 2196 行

pub fn ISSOCK(m: u32) bool

参数

m: u32

std.c.S.ISSOCK

函数

第 2259 行

pub fn ISSOCK(m: u32) bool

参数

m: u32

std.c.S.ISSOCK

函数

第 2323 行

pub fn ISSOCK(m: u32) bool

参数

m: u32

std.c.S.ISSOCK

函数

第 2389 行

pub fn ISSOCK(m: u32) bool

参数

m: u32

std.c.S.ISSOCK

函数

第 2449 行

pub fn ISSOCK(m: u32) bool

参数

m: u32

std.c.S.ISSOCK

函数

第 2510 行

pub fn ISSOCK(m: u32) bool

参数

m: u32

std.c.S.ISSOCK

函数

第 2570 行

pub fn ISSOCK(m: u32) bool

参数

m: u32

std.c.S.ISTXT

常量

第 2362 行

std.c.S.ISUID

常量

第 2096 行

std.c.S.ISUID

常量

第 2156 行

std.c.S.ISUID

常量

第 2219 行

std.c.S.ISUID

常量

第 2283 行

std.c.S.ISUID

常量

第 2343 行

std.c.S.ISUID

常量

第 2409 行

std.c.S.ISUID

常量

第 2468 行

std.c.S.ISUID

常量

第 2525 行

std.c.S.ISVTX

常量

第 2098 行

std.c.S.ISVTX

常量

第 2158 行

std.c.S.ISVTX

常量

第 2221 行

std.c.S.ISVTX

常量

第 2285 行

std.c.S.ISVTX

常量

第 2345 行

std.c.S.ISVTX

常量

第 2411 行

std.c.S.ISVTX

常量

第 2470 行

std.c.S.ISVTX

常量

第 2527 行

std.c.S.IUMSK

常量

第 2408 行

std.c.S.IWGRP

常量

第 2105 行

std.c.S.IWGRP

常量

第 2165 行

std.c.S.IWGRP

常量

第 2228 行

std.c.S.IWGRP

常量

第 2292 行

std.c.S.IWGRP

常量

第 2352 行

std.c.S.IWGRP

常量

第 2418 行

std.c.S.IWGRP

常量

第 2477 行

std.c.S.IWGRP

常量

第 2535 行

std.c.S.IWHT

函数

第 2140 行

pub fn IWHT(m: u32) bool

参数

m: u32

std.c.S.IWHT

函数

第 2200 行

pub fn IWHT(m: u32) bool

参数

m: u32

std.c.S.IWHT

函数

第 2327 行

pub fn IWHT(m: u32) bool

参数

m: u32

std.c.S.IWHT

函数

第 2393 行

pub fn IWHT(m: u32) bool

参数

m: u32

std.c.S.IWOTH

常量

第 2109 行

std.c.S.IWOTH

常量

第 2169 行

std.c.S.IWOTH

常量

第 2232 行

std.c.S.IWOTH

常量

第 2296 行

std.c.S.IWOTH

常量

第 2356 行

std.c.S.IWOTH

常量

第 2422 行

std.c.S.IWOTH

常量

第 2481 行

std.c.S.IWOTH

常量

第 2538 行

std.c.S.IWRITE

别名

第 2361 行

别名目标 std.c.S.IWUSR

std.c.S.IWRITE

别名

第 2532 行

别名目标 std.c.S.IWUSR

std.c.S.IWUSR

常量

第 2101 行

std.c.S.IWUSR

常量

第 2161 行

std.c.S.IWUSR

常量

第 2224 行

std.c.S.IWUSR

常量

第 2288 行

std.c.S.IWUSR

常量

第 2348 行

std.c.S.IWUSR

常量

第 2414 行

std.c.S.IWUSR

常量

第 2473 行

std.c.S.IWUSR

常量

第 2529 行

std.c.S.IXGRP

常量

第 2106 行

std.c.S.IXGRP

常量

第 2166 行

std.c.S.IXGRP

常量

第 2229 行

std.c.S.IXGRP

常量

第 2293 行

std.c.S.IXGRP

常量

第 2353 行

std.c.S.IXGRP

常量

第 2419 行

std.c.S.IXGRP

常量

第 2478 行

std.c.S.IXGRP

常量

第 2536 行

std.c.S.IXOTH

常量

第 2110 行

std.c.S.IXOTH

常量

第 2170 行

std.c.S.IXOTH

常量

第 2233 行

std.c.S.IXOTH

常量

第 2297 行

std.c.S.IXOTH

常量

第 2357 行

std.c.S.IXOTH

常量

第 2423 行

std.c.S.IXOTH

常量

第 2482 行

std.c.S.IXOTH

常量

第 2539 行

std.c.S.IXUSR

常量

第 2102 行

std.c.S.IXUSR

常量

第 2162 行

std.c.S.IXUSR

常量

第 2225 行

std.c.S.IXUSR

常量

第 2289 行

std.c.S.IXUSR

常量

第 2349 行

std.c.S.IXUSR

常量

第 2415 行

std.c.S.IXUSR

常量

第 2474 行

std.c.S.IXUSR

常量

第 2530 行

std.c.SA

类型

第 2576 行

std.c.sa_family_t

类型

第 5409 行

std.c.SA.@"64REGSET"

常量

第 2597 行

带 SIGINFO 参数及 64 位寄存器信息的信号处理程序。

std.c.SA.NOCLDSTOP

常量

第 2587 行

子进程停止时不生成 SIG.CHLD

std.c.SA.NOCLDSTOP

常量

第 2603 行

std.c.SA.NOCLDSTOP

常量

第 2620 行

std.c.SA.NOCLDSTOP

常量

第 2634 行

std.c.SA.NOCLDSTOP

常量

第 2649 行

std.c.SA.NOCLDSTOP

常量

第 2656 行

std.c.SA.NOCLDWAIT

常量

第 2591 行

不要保留僵尸进程

std.c.SA.NOCLDWAIT

常量

第 2605 行

std.c.SA.NOCLDWAIT

常量

第 2614 行

std.c.SA.NOCLDWAIT

常量

第 2622 行

std.c.SA.NOCLDWAIT

常量

第 2630 行

std.c.SA.NOCLDWAIT

常量

第 2635 行

std.c.SA.NOCLDWAIT

常量

第 2651 行

std.c.SA.NOCLDWAIT

常量

第 2657 行

std.c.SA.NODEFER

常量

第 2589 行

不要屏蔽正在传送的信号

std.c.SA.NODEFER

常量

第 2604 行

std.c.SA.NODEFER

常量

第 2613 行

std.c.SA.NODEFER

常量

第 2621 行

std.c.SA.NODEFER

常量

第 2629 行

std.c.SA.NODEFER

常量

第 2637 行

std.c.SA.NODEFER

常量

第 2650 行

std.c.SA.NODEFER

常量

第 2661 行

std.c.SA.NOMASK

别名

第 2641 行

别名目标 std.c.SA.NODEFER

std.c.SA.NOMASK

别名

第 2663 行

别名目标 std.c.SA.NODEFER

std.c.SA.ONESHOT

别名

第 2643 行

别名目标 std.c.SA.RESETHAND

std.c.SA.ONESHOT

别名

第 2664 行

别名目标 std.c.SA.RESETHAND

std.c.SA.ONSTACK

常量

第 2581 行

在信号栈上处理信号

std.c.SA.ONSTACK

常量

第 2600 行

std.c.SA.ONSTACK

常量

第 2609 行

std.c.SA.ONSTACK

常量

第 2617 行

std.c.SA.ONSTACK

常量

第 2626 行

std.c.SA.ONSTACK

常量

第 2639 行

std.c.SA.ONSTACK

常量

第 2646 行

std.c.SA.ONSTACK

常量

第 2659 行

std.c.SA.RESETHAND

常量

第 2585 行

获取信号时重置为 SIG.DFL

std.c.SA.RESETHAND

常量

第 2602 行

std.c.SA.RESETHAND

常量

第 2610 行

std.c.SA.RESETHAND

常量

第 2619 行

std.c.SA.RESETHAND

常量

第 2628 行

std.c.SA.RESETHAND

常量

第 2636 行

std.c.SA.RESETHAND

常量

第 2648 行

std.c.SA.RESETHAND

常量

第 2662 行

std.c.SA.RESTART

常量

第 2583 行

信号返回时重启系统调用

std.c.SA.RESTART

常量

第 2601 行

std.c.SA.RESTART

常量

第 2611 行

std.c.SA.RESTART

常量

第 2618 行

std.c.SA.RESTART

常量

第 2627 行

std.c.SA.RESTART

常量

第 2638 行

std.c.SA.RESTART

常量

第 2647 行

std.c.SA.RESTART

常量

第 2660 行

std.c.SA.SIGINFO

常量

第 2593 行

带 SIGINFO 参数的信号处理程序

std.c.SA.SIGINFO

常量

第 2606 行

std.c.SA.SIGINFO

常量

第 2612 行

std.c.SA.SIGINFO

常量

第 2623 行

std.c.SA.SIGINFO

常量

第 2631 行

std.c.SA.SIGINFO

常量

第 2640 行

std.c.SA.SIGINFO

常量

第 2652 行

std.c.SA.SIGINFO

常量

第 2658 行

std.c.SA.STACK

别名

第 2642 行

别名目标 std.c.SA.ONSTACK

std.c.SA.USERTRAMP

常量

第 2595 行

不经过内核的 sigtramp 跳板

std.c.SC

类型

第 2676 行

std.c.sched_getaffinity

函数

第 10664 行

pub extern "c" fn sched_getaffinity(pid: c_int, size: usize, set: *cpu_set_t) c_int

参数

pid: c_int
size: usize
set: *cpu_set_t

std.c.sched_yield

常量

第 10932 行

std.c.SCM

类型

第 7156 行

std.c.SCM.BINTIME

常量

第 7178 行

std.c.SCM.CREDS

常量

第 7177 行

std.c.SCM.CREDS

常量

第 7188 行

std.c.SCM.CREDS

常量

第 7194 行

std.c.SCM.CREDS

常量

第 7205 行

std.c.SCM.CREDS2

常量

第 7182 行

std.c.SCM.MONOTONIC

常量

第 7180 行

std.c.SCM.REALTIME

常量

第 7179 行

std.c.SCM.RIGHTS

常量

第 7160 行

std.c.SCM.RIGHTS

常量

第 7166 行

std.c.SCM.RIGHTS

常量

第 7171 行

std.c.SCM.RIGHTS

常量

第 7175 行

std.c.SCM.RIGHTS

常量

第 7186 行

std.c.SCM.RIGHTS

常量

第 7192 行

std.c.SCM.RIGHTS

常量

第 7198 行

std.c.SCM.RIGHTS

常量

第 7203 行

std.c.SCM.TIME_INFO

常量

第 7181 行

std.c.SCM.TIMESTAMP

常量

第 7162 行

std.c.SCM.TIMESTAMP

常量

第 7170 行

std.c.SCM.TIMESTAMP

常量

第 7176 行

std.c.SCM.TIMESTAMP

常量

第 7187 行

std.c.SCM.TIMESTAMP

常量

第 7193 行

std.c.SCM.TIMESTAMP

常量

第 7199 行

std.c.SCM.TIMESTAMP

常量

第 7204 行

std.c.SCM.TIMESTAMP_MONOTONIC

常量

第 7206 行

std.c.SCM.UCRED

常量

第 7161 行

std.c.SEEK

类型

第 2736 行

std.c.SEEK.CUR

常量

第 2741 行

wasi.whence_t

std.c.SEEK.CUR

常量

第 2747 行

std.c.SEEK.CUR

常量

第 2752 行

std.c.SEEK.DATA

常量

第 2754 行

std.c.SEEK.END

常量

第 2742 行

wasi.whence_t

std.c.SEEK.END

常量

第 2748 行

std.c.SEEK.END

常量

第 2753 行

std.c.SEEK.HOLE

常量

第 2755 行

std.c.SEEK.SET

常量

第 2740 行

wasi.whence_t

std.c.SEEK.SET

常量

第 2746 行

std.c.SEEK.SET

常量

第 2751 行

std.c.seekdir

函数

第 10573 行

pub extern "c" fn seekdir(dp: *DIR, loc: c_long) void

参数

dp: *DIR
loc: c_long

std.c.sem_close

函数

第 11298 行

pub extern "c" fn sem_close(sem: *sem_t) c_int

参数

sem: *sem_t

std.c.sem_destroy

函数

第 11296 行

pub extern "c" fn sem_destroy(sem: *sem_t) c_int

参数

sem: *sem_t

std.c.sem_getvalue

函数

第 11303 行

pub extern "c" fn sem_getvalue(sem: *sem_t, sval: *c_int) c_int

参数

sem: *sem_t
sval: *c_int

std.c.sem_id

别名

第 11666 行

别名目标 std.c.haiku.sem_id

std.c.sem_init

函数

第 11295 行

pub extern "c" fn sem_init(sem: *sem_t, pshared: c_int, value: c_uint) c_int

参数

sem: *sem_t
pshared: c_int
value: c_uint

std.c.sem_open

函数

第 11297 行

pub extern "c" fn sem_open(name: [*:0]const u8, flag: c_int, mode: mode_t, value: c_uint) *sem_t

参数

name: [*:0]const u8
flag: c_int
mode: mode_t
value: c_uint

std.c.sem_post

函数

第 11299 行

pub extern "c" fn sem_post(sem: *sem_t) c_int

参数

sem: *sem_t

std.c.sem_t

类型

第 8401 行

std.c.sem_timedwait

函数

第 11302 行

pub extern "c" fn sem_timedwait(sem: *sem_t, abs_timeout: *const timespec) c_int

参数

sem: *sem_t
abs_timeout: *const timespec

std.c.sem_trywait

函数

第 11301 行

pub extern "c" fn sem_trywait(sem: *sem_t) c_int

参数

sem: *sem_t

std.c.sem_wait

函数

第 11300 行

pub extern "c" fn sem_wait(sem: *sem_t) c_int

参数

sem: *sem_t

std.c.send

函数

第 11162 行

pub extern "c" fn send(sockfd: fd_t, buf: *const anyopaque, len: usize, flags: u32) isize

参数

sockfd: fd_t
buf: *const anyopaque
len: usize
flags: u32

std.c.sendfile

常量

第 10695 行

std.c.sendfile64

函数

第 10638 行

pub extern "c" fn sendfile64(out_fd: fd_t, in_fd: fd_t, offset: ?*i64, count: usize) isize

参数

out_fd: fd_t
in_fd: fd_t
offset: ?*i64
count: usize

std.c.sendmmsg

函数

第 11172 行

pub extern "c" fn sendmmsg(sockfd: fd_t, msgvec: [*]mmsghdr, n: c_uint, flags: u32) c_int

参数

sockfd: fd_t
msgvec: [*]mmsghdr
n: c_uint
flags: u32

std.c.sendmsg

函数

第 11171 行

pub extern "c" fn sendmsg(sockfd: fd_t, msg: *const msghdr_const, flags: u32) isize

参数

sockfd: fd_t
msg: *const msghdr_const
flags: u32

std.c.sendto

函数

第 11163 行

pub extern "c" fn sendto( sockfd: fd_t, buf: *const anyopaque, len: usize, flags: u32, dest_addr: ?*const sockaddr, addrlen: socklen_t, ) isize

参数

sockfd: fd_t
buf: *const anyopaque
len: usize
flags: u32
dest_addr: ?*const sockaddr
addrlen: socklen_t

std.c.serenity

别名

第 24 行

别名目标 std.c.serenity

std.c.setclasscontext

别名

第 11727 行

别名目标 std.c.openbsd.setclasscontext

std.c.SETCONTEXT

别名

第 11628 行

别名目标 std.c.illumos.SETCONTEXT

std.c.setegid

函数

第 11199 行

pub extern "c" fn setegid(egid: gid_t) c_int

参数

egid: gid_t

std.c.seteuid

函数

第 11198 行

pub extern "c" fn seteuid(euid: uid_t) c_int

参数

euid: uid_t

std.c.setgid

函数

第 11197 行

pub extern "c" fn setgid(gid: gid_t) c_int

参数

gid: gid_t

std.c.setgrent

函数

第 10623 行

pub extern "c" fn setgrent() void

std.c.setkeymap

别名

第 11972 行

别名目标 std.c.serenity.setkeymap

std.c.setlocale

函数

第 11473 行

pub extern "c" fn setlocale(category: LC, locale: ?[*:0]const u8) ?[*:0]const u8

参数

category: LC
locale: ?[*:0]const u8

std.c.setlogmask

函数

第 11445 行

pub extern "c" fn setlogmask(maskpri: c_int) c_int

参数

maskpri: c_int

std.c.setpassent

别名

第 11728 行

别名目标 std.c.openbsd.setpassent

std.c.setpgid

函数

第 11204 行

pub extern "c" fn setpgid(pid: pid_t, pgid: pid_t) c_int

参数

pid: pid_t
pgid: pid_t

std.c.setpwent

函数

第 10617 行

pub extern "c" fn setpwent() void

std.c.setregid

函数

第 11201 行

pub extern "c" fn setregid(rgid: gid_t, egid: gid_t) c_int

参数

rgid: gid_t
egid: gid_t

std.c.setresgid

函数

第 11203 行

pub extern "c" fn setresgid(rgid: gid_t, egid: gid_t, sgid: gid_t) c_int

参数

rgid: gid_t
egid: gid_t
sgid: gid_t

std.c.setresuid

函数

第 11202 行

pub extern "c" fn setresuid(ruid: uid_t, euid: uid_t, suid: uid_t) c_int

参数

ruid: uid_t
euid: uid_t
suid: uid_t

std.c.setreuid

函数

第 11200 行

pub extern "c" fn setreuid(ruid: uid_t, euid: uid_t) c_int

参数

ruid: uid_t
euid: uid_t

std.c.setrlimit

函数

第 11438 行

pub extern "c" fn setrlimit(resource: rlimit_resource, rlim: *const rlimit) c_int

参数

resource: rlimit_resource
rlim: *const rlimit

std.c.setrlimit64

函数

第 10639 行

pub extern "c" fn setrlimit64(resource: rlimit_resource, rlim: *const rlimit) c_int

参数

resource: rlimit_resource
rlim: *const rlimit

std.c.setsid

函数

第 11451 行

pub extern "c" fn setsid() pid_t

std.c.setsockopt

函数

第 11161 行

pub extern "c" fn setsockopt(sockfd: fd_t, level: i32, optname: u32, optval: ?*const anyopaque, optlen: socklen_t) c_int

参数

sockfd: fd_t
level: i32
optname: u32
optval: ?*const anyopaque
optlen: socklen_t

std.c.setuid

函数

第 11196 行

pub extern "c" fn setuid(uid: uid_t) c_int

参数

uid: uid_t

std.c.setusercontext

别名

第 11729 行

别名目标 std.c.openbsd.setusercontext

std.c.SETUSTACK

别名

第 11629 行

别名目标 std.c.illumos.GETUSTACK

std.c.sf_hdtr

类型

第 11034 行

std.c.SFD

别名

第 11630 行

别名目标 std.c.illumos.SFD

std.c.shm_open

常量

第 11305 行

std.c.shm_unlink

函数

第 11309 行

pub extern "c" fn shm_unlink(name: [*:0]const u8) c_int

参数

name: [*:0]const u8

std.c.SHUT

类型

第 2759 行

std.c.SHUT.RD

常量

第 2764 行

std.c.SHUT.RDWR

常量

第 2766 行

std.c.SHUT.WR

常量

第 2765 行

std.c.shutdown

函数

第 11152 行

pub extern "c" fn shutdown(socket: fd_t, how: c_int) c_int

参数

socket: fd_t
how: c_int

std.c.SIG

类型

第 2771 行

信号类型

std.c.sig_atomic_t

类型

第 9928 行

std.c.SIG.ACK

常量

第 2803 行

确认

std.c.SIG.BIT

函数

第 2905 行

pub inline fn BIT(sig: usize) usize

参数

sig: usize

std.c.SIG.BIT

函数

第 2975 行

pub inline fn BIT(sig: usize) usize

参数

sig: usize

std.c.SIG.BIT

函数

第 3050 行

pub inline fn BIT(sig: usize) usize

参数

sig: usize

std.c.SIG.BLOCK

常量

第 2814 行

阻塞指定信号集

std.c.SIG.BLOCK

常量

第 2888 行

std.c.SIG.BLOCK

常量

第 2962 行

std.c.SIG.BLOCK

常量

第 3037 行

std.c.SIG.BLOCK

常量

第 3098 行

std.c.SIG.BLOCK

常量

第 3149 行

std.c.SIG.BLOCK

常量

第 3197 行

std.c.SIG.BLOCK

常量

第 3244 行

std.c.SIG.CATCH

常量

第 3194 行

?Sigaction.handler_fn

std.c.SIG.CLD

常量

第 2984 行

SIG

std.c.SIG.DFL

常量

第 2795 行

默认信号动作

std.c.SIG.DFL

常量

第 2809 行

?Sigaction.handler_fn

std.c.SIG.DFL

常量

第 2892 行

?Sigaction.handler_fn

std.c.SIG.DFL

常量

第 2954 行

?Sigaction.handler_fn

std.c.SIG.DFL

常量

第 3030 行

?Sigaction.handler_fn

std.c.SIG.DFL

常量

第 3094 行

?Sigaction.handler_fn

std.c.SIG.DFL

常量

第 3143 行

?Sigaction.handler_fn

std.c.SIG.DFL

常量

第 3191 行

?Sigaction.handler_fn

std.c.SIG.DFL

常量

第 3240 行

?Sigaction.handler_fn

std.c.SIG.ERR

常量

第 2805 行

信号错误值(signal 调用出错时返回)

std.c.SIG.ERR

常量

第 2808 行

?Sigaction.handler_fn

std.c.SIG.ERR

常量

第 2894 行

?Sigaction.handler_fn

std.c.SIG.ERR

常量

第 2955 行

?Sigaction.handler_fn

std.c.SIG.ERR

常量

第 3032 行

?Sigaction.handler_fn

std.c.SIG.ERR

常量

第 3096 行

?Sigaction.handler_fn

std.c.SIG.ERR

常量

第 3145 行

?Sigaction.handler_fn

std.c.SIG.ERR

常量

第 3193 行

?Sigaction.handler_fn

std.c.SIG.ERR

常量

第 3241 行

?Sigaction.handler_fn

std.c.SIG.GET

常量

第 2799 行

返回当前值

std.c.SIG.HOLD

常量

第 2811 行

?Sigaction.handler_fn

std.c.SIG.HOLD

常量

第 2957 行

?Sigaction.handler_fn

std.c.SIG.HOLD

常量

第 3147 行

?Sigaction.handler_fn

std.c.SIG.HOLD

常量

第 3195 行

?Sigaction.handler_fn

std.c.SIG.IDX

函数

第 2899 行

pub inline fn IDX(sig: usize) usize

参数

sig: usize

std.c.SIG.IDX

函数

第 2969 行

pub inline fn IDX(sig: usize) usize

参数

sig: usize

std.c.SIG.IDX

函数

第 3044 行

pub inline fn IDX(sig: usize) usize

参数

sig: usize

std.c.SIG.IGN

常量

第 2797 行

忽略信号

std.c.SIG.IGN

常量

第 2810 行

?Sigaction.handler_fn

std.c.SIG.IGN

常量

第 2893 行

?Sigaction.handler_fn

std.c.SIG.IGN

常量

第 2956 行

?Sigaction.handler_fn

std.c.SIG.IGN

常量

第 3031 行

?Sigaction.handler_fn

std.c.SIG.IGN

常量

第 3095 行

?Sigaction.handler_fn

std.c.SIG.IGN

常量

第 3144 行

?Sigaction.handler_fn

std.c.SIG.IGN

常量

第 3192 行

?Sigaction.handler_fn

std.c.SIG.IGN

常量

第 3242 行

?Sigaction.handler_fn

std.c.SIG.IO

常量

第 3153 行

SIG

std.c.SIG.IOT

常量

第 2820 行

SIG

std.c.SIG.IOT

常量

第 2912 行

SIG

std.c.SIG.IOT

常量

第 2983 行

SIG

std.c.SIG.IOT

常量

第 3057 行

SIG

std.c.SIG.IOT

常量

第 3104 行

SIG

std.c.SIG.IOT

常量

第 3154 行

SIG

std.c.SIG.IOT

常量

第 3201 行

SIG

std.c.SIG.LWP

常量

第 2913 行

SIG

std.c.SIG.MAXSIG

常量

第 2897 行

std.c.SIG.MAXSIG

常量

第 2960 行

std.c.SIG.MAXSIG

常量

第 3035 行

std.c.SIG.POLL

常量

第 2821 行

SIG

std.c.SIG.POLL

常量

第 2982 行

SIG

std.c.SIG.RTMAX

常量

第 2916 行

std.c.SIG.RTMAX

常量

第 2967 行

std.c.SIG.RTMAX

常量

第 3042 行

std.c.SIG.RTMIN

常量

第 2915 行

std.c.SIG.RTMIN

常量

第 2966 行

std.c.SIG.RTMIN

常量

第 3041 行

std.c.SIG.SETMASK

常量

第 2818 行

设置指定的信号集

std.c.SIG.SETMASK

常量

第 2890 行

std.c.SIG.SETMASK

常量

第 2964 行

std.c.SIG.SETMASK

常量

第 3039 行

std.c.SIG.SETMASK

常量

第 3100 行

std.c.SIG.SETMASK

常量

第 3151 行

std.c.SIG.SETMASK

常量

第 3199 行

std.c.SIG.SETMASK

常量

第 3246 行

std.c.SIG.SGE

常量

第 2801 行

信号收到错误

std.c.SIG.UNBLOCK

常量

第 2816 行

解除对指定信号集的阻塞

std.c.SIG.UNBLOCK

常量

第 2889 行

std.c.SIG.UNBLOCK

常量

第 2963 行

std.c.SIG.UNBLOCK

常量

第 3038 行

std.c.SIG.UNBLOCK

常量

第 3099 行

std.c.SIG.UNBLOCK

常量

第 3150 行

std.c.SIG.UNBLOCK

常量

第 3198 行

std.c.SIG.UNBLOCK

常量

第 3245 行

std.c.SIG.VALID

函数

第 2908 行

pub inline fn VALID(sig: usize) usize

参数

sig: usize

std.c.SIG.VALID

函数

第 2978 行

pub inline fn VALID(sig: usize) usize

参数

sig: usize

std.c.SIG.VALID

函数

第 3053 行

pub inline fn VALID(sig: usize) usize

参数

sig: usize

std.c.SIG.WORD

函数

第 2902 行

pub inline fn WORD(sig: usize) usize

参数

sig: usize

std.c.SIG.WORD

函数

第 2972 行

pub inline fn WORD(sig: usize) usize

参数

sig: usize

std.c.SIG.WORD

函数

第 3047 行

pub inline fn WORD(sig: usize) usize

参数

sig: usize

std.c.SIG.WORDS

常量

第 2896 行

std.c.SIG.WORDS

常量

第 2959 行

std.c.SIG.WORDS

常量

第 3034 行

std.c.SIG.WORDS

常量

第 3102 行

std.c.sigaction

常量

第 10937 行

std.c.Sigaction

类型

第 3331 行

从 sigaction 重命名为 Sigaction,以避免与函数名冲突。

std.c.Sigaction.handler_fn

类型

第 3340 行

std.c.Sigaction.handler_fn

类型

第 3351 行

std.c.Sigaction.handler_fn

类型

第 3364 行

std.c.Sigaction.handler_fn

类型

第 3377 行

std.c.Sigaction.handler_fn

类型

第 3393 行

std.c.Sigaction.handler_fn

类型

第 3404 行

std.c.Sigaction.handler_fn

类型

第 3418 行

std.c.Sigaction.handler_fn

类型

第 3432 行

std.c.Sigaction.handler_fn

类型

第 3451 行

std.c.Sigaction.handler_fn

类型

第 3466 行

std.c.Sigaction.sigaction_fn

类型

第 3341 行

std.c.Sigaction.sigaction_fn

类型

第 3352 行

std.c.Sigaction.sigaction_fn

类型

第 3365 行

std.c.Sigaction.sigaction_fn

类型

第 3378 行

std.c.Sigaction.sigaction_fn

类型

第 3394 行

std.c.Sigaction.sigaction_fn

类型

第 3405 行

std.c.Sigaction.sigaction_fn

类型

第 3419 行

std.c.Sigaction.sigaction_fn

类型

第 3433 行

std.c.Sigaction.sigaction_fn

类型

第 3452 行

std.c.Sigaction.sigaction_fn

类型

第 3467 行

std.c.sigaddset

别名

第 10981 行

别名目标 std.c.private.sigaddset

std.c.sigaltstack

常量

第 10832 行

std.c.sigdelset

别名

第 10986 行

别名目标 std.c.private.sigdelset

std.c.sigemptyset

常量

第 10982 行

std.c.sigfillset

常量

第 10976 行

std.c.siginfo_t

类型

第 4789 行

std.c.sigismember

别名

第 10987 行

别名目标 std.c.private.sigismember

std.c.signalfd

函数

第 10848 行

pub extern "c" fn signalfd(fd: fd_t, mask: *const sigset_t, flags: u32) c_int

参数

fd: fd_t
mask: *const sigset_t
flags: u32

std.c.signalfd_siginfo

别名

第 11644 行

别名目标 std.c.illumos.signalfd_siginfo

std.c.sigprocmask

常量

第 10989 行

std.c.sigrt_private

命名空间

第 10954 行

std.c.sigrt_private.sigrtmax

函数

第 10965 行

pub fn sigrtmax() u8

std.c.sigrt_private.sigrtmin

函数

第 10955 行

pub fn sigrtmin() u8

std.c.sigrtmax

常量

第 10949 行

Zig 版本的 SIGRTMAX。实际上是函数。

std.c.sigrtmin

常量

第 10943 行

Zig 版 SIGRTMIN。实际为函数。

std.c.sigset_t

类型

第 4969 行

std.c.SIGSTKSZ

常量

第 9962 行

std.c.sigval

类型

第 4982 行

std.c.sigval_t

类型

第 2668 行

std.c.sigwait

函数

第 10575 行

pub extern "c" fn sigwait(set: ?*sigset_t, sig: ?*c_int) c_int

参数

set: ?*sigset_t
sig: ?*c_int

std.c.SIOCGIFINDEX

类型

第 3286 行

std.c.SO

类型

第 6903 行

std.c.SO.ACCEPTCONN

常量

第 6909 行

std.c.SO.ACCEPTCONN

常量

第 6938 行

std.c.SO.ACCEPTCONN

常量

第 6978 行

std.c.SO.ACCEPTCONN

常量

第 7012 行

std.c.SO.ACCEPTCONN

常量

第 7040 行

std.c.SO.ACCEPTCONN

常量

第 7067 行

std.c.SO.ACCEPTCONN

常量

第 7092 行

std.c.SO.ACCEPTCONN

常量

第 7135 行

std.c.SO.ACCEPTFILTER

常量

第 6918 行

std.c.SO.ACCEPTFILTER

常量

第 6949 行

std.c.SO.ACCEPTFILTER

常量

第 7022 行

std.c.SO.ACCEPTFILTER

常量

第 7051 行

std.c.SO.ALLZONES

常量

第 7005 行

std.c.SO.ANON_MLP

常量

第 6998 行

std.c.SO.BINDANY

常量

第 7102 行

std.c.SO.BINDTODEVICE

常量

第 7087 行

std.c.SO.BINDTODEVICE

常量

第 7130 行

std.c.SO.BINTIME

常量

第 6950 行

std.c.SO.BROADCAST

常量

第 6913 行

std.c.SO.BROADCAST

常量

第 6942 行

std.c.SO.BROADCAST

常量

第 6982 行

std.c.SO.BROADCAST

常量

第 7016 行

std.c.SO.BROADCAST

常量

第 7044 行

std.c.SO.BROADCAST

常量

第 7068 行

std.c.SO.BROADCAST

常量

第 7096 行

std.c.SO.BROADCAST

常量

第 7133 行

std.c.SO.CPUHINT

常量

第 7064 行

std.c.SO.DEBUG

常量

第 6908 行

std.c.SO.DEBUG

常量

第 6937 行

std.c.SO.DEBUG

常量

第 6977 行

std.c.SO.DEBUG

常量

第 7011 行

std.c.SO.DEBUG

常量

第 7039 行

std.c.SO.DEBUG

常量

第 7069 行

std.c.SO.DEBUG

常量

第 7091 行

std.c.SO.DEBUG

常量

第 7128 行

std.c.SO.DGRAM_ERRIND

常量

第 6986 行

std.c.SO.DOMAIN

常量

第 6974 行

std.c.SO.DOMAIN

常量

第 7000 行

std.c.SO.DOMAIN

常量

第 7116 行

std.c.SO.DONTROUTE

常量

第 6912 行

std.c.SO.DONTROUTE

常量

第 6941 行

std.c.SO.DONTROUTE

常量

第 6981 行

std.c.SO.DONTROUTE

常量

第 7015 行

std.c.SO.DONTROUTE

常量

第 7043 行

std.c.SO.DONTROUTE

常量

第 7070 行

std.c.SO.DONTROUTE

常量

第 7095 行

std.c.SO.DONTROUTE

常量

第 7136 行

std.c.SO.ERROR

常量

第 6925 行

std.c.SO.ERROR

常量

第 6961 行

std.c.SO.ERROR

常量

第 6995 行

std.c.SO.ERROR

常量

第 7030 行

std.c.SO.ERROR

常量

第 7061 行

std.c.SO.ERROR

常量

第 7084 行

std.c.SO.ERROR

常量

第 7110 行

std.c.SO.ERROR

常量

第 7124 行

std.c.SO.EXCLBIND

常量

第 7006 行

std.c.SO.KEEPALIVE

常量

第 6911 行

std.c.SO.KEEPALIVE

常量

第 6940 行

std.c.SO.KEEPALIVE

常量

第 6980 行

std.c.SO.KEEPALIVE

常量

第 7014 行

std.c.SO.KEEPALIVE

常量

第 7042 行

std.c.SO.KEEPALIVE

常量

第 7071 行

std.c.SO.KEEPALIVE

常量

第 7094 行

std.c.SO.KEEPALIVE

常量

第 7131 行

std.c.SO.LABEL

常量

第 6963 行

std.c.SO.LINGER

常量

第 6915 行

std.c.SO.LINGER

常量

第 6944 行

std.c.SO.LINGER

常量

第 6984 行

std.c.SO.LINGER

常量

第 7018 行

std.c.SO.LINGER

常量

第 7046 行

std.c.SO.LINGER

常量

第 7076 行

std.c.SO.LINGER

常量

第 7098 行

std.c.SO.LINGER

常量

第 7134 行

std.c.SO.LINGER_SEC

常量

第 6934 行

std.c.SO.LISTENINCQLEN

常量

第 6967 行

std.c.SO.LISTENQLEN

常量

第 6966 行

std.c.SO.LISTENQLIMIT

常量

第 6965 行

std.c.SO.MAC_EXEMPT

常量

第 6999 行

std.c.SO.MAC_IMPLICIT

常量

第 7007 行

std.c.SO.MAX_PACING_RATE

常量

第 6973 行

std.c.SO.NETPROC

常量

第 7112 行

std.c.SO.NKE

常量

第 6929 行

std.c.SO.NO_DDP

常量

第 6952 行

std.c.SO.NO_OFFLOAD

常量

第 6951 行

std.c.SO.NOADDRERR

常量

第 6931 行

std.c.SO.NOHEADER

常量

第 7034 行

std.c.SO.NONBLOCK

常量

第 7086 行

std.c.SO.NOSIGPIPE

常量

第 6930 行

std.c.SO.NOSIGPIPE

常量

第 6948 行

std.c.SO.NOSIGPIPE

常量

第 7021 行

std.c.SO.NOSIGPIPE

常量

第 7050 行

std.c.SO.NREAD

常量

第 6928 行

std.c.SO.NWRITE

常量

第 6932 行

std.c.SO.OOBINLINE

常量

第 6916 行

std.c.SO.OOBINLINE

常量

第 6945 行

std.c.SO.OOBINLINE

常量

第 6985 行

std.c.SO.OOBINLINE

常量

第 7019 行

std.c.SO.OOBINLINE

常量

第 7047 行

std.c.SO.OOBINLINE

常量

第 7072 行

std.c.SO.OOBINLINE

常量

第 7099 行

std.c.SO.OOBINLINE

常量

第 7137 行

std.c.SO.OVERFLOWED

常量

第 7032 行

std.c.SO.PASSCRED

常量

第 7053 行

std.c.SO.PEERCRED

常量

第 7088 行

std.c.SO.PEERCRED

常量

第 7114 行

std.c.SO.PEERCRED

常量

第 7125 行

std.c.SO.PEERLABEL

常量

第 6964 行

std.c.SO.PROTOCOL

常量

第 6970 行

std.c.SO.PROTOCOL

常量

第 7117 行

std.c.SO.PROTOTYPE

别名

第 6971 行

别名目标 std.c.SO.PROTOCOL

std.c.SO.PROTOTYPE

常量

第 6997 行

std.c.SO.RCVBUF

常量

第 6920 行

std.c.SO.RCVBUF

常量

第 6956 行

std.c.SO.RCVBUF

常量

第 6990 行

std.c.SO.RCVBUF

常量

第 7027 行

std.c.SO.RCVBUF

常量

第 7056 行

std.c.SO.RCVBUF

常量

第 7081 行

std.c.SO.RCVBUF

常量

第 7105 行

std.c.SO.RCVBUF

常量

第 7126 行

std.c.SO.RCVLOWAT

常量

第 6922 行

std.c.SO.RCVLOWAT

常量

第 6958 行

std.c.SO.RCVLOWAT

常量

第 6992 行

std.c.SO.RCVLOWAT

常量

第 7029 行

std.c.SO.RCVLOWAT

常量

第 7058 行

std.c.SO.RCVLOWAT

常量

第 7082 行

std.c.SO.RCVLOWAT

常量

第 7107 行

std.c.SO.RCVLOWAT

常量

第 7139 行

std.c.SO.RCVPSH

常量

第 7001 行

std.c.SO.RCVTIMEO

常量

第 6924 行

std.c.SO.RCVTIMEO

常量

第 6960 行

std.c.SO.RCVTIMEO

常量

第 6994 行

std.c.SO.RCVTIMEO

常量

第 7036 行

std.c.SO.RCVTIMEO

常量

第 7060 行

std.c.SO.RCVTIMEO

常量

第 7083 行

std.c.SO.RCVTIMEO

常量

第 7109 行

std.c.SO.RCVTIMEO

常量

第 7121 行

std.c.SO.RECVUCRED

常量

第 6987 行

std.c.SO.RERROR

常量

第 7024 行

std.c.SO.RERROR

常量

第 7052 行

std.c.SO.REUSEADDR

常量

第 6910 行

std.c.SO.REUSEADDR

常量

第 6939 行

std.c.SO.REUSEADDR

常量

第 6979 行

std.c.SO.REUSEADDR

常量

第 7013 行

std.c.SO.REUSEADDR

常量

第 7041 行

std.c.SO.REUSEADDR

常量

第 7073 行

std.c.SO.REUSEADDR

常量

第 7093 行

std.c.SO.REUSEADDR

常量

第 7129 行

std.c.SO.REUSEPORT

常量

第 6917 行

std.c.SO.REUSEPORT

常量

第 6946 行

std.c.SO.REUSEPORT

常量

第 7020 行

std.c.SO.REUSEPORT

常量

第 7048 行

std.c.SO.REUSEPORT

常量

第 7074 行

std.c.SO.REUSEPORT

常量

第 7100 行

std.c.SO.REUSEPORT_LB

常量

第 6953 行

std.c.SO.REUSESHAREUID

常量

第 6933 行

std.c.SO.RTABLE

常量

第 7113 行

std.c.SO.SECATTR

常量

第 7003 行

std.c.SO.SETFIB

常量

第 6968 行

std.c.SO.SNDBUF

常量

第 6919 行

std.c.SO.SNDBUF

常量

第 6955 行

std.c.SO.SNDBUF

常量

第 6989 行

std.c.SO.SNDBUF

常量

第 7026 行

std.c.SO.SNDBUF

常量

第 7055 行

std.c.SO.SNDBUF

常量

第 7078 行

std.c.SO.SNDBUF

常量

第 7104 行

std.c.SO.SNDBUF

常量

第 7127 行

std.c.SO.SNDLOWAT

常量

第 6921 行

std.c.SO.SNDLOWAT

常量

第 6957 行

std.c.SO.SNDLOWAT

常量

第 6991 行

std.c.SO.SNDLOWAT

常量

第 7028 行

std.c.SO.SNDLOWAT

常量

第 7057 行

std.c.SO.SNDLOWAT

常量

第 7079 行

std.c.SO.SNDLOWAT

常量

第 7106 行

std.c.SO.SNDLOWAT

常量

第 7138 行

std.c.SO.SNDSPACE

常量

第 7063 行

std.c.SO.SNDTIMEO

常量

第 6923 行

std.c.SO.SNDTIMEO

常量

第 6959 行

std.c.SO.SNDTIMEO

常量

第 6993 行

std.c.SO.SNDTIMEO

常量

第 7035 行

std.c.SO.SNDTIMEO

常量

第 7059 行

std.c.SO.SNDTIMEO

常量

第 7080 行

std.c.SO.SNDTIMEO

常量

第 7108 行

std.c.SO.SNDTIMEO

常量

第 7122 行

std.c.SO.SPLICE

常量

第 7115 行

std.c.SO.TIMESTAMP

常量

第 6947 行

std.c.SO.TIMESTAMP

常量

第 7004 行

std.c.SO.TIMESTAMP

常量

第 7023 行

std.c.SO.TIMESTAMP

常量

第 7049 行

std.c.SO.TIMESTAMP

常量

第 7101 行

std.c.SO.TIMESTAMP

常量

第 7132 行

std.c.SO.TS_CLOCK

常量

第 6972 行

std.c.SO.TYPE

常量

第 6926 行

std.c.SO.TYPE

常量

第 6962 行

std.c.SO.TYPE

常量

第 6996 行

std.c.SO.TYPE

常量

第 7031 行

std.c.SO.TYPE

常量

第 7062 行

std.c.SO.TYPE

常量

第 7085 行

std.c.SO.TYPE

常量

第 7111 行

std.c.SO.TYPE

常量

第 7123 行

std.c.SO.USELOOPBACK

常量

第 6914 行

std.c.SO.USELOOPBACK

常量

第 6943 行

std.c.SO.USELOOPBACK

常量

第 6983 行

std.c.SO.USELOOPBACK

常量

第 7017 行

std.c.SO.USELOOPBACK

常量

第 7045 行

std.c.SO.USELOOPBACK

常量

第 7075 行

std.c.SO.USELOOPBACK

常量

第 7097 行

std.c.SO.USER_COOKIE

常量

第 6969 行

std.c.SO.VRRP

常量

第 7008 行

std.c.SO.ZEROIZE

常量

第 7103 行

std.c.SOCK

类型

第 6127 行

std.c.SOCK.CLOEXEC

常量

第 6142 行

Darwin 实际上不支持,但 Zig 提供了兼容实现。 这个数值不保证 ABI 稳定,只需不与 其他 SOCK 位冲突。

std.c.SOCK.CLOEXEC

常量

第 6155 行

std.c.SOCK.CLOEXEC

常量

第 6172 行

std.c.SOCK.CLOEXEC

常量

第 6183 行

std.c.SOCK.CLOEXEC

常量

第 6195 行

std.c.SOCK.CLOEXEC

常量

第 6206 行

std.c.SOCK.CLOEXEC

常量

第 6215 行

std.c.SOCK.CLOEXEC

常量

第 6227 行

std.c.SOCK.CONN_DGRAM

常量

第 6180 行

std.c.SOCK.DCCP

别名

第 6181 行

别名目标 std.c.SOCK.CONN_DGRAM

std.c.SOCK.DGRAM

常量

第 6133 行

std.c.SOCK.DGRAM

常量

第 6150 行

std.c.SOCK.DGRAM

常量

第 6160 行

数据报。

std.c.SOCK.DGRAM

常量

第 6176 行

std.c.SOCK.DGRAM

常量

第 6190 行

std.c.SOCK.DGRAM

常量

第 6200 行

std.c.SOCK.DGRAM

常量

第 6210 行

std.c.SOCK.DGRAM

常量

第 6221 行

std.c.SOCK.FLAGS_MASK

常量

第 6186 行

std.c.SOCK.MAXADDRLEN

常量

第 6137 行

std.c.SOCK.MAXADDRLEN

常量

第 6194 行

std.c.SOCK.MISC

常量

第 6203 行

std.c.SOCK.NDELAY

常量

第 6171 行

std.c.SOCK.NONBLOCK

常量

第 6146 行

Darwin 实际上不支持,但 Zig 提供了兼容实现。 这个数值不保证 ABI 稳定,只需不与 其他 SOCK 位冲突。

std.c.SOCK.NONBLOCK

常量

第 6156 行

std.c.SOCK.NONBLOCK

常量

第 6170 行

std.c.SOCK.NONBLOCK

常量

第 6184 行

std.c.SOCK.NONBLOCK

常量

第 6196 行

std.c.SOCK.NONBLOCK

常量

第 6205 行

std.c.SOCK.NONBLOCK

常量

第 6216 行

std.c.SOCK.NONBLOCK

常量

第 6226 行

std.c.SOCK.NOSIGPIPE

常量

第 6185 行

std.c.SOCK.RAW

常量

第 6134 行

std.c.SOCK.RAW

常量

第 6151 行

std.c.SOCK.RAW

常量

第 6164 行

原始协议接口。

std.c.SOCK.RAW

常量

第 6177 行

std.c.SOCK.RAW

常量

第 6191 行

std.c.SOCK.RAW

常量

第 6201 行

std.c.SOCK.RAW

常量

第 6211 行

std.c.SOCK.RAW

常量

第 6222 行

std.c.SOCK.RDM

常量

第 6135 行

std.c.SOCK.RDM

常量

第 6152 行

std.c.SOCK.RDM

常量

第 6166 行

可靠投递的消息。

std.c.SOCK.RDM

常量

第 6178 行

std.c.SOCK.RDM

常量

第 6192 行

std.c.SOCK.RDM

常量

第 6212 行

std.c.SOCK.RDM

常量

第 6223 行

std.c.SOCK.SEQPACKET

常量

第 6136 行

std.c.SOCK.SEQPACKET

常量

第 6153 行

std.c.SOCK.SEQPACKET

常量

第 6168 行

顺序打包流。

std.c.SOCK.SEQPACKET

常量

第 6179 行

std.c.SOCK.SEQPACKET

常量

第 6193 行

std.c.SOCK.SEQPACKET

常量

第 6202 行

std.c.SOCK.SEQPACKET

常量

第 6213 行

std.c.SOCK.SEQPACKET

常量

第 6224 行

std.c.SOCK.STREAM

常量

第 6132 行

std.c.SOCK.STREAM

常量

第 6149 行

std.c.SOCK.STREAM

常量

第 6162 行

流。

std.c.SOCK.STREAM

常量

第 6175 行

std.c.SOCK.STREAM

常量

第 6189 行

std.c.SOCK.STREAM

常量

第 6199 行

std.c.SOCK.STREAM

常量

第 6209 行

std.c.SOCK.STREAM

常量

第 6220 行

std.c.sockaddr

类型

第 5067 行

std.c.sockaddr.in

容器

第 5086 行

字段

len: u8 = @sizeOf(in)
family: sa_family_t = AF.INET
port: in_port_t
addr: u32
zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 }

std.c.sockaddr.in

容器

第 5129 行

字段

len: u8 = @sizeOf(in)
family: sa_family_t = AF.INET
port: in_port_t
addr: u32
zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 }

std.c.sockaddr.in

容器

第 5170 行

字段

family: sa_family_t = AF.INET
port: in_port_t
addr: u32
zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 }

std.c.sockaddr.in

容器

第 5212 行

字段

len: u8 = @sizeOf(in)
family: sa_family_t = AF.INET
port: in_port_t
addr: u32
zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 }

std.c.sockaddr.in

容器

第 5257 行

字段

len: u8 = @sizeOf(in)
family: sa_family_t = AF.INET
port: in_port_t
addr: u32
zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 }

std.c.sockaddr.in

容器

第 5300 行

字段

len: u8 = @sizeOf(in)
family: sa_family_t = AF.INET
port: in_port_t
addr: u32
zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 }

std.c.sockaddr.in

容器

第 5343 行

字段

len: u8 = @sizeOf(in)
family: sa_family_t = AF.INET
port: in_port_t
addr: u32
zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 }

std.c.sockaddr.in

容器

第 5379 行

字段

family: sa_family_t = AF.INET
port: in_port_t
addr: in_addr
zero: [8]u8 = @splat(0)

std.c.sockaddr.in_addr

类型

第 5377 行

std.c.sockaddr.in6

容器

第 5093 行

字段

len: u8 = @sizeOf(in6)
family: sa_family_t = AF.INET6
port: in_port_t
flowinfo: u32
addr: [16]u8
scope_id: u32

std.c.sockaddr.in6

容器

第 5137 行

字段

len: u8 = @sizeOf(in6)
family: sa_family_t = AF.INET6
port: in_port_t
flowinfo: u32
addr: [16]u8
scope_id: u32

std.c.sockaddr.in6

容器

第 5177 行

字段

family: sa_family_t = AF.INET6
port: in_port_t
flowinfo: u32
addr: [16]u8
scope_id: u32
__src_id: u32 = 0

std.c.sockaddr.in6

容器

第 5220 行

字段

len: u8 = @sizeOf(in6)
family: sa_family_t = AF.INET6
port: in_port_t
flowinfo: u32
addr: [16]u8
scope_id: u32

std.c.sockaddr.in6

容器

第 5265 行

字段

len: u8 = @sizeOf(in6)
family: sa_family_t = AF.INET6
port: in_port_t
flowinfo: u32
addr: [16]u8
scope_id: u32

std.c.sockaddr.in6

容器

第 5308 行

字段

len: u8 = @sizeOf(in6)
family: sa_family_t = AF.INET6
port: in_port_t
flowinfo: u32
addr: [16]u8
scope_id: u32

std.c.sockaddr.in6

容器

第 5351 行

字段

len: u8 = @sizeOf(in6)
family: sa_family_t = AF.INET6
port: in_port_t
flowinfo: u32
addr: [16]u8
scope_id: u32

std.c.sockaddr.in6

容器

第 5385 行

字段

family: sa_family_t = AF.INET6
port: in_port_t
flowinfo: u32
addr: in6_addr
scope_id: u32

std.c.sockaddr.in6_addr

类型

第 5378 行

std.c.sockaddr.SS_MAXSIZE

常量

第 5075 行

std.c.sockaddr.SS_MAXSIZE

常量

第 5117 行

std.c.sockaddr.SS_MAXSIZE

常量

第 5159 行

std.c.sockaddr.SS_MAXSIZE

常量

第 5200 行

std.c.sockaddr.SS_MAXSIZE

常量

第 5245 行

std.c.sockaddr.SS_MAXSIZE

常量

第 5288 行

std.c.sockaddr.SS_MAXSIZE

常量

第 5331 行

std.c.sockaddr.storage

容器

第 5076 行

字段

len: u8 align(8)
family: sa_family_t
padding: [126]u8 = undefined

std.c.sockaddr.storage

容器

第 5118 行

字段

len: u8 align(8)
family: sa_family_t
padding: [126]u8 = undefined

std.c.sockaddr.storage

容器

第 5160 行

字段

family: sa_family_t align(8)
padding: [254]u8 = undefined

std.c.sockaddr.storage

容器

第 5201 行

字段

len: u8 align(8)
family: sa_family_t
padding: [126]u8 = undefined

std.c.sockaddr.storage

容器

第 5246 行

字段

len: u8 align(8)
family: sa_family_t
padding: [126]u8 = undefined

std.c.sockaddr.storage

容器

第 5289 行

字段

len: u8 align(8)
family: sa_family_t
padding: [126]u8 = undefined

std.c.sockaddr.storage

容器

第 5332 行

字段

len: u8 align(8)
family: sa_family_t
padding: [254]u8 = undefined

std.c.sockaddr.un

容器

第 5103 行

UNIX 域套接字

字段

len: u8 = @sizeOf(un)
family: sa_family_t = AF.UNIX
path: [104]u8

std.c.sockaddr.un

容器

第 5146 行

字段

len: u8 = @sizeOf(un)
family: sa_family_t = AF.UNIX
path: [104]u8

std.c.sockaddr.un

容器

第 5187 行

UNIX IPC 域的定义。

字段

family: sa_family_t = AF.UNIX
path: [108]u8

std.c.sockaddr.un

容器

第 5230 行

UNIX IPC 域的定义。

字段

len: u8 = @sizeOf(un)

sockaddr 总长度

family: sa_family_t = AF.LOCAL
path: [104]u8

路径名

std.c.sockaddr.un

容器

第 5274 行

字段

len: u8 = @sizeOf(un)
family: sa_family_t = AF.UNIX
path: [104]u8

std.c.sockaddr.un

容器

第 5317 行

字段

len: u8 = @sizeOf(un)
family: sa_family_t = AF.UNIX
path: [104]u8

std.c.sockaddr.un

容器

第 5361 行

UNIX IPC 域的定义。

字段

len: u8 = @sizeOf(un)

sockaddr 总长度

family: sa_family_t = AF.LOCAL
path: [104]u8

路径名

std.c.sockaddr.un

容器

第 5395 行

字段

family: sa_family_t = AF.LOCAL
path: [UNIX_PATH_MAX]u8

std.c.sockaddr.UNIX_PATH_MAX

常量

第 5394 行

std.c.socket

常量

第 10994 行

std.c.socketpair

常量

第 10999 行

std.c.socklen_t

类型

第 5402 行

std.c.SOL

类型

第 6884 行

std.c.SOL.FILTER

常量

第 6895 行

std.c.SOL.PACKET

常量

第 6894 行

std.c.SOL.ROUTE

常量

第 6893 行

std.c.SOL.SOCKET

常量

第 6889 行

std.c.SOL.SOCKET

常量

第 6892 行

std.c.SOL.SOCKET

常量

第 6899 行

std.c.SOMAXCONN

类型

第 7143 行

std.c.speed_t

类型

第 9743 行

std.c.SS

类型

第 9972 行

std.c.SS.DISABLE

常量

第 9976 行

std.c.SS.DISABLE

常量

第 9981 行

std.c.SS.ONSTACK

常量

第 9975 行

std.c.SS.ONSTACK

常量

第 9980 行

std.c.stack_t

类型

第 7221 行

std.c.stat

常量

第 11005 行

std.c.Stat

类型

第 7858 行

std.c.Stat.atime

函数

第 7878 行

pub fn atime(self: @This()) timespec

参数

self: @This()

std.c.Stat.atime

函数

第 7939 行

pub fn atime(self: @This()) timespec

参数

self: @This()

std.c.Stat.atime

函数

第 7972 行

pub fn atime(self: @This()) timespec

参数

self: @This()

std.c.Stat.atime

函数

第 8003 行

pub fn atime(self: @This()) timespec

参数

self: @This()

std.c.Stat.atime

函数

第 8039 行

pub fn atime(self: @This()) timespec

参数

self: @This()

std.c.Stat.atime

函数

第 8068 行

pub fn atime(self: @This()) timespec

参数

self: @This()

std.c.Stat.atime

函数

第 8099 行

pub fn atime(self: @This()) timespec

参数

self: @This()

std.c.Stat.atime

函数

第 8131 行

pub fn atime(self: @This()) timespec

参数

self: @This()

std.c.Stat.birthtime

函数

第 7951 行

pub fn birthtime(self: @This()) timespec

参数

self: @This()

std.c.Stat.birthtime

函数

第 8015 行

pub fn birthtime(self: @This()) timespec

参数

self: @This()

std.c.Stat.birthtime

函数

第 8077 行

pub fn birthtime(self: @This()) timespec

参数

self: @This()

std.c.Stat.birthtime

函数

第 8111 行

pub fn birthtime(self: @This()) timespec

参数

self: @This()

std.c.Stat.ctime

函数

第 7886 行

pub fn ctime(self: @This()) timespec

参数

self: @This()

std.c.Stat.ctime

函数

第 7947 行

pub fn ctime(self: @This()) timespec

参数

self: @This()

std.c.Stat.ctime

函数

第 7980 行

pub fn ctime(self: @This()) timespec

参数

self: @This()

std.c.Stat.ctime

函数

第 8011 行

pub fn ctime(self: @This()) timespec

参数

self: @This()

std.c.Stat.ctime

函数

第 8047 行

pub fn ctime(self: @This()) timespec

参数

self: @This()

std.c.Stat.ctime

函数

第 8074 行

pub fn ctime(self: @This()) timespec

参数

self: @This()

std.c.Stat.ctime

函数

第 8107 行

pub fn ctime(self: @This()) timespec

参数

self: @This()

std.c.Stat.ctime

函数

第 8139 行

pub fn ctime(self: @This()) timespec

参数

self: @This()

std.c.Stat.fromFilestat

函数

第 7890 行

pub fn fromFilestat(st: wasi.filestat_t) Stat

参数

std.c.Stat.mtime

函数

第 7882 行

pub fn mtime(self: @This()) timespec

参数

self: @This()

std.c.Stat.mtime

函数

第 7943 行

pub fn mtime(self: @This()) timespec

参数

self: @This()

std.c.Stat.mtime

函数

第 7976 行

pub fn mtime(self: @This()) timespec

参数

self: @This()

std.c.Stat.mtime

函数

第 8007 行

pub fn mtime(self: @This()) timespec

参数

self: @This()

std.c.Stat.mtime

函数

第 8043 行

pub fn mtime(self: @This()) timespec

参数

self: @This()

std.c.Stat.mtime

函数

第 8071 行

pub fn mtime(self: @This()) timespec

参数

self: @This()

std.c.Stat.mtime

函数

第 8103 行

pub fn mtime(self: @This()) timespec

参数

self: @This()

std.c.Stat.mtime

函数

第 8135 行

pub fn mtime(self: @This()) timespec

参数

self: @This()

std.c.status_t

别名

第 11667 行

别名目标 std.c.haiku.status_t

std.c.statx

函数

第 10613 行

pub extern "c" fn statx(dirfd: fd_t, path: [*:0]const u8, flags: u32, mask: linux.STATX, buf: *linux.Statx) c_int

参数

dirfd: fd_t
path: [*:0]const u8
flags: u32
mask: linux.STATX
buf: *linux.Statx

std.c.std

别名

第 7 行

别名目标 std

std.c.STDERR_FILENO

常量

第 3305 行

std.c.STDIN_FILENO

常量

第 3295 行

std.c.STDOUT_FILENO

常量

第 3300 行

std.c.strcasecmp

函数

第 11549 行

pub extern "c" fn strcasecmp(a: [*:0]const c_char, b: [*:0]const c_char) c_int

参数

a: [*:0]const c_char
b: [*:0]const c_char

std.c.strdup

常量

第 11551 行

std.c.strncasecmp

函数

第 11550 行

pub extern "c" fn strncasecmp(a: [*:0]const c_char, b: [*:0]const c_char, max: usize) c_int

参数

a: [*:0]const c_char
b: [*:0]const c_char
max: usize

std.c.strncmp

函数

第 11548 行

pub extern "c" fn strncmp(a: [*:0]const c_char, b: [*:0]const c_char, max: usize) c_int

参数

a: [*:0]const c_char
b: [*:0]const c_char
max: usize

std.c.strndup

函数

第 11556 行

pub extern "c" fn strndup(s: [*:0]const c_char, n: usize) ?[*:0]c_char

参数

s: [*:0]const c_char
n: usize

std.c.strnlen

函数

第 11555 行

pub extern "c" fn strnlen(s: [*:0]const c_char, n: usize) callconv(.c) usize

参数

s: [*:0]const c_char
n: usize

std.c.strtoimax

函数

第 11593 行

pub extern "c" fn strtoimax(noalias str: [*:0]const c_char, noalias str_end: ?*[*:0]c_char, base: c_int) callconv(.c) intmax_t

参数

str: [*:0]const c_char
str_end: ?*[*:0]c_char
base: c_int

std.c.strtol

函数

第 11589 行

pub extern "c" fn strtol(noalias str: [*:0]const c_char, noalias str_end: ?*[*:0]c_char, base: c_int) callconv(.c) c_long

参数

str: [*:0]const c_char
str_end: ?*[*:0]c_char
base: c_int

std.c.strtoll

函数

第 11590 行

pub extern "c" fn strtoll(noalias str: [*:0]const c_char, noalias str_end: ?*[*:0]c_char, base: c_int) callconv(.c) c_longlong

参数

str: [*:0]const c_char
str_end: ?*[*:0]c_char
base: c_int

std.c.strtoul

函数

第 11591 行

pub extern "c" fn strtoul(noalias str: [*:0]const c_char, noalias str_end: ?*[*:0]c_char, base: c_int) callconv(.c) c_ulong

参数

str: [*:0]const c_char
str_end: ?*[*:0]c_char
base: c_int

std.c.strtoull

函数

第 11592 行

pub extern "c" fn strtoull(noalias str: [*:0]const c_char, noalias str_end: ?*[*:0]c_char, base: c_int) callconv(.c) c_ulonglong

参数

str: [*:0]const c_char
str_end: ?*[*:0]c_char
base: c_int

std.c.strtoumax

函数

第 11594 行

pub extern "c" fn strtoumax(noalias str: [*:0]const c_char, noalias str_end: ?*[*:0]c_char, base: c_int) callconv(.c) uintmax_t

参数

str: [*:0]const c_char
str_end: ?*[*:0]c_char
base: c_int

std.c.suseconds_t

类型

第 7254 行

std.c.swab

常量

第 11543 行

std.c.symlink

函数

第 11121 行

pub extern "c" fn symlink(existing: [*:0]const u8, new: [*:0]const u8) c_int

参数

existing: [*:0]const u8
new: [*:0]const u8

std.c.symlinkat

函数

第 11122 行

pub extern "c" fn symlinkat(oldpath: [*:0]const u8, newdirfd: fd_t, newpath: [*:0]const u8) c_int

参数

oldpath: [*:0]const u8
newdirfd: fd_t
newpath: [*:0]const u8

std.c.sync

函数

第 11430 行

pub extern "c" fn sync() void

std.c.syncfs

函数

第 11431 行

pub extern "c" fn syncfs(fd: c_int) c_int

参数

fd: c_int

std.c.SYS

类型

第 3311 行

std.c.sysconf

常量

第 11029 行

std.c.sysctl

函数

第 11143 行

pub extern "c" fn sysctl(name: [*]const c_int, namelen: c_uint, oldp: ?*anyopaque, oldlenp: ?*usize, newp: ?*anyopaque, newlen: usize) c_int

参数

name: [*]const c_int
namelen: c_uint
oldp: ?*anyopaque
oldlenp: ?*usize
newp: ?*anyopaque
newlen: usize

std.c.sysctlbyname

函数

第 11144 行

pub extern "c" fn sysctlbyname(name: [*:0]const u8, oldp: ?*anyopaque, oldlenp: ?*usize, newp: ?*anyopaque, newlen: usize) c_int

参数

name: [*:0]const u8
oldp: ?*anyopaque
oldlenp: ?*usize
newp: ?*anyopaque
newlen: usize

std.c.sysctlnametomib

函数

第 11145 行

pub extern "c" fn sysctlnametomib(name: [*:0]const u8, mibp: ?*c_int, sizep: ?*usize) c_int

参数

name: [*:0]const u8
mibp: ?*c_int
sizep: ?*usize

std.c.syslog

函数

第 11442 行

pub extern "c" fn syslog(priority: c_int, message: [*:0]const u8, ...) void

参数

priority: c_int
message: [*:0]const u8

std.c.SYSPROTO_CONTROL

别名

第 11766 行

别名目标 std.c.darwin.SYSPROTO_CONTROL

std.c.SYSPROTO_EVENT

别名

第 11765 行

别名目标 std.c.darwin.SYSPROTO_EVENT

std.c.system_info

别名

第 11668 行

别名目标 std.c.haiku.system_info

std.c.T

类型

第 3478 行

std.c.T.CFLSH

常量

第 3521 行

std.c.T.CFLSH

常量

第 3686 行

std.c.T.CFLSH

常量

第 3859 行

std.c.T.CGETA

常量

第 3515 行

std.c.T.CGETA

常量

第 3680 行

std.c.T.CGETBITS

常量

第 3689 行

std.c.T.CGETS

常量

第 3528 行

std.c.T.CGETS

常量

第 3855 行

std.c.T.CQUERYCONNECTED

常量

第 3688 行

std.c.T.CSADRAIN

常量

第 3532 行

std.c.T.CSANOW

常量

第 3530 行

std.c.T.CSBRK

常量

第 3519 行

std.c.T.CSBRK

常量

第 3685 行

std.c.T.CSETA

常量

第 3516 行

std.c.T.CSETA

常量

第 3681 行

std.c.T.CSETAF

常量

第 3518 行

std.c.T.CSETAF

常量

第 3682 行

std.c.T.CSETAW

常量

第 3517 行

std.c.T.CSETAW

常量

第 3683 行

std.c.T.CSETDTR

常量

第 3690 行

std.c.T.CSETRTS

常量

第 3691 行

std.c.T.CSETS

常量

第 3529 行

std.c.T.CSETS

常量

第 3856 行

std.c.T.CSETSF

常量

第 3533 行

std.c.T.CSETSF

常量

第 3858 行

std.c.T.CSETSW

常量

第 3531 行

std.c.T.CSETSW

常量

第 3857 行

std.c.T.CVTIME

常量

第 3694 行

std.c.T.CWAITEVENT

常量

第 3684 行

std.c.T.CXONC

常量

第 3520 行

std.c.T.CXONC

常量

第 3687 行

std.c.T.FIONBIO

常量

第 3504 行

std.c.T.FIONBIO

常量

第 3707 行

std.c.T.FIONREAD

常量

第 3501 行

std.c.T.FIONREAD

常量

第 3706 行

std.c.T.IOCCBRK

常量

第 3509 行

std.c.T.IOCCBRK

常量

第 3563 行

清除 break 位

std.c.T.IOCCBRK

常量

第 3604 行

std.c.T.IOCCBRK

常量

第 3701 行

std.c.T.IOCCBRK

常量

第 3710 行

std.c.T.IOCCBRK

常量

第 3809 行

std.c.T.IOCCDTR

常量

第 3567 行

清除数据终端就绪状态

std.c.T.IOCCDTR

常量

第 3605 行

std.c.T.IOCCDTR

常量

第 3711 行

std.c.T.IOCCDTR

常量

第 3811 行

std.c.T.IOCCONS

常量

第 3502 行

std.c.T.IOCCONS

常量

第 3606 行

std.c.T.IOCCONS

常量

第 3712 行

std.c.T.IOCCONS

常量

第 3838 行

std.c.T.IOCDCDTIMESTAMP

常量

第 3607 行

std.c.T.IOCDCDTIMESTAMP

常量

第 3713 行

std.c.T.IOCDCDTIMESTAMP

常量

第 3846 行

std.c.T.IOCDRAIN

常量

第 3608 行

std.c.T.IOCDRAIN

常量

第 3714 行

std.c.T.IOCDRAIN

常量

第 3842 行

std.c.T.IOCEXCL

常量

第 3488 行

std.c.T.IOCEXCL

常量

第 3547 行

std.c.T.IOCEXCL

常量

第 3609 行

std.c.T.IOCEXCL

常量

第 3715 行

std.c.T.IOCEXCL

常量

第 3799 行

std.c.T.IOCEXT

常量

第 3610 行

std.c.T.IOCEXT

常量

第 3716 行

std.c.T.IOCEXT

常量

第 3840 行

std.c.T.IOCFLAG_CDTRCTS

常量

第 3611 行

std.c.T.IOCFLAG_CDTRCTS

常量

第 3717 行

std.c.T.IOCFLAG_CLOCAL

常量

第 3612 行

std.c.T.IOCFLAG_CLOCAL

常量

第 3718 行

std.c.T.IOCFLAG_CRTSCTS

常量

第 3613 行

std.c.T.IOCFLAG_CRTSCTS

常量

第 3719 行

std.c.T.IOCFLAG_MDMBUF

常量

第 3614 行

std.c.T.IOCFLAG_MDMBUF

常量

第 3720 行

std.c.T.IOCFLAG_SOFTCAR

常量

第 3615 行

std.c.T.IOCFLAG_SOFTCAR

常量

第 3721 行

std.c.T.IOCFLUSH

常量

第 3549 行

std.c.T.IOCFLUSH

常量

第 3616 行

std.c.T.IOCFLUSH

常量

第 3722 行

std.c.T.IOCFLUSH

常量

第 3801 行

std.c.T.IOCGDRAINWAIT

常量

第 3848 行

std.c.T.IOCGETA

常量

第 3617 行

std.c.T.IOCGETA

常量

第 3723 行

std.c.T.IOCGETA

常量

第 3802 行

std.c.T.IOCGETC

常量

第 3551 行

std.c.T.IOCGETD

常量

第 3507 行

std.c.T.IOCGETD

常量

第 3541 行

std.c.T.IOCGETD

常量

第 3618 行

std.c.T.IOCGETD

常量

第 3724 行

std.c.T.IOCGETD

常量

第 3806 行

std.c.T.IOCGETLD

常量

第 3535 行

std.c.T.IOCGETP

常量

第 3544 行

std.c.T.IOCGFLAGS

常量

第 3619 行

std.c.T.IOCGFLAGS

常量

第 3725 行

std.c.T.IOCGLINED

常量

第 3620 行

std.c.T.IOCGLINED

常量

第 3726 行

std.c.T.IOCGLTC

常量

第 3571 行

获取本地特殊字符

std.c.T.IOCGPGRP

常量

第 3491 行

std.c.T.IOCGPGRP

常量

第 3583 行

获取 tty 的进程组

std.c.T.IOCGPGRP

常量

第 3621 行

std.c.T.IOCGPGRP

常量

第 3695 行

std.c.T.IOCGPGRP

常量

第 3727 行

std.c.T.IOCGPGRP

常量

第 3812 行

std.c.T.IOCGPGRP

常量

第 3853 行

std.c.T.IOCGPPS

常量

第 3537 行

std.c.T.IOCGPPSEV

常量

第 3539 行

std.c.T.IOCGPTN

常量

第 3511 行

std.c.T.IOCGPTN

常量

第 3865 行

std.c.T.IOCGQSIZE

常量

第 3622 行

std.c.T.IOCGQSIZE

常量

第 3728 行

std.c.T.IOCGRANTPT

常量

第 3623 行

std.c.T.IOCGRANTPT

常量

第 3729 行

std.c.T.IOCGSID

常量

第 3510 行

std.c.T.IOCGSID

常量

第 3587 行

在控制终端上获取会话 ID

std.c.T.IOCGSID

常量

第 3624 行

std.c.T.IOCGSID

常量

第 3704 行

std.c.T.IOCGSID

常量

第 3730 行

std.c.T.IOCGSID

常量

第 3837 行

std.c.T.IOCGSIZE

常量

第 3625 行

std.c.T.IOCGSIZE

常量

第 3731 行

std.c.T.IOCGSOFTCAR

常量

第 3525 行

std.c.T.IOCGWINSZ

常量

第 3481 行

std.c.T.IOCGWINSZ

常量

第 3495 行

std.c.T.IOCGWINSZ

常量

第 3522 行

std.c.T.IOCGWINSZ

常量

第 3626 行

std.c.T.IOCGWINSZ

常量

第 3692 行

std.c.T.IOCGWINSZ

常量

第 3732 行

std.c.T.IOCGWINSZ

常量

第 3833 行

std.c.T.IOCGWINSZ

常量

第 3860 行

std.c.T.IOCHPCL

常量

第 3543 行

std.c.T.IOCISPTMASTER

常量

第 3849 行

std.c.T.IOCLBIC

常量

第 3555 行

清除本地模式位

std.c.T.IOCLBIS

常量

第 3553 行

按位设置本地模式位

std.c.T.IOCLGET

常量

第 3559 行

获取本地模式

std.c.T.IOCLSET

常量

第 3557 行

设置整个本地模式字

std.c.T.IOCM_CAR

常量

第 3631 行

std.c.T.IOCM_CAR

常量

第 3737 行

std.c.T.IOCM_CAR

常量

第 3794 行

std.c.T.IOCM_CD

常量

第 3632 行

std.c.T.IOCM_CD

常量

第 3738 行

std.c.T.IOCM_CD

常量

第 3795 行

std.c.T.IOCM_CTS

常量

第 3633 行

std.c.T.IOCM_CTS

常量

第 3739 行

std.c.T.IOCM_CTS

常量

第 3793 行

std.c.T.IOCM_DSR

常量

第 3634 行

std.c.T.IOCM_DSR

常量

第 3740 行

std.c.T.IOCM_DSR

常量

第 3798 行

std.c.T.IOCM_DTR

常量

第 3635 行

std.c.T.IOCM_DTR

常量

第 3741 行

std.c.T.IOCM_DTR

常量

第 3789 行

std.c.T.IOCM_LE

常量

第 3636 行

std.c.T.IOCM_LE

常量

第 3742 行

std.c.T.IOCM_LE

常量

第 3788 行

std.c.T.IOCM_RI

常量

第 3637 行

std.c.T.IOCM_RI

常量

第 3743 行

std.c.T.IOCM_RI

常量

第 3797 行

std.c.T.IOCM_RNG

常量

第 3638 行

std.c.T.IOCM_RNG

常量

第 3744 行

std.c.T.IOCM_RNG

常量

第 3796 行

std.c.T.IOCM_RTS

常量

第 3639 行

std.c.T.IOCM_RTS

常量

第 3745 行

std.c.T.IOCM_RTS

常量

第 3790 行

std.c.T.IOCM_SR

常量

第 3640 行

std.c.T.IOCM_SR

常量

第 3746 行

std.c.T.IOCM_SR

常量

第 3792 行

std.c.T.IOCM_ST

常量

第 3641 行

std.c.T.IOCM_ST

常量

第 3747 行

std.c.T.IOCM_ST

常量

第 3791 行

std.c.T.IOCMBIC

常量

第 3499 行

std.c.T.IOCMBIC

常量

第 3595 行

清除调制解调器位

std.c.T.IOCMBIC

常量

第 3627 行

std.c.T.IOCMBIC

常量

第 3703 行

std.c.T.IOCMBIC

常量

第 3733 行

std.c.T.IOCMBIC

常量

第 3830 行

std.c.T.IOCMBIS

常量

第 3498 行

std.c.T.IOCMBIS

常量

第 3593 行

设置调制解调器位

std.c.T.IOCMBIS

常量

第 3628 行

std.c.T.IOCMBIS

常量

第 3702 行

std.c.T.IOCMBIS

常量

第 3734 行

std.c.T.IOCMBIS

常量

第 3829 行

std.c.T.IOCMGDTRWAIT

常量

第 3844 行

std.c.T.IOCMGET

常量

第 3497 行

std.c.T.IOCMGET

常量

第 3597 行

获取全部调制解调器位

std.c.T.IOCMGET

常量

第 3629 行

std.c.T.IOCMGET

常量

第 3698 行

std.c.T.IOCMGET

常量

第 3735 行

std.c.T.IOCMGET

常量

第 3831 行

std.c.T.IOCMODG

常量

第 3786 行

std.c.T.IOCMODS

常量

第 3787 行

std.c.T.IOCMSDTRWAIT

常量

第 3843 行

std.c.T.IOCMSET

常量

第 3500 行

std.c.T.IOCMSET

常量

第 3591 行

设置所有调制解调器位

std.c.T.IOCMSET

常量

第 3630 行

std.c.T.IOCMSET

常量

第 3699 行

std.c.T.IOCMSET

常量

第 3736 行

std.c.T.IOCMSET

常量

第 3828 行

std.c.T.IOCNOTTY

常量

第 3505 行

std.c.T.IOCNOTTY

常量

第 3575 行

解除 tty 关联

std.c.T.IOCNOTTY

常量

第 3642 行

std.c.T.IOCNOTTY

常量

第 3748 行

std.c.T.IOCNOTTY

常量

第 3816 行

std.c.T.IOCNOTTY

常量

第 3863 行

std.c.T.IOCNXCL

常量

第 3489 行

std.c.T.IOCNXCL

常量

第 3548 行

std.c.T.IOCNXCL

常量

第 3643 行

std.c.T.IOCNXCL

常量

第 3749 行

std.c.T.IOCNXCL

常量

第 3800 行

std.c.T.IOCOUTQ

常量

第 3493 行

std.c.T.IOCOUTQ

常量

第 3573 行

驱动程序输出队列大小

std.c.T.IOCOUTQ

常量

第 3644 行

std.c.T.IOCOUTQ

常量

第 3750 行

std.c.T.IOCOUTQ

常量

第 3814 行

std.c.T.IOCPKT

常量

第 3503 行

std.c.T.IOCPKT

常量

第 3645 行

std.c.T.IOCPKT

常量

第 3751 行

std.c.T.IOCPKT

常量

第 3817 行

std.c.T.IOCPKT_DATA

常量

第 3646 行

std.c.T.IOCPKT_DATA

常量

第 3752 行

std.c.T.IOCPKT_DATA

常量

第 3818 行

std.c.T.IOCPKT_DOSTOP

常量

第 3647 行

std.c.T.IOCPKT_DOSTOP

常量

第 3753 行

std.c.T.IOCPKT_DOSTOP

常量

第 3824 行

std.c.T.IOCPKT_FLUSHREAD

常量

第 3648 行

std.c.T.IOCPKT_FLUSHREAD

常量

第 3754 行

std.c.T.IOCPKT_FLUSHREAD

常量

第 3819 行

std.c.T.IOCPKT_FLUSHWRITE

常量

第 3649 行

std.c.T.IOCPKT_FLUSHWRITE

常量

第 3755 行

std.c.T.IOCPKT_FLUSHWRITE

常量

第 3820 行

std.c.T.IOCPKT_IOCTL

常量

第 3650 行

std.c.T.IOCPKT_IOCTL

常量

第 3756 行

std.c.T.IOCPKT_IOCTL

常量

第 3825 行

std.c.T.IOCPKT_NOSTOP

常量

第 3651 行

std.c.T.IOCPKT_NOSTOP

常量

第 3757 行

std.c.T.IOCPKT_NOSTOP

常量

第 3823 行

std.c.T.IOCPKT_START

常量

第 3652 行

std.c.T.IOCPKT_START

常量

第 3758 行

std.c.T.IOCPKT_START

常量

第 3822 行

std.c.T.IOCPKT_STOP

常量

第 3653 行

std.c.T.IOCPKT_STOP

常量

第 3759 行

std.c.T.IOCPKT_STOP

常量

第 3821 行

std.c.T.IOCPTMGET

常量

第 3654 行

std.c.T.IOCPTMGET

常量

第 3760 行

std.c.T.IOCPTSNAME

常量

第 3655 行

std.c.T.IOCPTSNAME

常量

第 3761 行

std.c.T.IOCRCVFRAME

常量

第 3656 行

std.c.T.IOCRCVFRAME

常量

第 3762 行

std.c.T.IOCREMOTE

常量

第 3657 行

std.c.T.IOCREMOTE

常量

第 3763 行

std.c.T.IOCREMOTE

常量

第 3832 行

std.c.T.IOCSBRK

常量

第 3508 行

std.c.T.IOCSBRK

常量

第 3561 行

设置 break 位

std.c.T.IOCSBRK

常量

第 3658 行

std.c.T.IOCSBRK

常量

第 3700 行

std.c.T.IOCSBRK

常量

第 3764 行

std.c.T.IOCSBRK

常量

第 3808 行

std.c.T.IOCSCTTY

常量

第 3490 行

std.c.T.IOCSCTTY

常量

第 3577 行

获取控制终端

std.c.T.IOCSCTTY

常量

第 3659 行

std.c.T.IOCSCTTY

常量

第 3697 行

std.c.T.IOCSCTTY

常量

第 3765 行

std.c.T.IOCSCTTY

常量

第 3839 行

std.c.T.IOCSCTTY

常量

第 3861 行

std.c.T.IOCSDRAINWAIT

常量

第 3847 行

std.c.T.IOCSDTR

常量

第 3565 行

设置数据终端就绪状态

std.c.T.IOCSDTR

常量

第 3660 行

std.c.T.IOCSDTR

常量

第 3766 行

std.c.T.IOCSDTR

常量

第 3810 行

std.c.T.IOCSETA

常量

第 3661 行

std.c.T.IOCSETA

常量

第 3767 行

std.c.T.IOCSETA

常量

第 3803 行

std.c.T.IOCSETAF

常量

第 3662 行

std.c.T.IOCSETAF

常量

第 3768 行

std.c.T.IOCSETAF

常量

第 3805 行

std.c.T.IOCSETAW

常量

第 3663 行

std.c.T.IOCSETAW

常量

第 3769 行

std.c.T.IOCSETAW

常量

第 3804 行

std.c.T.IOCSETC

常量

第 3550 行

std.c.T.IOCSETD

常量

第 3506 行

std.c.T.IOCSETD

常量

第 3542 行

std.c.T.IOCSETD

常量

第 3664 行

std.c.T.IOCSETD

常量

第 3770 行

std.c.T.IOCSETD

常量

第 3807 行

std.c.T.IOCSETLD

常量

第 3534 行

std.c.T.IOCSETN

常量

第 3546 行

std.c.T.IOCSETP

常量

第 3545 行

std.c.T.IOCSFLAGS

常量

第 3665 行

std.c.T.IOCSFLAGS

常量

第 3771 行

std.c.T.IOCSIG

常量

第 3512 行

std.c.T.IOCSIG

常量

第 3666 行

std.c.T.IOCSIG

常量

第 3772 行

std.c.T.IOCSIG

常量

第 3841 行

std.c.T.IOCSLINED

常量

第 3667 行

std.c.T.IOCSLINED

常量

第 3773 行

std.c.T.IOCSLTC

常量

第 3569 行

设置本地特殊字符

std.c.T.IOCSPGRP

常量

第 3492 行

std.c.T.IOCSPGRP

常量

第 3585 行

设置 tty 的进程组

std.c.T.IOCSPGRP

常量

第 3668 行

std.c.T.IOCSPGRP

常量

第 3696 行

std.c.T.IOCSPGRP

常量

第 3774 行

std.c.T.IOCSPGRP

常量

第 3813 行

std.c.T.IOCSPGRP

常量

第 3854 行

std.c.T.IOCSPPS

常量

第 3538 行

std.c.T.IOCSQSIZE

常量

第 3669 行

std.c.T.IOCSQSIZE

常量

第 3775 行

std.c.T.IOCSSIZE

常量

第 3670 行

std.c.T.IOCSSIZE

常量

第 3776 行

std.c.T.IOCSSOFTCAR

常量

第 3526 行

std.c.T.IOCSTART

常量

第 3581 行

开始输出,类似 ^Q

std.c.T.IOCSTART

常量

第 3671 行

std.c.T.IOCSTART

常量

第 3777 行

std.c.T.IOCSTART

常量

第 3827 行

std.c.T.IOCSTAT

常量

第 3672 行

std.c.T.IOCSTAT

常量

第 3778 行

std.c.T.IOCSTAT

常量

第 3836 行

std.c.T.IOCSTI

常量

第 3494 行

std.c.T.IOCSTI

常量

第 3589 行

模拟终端输入

std.c.T.IOCSTI

常量

第 3673 行

std.c.T.IOCSTI

常量

第 3779 行

std.c.T.IOCSTI

常量

第 3815 行

std.c.T.IOCSTI

常量

第 3862 行

std.c.T.IOCSTOP

常量

第 3579 行

停止输出,如 ^S

std.c.T.IOCSTOP

常量

第 3674 行

std.c.T.IOCSTOP

常量

第 3780 行

std.c.T.IOCSTOP

常量

第 3826 行

std.c.T.IOCSWINSZ

常量

第 3496 行

std.c.T.IOCSWINSZ

常量

第 3523 行

std.c.T.IOCSWINSZ

常量

第 3675 行

std.c.T.IOCSWINSZ

常量

第 3693 行

std.c.T.IOCSWINSZ

常量

第 3781 行

std.c.T.IOCSWINSZ

常量

第 3834 行

std.c.T.IOCSWINSZ

常量

第 3864 行

std.c.T.IOCTIMESTAMP

常量

第 3845 行

std.c.T.IOCUCNTL

常量

第 3676 行

std.c.T.IOCUCNTL

常量

第 3782 行

std.c.T.IOCUCNTL

常量

第 3835 行

std.c.T.IOCXMTFRAME

常量

第 3677 行

std.c.T.IOCXMTFRAME

常量

第 3783 行

std.c.T.ior

函数

第 3483 行

fn ior(inout: u32, group_arg: usize, num: usize, len: usize) usize

参数

inout: u32
group_arg: usize
num: usize
len: usize

std.c.T.tioc

函数

第 3599 行

fn tioc(t: u16, num: u8) u16

参数

t: u16
num: u8

std.c.TASK

别名

第 11767 行

别名目标 std.c.darwin.TASK

std.c.task_flavor_t

别名

第 11874 行

别名目标 std.c.darwin.task_flavor_t

std.c.task_for_pid

别名

第 11875 行

别名目标 std.c.darwin.task_for_pid

std.c.task_get_exception_ports

别名

第 11876 行

别名目标 std.c.darwin.task_get_exception_ports

std.c.task_info

别名

第 11877 行

别名目标 std.c.darwin.task_info

std.c.task_info_t

别名

第 11878 行

别名目标 std.c.darwin.task_info_t

std.c.task_name_t

别名

第 11879 行

别名目标 std.c.darwin.task_name_t

std.c.TASK_NULL

别名

第 11768 行

别名目标 std.c.darwin.TASK_NULL

std.c.task_policy_flavor_t

别名

第 11932 行

别名目标 std.c.darwin.task_policy_flavor_t

std.c.task_policy_t

别名

第 11933 行

别名目标 std.c.darwin.task_policy_t

std.c.task_read_t

别名

第 11934 行

别名目标 std.c.darwin.task_read_t

std.c.task_resume

别名

第 11880 行

别名目标 std.c.darwin.task_resume

std.c.task_set_exception_ports

别名

第 11881 行

别名目标 std.c.darwin.task_set_exception_ports

std.c.task_suspend

别名

第 11882 行

别名目标 std.c.darwin.task_suspend

std.c.task_t

别名

第 11935 行

别名目标 std.c.darwin.task_t

std.c.task_threads

别名

第 11883 行

别名目标 std.c.darwin.task_threads

std.c.TASK_VM_INFO

别名

第 11769 行

别名目标 std.c.darwin.TASK_VM_INFO

std.c.TASK_VM_INFO_COUNT

别名

第 11770 行

别名目标 std.c.darwin.TASK_VM_INFO_COUNT

std.c.task_vm_info_data_t

别名

第 11884 行

别名目标 std.c.darwin.task_vm_info_data_t

std.c.taskid_t

别名

第 11645 行

别名目标 std.c.illumos.taskid_t

std.c.tc_cflag_t

类型

第 9447 行

std.c.tc_iflag_t

类型

第 9238 行

std.c.tc_lflag_t

类型

第 9596 行

std.c.tc_oflag_t

类型

第 9349 行

std.c.TCFLUSH

别名

第 11676 行

别名目标 std.c.openbsd.TCFLUSH

std.c.tcgetattr

函数

第 11146 行

pub extern "c" fn tcgetattr(fd: fd_t, termios_p: *termios) c_int

参数

fd: fd_t
termios_p: *termios

std.c.TCIO

别名

第 11677 行

别名目标 std.c.openbsd.TCIO

std.c.TCP

类型

第 6231 行

std.c.TCP.MAXSEG

常量

第 6245 行

std.c.TCP.NODELAY

常量

第 6244 行

std.c.TCSA

别名

第 3874 行

别名目标 std.posix.TCSA

std.c.tcsetattr

函数

第 11147 行

pub extern "c" fn tcsetattr(fd: fd_t, optional_action: TCSA, termios_p: *const termios) c_int

参数

fd: fd_t
optional_action: TCSA
termios_p: *const termios

std.c.team_id

别名

第 11669 行

别名目标 std.c.haiku.team_id

std.c.telldir

函数

第 10572 行

pub extern "c" fn telldir(dp: *DIR) c_long

参数

dp: *DIR

std.c.termios

类型

第 9187 行

std.c.TFD

类型

第 3875 行

std.c.THREAD

别名

第 11771 行

别名目标 std.c.darwin.THREAD

std.c.thread_act_t

别名

第 11936 行

别名目标 std.c.darwin.thread_act_t

std.c.thread_basic_info

别名

第 11885 行

别名目标 std.c.darwin.thread_basic_info

std.c.THREAD_BASIC_INFO

别名

第 11772 行

别名目标 std.c.darwin.THREAD_BASIC_INFO

std.c.THREAD_BASIC_INFO_COUNT

别名

第 11773 行

别名目标 std.c.darwin.THREAD_BASIC_INFO_COUNT

std.c.thread_flavor_t

别名

第 11937 行

别名目标 std.c.darwin.thread_flavor_t

std.c.thread_get_state

别名

第 11886 行

别名目标 std.c.darwin.thread_get_state

std.c.thread_id

别名

第 11670 行

别名目标 std.c.haiku.thread_id

std.c.thread_identifier_info

别名

第 11887 行

别名目标 std.c.darwin.thread_identifier_info

std.c.THREAD_IDENTIFIER_INFO_COUNT

别名

第 11774 行

别名目标 std.c.darwin.THREAD_IDENTIFIER_INFO_COUNT

std.c.thread_info

别名

第 11888 行

别名目标 std.c.darwin.thread_info

std.c.thread_info_t

别名

第 11889 行

别名目标 std.c.darwin.thread_info_t

std.c.THREAD_NULL

别名

第 11775 行

别名目标 std.c.darwin.THREAD_NULL

std.c.thread_port_t

别名

第 11938 行

别名目标 std.c.darwin.thread_port_t

std.c.thread_resume

别名

第 11890 行

别名目标 std.c.darwin.thread_resume

std.c.thread_set_state

别名

第 11891 行

别名目标 std.c.darwin.thread_set_state

std.c.thread_state_flavor_t

别名

第 11939 行

别名目标 std.c.darwin.thread_state_flavor_t

std.c.THREAD_STATE_NONE

别名

第 11776 行

别名目标 std.c.darwin.THREAD_STATE_NONE

std.c.thread_state_t

别名

第 11940 行

别名目标 std.c.darwin.thread_state_t

std.c.thread_t

别名

第 11941 行

别名目标 std.c.darwin.thread_t

std.c.time_t

类型

第 7244 行

std.c.time_value_t

别名

第 11942 行

别名目标 std.c.darwin.time_value_t

std.c.TIMER

类型

第 11522 行

std.c.TIMERFD_CLOCK

别名

第 282 行

别名目标 std.c.timerfd_clockid_t

std.c.timerfd_clockid_t

类型

第 283 行

std.c.timerfd_create

函数

第 10678 行

pub extern "c" fn timerfd_create(clockid: timerfd_clockid_t, flags: c_int) c_int

参数

clockid: timerfd_clockid_t
flags: c_int

std.c.timerfd_gettime

函数

第 10685 行

pub extern "c" fn timerfd_gettime(fd: c_int, curr_value: *itimerspec) c_int

参数

fd: c_int
curr_value: *itimerspec

std.c.timerfd_settime

函数

第 10679 行

pub extern "c" fn timerfd_settime( fd: c_int, flags: c_int, new_value: *const itimerspec, old_value: ?*itimerspec, ) c_int

参数

fd: c_int
flags: c_int
new_value: *const itimerspec
old_value: ?*itimerspec

std.c.timespec

类型

第 120 行

std.c.timespec.fromTimestamp

函数

第 128 行

pub fn fromTimestamp(tm: wasi.timestamp_t) timespec

参数

std.c.timespec.toTimestamp

函数

第 137 行

pub fn toTimestamp(ts: timespec) wasi.timestamp_t

参数

ts: timespec

std.c.timeval

类型

第 7262 行

std.c.timezone

类型

第 7278 行

std.c.uid_from_user

别名

第 11730 行

别名目标 std.c.openbsd.uid_from_user

std.c.uid_t

类型

第 182 行

std.c.uintmax_t

类型

第 11506 行

std.c.UL

别名

第 11777 行

别名目标 std.c.darwin.UL

std.c.umask

函数

第 11139 行

pub extern "c" fn umask(mode: mode_t) mode_t

参数

mode: mode_t

std.c.UMTX_ABSTIME

别名

第 11736 行

别名目标 std.c.freebsd.UMTX_ABSTIME

std.c.UMTX_OP

别名

第 11737 行

别名目标 std.c.freebsd.UMTX_OP

std.c.umtx_sleep

别名

第 11958 行

别名目标 std.c.dragonfly.umtx_sleep

std.c.umtx_wakeup

别名

第 11959 行

别名目标 std.c.dragonfly.umtx_wakeup

std.c.uname

函数

第 11149 行

pub extern "c" fn uname(buf: *utsname) c_int

参数

buf: *utsname

std.c.unlink

函数

第 11087 行

pub extern "c" fn unlink(path: [*:0]const u8) c_int

参数

path: [*:0]const u8

std.c.unlinkat

函数

第 11088 行

pub extern "c" fn unlinkat(dirfd: fd_t, path: [*:0]const u8, flags: c_uint) c_int

参数

dirfd: fd_t
path: [*:0]const u8
flags: c_uint

std.c.unveil

别名

第 11731 行

别名目标 std.c.openbsd.unveil

std.c.user_desc

类型

第 7289 行

std.c.user_from_uid

别名

第 11732 行

别名目标 std.c.openbsd.user_from_uid

std.c.UTIME

类型

第 98 行

与 utimensat 和 futimens 配合使用。

std.c.UTIME.NOW

常量

第 100 行

timespec

std.c.UTIME.NOW

常量

第 105 行

timespec

std.c.UTIME.NOW

常量

第 110 行

timespec

std.c.UTIME.NOW

常量

第 114 行

timespec

std.c.UTIME.OMIT

常量

第 101 行

timespec

std.c.UTIME.OMIT

常量

第 106 行

timespec

std.c.UTIME.OMIT

常量

第 111 行

timespec

std.c.UTIME.OMIT

常量

第 115 行

timespec

std.c.utimensat

函数

第 11220 行

pub extern "c" fn utimensat(dirfd: fd_t, pathname: [*:0]const u8, times: ?*const [2]timespec, flags: u32) c_int

参数

dirfd: fd_t
pathname: [*:0]const u8
times: ?*const [2]timespec
flags: u32

std.c.utimes

函数

第 11218 行

pub extern "c" fn utimes(path: [*:0]const u8, times: ?*[2]timeval) c_int

参数

path: [*:0]const u8
times: ?*[2]timeval

std.c.utsname

类型

第 7293 行

std.c.utsname.UTSNAME_ENTRY_LEN

常量

第 7327 行

std.c.V

类型

第 9057 行

termios 结构体中 cc 数组的索引。

std.c.VDSO

类型

第 3879 行

std.c.versionCheck

函数

第 57 行

  • 未链接 libc 时返回 false。
  • 链接 musl libc 时返回 true。
  • 链接 GNU libc,即 glibc 时,若目标版本大于或等于 version,则返回 true。
  • 链接 Android libc,即 bionic 时,若目标 API 级别大于或 等于 version.major,则返回 true,忽略其他分量。
  • 链接其他 libc 时返回 false。
pub inline fn versionCheck(comptime version: std.SemanticVersion) bool

参数

version: std.SemanticVersion

std.c.VM

别名

第 11778 行

别名目标 std.c.darwin.VM

std.c.vm_address_t

别名

第 11892 行

别名目标 std.c.darwin.vm_address_t

std.c.vm_behavior_t

别名

第 11944 行

别名目标 std.c.darwin.vm_behavior_t

std.c.vm_deallocate

别名

第 11893 行

别名目标 std.c.darwin.vm_deallocate

std.c.vm_inherit_t

别名

第 11945 行

别名目标 std.c.darwin.vm_inherit_t

std.c.vm_machine_attribute

别名

第 11894 行

别名目标 std.c.darwin.vm_machine_attribute

std.c.vm_machine_attribute_t

别名

第 11895 行

别名目标 std.c.darwin.vm_machine_attribute_t

std.c.vm_machine_attribute_val_t

别名

第 11896 行

别名目标 std.c.darwin.vm_machine_attribute_val_t

std.c.vm_map_read_t

别名

第 11946 行

别名目标 std.c.darwin.vm_map_read_t

std.c.vm_map_t

别名

第 11897 行

别名目标 std.c.darwin.vm_map_t

std.c.vm_object_id_t

别名

第 11947 行

别名目标 std.c.darwin.vm_object_id_t

std.c.vm_offset_t

别名

第 11898 行

别名目标 std.c.darwin.vm_offset_t

std.c.vm_prot_t

别名

第 11899 行

别名目标 std.c.darwin.vm_prot_t

std.c.vm_region_basic_info_64

别名

第 11900 行

别名目标 std.c.darwin.vm_region_basic_info_64

std.c.vm_region_extended_info

别名

第 11901 行

别名目标 std.c.darwin.vm_region_extended_info

std.c.vm_region_flavor_t

别名

第 11948 行

别名目标 std.c.darwin.vm_region_flavor_t

std.c.vm_region_info_t

别名

第 11902 行

别名目标 std.c.darwin.vm_region_info_t

std.c.vm_region_recurse_info_t

别名

第 11903 行

别名目标 std.c.darwin.vm_region_recurse_info_t

std.c.vm_region_submap_info_64

别名

第 11904 行

别名目标 std.c.darwin.vm_region_submap_info_64

std.c.vm_region_submap_short_info_64

别名

第 11905 行

别名目标 std.c.darwin.vm_region_submap_short_info_64

std.c.vm_region_top_info

别名

第 11906 行

别名目标 std.c.darwin.vm_region_top_info

std.c.vm_size_t

别名

第 11804 行

别名目标 std.c.darwin.vm_size_t

std.c.vm32_object_id_t

别名

第 11943 行

别名目标 std.c.darwin.vm32_object_id_t

std.c.W

类型

第 3883 行

std.c.W_OK

常量

第 1250 行

测试写入权限。

std.c.W.CONTINUED

常量

第 3920 行

std.c.W.CONTINUED

常量

第 3949 行

std.c.W.CONTINUED

常量

第 3982 行

std.c.W.CONTINUED

常量

第 4015 行

std.c.W.CONTINUED

常量

第 4043 行

std.c.W.CONTINUED

常量

第 4075 行

std.c.W.CONTINUED

常量

第 4108 行

std.c.W.EXITED

常量

第 3922 行

std.c.W.EXITED

常量

第 3945 行

std.c.W.EXITED

常量

第 3984 行

std.c.W.EXITED

常量

第 4018 行

std.c.W.EXITED

常量

第 4044 行

std.c.W.EXITED

常量

第 4107 行

std.c.W.EXITSTATUS

函数

第 3892 行

pub fn EXITSTATUS(x: u32) u8

参数

x: u32

std.c.W.EXITSTATUS

函数

第 3925 行

pub fn EXITSTATUS(s: u32) u8

参数

s: u32

std.c.W.EXITSTATUS

函数

第 3953 行

pub fn EXITSTATUS(s: u32) u8

参数

s: u32

std.c.W.EXITSTATUS

函数

第 3987 行

pub fn EXITSTATUS(s: u32) u8

参数

s: u32

std.c.W.EXITSTATUS

函数

第 4021 行

pub fn EXITSTATUS(s: u32) u8

参数

s: u32

std.c.W.EXITSTATUS

函数

第 4048 行

pub fn EXITSTATUS(s: u32) u8

参数

s: u32

std.c.W.EXITSTATUS

函数

第 4077 行

pub fn EXITSTATUS(s: u32) u8

参数

s: u32

std.c.W.EXITSTATUS

函数

第 4111 行

pub fn EXITSTATUS(s: u32) u8

参数

s: u32

std.c.W.IFCONTINUED

函数

第 3966 行

pub fn IFCONTINUED(s: u32) bool

参数

s: u32

std.c.W.IFCONTINUED

函数

第 4000 行

pub fn IFCONTINUED(s: u32) bool

参数

s: u32

std.c.W.IFCONTINUED

函数

第 4090 行

pub fn IFCONTINUED(s: u32) bool

参数

s: u32

std.c.W.IFCONTINUED

函数

第 4135 行

pub fn IFCONTINUED(s: u32) bool

参数

s: u32

std.c.W.IFEXITED

函数

第 3901 行

pub fn IFEXITED(x: u32) bool

参数

x: u32

std.c.W.IFEXITED

函数

第 3934 行

pub fn IFEXITED(s: u32) bool

参数

s: u32

std.c.W.IFEXITED

函数

第 3962 行

pub fn IFEXITED(s: u32) bool

参数

s: u32

std.c.W.IFEXITED

函数

第 3996 行

pub fn IFEXITED(s: u32) bool

参数

s: u32

std.c.W.IFEXITED

函数

第 4030 行

pub fn IFEXITED(s: u32) bool

参数

s: u32

std.c.W.IFEXITED

函数

第 4060 行

pub fn IFEXITED(s: u32) bool

参数

s: u32

std.c.W.IFEXITED

函数

第 4086 行

pub fn IFEXITED(s: u32) bool

参数

s: u32

std.c.W.IFEXITED

函数

第 4123 行

pub fn IFEXITED(s: u32) bool

参数

s: u32

std.c.W.IFSIGNALED

函数

第 3907 行

pub fn IFSIGNALED(x: u32) bool

参数

x: u32

std.c.W.IFSIGNALED

函数

第 3940 行

pub fn IFSIGNALED(s: u32) bool

参数

s: u32

std.c.W.IFSIGNALED

函数

第 3974 行

pub fn IFSIGNALED(s: u32) bool

参数

s: u32

std.c.W.IFSIGNALED

函数

第 4008 行

pub fn IFSIGNALED(s: u32) bool

参数

s: u32

std.c.W.IFSIGNALED

函数

第 4036 行

pub fn IFSIGNALED(s: u32) bool

参数

s: u32

std.c.W.IFSIGNALED

函数

第 4068 行

pub fn IFSIGNALED(s: u32) bool

参数

s: u32

std.c.W.IFSIGNALED

函数

第 4098 行

pub fn IFSIGNALED(s: u32) bool

参数

s: u32

std.c.W.IFSIGNALED

函数

第 4131 行

pub fn IFSIGNALED(s: u32) bool

参数

s: u32

std.c.W.IFSTOPPED

函数

第 3904 行

pub fn IFSTOPPED(x: u32) bool

参数

x: u32

std.c.W.IFSTOPPED

函数

第 3937 行

pub fn IFSTOPPED(s: u32) bool

参数

s: u32

std.c.W.IFSTOPPED

函数

第 3970 行

pub fn IFSTOPPED(s: u32) bool

参数

s: u32

std.c.W.IFSTOPPED

函数

第 4004 行

pub fn IFSTOPPED(s: u32) bool

参数

s: u32

std.c.W.IFSTOPPED

函数

第 4033 行

pub fn IFSTOPPED(s: u32) bool

参数

s: u32

std.c.W.IFSTOPPED

函数

第 4064 行

pub fn IFSTOPPED(s: u32) bool

参数

s: u32

std.c.W.IFSTOPPED

函数

第 4094 行

pub fn IFSTOPPED(s: u32) bool

参数

s: u32

std.c.W.IFSTOPPED

函数

第 4127 行

pub fn IFSTOPPED(s: u32) bool

参数

s: u32

std.c.W.NOHANG

常量

第 3888 行

[XSI] 等待时不阻塞或没有可回收的子进程

std.c.W.NOHANG

常量

第 3917 行

std.c.W.NOHANG

常量

第 3950 行

std.c.W.NOHANG

常量

第 3979 行

std.c.W.NOHANG

常量

第 4013 行

std.c.W.NOHANG

常量

第 4041 行

std.c.W.NOHANG

常量

第 4073 行

std.c.W.NOHANG

常量

第 4104 行

std.c.W.NOWAIT

常量

第 3921 行

std.c.W.NOWAIT

常量

第 3951 行

std.c.W.NOWAIT

常量

第 3983 行

std.c.W.NOWAIT

常量

第 4017 行

std.c.W.NOWAIT

常量

第 4046 行

std.c.W.NOWAIT

常量

第 4109 行

std.c.W.status

函数

第 3911 行

fn status(x: u32) u32

参数

x: u32

std.c.W.stopped

常量

第 3914 行

std.c.W.STOPPED

别名

第 3919 行

别名目标 std.c.W.UNTRACED

std.c.W.STOPPED

别名

第 3948 行

别名目标 std.c.W.UNTRACED

std.c.W.STOPPED

别名

第 3981 行

别名目标 std.c.W.UNTRACED

std.c.W.STOPPED

别名

第 4016 行

别名目标 std.c.W.UNTRACED

std.c.W.STOPPED

常量

第 4045 行

std.c.W.STOPPED

别名

第 4106 行

别名目标 std.c.W.UNTRACED

std.c.W.STOPSIG

函数

第 3898 行

pub fn STOPSIG(x: u32) SIG

参数

x: u32

std.c.W.STOPSIG

函数

第 3931 行

pub fn STOPSIG(s: u32) SIG

参数

s: u32

std.c.W.STOPSIG

函数

第 3959 行

pub fn STOPSIG(s: u32) SIG

参数

s: u32

std.c.W.STOPSIG

函数

第 3993 行

pub fn STOPSIG(s: u32) SIG

参数

s: u32

std.c.W.STOPSIG

函数

第 4027 行

pub fn STOPSIG(s: u32) SIG

参数

s: u32

std.c.W.STOPSIG

函数

第 4056 行

pub fn STOPSIG(s: u32) SIG

参数

s: u32

std.c.W.STOPSIG

函数

第 4083 行

pub fn STOPSIG(s: u32) SIG

参数

s: u32

std.c.W.STOPSIG

函数

第 4115 行

pub fn STOPSIG(s: u32) SIG

参数

s: u32

std.c.W.TERMSIG

函数

第 3895 行

pub fn TERMSIG(x: u32) SIG

参数

x: u32

std.c.W.TERMSIG

函数

第 3928 行

pub fn TERMSIG(s: u32) SIG

参数

s: u32

std.c.W.TERMSIG

函数

第 3956 行

pub fn TERMSIG(s: u32) SIG

参数

s: u32

std.c.W.TERMSIG

函数

第 3990 行

pub fn TERMSIG(s: u32) SIG

参数

s: u32

std.c.W.TERMSIG

函数

第 4024 行

pub fn TERMSIG(s: u32) SIG

参数

s: u32

std.c.W.TERMSIG

函数

第 4052 行

pub fn TERMSIG(s: u32) SIG

参数

s: u32

std.c.W.TERMSIG

函数

第 4080 行

pub fn TERMSIG(s: u32) SIG

参数

s: u32

std.c.W.TERMSIG

函数

第 4119 行

pub fn TERMSIG(s: u32) SIG

参数

s: u32

std.c.W.TRAPPED

常量

第 3923 行

std.c.W.TRAPPED

常量

第 3946 行

std.c.W.TRAPPED

常量

第 3985 行

std.c.W.TRAPPED

常量

第 4019 行

std.c.W.UNTRACED

常量

第 3890 行

[XSI] 在停止时通知未跟踪的子进程

std.c.W.UNTRACED

常量

第 3918 行

std.c.W.UNTRACED

常量

第 3947 行

std.c.W.UNTRACED

常量

第 3980 行

std.c.W.UNTRACED

常量

第 4014 行

std.c.W.UNTRACED

常量

第 4042 行

std.c.W.UNTRACED

常量

第 4074 行

std.c.W.UNTRACED

常量

第 4105 行

std.c.wait4

常量

第 11092 行

std.c.waitpid

函数

第 11090 行

pub extern "c" fn waitpid(pid: pid_t, status: ?*c_int, options: c_int) pid_t

参数

pid: pid_t
status: ?*c_int
options: c_int

std.c.wasi

别名

第 14 行

别名目标 std.os.wasi

std.c.wchar_t

类型

第 11513 行

std.c.wcsdup

常量

第 11558 行

std.c.wcsnlen

函数

第 11557 行

pub extern "c" fn wcsnlen(s: [*:0]const wchar_t, n: usize) callconv(.c) usize

参数

s: [*:0]const wchar_t
n: usize

std.c.whence_t

类型

第 9926 行

std.c.windows

别名

第 15 行

别名目标 std.os.windows

std.c.winsize

别名

第 32 行

别名目标 std.posix.winsize

std.c.wint_t

类型

第 11508 行

std.c.write

函数

第 11079 行

pub extern "c" fn write(fd: fd_t, buf: [*]const u8, nbyte: usize) isize

参数

fd: fd_t
buf: [*]const u8
nbyte: usize

std.c.writev

函数

第 11077 行

pub extern "c" fn writev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint) isize

参数

fd: c_int
iov: [*]const iovec_const
iovcnt: c_uint

std.c.writev_pos

别名

第 11671 行

别名目标 std.c.haiku.writev_pos

std.c.ws2_32

别名

第 16 行

别名目标 std.os.windows.ws2_32

std.c.X_OK

常量

第 1244 行

测试执行权限或搜索权限。

std.c.zoneid_t

别名

第 11646 行

别名目标 std.c.illumos.zoneid_t

源码

std/c.zig

const builtin = @import("builtin");
const native_abi = builtin.abi;
const native_arch = builtin.cpu.arch;
const native_os = builtin.os.tag;
const native_endian = builtin.cpu.arch.endian();

const std = @import("std");
const c = @This();
const maxInt = std.math.maxInt;
const assert = std.debug.assert;
const page_size = std.heap.page_size_min;
const linux = std.os.linux;
const emscripten = std.os.emscripten;
const wasi = std.os.wasi;
const windows = std.os.windows;
const ws2_32 = std.os.windows.ws2_32;
const darwin = @import("c/darwin.zig");
const freebsd = @import("c/freebsd.zig");
const illumos = @import("c/illumos.zig");
const netbsd = @import("c/netbsd.zig");
const dragonfly = @import("c/dragonfly.zig");
const haiku = @import("c/haiku.zig");
const openbsd = @import("c/openbsd.zig");
const serenity = @import("c/serenity.zig");

// 即使不链接 libc,这些常量也由所有操作系统共享。
//

pub const iovec = std.posix.iovec;
pub const iovec_const = std.posix.iovec_const;
pub const LOCK = std.posix.LOCK;
pub const winsize = std.posix.winsize;

/// 链接编辑器定义的符号 _MH_EXECUTE_SYM 的值,是
/// Mach-O 可执行文件中 mach 头部的地址。它不会出现在
/// MH_EXECUTE 之外的文件类型中。该符号的类型为
/// 绝对符号,因为头部不属于任何节。
/// 链接系统 libc 时会填充此符号,而此操作系统保证
/// 会链接系统 libc。不过,构建目标文件或库时,
/// 直到最终可执行文件才会链接系统 libc。因此这里
/// 导出弱符号,以便由真正的符号覆盖。
pub extern var _mh_execute_header: mach_hdr;
var dummy_execute_header: mach_hdr = undefined;
comptime {
    if (native_os.isDarwin()) {
        @export(&dummy_execute_header, .{ .name = "_mh_execute_header", .linkage = .weak });
    }
}

/// * 未链接 libc 时返回 `false`。
/// * 链接 musl libc 时返回 `true`。
/// * 链接 GNU libc,即 glibc 时,若目标版本大于或等于
///   `version`,则返回 `true`。
/// * 链接 Android libc,即 bionic 时,若目标 API 级别大于或
///   等于 `version.major`,则返回 `true`,忽略其他分量。
/// * 链接其他 libc 时返回 `false`。
pub inline fn versionCheck(comptime version: std.SemanticVersion) bool {
    return comptime blk: {
        if (!builtin.link_libc) break :blk false;
        if (native_abi.isMusl()) break :blk true;
        if (builtin.target.isGnuLibC()) {
            const ver = builtin.os.versionRange().gnuLibCVersion().?;
            break :blk switch (ver.order(version)) {
                .gt, .eq => true,
                .lt => false,
            };
        } else if (builtin.abi.isAndroid()) {
            break :blk builtin.os.version_range.linux.android >= version.major;
        } else {
            break :blk false;
        }
    };
}

/// rc 为 -1 时获取 errno;rc 不为 -1 时返回 SUCCESS。
pub fn errno(rc: anytype) E {
    return if (rc == -1) @fromBackingInt(@intCast(_errno().*)) else .SUCCESS;
}

pub const ino_t = switch (native_os) {
    .linux => linux.ino_t,
    .emscripten => emscripten.ino_t,
    .wasi => wasi.inode_t,
    .windows => windows.LARGE_INTEGER,
    .haiku => i64,
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L38
    else => u64,
};

pub const off_t = switch (native_os) {
    .linux => linux.off_t,
    .emscripten => emscripten.off_t,
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L39
    else => i64,
};

/// 与 `utimensat` 和 `futimens` 配合使用。
pub const UTIME = switch (native_os) {
    .dragonfly, .freebsd, .illumos, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .wasi => struct {
        pub const NOW: timespec = .{ .sec = 0, .nsec = -1 };
        pub const OMIT: timespec = .{ .sec = 0, .nsec = -2 };
    },
    .emscripten => emscripten.UTIME,
    .haiku => struct {
        pub const NOW: timespec = .{ .sec = 0, .nsec = 1000000000 };
        pub const OMIT: timespec = .{ .sec = 0, .nsec = 1000000001 };
    },
    .linux => linux.UTIME,
    .netbsd => struct {
        pub const NOW: timespec = .{ .sec = 0, .nsec = 0x3fffffff };
        pub const OMIT: timespec = .{ .sec = 0, .nsec = 0x3ffffffe };
    },
    .openbsd, .serenity => struct {
        pub const NOW: timespec = .{ .sec = 0, .nsec = -2 };
        pub const OMIT: timespec = .{ .sec = 0, .nsec = -1 };
    },
    else => void,
};

pub const timespec = switch (native_os) {
    .linux => linux.timespec,
    .emscripten => emscripten.timespec,
    // 头文件路径:lib/libc/include/wasm-wasi-musl/__struct_timespec.h
    .wasi => extern struct {
        sec: time_t,
        nsec: c_long,

        pub fn fromTimestamp(tm: wasi.timestamp_t) timespec {
            const sec: wasi.timestamp_t = tm / 1_000_000_000;
            const nsec = tm - sec * 1_000_000_000;
            return .{
                .sec = @as(time_t, @intCast(sec)),
                .nsec = @as(isize, @intCast(nsec)),
            };
        }

        pub fn toTimestamp(ts: timespec) wasi.timestamp_t {
            return @as(wasi.timestamp_t, @intCast(ts.sec * 1_000_000_000)) +
                @as(wasi.timestamp_t, @intCast(ts.nsec));
        }
    },
    // https://github.com/SerenityOS/serenity/blob/0a78056453578c18e0a04a0b45ebfb1c96d59005/Kernel/API/POSIX/time.h#L17-L20
    .dragonfly, .freebsd, .netbsd, .openbsd, .illumos, .haiku, .serenity, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .windows => extern struct {
        sec: time_t,
        nsec: c_long,
    },
    else => void,
};

pub const dev_t = switch (native_os) {
    .emscripten => emscripten.dev_t,
    .wasi => wasi.device_t,
    .openbsd, .haiku, .illumos, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => i32,
    // glibc 和 musl 将 dev_t 定义为 u64,而 Linux 内核中为 u32。
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L43
    .linux, .netbsd, .freebsd, .serenity => u64,
    else => void,
};

pub const mode_t = switch (native_os) {
    .linux => linux.mode_t,
    .emscripten => emscripten.mode_t,
    .openbsd, .haiku, .netbsd, .illumos, .windows => u32,
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L44
    .freebsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .dragonfly, .serenity => u16,
    .wasi => if (builtin.link_libc) u32 else u0, // WASI libc 模拟 mode。
    else => u0,
};

pub const nlink_t = switch (native_os) {
    .linux => linux.nlink_t,
    .emscripten => emscripten.nlink_t,
    .wasi => c_ulonglong,
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L45
    .freebsd, .serenity => u64,
    .openbsd, .netbsd, .dragonfly, .illumos, .windows => u32,
    .haiku => i32,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => u16,
    else => u0,
};

pub const uid_t = switch (native_os) {
    .linux => linux.uid_t,
    .emscripten => emscripten.uid_t,
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L28
    else => u32,
};

pub const gid_t = switch (native_os) {
    .linux => linux.gid_t,
    .emscripten => emscripten.gid_t,
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L29
    else => u32,
};

pub const blksize_t = switch (native_os) {
    .linux => linux.blksize_t,
    .emscripten => emscripten.blksize_t,
    .wasi => c_long,
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L42
    .serenity => u64,
    else => i32,
};

pub const passwd = switch (native_os) {
    // https://github.com/SerenityOS/serenity/blob/7442cfb5072b74a62c0e061e6e9ff44fda08780d/Userland/Libraries/LibC/pwd.h#L15-L23
    .linux, .serenity => extern struct {
        name: ?[*:0]const u8, // 用户名
        passwd: ?[*:0]const u8, // 用户密码
        uid: uid_t, // 用户 ID
        gid: gid_t, // 组 ID
        gecos: ?[*:0]const u8, // 用户信息
        dir: ?[*:0]const u8, // 用户主目录
        shell: ?[*:0]const u8, // shell 程序
    },
    .netbsd, .openbsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        name: ?[*:0]const u8, // 用户名
        passwd: ?[*:0]const u8, // 加密密码
        uid: uid_t, // 用户 uid
        gid: gid_t, // 用户组标识
        change: time_t, // 密码更改时间
        class: ?[*:0]const u8, // 用户访问类
        gecos: ?[*:0]const u8, // Honeywell 登录信息
        dir: ?[*:0]const u8, // 用户主目录
        shell: ?[*:0]const u8, // 默认 shell
        expire: time_t, // 账户到期时间
    },
    .dragonfly, .freebsd => extern struct {
        name: ?[*:0]const u8, // 用户名
        passwd: ?[*:0]const u8, // 加密密码
        uid: uid_t, // 用户 uid
        gid: gid_t, // 用户组标识
        change: time_t, // 密码更改时间
        class: ?[*:0]const u8, // 用户访问类
        gecos: ?[*:0]const u8, // Honeywell 登录信息
        dir: ?[*:0]const u8, // 用户主目录
        shell: ?[*:0]const u8, // 默认 shell
        expire: time_t, // 账户到期时间
        fields: c_int, // 内部
    },
    else => void,
};

pub const group = switch (native_os) {
    .linux, .freebsd, .openbsd, .dragonfly, .netbsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        name: ?[*:0]const u8,
        passwd: ?[*:0]const u8,
        gid: gid_t,
        mem: [*:null]?[*:0]const u8,
    },
    else => void,
};

pub const blkcnt_t = switch (native_os) {
    .linux => linux.blkcnt_t,
    .emscripten => emscripten.blkcnt_t,
    .wasi => c_longlong,
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L41
    .serenity => u64,
    else => i64,
};

pub const fd_t = switch (native_os) {
    .linux => linux.fd_t,
    .wasi => wasi.fd_t,
    .windows => windows.HANDLE,
    .serenity => c_int,
    else => i32,
};

pub const ARCH = switch (native_os) {
    .linux => linux.ARCH,
    else => void,
};

// 供 posix.timerfd_create() 使用。
// 实际上,timerfd_create() 函数的参数是整数,
// 意味着开发者必须自行判断哪个值适用。
// 为简化此过程,尤其是提高安全性,因为错误值会导致
// panic,这里引入枚举,只允许
// 实际有效的值。
pub const TIMERFD_CLOCK = timerfd_clockid_t;
pub const timerfd_clockid_t = switch (native_os) {
    .freebsd => enum(u32) {
        REALTIME = 0,
        MONOTONIC = 4,
        _,
    },
    .linux => linux.timerfd_clockid_t,
    else => clockid_t,
};

pub const CLOCK = clockid_t;
pub const clockid_t = switch (native_os) {
    .linux, .emscripten => linux.clockid_t,
    .wasi => wasi.clockid_t,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => enum(u32) {
        REALTIME = 0,
        MONOTONIC = 6,
        MONOTONIC_RAW = 4,
        MONOTONIC_RAW_APPROX = 5,
        UPTIME_RAW = 8,
        UPTIME_RAW_APPROX = 9,
        PROCESS_CPUTIME_ID = 12,
        THREAD_CPUTIME_ID = 16,
        _,
    },
    .haiku => enum(i32) {
        /// 系统范围的单调时钟(也称系统时间)
        MONOTONIC = 0,
        /// 系统范围的实时时钟
        REALTIME = -1,
        /// 测量当前进程已用 CPU 时间的时钟
        PROCESS_CPUTIME_ID = -2,
        /// 测量当前线程已用 CPU 时间的时钟
        THREAD_CPUTIME_ID = -3,
    },
    .freebsd => enum(u32) {
        REALTIME = 0,
        VIRTUAL = 1,
        PROF = 2,
        MONOTONIC = 4,
        UPTIME = 5,
        UPTIME_PRECISE = 7,
        UPTIME_FAST = 8,
        REALTIME_PRECISE = 9,
        REALTIME_FAST = 10,
        MONOTONIC_PRECISE = 11,
        MONOTONIC_FAST = 12,
        SECOND = 13,
        THREAD_CPUTIME_ID = 14,
        PROCESS_CPUTIME_ID = 15,
    },
    .illumos => enum(u32) {
        VIRTUAL = 1,
        THREAD_CPUTIME_ID = 2,
        REALTIME = 3,
        MONOTONIC = 4,
        PROCESS_CPUTIME_ID = 5,
    },
    .netbsd => enum(u32) {
        REALTIME = 0,
        VIRTUAL = 1,
        PROF = 2,
        MONOTONIC = 3,
        THREAD_CPUTIME_ID = 0x20000000,
        PROCESS_CPUTIME_ID = 0x40000000,
    },
    .dragonfly => enum(u32) {
        REALTIME = 0,
        VIRTUAL = 1,
        PROF = 2,
        MONOTONIC = 4,
        UPTIME = 5,
        UPTIME_PRECISE = 7,
        UPTIME_FAST = 8,
        REALTIME_PRECISE = 9,
        REALTIME_FAST = 10,
        MONOTONIC_PRECISE = 11,
        MONOTONIC_FAST = 12,
        SECOND = 13,
        THREAD_CPUTIME_ID = 14,
        PROCESS_CPUTIME_ID = 15,
    },
    .openbsd => enum(u32) {
        REALTIME = 0,
        PROCESS_CPUTIME_ID = 2,
        MONOTONIC = 3,
        THREAD_CPUTIME_ID = 4,
    },
    // https://github.com/SerenityOS/serenity/blob/0a78056453578c18e0a04a0b45ebfb1c96d59005/Kernel/API/POSIX/time.h#L24-L36
    .serenity => enum(c_int) {
        REALTIME = 0,
        MONOTONIC = 1,
        MONOTONIC_RAW = 2,
        REALTIME_COARSE = 3,
        MONOTONIC_COARSE = 4,
    },
    else => void,
};
pub const CPU_COUNT = switch (native_os) {
    .linux => linux.CPU_COUNT,
    .emscripten => emscripten.CPU_COUNT,
    else => void,
};
pub const E = switch (native_os) {
    .linux => linux.E,
    .emscripten => emscripten.E,
    .wasi => wasi.errno_t,
    .windows => enum(u16) {
        /// 未发生错误。
        SUCCESS = 0,
        PERM = 1,
        NOENT = 2,
        SRCH = 3,
        INTR = 4,
        IO = 5,
        NXIO = 6,
        @"2BIG" = 7,
        NOEXEC = 8,
        BADF = 9,
        CHILD = 10,
        AGAIN = 11,
        NOMEM = 12,
        ACCES = 13,
        FAULT = 14,
        BUSY = 16,
        EXIST = 17,
        XDEV = 18,
        NODEV = 19,
        NOTDIR = 20,
        ISDIR = 21,
        NFILE = 23,
        MFILE = 24,
        NOTTY = 25,
        FBIG = 27,
        NOSPC = 28,
        SPIPE = 29,
        ROFS = 30,
        MLINK = 31,
        PIPE = 32,
        DOM = 33,
        /// 也表示 `DEADLOCK`。
        DEADLK = 36,
        NAMETOOLONG = 38,
        NOLCK = 39,
        NOSYS = 40,
        NOTEMPTY = 41,

        INVAL = 22,
        RANGE = 34,
        ILSEQ = 42,

        // POSIX 补充
        ADDRINUSE = 100,
        ADDRNOTAVAIL = 101,
        AFNOSUPPORT = 102,
        ALREADY = 103,
        BADMSG = 104,
        CANCELED = 105,
        CONNABORTED = 106,
        CONNREFUSED = 107,
        CONNRESET = 108,
        DESTADDRREQ = 109,
        HOSTUNREACH = 110,
        IDRM = 111,
        INPROGRESS = 112,
        ISCONN = 113,
        LOOP = 114,
        MSGSIZE = 115,
        NETDOWN = 116,
        NETRESET = 117,
        NETUNREACH = 118,
        NOBUFS = 119,
        NODATA = 120,
        NOLINK = 121,
        NOMSG = 122,
        NOPROTOOPT = 123,
        NOSR = 124,
        NOSTR = 125,
        NOTCONN = 126,
        NOTRECOVERABLE = 127,
        NOTSOCK = 128,
        NOTSUP = 129,
        OPNOTSUPP = 130,
        OTHER = 131,
        OVERFLOW = 132,
        OWNERDEAD = 133,
        PROTO = 134,
        PROTONOSUPPORT = 135,
        PROTOTYPE = 136,
        TIME = 137,
        TIMEDOUT = 138,
        TXTBSY = 139,
        WOULDBLOCK = 140,
        DQUOT = 10069,
        _,
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => darwin.E,
    .freebsd => freebsd.E,
    .illumos => enum(u16) {
        /// 未发生错误。
        SUCCESS = 0,
        /// 不是超级用户
        PERM = 1,
        /// 没有此文件或目录
        NOENT = 2,
        /// 无此进程
        SRCH = 3,
        /// 系统调用被中断
        INTR = 4,
        /// I/O 错误
        IO = 5,
        /// 无此设备或地址
        NXIO = 6,
        /// 参数列表过长
        @"2BIG" = 7,
        /// 可执行文件格式错误
        NOEXEC = 8,
        /// 错误的文件编号
        BADF = 9,
        /// 没有子节点
        CHILD = 10,
        /// 资源暂时不可用。
        /// 也用于 WOULDBLOCK:操作将阻塞。
        AGAIN = 11,
        /// 内存不足
        NOMEM = 12,
        /// 权限被拒绝
        ACCES = 13,
        /// 错误的地址
        FAULT = 14,
        /// 需要块设备
        NOTBLK = 15,
        /// 挂载设备忙
        BUSY = 16,
        /// 文件已存在
        EXIST = 17,
        /// 跨设备链接
        XDEV = 18,
        /// 无此设备
        NODEV = 19,
        /// 不是目录
        NOTDIR = 20,
        /// 是一个目录
        ISDIR = 21,
        /// 参数无效
        INVAL = 22,
        /// 文件表溢出
        NFILE = 23,
        /// 打开的文件过多
        MFILE = 24,
        /// 此设备不适用该 ioctl
        NOTTY = 25,
        /// 文本文件忙
        TXTBSY = 26,
        /// 文件过大
        FBIG = 27,
        /// 设备上没有剩余空间
        NOSPC = 28,
        /// 非法寻址
        SPIPE = 29,
        /// 只读文件系统
        ROFS = 30,
        /// 链接过多
        MLINK = 31,
        /// 管道破裂
        PIPE = 32,
        /// 数学参数超出函数定义域
        DOM = 33,
        /// 数学结果无法表示
        RANGE = 34,
        /// 没有所需类型的消息
        NOMSG = 35,
        /// 标识符已移除
        IDRM = 36,
        /// 通道号超出范围
        CHRNG = 37,
        /// 第 2 层未同步
        L2NSYNC = 38,
        /// 第 3 级已停止
        L3HLT = 39,
        /// 第 3 级重置
        L3RST = 40,
        /// 链接数超出范围
        LNRNG = 41,
        /// 未附加协议驱动程序
        UNATCH = 42,
        /// 没有可用的 CSI 结构
        NOCSI = 43,
        /// 第 2 层已停止
        L2HLT = 44,
        /// 死锁条件。
        DEADLK = 45,
        /// 没有可用的记录锁。
        NOLCK = 46,
        /// 操作已取消
        CANCELED = 47,
        /// 操作不受支持
        NOTSUP = 48,

        // 文件系统配额
        /// 超出磁盘配额
        DQUOT = 49,

        // 收敛错误返回
        /// 交换无效
        BADE = 50,
        /// 请求描述符无效
        BADR = 51,
        /// 交换区已满
        XFULL = 52,
        /// 没有 anode
        NOANO = 53,
        /// 无效的请求代码
        BADRQC = 54,
        /// 槽位无效
        BADSLT = 55,
        /// 文件加锁死锁错误
        DEADLOCK = 56,
        /// 错误的字体文件格式
        BFONT = 57,

        // 进程间健壮锁
        /// 进程持锁时终止
        OWNERDEAD = 58,
        /// 锁无法恢复
        NOTRECOVERABLE = 59,
        /// 已锁定的锁被解除映射
        LOCKUNMAPPED = 72,
        /// 设施未激活
        NOTACTIVE = 73,
        /// 尝试多跳
        MULTIHOP = 74,
        /// 尝试读取不可读的消息
        BADMSG = 77,
        /// 路径名过长
        NAMETOOLONG = 78,
        /// 数值过大,无法存入该数据类型
        OVERFLOW = 79,
        /// 给定的逻辑名称不唯一
        NOTUNIQ = 80,
        /// 文件描述符不适用于此操作
        BADFD = 81,
        /// 远程地址已更改
        REMCHG = 82,

        // 流问题
        /// 设备不是流
        NOSTR = 60,
        /// 无数据(用于无延迟 io)
        NODATA = 61,
        /// 定时器已到期
        TIME = 62,
        /// 流资源耗尽
        NOSR = 63,
        /// 机器不在网络中
        NONET = 64,
        /// 未安装软件包
        NOPKG = 65,
        /// 对象位于远程
        REMOTE = 66,
        /// 链接已断开
        NOLINK = 67,
        /// 通告错误
        ADV = 68,
        /// srmount 错误
        SRMNT = 69,
        /// 发送时发生通信错误
        COMM = 70,
        /// 协议错误
        PROTO = 71,

        // 共享库问题
        /// 无法访问所需共享库。
        LIBACC = 83,
        /// 正在访问损坏的共享库。
        LIBBAD = 84,
        /// a.out 中的 .lib 节已损坏。
        LIBSCN = 85,
        /// 试图链接过多的库。
        LIBMAX = 86,
        /// 尝试执行共享库。
        LIBEXEC = 87,
        /// 非法字节序列。
        ILSEQ = 88,
        /// 不支持的文件系统操作
        NOSYS = 89,
        /// 符号链接循环
        LOOP = 90,
        /// 可重新启动的系统调用
        RESTART = 91,
        /// 若为管道/FIFO,则不在流头处休眠
        STRPIPE = 92,
        /// 目录非空
        NOTEMPTY = 93,
        /// 用户过多(针对 UFS)
        USERS = 94,

        // BSD 网络软件
        // 参数错误
        /// 对非套接字执行了套接字操作
        NOTSOCK = 95,
        /// 需要目标地址
        DESTADDRREQ = 96,
        /// 消息过长
        MSGSIZE = 97,
        /// 套接字的协议类型错误
        PROTOTYPE = 98,
        /// 协议不可用
        NOPROTOOPT = 99,
        /// 不支持此协议
        PROTONOSUPPORT = 120,
        /// 不支持的套接字类型
        SOCKTNOSUPPORT = 121,
        /// 套接字不支持此操作
        OPNOTSUPP = 122,
        /// 不支持此协议族
        PFNOSUPPORT = 123,
        /// 地址族不受其支持:
        AFNOSUPPORT = 124,
        /// 地址已被使用
        ADDRINUSE = 125,
        /// 无法分配请求的地址
        ADDRNOTAVAIL = 126,

        // 操作错误
        /// 网络已关闭
        NETDOWN = 127,
        /// 网络不可达
        NETUNREACH = 128,
        /// 网络连接中断,原因是
        NETRESET = 129,
        /// 软件导致连接中止
        CONNABORTED = 130,
        /// 连接被对端重置
        CONNRESET = 131,
        /// 没有可用的缓冲区空间
        NOBUFS = 132,
        /// 套接字已连接
        ISCONN = 133,
        /// 套接字未连接
        NOTCONN = 134,
        /// 套接字关闭后无法发送
        SHUTDOWN = 143,
        /// 引用过多:无法拼接
        TOOMANYREFS = 144,
        /// 连接超时
        TIMEDOUT = 145,
        /// 连接被拒绝
        CONNREFUSED = 146,
        /// 主机已关闭
        HOSTDOWN = 147,
        /// 无到主机的路由
        HOSTUNREACH = 148,
        /// 操作已在进行中
        ALREADY = 149,
        /// 操作正在进行中
        INPROGRESS = 150,

        // SUN 网络文件系统
        /// 失效的 NFS 文件句柄
        STALE = 151,

        _,
    },
    .netbsd => netbsd.E,
    .dragonfly => dragonfly.E,
    .haiku => haiku.E,
    .openbsd => openbsd.E,
    // https://github.com/SerenityOS/serenity/blob/dd59fe35c7e5bbaf6b6b3acb3f9edc56619d4b66/Kernel/API/POSIX/errno.h
    .serenity => enum(c_int) {
        SUCCESS = 0,
        PERM = 1,
        NOENT = 2,
        SRCH = 3,
        INTR = 4,
        IO = 5,
        NXIO = 6,
        @"2BIG" = 7,
        NOEXEC = 8,
        BADF = 9,
        CHILD = 10,
        AGAIN = 11,
        NOMEM = 12,
        ACCES = 13,
        FAULT = 14,
        NOTBLK = 15,
        BUSY = 16,
        EXIST = 17,
        XDEV = 18,
        NODEV = 19,
        NOTDIR = 20,
        ISDIR = 21,
        INVAL = 22,
        NFILE = 23,
        MFILE = 24,
        NOTTY = 25,
        TXTBSY = 26,
        FBIG = 27,
        NOSPC = 28,
        SPIPE = 29,
        ROFS = 30,
        MLINK = 31,
        PIPE = 32,
        RANGE = 33,
        NAMETOOLONG = 34,
        LOOP = 35,
        OVERFLOW = 36,
        OPNOTSUPP = 37,
        NOSYS = 38,
        NOTIMPL = 39,
        AFNOSUPPORT = 40,
        NOTSOCK = 41,
        ADDRINUSE = 42,
        NOTEMPTY = 43,
        DOM = 44,
        CONNREFUSED = 45,
        HOSTDOWN = 46,
        ADDRNOTAVAIL = 47,
        ISCONN = 48,
        CONNABORTED = 49,
        ALREADY = 50,
        CONNRESET = 51,
        DESTADDRREQ = 52,
        HOSTUNREACH = 53,
        ILSEQ = 54,
        MSGSIZE = 55,
        NETDOWN = 56,
        NETUNREACH = 57,
        NETRESET = 58,
        NOBUFS = 59,
        NOLCK = 60,
        NOMSG = 61,
        NOPROTOOPT = 62,
        NOTCONN = 63,
        SHUTDOWN = 64,
        TOOMANYREFS = 65,
        SOCKTNOSUPPORT = 66,
        PROTONOSUPPORT = 67,
        DEADLK = 68,
        TIMEDOUT = 69,
        PROTOTYPE = 70,
        INPROGRESS = 71,
        NOTHREAD = 72,
        PROTO = 73,
        NOTSUP = 74,
        PFNOSUPPORT = 75,
        DIRINTOSELF = 76,
        DQUOT = 77,
        NOTRECOVERABLE = 78,
        CANCELED = 79,
        PROMISEVIOLATION = 80,
        STALE = 81,
        SRCNOTFOUND = 82,
        _,
    },
    else => void,
};
pub const Elf_Symndx = switch (native_os) {
    .linux => linux.Elf_Symndx,
    else => void,
};
/// fcntl(2) 的命令标志。
pub const F = switch (native_os) {
    .linux => linux.F,
    .emscripten => emscripten.F,
    .wasi => struct {
        // 与 lib/libc/include/wasm-wasi-musl/__header_fcntl.h 中的 `F_*` 常量一致。
        pub const GETFD = 1;
        pub const SETFD = 2;
        pub const GETFL = 3;
        pub const SETFL = 4;
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        /// 复制文件描述符
        pub const DUPFD = 0;
        /// 获取文件描述符标志
        pub const GETFD = 1;
        /// 设置文件描述符标志
        pub const SETFD = 2;
        /// 获取文件状态标志
        pub const GETFL = 3;
        /// 设置文件状态标志
        pub const SETFL = 4;
        /// 获取 SIGIO/SIGURG 的进程或进程组
        pub const GETOWN = 5;
        /// 设置 SIGIO/SIGURG 的进程/进程组
        pub const SETOWN = 6;
        /// 获取记录锁信息
        pub const GETLK = 7;
        /// 设置记录锁定信息
        pub const SETLK = 8;
        /// F.SETLK;被阻塞时等待
        pub const SETLKW = 9;
        /// F.SETLK;受阻时等待,超时返回
        pub const SETLKWTIMEOUT = 10;
        pub const FLUSH_DATA = 40;
        /// 用于回归测试
        pub const CHKCLEAN = 41;
        /// 预分配存储空间
        pub const PREALLOCATE = 42;
        /// 截断文件但不将空间清零
        pub const SETSIZE = 43;
        /// 异步发起建议性读取,不将数据复制到用户空间
        pub const RDADVISE = 44;
        /// 为此 fd 关闭或开启预读
        pub const RDAHEAD = 45;
        /// 为此 fd 关闭或开启数据缓存
        pub const NOCACHE = 48;
        /// 文件偏移转换为设备偏移
        pub const LOG2PHYS = 49;
        /// 返回文件描述符对应的完整路径
        pub const GETPATH = 50;
        /// fsync + 请求驱动器将数据刷新到介质
        pub const FULLFSYNC = 51;
        /// 查找哪个分量是包(若有)
        pub const PATHPKG_CHECK = 52;
        /// “冻结”所有文件系统操作
        pub const FREEZE_FS = 53;
        /// “解冻”所有文件系统操作
        pub const THAW_FS = 54;
        /// 对此文件全局关闭或开启数据缓存。
        pub const GLOBAL_NOCACHE = 55;
        /// 添加分离签名
        pub const ADDSIGS = 59;
        /// 从同一文件添加签名(由 dyld 用于共享库)。
        pub const ADDFILESIGS = 61;
        /// 与 F.NOCACHE 配合使用,表示不应使用 DIRECT 同步写入
        /// (即可暂时创建缓存页)
        pub const NODIRECT = 62;
        /// 从扩展属性获取文件的保护类,返回 int
        pub const GETPROTECTIONCLASS = 63;
        /// 为 EA 设置文件的保护类别,要求 int 类型
        pub const SETPROTECTIONCLASS = 64;
        /// 文件偏移量到设备偏移量,扩展形式
        pub const LOG2PHYS_EXT = 65;
        /// 获取每个进程的记录锁信息
        pub const GETLKPID = 66;
        /// 将文件标记为另一个文件系统的底层存储。
        pub const SETBACKINGSTORE = 70;
        /// 返回 FD 的完整路径,但在特定 mtmd 情况下报错
        pub const GETPATH_MTMINFO = 71;
        /// 将代码目录及其关联哈希返回给调用方
        pub const GETCODEDIR = 72;
        /// EPIPE 时不生成 SIGPIPE
        pub const SETNOSIGPIPE = 73;
        /// 此文件描述符的 SIGPIPE 状态
        pub const GETNOSIGPIPE = 74;
        /// 某些情况下,需要为 AKS/MKB 重新封装密钥
        pub const TRANSCODEKEY = 75;
        /// 文件由单个写入者写入……若启用限速,写入
        /// 可能被拆分成更小的块,并在块之间限速
        pub const SINGLE_WRITER = 76;
        /// 获取此文件系统的保护版本号。
        pub const GETPROTECTIONLEVEL = 77;
        /// 添加分离的代码签名(由 dyld 用于共享库)。
        pub const FINDSIGS = 78;
        /// 仅当由 Apple 签名时,添加同一文件中的签名(由 dyld 用于模拟器)
        pub const ADDFILESIGS_FOR_DYLD_SIM = 83;
        /// fsync 并向驱动器发出屏障
        pub const BARRIERFSYNC = 85;
        /// 从同一文件添加签名,成功时返回结构体中的结束偏移
        pub const ADDFILESIGS_RETURN = 97;
        /// 检查 Library Validation 是否允许将此 Mach-O 文件映射到调用进程
        pub const CHECK_LV = 98;
        /// 释放文件的一个范围
        pub const PUNCHHOLE = 99;
        /// 裁剪活动文件
        pub const TRIM_ACTIVE_FILE = 100;
        /// 为副本设置 FD_CLOEXEC
        pub const DUPFD_CLOEXEC = 67;
        /// 共享锁或读锁
        pub const RDLCK = 1;
        /// 解锁
        pub const UNLCK = 2;
        /// 独占锁或写锁
        pub const WRLCK = 3;
    },
    .freebsd => struct {
        /// 重复的文件描述符。
        pub const DUPFD = 0;
        /// 获取文件描述符标志。
        pub const GETFD = 1;
        /// 设置文件描述符标志。
        pub const SETFD = 2;
        /// 获取文件状态标志。
        pub const GETFL = 3;
        /// 设置文件状态标志。
        pub const SETFL = 4;

        /// 获取 SIGIO/SIGURG 的进程或进程组。
        pub const GETOWN = 5;
        /// 设置 SIGIO/SIGURG 的进程/进程组。
        pub const SETOWN = 6;

        /// 获取记录锁定信息。
        pub const GETLK = 11;
        /// 设置记录锁信息。
        pub const SETLK = 12;
        /// 设置记录锁定信息,若被阻塞则等待。
        pub const SETLKW = 13;

        /// 远程锁的调试支持。
        pub const SETLK_REMOTE = 14;
        /// 预读。
        pub const READAHEAD = 15;

        /// 设置了 FD_CLOEXEC 的 DUPFD。
        pub const DUPFD_CLOEXEC = 17;
        /// 设置 FD_CLOEXEC 的 DUP2FD。
        pub const DUP2FD_CLOEXEC = 18;

        pub const ADD_SEALS = 19;
        pub const GET_SEALS = 20;
        /// 返回文件描述符的 `kinfo_file`。
        pub const KINFO = 22;

        // 封印(ADD_SEALS、GET_SEALS)
        /// 禁止添加封印。
        pub const SEAL_SEAL = 0x0001;
        /// 不可收缩
        pub const SEAL_SHRINK = 0x0002;
        /// 不可增长。
        pub const SEAL_GROW = 0x0004;
        /// 不可写入。
        pub const SEAL_WRITE = 0x0008;

        // 记录锁定标志(GETLK、SETLK、SETLKW)。
        /// 共享锁或读锁。
        pub const RDLCK = 1;
        /// 解锁。
        pub const UNLCK = 2;
        /// 独占锁或写锁。
        pub const WRLCK = 3;
        /// 清除给定系统 ID 的锁。
        pub const UNLCKSYS = 4;
        /// 取消异步加锁请求。
        pub const CANCEL = 5;

        pub const SETOWN_EX = 15;
        pub const GETOWN_EX = 16;

        pub const GETOWNER_UIDS = 17;
    },
    .illumos => struct {
        /// 解锁先前锁定的区域
        pub const ULOCK = 0;
        /// 锁定一个区域供独占使用
        pub const LOCK = 1;
        /// 测试并锁定一个区域以供独占使用
        pub const TLOCK = 2;
        /// 测试某个区域是否被其他进程加锁
        pub const TEST = 3;

        /// 复制 fildes
        pub const DUPFD = 0;
        /// 获取 fildes 标志
        pub const GETFD = 1;
        /// 设置 fildes 标志
        pub const SETFD = 2;
        /// 获取文件标志
        pub const GETFL = 3;
        /// 获取文件标志,包括仅打开时有效的标志
        pub const GETXFL = 45;
        /// 设置文件标志
        pub const SETFL = 4;

        /// 未使用
        pub const CHKFL = 8;
        /// 从第三个参数起复制 fildes
        pub const DUP2FD = 9;
        /// 类似于设置了 O_CLOEXEC 的 DUP2FD;若 fildes 与 arg1 相同则返回 EINVAL
        pub const DUP2FD_CLOEXEC = 36;
        /// 类似 DUPFD,但设置了 O_CLOEXEC
        pub const DUPFD_CLOEXEC = 37;

        /// 文件描述符是否为流?
        pub const ISSTREAM = 13;
        /// 启用对文件的私有访问
        pub const PRIV = 15;
        /// 关闭对文件的私有访问
        pub const NPRIV = 16;
        /// UFS 配额调用
        pub const QUOTACTL = 17;
        /// 获取已分配的 BLKSIZE 大小块的数量
        pub const BLOCKS = 18;
        /// 获取最优 I/O 块大小
        pub const BLKSIZE = 19;
        /// 获取所有者(套接字仿真)
        pub const GETOWN = 23;
        /// 设置所有者(套接字模拟)
        pub const SETOWN = 24;
        /// 对象复用时撤销文件描述符访问权限。
        pub const REVOKE = 25;
        /// vp 是否具有锁管理器私有的 NFS 锁
        pub const HASREMOTELOCKS = 26;

        /// 设置文件锁
        pub const SETLK = 6;
        /// 设置文件锁并等待
        pub const SETLKW = 7;
        /// 分配文件空间
        pub const ALLOCSP = 10;
        /// 释放文件空间
        pub const FREESP = 11;
        /// 获取文件锁
        pub const GETLK = 14;
        /// 获取文件拥有的文件锁
        pub const OFD_GETLK = 47;
        /// 设置由文件持有的文件锁
        pub const OFD_SETLK = 48;
        /// 设置由文件持有的文件锁并等待
        pub const OFD_SETLKW = 49;
        /// 设置文件共享预留
        pub const SHARE = 40;
        /// 移除文件共享预留
        pub const UNSHARE = 41;
        /// 创建毒化 FD
        pub const BADFD = 46;

        /// 读锁
        pub const RDLCK = 1;
        /// 写锁
        pub const WRLCK = 2;
        /// 移除锁
        pub const UNLCK = 3;
        /// 移除指定系统的远程锁
        pub const UNLKSYS = 4;

        // f_access 的取值
        /// 只读共享访问
        pub const RDACC = 0x1;
        /// 仅写共享访问
        pub const WRACC = 0x2;
        /// 共享读写访问
        pub const RWACC = 0x3;

        // f_deny 的值
        /// 不要拒绝他人访问
        pub const NODNY = 0x0;
        /// 拒绝其他方的共享读访问
        pub const RDDNY = 0x1;
        /// 拒绝其他方的共享写访问
        pub const WRDNY = 0x2;
        /// 拒绝其他人共享读取或写入访问
        pub const RWDNY = 0x3;
        /// 私有标志:拒绝共享删除访问
        pub const RMDNY = 0x4;
    },
    .netbsd => struct {
        pub const DUPFD = 0;
        pub const GETFD = 1;
        pub const SETFD = 2;
        pub const GETFL = 3;
        pub const SETFL = 4;
        pub const GETOWN = 5;
        pub const SETOWN = 6;
        pub const GETLK = 7;
        pub const SETLK = 8;
        pub const SETLKW = 9;
        pub const CLOSEM = 10;
        pub const MAXFD = 11;
        pub const DUPFD_CLOEXEC = 12;
        pub const GETNOSIGPIPE = 13;
        pub const SETNOSIGPIPE = 14;
        pub const GETPATH = 15;

        pub const RDLCK = 1;
        pub const WRLCK = 3;
        pub const UNLCK = 2;
    },
    .dragonfly => struct {
        pub const ULOCK = 0;
        pub const LOCK = 1;
        pub const TLOCK = 2;
        pub const TEST = 3;

        pub const DUPFD = 0;
        pub const GETFD = 1;
        pub const RDLCK = 1;
        pub const SETFD = 2;
        pub const UNLCK = 2;
        pub const WRLCK = 3;
        pub const GETFL = 3;
        pub const SETFL = 4;
        pub const GETOWN = 5;
        pub const SETOWN = 6;
        pub const GETLK = 7;
        pub const SETLK = 8;
        pub const SETLKW = 9;
        pub const DUP2FD = 10;
        pub const DUPFD_CLOEXEC = 17;
        pub const DUP2FD_CLOEXEC = 18;
        pub const GETPATH = 19;
    },
    .haiku => struct {
        pub const DUPFD = 0x0001;
        pub const GETFD = 0x0002;
        pub const SETFD = 0x0004;
        pub const GETFL = 0x0008;
        pub const SETFL = 0x0010;

        pub const GETLK = 0x0020;
        pub const SETLK = 0x0080;
        pub const SETLKW = 0x0100;
        pub const DUPFD_CLOEXEC = 0x0200;

        pub const RDLCK = 0x0040;
        pub const UNLCK = 0x0200;
        pub const WRLCK = 0x0400;
    },
    .openbsd => struct {
        pub const DUPFD = 0;
        pub const GETFD = 1;
        pub const SETFD = 2;
        pub const GETFL = 3;
        pub const SETFL = 4;

        pub const GETOWN = 5;
        pub const SETOWN = 6;

        pub const GETLK = 7;
        pub const SETLK = 8;
        pub const SETLKW = 9;

        pub const RDLCK = 1;
        pub const UNLCK = 2;
        pub const WRLCK = 3;
    },
    .serenity => struct {
        // https://github.com/SerenityOS/serenity/blob/2808b0376406a40e31293bb3bcb9170374e90506/Kernel/API/POSIX/fcntl.h#L15-L24
        pub const DUPFD = 0;
        pub const GETFD = 1;
        pub const SETFD = 2;
        pub const GETFL = 3;
        pub const SETFL = 4;
        pub const ISTTY = 5;
        pub const GETLK = 6;
        pub const SETLK = 7;
        pub const SETLKW = 8;
        pub const DUPFD_CLOEXEC = 9;

        // https://github.com/SerenityOS/serenity/blob/2808b0376406a40e31293bb3bcb9170374e90506/Kernel/API/POSIX/fcntl.h#L45-L47
        pub const RDLCK = 0;
        pub const WRLCK = 1;
        pub const UNLCK = 2;
    },
    else => void,
};
pub const FD_CLOEXEC = switch (native_os) {
    .linux => linux.FD_CLOEXEC,
    .emscripten => emscripten.FD_CLOEXEC,
    else => 1,
};

/// 测试文件是否存在。
pub const F_OK = switch (native_os) {
    .linux => linux.F_OK,
    .emscripten => emscripten.F_OK,
    else => 0,
};
/// 测试执行权限或搜索权限。
pub const X_OK = switch (native_os) {
    .linux => linux.X_OK,
    .emscripten => emscripten.X_OK,
    else => 1,
};
/// 测试写入权限。
pub const W_OK = switch (native_os) {
    .linux => linux.W_OK,
    .emscripten => emscripten.W_OK,
    else => 2,
};
/// 测试读取权限。
pub const R_OK = switch (native_os) {
    .linux => linux.R_OK,
    .emscripten => emscripten.R_OK,
    else => 4,
};

pub const Flock = switch (native_os) {
    .linux => linux.Flock,
    .emscripten => emscripten.Flock,
    .openbsd, .dragonfly, .netbsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        start: off_t,
        len: off_t,
        pid: pid_t,
        type: i16,
        whence: i16,
    },
    .freebsd => extern struct {
        /// 起始偏移量。
        start: off_t,
        /// 要锁定的连续字节数量。
        /// 值为 0 表示直到文件末尾。
        len: off_t,
        /// 锁所有者。
        pid: pid_t,
        /// 锁类型。
        type: i16,
        /// start 成员的类型。
        whence: i16,
        /// 远程系统 ID,本地则为零。
        sysid: i32,
    },
    .illumos => extern struct {
        type: c_short,
        whence: c_short,
        start: off_t,
        // len == 0 表示读取至文件末尾。
        len: off_t,
        sysid: c_int,
        pid: pid_t,
        __pad: [4]c_long,
    },
    .haiku => extern struct {
        type: i16,
        whence: i16,
        start: off_t,
        len: off_t,
        pid: pid_t,
    },
    // https://github.com/SerenityOS/serenity/blob/2808b0376406a40e31293bb3bcb9170374e90506/Kernel/API/POSIX/fcntl.h#L54-L60
    .serenity => extern struct {
        type: c_short,
        whence: c_short,
        start: off_t,
        len: off_t,
        pid: pid_t,
    },
    else => void,
};
pub const HOST_NAME_MAX = switch (native_os) {
    .linux => linux.HOST_NAME_MAX,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => 72,
    .openbsd, .haiku, .dragonfly, .netbsd, .illumos, .freebsd => 255,
    // https://github.com/SerenityOS/serenity/blob/c87557e9c1865fa1a6440de34ff6ce6fc858a2b7/Kernel/API/POSIX/sys/limits.h#L22
    .serenity => 64,
    else => {},
};
pub const IOV_MAX = switch (native_os) {
    .linux => linux.IOV_MAX,
    .emscripten => emscripten.IOV_MAX,
    // https://github.com/SerenityOS/serenity/blob/098af0f846a87b651731780ff48420205fd33754/Kernel/API/POSIX/sys/uio.h#L16
    .openbsd, .haiku, .illumos, .wasi, .serenity => 1024,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => 16,
    .dragonfly, .netbsd, .freebsd => KERN.IOV_MAX,
    else => {},
};
pub const CTL = switch (native_os) {
    .freebsd => struct {
        pub const SYSCTL = 0;
        pub const KERN = 1;
        pub const VM = 2;
        pub const VFS = 3;
        pub const NET = 4;
        pub const DEBUG = 5;
        pub const HW = 6;
        pub const MACHDEP = 7;
        pub const USER = 8;
        pub const P1003_1B = 9;
    },
    .netbsd => struct {
        pub const KERN = 1;
        pub const DEBUG = 5;
    },
    .dragonfly => struct {
        pub const UNSPEC = 0;
        pub const KERN = 1;
        pub const VM = 2;
        pub const VFS = 3;
        pub const NET = 4;
        pub const DEBUG = 5;
        pub const HW = 6;
        pub const MACHDEP = 7;
        pub const USER = 8;
        pub const LWKT = 10;
        pub const MAXID = 11;
        pub const MAXNAME = 12;
    },
    .openbsd => struct {
        pub const UNSPEC = 0;
        pub const KERN = 1;
        pub const VM = 2;
        pub const FS = 3;
        pub const NET = 4;
        pub const DEBUG = 5;
        pub const HW = 6;
        pub const MACHDEP = 7;

        pub const DDB = 9;
        pub const VFS = 10;
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const UNSPEC = 0;
        pub const KERN = 1;
        pub const VM = 2;
        pub const VFS = 3;
        pub const NET = 4;
        pub const DEBUG = 5;
        pub const HW = 6;
        pub const MACHDEP = 7;
        pub const USER = 8;
        pub const MAXID = 9;
    },
    else => void,
};
pub const CPU = switch (native_os) {
    .openbsd => switch (native_arch) {
        .aarch64, .aarch64_be => struct {
            pub const COMPATIBLE = 1;
            pub const ID_AA64ISAR0 = 2;
            pub const ID_AA64ISAR1 = 3;
            pub const ID_AA64ISAR2 = 4;
            pub const ID_AA64MMFR0 = 5;
            pub const ID_AA64MMFR1 = 6;
            pub const ID_AA64MMFR2 = 7;
            pub const AA64PFR0 = 8;
            pub const AA64PFR1 = 9;
            pub const AA64SMFR0 = 10;
            pub const AA64ZFR0 = 11;
            pub const LIDACTION = 12;
            pub const LED_BLINK = 13;
        },
        else => void,
    },
    else => void,
};
pub const HW = switch (native_os) {
    .freebsd => struct {
        pub const MACHINE = 1;
        pub const MODEL = 2;
        pub const NCPU = 3;
        pub const BYTEORDER = 4;
        pub const PHYSMEM = 5;
        pub const USERMEM = 6;
        pub const PAGESIZE = 7;
        pub const DISKNAMES = 8;
        pub const DISKSTATS = 9;
        pub const FLOATINGPT = 10;
        pub const MACHINE_ARCH = 11;
        pub const REALMEM = 12;
    },
    .openbsd => struct {
        pub const MACHINE = 1;
        pub const MODEL = 2;
        pub const NCPU = 3;
        pub const BYTEORDER = 4;
        pub const PHYSMEM = 5;
        pub const USERMEM = 6;
        pub const PAGESIZE = 7;
        pub const DISKNAMES = 8;
        pub const DISKSTATS = 9;
        pub const DISKCOUNT = 10;
        pub const SENSORS = 11;
        pub const CPUSPEED = 12;
        pub const SETPERF = 13;
        pub const VENDOR = 14;
        pub const PRODUCT = 15;
        pub const VERSION = 16;
        pub const SERIALNO = 17;
        pub const UUID = 18;
        pub const PHYSMEM64 = 19;
        pub const USERMEM64 = 20;
        pub const NCPUFOUND = 21;
        pub const ALLOWPOWERDOWN = 22;
        pub const PERFPOLICY = 23;
        pub const SMT = 24;
        pub const NCPUONLINE = 25;
        pub const POWER = 26;
    },
    else => void,
};
pub const KERN = switch (native_os) {
    .freebsd => struct {
        /// 结构体:进程条目
        pub const PROC = 14;
        /// 可执行文件路径
        pub const PROC_PATHNAME = 12;
        /// 进程的文件描述符
        pub const PROC_FILEDESC = 33;
        pub const IOV_MAX = 35;
    },
    .netbsd => struct {
        /// 结构体:进程 argv/env
        pub const PROC_ARGS = 48;
        /// 可执行文件路径
        pub const PROC_PATHNAME = 5;
        pub const IOV_MAX = 38;
    },
    .dragonfly => struct {
        pub const PROC_ALL = 0;
        pub const OSTYPE = 1;
        pub const PROC_PID = 1;
        pub const OSRELEASE = 2;
        pub const PROC_PGRP = 2;
        pub const OSREV = 3;
        pub const PROC_SESSION = 3;
        pub const VERSION = 4;
        pub const PROC_TTY = 4;
        pub const MAXVNODES = 5;
        pub const PROC_UID = 5;
        pub const MAXPROC = 6;
        pub const PROC_RUID = 6;
        pub const MAXFILES = 7;
        pub const PROC_ARGS = 7;
        pub const ARGMAX = 8;
        pub const PROC_CWD = 8;
        pub const PROC_PATHNAME = 9;
        pub const SECURELVL = 9;
        pub const PROC_SIGTRAMP = 10;
        pub const HOSTNAME = 10;
        pub const HOSTID = 11;
        pub const CLOCKRATE = 12;
        pub const VNODE = 13;
        pub const PROC = 14;
        pub const FILE = 15;
        pub const PROC_FLAGMASK = 16;
        pub const PROF = 16;
        pub const PROC_FLAG_LWP = 16;
        pub const POSIX1 = 17;
        pub const NGROUPS = 18;
        pub const JOB_CONTROL = 19;
        pub const SAVED_IDS = 20;
        pub const BOOTTIME = 21;
        pub const NISDOMAINNAME = 22;
        pub const UPDATEINTERVAL = 23;
        pub const OSRELDATE = 24;
        pub const NTP_PLL = 25;
        pub const BOOTFILE = 26;
        pub const MAXFILESPERPROC = 27;
        pub const MAXPROCPERUID = 28;
        pub const DUMPDEV = 29;
        pub const IPC = 30;
        pub const DUMMY = 31;
        pub const PS_STRINGS = 32;
        pub const USRSTACK = 33;
        pub const LOGSIGEXIT = 34;
        pub const IOV_MAX = 35;
        pub const MAXPOSIXLOCKSPERUID = 36;
        pub const MAXID = 37;
    },
    .openbsd => struct {
        pub const OSTYPE = 1;
        pub const OSRELEASE = 2;
        pub const OSREV = 3;
        pub const VERSION = 4;
        pub const MAXVNODES = 5;
        pub const MAXPROC = 6;
        pub const MAXFILES = 7;
        pub const ARGMAX = 8;
        pub const SECURELVL = 9;
        pub const HOSTNAME = 10;
        pub const HOSTID = 11;
        pub const CLOCKRATE = 12;

        pub const PROF = 16;
        pub const POSIX1 = 17;
        pub const NGROUPS = 18;
        pub const JOB_CONTROL = 19;
        pub const SAVED_IDS = 20;
        pub const BOOTTIME = 21;
        pub const DOMAINNAME = 22;
        pub const MAXPARTITIONS = 23;
        pub const RAWPARTITION = 24;
        pub const MAXTHREAD = 25;
        pub const NTHREADS = 26;
        pub const OSVERSION = 27;
        pub const SOMAXCONN = 28;
        pub const SOMINCONN = 29;

        pub const NOSUIDCOREDUMP = 32;
        pub const FSYNC = 33;
        pub const SYSVMSG = 34;
        pub const SYSVSEM = 35;
        pub const SYSVSHM = 36;

        pub const MSGBUFSIZE = 38;
        pub const MALLOCSTATS = 39;
        pub const CPTIME = 40;
        pub const NCHSTATS = 41;
        pub const FORKSTAT = 42;
        pub const NSELCOLL = 43;
        pub const TTY = 44;
        pub const CCPU = 45;
        pub const FSCALE = 46;
        pub const NPROCS = 47;
        pub const MSGBUF = 48;
        pub const POOL = 49;
        pub const STACKGAPRANDOM = 50;
        pub const SYSVIPC_INFO = 51;
        pub const ALLOWKMEM = 52;
        pub const WITNESSWATCH = 53;
        pub const SPLASSERT = 54;
        pub const PROC_ARGS = 55;
        pub const NFILES = 56;
        pub const TTYCOUNT = 57;
        pub const NUMVNODES = 58;
        pub const MBSTAT = 59;
        pub const WITNESS = 60;
        pub const SEMINFO = 61;
        pub const SHMINFO = 62;
        pub const INTRCNT = 63;
        pub const WATCHDOG = 64;
        pub const ALLOWDT = 65;
        pub const PROC = 66;
        pub const MAXCLUSTERS = 67;
        pub const EVCOUNT = 68;
        pub const TIMECOUNTER = 69;
        pub const MAXLOCKSPERUID = 70;
        pub const CPTIME2 = 71;
        pub const CACHEPCT = 72;
        pub const FILE = 73;
        pub const WXABORT = 74;
        pub const CONSDEV = 75;
        pub const NETLIVELOCKS = 76;
        pub const POOL_DEBUG = 77;
        pub const PROC_CWD = 78;
        pub const PROC_NOBROADCASTKILL = 79;
        pub const PROC_VMMAP = 80;
        pub const GLOBAL_PTRACE = 81;
        pub const CONSBUFSIZE = 82;
        pub const CONSBUF = 83;
        pub const AUDIO = 84;
        pub const CPUSTATS = 85;
        pub const PFSTATUS = 86;
        pub const TIMEOUT_STATS = 87;
        pub const UTC_OFFSET = 88;
        pub const VIDEO = 89;

        pub const PROC_ALL = 0;
        pub const PROC_PID = 1;
        pub const PROC_PGRP = 2;
        pub const PROC_SESSION = 3;
        pub const PROC_TTY = 4;
        pub const PROC_UID = 5;
        pub const PROC_RUID = 6;
        pub const PROC_KTHREAD = 7;
        pub const PROC_SHOW_THREADS = 0x40000000;

        pub const PROC_ARGV = 1;
        pub const PROC_NARGV = 2;
        pub const PROC_ENV = 3;
        pub const PROC_NENV = 4;
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const OSTYPE = 1;
        pub const OSRELEASE = 2;
        pub const OSREV = 3;
        pub const VERSION = 4;
        pub const MAXVNODES = 5;
        pub const MAXPROC = 6;
        pub const MAXFILES = 7;
        pub const ARGMAX = 8;
        pub const SECURELVL = 9;
        pub const HOSTNAME = 10;
        pub const HOSTID = 11;
        pub const CLOCKRATE = 12;
        pub const VNODE = 13;
        pub const PROC = 14;
        pub const FILE = 15;
        pub const PROF = 16;
        pub const POSIX1 = 17;
        pub const NGROUPS = 18;
        pub const JOB_CONTROL = 19;
        pub const SAVED_IDS = 20;
        pub const BOOTTIME = 21;
        pub const NISDOMAINNAME = 22;
        pub const DOMAINNAME = 22;
        pub const MAXPARTITIONS = 23;
        pub const KDEBUG = 24;
        pub const UPDATEINTERVAL = 25;
        pub const OSRELDATE = 26;
        pub const NTP_PLL = 27;
        pub const BOOTFILE = 28;
        pub const MAXFILESPERPROC = 29;
        pub const MAXPROCPERUID = 30;
        pub const DUMPDEV = 31;
        pub const IPC = 32;
        pub const DUMMY = 33;
        pub const PS_STRINGS = 34;
        pub const USRSTACK32 = 35;
        pub const LOGSIGEXIT = 36;
        pub const SYMFILE = 37;
        pub const PROCARGS = 38;
        pub const NETBOOT = 40;
        pub const SYSV = 42;
        pub const AFFINITY = 43;
        pub const TRANSLATE = 44;
        pub const CLASSIC = 44;
        pub const EXEC = 45;
        pub const CLASSICHANDLER = 45;
        pub const AIOMAX = 46;
        pub const AIOPROCMAX = 47;
        pub const AIOTHREADS = 48;
        pub const PROCARGS2 = 49;
        pub const COREFILE = 50;
        pub const COREDUMP = 51;
        pub const SUGID_COREDUMP = 52;
        pub const PROCDELAYTERM = 53;
        pub const SHREG_PRIVATIZABLE = 54;
        pub const LOW_PRI_WINDOW = 56;
        pub const LOW_PRI_DELAY = 57;
        pub const POSIX = 58;
        pub const USRSTACK64 = 59;
        pub const NX_PROTECTION = 60;
        pub const TFP = 61;
        pub const PROCNAME = 62;
        pub const THALTSTACK = 63;
        pub const SPECULATIVE_READS = 64;
        pub const OSVERSION = 65;
        pub const SAFEBOOT = 66;
        pub const RAGEVNODE = 68;
        pub const TTY = 69;
        pub const CHECKOPENEVT = 70;
        pub const THREADNAME = 71;
        pub const MAXID = 72;
    },
    else => void,
};
pub const MADV = switch (native_os) {
    .linux => linux.MADV,
    .emscripten => emscripten.MADV,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const NORMAL = 0;
        pub const RANDOM = 1;
        pub const SEQUENTIAL = 2;
        pub const WILLNEED = 3;
        pub const DONTNEED = 4;
        pub const FREE = 5;
        pub const ZERO_WIRED_PAGES = 6;
        pub const FREE_REUSABLE = 7;
        pub const FREE_REUSE = 8;
        pub const CAN_REUSE = 9;
        pub const PAGEOUT = 10;
        pub const ZERO = 11;
    },
    .freebsd => struct {
        pub const NORMAL = 0;
        pub const RANDOM = 1;
        pub const SEQUENTIAL = 2;
        pub const WILLNEED = 3;
        pub const DONTNEED = 4;
        pub const FREE = 5;
        pub const NOSYNC = 6;
        pub const AUTOSYNC = 7;
        pub const NOCORE = 8;
        pub const CORE = 9;
        pub const PROTECT = 10;
    },
    .illumos => struct {
        /// 不再进行特殊处理
        pub const NORMAL = 0;
        /// 预期随机页面访问
        pub const RANDOM = 1;
        /// 预计顺序引用页面
        pub const SEQUENTIAL = 2;
        /// 将需要这些页面
        pub const WILLNEED = 3;
        /// 不需要这些页面
        pub const DONTNEED = 4;
        /// 内容可被释放
        pub const FREE = 5;
        /// 默认访问权限
        pub const ACCESS_DEFAULT = 6;
        /// 下一个需要频繁访问的 LWP
        pub const ACCESS_LWP = 7;
        /// 大量进程会频繁访问
        pub const ACCESS_MANY = 8;
        /// 内容将被清除
        pub const PURGE = 9;
    },
    .dragonfly => struct {
        pub const SEQUENTIAL = 2;
        pub const CONTROL_END = SETMAP;
        pub const DONTNEED = 4;
        pub const RANDOM = 1;
        pub const WILLNEED = 3;
        pub const NORMAL = 0;
        pub const CONTROL_START = INVAL;
        pub const FREE = 5;
        pub const NOSYNC = 6;
        pub const AUTOSYNC = 7;
        pub const NOCORE = 8;
        pub const CORE = 9;
        pub const INVAL = 10;
        pub const SETMAP = 11;
    },
    // https://github.com/SerenityOS/serenity/blob/6d59d4d3d9e76e39112842ec487840828f1c9bfe/Kernel/API/POSIX/sys/mman.h#L35-L41
    .serenity => struct {
        pub const NORMAL = 0x0;
        pub const SET_VOLATILE = 0x1;
        pub const SET_NONVOLATILE = 0x2;
        pub const DONTNEED = 0x3;
        pub const WILLNEED = 0x4;
        pub const SEQUENTIAL = 0x5;
        pub const RANDOM = 0x6;
    },
    .netbsd, .openbsd => struct {
        pub const NORMAL = 0;
        pub const RANDOM = 1;
        pub const SEQUENTIAL = 2;
        pub const WILLNEED = 3;
        pub const DONTNEED = 4;
        pub const SPACEAVAIL = 5;
        pub const FREE = 6;
    },
    else => void,
};
pub const MCL = switch (native_os) {
    .linux => linux.MCL,
    // https://github.com/freebsd/freebsd-src/blob/39fea5c8dc598021e900c4feaf0e18111fda57b2/sys/sys/mman.h#L133
    // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/088552723935447397400336f5ddb7aa5f5de660/sys/sys/mman.h#L118
    // https://github.com/NetBSD/src/blob/fd2741deca927c18e3ba15acdf78b8b14b2abe36/sys/sys/mman.h#L179
    // https://github.com/openbsd/src/blob/39404228f6d36c0ca4be5f04ab5385568ebd6aa3/sys/sys/mman.h#L129
    // https://github.com/illumos/illumos-gate/blob/5280477614f83fea20fc938729df6adb3e44340d/usr/src/uts/common/sys/mman.h#L343
    .freebsd, .dragonfly, .netbsd, .openbsd, .illumos => packed struct(u32) {
        CURRENT: bool = false,
        FUTURE: bool = false,
        _: u30 = 0,
    },
    else => void,
};
pub const MLOCK = switch (native_os) {
    .linux => linux.MLOCK,
    else => void,
};
pub const MSF = switch (native_os) {
    .linux => linux.MSF,
    .emscripten => emscripten.MSF,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const ASYNC = 0x1;
        pub const INVALIDATE = 0x2;
        /// 使之失效,保留映射
        pub const KILLPAGES = 0x4;
        /// 停用,但保持映射
        pub const DEACTIVATE = 0x8;
        pub const SYNC = 0x10;
    },
    .freebsd, .dragonfly => struct {
        pub const SYNC = 0;
        pub const ASYNC = 1;
        pub const INVALIDATE = 2;
    },
    .openbsd, .haiku => struct {
        pub const ASYNC = 1;
        pub const SYNC = 2;
        pub const INVALIDATE = 4;
    },
    .netbsd, .illumos => struct {
        pub const ASYNC = 1;
        pub const INVALIDATE = 2;
        pub const SYNC = 4;
    },
    // https://github.com/SerenityOS/serenity/blob/6d59d4d3d9e76e39112842ec487840828f1c9bfe/Kernel/API/POSIX/sys/mman.h#L50-L52
    .serenity => struct {
        pub const SYNC = 1;
        pub const ASYNC = 2;
        pub const INVALIDATE = 4;
    },
    else => void,
};
pub const NAME_MAX = switch (native_os) {
    .linux => linux.NAME_MAX,
    .emscripten => emscripten.NAME_MAX,
    // Haiku 头文件将其设为 256,以容纳末尾的空
    // 字符,但 POSIX 定义规定 NAME_MAX 不包括
    // 终止空字符。
    // https://github.com/SerenityOS/serenity/blob/c87557e9c1865fa1a6440de34ff6ce6fc858a2b7/Kernel/API/POSIX/sys/limits.h#L20
    .haiku, .openbsd, .dragonfly, .netbsd, .illumos, .freebsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .serenity => 255,
    else => {},
};
pub const PATH_MAX = switch (native_os) {
    .linux => linux.PATH_MAX,
    .emscripten => emscripten.PATH_MAX,
    .wasi => 4096,
    .windows => 260,
    .openbsd, .haiku, .dragonfly, .netbsd, .illumos, .freebsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .serenity => 1024,
    else => {},
};

pub const POLL = switch (native_os) {
    .linux => linux.POLL,
    .emscripten => emscripten.POLL,
    .wasi => struct {
        pub const RDNORM = 0x1;
        pub const WRNORM = 0x2;
        pub const IN = RDNORM;
        pub const OUT = WRNORM;
        pub const ERR = 0x1000;
        pub const HUP = 0x2000;
        pub const NVAL = 0x4000;
    },
    .windows => ws2_32.POLL,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const IN = 0x001;
        pub const PRI = 0x002;
        pub const OUT = 0x004;
        pub const RDNORM = 0x040;
        pub const WRNORM = OUT;
        pub const RDBAND = 0x080;
        pub const WRBAND = 0x100;

        pub const EXTEND = 0x0200;
        pub const ATTRIB = 0x0400;
        pub const NLINK = 0x0800;
        pub const WRITE = 0x1000;

        pub const ERR = 0x008;
        pub const HUP = 0x010;
        pub const NVAL = 0x020;

        pub const STANDARD = IN | PRI | OUT | RDNORM | RDBAND | WRBAND | ERR | HUP | NVAL;
    },
    .freebsd => struct {
        /// 存在任何可读数据。
        pub const IN = 0x0001;
        /// 带外/紧急可读数据。
        pub const PRI = 0x0002;
        /// 文件描述符可写。
        pub const OUT = 0x0004;
        /// 非带外/紧急数据可用。
        pub const RDNORM = 0x0040;
        /// 不区分写入类型。
        pub const WRNORM = OUT;
        /// 带外/紧急可读数据。
        pub const RDBAND = 0x0080;
        /// 可写入带外/紧急数据。
        pub const WRBAND = 0x0100;
        /// 类似 IN,但忽略 EOF。
        pub const INIGNEOF = 0x2000;
        /// 发生了某种 poll 错误。
        pub const ERR = 0x0008;
        /// 文件描述符已挂断。
        pub const HUP = 0x0010;
        /// 请求的事件为 "invalid"。
        pub const NVAL = 0x0020;

        pub const STANDARD = IN | PRI | OUT | RDNORM | RDBAND | WRBAND | ERR | HUP | NVAL;
    },
    .illumos => struct {
        pub const IN = 0x0001;
        pub const PRI = 0x0002;
        pub const OUT = 0x0004;
        pub const RDNORM = 0x0040;
        pub const WRNORM = .OUT;
        pub const RDBAND = 0x0080;
        pub const WRBAND = 0x0100;
        /// 读取端挂断。
        pub const RDHUP = 0x4000;

        /// 不可测试事件(不能在 events 中指定)。
        pub const ERR = 0x0008;
        pub const HUP = 0x0010;
        pub const NVAL = 0x0020;

        /// 控制 `/dev/poll` 的事件(不在 revents 中指定)。
        pub const REMOVE = 0x0800;
        pub const ONESHOT = 0x1000;
        pub const ET = 0x2000;
    },
    .dragonfly, .netbsd => struct {
        /// 可测试事件(可在 events 字段中指定)。
        pub const IN = 0x0001;
        pub const PRI = 0x0002;
        pub const OUT = 0x0004;
        pub const RDNORM = 0x0040;
        pub const WRNORM = OUT;
        pub const RDBAND = 0x0080;
        pub const WRBAND = 0x0100;

        /// 不可测试事件(不能在 events 字段中指定)。
        pub const ERR = 0x0008;
        pub const HUP = 0x0010;
        pub const NVAL = 0x0020;
    },
    .haiku => struct {
        /// 有任意可读数据可用
        pub const IN = 0x0001;
        /// 文件描述符可写
        pub const OUT = 0x0002;
        pub const RDNORM = IN;
        pub const WRNORM = OUT;
        /// 高优先级可读数据
        pub const RDBAND = 0x0008;
        /// 可写入优先数据
        pub const WRBAND = 0x0010;
        /// 高优先级可读数据
        pub const PRI = 0x0020;

        /// 存在待处理错误
        pub const ERR = 0x0004;
        /// 已断开连接
        pub const HUP = 0x0080;
        /// 无效的文件描述符
        pub const NVAL = 0x1000;
    },
    .openbsd => struct {
        pub const IN = 0x0001;
        pub const PRI = 0x0002;
        pub const OUT = 0x0004;
        pub const ERR = 0x0008;
        pub const HUP = 0x0010;
        pub const NVAL = 0x0020;
        pub const RDNORM = 0x0040;
        pub const NORM = RDNORM;
        pub const WRNORM = OUT;
        pub const RDBAND = 0x0080;
        pub const WRBAND = 0x0100;
    },
    // https://github.com/SerenityOS/serenity/blob/265764ff2fec038855193296588a887fc322d76a/Kernel/API/POSIX/poll.h#L15-L24
    .serenity => struct {
        pub const IN = 0x0001;
        pub const PRI = 0x0002;
        pub const OUT = 0x0004;
        pub const ERR = 0x0008;
        pub const HUP = 0x0010;
        pub const NVAL = 0x0020;
        pub const RDNORM = IN;
        pub const WRNORM = OUT;
        pub const WRBAND = 0x1000;
        pub const RDHUP = 0x2000;
    },
    else => void,
};

/// 基本内存保护标志
pub const PROT = switch (native_os) {
    .linux => linux.PROT,
    .emscripten => emscripten.PROT,
    // https://github.com/SerenityOS/serenity/blob/6d59d4d3d9e76e39112842ec487840828f1c9bfe/Kernel/API/POSIX/sys/mman.h#L28-L31
    .openbsd, .haiku, .dragonfly, .netbsd, .illumos, .freebsd, .windows, .serenity => packed struct(u32) {
        READ: bool = false,
        WRITE: bool = false,
        EXEC: bool = false,
        _: u29 = 0,
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => vm_prot_t,
    else => void,
};

pub const RLIM = switch (native_os) {
    .linux => linux.RLIM,
    .emscripten => emscripten.RLIM,
    // https://github.com/SerenityOS/serenity/blob/aae106e37b48f2158e68902293df1e4bf7b80c0f/Userland/Libraries/LibC/sys/resource.h#L52
    .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .serenity => struct {
        /// 无限制
        pub const INFINITY: rlim_t = (1 << 63) - 1;

        pub const SAVED_MAX = INFINITY;
        pub const SAVED_CUR = INFINITY;
    },
    .illumos => struct {
        /// 无限制
        pub const INFINITY: rlim_t = (1 << 63) - 3;
        pub const SAVED_MAX: rlim_t = (1 << 63) - 2;
        pub const SAVED_CUR: rlim_t = (1 << 63) - 1;
    },
    else => void,
};
pub const S = switch (native_os) {
    .linux => linux.S,
    .emscripten => emscripten.S,
    .wasi => struct {
        // 匹配 lib/libc/include/wasm-wasi-musl/__mode_t.h 中的 `S_*` 常量
        pub const IFBLK = 0x6000;
        pub const IFCHR = 0x2000;
        pub const IFDIR = 0x4000;
        pub const IFIFO = 0x1000;
        pub const IFLNK = 0xa000;
        pub const IFMT = IFBLK | IFCHR | IFDIR | IFIFO | IFLNK | IFREG | IFSOCK;
        pub const IFREG = 0x8000;
        pub const IFSOCK = 0xc000;

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const IFMT = 0o170000;

        pub const IFIFO = 0o010000;
        pub const IFCHR = 0o020000;
        pub const IFDIR = 0o040000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;
        pub const IFWHT = 0o160000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }

        pub fn IWHT(m: u32) bool {
            return m & IFMT == IFWHT;
        }
    },
    .freebsd => struct {
        pub const IFMT = 0o170000;

        pub const IFIFO = 0o010000;
        pub const IFCHR = 0o020000;
        pub const IFDIR = 0o040000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;
        pub const IFWHT = 0o160000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }

        pub fn IWHT(m: u32) bool {
            return m & IFMT == IFWHT;
        }
    },
    .illumos => struct {
        pub const IFMT = 0o170000;

        pub const IFIFO = 0o010000;
        pub const IFCHR = 0o020000;
        pub const IFDIR = 0o040000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;
        /// SunOS 2.6 的 Door
        pub const IFDOOR = 0o150000;
        /// Solaris 10 事件端口
        pub const IFPORT = 0o160000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }

        pub fn ISDOOR(m: u32) bool {
            return m & IFMT == IFDOOR;
        }

        pub fn ISPORT(m: u32) bool {
            return m & IFMT == IFPORT;
        }
    },
    .netbsd => struct {
        pub const IFMT = 0o170000;

        pub const IFIFO = 0o010000;
        pub const IFCHR = 0o020000;
        pub const IFDIR = 0o040000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;
        pub const IFWHT = 0o160000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }

        pub fn IWHT(m: u32) bool {
            return m & IFMT == IFWHT;
        }
    },
    .dragonfly => struct {
        pub const IFMT = 0o170000;

        pub const IFIFO = 0o010000;
        pub const IFCHR = 0o020000;
        pub const IFDIR = 0o040000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;
        pub const IFWHT = 0o160000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub const IREAD = IRUSR;
        pub const IEXEC = IXUSR;
        pub const IWRITE = IWUSR;
        pub const ISTXT = 512;
        pub const BLKSIZE = 512;

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }

        pub fn IWHT(m: u32) bool {
            return m & IFMT == IFWHT;
        }
    },
    .haiku => struct {
        pub const IFMT = 0o170000;
        pub const IFSOCK = 0o140000;
        pub const IFLNK = 0o120000;
        pub const IFREG = 0o100000;
        pub const IFBLK = 0o060000;
        pub const IFDIR = 0o040000;
        pub const IFCHR = 0o020000;
        pub const IFIFO = 0o010000;
        pub const INDEX_DIR = 0o4000000000;

        pub const IUMSK = 0o7777;
        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }

        pub fn ISINDEX(m: u32) bool {
            return m & INDEX_DIR == INDEX_DIR;
        }
    },
    .openbsd => struct {
        pub const IFMT = 0o170000;

        pub const IFIFO = 0o010000;
        pub const IFCHR = 0o020000;
        pub const IFDIR = 0o040000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub const BLKSIZE = 512;

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }
    },
    // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/sys/stat.h#L16-L51
    .serenity => struct {
        pub const IFMT = 0o170000;
        pub const IFDIR = 0o040000;
        pub const IFCHR = 0o020000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFIFO = 0o010000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IREAD = IRUSR;
        pub const IWRITE = IWUSR;
        pub const IEXEC = IXUSR;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub const IRWXU = IRUSR | IWUSR | IXUSR;

        pub const IRWXG = IRWXU >> 3;
        pub const IRWXO = IRWXG >> 3;

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }
    },
    else => void,
};
pub const SA = switch (native_os) {
    .linux => linux.SA,
    .emscripten => emscripten.SA,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        /// 在信号栈上处理信号
        pub const ONSTACK = 0x0001;
        /// 信号返回时重启系统调用
        pub const RESTART = 0x0002;
        /// 获取信号时重置为 SIG.DFL
        pub const RESETHAND = 0x0004;
        /// 子进程停止时不生成 SIG.CHLD
        pub const NOCLDSTOP = 0x0008;
        /// 不要屏蔽正在传送的信号
        pub const NODEFER = 0x0010;
        /// 不要保留僵尸进程
        pub const NOCLDWAIT = 0x0020;
        /// 带 SIGINFO 参数的信号处理程序
        pub const SIGINFO = 0x0040;
        /// 不经过内核的 sigtramp 跳板
        pub const USERTRAMP = 0x0100;
        /// 带 SIGINFO 参数及 64 位寄存器信息的信号处理程序。
        pub const @"64REGSET" = 0x0200;
    },
    .freebsd => struct {
        pub const ONSTACK = 0x0001;
        pub const RESTART = 0x0002;
        pub const RESETHAND = 0x0004;
        pub const NOCLDSTOP = 0x0008;
        pub const NODEFER = 0x0010;
        pub const NOCLDWAIT = 0x0020;
        pub const SIGINFO = 0x0040;
    },
    .illumos => struct {
        pub const ONSTACK = 0x00000001;
        pub const RESETHAND = 0x00000002;
        pub const RESTART = 0x00000004;
        pub const SIGINFO = 0x00000008;
        pub const NODEFER = 0x00000010;
        pub const NOCLDWAIT = 0x00010000;
    },
    .netbsd => struct {
        pub const ONSTACK = 0x0001;
        pub const RESTART = 0x0002;
        pub const RESETHAND = 0x0004;
        pub const NOCLDSTOP = 0x0008;
        pub const NODEFER = 0x0010;
        pub const NOCLDWAIT = 0x0020;
        pub const SIGINFO = 0x0040;
    },
    .dragonfly => struct {
        pub const ONSTACK = 0x0001;
        pub const RESTART = 0x0002;
        pub const RESETHAND = 0x0004;
        pub const NODEFER = 0x0010;
        pub const NOCLDWAIT = 0x0020;
        pub const SIGINFO = 0x0040;
    },
    .haiku => struct {
        pub const NOCLDSTOP = 0x01;
        pub const NOCLDWAIT = 0x02;
        pub const RESETHAND = 0x04;
        pub const NODEFER = 0x08;
        pub const RESTART = 0x10;
        pub const ONSTACK = 0x20;
        pub const SIGINFO = 0x40;
        pub const NOMASK = NODEFER;
        pub const STACK = ONSTACK;
        pub const ONESHOT = RESETHAND;
    },
    .openbsd => struct {
        pub const ONSTACK = 0x0001;
        pub const RESTART = 0x0002;
        pub const RESETHAND = 0x0004;
        pub const NOCLDSTOP = 0x0008;
        pub const NODEFER = 0x0010;
        pub const NOCLDWAIT = 0x0020;
        pub const SIGINFO = 0x0040;
    },
    // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L65-L71
    .serenity => struct {
        pub const NOCLDSTOP = 1;
        pub const NOCLDWAIT = 2;
        pub const SIGINFO = 4;
        pub const ONSTACK = 0x08000000;
        pub const RESTART = 0x10000000;
        pub const NODEFER = 0x40000000;
        pub const RESETHAND = 0x80000000;
        pub const NOMASK = NODEFER;
        pub const ONESHOT = RESETHAND;
    },
    else => void,
};
pub const sigval_t = switch (native_os) {
    .netbsd, .illumos => extern union {
        int: i32,
        ptr: ?*anyopaque,
    },
    else => void,
};

pub const SC = switch (native_os) {
    .linux => linux.SC,
    else => void,
};

pub const _SC = if (builtin.abi.isAndroid()) enum(c_int) {
    PAGESIZE = 39,
    NPROCESSORS_ONLN = 97,
} else switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => enum(c_int) {
        PAGESIZE = 29,
    },
    .dragonfly => enum(c_int) {
        PAGESIZE = 47,
    },
    .freebsd => enum(c_int) {
        PAGESIZE = 47,
    },
    .fuchsia => enum(c_int) {
        PAGESIZE = 30,
    },
    .haiku => enum(c_int) {
        PAGESIZE = 27,
    },
    .linux => enum(c_int) {
        PAGESIZE = 30,
    },
    .netbsd => enum(c_int) {
        PAGESIZE = 28,
    },
    .openbsd => enum(c_int) {
        PAGESIZE = 28,
    },
    .illumos => enum(c_int) {
        PAGESIZE = 11,
        NPROCESSORS_ONLN = 15,
        SIGRT_MIN = 40,
        SIGRT_MAX = 41,
    },
    // https://github.com/SerenityOS/serenity/blob/1dfc9e2df39dd23f1de92530677c845aae4345f2/Kernel/API/POSIX/unistd.h#L36-L52
    .serenity => enum(c_int) {
        MONOTONIC_CLOCK = 0,
        NPROCESSORS_CONF = 1,
        NPROCESSORS_ONLN = 2,
        OPEN_MAX = 3,
        HOST_NAME_MAX = 4,
        TTY_NAME_MAX = 5,
        PAGESIZE = 6,
        GETPW_R_SIZE_MAX = 7,
        GETGR_R_SIZE_MAX = 8,
        CLK_TCK = 9,
        SYMLOOP_MAX = 10,
        MAPPED_FILES = 11,
        ARG_MAX = 12,
        IOV_MAX = 13,
        PHYS_PAGES = 14,
    },
    else => void,
};

pub const SEEK = switch (native_os) {
    .linux => linux.SEEK,
    .emscripten => emscripten.SEEK,
    .wasi => struct {
        pub const SET: wasi.whence_t = .SET;
        pub const CUR: wasi.whence_t = .CUR;
        pub const END: wasi.whence_t = .END;
    },
    // https://github.com/SerenityOS/serenity/blob/808ce594db1f2190e5212a250e900bde2ffe710b/Kernel/API/POSIX/stdio.h#L15-L17
    .openbsd, .haiku, .netbsd, .freebsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .windows, .serenity => struct {
        pub const SET = 0;
        pub const CUR = 1;
        pub const END = 2;
    },
    .dragonfly, .illumos => struct {
        pub const SET = 0;
        pub const CUR = 1;
        pub const END = 2;
        pub const DATA = 3;
        pub const HOLE = 4;
    },
    else => void,
};
pub const SHUT = switch (native_os) {
    .linux => linux.SHUT,
    .emscripten => emscripten.SHUT,
    // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L40-L42
    else => struct {
        pub const RD = 0;
        pub const WR = 1;
        pub const RDWR = 2;
    },
};

/// 信号类型
pub const SIG = switch (native_os) {
    .linux => linux.SIG,
    .emscripten => emscripten.SIG,
    .windows => enum(u32) {
        /// 中断
        INT = 2,
        /// 非法指令 - 无效的函数映像
        ILL = 4,
        /// 浮点异常
        FPE = 8,
        /// 段访问违规
        SEGV = 11,
        /// 来自 kill 的软件终止信号
        TERM = 15,
        /// Ctrl-Break 序列
        BREAK = 21,
        /// 由 abort 调用触发的异常终止
        ABRT = 22,
        /// 与其他平台兼容的 SIGABRT,与 SIGABRT 相同
        ABRT_COMPAT = 6,
        _,

        // 信号操作码
        /// 默认信号动作
        pub const DFL = 0;
        /// 忽略信号
        pub const IGN = 1;
        /// 返回当前值
        pub const GET = 2;
        /// 信号收到错误
        pub const SGE = 3;
        /// 确认
        pub const ACK = 4;
        /// 信号错误值(signal 调用出错时返回)
        pub const ERR = -1;
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => enum(u32) {
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const HOLD: ?Sigaction.handler_fn = @ptrFromInt(5);

        /// 阻塞指定信号集
        pub const BLOCK = 1;
        /// 解除对指定信号集的阻塞
        pub const UNBLOCK = 2;
        /// 设置指定的信号集
        pub const SETMASK = 3;

        pub const IOT: SIG = .ABRT;
        pub const POLL: SIG = .EMT;

        /// 挂断
        HUP = 1,
        /// 中断
        INT = 2,
        /// 退出
        QUIT = 3,
        /// 非法指令(捕获时不重置)
        ILL = 4,
        /// 跟踪陷阱(捕获时不重置)
        TRAP = 5,
        /// abort()
        ABRT = 6,
        /// EMT 指令
        EMT = 7,
        /// 浮点异常
        FPE = 8,
        /// 终止(不可捕获或忽略)
        KILL = 9,
        /// 总线错误
        BUS = 10,
        /// 段访问违规
        SEGV = 11,
        /// 系统调用参数错误
        SYS = 12,
        /// 向没有读取方的管道写入
        PIPE = 13,
        /// 闹钟
        ALRM = 14,
        /// 由 kill 发出的软件终止信号
        TERM = 15,
        /// IO 通道上出现紧急状况
        URG = 16,
        /// 可发送的停止信号,非来自 tty
        STOP = 17,
        /// 来自 tty 的停止信号
        TSTP = 18,
        /// 继续已停止的进程
        CONT = 19,
        /// 子进程停止或退出时发送给父进程
        CHLD = 20,
        /// 在后台读取终端时发送给读取进程组
        TTIN = 21,
        /// 若 (tp->t_local&LTOSTOP),输出时行为类似 TTIN
        TTOU = 22,
        /// 表示可以进行输入/输出的信号
        IO = 23,
        /// 超出 CPU 时间限制
        XCPU = 24,
        /// 超出文件大小限制
        XFSZ = 25,
        /// 虚拟时间警报
        VTALRM = 26,
        /// 性能分析计时器警报
        PROF = 27,
        /// 窗口大小更改
        WINCH = 28,
        /// 信息请求
        INFO = 29,
        /// 用户自定义信号 1
        USR1 = 30,
        /// 用户定义的信号 2
        USR2 = 31,
        _,
    },
    .freebsd => enum(u32) {
        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;

        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));

        pub const WORDS = 4;
        pub const MAXSIG = 128;

        pub inline fn IDX(sig: usize) usize {
            return sig - 1;
        }
        pub inline fn WORD(sig: usize) usize {
            return IDX(sig) >> 5;
        }
        pub inline fn BIT(sig: usize) usize {
            return 1 << (IDX(sig) & 31);
        }
        pub inline fn VALID(sig: usize) usize {
            return sig <= MAXSIG and sig > 0;
        }

        pub const IOT: SIG = .ABRT;
        pub const LWP: SIG = .THR;

        pub const RTMIN = 65;
        pub const RTMAX = 126;

        HUP = 1,
        INT = 2,
        QUIT = 3,
        ILL = 4,
        TRAP = 5,
        ABRT = 6,
        EMT = 7,
        FPE = 8,
        KILL = 9,
        BUS = 10,
        SEGV = 11,
        SYS = 12,
        PIPE = 13,
        ALRM = 14,
        TERM = 15,
        URG = 16,
        STOP = 17,
        TSTP = 18,
        CONT = 19,
        CHLD = 20,
        TTIN = 21,
        TTOU = 22,
        IO = 23,
        XCPU = 24,
        XFSZ = 25,
        VTALRM = 26,
        PROF = 27,
        WINCH = 28,
        INFO = 29,
        USR1 = 30,
        USR2 = 31,
        THR = 32,
        LIBRT = 33,
        _,
    },
    .illumos => enum(u32) {
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const HOLD: ?Sigaction.handler_fn = @ptrFromInt(2);

        pub const WORDS = 4;
        pub const MAXSIG = 75;

        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;

        pub const RTMIN = 42;
        pub const RTMAX = 74;

        pub inline fn IDX(sig: usize) usize {
            return sig - 1;
        }
        pub inline fn WORD(sig: usize) usize {
            return IDX(sig) >> 5;
        }
        pub inline fn BIT(sig: usize) usize {
            return 1 << (IDX(sig) & 31);
        }
        pub inline fn VALID(sig: usize) usize {
            return sig <= MAXSIG and sig > 0;
        }

        pub const POLL: SIG = .IO;
        pub const IOT: SIG = .ABRT;
        pub const CLD: SIG = .CHLD;

        HUP = 1,
        INT = 2,
        QUIT = 3,
        ILL = 4,
        TRAP = 5,
        ABRT = 6,
        EMT = 7,
        FPE = 8,
        KILL = 9,
        BUS = 10,
        SEGV = 11,
        SYS = 12,
        PIPE = 13,
        ALRM = 14,
        TERM = 15,
        USR1 = 16,
        USR2 = 17,
        CHLD = 18,
        PWR = 19,
        WINCH = 20,
        URG = 21,
        IO = 22,
        STOP = 23,
        TSTP = 24,
        CONT = 25,
        TTIN = 26,
        TTOU = 27,
        VTALRM = 28,
        PROF = 29,
        XCPU = 30,
        XFSZ = 31,
        WAITING = 32,
        LWP = 33,
        FREEZE = 34,
        THAW = 35,
        CANCEL = 36,
        LOST = 37,
        XRES = 38,
        JVM1 = 39,
        JVM2 = 40,
        INFO = 41,
        _,
    },
    .netbsd => enum(u32) {
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));

        pub const WORDS = 4;
        pub const MAXSIG = 128;

        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;

        pub const RTMIN = 33;
        pub const RTMAX = 63;

        pub inline fn IDX(sig: usize) usize {
            return sig - 1;
        }
        pub inline fn WORD(sig: usize) usize {
            return IDX(sig) >> 5;
        }
        pub inline fn BIT(sig: usize) usize {
            return 1 << (IDX(sig) & 31);
        }
        pub inline fn VALID(sig: usize) usize {
            return sig <= MAXSIG and sig > 0;
        }

        pub const IOT: SIG = .ABRT;

        HUP = 1,
        INT = 2,
        QUIT = 3,
        ILL = 4,
        TRAP = 5,
        ABRT = 6,
        EMT = 7,
        FPE = 8,
        KILL = 9,
        BUS = 10,
        SEGV = 11,
        SYS = 12,
        PIPE = 13,
        ALRM = 14,
        TERM = 15,
        URG = 16,
        STOP = 17,
        TSTP = 18,
        CONT = 19,
        CHLD = 20,
        TTIN = 21,
        TTOU = 22,
        IO = 23,
        XCPU = 24,
        XFSZ = 25,
        VTALRM = 26,
        PROF = 27,
        WINCH = 28,
        INFO = 29,
        USR1 = 30,
        USR2 = 31,
        PWR = 32,
        _,
    },
    .dragonfly => enum(u32) {
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));

        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;

        pub const WORDS = 4;

        pub const IOT: SIG = .ABRT;

        HUP = 1,
        INT = 2,
        QUIT = 3,
        ILL = 4,
        TRAP = 5,
        ABRT = 6,
        EMT = 7,
        FPE = 8,
        KILL = 9,
        BUS = 10,
        SEGV = 11,
        SYS = 12,
        PIPE = 13,
        ALRM = 14,
        TERM = 15,
        URG = 16,
        STOP = 17,
        TSTP = 18,
        CONT = 19,
        CHLD = 20,
        TTIN = 21,
        TTOU = 22,
        IO = 23,
        XCPU = 24,
        XFSZ = 25,
        VTALRM = 26,
        PROF = 27,
        WINCH = 28,
        INFO = 29,
        USR1 = 30,
        USR2 = 31,
        THR = 32,
        CKPT = 33,
        CKPTEXIT = 34,
        _,
    },
    .haiku => enum(u32) {
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));

        pub const HOLD: ?Sigaction.handler_fn = @ptrFromInt(3);

        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;

        pub const IO: SIG = .POLL;
        pub const IOT: SIG = .ABRT;

        HUP = 1,
        INT = 2,
        QUIT = 3,
        ILL = 4,
        CHLD = 5,
        ABRT = 6,
        PIPE = 7,
        FPE = 8,
        KILL = 9,
        STOP = 10,
        SEGV = 11,
        CONT = 12,
        TSTP = 13,
        ALRM = 14,
        TERM = 15,
        TTIN = 16,
        TTOU = 17,
        USR1 = 18,
        USR2 = 19,
        WINCH = 20,
        KILLTHR = 21,
        TRAP = 22,
        POLL = 23,
        PROF = 24,
        SYS = 25,
        URG = 26,
        VTALRM = 27,
        XCPU = 28,
        XFSZ = 29,
        BUS = 30,
        RESERVED1 = 31,
        RESERVED2 = 32,
        _,
    },
    .openbsd => enum(u32) {
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));
        pub const CATCH: ?Sigaction.handler_fn = @ptrFromInt(2);
        pub const HOLD: ?Sigaction.handler_fn = @ptrFromInt(3);

        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;

        pub const IOT: SIG = .ABRT;

        HUP = 1,
        INT = 2,
        QUIT = 3,
        ILL = 4,
        TRAP = 5,
        ABRT = 6,
        EMT = 7,
        FPE = 8,
        KILL = 9,
        BUS = 10,
        SEGV = 11,
        SYS = 12,
        PIPE = 13,
        ALRM = 14,
        TERM = 15,
        URG = 16,
        STOP = 17,
        TSTP = 18,
        CONT = 19,
        CHLD = 20,
        TTIN = 21,
        TTOU = 22,
        IO = 23,
        XCPU = 24,
        XFSZ = 25,
        VTALRM = 26,
        PROF = 27,
        WINCH = 28,
        INFO = 29,
        USR1 = 30,
        USR2 = 31,
        PWR = 32,
        _,
    },
    // https://github.com/SerenityOS/serenity/blob/046c23f567a17758d762a33bdf04bacbfd088f9f/Kernel/API/POSIX/signal.h
    // https://github.com/SerenityOS/serenity/blob/046c23f567a17758d762a33bdf04bacbfd088f9f/Kernel/API/POSIX/signal_numbers.h
    .serenity => enum(u32) {
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);

        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;

        INVAL = 0,
        HUP = 1,
        INT = 2,
        QUIT = 3,
        ILL = 4,
        TRAP = 5,
        ABRT = 6,
        BUS = 7,
        FPE = 8,
        KILL = 9,
        USR1 = 10,
        SEGV = 11,
        USR2 = 12,
        PIPE = 13,
        ALRM = 14,
        TERM = 15,
        STKFLT = 16,
        CHLD = 17,
        CONT = 18,
        STOP = 19,
        TSTP = 20,
        TTIN = 21,
        TTOU = 22,
        URG = 23,
        XCPU = 24,
        XFSZ = 25,
        VTALRM = 26,
        PROF = 27,
        WINCH = 28,
        IO = 29,
        INFO = 30,
        SYS = 31,
        CANCEL = 32,
        _,
    },
    else => void,
};

pub const SIOCGIFINDEX = switch (native_os) {
    .linux => linux.SIOCGIFINDEX,
    .emscripten => emscripten.SIOCGIFINDEX,
    .illumos => illumos.SIOCGLIFINDEX,
    // https://github.com/SerenityOS/serenity/blob/cb10f70394fb7e9cfc77f827adb2e46d199bc3a5/Kernel/API/Ioctl.h#L118
    .serenity => 34,
    else => void,
};

pub const STDIN_FILENO = switch (native_os) {
    .linux => linux.STDIN_FILENO,
    .emscripten => emscripten.STDIN_FILENO,
    else => 0,
};
pub const STDOUT_FILENO = switch (native_os) {
    .linux => linux.STDOUT_FILENO,
    .emscripten => emscripten.STDOUT_FILENO,
    else => 1,
};
pub const STDERR_FILENO = switch (native_os) {
    .linux => linux.STDERR_FILENO,
    .emscripten => emscripten.STDERR_FILENO,
    else => 2,
};

pub const SYS = switch (native_os) {
    .linux => linux.SYS,
    else => void,
};

/// 多种 Linux 变体通用的 Sigaction 结构体格式。
const common_linux_Sigaction = extern struct {
    pub const handler_fn = *align(1) const fn (SIG) callconv(.c) void;
    pub const sigaction_fn = *const fn (SIG, *const siginfo_t, ?*anyopaque) callconv(.c) void;

    handler: extern union {
        handler: ?handler_fn,
        sigaction: ?sigaction_fn,
    },
    mask: sigset_t,
    flags: c_uint,
    restorer: ?*const fn () callconv(.c) void = null, // C 库会填充此字段
};

/// 从 `sigaction` 重命名为 `Sigaction`,以避免与函数名冲突。
pub const Sigaction = switch (native_os) {
    .linux => switch (native_arch) {
        .mips,
        .mipsel,
        .mips64,
        .mips64el,
        => if (builtin.target.abi.isMusl())
            common_linux_Sigaction
        else if (builtin.target.ptrBitWidth() == 64) extern struct {
            pub const handler_fn = *align(1) const fn (SIG) callconv(.c) void;
            pub const sigaction_fn = *const fn (SIG, *const siginfo_t, ?*anyopaque) callconv(.c) void;

            flags: c_uint,
            handler: extern union {
                handler: ?handler_fn,
                sigaction: ?sigaction_fn,
            },
            mask: sigset_t,
            restorer: ?*const fn () callconv(.c) void = null,
        } else extern struct {
            pub const handler_fn = *align(1) const fn (SIG) callconv(.c) void;
            pub const sigaction_fn = *const fn (SIG, *const siginfo_t, ?*anyopaque) callconv(.c) void;

            flags: c_uint,
            handler: extern union {
                handler: ?handler_fn,
                sigaction: ?sigaction_fn,
            },
            mask: sigset_t,
            restorer: ?*const fn () callconv(.c) void = null,
            __resv: [1]c_int = .{0},
        },
        .s390x => if (builtin.abi == .gnu) extern struct {
            pub const handler_fn = *align(1) const fn (SIG) callconv(.c) void;
            pub const sigaction_fn = *const fn (SIG, *const siginfo_t, ?*anyopaque) callconv(.c) void;

            handler: extern union {
                handler: ?handler_fn,
                sigaction: ?sigaction_fn,
            },
            __glibc_reserved0: c_int = 0,
            flags: c_uint,
            restorer: ?*const fn () callconv(.c) void = null,
            mask: sigset_t,
        } else common_linux_Sigaction,
        .sparc64 => if (builtin.abi == .gnu) extern struct {
            pub const handler_fn = *align(1) const fn (SIG) callconv(.c) void;
            pub const sigaction_fn = *const fn (SIG, *const siginfo_t, ?*anyopaque) callconv(.c) void;

            handler: extern union {
                handler: ?handler_fn,
                sigaction: ?sigaction_fn,
            },
            mask: sigset_t,
            __glibc_reserved0: c_int = 0,
            flags: c_uint,
            restorer: ?*const fn () callconv(.c) void = null,
        } else common_linux_Sigaction,
        else => common_linux_Sigaction,
    },
    .emscripten => emscripten.Sigaction,
    .netbsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        pub const handler_fn = *align(1) const fn (SIG) callconv(.c) void;
        pub const sigaction_fn = *const fn (SIG, *const siginfo_t, ?*anyopaque) callconv(.c) void;

        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },
        mask: sigset_t,
        flags: c_uint,
    },
    .dragonfly, .freebsd => extern struct {
        pub const handler_fn = *align(1) const fn (SIG) callconv(.c) void;
        pub const sigaction_fn = *const fn (SIG, *const siginfo_t, ?*anyopaque) callconv(.c) void;

        /// 信号处理函数
        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },
        /// 参见信号选项
        flags: c_uint,
        /// 要应用的信号掩码
        mask: sigset_t,
    },
    .illumos => extern struct {
        pub const handler_fn = *align(1) const fn (SIG) callconv(.c) void;
        pub const sigaction_fn = *const fn (SIG, *const siginfo_t, ?*anyopaque) callconv(.c) void;

        /// 信号选项
        flags: c_uint,
        /// 信号处理函数
        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },
        /// 要应用的信号掩码
        mask: sigset_t,
    },
    .haiku => extern struct {
        pub const handler_fn = *align(1) const fn (SIG) callconv(.c) void;
        pub const sigaction_fn = *const fn (SIG, *const siginfo_t, ?*anyopaque) callconv(.c) void;

        /// 信号处理函数
        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },

        /// 要应用的信号掩码
        mask: sigset_t,

        /// 参见信号选项
        flags: i32,

        /// 将传给信号处理器,BeOS 扩展
        userdata: *allowzero anyopaque = undefined,
    },
    .openbsd => extern struct {
        pub const handler_fn = *align(1) const fn (SIG) callconv(.c) void;
        pub const sigaction_fn = *const fn (SIG, *const siginfo_t, ?*anyopaque) callconv(.c) void;

        /// 信号处理函数
        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },
        /// 要应用的信号掩码
        mask: sigset_t,
        /// 信号选项
        flags: c_uint,
    },
    // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L39-L46
    .serenity => extern struct {
        pub const handler_fn = *align(1) const fn (SIG) callconv(.c) void;
        pub const sigaction_fn = *const fn (SIG, *const siginfo_t, ?*anyopaque) callconv(.c) void;

        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },
        mask: sigset_t,
        flags: c_uint,
    },
    else => void,
};
pub const T = switch (native_os) {
    .linux => linux.T,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const IOCGWINSZ = ior(0x40000000, 't', 104, @sizeOf(winsize));

        fn ior(inout: u32, group_arg: usize, num: usize, len: usize) usize {
            return (inout | ((len & IOCPARM_MASK) << 16) | ((group_arg) << 8) | (num));
        }
    },
    .freebsd => struct {
        pub const IOCEXCL = 0x2000740d;
        pub const IOCNXCL = 0x2000740e;
        pub const IOCSCTTY = 0x20007461;
        pub const IOCGPGRP = 0x40047477;
        pub const IOCSPGRP = 0x80047476;
        pub const IOCOUTQ = 0x40047473;
        pub const IOCSTI = 0x80017472;
        pub const IOCGWINSZ = 0x40087468;
        pub const IOCSWINSZ = 0x80087467;
        pub const IOCMGET = 0x4004746a;
        pub const IOCMBIS = 0x8004746c;
        pub const IOCMBIC = 0x8004746b;
        pub const IOCMSET = 0x8004746d;
        pub const FIONREAD = 0x4004667f;
        pub const IOCCONS = 0x80047462;
        pub const IOCPKT = 0x80047470;
        pub const FIONBIO = 0x8004667e;
        pub const IOCNOTTY = 0x20007471;
        pub const IOCSETD = 0x8004741b;
        pub const IOCGETD = 0x4004741a;
        pub const IOCSBRK = 0x2000747b;
        pub const IOCCBRK = 0x2000747a;
        pub const IOCGSID = 0x40047463;
        pub const IOCGPTN = 0x4004740f;
        pub const IOCSIG = 0x2004745f;
    },
    .illumos => struct {
        pub const CGETA = tioc('T', 1);
        pub const CSETA = tioc('T', 2);
        pub const CSETAW = tioc('T', 3);
        pub const CSETAF = tioc('T', 4);
        pub const CSBRK = tioc('T', 5);
        pub const CXONC = tioc('T', 6);
        pub const CFLSH = tioc('T', 7);
        pub const IOCGWINSZ = tioc('T', 104);
        pub const IOCSWINSZ = tioc('T', 103);
        // 软载波 ioctl
        pub const IOCGSOFTCAR = tioc('T', 105);
        pub const IOCSSOFTCAR = tioc('T', 106);
        // termios 的 ioctl
        pub const CGETS = tioc('T', 13);
        pub const CSETS = tioc('T', 14);
        pub const CSANOW = tioc('T', 14);
        pub const CSETSW = tioc('T', 15);
        pub const CSADRAIN = tioc('T', 15);
        pub const CSETSF = tioc('T', 16);
        pub const IOCSETLD = tioc('T', 123);
        pub const IOCGETLD = tioc('T', 124);
        // NTP PPS ioctl 调用
        pub const IOCGPPS = tioc('T', 125);
        pub const IOCSPPS = tioc('T', 126);
        pub const IOCGPPSEV = tioc('T', 127);

        pub const IOCGETD = tioc('t', 0);
        pub const IOCSETD = tioc('t', 1);
        pub const IOCHPCL = tioc('t', 2);
        pub const IOCGETP = tioc('t', 8);
        pub const IOCSETP = tioc('t', 9);
        pub const IOCSETN = tioc('t', 10);
        pub const IOCEXCL = tioc('t', 13);
        pub const IOCNXCL = tioc('t', 14);
        pub const IOCFLUSH = tioc('t', 16);
        pub const IOCSETC = tioc('t', 17);
        pub const IOCGETC = tioc('t', 18);
        /// 按位设置本地模式位
        pub const IOCLBIS = tioc('t', 127);
        /// 清除本地模式位
        pub const IOCLBIC = tioc('t', 126);
        /// 设置整个本地模式字
        pub const IOCLSET = tioc('t', 125);
        /// 获取本地模式
        pub const IOCLGET = tioc('t', 124);
        /// 设置 break 位
        pub const IOCSBRK = tioc('t', 123);
        /// 清除 break 位
        pub const IOCCBRK = tioc('t', 122);
        /// 设置数据终端就绪状态
        pub const IOCSDTR = tioc('t', 121);
        /// 清除数据终端就绪状态
        pub const IOCCDTR = tioc('t', 120);
        /// 设置本地特殊字符
        pub const IOCSLTC = tioc('t', 117);
        /// 获取本地特殊字符
        pub const IOCGLTC = tioc('t', 116);
        /// 驱动程序输出队列大小
        pub const IOCOUTQ = tioc('t', 115);
        /// 解除 tty 关联
        pub const IOCNOTTY = tioc('t', 113);
        /// 获取控制终端
        pub const IOCSCTTY = tioc('t', 132);
        /// 停止输出,如 ^S
        pub const IOCSTOP = tioc('t', 111);
        /// 开始输出,类似 ^Q
        pub const IOCSTART = tioc('t', 110);
        /// 获取 tty 的进程组
        pub const IOCGPGRP = tioc('t', 20);
        /// 设置 tty 的进程组
        pub const IOCSPGRP = tioc('t', 21);
        /// 在控制终端上获取会话 ID
        pub const IOCGSID = tioc('t', 22);
        /// 模拟终端输入
        pub const IOCSTI = tioc('t', 23);
        /// 设置所有调制解调器位
        pub const IOCMSET = tioc('t', 26);
        /// 设置调制解调器位
        pub const IOCMBIS = tioc('t', 27);
        /// 清除调制解调器位
        pub const IOCMBIC = tioc('t', 28);
        /// 获取全部调制解调器位
        pub const IOCMGET = tioc('t', 29);

        fn tioc(t: u16, num: u8) u16 {
            return (t << 8) | num;
        }
    },
    .netbsd => struct {
        pub const IOCCBRK = 0x2000747a;
        pub const IOCCDTR = 0x20007478;
        pub const IOCCONS = 0x80047462;
        pub const IOCDCDTIMESTAMP = 0x40107458;
        pub const IOCDRAIN = 0x2000745e;
        pub const IOCEXCL = 0x2000740d;
        pub const IOCEXT = 0x80047460;
        pub const IOCFLAG_CDTRCTS = 0x10;
        pub const IOCFLAG_CLOCAL = 0x2;
        pub const IOCFLAG_CRTSCTS = 0x4;
        pub const IOCFLAG_MDMBUF = 0x8;
        pub const IOCFLAG_SOFTCAR = 0x1;
        pub const IOCFLUSH = 0x80047410;
        pub const IOCGETA = 0x402c7413;
        pub const IOCGETD = 0x4004741a;
        pub const IOCGFLAGS = 0x4004745d;
        pub const IOCGLINED = 0x40207442;
        pub const IOCGPGRP = 0x40047477;
        pub const IOCGQSIZE = 0x40047481;
        pub const IOCGRANTPT = 0x20007447;
        pub const IOCGSID = 0x40047463;
        pub const IOCGSIZE = 0x40087468;
        pub const IOCGWINSZ = 0x40087468;
        pub const IOCMBIC = 0x8004746b;
        pub const IOCMBIS = 0x8004746c;
        pub const IOCMGET = 0x4004746a;
        pub const IOCMSET = 0x8004746d;
        pub const IOCM_CAR = 0x40;
        pub const IOCM_CD = 0x40;
        pub const IOCM_CTS = 0x20;
        pub const IOCM_DSR = 0x100;
        pub const IOCM_DTR = 0x2;
        pub const IOCM_LE = 0x1;
        pub const IOCM_RI = 0x80;
        pub const IOCM_RNG = 0x80;
        pub const IOCM_RTS = 0x4;
        pub const IOCM_SR = 0x10;
        pub const IOCM_ST = 0x8;
        pub const IOCNOTTY = 0x20007471;
        pub const IOCNXCL = 0x2000740e;
        pub const IOCOUTQ = 0x40047473;
        pub const IOCPKT = 0x80047470;
        pub const IOCPKT_DATA = 0x0;
        pub const IOCPKT_DOSTOP = 0x20;
        pub const IOCPKT_FLUSHREAD = 0x1;
        pub const IOCPKT_FLUSHWRITE = 0x2;
        pub const IOCPKT_IOCTL = 0x40;
        pub const IOCPKT_NOSTOP = 0x10;
        pub const IOCPKT_START = 0x8;
        pub const IOCPKT_STOP = 0x4;
        pub const IOCPTMGET = 0x40287446;
        pub const IOCPTSNAME = 0x40287448;
        pub const IOCRCVFRAME = 0x80087445;
        pub const IOCREMOTE = 0x80047469;
        pub const IOCSBRK = 0x2000747b;
        pub const IOCSCTTY = 0x20007461;
        pub const IOCSDTR = 0x20007479;
        pub const IOCSETA = 0x802c7414;
        pub const IOCSETAF = 0x802c7416;
        pub const IOCSETAW = 0x802c7415;
        pub const IOCSETD = 0x8004741b;
        pub const IOCSFLAGS = 0x8004745c;
        pub const IOCSIG = 0x2000745f;
        pub const IOCSLINED = 0x80207443;
        pub const IOCSPGRP = 0x80047476;
        pub const IOCSQSIZE = 0x80047480;
        pub const IOCSSIZE = 0x80087467;
        pub const IOCSTART = 0x2000746e;
        pub const IOCSTAT = 0x80047465;
        pub const IOCSTI = 0x80017472;
        pub const IOCSTOP = 0x2000746f;
        pub const IOCSWINSZ = 0x80087467;
        pub const IOCUCNTL = 0x80047466;
        pub const IOCXMTFRAME = 0x80087444;
    },
    .haiku => struct {
        pub const CGETA = 0x8000;
        pub const CSETA = 0x8001;
        pub const CSETAF = 0x8002;
        pub const CSETAW = 0x8003;
        pub const CWAITEVENT = 0x8004;
        pub const CSBRK = 0x8005;
        pub const CFLSH = 0x8006;
        pub const CXONC = 0x8007;
        pub const CQUERYCONNECTED = 0x8008;
        pub const CGETBITS = 0x8009;
        pub const CSETDTR = 0x8010;
        pub const CSETRTS = 0x8011;
        pub const IOCGWINSZ = 0x8012;
        pub const IOCSWINSZ = 0x8013;
        pub const CVTIME = 0x8014;
        pub const IOCGPGRP = 0x8015;
        pub const IOCSPGRP = 0x8016;
        pub const IOCSCTTY = 0x8017;
        pub const IOCMGET = 0x8018;
        pub const IOCMSET = 0x8019;
        pub const IOCSBRK = 0x8020;
        pub const IOCCBRK = 0x8021;
        pub const IOCMBIS = 0x8022;
        pub const IOCMBIC = 0x8023;
        pub const IOCGSID = 0x8024;

        pub const FIONREAD = 0xbe000001;
        pub const FIONBIO = 0xbe000000;
    },
    .openbsd => struct {
        pub const IOCCBRK = 0x2000747a;
        pub const IOCCDTR = 0x20007478;
        pub const IOCCONS = 0x80047462;
        pub const IOCDCDTIMESTAMP = 0x40107458;
        pub const IOCDRAIN = 0x2000745e;
        pub const IOCEXCL = 0x2000740d;
        pub const IOCEXT = 0x80047460;
        pub const IOCFLAG_CDTRCTS = 0x10;
        pub const IOCFLAG_CLOCAL = 0x2;
        pub const IOCFLAG_CRTSCTS = 0x4;
        pub const IOCFLAG_MDMBUF = 0x8;
        pub const IOCFLAG_SOFTCAR = 0x1;
        pub const IOCFLUSH = 0x80047410;
        pub const IOCGETA = 0x402c7413;
        pub const IOCGETD = 0x4004741a;
        pub const IOCGFLAGS = 0x4004745d;
        pub const IOCGLINED = 0x40207442;
        pub const IOCGPGRP = 0x40047477;
        pub const IOCGQSIZE = 0x40047481;
        pub const IOCGRANTPT = 0x20007447;
        pub const IOCGSID = 0x40047463;
        pub const IOCGSIZE = 0x40087468;
        pub const IOCGWINSZ = 0x40087468;
        pub const IOCMBIC = 0x8004746b;
        pub const IOCMBIS = 0x8004746c;
        pub const IOCMGET = 0x4004746a;
        pub const IOCMSET = 0x8004746d;
        pub const IOCM_CAR = 0x40;
        pub const IOCM_CD = 0x40;
        pub const IOCM_CTS = 0x20;
        pub const IOCM_DSR = 0x100;
        pub const IOCM_DTR = 0x2;
        pub const IOCM_LE = 0x1;
        pub const IOCM_RI = 0x80;
        pub const IOCM_RNG = 0x80;
        pub const IOCM_RTS = 0x4;
        pub const IOCM_SR = 0x10;
        pub const IOCM_ST = 0x8;
        pub const IOCNOTTY = 0x20007471;
        pub const IOCNXCL = 0x2000740e;
        pub const IOCOUTQ = 0x40047473;
        pub const IOCPKT = 0x80047470;
        pub const IOCPKT_DATA = 0x0;
        pub const IOCPKT_DOSTOP = 0x20;
        pub const IOCPKT_FLUSHREAD = 0x1;
        pub const IOCPKT_FLUSHWRITE = 0x2;
        pub const IOCPKT_IOCTL = 0x40;
        pub const IOCPKT_NOSTOP = 0x10;
        pub const IOCPKT_START = 0x8;
        pub const IOCPKT_STOP = 0x4;
        pub const IOCPTMGET = 0x40287446;
        pub const IOCPTSNAME = 0x40287448;
        pub const IOCRCVFRAME = 0x80087445;
        pub const IOCREMOTE = 0x80047469;
        pub const IOCSBRK = 0x2000747b;
        pub const IOCSCTTY = 0x20007461;
        pub const IOCSDTR = 0x20007479;
        pub const IOCSETA = 0x802c7414;
        pub const IOCSETAF = 0x802c7416;
        pub const IOCSETAW = 0x802c7415;
        pub const IOCSETD = 0x8004741b;
        pub const IOCSFLAGS = 0x8004745c;
        pub const IOCSIG = 0x2000745f;
        pub const IOCSLINED = 0x80207443;
        pub const IOCSPGRP = 0x80047476;
        pub const IOCSQSIZE = 0x80047480;
        pub const IOCSSIZE = 0x80087467;
        pub const IOCSTART = 0x2000746e;
        pub const IOCSTAT = 0x80047465;
        pub const IOCSTI = 0x80017472;
        pub const IOCSTOP = 0x2000746f;
        pub const IOCSWINSZ = 0x80087467;
        pub const IOCUCNTL = 0x80047466;
        pub const IOCXMTFRAME = 0x80087444;
    },
    .dragonfly => struct {
        pub const IOCMODG = 0x40047403;
        pub const IOCMODS = 0x80047404;
        pub const IOCM_LE = 0x00000001;
        pub const IOCM_DTR = 0x00000002;
        pub const IOCM_RTS = 0x00000004;
        pub const IOCM_ST = 0x00000008;
        pub const IOCM_SR = 0x00000010;
        pub const IOCM_CTS = 0x00000020;
        pub const IOCM_CAR = 0x00000040;
        pub const IOCM_CD = 0x00000040;
        pub const IOCM_RNG = 0x00000080;
        pub const IOCM_RI = 0x00000080;
        pub const IOCM_DSR = 0x00000100;
        pub const IOCEXCL = 0x2000740d;
        pub const IOCNXCL = 0x2000740e;
        pub const IOCFLUSH = 0x80047410;
        pub const IOCGETA = 0x402c7413;
        pub const IOCSETA = 0x802c7414;
        pub const IOCSETAW = 0x802c7415;
        pub const IOCSETAF = 0x802c7416;
        pub const IOCGETD = 0x4004741a;
        pub const IOCSETD = 0x8004741b;
        pub const IOCSBRK = 0x2000747b;
        pub const IOCCBRK = 0x2000747a;
        pub const IOCSDTR = 0x20007479;
        pub const IOCCDTR = 0x20007478;
        pub const IOCGPGRP = 0x40047477;
        pub const IOCSPGRP = 0x80047476;
        pub const IOCOUTQ = 0x40047473;
        pub const IOCSTI = 0x80017472;
        pub const IOCNOTTY = 0x20007471;
        pub const IOCPKT = 0x80047470;
        pub const IOCPKT_DATA = 0x00000000;
        pub const IOCPKT_FLUSHREAD = 0x00000001;
        pub const IOCPKT_FLUSHWRITE = 0x00000002;
        pub const IOCPKT_STOP = 0x00000004;
        pub const IOCPKT_START = 0x00000008;
        pub const IOCPKT_NOSTOP = 0x00000010;
        pub const IOCPKT_DOSTOP = 0x00000020;
        pub const IOCPKT_IOCTL = 0x00000040;
        pub const IOCSTOP = 0x2000746f;
        pub const IOCSTART = 0x2000746e;
        pub const IOCMSET = 0x8004746d;
        pub const IOCMBIS = 0x8004746c;
        pub const IOCMBIC = 0x8004746b;
        pub const IOCMGET = 0x4004746a;
        pub const IOCREMOTE = 0x80047469;
        pub const IOCGWINSZ = 0x40087468;
        pub const IOCSWINSZ = 0x80087467;
        pub const IOCUCNTL = 0x80047466;
        pub const IOCSTAT = 0x20007465;
        pub const IOCGSID = 0x40047463;
        pub const IOCCONS = 0x80047462;
        pub const IOCSCTTY = 0x20007461;
        pub const IOCEXT = 0x80047460;
        pub const IOCSIG = 0x2000745f;
        pub const IOCDRAIN = 0x2000745e;
        pub const IOCMSDTRWAIT = 0x8004745b;
        pub const IOCMGDTRWAIT = 0x4004745a;
        pub const IOCTIMESTAMP = 0x40107459;
        pub const IOCDCDTIMESTAMP = 0x40107458;
        pub const IOCSDRAINWAIT = 0x80047457;
        pub const IOCGDRAINWAIT = 0x40047456;
        pub const IOCISPTMASTER = 0x20007455;
    },
    // https://github.com/SerenityOS/serenity/blob/cb10f70394fb7e9cfc77f827adb2e46d199bc3a5/Kernel/API/Ioctl.h#L84-L96
    .serenity => struct {
        pub const IOCGPGRP = 0;
        pub const IOCSPGRP = 1;
        pub const CGETS = 2;
        pub const CSETS = 3;
        pub const CSETSW = 4;
        pub const CSETSF = 5;
        pub const CFLSH = 6;
        pub const IOCGWINSZ = 7;
        pub const IOCSCTTY = 8;
        pub const IOCSTI = 9;
        pub const IOCNOTTY = 10;
        pub const IOCSWINSZ = 11;
        pub const IOCGPTN = 12;
    },
    else => void,
};
pub const IOCPARM_MASK = switch (native_os) {
    .windows => ws2_32.IOCPARM_MASK,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => 0x1fff,
    else => void,
};
pub const TCSA = std.posix.TCSA;
pub const TFD = switch (native_os) {
    .linux => linux.TFD,
    else => void,
};
pub const VDSO = switch (native_os) {
    .linux => linux.VDSO,
    else => void,
};
pub const W = switch (native_os) {
    .linux => linux.W,
    .emscripten => emscripten.W,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        /// [XSI] 等待时不阻塞或没有可回收的子进程
        pub const NOHANG = 0x00000001;
        /// [XSI] 在停止时通知未跟踪的子进程
        pub const UNTRACED = 0x00000002;

        pub fn EXITSTATUS(x: u32) u8 {
            return @as(u8, @intCast(x >> 8));
        }
        pub fn TERMSIG(x: u32) SIG {
            return @fromBackingInt(@intCast(status(x)));
        }
        pub fn STOPSIG(x: u32) SIG {
            return @fromBackingInt(@intCast(x >> 8));
        }
        pub fn IFEXITED(x: u32) bool {
            return status(x) == 0;
        }
        pub fn IFSTOPPED(x: u32) bool {
            return status(x) == stopped and @as(u32, @backingInt(STOPSIG(x))) != 0x13;
        }
        pub fn IFSIGNALED(x: u32) bool {
            return status(x) != stopped and status(x) != 0;
        }

        fn status(x: u32) u32 {
            return x & 0o177;
        }
        const stopped = 0o177;
    },
    .freebsd => struct {
        pub const NOHANG = 1;
        pub const UNTRACED = 2;
        pub const STOPPED = UNTRACED;
        pub const CONTINUED = 4;
        pub const NOWAIT = 8;
        pub const EXITED = 16;
        pub const TRAPPED = 32;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast((s & 0xff00) >> 8));
        }
        pub fn TERMSIG(s: u32) SIG {
            return @fromBackingInt(@intCast(s & 0x7f));
        }
        pub fn STOPSIG(s: u32) SIG {
            return @fromBackingInt(@intCast(EXITSTATUS(s)));
        }
        pub fn IFEXITED(s: u32) bool {
            return (s & 0x7f) == 0;
        }
        pub fn IFSTOPPED(s: u32) bool {
            return @as(u16, @truncate((((s & 0xffff) *% 0x10001) >> 8))) > 0x7f00;
        }
        pub fn IFSIGNALED(s: u32) bool {
            return (s & 0xffff) -% 1 < 0xff;
        }
    },
    .illumos => struct {
        pub const EXITED = 0o001;
        pub const TRAPPED = 0o002;
        pub const UNTRACED = 0o004;
        pub const STOPPED = UNTRACED;
        pub const CONTINUED = 0o010;
        pub const NOHANG = 0o100;
        pub const NOWAIT = 0o200;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast((s >> 8) & 0xff));
        }
        pub fn TERMSIG(s: u32) SIG {
            return @fromBackingInt(@intCast(s & 0x7f));
        }
        pub fn STOPSIG(s: u32) SIG {
            return @fromBackingInt(@intCast(EXITSTATUS(s)));
        }
        pub fn IFEXITED(s: u32) bool {
            return (s & 0x7f) == 0;
        }

        pub fn IFCONTINUED(s: u32) bool {
            return ((s & 0o177777) == 0o177777);
        }

        pub fn IFSTOPPED(s: u32) bool {
            return (s & 0x00ff != 0o177) and !(s & 0xff00 != 0);
        }

        pub fn IFSIGNALED(s: u32) bool {
            return s & 0x00ff > 0 and s & 0xff00 == 0;
        }
    },
    .netbsd => struct {
        pub const NOHANG = 0x00000001;
        pub const UNTRACED = 0x00000002;
        pub const STOPPED = UNTRACED;
        pub const CONTINUED = 0x00000010;
        pub const NOWAIT = 0x00010000;
        pub const EXITED = 0x00000020;
        pub const TRAPPED = 0x00000040;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast((s >> 8) & 0xff));
        }
        pub fn TERMSIG(s: u32) SIG {
            return @fromBackingInt(@intCast(s & 0x7f));
        }
        pub fn STOPSIG(s: u32) SIG {
            return @fromBackingInt(@intCast(EXITSTATUS(s)));
        }
        pub fn IFEXITED(s: u32) bool {
            return (s & 0x7f) == 0;
        }

        pub fn IFCONTINUED(s: u32) bool {
            return (s == CONTINUED);
        }

        pub fn IFSTOPPED(s: u32) bool {
            return (((s & 0x7f) == STOPPED) and !IFCONTINUED(s));
        }

        pub fn IFSIGNALED(s: u32) bool {
            return !IFSTOPPED(s) and !IFCONTINUED(s) and !IFEXITED(s);
        }
    },
    .dragonfly => struct {
        pub const NOHANG = 0x0001;
        pub const UNTRACED = 0x0002;
        pub const CONTINUED = 0x0004;
        pub const STOPPED = UNTRACED;
        pub const NOWAIT = 0x0008;
        pub const EXITED = 0x0010;
        pub const TRAPPED = 0x0020;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast((s & 0xff00) >> 8));
        }
        pub fn TERMSIG(s: u32) SIG {
            return @fromBackingInt(@intCast(s & 0x7f));
        }
        pub fn STOPSIG(s: u32) SIG {
            return @fromBackingInt(@intCast(EXITSTATUS(s)));
        }
        pub fn IFEXITED(s: u32) bool {
            return (s & 0x7f) == 0;
        }
        pub fn IFSTOPPED(s: u32) bool {
            return @as(u16, @truncate((((s & 0xffff) *% 0x10001) >> 8))) > 0x7f00;
        }
        pub fn IFSIGNALED(s: u32) bool {
            return (s & 0xffff) -% 1 < 0xff;
        }
    },
    .haiku => struct {
        pub const NOHANG = 0x1;
        pub const UNTRACED = 0x2;
        pub const CONTINUED = 0x4;
        pub const EXITED = 0x08;
        pub const STOPPED = 0x10;
        pub const NOWAIT = 0x20;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast(s & 0xff));
        }

        pub fn TERMSIG(s: u32) SIG {
            return @fromBackingInt(@intCast((s >> 8) & 0xff));
        }

        pub fn STOPSIG(s: u32) SIG {
            return @fromBackingInt(@intCast((s >> 16) & 0xff));
        }

        pub fn IFEXITED(s: u32) bool {
            return (s & ~@as(u32, 0xff)) == 0;
        }

        pub fn IFSTOPPED(s: u32) bool {
            return ((s >> 16) & 0xff) != 0;
        }

        pub fn IFSIGNALED(s: u32) bool {
            return ((s >> 8) & 0xff) != 0;
        }
    },
    .openbsd => struct {
        pub const NOHANG = 1;
        pub const UNTRACED = 2;
        pub const CONTINUED = 8;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast((s >> 8) & 0xff));
        }
        pub fn TERMSIG(s: u32) SIG {
            return @fromBackingInt(@intCast(s & 0x7f));
        }
        pub fn STOPSIG(s: u32) SIG {
            return @fromBackingInt(@intCast(EXITSTATUS(s)));
        }
        pub fn IFEXITED(s: u32) bool {
            return (s & 0x7f) == 0;
        }

        pub fn IFCONTINUED(s: u32) bool {
            return ((s & 0o177777) == 0o177777);
        }

        pub fn IFSTOPPED(s: u32) bool {
            return (s & 0xff == 0o177);
        }

        pub fn IFSIGNALED(s: u32) bool {
            return (((s) & 0o177) != 0o177) and (((s) & 0o177) != 0);
        }
    },
    // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/sys/wait.h
    .serenity => struct {
        pub const NOHANG = 1;
        pub const UNTRACED = 2;
        pub const STOPPED = UNTRACED;
        pub const EXITED = 4;
        pub const CONTINUED = 8;
        pub const NOWAIT = 0x1000000;

        pub fn EXITSTATUS(s: u32) u8 {
            return @intCast((s & 0xff00) >> 8);
        }

        pub fn STOPSIG(s: u32) SIG {
            return @fromBackingInt(@intCast(EXITSTATUS(s)));
        }

        pub fn TERMSIG(s: u32) SIG {
            return @fromBackingInt(@intCast(s & 0x7f));
        }

        pub fn IFEXITED(s: u32) bool {
            return (s & 0x7f) == 0;
        }

        pub fn IFSTOPPED(s: u32) bool {
            return (s & 0xff) == 0x7f;
        }

        pub fn IFSIGNALED(s: u32) bool {
            return (((s & 0x7f) + 1) >> 1) > 0;
        }

        pub fn IFCONTINUED(s: u32) bool {
            return s == 0xffff;
        }
    },
    else => void,
};
pub const accept_filter_arg = switch (native_os) {
    // https://github.com/freebsd/freebsd-src/blob/2024887abc7d1b931e00fbb0697658e98adf048d/sys/sys/socket.h#L205
    // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/6098912863ed4c7b3f70d7483910ce2956cf4ed3/sys/sys/socket.h#L164
    // https://github.com/NetBSD/src/blob/cad5c68a8524927f65e22ad651de3905382be6e0/sys/sys/socket.h#L188
    // https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/socket.h#L504
    .freebsd, .dragonfly, .netbsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        name: [16]u8,
        arg: [240]u8,
    },
    else => void,
};
pub const clock_t = switch (native_os) {
    .linux => linux.clock_t,
    .emscripten => emscripten.clock_t,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => c_ulong,
    .freebsd => isize,
    .openbsd, .illumos => i64,
    .netbsd => u32,
    .haiku => i32,
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L50
    .serenity => u64,
    else => void,
};
pub const cpu_set_t = switch (native_os) {
    .linux => linux.cpu_set_t,
    .emscripten => emscripten.cpu_set_t,
    else => void,
};
pub const dl_phdr_info = switch (native_os) {
    .linux => linux.dl_phdr_info,
    .emscripten => emscripten.dl_phdr_info,
    .freebsd => extern struct {
        /// 模块重定位基址。
        addr: std.elf.Addr,
        /// 模块名称。
        name: ?[*:0]const u8,
        /// 指向模块 phdr 的指针。
        phdr: [*]std.elf.ElfN.Phdr,
        /// phdr 中的条目数量。
        phnum: u16,
        /// 加载总次数。
        adds: u64,
        /// 卸载总次数。
        subs: u64,
        tls_modid: usize,
        tls_data: ?*anyopaque,
    },
    .illumos => extern struct {
        addr: std.elf.Addr,
        name: ?[*:0]const u8,
        phdr: [*]std.elf.ElfN.Phdr,
        phnum: std.elf.Half,
        /// 每当新对象映射到进程中时递增。
        adds: u64,
        /// 每当一个对象从进程中解除映射时递增。
        subs: u64,
    },
    // https://github.com/SerenityOS/serenity/blob/45d81dceed81df0c8ef75b440b20cc0938195faa/Userland/Libraries/LibC/link.h#L15-L20
    .openbsd, .haiku, .dragonfly, .netbsd, .serenity => extern struct {
        addr: usize,
        name: ?[*:0]const u8,
        phdr: [*]std.elf.ElfN.Phdr,
        phnum: std.elf.Half,
    },
    else => void,
};
pub const epoll_event = switch (native_os) {
    .linux => linux.epoll_event,
    else => void,
};
pub const ifreq = switch (native_os) {
    .linux => linux.ifreq,
    .emscripten => emscripten.ifreq,
    .illumos => lifreq,
    // https://github.com/SerenityOS/serenity/blob/9882848e0bf783dfc8e8a6d887a848d70d9c58f4/Kernel/API/POSIX/net/if.h#L49-L82
    .serenity => extern struct {
        // 实际上并不位于联合体中,但标准库要求 ifreq 中有一个联合体
        ifrn: extern union {
            name: [IFNAMESIZE]u8,
        },
        ifru: extern union {
            addr: sockaddr,
            dstaddr: sockaddr,
            broadaddr: sockaddr,
            netmask: sockaddr,
            hwaddr: sockaddr,
            flags: c_short,
            metric: c_int,
            vnetid: i64,
            media: u64,
            data: ?*anyopaque,
            index: c_uint,
        },
    },
    else => void,
};
pub const in_pktinfo = switch (native_os) {
    .linux => linux.in_pktinfo,
    // https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L1132
    // https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/netinet/in.h#L696
    .illumos, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        ifindex: u32,
        spec_dst: u32,
        addr: u32,
    },
    else => void,
};
pub const in6_pktinfo = switch (native_os) {
    .linux => linux.in6_pktinfo,
    // https://github.com/freebsd/freebsd-src/blob/9bfbc6826f72eb385bf52f4cde8080bccf7e3ebd/sys/netinet6/in6.h#L547
    // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/6098912863ed4c7b3f70d7483910ce2956cf4ed3/sys/netinet6/in6.h#L575
    // https://github.com/NetBSD/src/blob/80bf25a5691072d4755e84567ccbdf0729370dea/sys/netinet6/in6.h#L468
    // https://github.com/openbsd/src/blob/718a31b40d39fc6064de6355eb144e74633133fc/sys/netinet6/in6.h#L365
    // https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L114IP1
    // https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/netinet6/in6.h#L737
    // https://github.com/haiku/haiku/blob/2aab5f5f14aeb3f34c3a3d9a9064cc3c0d914bea/headers/posix/netinet6/in6.h#L63
    // https://github.com/SerenityOS/serenity/blob/5bd8af99be0bc4b2e14f361fd7d7590e6bcfa4d6/Kernel/API/POSIX/sys/socket.h#L122
    .freebsd, .dragonfly, .netbsd, .openbsd, .illumos, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .haiku, .serenity => extern struct {
        addr: [16]u8,
        ifindex: u32,
    },
    else => void,
};
pub const itimerspec = switch (native_os) {
    .linux => linux.itimerspec,
    .dragonfly, .freebsd, .netbsd, .openbsd, .haiku, .illumos, .windows, .wasi => extern struct {
        interval: timespec,
        value: timespec,
    },
    else => void,
};
pub const linger = switch (native_os) {
    .linux => linux.linger,
    // https://github.com/freebsd/freebsd-src/blob/46347b3619757e3d683a87ca03efaf2ae242335f/sys/sys/socket.h#L200
    .freebsd,
    // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/6098912863ed4c7b3f70d7483910ce2956cf4ed3/sys/sys/socket.h#L158
    .dragonfly,
    // https://github.com/NetBSD/src/blob/80bf25a5691072d4755e84567ccbdf0729370dea/sys/sys/socket.h#L183
    .netbsd,
    // https://github.com/openbsd/src/blob/718a31b40d39fc6064de6355eb144e74633133fc/sys/sys/socket.h#L126
    .openbsd,
    // https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/sys/socket.h#L250
    .illumos,
    // https://github.com/haiku/haiku/blob/2aab5f5f14aeb3f34c3a3d9a9064cc3c0d914bea/headers/posix/sys/socket.h#L87
    .haiku,
    // https://github.com/SerenityOS/serenity/blob/5bd8af99be0bc4b2e14f361fd7d7590e6bcfa4d6/Kernel/API/POSIX/sys/socket.h#L122
    .serenity,
    // https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/socket.h#L498
    .driverkit,
    .ios,
    .maccatalyst,
    .macos,
    .tvos,
    .visionos,
    .watchos,
    => extern struct {
        onoff: i32, // 非零表示关闭时延迟退出
        linger: i32, // 延迟关闭时间,单位为秒
    },
    else => void,
};

pub const msghdr = switch (native_os) {
    .linux => if (@bitSizeOf(usize) > @bitSizeOf(i32) and builtin.abi.isMusl()) posix_msghdr else linux.msghdr,
    .openbsd,
    .emscripten,
    .dragonfly,
    .freebsd,
    .netbsd,
    .haiku,
    .illumos,
    .driverkit,
    .ios,
    .maccatalyst,
    .macos,
    .tvos,
    .visionos,
    .watchos,
    .serenity, // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L74-L82
    => posix_msghdr,
    else => void,
};

/// POSIX 将若干结构体字段定义为 int 或 socklen_t,但 Linux 将其定义为 size_t。glibc 不遵循 POSIX,而采用 Linux 内核的定义;musl 则致力于遵循 POSIX,按 POSIX 方式定义这些字段。
///
/// musl 根据宿主字节序在字段前后添加填充字段,以解决 64 位 Linux ABI 与 POSIX 规范之间的不兼容:
///
///     #if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
///         int __pad2;
///     #endif
///         socklen_t msg_controllen;
///     #if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
///         int __pad2;
///     #endif
///
/// 为模拟 musl 的这一特殊行为,这些结构体使用 MuslOnlyPadding 字段:
///
///     pad0: MuslOnlyPadding(.big) = 0,
///     msg_controllen: socklen_t,
///     pad1: MuslOnlyPadding(.little) = 0,
///
/// 在 32 位系统以及非 musl 系统中,这些字段的大小为零,会被忽略。
///
///
///
///
fn MuslOnlyPadding(endian: std.builtin.Endian) type {
    return if (builtin.abi.isMusl() and @sizeOf(usize) == 8 and native_endian == endian) u32 else u0;
}

/// https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_socket.h.html
const posix_msghdr = extern struct {
    name: ?*sockaddr,
    namelen: socklen_t,
    iov: [*]iovec,
    pad0: MuslOnlyPadding(.big) = 0,
    iovlen: u32,
    pad1: MuslOnlyPadding(.little) = 0,
    control: ?*anyopaque,
    pad2: MuslOnlyPadding(.big) = 0,
    controllen: socklen_t,
    pad3: MuslOnlyPadding(.little) = 0,
    flags: u32,
};

pub const msghdr_const = switch (native_os) {
    .linux => if (@bitSizeOf(usize) > @bitSizeOf(i32) and builtin.abi.isMusl()) posix_msghdr_const else linux.msghdr_const,
    .openbsd,
    .emscripten,
    .dragonfly,
    .freebsd,
    .netbsd,
    .haiku,
    .illumos,
    .driverkit,
    .ios,
    .maccatalyst,
    .macos,
    .tvos,
    .visionos,
    .watchos,
    .serenity,
    => posix_msghdr_const,
    else => void,
};

const posix_msghdr_const = extern struct {
    name: ?*const sockaddr,
    namelen: socklen_t,
    iov: [*]const iovec_const,
    pad0: MuslOnlyPadding(.big) = 0,
    iovlen: u32,
    pad1: MuslOnlyPadding(.little) = 0,
    control: ?*const anyopaque,
    pad2: MuslOnlyPadding(.big) = 0,
    controllen: socklen_t,
    pad3: MuslOnlyPadding(.little) = 0,
    flags: u32,
};

pub const mmsghdr = switch (native_os) {
    .linux => linux.mmsghdr,
    else => extern struct {
        hdr: msghdr,
        len: u32,
    },
};

pub const cmsghdr = switch (native_os) {
    .linux => if (@bitSizeOf(usize) > @bitSizeOf(i32) and builtin.abi.isMusl()) posix_cmsghdr else linux.cmsghdr,
    // https://github.com/emscripten-core/emscripten/blob/96371ed7888fc78c040179f4d4faa82a6a07a116/system/lib/libc/musl/include/sys/socket.h#L44
    .emscripten => linux.cmsghdr,
    // https://github.com/freebsd/freebsd-src/blob/b197d2abcb6895d78bc9df8404e374397aa44748/sys/sys/socket.h#L492
    .freebsd,
    // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/107c0518337ba90e7fa49e74845d8d44320c9a6d/sys/sys/socket.h#L452
    .dragonfly,
    // https://github.com/NetBSD/src/blob/ba8e1774fd9c0c26ecca461c07bc95d9ebb69579/sys/sys/socket.h#L528
    .netbsd,
    // https://github.com/openbsd/src/blob/master/sys/sys/socket.h#L527
    .openbsd,
    // https://github.com/illumos/illumos-gate/blob/afdf2e523873cb523df379676067bf9785a0f456/usr/src/uts/common/sys/socket.h#L460
    .illumos,
    // https://github.com/SerenityOS/serenity/blob/4ee360a348a5e2490eeaeeabb3eb19e70dd450eb/Kernel/API/POSIX/sys/socket.h#L68
    .serenity,
    // https://github.com/haiku/haiku/blob/b54f586058fd6623645512e4631468cede9933b9/headers/posix/sys/socket.h#L132
    .haiku,
    // https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/socket.h#L1041
    .driverkit,
    .ios,
    .maccatalyst,
    .macos,
    .tvos,
    .visionos,
    .watchos,
    => posix_cmsghdr,

    else => void,
};

const posix_cmsghdr = extern struct {
    pad0: MuslOnlyPadding(.big) = 0,
    len: socklen_t,
    pad1: MuslOnlyPadding(.little) = 0,
    level: c_int,
    type: c_int,
};

// POSIX 指定的 CMSG_* 宏使用的对齐方式
// https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_socket.h.html
pub const cmsg_align = switch (native_os) {
    .linux => linux.cmsg_align,
    // https://github.com/emscripten-core/emscripten/blob/96371ed7888fc78c040179f4d4faa82a6a07a116/system/lib/libc/musl/include/sys/socket.h#L362
    .emscripten => @sizeOf(usize),
    // https://github.com/freebsd/freebsd-src/blob/b197d2abcb6895d78bc9df8404e374397aa44748/sys/sys/socket.h#L584
    // https://github.com/freebsd/freebsd-src/blob/d2018cedb414ef17e77b7fc2fa19fd81328da46b/sys/sys/_align.h#L30
    .freebsd => @sizeOf(*anyopaque),
    // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/d1f4fb943c73e2b61ddabff6aa48ce7551db72f4/sys/sys/socket.h#L441
    // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/d1f4fb943c73e2b61ddabff6aa48ce7551db72f4/sys/cpu/x86_64/include/alignbytes.h#L35
    .dragonfly => switch (builtin.cpu.arch) {
        .x86_64 => @sizeOf(c_long),
        else => {},
    },
    // https://github.com/NetBSD/src/blob/ba8e1774fd9c0c26ecca461c07bc95d9ebb69579/sys/sys/socket.h#L544
    .netbsd => switch (builtin.cpu.arch) {
        // https://github.com/NetBSD/src/blob/ac016822f750dc9166c84b6d2657479992622192/sys/arch/arm/include/cdefs.h#L63
        .aarch64, .aarch64_be => @sizeOf(i128),
        .arm, .armeb => @sizeOf(c_longlong),
        // https://github.com/NetBSD/src/blob/ac016822f750dc9166c84b6d2657479992622192/sys/arch/i386/include/cdefs.h#L9
        .x86 => @sizeOf(c_int),
        // https://github.com/NetBSD/src/blob/ac016822f750dc9166c84b6d2657479992622192/sys/arch/amd64/include/cdefs.h#L6
        .x86_64 => @sizeOf(c_long),
        // https://github.com/NetBSD/src/blob/ac016822f750dc9166c84b6d2657479992622192/sys/arch/mips/include/cdefs.h#L74
        .mips, .mips64, .mipsel, .mips64el => 8,
        // https://github.com/NetBSD/src/blob/ac016822f750dc9166c84b6d2657479992622192/sys/arch/sparc/include/cdefs.h#L8
        .sparc64 => 16,
        // https://github.com/NetBSD/src/blob/ac016822f750dc9166c84b6d2657479992622192/sys/arch/sparc/include/cdefs.h#L10
        .sparc => 8,
        // https://github.com/NetBSD/src/blob/ac016822f750dc9166c84b6d2657479992622192/sys/arch/alpha/include/cdefs.h#L6
        .alpha => 8,
        // https://github.com/NetBSD/src/blob/ac016822f750dc9166c84b6d2657479992622192/sys/arch/m68k/include/cdefs.h#L6
        .m68k => @sizeOf(c_int),
        // https://github.com/NetBSD/src/blob/ac016822f750dc9166c84b6d2657479992622192/sys/arch/hppa/include/cdefs.h#L12
        .hppa => 8,
        // https://github.com/NetBSD/src/blob/ac016822f750dc9166c84b6d2657479992622192/sys/arch/riscv/include/cdefs.h#L5
        .riscv32, .riscv32be, .riscv64, .riscv64be => @as(comptime_int, builtin.target.cMaxIntAlignment()),
        // https://github.com/NetBSD/src/blob/ac016822f750dc9166c84b6d2657479992622192/sys/arch/powerpc/include/cdefs.h#L6
        .powerpc, .powerpcle, .powerpc64, .powerpc64le => @sizeOf(f64),
        // https://github.com/NetBSD/src/blob/ac016822f750dc9166c84b6d2657479992622192/sys/arch/or1k/include/cdefs.h#L6
        .or1k => @as(comptime_int, builtin.target.cMaxIntAlignment()),
        else => {},
    },
    // https://github.com/openbsd/src/blob/4a7ecdb29021f26ee0ef397afdd2931e20e63071/sys/sys/socket.h#L564
    // https://github.com/openbsd/src/blob/4a7ecdb29021f26ee0ef397afdd2931e20e63071/sys/arch/amd64/include/_types.h#L50
    .openbsd => @sizeOf(c_long),
    // https://github.com/illumos/illumos-gate/blob/c1e950d976948602134f0e0e5dadf3d48a7ee996/usr/src/uts/common/sys/socket.h#L469
    .illumos => 4,
    // https://github.com/haiku/haiku/blob/b54f586058fd6623645512e4631468cede9933b9/headers/posix/sys/socket.h#L152
    // https://github.com/haiku/haiku/blob/6059d64cb7cd145f0f1eb5b89c383f71e4b6bebf/headers/posix/sys/param.h#L28
    .haiku => @sizeOf(c_long),
    // https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/socket.h#L1077
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => 4,
    else => {},
};
comptime {
    if (@TypeOf(cmsg_align) != void and @TypeOf(cmsghdr) != void) {
        assert(cmsg_align >= @alignOf(cmsghdr));
    }
}

pub const nfds_t = switch (native_os) {
    .linux => linux.nfds_t,
    .emscripten => emscripten.nfds_t,
    .haiku, .illumos, .wasi => usize,
    .windows => c_ulong,
    .openbsd, .dragonfly, .netbsd, .freebsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => u32,
    // https://github.com/SerenityOS/serenity/blob/265764ff2fec038855193296588a887fc322d76a/Kernel/API/POSIX/poll.h#L32
    .serenity => c_uint,
    else => void,
};
pub const perf_event_attr = switch (native_os) {
    .linux => linux.perf_event_attr,
    else => void,
};
pub const pid_t = switch (native_os) {
    .linux => linux.pid_t,
    .emscripten => emscripten.pid_t,
    .windows => windows.HANDLE,
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L31-L32
    .serenity => c_int,
    else => i32,
};
pub const pollfd = switch (native_os) {
    .linux => linux.pollfd,
    .emscripten => emscripten.pollfd,
    .windows => ws2_32.pollfd,
    // https://github.com/SerenityOS/serenity/blob/265764ff2fec038855193296588a887fc322d76a/Kernel/API/POSIX/poll.h#L26-L30
    .serenity => extern struct {
        fd: fd_t,
        events: c_short,
        revents: c_short = undefined,
    },
    else => extern struct {
        fd: fd_t,
        events: i16,
        revents: i16 = undefined,
    },
};
pub const rlim_t = switch (native_os) {
    .linux => linux.rlim_t,
    .emscripten => emscripten.rlim_t,
    .openbsd, .netbsd, .illumos, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => u64,
    .haiku, .dragonfly, .freebsd => i64,
    // https://github.com/SerenityOS/serenity/blob/aae106e37b48f2158e68902293df1e4bf7b80c0f/Userland/Libraries/LibC/sys/resource.h#L54
    .serenity => usize,
    else => void,
};
pub const rlimit = switch (native_os) {
    .linux, .emscripten => linux.rlimit,
    .windows => void,
    // https://github.com/SerenityOS/serenity/blob/aae106e37b48f2158e68902293df1e4bf7b80c0f/Userland/Libraries/LibC/sys/resource.h#L56-L59
    else => extern struct {
        /// 软限制
        cur: rlim_t,
        /// 硬限制
        max: rlim_t,
    },
};
pub const rlimit_resource = switch (native_os) {
    .linux => linux.rlimit_resource,
    .emscripten => emscripten.rlimit_resource,
    .openbsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => enum(c_int) {
        CPU = 0,
        FSIZE = 1,
        DATA = 2,
        STACK = 3,
        CORE = 4,
        RSS = 5,
        MEMLOCK = 6,
        NPROC = 7,
        NOFILE = 8,
        _,

        pub const AS: rlimit_resource = .RSS;
    },
    .freebsd => enum(c_int) {
        CPU = 0,
        FSIZE = 1,
        DATA = 2,
        STACK = 3,
        CORE = 4,
        RSS = 5,
        MEMLOCK = 6,
        NPROC = 7,
        NOFILE = 8,
        SBSIZE = 9,
        VMEM = 10,
        NPTS = 11,
        SWAP = 12,
        KQUEUES = 13,
        UMTXP = 14,
        _,

        pub const AS: rlimit_resource = .VMEM;
    },
    .illumos => enum(c_int) {
        CPU = 0,
        FSIZE = 1,
        DATA = 2,
        STACK = 3,
        CORE = 4,
        NOFILE = 5,
        VMEM = 6,
        _,

        pub const AS: rlimit_resource = .VMEM;
    },
    .netbsd => enum(c_int) {
        CPU = 0,
        FSIZE = 1,
        DATA = 2,
        STACK = 3,
        CORE = 4,
        RSS = 5,
        MEMLOCK = 6,
        NPROC = 7,
        NOFILE = 8,
        SBSIZE = 9,
        VMEM = 10,
        NTHR = 11,
        _,

        pub const AS: rlimit_resource = .VMEM;
    },
    .dragonfly => enum(c_int) {
        CPU = 0,
        FSIZE = 1,
        DATA = 2,
        STACK = 3,
        CORE = 4,
        RSS = 5,
        MEMLOCK = 6,
        NPROC = 7,
        NOFILE = 8,
        SBSIZE = 9,
        VMEM = 10,
        POSIXLOCKS = 11,
        _,

        pub const AS: rlimit_resource = .VMEM;
    },
    .haiku => enum(i32) {
        CORE = 0,
        CPU = 1,
        DATA = 2,
        FSIZE = 3,
        NOFILE = 4,
        STACK = 5,
        AS = 6,
        NOVMON = 7,
        _,
    },
    // https://github.com/SerenityOS/serenity/blob/aae106e37b48f2158e68902293df1e4bf7b80c0f/Userland/Libraries/LibC/sys/resource.h#L42-L48
    .serenity => enum(c_int) {
        CORE = 1,
        CPU = 2,
        DATA = 3,
        FSIZE = 4,
        NOFILE = 5,
        STACK = 6,
        AS = 7,
        _,
    },
    else => void,
};
pub const rusage = switch (native_os) {
    .linux => linux.rusage,
    .emscripten => emscripten.rusage,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        utime: timeval,
        stime: timeval,
        maxrss: isize,
        ixrss: isize,
        idrss: isize,
        isrss: isize,
        minflt: isize,
        majflt: isize,
        nswap: isize,
        inblock: isize,
        oublock: isize,
        msgsnd: isize,
        msgrcv: isize,
        nsignals: isize,
        nvcsw: isize,
        nivcsw: isize,

        pub const SELF = 0;
        pub const CHILDREN = -1;
    },
    .illumos => extern struct {
        utime: timeval,
        stime: timeval,
        maxrss: isize,
        ixrss: isize,
        idrss: isize,
        isrss: isize,
        minflt: isize,
        majflt: isize,
        nswap: isize,
        inblock: isize,
        oublock: isize,
        msgsnd: isize,
        msgrcv: isize,
        nsignals: isize,
        nvcsw: isize,
        nivcsw: isize,

        pub const SELF = 0;
        pub const CHILDREN = -1;
        pub const THREAD = 1;
    },
    // https://github.com/SerenityOS/serenity/blob/aae106e37b48f2158e68902293df1e4bf7b80c0f/Userland/Libraries/LibC/sys/resource.h#L18-L38
    .serenity => extern struct {
        utime: timeval,
        stime: timeval,
        maxrss: c_long,
        ixrss: c_long,
        idrss: c_long,
        isrss: c_long,
        minflt: c_long,
        majflt: c_long,
        nswap: c_long,
        inblock: c_long,
        oublock: c_long,
        msgsnd: c_long,
        msgrcv: c_long,
        nsignals: c_long,
        nvcsw: c_long,
        nivcsw: c_long,

        pub const SELF = 1;
        pub const CHILDREN = 2;
    },
    .freebsd, .openbsd => extern struct {
        utime: timeval,
        stime: timeval,
        maxrss: c_long,
        ixrss: c_long,
        idrss: c_long,
        isrss: c_long,
        minflt: c_long,
        majflt: c_long,
        nswap: c_long,
        inblock: c_long,
        oublock: c_long,
        msgsnd: c_long,
        msgrcv: c_long,
        nsignals: c_long,
        nvcsw: c_long,
        nivcsw: c_long,

        pub const SELF = 0;
        pub const CHILDREN = -1;
        pub const THREAD = 1;
    },
    .dragonfly, .netbsd => extern struct {
        utime: timeval,
        stime: timeval,
        maxrss: c_long,
        ixrss: c_long,
        idrss: c_long,
        isrss: c_long,
        minflt: c_long,
        majflt: c_long,
        nswap: c_long,
        inblock: c_long,
        oublock: c_long,
        msgsnd: c_long,
        msgrcv: c_long,
        nsignals: c_long,
        nvcsw: c_long,
        nivcsw: c_long,

        pub const SELF = 0;
        pub const CHILDREN = -1;
    },
    else => void,
};

pub const siginfo_t = switch (native_os) {
    .linux => linux.siginfo_t,
    .emscripten => emscripten.siginfo_t,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        signo: SIG,
        errno: c_int,
        code: c_int,
        pid: pid_t,
        uid: uid_t,
        status: c_int,
        addr: *allowzero anyopaque,
        value: extern union {
            int: c_int,
            ptr: *anyopaque,
        },
        si_band: c_long,
        _pad: [7]c_ulong,
    },
    .freebsd => extern struct {
        // 信号编号。
        signo: SIG,
        // Errno 关联。
        errno: c_int,
        /// 信号码。
        ///
        /// 信号的原因,为某个 SI_ 宏或信号专属值,例如
        /// SIGFPE 对应的某个 FPE_... 值。
        /// 此值等同于旧式 FreeBSD 信号处理函数的第二个参数。
        ///
        code: c_int,
        /// 发送进程。
        pid: pid_t,
        /// 发送者的真实用户 ID。
        uid: uid_t,
        /// 退出值。
        status: c_int,
        /// 引发故障的指令。
        addr: *allowzero anyopaque,
        /// 信号值。
        value: sigval,
        reason: extern union {
            fault: extern struct {
                /// 机器专用陷阱代码。
                trapno: c_int,
            },
            timer: extern struct {
                timerid: c_int,
                overrun: c_int,
            },
            mesgq: extern struct {
                mqd: c_int,
            },
            poll: extern struct {
                /// SIGPOLL 的频带事件。未使用。
                band: c_long,
            },
            spare: extern struct {
                spare1: c_long,
                spare2: [7]c_int,
            },
        },
    },
    .illumos => extern struct {
        signo: SIG,
        code: c_int,
        errno: c_int,
        // 64 位架构会在此插入 4 字节填充,方法是
        // 正确对齐 reason 字段
        reason: extern union {
            proc: extern struct {
                pid: pid_t,
                pdata: extern union {
                    kill: extern struct {
                        uid: uid_t,
                        value: sigval_t,
                    },
                    cld: extern struct {
                        utime: clock_t,
                        status: c_int,
                        stime: clock_t,
                    },
                },
                contract: illumos.ctid_t,
                zone: illumos.zoneid_t,
            },
            fault: extern struct {
                addr: *allowzero anyopaque,
                trapno: c_int,
                pc: ?*anyopaque,
            },
            file: extern struct {
                // fd 当前不可用于 SIGPOLL。
                fd: c_int,
                band: c_long,
            },
            prof: extern struct {
                addr: ?*anyopaque,
                timestamp: timespec,
                syscall: c_short,
                sysarg: u8,
                fault: u8,
                args: [8]c_long,
                state: [10]c_int,
            },
            rctl: extern struct {
                entity: i32,
            },
            __pad: [256 - 4 * @sizeOf(c_int)]u8,
        } align(@sizeOf(usize)),

        comptime {
            assert(@sizeOf(@This()) == 256);
            assert(@alignOf(@This()) == @sizeOf(usize));
        }
    },
    .netbsd => extern union {
        pad: [128]u8,
        info: netbsd._ksiginfo,
    },
    .dragonfly => extern struct {
        signo: SIG,
        errno: c_int,
        code: c_int,
        pid: c_int,
        uid: uid_t,
        status: c_int,
        addr: *allowzero anyopaque,
        value: sigval,
        band: c_long,
        __spare__: [7]c_int,
    },
    .haiku => extern struct {
        signo: SIG,
        code: i32,
        errno: i32,

        pid: pid_t,
        uid: uid_t,
        addr: *allowzero anyopaque,
    },
    .openbsd => extern struct {
        signo: SIG,
        code: c_int,
        errno: c_int,
        data: extern union {
            proc: extern struct {
                pid: pid_t,
                pdata: extern union {
                    kill: extern struct {
                        uid: uid_t,
                        value: sigval,
                    },
                    cld: extern struct {
                        utime: clock_t,
                        stime: clock_t,
                        status: c_int,
                    },
                },
            },
            fault: extern struct {
                addr: *allowzero anyopaque,
                trapno: c_int,
            },
            __pad: [128 - 3 * @sizeOf(c_int)]u8,
        },
    },
    // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L27-L37
    .serenity => extern struct {
        signo: SIG,
        code: c_int,
        errno: c_int,
        pid: pid_t,
        uid: uid_t,
        addr: ?*anyopaque,
        status: c_int,
        band: c_int,
        value: sigval,
    },
    else => void,
};
pub const sigset_t = switch (native_os) {
    .linux => [1024 / @bitSizeOf(c_ulong)]c_ulong, // glibc 和 musl 提供 1024 位 sigset_t,而内核使用的大小不超过 128 位。
    .emscripten => emscripten.sigset_t,
    // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L19
    .openbsd, .serenity => u32,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => darwin.sigset_t,
    .dragonfly, .netbsd, .illumos, .freebsd => extern struct {
        __bits: [SIG.WORDS]u32,
    },
    .haiku => u64,
    else => u0,
};

pub const sigval = switch (native_os) {
    .linux => linux.sigval,
    // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L22-L25
    .openbsd, .dragonfly, .freebsd, .serenity => extern union {
        int: c_int,
        ptr: ?*anyopaque,
    },
    else => void,
};

pub const addrinfo = if (builtin.abi.isAndroid()) extern struct {
    flags: AI,
    family: i32,
    socktype: i32,
    protocol: i32,
    addrlen: socklen_t,
    canonname: ?[*:0]u8,
    addr: ?*sockaddr,
    next: ?*addrinfo,
} else switch (native_os) {
    .linux, .emscripten => linux.addrinfo,
    .windows => ws2_32.addrinfo,
    .freebsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        flags: AI,
        family: i32,
        socktype: i32,
        protocol: i32,
        addrlen: socklen_t,
        canonname: ?[*:0]u8,
        addr: ?*sockaddr,
        next: ?*addrinfo,
    },
    .illumos => extern struct {
        flags: AI,
        family: i32,
        socktype: i32,
        protocol: i32,
        addrlen: socklen_t,
        canonname: ?[*:0]u8,
        addr: ?*sockaddr,
        next: ?*addrinfo,
    },
    .netbsd => extern struct {
        flags: AI,
        family: i32,
        socktype: i32,
        protocol: i32,
        addrlen: socklen_t,
        canonname: ?[*:0]u8,
        addr: ?*sockaddr,
        next: ?*addrinfo,
    },
    .dragonfly => extern struct {
        flags: AI,
        family: i32,
        socktype: i32,
        protocol: i32,
        addrlen: socklen_t,
        canonname: ?[*:0]u8,
        addr: ?*sockaddr,
        next: ?*addrinfo,
    },
    .haiku => extern struct {
        flags: AI,
        family: i32,
        socktype: i32,
        protocol: i32,
        addrlen: socklen_t,
        canonname: ?[*:0]u8,
        addr: ?*sockaddr,
        next: ?*addrinfo,
    },
    // https://github.com/SerenityOS/serenity/blob/d510d2aeb2facbd8f6c383d70fd1b033e1fee5dd/Userland/Libraries/LibC/netdb.h#L66-L75
    .openbsd, .serenity => extern struct {
        flags: AI,
        family: c_int,
        socktype: c_int,
        protocol: c_int,
        addrlen: socklen_t,
        addr: ?*sockaddr,
        canonname: ?[*:0]u8,
        next: ?*addrinfo,
    },
    else => void,
};
pub const sockaddr = switch (native_os) {
    .linux, .emscripten => linux.sockaddr,
    .windows => ws2_32.sockaddr,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        len: u8,
        family: sa_family_t,
        data: [14]u8,

        pub const SS_MAXSIZE = 128;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [126]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };
        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };
        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        /// UNIX 域套接字
        pub const un = extern struct {
            len: u8 = @sizeOf(un),
            family: sa_family_t = AF.UNIX,
            path: [104]u8,
        };
    },
    .freebsd => extern struct {
        /// 总长度
        len: u8,
        /// 地址族
        family: sa_family_t,
        /// 实际更长;地址值
        data: [14]u8,

        pub const SS_MAXSIZE = 128;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [126]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        pub const un = extern struct {
            len: u8 = @sizeOf(un),
            family: sa_family_t = AF.UNIX,
            path: [104]u8,
        };
    },
    .illumos => extern struct {
        /// 地址族
        family: sa_family_t,

        /// 实际更长;地址值
        data: [14]u8,

        pub const SS_MAXSIZE = 256;
        pub const storage = extern struct {
            family: sa_family_t align(8),
            padding: [254]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
            __src_id: u32 = 0,
        };

        /// UNIX IPC 域的定义。
        pub const un = extern struct {
            family: sa_family_t = AF.UNIX,
            path: [108]u8,
        };
    },
    .netbsd => extern struct {
        /// 总长度
        len: u8,
        /// 地址族
        family: sa_family_t,
        /// 实际更长;地址值
        data: [14]u8,

        pub const SS_MAXSIZE = 128;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [126]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        /// UNIX IPC 域的定义。
        pub const un = extern struct {
            /// sockaddr 总长度
            len: u8 = @sizeOf(un),

            family: sa_family_t = AF.LOCAL,

            /// 路径名
            path: [104]u8,
        };
    },
    .dragonfly => extern struct {
        len: u8,
        family: sa_family_t,
        data: [14]u8,

        pub const SS_MAXSIZE = 128;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [126]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        pub const un = extern struct {
            len: u8 = @sizeOf(un),
            family: sa_family_t = AF.UNIX,
            path: [104]u8,
        };
    },
    .haiku => extern struct {
        /// 总长度
        len: u8,
        /// 地址族
        family: sa_family_t,
        /// 实际更长;地址值
        data: [14]u8,

        pub const SS_MAXSIZE = 128;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [126]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        pub const un = extern struct {
            len: u8 = @sizeOf(un),
            family: sa_family_t = AF.UNIX,
            path: [104]u8,
        };
    },
    .openbsd => extern struct {
        /// 总长度
        len: u8,
        /// 地址族
        family: sa_family_t,
        /// 实际更长;地址值
        data: [14]u8,

        pub const SS_MAXSIZE = 256;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [254]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        /// UNIX IPC 域的定义。
        pub const un = extern struct {
            /// sockaddr 总长度
            len: u8 = @sizeOf(un),

            family: sa_family_t = AF.LOCAL,

            /// 路径名
            path: [104]u8,
        };
    },
    // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L110-L114
    .serenity => extern struct {
        family: sa_family_t,
        data: [26]u8,

        // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/netinet/in.h
        const in_addr = u32;
        const in6_addr = [16]u8;
        pub const in = extern struct {
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: in_addr,
            zero: [8]u8 = @splat(0),
        };
        pub const in6 = extern struct {
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: in6_addr,
            scope_id: u32,
        };

        // https://github.com/SerenityOS/serenity/blob/b92e6b02e53b2927732f31b1442cad420b62d1ef/Kernel/API/POSIX/sys/un.h
        const UNIX_PATH_MAX = 108;
        pub const un = extern struct {
            family: sa_family_t = AF.LOCAL,
            path: [UNIX_PATH_MAX]u8,
        };
    },
    else => void,
};
pub const socklen_t = switch (native_os) {
    .linux, .emscripten => linux.socklen_t,
    .windows => ws2_32.socklen_t,
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L57
    else => u32,
};
pub const in_port_t = u16;
pub const sa_family_t = switch (native_os) {
    .linux, .emscripten => linux.sa_family_t,
    .windows => ws2_32.ADDRESS_FAMILY,
    .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => u8,
    // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L66
    .illumos, .serenity => u16,
    else => void,
};
pub const AF = if (builtin.abi.isAndroid()) struct {
    pub const UNSPEC = 0;
    pub const UNIX = 1;
    pub const LOCAL = 1;
    pub const INET = 2;
    pub const AX25 = 3;
    pub const IPX = 4;
    pub const APPLETALK = 5;
    pub const NETROM = 6;
    pub const BRIDGE = 7;
    pub const ATMPVC = 8;
    pub const X25 = 9;
    pub const INET6 = 10;
    pub const ROSE = 11;
    pub const DECnet = 12;
    pub const NETBEUI = 13;
    pub const SECURITY = 14;
    pub const KEY = 15;
    pub const NETLINK = 16;
    pub const ROUTE = NETLINK;
    pub const PACKET = 17;
    pub const ASH = 18;
    pub const ECONET = 19;
    pub const ATMSVC = 20;
    pub const RDS = 21;
    pub const SNA = 22;
    pub const IRDA = 23;
    pub const PPPOX = 24;
    pub const WANPIPE = 25;
    pub const LLC = 26;
    pub const CAN = 29;
    pub const TIPC = 30;
    pub const BLUETOOTH = 31;
    pub const IUCV = 32;
    pub const RXRPC = 33;
    pub const ISDN = 34;
    pub const PHONET = 35;
    pub const IEEE802154 = 36;
    pub const CAIF = 37;
    pub const ALG = 38;
    pub const NFC = 39;
    pub const VSOCK = 40;
    pub const KCM = 41;
    pub const QIPCRTR = 42;
    pub const MAX = 43;
} else switch (native_os) {
    .linux, .emscripten => linux.AF,
    .windows => ws2_32.AF,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const UNSPEC = 0;
        pub const LOCAL = 1;
        pub const UNIX = LOCAL;
        pub const INET = 2;
        pub const SYS_CONTROL = 2;
        pub const IMPLINK = 3;
        pub const PUP = 4;
        pub const CHAOS = 5;
        pub const NS = 6;
        pub const ISO = 7;
        pub const OSI = ISO;
        pub const ECMA = 8;
        pub const DATAKIT = 9;
        pub const CCITT = 10;
        pub const SNA = 11;
        pub const DECnet = 12;
        pub const DLI = 13;
        pub const LAT = 14;
        pub const HYLINK = 15;
        pub const APPLETALK = 16;
        pub const ROUTE = 17;
        pub const LINK = 18;
        pub const XTP = 19;
        pub const COIP = 20;
        pub const CNT = 21;
        pub const RTIP = 22;
        pub const IPX = 23;
        pub const SIP = 24;
        pub const PIP = 25;
        pub const ISDN = 28;
        pub const E164 = ISDN;
        pub const KEY = 29;
        pub const INET6 = 30;
        pub const NATM = 31;
        pub const SYSTEM = 32;
        pub const NETBIOS = 33;
        pub const PPP = 34;
        pub const MAX = 40;
    },
    .freebsd => struct {
        pub const UNSPEC = 0;
        pub const UNIX = 1;
        pub const LOCAL = UNIX;
        pub const FILE = LOCAL;
        pub const INET = 2;
        pub const IMPLINK = 3;
        pub const PUP = 4;
        pub const CHAOS = 5;
        pub const NETBIOS = 6;
        pub const ISO = 7;
        pub const OSI = ISO;
        pub const ECMA = 8;
        pub const DATAKIT = 9;
        pub const CCITT = 10;
        pub const SNA = 11;
        pub const DECnet = 12;
        pub const DLI = 13;
        pub const LAT = 14;
        pub const HYLINK = 15;
        pub const APPLETALK = 16;
        pub const ROUTE = 17;
        pub const LINK = 18;
        pub const pseudo_XTP = 19;
        pub const COIP = 20;
        pub const CNT = 21;
        pub const pseudo_RTIP = 22;
        pub const IPX = 23;
        pub const SIP = 24;
        pub const pseudo_PIP = 25;
        pub const ISDN = 26;
        pub const E164 = ISDN;
        pub const pseudo_KEY = 27;
        pub const INET6 = 28;
        pub const NATM = 29;
        pub const ATM = 30;
        pub const pseudo_HDRCMPLT = 31;
        pub const NETGRAPH = 32;
        pub const SLOW = 33;
        pub const SCLUSTER = 34;
        pub const ARP = 35;
        pub const BLUETOOTH = 36;
        pub const IEEE80211 = 37;
        pub const INET_SDP = 40;
        pub const INET6_SDP = 42;
        pub const MAX = 42;
    },
    .illumos => struct {
        pub const UNSPEC = 0;
        pub const UNIX = 1;
        pub const LOCAL = UNIX;
        pub const FILE = UNIX;
        pub const INET = 2;
        pub const IMPLINK = 3;
        pub const PUP = 4;
        pub const CHAOS = 5;
        pub const NS = 6;
        pub const NBS = 7;
        pub const ECMA = 8;
        pub const DATAKIT = 9;
        pub const CCITT = 10;
        pub const SNA = 11;
        pub const DECnet = 12;
        pub const DLI = 13;
        pub const LAT = 14;
        pub const HYLINK = 15;
        pub const APPLETALK = 16;
        pub const NIT = 17;
        pub const @"802" = 18;
        pub const OSI = 19;
        pub const X25 = 20;
        pub const OSINET = 21;
        pub const GOSIP = 22;
        pub const IPX = 23;
        pub const ROUTE = 24;
        pub const LINK = 25;
        pub const INET6 = 26;
        pub const KEY = 27;
        pub const NCA = 28;
        pub const POLICY = 29;
        pub const INET_OFFLOAD = 30;
        pub const TRILL = 31;
        pub const PACKET = 32;
        pub const LX_NETLINK = 33;
        pub const MAX = 33;
    },
    .netbsd => struct {
        pub const UNSPEC = 0;
        pub const LOCAL = 1;
        pub const UNIX = LOCAL;
        pub const INET = 2;
        pub const IMPLINK = 3;
        pub const PUP = 4;
        pub const CHAOS = 5;
        pub const NS = 6;
        pub const ISO = 7;
        pub const OSI = ISO;
        pub const ECMA = 8;
        pub const DATAKIT = 9;
        pub const CCITT = 10;
        pub const SNA = 11;
        pub const DECnet = 12;
        pub const DLI = 13;
        pub const LAT = 14;
        pub const HYLINK = 15;
        pub const APPLETALK = 16;
        pub const OROUTE = 17;
        pub const LINK = 18;
        pub const COIP = 20;
        pub const CNT = 21;
        pub const IPX = 23;
        pub const INET6 = 24;
        pub const ISDN = 26;
        pub const E164 = ISDN;
        pub const NATM = 27;
        pub const ARP = 28;
        pub const BLUETOOTH = 31;
        pub const IEEE80211 = 32;
        pub const MPLS = 33;
        pub const ROUTE = 34;
        pub const CAN = 35;
        pub const ETHER = 36;
        pub const MAX = 37;
    },
    .dragonfly => struct {
        pub const UNSPEC = 0;
        pub const OSI = ISO;
        pub const UNIX = LOCAL;
        pub const LOCAL = 1;
        pub const INET = 2;
        pub const IMPLINK = 3;
        pub const PUP = 4;
        pub const CHAOS = 5;
        pub const NETBIOS = 6;
        pub const ISO = 7;
        pub const ECMA = 8;
        pub const DATAKIT = 9;
        pub const CCITT = 10;
        pub const SNA = 11;
        pub const DLI = 13;
        pub const LAT = 14;
        pub const HYLINK = 15;
        pub const APPLETALK = 16;
        pub const ROUTE = 17;
        pub const LINK = 18;
        pub const COIP = 20;
        pub const CNT = 21;
        pub const IPX = 23;
        pub const SIP = 24;
        pub const ISDN = 26;
        pub const INET6 = 28;
        pub const NATM = 29;
        pub const ATM = 30;
        pub const NETGRAPH = 32;
        pub const BLUETOOTH = 33;
        pub const MPLS = 34;
        pub const MAX = 36;
    },
    .haiku => struct {
        pub const UNSPEC = 0;
        pub const INET = 1;
        pub const APPLETALK = 2;
        pub const ROUTE = 3;
        pub const LINK = 4;
        pub const INET6 = 5;
        pub const DLI = 6;
        pub const IPX = 7;
        pub const NOTIFY = 8;
        pub const LOCAL = 9;
        pub const UNIX = LOCAL;
        pub const BLUETOOTH = 10;
        pub const MAX = 11;
    },
    .openbsd => struct {
        pub const UNSPEC = 0;
        pub const UNIX = 1;
        pub const LOCAL = UNIX;
        pub const INET = 2;
        pub const APPLETALK = 16;
        pub const INET6 = 24;
        pub const KEY = 30;
        pub const ROUTE = 17;
        pub const SNA = 11;
        pub const MPLS = 33;
        pub const BLUETOOTH = 32;
        pub const ISDN = 26;
        pub const MAX = 36;
    },
    // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L17-L22
    .serenity => struct {
        pub const UNSPEC = 0;
        pub const LOCAL = 1;
        pub const UNIX = LOCAL;
        pub const INET = 2;
        pub const INET6 = 3;
        pub const MAX = 4;
    },
    else => void,
};
pub const PF = if (builtin.abi.isAndroid()) struct {
    pub const UNSPEC = AF.UNSPEC;
    pub const UNIX = AF.UNIX;
    pub const LOCAL = AF.LOCAL;
    pub const INET = AF.INET;
    pub const AX25 = AF.AX25;
    pub const IPX = AF.IPX;
    pub const APPLETALK = AF.APPLETALK;
    pub const NETROM = AF.NETROM;
    pub const BRIDGE = AF.BRIDGE;
    pub const ATMPVC = AF.ATMPVC;
    pub const X25 = AF.X25;
    pub const PF_INET6 = AF.INET6;
    pub const PF_ROSE = AF.ROSE;
    pub const PF_DECnet = AF.DECnet;
    pub const PF_NETBEUI = AF.NETBEUI;
    pub const PF_SECURITY = AF.SECURITY;
    pub const PF_KEY = AF.KEY;
    pub const PF_NETLINK = AF.NETLINK;
    pub const PF_ROUTE = AF.ROUTE;
    pub const PF_PACKET = AF.PACKET;
    pub const PF_ASH = AF.ASH;
    pub const PF_ECONET = AF.ECONET;
    pub const PF_ATMSVC = AF.ATMSVC;
    pub const PF_RDS = AF.RDS;
    pub const PF_SNA = AF.SNA;
    pub const PF_IRDA = AF.IRDA;
    pub const PF_PPPOX = AF.PPPOX;
    pub const PF_WANPIPE = AF.WANPIPE;
    pub const PF_LLC = AF.LLC;
    pub const PF_CAN = AF.CAN;
    pub const PF_TIPC = AF.TIPC;
    pub const PF_BLUETOOTH = AF.BLUETOOTH;
    pub const PF_IUCV = AF.IUCV;
    pub const PF_RXRPC = AF.RXRPC;
    pub const PF_ISDN = AF.ISDN;
    pub const PF_PHONET = AF.PHONET;
    pub const PF_IEEE802154 = AF.IEEE802154;
    pub const PF_CAIF = AF.CAIF;
    pub const PF_ALG = AF.ALG;
    pub const PF_NFC = AF.NFC;
    pub const PF_VSOCK = AF.VSOCK;
    pub const PF_KCM = AF.KCM;
    pub const PF_QIPCRTR = AF.QIPCRTR;
    pub const PF_MAX = AF.MAX;
} else switch (native_os) {
    .linux, .emscripten => linux.PF,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const LOCAL = AF.LOCAL;
        pub const UNIX = PF.LOCAL;
        pub const INET = AF.INET;
        pub const IMPLINK = AF.IMPLINK;
        pub const PUP = AF.PUP;
        pub const CHAOS = AF.CHAOS;
        pub const NS = AF.NS;
        pub const ISO = AF.ISO;
        pub const OSI = AF.ISO;
        pub const ECMA = AF.ECMA;
        pub const DATAKIT = AF.DATAKIT;
        pub const CCITT = AF.CCITT;
        pub const SNA = AF.SNA;
        pub const DECnet = AF.DECnet;
        pub const DLI = AF.DLI;
        pub const LAT = AF.LAT;
        pub const HYLINK = AF.HYLINK;
        pub const APPLETALK = AF.APPLETALK;
        pub const ROUTE = AF.ROUTE;
        pub const LINK = AF.LINK;
        pub const XTP = AF.XTP;
        pub const COIP = AF.COIP;
        pub const CNT = AF.CNT;
        pub const SIP = AF.SIP;
        pub const IPX = AF.IPX;
        pub const RTIP = AF.RTIP;
        pub const PIP = AF.PIP;
        pub const ISDN = AF.ISDN;
        pub const KEY = AF.KEY;
        pub const INET6 = AF.INET6;
        pub const NATM = AF.NATM;
        pub const SYSTEM = AF.SYSTEM;
        pub const NETBIOS = AF.NETBIOS;
        pub const PPP = AF.PPP;
        pub const MAX = AF.MAX;
    },
    .freebsd => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const LOCAL = AF.LOCAL;
        pub const UNIX = PF.LOCAL;
        pub const INET = AF.INET;
        pub const IMPLINK = AF.IMPLINK;
        pub const PUP = AF.PUP;
        pub const CHAOS = AF.CHAOS;
        pub const NETBIOS = AF.NETBIOS;
        pub const ISO = AF.ISO;
        pub const OSI = AF.ISO;
        pub const ECMA = AF.ECMA;
        pub const DATAKIT = AF.DATAKIT;
        pub const CCITT = AF.CCITT;
        pub const DECnet = AF.DECnet;
        pub const DLI = AF.DLI;
        pub const LAT = AF.LAT;
        pub const HYLINK = AF.HYLINK;
        pub const APPLETALK = AF.APPLETALK;
        pub const ROUTE = AF.ROUTE;
        pub const LINK = AF.LINK;
        pub const XTP = AF.pseudo_XTP;
        pub const COIP = AF.COIP;
        pub const CNT = AF.CNT;
        pub const SIP = AF.SIP;
        pub const IPX = AF.IPX;
        pub const RTIP = AF.pseudo_RTIP;
        pub const PIP = AF.pseudo_PIP;
        pub const ISDN = AF.ISDN;
        pub const KEY = AF.pseudo_KEY;
        pub const INET6 = AF.pseudo_INET6;
        pub const NATM = AF.NATM;
        pub const ATM = AF.ATM;
        pub const NETGRAPH = AF.NETGRAPH;
        pub const SLOW = AF.SLOW;
        pub const SCLUSTER = AF.SCLUSTER;
        pub const ARP = AF.ARP;
        pub const BLUETOOTH = AF.BLUETOOTH;
        pub const IEEE80211 = AF.IEEE80211;
        pub const INET_SDP = AF.INET_SDP;
        pub const INET6_SDP = AF.INET6_SDP;
        pub const MAX = AF.MAX;
    },
    .illumos => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const UNIX = AF.UNIX;
        pub const LOCAL = UNIX;
        pub const FILE = UNIX;
        pub const INET = AF.INET;
        pub const IMPLINK = AF.IMPLINK;
        pub const PUP = AF.PUP;
        pub const CHAOS = AF.CHAOS;
        pub const NS = AF.NS;
        pub const NBS = AF.NBS;
        pub const ECMA = AF.ECMA;
        pub const DATAKIT = AF.DATAKIT;
        pub const CCITT = AF.CCITT;
        pub const SNA = AF.SNA;
        pub const DECnet = AF.DECnet;
        pub const DLI = AF.DLI;
        pub const LAT = AF.LAT;
        pub const HYLINK = AF.HYLINK;
        pub const APPLETALK = AF.APPLETALK;
        pub const NIT = AF.NIT;
        pub const @"802" = AF.@"802";
        pub const OSI = AF.OSI;
        pub const X25 = AF.X25;
        pub const OSINET = AF.OSINET;
        pub const GOSIP = AF.GOSIP;
        pub const IPX = AF.IPX;
        pub const ROUTE = AF.ROUTE;
        pub const LINK = AF.LINK;
        pub const INET6 = AF.INET6;
        pub const KEY = AF.KEY;
        pub const NCA = AF.NCA;
        pub const POLICY = AF.POLICY;
        pub const TRILL = AF.TRILL;
        pub const PACKET = AF.PACKET;
        pub const LX_NETLINK = AF.LX_NETLINK;
        pub const MAX = AF.MAX;
    },
    .netbsd => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const LOCAL = AF.LOCAL;
        pub const UNIX = PF.LOCAL;
        pub const INET = AF.INET;
        pub const IMPLINK = AF.IMPLINK;
        pub const PUP = AF.PUP;
        pub const CHAOS = AF.CHAOS;
        pub const NS = AF.NS;
        pub const ISO = AF.ISO;
        pub const OSI = AF.ISO;
        pub const ECMA = AF.ECMA;
        pub const DATAKIT = AF.DATAKIT;
        pub const CCITT = AF.CCITT;
        pub const SNA = AF.SNA;
        pub const DECnet = AF.DECnet;
        pub const DLI = AF.DLI;
        pub const LAT = AF.LAT;
        pub const HYLINK = AF.HYLINK;
        pub const APPLETALK = AF.APPLETALK;
        pub const OROUTE = AF.OROUTE;
        pub const LINK = AF.LINK;
        pub const COIP = AF.COIP;
        pub const CNT = AF.CNT;
        pub const INET6 = AF.INET6;
        pub const IPX = AF.IPX;
        pub const ISDN = AF.ISDN;
        pub const E164 = AF.E164;
        pub const NATM = AF.NATM;
        pub const ARP = AF.ARP;
        pub const BLUETOOTH = AF.BLUETOOTH;
        pub const MPLS = AF.MPLS;
        pub const ROUTE = AF.ROUTE;
        pub const CAN = AF.CAN;
        pub const ETHER = AF.ETHER;
        pub const MAX = AF.MAX;
    },
    .dragonfly => struct {
        pub const INET6 = AF.INET6;
        pub const IMPLINK = AF.IMPLINK;
        pub const ROUTE = AF.ROUTE;
        pub const ISO = AF.ISO;
        pub const PIP = AF.pseudo_PIP;
        pub const CHAOS = AF.CHAOS;
        pub const DATAKIT = AF.DATAKIT;
        pub const INET = AF.INET;
        pub const APPLETALK = AF.APPLETALK;
        pub const SIP = AF.SIP;
        pub const OSI = AF.ISO;
        pub const CNT = AF.CNT;
        pub const LINK = AF.LINK;
        pub const HYLINK = AF.HYLINK;
        pub const MAX = AF.MAX;
        pub const KEY = AF.pseudo_KEY;
        pub const PUP = AF.PUP;
        pub const COIP = AF.COIP;
        pub const SNA = AF.SNA;
        pub const LOCAL = AF.LOCAL;
        pub const NETBIOS = AF.NETBIOS;
        pub const NATM = AF.NATM;
        pub const BLUETOOTH = AF.BLUETOOTH;
        pub const UNSPEC = AF.UNSPEC;
        pub const NETGRAPH = AF.NETGRAPH;
        pub const ECMA = AF.ECMA;
        pub const IPX = AF.IPX;
        pub const DLI = AF.DLI;
        pub const ATM = AF.ATM;
        pub const CCITT = AF.CCITT;
        pub const ISDN = AF.ISDN;
        pub const RTIP = AF.pseudo_RTIP;
        pub const LAT = AF.LAT;
        pub const UNIX = PF.LOCAL;
        pub const XTP = AF.pseudo_XTP;
        pub const DECnet = AF.DECnet;
    },
    .haiku => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const INET = AF.INET;
        pub const ROUTE = AF.ROUTE;
        pub const LINK = AF.LINK;
        pub const INET6 = AF.INET6;
        pub const LOCAL = AF.LOCAL;
        pub const UNIX = AF.UNIX;
        pub const BLUETOOTH = AF.BLUETOOTH;
    },
    .openbsd => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const LOCAL = AF.LOCAL;
        pub const UNIX = AF.UNIX;
        pub const INET = AF.INET;
        pub const APPLETALK = AF.APPLETALK;
        pub const INET6 = AF.INET6;
        pub const DECnet = AF.DECnet;
        pub const KEY = AF.KEY;
        pub const ROUTE = AF.ROUTE;
        pub const SNA = AF.SNA;
        pub const MPLS = AF.MPLS;
        pub const BLUETOOTH = AF.BLUETOOTH;
        pub const ISDN = AF.ISDN;
        pub const MAX = AF.MAX;
    },
    // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L24-L29
    .serenity => struct {
        pub const LOCAL = AF.LOCAL;
        pub const UNIX = AF.LOCAL;
        pub const INET = AF.INET;
        pub const INET6 = AF.INET6;
        pub const UNSPEC = AF.UNSPEC;
        pub const MAX = AF.MAX;
    },
    else => void,
};
pub const DT = switch (native_os) {
    .linux => linux.DT,
    // https://github.com/SerenityOS/serenity/blob/1262a7d1424d0d2e89d80644409721cbf056ab17/Kernel/API/POSIX/dirent.h#L16-L35
    .netbsd, .freebsd, .openbsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .serenity => struct {
        pub const UNKNOWN = 0;
        pub const FIFO = 1;
        pub const CHR = 2;
        pub const DIR = 4;
        pub const BLK = 6;
        pub const REG = 8;
        pub const LNK = 10;
        pub const SOCK = 12;
        pub const WHT = 14;
    },
    .dragonfly => struct {
        pub const UNKNOWN = 0;
        pub const FIFO = 1;
        pub const CHR = 2;
        pub const DIR = 4;
        pub const BLK = 6;
        pub const REG = 8;
        pub const LNK = 10;
        pub const SOCK = 12;
        pub const WHT = 14;
        pub const DBF = 15;
    },
    else => void,
};
pub const MSG = switch (native_os) {
    .linux => linux.MSG,
    .emscripten => emscripten.MSG,
    .windows => ws2_32.MSG,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => darwin.MSG,
    .haiku => struct {
        pub const OOB = 0x0001;
        pub const PEEK = 0x0002;
        pub const DONTROUTE = 0x0004;
        pub const EOR = 0x0008;
        pub const TRUNC = 0x0010;
        pub const CTRUNC = 0x0020;
        pub const WAITALL = 0x0040;
        pub const DONTWAIT = 0x0080;
        pub const BCAST = 0x0100;
        pub const MCAST = 0x0200;
        pub const EOF = 0x0400;
        pub const NOSIGNAL = 0x0800;
    },
    // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L56-L64
    .serenity => struct {
        pub const TRUNC = 0x1;
        pub const CTRUNC = 0x2;
        pub const PEEK = 0x4;
        pub const OOB = 0x8;
        pub const DONTROUTE = 0x10;
        pub const WAITALL = 0x20;
        pub const DONTWAIT = 0x40;
        pub const NOSIGNAL = 0x80;
        pub const EOR = 0x100;
    },
    .freebsd => struct {
        pub const OOB = 0x00000001;
        pub const PEEK = 0x00000002;
        pub const DONTROUTE = 0x00000004;
        pub const EOR = 0x00000008;
        pub const TRUNC = 0x00000010;
        pub const CTRUNC = 0x00000020;
        pub const WAITALL = 0x00000040;
        pub const DONTWAIT = 0x00000080;
        pub const EOF = 0x00000100;
        pub const NOTIFICATION = 0x00002000;
        pub const NBIO = 0x00004000;
        pub const COMPAT = 0x00008000;
        pub const SOCALLBCK = 0x00010000;
        pub const NOSIGNAL = 0x00020000;
        pub const CMSG_CLOEXEC = 0x00040000;
        pub const WAITFORONE = 0x00080000;
        pub const MORETOCOME = 0x00100000;
        pub const TLSAPPDATA = 0x00200000;
    },
    .netbsd => struct {
        pub const OOB = 0x0001;
        pub const PEEK = 0x0002;
        pub const DONTROUTE = 0x0004;
        pub const EOR = 0x0008;
        pub const TRUNC = 0x0010;
        pub const CTRUNC = 0x0020;
        pub const WAITALL = 0x0040;
        pub const DONTWAIT = 0x0080;
        pub const BCAST = 0x0100;
        pub const MCAST = 0x0200;
        pub const NOSIGNAL = 0x0400;
        pub const CMSG_CLOEXEC = 0x0800;
        pub const NBIO = 0x1000;
        pub const WAITFORONE = 0x2000;
        pub const NOTIFICATION = 0x4000;
    },
    // https://github.com/openbsd/src/blob/42a7be81bef70c04732f45ec573622effe56b563/sys/sys/socket.h#L506
    .openbsd => struct {
        pub const OOB = 0x1;
        pub const PEEK = 0x2;
        pub const DONTROUTE = 0x4;
        pub const EOR = 0x8;
        pub const TRUNC = 0x10;
        pub const CTRUNC = 0x20;
        pub const WAITALL = 0x40;
        pub const DONTWAIT = 0x80;
        pub const BCAST = 0x100;
        pub const MCAST = 0x200;
        pub const NOSIGNAL = 0x400;
        pub const CMSG_CLOEXEC = 0x800;
        pub const WAITFORONE = 0x1000;
        pub const CMSG_CLOFORK = 0x2000;
    },
    .dragonfly => struct {
        pub const OOB = 0x0001;
        pub const PEEK = 0x0002;
        pub const DONTROUTE = 0x0004;
        pub const EOR = 0x0008;
        pub const TRUNC = 0x0010;
        pub const CTRUNC = 0x0020;
        pub const WAITALL = 0x0040;
        pub const DONTWAIT = 0x0080;
        pub const NOSIGNAL = 0x0400;
        pub const SYNC = 0x0800;
        pub const CMSG_CLOEXEC = 0x1000;
        pub const CMSG_CLOFORK = 0x2000;
        pub const FBLOCKING = 0x10000;
        pub const FNONBLOCKING = 0x20000;
    },
    .illumos => struct {
        pub const OOB = 0x0001;
        pub const PEEK = 0x0002;
        pub const DONTROUTE = 0x0004;
        pub const EOR = 0x0008;
        pub const CTRUNC = 0x0010;
        pub const TRUNC = 0x0020;
        pub const WAITALL = 0x0040;
        pub const DONTWAIT = 0x0080;
        pub const NOTIFICATION = 0x0100;
        pub const NOSIGNAL = 0x0200;
        pub const CMSG_CLOEXEC = 0x1000;
        pub const CMSG_CLOFORK = 0x2000;
    },
    else => void,
};
pub const SOCK = switch (native_os) {
    .linux => linux.SOCK,
    .emscripten => emscripten.SOCK,
    .windows => ws2_32.SOCK,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const RDM = 4;
        pub const SEQPACKET = 5;
        pub const MAXADDRLEN = 255;

        /// Darwin 实际上不支持,但 Zig 提供了兼容实现。
        /// 这个数值不保证 ABI 稳定,只需不与
        /// 其他 `SOCK` 位冲突。
        pub const CLOEXEC = 1 << 15;
        /// Darwin 实际上不支持,但 Zig 提供了兼容实现。
        /// 这个数值不保证 ABI 稳定,只需不与
        /// 其他 `SOCK` 位冲突。
        pub const NONBLOCK = 1 << 16;
    },
    .freebsd => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const RDM = 4;
        pub const SEQPACKET = 5;

        pub const CLOEXEC = 0x10000000;
        pub const NONBLOCK = 0x20000000;
    },
    .illumos => struct {
        /// 数据报。
        pub const DGRAM = 1;
        /// 流。
        pub const STREAM = 2;
        /// 原始协议接口。
        pub const RAW = 4;
        /// 可靠投递的消息。
        pub const RDM = 5;
        /// 顺序打包流。
        pub const SEQPACKET = 6;

        pub const NONBLOCK = 0x100000;
        pub const NDELAY = 0x200000;
        pub const CLOEXEC = 0x080000;
    },
    .netbsd => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const RDM = 4;
        pub const SEQPACKET = 5;
        pub const CONN_DGRAM = 6;
        pub const DCCP = CONN_DGRAM;

        pub const CLOEXEC = 0x10000000;
        pub const NONBLOCK = 0x20000000;
        pub const NOSIGPIPE = 0x40000000;
        pub const FLAGS_MASK = 0xf0000000;
    },
    .dragonfly => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const RDM = 4;
        pub const SEQPACKET = 5;
        pub const MAXADDRLEN = 255;
        pub const CLOEXEC = 0x10000000;
        pub const NONBLOCK = 0x20000000;
    },
    .haiku => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const SEQPACKET = 5;
        pub const MISC = 255;

        pub const NONBLOCK = 0x40000;
        pub const CLOEXEC = 0x80000;
    },
    .openbsd => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const RDM = 4;
        pub const SEQPACKET = 5;

        pub const CLOEXEC = 0x8000;
        pub const NONBLOCK = 0x4000;
    },
    // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L31-L38
    .serenity => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const RDM = 4;
        pub const SEQPACKET = 5;

        pub const NONBLOCK = 0o4000;
        pub const CLOEXEC = 0o2000000;
    },
    else => void,
};
pub const TCP = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => darwin.TCP,
    .linux => linux.TCP,
    .freebsd => freebsd.TCP,
    .netbsd => netbsd.TCP,
    .openbsd => openbsd.TCP,
    .dragonfly => dragonfly.TCP,
    .emscripten => emscripten.TCP,
    .windows => ws2_32.TCP,
    .illumos => illumos.TCP,
    .haiku => haiku.TCP,
    // https://github.com/SerenityOS/serenity/blob/61ac554a3403838f79ca746bd1c65ded6f97d124/Kernel/API/POSIX/netinet/tcp.h#L13-L14
    .serenity => struct {
        pub const NODELAY = 10;
        pub const MAXSEG = 11;
    },
    else => void,
};
pub const IPPROTO = switch (native_os) {
    .linux, .emscripten => linux.IPPROTO,
    .windows => ws2_32.IPPROTO,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const ICMP = 1;
        pub const ICMPV6 = 58;
        pub const TCP = 6;
        pub const UDP = 17;
        pub const IP = 0;
        pub const IPV6 = 41;
        pub const RAW = 255;
    },
    .freebsd => struct {
        /// IP 占位项
        pub const IP = 0;
        /// 控制消息协议
        pub const ICMP = 1;
        /// tcp
        pub const TCP = 6;
        /// 用户数据报协议
        pub const UDP = 17;
        /// IP6 头
        pub const IPV6 = 41;
        /// 原始 IP 数据包
        pub const RAW = 255;
        /// IPv6 逐跳选项
        pub const HOPOPTS = 0;
        /// 组管理协议
        pub const IGMP = 2;
        /// gateway^2(已弃用)
        pub const GGP = 3;
        /// IPv4 封装
        pub const IPV4 = 4;
        /// 用于兼容
        pub const IPIP = IPV4;
        /// 流协议 II
        pub const ST = 7;
        /// 外部网关协议
        pub const EGP = 8;
        /// 私有内部网关
        pub const PIGP = 9;
        /// BBN RCC 监控
        pub const RCCMON = 10;
        /// 网络语音协议
        pub const NVPII = 11;
        /// pup
        pub const PUP = 12;
        /// Argus
        pub const ARGUS = 13;
        /// EMCON
        pub const EMCON = 14;
        /// 跨网络调试器
        pub const XNET = 15;
        /// Chaos
        pub const CHAOS = 16;
        /// 多路复用
        pub const MUX = 18;
        /// DCN 测量子系统
        pub const MEAS = 19;
        /// 主机监控
        pub const HMP = 20;
        /// 分组无线电测量
        pub const PRM = 21;
        /// xns idp
        pub const IDP = 22;
        /// Trunk-1
        pub const TRUNK1 = 23;
        /// Trunk-2
        pub const TRUNK2 = 24;
        /// Leaf-1 协议
        pub const LEAF1 = 25;
        /// Leaf-2
        pub const LEAF2 = 26;
        /// 可靠数据
        pub const RDP = 27;
        /// 可靠事务
        pub const IRTP = 28;
        /// 带类别协商的 tp-4
        pub const TP = 29;
        /// 批量数据传输
        pub const BLT = 30;
        /// 网络服务
        pub const NSP = 31;
        /// Merit 节点间协议
        pub const INP = 32;
        /// 数据报拥塞控制协议
        pub const DCCP = 33;
        /// 第三方连接
        pub const @"3PC" = 34;
        /// 域间策略路由
        pub const IDPR = 35;
        /// XTP
        pub const XTP = 36;
        /// 数据报传送
        pub const DDP = 37;
        /// 控制消息传输
        pub const CMTP = 38;
        /// TP++ 传输
        pub const TPXX = 39;
        /// IL 传输协议
        pub const IL = 40;
        /// 源按需路由
        pub const SDRP = 42;
        /// IP6 路由头
        pub const ROUTING = 43;
        /// IP6 分片头
        pub const FRAGMENT = 44;
        /// 域间路由
        pub const IDRP = 45;
        /// 资源预留
        pub const RSVP = 46;
        /// 通用路由封装
        pub const GRE = 47;
        /// 移动主机路由
        pub const MHRP = 48;
        /// BHA
        pub const BHA = 49;
        /// IP6 封装安全载荷
        pub const ESP = 50;
        /// IP6 认证首部
        pub const AH = 51;
        /// 集成网络层安全
        pub const INLSP = 52;
        /// 带加密的 IP
        pub const SWIPE = 53;
        /// 下一跳解析
        pub const NHRP = 54;
        /// IP 移动性
        pub const MOBILE = 55;
        /// 传输层安全性
        pub const TLSP = 56;
        /// SKIP
        pub const SKIP = 57;
        /// ICMP6
        pub const ICMPV6 = 58;
        /// IPv6 无下一头部
        pub const NONE = 59;
        /// IP6 目标选项
        pub const DSTOPTS = 60;
        /// 任意主机内部协议
        pub const AHIP = 61;
        /// CFTP
        pub const CFTP = 62;
        /// “hello”路由协议
        pub const HELLO = 63;
        /// SATNET/Backroom EXPAK
        pub const SATEXPAK = 64;
        /// Kryptolan
        pub const KRYPTOLAN = 65;
        /// 远程虚拟磁盘
        pub const RVD = 66;
        /// Pluribus 分组核心协议
        pub const IPPC = 67;
        /// 任意分布式文件系统
        pub const ADFS = 68;
        /// Satnet 监控
        pub const SATMON = 69;
        /// VISA 协议
        pub const VISA = 70;
        /// 分组核心实用协议
        pub const IPCV = 71;
        /// 计算机协议网络执行程序
        pub const CPNX = 72;
        /// Comp. Prot. 心跳
        pub const CPHB = 73;
        /// Wang Span 网络
        pub const WSN = 74;
        /// 分组视频协议
        pub const PVP = 75;
        /// BackRoom SATNET 监视
        pub const BRSATMON = 76;
        /// Sun 网络磁盘协议(临时)
        pub const ND = 77;
        /// 宽带监控
        pub const WBMON = 78;
        /// WIDEBAND EXPAK
        pub const WBEXPAK = 79;
        /// ISO cnlp
        pub const EON = 80;
        /// VMTP
        pub const VMTP = 81;
        /// 安全 VMTP
        pub const SVMTP = 82;
        /// Banyon VINES
        pub const VINES = 83;
        /// TTP
        pub const TTP = 84;
        /// NSFNET-IGP
        pub const IGP = 85;
        /// 异构网关协议。
        pub const DGP = 86;
        /// TCF
        pub const TCF = 87;
        /// Cisco/GXS IGRP
        pub const IGRP = 88;
        /// OSPFIGP
        pub const OSPFIGP = 89;
        /// Strite RPC 协议
        pub const SRPC = 90;
        /// Locus 地址解析
        pub const LARP = 91;
        /// 组播传输
        pub const MTP = 92;
        /// AX.25 帧
        pub const AX25 = 93;
        /// 封装在 IP 中的 IP
        pub const IPEIP = 94;
        /// 移动互连控制
        pub const MICP = 95;
        /// Semaphore 通信安全性
        pub const SCCSP = 96;
        /// 以太网 IP 封装
        pub const ETHERIP = 97;
        /// 封装首部
        pub const ENCAP = 98;
        /// 任何私有加密方案
        pub const APES = 99;
        /// GMTP
        pub const GMTP = 100;
        /// 载荷压缩(IPComp)
        pub const IPCOMP = 108;
        /// SCTP
        pub const SCTP = 132;
        /// IPv6 移动性头
        pub const MH = 135;
        /// UDP-Lite
        pub const UDPLITE = 136;
        /// IP6 主机标识协议
        pub const HIP = 139;
        /// IP6 Shim6 协议
        pub const SHIM6 = 140;
        /// 与协议无关的多播
        pub const PIM = 103;
        /// CARP
        pub const CARP = 112;
        /// PGM
        pub const PGM = 113;
        /// 封装在 IP 中的 MPLS
        pub const MPLS = 137;
        /// PFSYNC
        pub const PFSYNC = 240;
        /// 保留
        pub const RESERVED_253 = 253;
        /// 保留
        pub const RESERVED_254 = 254;
    },
    .illumos => struct {
        /// IP 占位项
        pub const IP = 0;
        /// IPv6 逐跳选项头
        pub const HOPOPTS = 0;
        /// 控制消息协议
        pub const ICMP = 1;
        /// 组控制协议
        pub const IGMP = 2;
        /// gateway^2(已弃用)
        pub const GGP = 3;
        /// IP 中的 IP 封装
        pub const ENCAP = 4;
        /// tcp
        pub const TCP = 6;
        /// 外部网关协议
        pub const EGP = 8;
        /// pup
        pub const PUP = 12;
        /// 用户数据报协议
        pub const UDP = 17;
        /// xns idp
        pub const IDP = 22;
        /// 封装在 IP 中的 IPv6
        pub const IPV6 = 41;
        /// IPv6 路由头
        pub const ROUTING = 43;
        /// IPv6 分片头
        pub const FRAGMENT = 44;
        /// rsvp
        pub const RSVP = 46;
        /// IPsec 封装安全载荷
        pub const ESP = 50;
        /// IPsec 认证头。
        pub const AH = 51;
        /// IPv6 的 ICMP
        pub const ICMPV6 = 58;
        /// IPv6 无下一个首部
        pub const NONE = 59;
        /// 目标选项
        pub const DSTOPTS = 60;
        /// “hello”路由协议
        pub const HELLO = 63;
        /// 非官方网络磁盘协议
        pub const ND = 77;
        /// ISO clnp
        pub const EON = 80;
        /// OSPF
        pub const OSPF = 89;
        /// PIM 路由协议
        pub const PIM = 103;
        /// 流控制
        pub const SCTP = 132;
        /// 原始 IP 数据包
        pub const RAW = 255;
        /// 套接字直连协议
        pub const PROTO_SDP = 257;
    },
    .netbsd => struct {
        /// IP 占位项
        pub const IP = 0;
        /// IPv6 逐跳选项
        pub const HOPOPTS = 0;
        /// 控制消息协议
        pub const ICMP = 1;
        /// 组管理协议
        pub const IGMP = 2;
        /// gateway^2(已弃用)
        pub const GGP = 3;
        /// IP 头部
        pub const IPV4 = 4;
        /// IP 内封装 IP
        pub const IPIP = 4;
        /// tcp
        pub const TCP = 6;
        /// 外部网关协议
        pub const EGP = 8;
        /// pup
        pub const PUP = 12;
        /// 用户数据报协议
        pub const UDP = 17;
        /// xns idp
        pub const IDP = 22;
        /// 带类别协商的 tp-4
        pub const TP = 29;
        /// DCCP
        pub const DCCP = 33;
        /// IP6 头
        pub const IPV6 = 41;
        /// IP6 路由头
        pub const ROUTING = 43;
        /// IP6 分片头
        pub const FRAGMENT = 44;
        /// 资源预留
        pub const RSVP = 46;
        /// GRE 封装 RFC 1701
        pub const GRE = 47;
        /// 封装安全载荷
        pub const ESP = 50;
        /// 身份验证头
        pub const AH = 51;
        /// IP 移动性 RFC 2004
        pub const MOBILE = 55;
        /// IPv6 的 ICMP
        pub const IPV6_ICMP = 58;
        /// ICMP6
        pub const ICMPV6 = 58;
        /// IPv6 无下一头部
        pub const NONE = 59;
        /// IP6 目标选项
        pub const DSTOPTS = 60;
        /// ISO cnlp
        pub const EON = 80;
        /// 封装在 IP 中的以太网
        pub const ETHERIP = 97;
        /// 封装首部
        pub const ENCAP = 98;
        /// 与协议无关的多播
        pub const PIM = 103;
        /// IP 载荷压缩协议
        pub const IPCOMP = 108;
        /// VRRP 协议,RFC 2338
        pub const VRRP = 112;
        /// 公共地址冗余协议
        pub const CARP = 112;
        /// L2TPv3
        pub const L2TP = 115;
        /// SCTP
        pub const SCTP = 132;
        /// PFSYNC
        pub const PFSYNC = 240;
        /// 原始 IP 数据包
        pub const RAW = 255;
    },
    .dragonfly => struct {
        pub const IP = 0;
        pub const ICMP = 1;
        pub const TCP = 6;
        pub const UDP = 17;
        pub const IPV6 = 41;
        pub const RAW = 255;
        pub const HOPOPTS = 0;
        pub const IGMP = 2;
        pub const GGP = 3;
        pub const IPV4 = 4;
        pub const IPIP = IPV4;
        pub const ST = 7;
        pub const EGP = 8;
        pub const PIGP = 9;
        pub const RCCMON = 10;
        pub const NVPII = 11;
        pub const PUP = 12;
        pub const ARGUS = 13;
        pub const EMCON = 14;
        pub const XNET = 15;
        pub const CHAOS = 16;
        pub const MUX = 18;
        pub const MEAS = 19;
        pub const HMP = 20;
        pub const PRM = 21;
        pub const IDP = 22;
        pub const TRUNK1 = 23;
        pub const TRUNK2 = 24;
        pub const LEAF1 = 25;
        pub const LEAF2 = 26;
        pub const RDP = 27;
        pub const IRTP = 28;
        pub const TP = 29;
        pub const BLT = 30;
        pub const NSP = 31;
        pub const INP = 32;
        pub const SEP = 33;
        pub const @"3PC" = 34;
        pub const IDPR = 35;
        pub const XTP = 36;
        pub const DDP = 37;
        pub const CMTP = 38;
        pub const TPXX = 39;
        pub const IL = 40;
        pub const SDRP = 42;
        pub const ROUTING = 43;
        pub const FRAGMENT = 44;
        pub const IDRP = 45;
        pub const RSVP = 46;
        pub const GRE = 47;
        pub const MHRP = 48;
        pub const BHA = 49;
        pub const ESP = 50;
        pub const AH = 51;
        pub const INLSP = 52;
        pub const SWIPE = 53;
        pub const NHRP = 54;
        pub const MOBILE = 55;
        pub const TLSP = 56;
        pub const SKIP = 57;
        pub const ICMPV6 = 58;
        pub const NONE = 59;
        pub const DSTOPTS = 60;
        pub const AHIP = 61;
        pub const CFTP = 62;
        pub const HELLO = 63;
        pub const SATEXPAK = 64;
        pub const KRYPTOLAN = 65;
        pub const RVD = 66;
        pub const IPPC = 67;
        pub const ADFS = 68;
        pub const SATMON = 69;
        pub const VISA = 70;
        pub const IPCV = 71;
        pub const CPNX = 72;
        pub const CPHB = 73;
        pub const WSN = 74;
        pub const PVP = 75;
        pub const BRSATMON = 76;
        pub const ND = 77;
        pub const WBMON = 78;
        pub const WBEXPAK = 79;
        pub const EON = 80;
        pub const VMTP = 81;
        pub const SVMTP = 82;
        pub const VINES = 83;
        pub const TTP = 84;
        pub const IGP = 85;
        pub const DGP = 86;
        pub const TCF = 87;
        pub const IGRP = 88;
        pub const OSPFIGP = 89;
        pub const SRPC = 90;
        pub const LARP = 91;
        pub const MTP = 92;
        pub const AX25 = 93;
        pub const IPEIP = 94;
        pub const MICP = 95;
        pub const SCCSP = 96;
        pub const ETHERIP = 97;
        pub const ENCAP = 98;
        pub const APES = 99;
        pub const GMTP = 100;
        pub const IPCOMP = 108;
        pub const PIM = 103;
        pub const CARP = 112;
        pub const PGM = 113;
        pub const PFSYNC = 240;
        pub const DIVERT = 254;
        pub const MAX = 256;
        pub const DONE = 257;
        pub const UNKNOWN = 258;
    },
    .haiku => struct {
        pub const IP = 0;
        pub const HOPOPTS = 0;
        pub const ICMP = 1;
        pub const IGMP = 2;
        pub const TCP = 6;
        pub const UDP = 17;
        pub const IPV6 = 41;
        pub const ROUTING = 43;
        pub const FRAGMENT = 44;
        pub const ESP = 50;
        pub const AH = 51;
        pub const ICMPV6 = 58;
        pub const NONE = 59;
        pub const DSTOPTS = 60;
        pub const ETHERIP = 97;
        pub const RAW = 255;
        pub const MAX = 256;
    },
    .openbsd => struct {
        /// IP 占位项
        pub const IP = 0;
        /// IPv6 逐跳选项
        pub const HOPOPTS = IPPROTO.IP;
        /// 控制消息协议
        pub const ICMP = 1;
        /// 组管理协议
        pub const IGMP = 2;
        /// gateway^2(已弃用)
        pub const GGP = 3;
        /// IP 头部
        pub const IPV4 = IPIP;
        /// IP 内封装 IP
        pub const IPIP = 4;
        /// tcp
        pub const TCP = 6;
        /// 外部网关协议
        pub const EGP = 8;
        /// pup
        pub const PUP = 12;
        /// 用户数据报协议
        pub const UDP = 17;
        /// xns idp
        pub const IDP = 22;
        /// 带类别协商的 tp-4
        pub const TP = 29;
        /// IP6 头
        pub const IPV6 = 41;
        /// IP6 路由头
        pub const ROUTING = 43;
        /// IP6 分片头
        pub const FRAGMENT = 44;
        /// 资源预留
        pub const RSVP = 46;
        /// GRE 封装 RFC 1701
        pub const GRE = 47;
        /// 封装安全载荷
        pub const ESP = 50;
        /// 身份验证头
        pub const AH = 51;
        /// IP 移动性 RFC 2004
        pub const MOBILE = 55;
        /// IPv6 的 ICMP
        pub const IPV6_ICMP = 58;
        /// ICMP6
        pub const ICMPV6 = 58;
        /// IPv6 无下一头部
        pub const NONE = 59;
        /// IP6 目标选项
        pub const DSTOPTS = 60;
        /// ISO cnlp
        pub const EON = 80;
        /// 封装在 IP 中的以太网
        pub const ETHERIP = 97;
        /// 封装首部
        pub const ENCAP = 98;
        /// 与协议无关的多播
        pub const PIM = 103;
        /// IP 载荷压缩协议
        pub const IPCOMP = 108;
        /// VRRP 协议,RFC 2338
        pub const VRRP = 112;
        /// 公共地址冗余协议
        pub const CARP = 112;
        /// PFSYNC
        pub const PFSYNC = 240;
        /// 原始 IP 数据包
        pub const RAW = 255;
    },
    // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L44-L54
    .serenity => struct {
        pub const IP = 0;
        pub const ICMP = 1;
        pub const IGMP = 2;
        pub const IPIP = 4;
        pub const TCP = 6;
        pub const UDP = 17;
        pub const IPV6 = 41;
        pub const ESP = 50;
        pub const AH = 51;
        pub const ICMPV6 = 58;
        pub const RAW = 255;
    },
    else => void,
};
pub const IP = switch (native_os) {
    .linux => linux.IP,
    .freebsd => freebsd.IP,
    .dragonfly => dragonfly.IP,
    .netbsd => netbsd.IP,
    .openbsd => openbsd.IP,
    .illumos => illumos.IP,
    .haiku => haiku.IP,
    .serenity => serenity.IP,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => darwin.IP,
    else => void,
};
pub const IPV6 = switch (native_os) {
    .linux => linux.IPV6,
    .freebsd => freebsd.IPV6,
    .dragonfly => dragonfly.IPV6,
    .netbsd => netbsd.IPV6,
    .openbsd => openbsd.IPV6,
    .illumos => illumos.IPV6,
    .haiku => haiku.IPV6,
    .serenity => serenity.IPV6,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => darwin.IPV6,
    else => void,
};
pub const IPTOS = switch (native_os) {
    .linux => linux.IPTOS,
    .freebsd => freebsd.IPTOS,
    .dragonfly => dragonfly.IPTOS,
    .netbsd => netbsd.IPTOS,
    .openbsd => openbsd.IPTOS,
    .illumos => illumos.IPTOS,
    .haiku => haiku.IPTOS,
    .serenity => serenity.IPTOS,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => darwin.IPTOS,
    else => void,
};
pub const SOL = switch (native_os) {
    .linux => linux.SOL,
    .emscripten => emscripten.SOL,
    .windows => ws2_32.SOL,
    .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const SOCKET = 0xffff;
    },
    .illumos => struct {
        pub const SOCKET = 0xffff;
        pub const ROUTE = 0xfffe;
        pub const PACKET = 0xfffd;
        pub const FILTER = 0xfffc;
    },
    // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L127
    .serenity => struct {
        pub const SOCKET = 1;
    },
    else => void,
};
pub const SO = switch (native_os) {
    .linux => linux.SO,
    .emscripten => emscripten.SO,
    .windows => ws2_32.SO,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const DEBUG = 0x0001;
        pub const ACCEPTCONN = 0x0002;
        pub const REUSEADDR = 0x0004;
        pub const KEEPALIVE = 0x0008;
        pub const DONTROUTE = 0x0010;
        pub const BROADCAST = 0x0020;
        pub const USELOOPBACK = 0x0040;
        pub const LINGER = 0x0080;
        pub const OOBINLINE = 0x0100;
        pub const REUSEPORT = 0x0200;
        pub const ACCEPTFILTER = 0x1000;
        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const SNDTIMEO = 0x1005;
        pub const RCVTIMEO = 0x1006;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;

        pub const NREAD = 0x1020;
        pub const NKE = 0x1021;
        pub const NOSIGPIPE = 0x1022;
        pub const NOADDRERR = 0x1023;
        pub const NWRITE = 0x1024;
        pub const REUSESHAREUID = 0x1025;
        pub const LINGER_SEC = 0x1080;
    },
    .freebsd => struct {
        pub const DEBUG = 0x00000001;
        pub const ACCEPTCONN = 0x00000002;
        pub const REUSEADDR = 0x00000004;
        pub const KEEPALIVE = 0x00000008;
        pub const DONTROUTE = 0x00000010;
        pub const BROADCAST = 0x00000020;
        pub const USELOOPBACK = 0x00000040;
        pub const LINGER = 0x00000080;
        pub const OOBINLINE = 0x00000100;
        pub const REUSEPORT = 0x00000200;
        pub const TIMESTAMP = 0x00000400;
        pub const NOSIGPIPE = 0x00000800;
        pub const ACCEPTFILTER = 0x00001000;
        pub const BINTIME = 0x00002000;
        pub const NO_OFFLOAD = 0x00004000;
        pub const NO_DDP = 0x00008000;
        pub const REUSEPORT_LB = 0x00010000;

        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const SNDTIMEO = 0x1005;
        pub const RCVTIMEO = 0x1006;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;
        pub const LABEL = 0x1009;
        pub const PEERLABEL = 0x1010;
        pub const LISTENQLIMIT = 0x1011;
        pub const LISTENQLEN = 0x1012;
        pub const LISTENINCQLEN = 0x1013;
        pub const SETFIB = 0x1014;
        pub const USER_COOKIE = 0x1015;
        pub const PROTOCOL = 0x1016;
        pub const PROTOTYPE = PROTOCOL;
        pub const TS_CLOCK = 0x1017;
        pub const MAX_PACING_RATE = 0x1018;
        pub const DOMAIN = 0x1019;
    },
    .illumos => struct {
        pub const DEBUG = 0x0001;
        pub const ACCEPTCONN = 0x0002;
        pub const REUSEADDR = 0x0004;
        pub const KEEPALIVE = 0x0008;
        pub const DONTROUTE = 0x0010;
        pub const BROADCAST = 0x0020;
        pub const USELOOPBACK = 0x0040;
        pub const LINGER = 0x0080;
        pub const OOBINLINE = 0x0100;
        pub const DGRAM_ERRIND = 0x0200;
        pub const RECVUCRED = 0x0400;

        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const SNDTIMEO = 0x1005;
        pub const RCVTIMEO = 0x1006;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;
        pub const PROTOTYPE = 0x1009;
        pub const ANON_MLP = 0x100a;
        pub const MAC_EXEMPT = 0x100b;
        pub const DOMAIN = 0x100c;
        pub const RCVPSH = 0x100d;

        pub const SECATTR = 0x1011;
        pub const TIMESTAMP = 0x1013;
        pub const ALLZONES = 0x1014;
        pub const EXCLBIND = 0x1015;
        pub const MAC_IMPLICIT = 0x1016;
        pub const VRRP = 0x1017;
    },
    .netbsd => struct {
        pub const DEBUG = 0x0001;
        pub const ACCEPTCONN = 0x0002;
        pub const REUSEADDR = 0x0004;
        pub const KEEPALIVE = 0x0008;
        pub const DONTROUTE = 0x0010;
        pub const BROADCAST = 0x0020;
        pub const USELOOPBACK = 0x0040;
        pub const LINGER = 0x0080;
        pub const OOBINLINE = 0x0100;
        pub const REUSEPORT = 0x0200;
        pub const NOSIGPIPE = 0x0800;
        pub const ACCEPTFILTER = 0x1000;
        pub const TIMESTAMP = 0x2000;
        pub const RERROR = 0x4000;

        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;
        pub const OVERFLOWED = 0x1009;

        pub const NOHEADER = 0x100a;
        pub const SNDTIMEO = 0x100b;
        pub const RCVTIMEO = 0x100c;
    },
    .dragonfly => struct {
        pub const DEBUG = 0x0001;
        pub const ACCEPTCONN = 0x0002;
        pub const REUSEADDR = 0x0004;
        pub const KEEPALIVE = 0x0008;
        pub const DONTROUTE = 0x0010;
        pub const BROADCAST = 0x0020;
        pub const USELOOPBACK = 0x0040;
        pub const LINGER = 0x0080;
        pub const OOBINLINE = 0x0100;
        pub const REUSEPORT = 0x0200;
        pub const TIMESTAMP = 0x0400;
        pub const NOSIGPIPE = 0x0800;
        pub const ACCEPTFILTER = 0x1000;
        pub const RERROR = 0x2000;
        pub const PASSCRED = 0x4000;

        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const SNDTIMEO = 0x1005;
        pub const RCVTIMEO = 0x1006;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;
        pub const SNDSPACE = 0x100a;
        pub const CPUHINT = 0x1030;
    },
    .haiku => struct {
        pub const ACCEPTCONN = 0x00000001;
        pub const BROADCAST = 0x00000002;
        pub const DEBUG = 0x00000004;
        pub const DONTROUTE = 0x00000008;
        pub const KEEPALIVE = 0x00000010;
        pub const OOBINLINE = 0x00000020;
        pub const REUSEADDR = 0x00000040;
        pub const REUSEPORT = 0x00000080;
        pub const USELOOPBACK = 0x00000100;
        pub const LINGER = 0x00000200;

        pub const SNDBUF = 0x40000001;
        pub const SNDLOWAT = 0x40000002;
        pub const SNDTIMEO = 0x40000003;
        pub const RCVBUF = 0x40000004;
        pub const RCVLOWAT = 0x40000005;
        pub const RCVTIMEO = 0x40000006;
        pub const ERROR = 0x40000007;
        pub const TYPE = 0x40000008;
        pub const NONBLOCK = 0x40000009;
        pub const BINDTODEVICE = 0x4000000a;
        pub const PEERCRED = 0x4000000b;
    },
    .openbsd => struct {
        pub const DEBUG = 0x0001;
        pub const ACCEPTCONN = 0x0002;
        pub const REUSEADDR = 0x0004;
        pub const KEEPALIVE = 0x0008;
        pub const DONTROUTE = 0x0010;
        pub const BROADCAST = 0x0020;
        pub const USELOOPBACK = 0x0040;
        pub const LINGER = 0x0080;
        pub const OOBINLINE = 0x0100;
        pub const REUSEPORT = 0x0200;
        pub const TIMESTAMP = 0x0800;
        pub const BINDANY = 0x1000;
        pub const ZEROIZE = 0x2000;
        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const SNDTIMEO = 0x1005;
        pub const RCVTIMEO = 0x1006;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;
        pub const NETPROC = 0x1020;
        pub const RTABLE = 0x1021;
        pub const PEERCRED = 0x1022;
        pub const SPLICE = 0x1023;
        pub const DOMAIN = 0x1024;
        pub const PROTOCOL = 0x1025;
    },
    // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L130-L150
    .serenity => struct {
        pub const RCVTIMEO = 0;
        pub const SNDTIMEO = 1;
        pub const TYPE = 2;
        pub const ERROR = 3;
        pub const PEERCRED = 4;
        pub const RCVBUF = 5;
        pub const SNDBUF = 6;
        pub const DEBUG = 7;
        pub const REUSEADDR = 8;
        pub const BINDTODEVICE = 9;
        pub const KEEPALIVE = 10;
        pub const TIMESTAMP = 11;
        pub const BROADCAST = 12;
        pub const LINGER = 13;
        pub const ACCEPTCONN = 14;
        pub const DONTROUTE = 15;
        pub const OOBINLINE = 16;
        pub const SNDLOWAT = 17;
        pub const RCVLOWAT = 18;
    },
    else => void,
};
pub const SOMAXCONN = switch (native_os) {
    .linux => linux.SOMAXCONN,
    .windows => ws2_32.SOMAXCONN,
    // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L128
    .illumos, .serenity => 128,
    // https://github.com/freebsd/freebsd-src/blob/9ab31f821ad1c6bad474510447387c50bef2c24c/sys/sys/socket.h#L434
    // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/fd3d1949d526ffa646e57037770acd6f2f3bb617/sys/sys/socket.h#L393
    // https://github.com/NetBSD/src/blob/a673fb3f8487e974c669216064f7588207229fea/sys/sys/socket.h#L472
    // https://github.com/openbsd/src/blob/8ba9cd88f10123fef7af805b8e5ccc2463ad8fa4/sys/sys/socket.h#L483
    // https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/socket.h#L815
    .freebsd, .dragonfly, .netbsd, .openbsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => 128,
    else => void,
};
pub const SCM = switch (native_os) {
    .linux, .emscripten => linux.SCM,
    // https://github.com/illumos/illumos-gate/blob/489f6310fe8952e87fc1dce8af87990fcfd90f18/usr/src/uts/common/sys/socket.h#L196
    .illumos => struct {
        pub const RIGHTS = 0x1010;
        pub const UCRED = 0x1012;
        pub const TIMESTAMP = SO.TIMESTAMP;
    },
    // https://github.com/haiku/haiku/blob/e3d01e53a25446d5ba4999d0ff6dff29a2418657/headers/posix/sys/socket.h#L156
    .haiku => struct {
        pub const RIGHTS = 1;
    },
    // https://github.com/SerenityOS/serenity/blob/c6618f36bf0949bd76177f202659b1f3079e0792/Kernel/API/POSIX/sys/socket.h#L171
    .serenity => struct {
        pub const TIMESTAMP = 0;
        pub const RIGHTS = 1;
    },
    // https://github.com/freebsd/freebsd-src/blob/614e9b33bf5594d9d09b5d296afa4f3aa6971823/sys/sys/socket.h#L593
    .freebsd => struct {
        pub const RIGHTS = 1;
        pub const TIMESTAMP = 2;
        pub const CREDS = 3;
        pub const BINTIME = 4;
        pub const REALTIME = 5;
        pub const MONOTONIC = 6;
        pub const TIME_INFO = 7;
        pub const CREDS2 = 8;
    },
    // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/6098912863ed4c7b3f70d7483910ce2956cf4ed3/sys/sys/socket.h#L520
    .dragonfly => struct {
        pub const RIGHTS = 1;
        pub const TIMESTAMP = 2;
        pub const CREDS = 3;
    },
    // https://github.com/NetBSD/src/blob/3311177ea898ab8322292ba0e48faa9b2e834cb6/sys/sys/socket.h#L578
    .netbsd => struct {
        pub const RIGHTS = 0x01;
        pub const TIMESTAMP = 0x08;
        pub const CREDS = 0x10;
    },
    // https://github.com/openbsd/src/blob/1b1dd04c9634112eb763374379af99a68ace4328/sys/sys/socket.h#L566
    .openbsd => struct {
        pub const RIGHTS = 0x01;
        pub const TIMESTAMP = 0x04;
    },
    // https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/socket.h#L1114
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const RIGHTS = 1;
        pub const TIMESTAMP = 2;
        pub const CREDS = 3;
        pub const TIMESTAMP_MONOTONIC = 4;
    },
    else => void,
};

pub const IFNAMESIZE = switch (native_os) {
    .linux => linux.IFNAMESIZE,
    .emscripten => emscripten.IFNAMESIZE,
    .windows => 30,
    // https://github.com/SerenityOS/serenity/blob/9882848e0bf783dfc8e8a6d887a848d70d9c58f4/Kernel/API/POSIX/net/if.h#L50
    .openbsd, .dragonfly, .netbsd, .freebsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .serenity => 16,
    .illumos => 32,
    else => {},
};

pub const stack_t = switch (native_os) {
    .linux => linux.stack_t,
    .emscripten => emscripten.stack_t,
    .freebsd, .openbsd => extern struct {
        /// 信号栈基址。
        sp: *anyopaque,
        /// 信号栈长度。
        size: usize,
        /// SS_DISABLE 和/或 SS_ONSTACK。
        flags: i32,
    },
    // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L48-L52
    .serenity => extern struct {
        sp: *anyopaque,
        flags: c_int,
        size: usize,
    },
    else => extern struct {
        sp: [*]u8,
        size: isize,
        flags: i32,
    },
};
pub const time_t = switch (native_os) {
    .linux => linux.time_t,
    .dragonfly, .illumos, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => c_long,
    .emscripten => emscripten.time_t,
    .freebsd, .haiku => if (native_arch == .x86) c_int else c_longlong,
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L47
    // lib/libc/include/wasm-wasi-musl/__typedef_time_t.h
    .netbsd, .openbsd, .serenity, .wasi => c_longlong,
    else => void,
};
pub const suseconds_t = switch (native_os) {
    .dragonfly, .freebsd, .openbsd, .illumos => c_long,
    .netbsd, .haiku, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => c_int,
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L49
    .serenity, .wasi => c_longlong,
    else => void,
};

pub const timeval = switch (native_os) {
    .linux => linux.timeval,
    .emscripten => emscripten.timeval,
    .windows => extern struct {
        sec: c_long,
        usec: c_long,
    },
    // https://github.com/SerenityOS/serenity/blob/6b6eca0631c893c5f8cfb8274cdfe18e2d0637c0/Kernel/API/POSIX/sys/time.h#L15-L18
    .dragonfly, .freebsd, .netbsd, .openbsd, .haiku, .illumos, .serenity, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .wasi => extern struct {
        /// 秒
        sec: time_t,
        /// 微秒
        usec: suseconds_t,
    },
    else => void,
};
pub const timezone = switch (native_os) {
    .linux => linux.timezone,
    .emscripten => emscripten.timezone,
    // https://github.com/SerenityOS/serenity/blob/ba776390b5878ec0be1a9e595a3471a6cfe0a0cf/Userland/Libraries/LibC/sys/time.h#L19-L22
    .dragonfly, .freebsd, .netbsd, .openbsd, .haiku, .illumos, .serenity, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .windows, .wasi => extern struct {
        minuteswest: c_int,
        dsttime: c_int,
    },
    else => void,
};

pub const user_desc = switch (native_os) {
    .linux => linux.user_desc,
    else => void,
};
pub const utsname = switch (native_os) {
    .linux => linux.utsname,
    .emscripten => emscripten.utsname,
    .wasi => extern struct {
        sysname: [64:0]u8,
        nodename: [64:0]u8,
        release: [64:0]u8,
        version: [64:0]u8,
        machine: [64:0]u8,
        domainname: [64:0]u8,
    },
    .illumos => extern struct {
        sysname: [256:0]u8,
        nodename: [256:0]u8,
        release: [256:0]u8,
        version: [256:0]u8,
        machine: [256:0]u8,
        domainname: [256:0]u8,
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        sysname: [255:0]u8,
        nodename: [255:0]u8,
        release: [255:0]u8,
        version: [255:0]u8,
        machine: [255:0]u8,
    },
    // https://github.com/SerenityOS/serenity/blob/d794ed1de7a46482272683f8dc4c858806390f29/Kernel/API/POSIX/sys/utsname.h#L17-L23
    .serenity => extern struct {
        sysname: [UTSNAME_ENTRY_LEN:0]u8,
        nodename: [UTSNAME_ENTRY_LEN:0]u8,
        release: [UTSNAME_ENTRY_LEN:0]u8,
        version: [UTSNAME_ENTRY_LEN:0]u8,
        machine: [UTSNAME_ENTRY_LEN:0]u8,

        const UTSNAME_ENTRY_LEN = 64;
    },
    else => void,
};
pub const PR = switch (native_os) {
    .linux => linux.PR,
    else => void,
};
pub const _errno = switch (native_os) {
    .linux => switch (native_abi) {
        .android, .androideabi => private.__errno,
        else => private.__errno_location,
    },
    .emscripten => private.__errno_location,
    .wasi, .dragonfly => private.errnoFromThreadLocal,
    .windows => private._errno,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .freebsd => private.__error,
    .illumos => private.___errno,
    .openbsd, .netbsd => private.__errno,
    .haiku => haiku._errnop,
    // https://github.com/SerenityOS/serenity/blob/a353ceecf13b6f156a078e32f1ddf1d21366934c/Userland/Libraries/LibC/errno.h#L33
    .serenity => private.__errno_location,
    else => {},
};

pub const RTLD = switch (native_os) {
    .linux, .emscripten => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        NOLOAD: bool = false,
        DEEPBIND: bool = false,
        _4: u4 = 0,
        GLOBAL: bool = false,
        _9: u3 = 0,
        NODELETE: bool = false,
        _: u19 = 0,
    },
    .dragonfly, .freebsd => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        _2: u6 = 0,
        GLOBAL: bool = false,
        TRACE: bool = false,
        _10: u2 = 0,
        NODELETE: bool = false,
        NOLOAD: bool = false,
        _: u18 = 0,
    },
    .haiku => packed struct(u32) {
        NOW: bool = false,
        GLOBAL: bool = false,
        _: u30 = 0,
    },
    .netbsd => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        _2: u6 = 0,
        GLOBAL: bool = false,
        LOCAL: bool = false,
        _10: u2 = 0,
        NODELETE: bool = false,
        NOLOAD: bool = false,
        _: u18 = 0,
    },
    .illumos => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        NOLOAD: bool = false,
        _3: u5 = 0,
        GLOBAL: bool = false,
        PARENT: bool = false,
        GROUP: bool = false,
        WORLD: bool = false,
        NODELETE: bool = false,
        FIRST: bool = false,
        _14: u2 = 0,
        CONFGEN: bool = false,
        _: u15 = 0,
    },
    .openbsd => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        _2: u6 = 0,
        GLOBAL: bool = false,
        TRACE: bool = false,
        _: u22 = 0,
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        LOCAL: bool = false,
        GLOBAL: bool = false,
        NOLOAD: bool = false,
        _5: u2 = 0,
        NODELETE: bool = false,
        FIRST: bool = false,
        _: u23 = 0,
    },
    // https://github.com/SerenityOS/serenity/blob/36a26d7fa80bc9c72b19442912d8967f448368ff/Userland/Libraries/LibC/dlfcn.h#L13-L17
    .serenity => packed struct(c_int) {
        DEFAULT: bool = false,
        _1: u1,
        LAZY: bool = false,
        NOW: bool = false,
        GLOBAL: bool = false,
        LOCAL: bool = false,
        _: @Int(.unsigned, @bitSizeOf(c_int) - 6) = 0,
    },
    else => void,
};

pub const dirent = switch (native_os) {
    .linux, .emscripten => extern struct {
        ino: ino_t,
        off: off_t,
        reclen: c_ushort,
        type: u8,
        name: [256]u8,
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        ino: u64,
        seekoff: u64,
        reclen: u16,
        namlen: u16,
        type: u8,
        name: [1024]u8,
    },
    .freebsd => extern struct {
        /// 条目的文件编号。
        fileno: ino_t,
        /// 条目的目录偏移量。
        off: off_t,
        /// 此记录的长度。
        reclen: u16,
        /// 文件类型,为 DT_ 之一。
        type: u8,
        pad0: u8 = 0,
        /// name 成员的长度。
        namlen: u16,
        pad1: u16 = 0,
        /// 条目名称。
        name: [255:0]u8,
    },
    .illumos => extern struct {
        /// 条目的 inode 编号。
        ino: ino_t,
        /// 此条目在磁盘上的偏移量。
        off: off_t,
        /// 此记录的长度。
        reclen: u16,
        /// 文件名。
        name: [MAXNAMLEN:0]u8,
    },
    .netbsd => extern struct {
        fileno: ino_t,
        reclen: u16,
        namlen: u16,
        type: u8,
        name: [MAXNAMLEN:0]u8,
    },
    .dragonfly => extern struct {
        fileno: c_ulong,
        namlen: u16,
        type: u8,
        unused1: u8,
        unused2: u32,
        name: [256]u8,

        pub fn reclen(self: dirent) u16 {
            return (@offsetOf(dirent, "name") + self.namlen + 1 + 7) & ~@as(u16, 7);
        }
    },
    .openbsd => extern struct {
        fileno: ino_t,
        off: off_t,
        reclen: u16,
        type: u8,
        namlen: u8,
        _: u32 align(1) = 0,
        name: [MAXNAMLEN:0]u8,
    },
    // https://github.com/SerenityOS/serenity/blob/abc150085f532f123b598949218893cb272ccc4c/Userland/Libraries/LibC/dirent.h#L14-L20
    .serenity => extern struct {
        ino: ino_t,
        off: off_t,
        reclen: c_ushort,
        type: u8,
        name: [255:0]u8,
    },
    else => void,
};
pub const MAXNAMLEN = switch (native_os) {
    .netbsd, .illumos => 511,
    // https://github.com/SerenityOS/serenity/blob/1262a7d1424d0d2e89d80644409721cbf056ab17/Kernel/API/POSIX/dirent.h#L37
    .haiku, .serenity => NAME_MAX,
    .openbsd => 255,
    else => {},
};
pub const dirent64 = switch (native_os) {
    .linux => extern struct {
        ino: c_ulong,
        off: c_ulong,
        reclen: c_ushort,
        type: u8,
        name: [256]u8,
    },
    else => void,
};

pub const AI = if (builtin.abi.isAndroid()) packed struct(u32) {
    PASSIVE: bool = false,
    CANONNAME: bool = false,
    NUMERICHOST: bool = false,
    NUMERICSERV: bool = false,
    _4: u4 = 0,
    ALL: bool = false,
    V4MAPPED_CFG: bool = false,
    ADDRCONFIG: bool = false,
    V4MAPPED: bool = false,
    _: u20 = 0,
} else switch (native_os) {
    .linux, .emscripten => linux.AI,
    .dragonfly, .haiku, .freebsd => packed struct(u32) {
        PASSIVE: bool = false,
        CANONNAME: bool = false,
        NUMERICHOST: bool = false,
        NUMERICSERV: bool = false,
        _4: u4 = 0,
        ALL: bool = false,
        V4MAPPED_CFG: bool = false,
        ADDRCONFIG: bool = false,
        V4MAPPED: bool = false,
        _: u20 = 0,
    },
    .netbsd => packed struct(u32) {
        PASSIVE: bool = false,
        CANONNAME: bool = false,
        NUMERICHOST: bool = false,
        NUMERICSERV: bool = false,
        _4: u6 = 0,
        ADDRCONFIG: bool = false,
        SRV: bool = false,
        _: u20 = 0,
    },
    .illumos => packed struct(u32) {
        V4MAPPED: bool = false,
        ALL: bool = false,
        ADDRCONFIG: bool = false,
        PASSIVE: bool = false,
        CANONNAME: bool = false,
        NUMERICHOST: bool = false,
        NUMERICSERV: bool = false,
        _: u25 = 0,
    },
    .openbsd => packed struct(u32) {
        PASSIVE: bool = false,
        CANONNAME: bool = false,
        NUMERICHOST: bool = false,
        EXT: bool = false,
        NUMERICSERV: bool = false,
        FQDN: bool = false,
        ADDRCONFIG: bool = false,
        _: u25 = 0,
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => packed struct(u32) {
        PASSIVE: bool = false,
        CANONNAME: bool = false,
        NUMERICHOST: bool = false,
        _3: u5 = 0,
        ALL: bool = false,
        V4MAPPED_CFG: bool = false,
        ADDRCONFIG: bool = false,
        V4MAPPED: bool = false,
        NUMERICSERV: bool = false,
        _: u19 = 0,
    },
    .windows => ws2_32.AI,
    // https://github.com/SerenityOS/serenity/blob/d510d2aeb2facbd8f6c383d70fd1b033e1fee5dd/Userland/Libraries/LibC/netdb.h#L90-L96
    .serenity => packed struct(c_int) {
        PASSIVE: bool = false,
        CANONNAME: bool = false,
        NUMERICHOST: bool = false,
        NUMERICSERV: bool = false,
        V4MAPPED: bool = false,
        ALL: bool = false,
        ADDRCONFIG: bool = false,
        _: @Int(.unsigned, @bitSizeOf(c_int) - 7) = 0,
    },
    else => void,
};

pub const NI = switch (native_os) {
    .linux, .emscripten => packed struct(u32) {
        NUMERICHOST: bool = false,
        NUMERICSERV: bool = false,
        NOFQDN: bool = false,
        NAMEREQD: bool = false,
        DGRAM: bool = false,
        _5: u3 = 0,
        NUMERICSCOPE: bool = false,
        _: u23 = 0,
    },
    .illumos => packed struct(u32) {
        NOFQDN: bool = false,
        NUMERICHOST: bool = false,
        NAMEREQD: bool = false,
        NUMERICSERV: bool = false,
        DGRAM: bool = false,
        WITHSCOPEID: bool = false,
        NUMERICSCOPE: bool = false,
        _: u25 = 0,
    },
    // https://github.com/SerenityOS/serenity/blob/d510d2aeb2facbd8f6c383d70fd1b033e1fee5dd/Userland/Libraries/LibC/netdb.h#L101-L105
    .serenity => packed struct(c_int) {
        NUMERICHOST: bool = false,
        NUMERICSERV: bool = false,
        NAMEREQD: bool = false,
        NOFQDN: bool = false,
        DGRAM: bool = false,
        _: @Int(.unsigned, @bitSizeOf(c_int) - 5) = 0,
    },
    .freebsd, .haiku => packed struct(u32) {
        NOFQDN: bool = false,
        NUMERICHOST: bool = false,
        NAMEREQD: bool = false,
        NUMERICSERV: bool = false,
        DGRAM: bool = false,
        NUMERICSCOPE: bool = false,
        _: u26 = 0,
    },
    .dragonfly, .netbsd => packed struct(u32) {
        NOFQDN: bool = false,
        NUMERICHOST: bool = false,
        NAMEREQD: bool = false,
        NUMERICSERV: bool = false,
        DGRAM: bool = false,
        _5: u1 = 0,
        NUMERICSCOPE: bool = false,
        _: u25 = 0,
    },
    .openbsd => packed struct(u32) {
        NUMERICHOST: bool = false,
        NUMERICSERV: bool = false,
        NOFQDN: bool = false,
        NAMEREQD: bool = false,
        DGRAM: bool = false,
        _: u27 = 0,
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => packed struct(u32) {
        NOFQDN: bool = false,
        NUMERICHOST: bool = false,
        NAMEREQD: bool = false,
        NUMERICSERV: bool = false,
        DGRAM: bool = false,
        _5: u3 = 0,
        NUMERICSCOPE: bool = false,
        _: u23 = 0,
    },
    else => void,
};

pub const EAI = if (builtin.abi.isAndroid()) enum(c_int) {
    /// 不支持 hostname 的地址族
    ADDRFAMILY = 1,
    /// 名称解析临时失败
    AGAIN = 2,
    /// ai_flags 的值无效
    BADFLAGS = 3,
    /// 名称解析发生不可恢复的失败
    FAIL = 4,
    /// 不支持 ai_family
    FAMILY = 5,
    /// 内存分配失败
    MEMORY = 6,
    /// 主机名未关联地址
    NODATA = 7,
    /// 未提供 hostname 和 servname,或其未知
    NONAME = 8,
    /// ai_socktype 不支持 servname
    SERVICE = 9,
    /// 不支持 ai_socktype
    SOCKTYPE = 10,
    /// 通过 errno 返回系统错误
    SYSTEM = 11,
    /// hints 的值无效
    BADHINTS = 12,
    /// 解析出的协议未知
    PROTOCOL = 13,
    /// 参数缓冲区溢出
    OVERFLOW = 14,

    MAX = 15,

    _,
} else switch (native_os) {
    .linux, .emscripten => enum(c_int) {
        BADFLAGS = -1,
        NONAME = -2,
        AGAIN = -3,
        FAIL = -4,
        FAMILY = -6,
        SOCKTYPE = -7,
        SERVICE = -8,
        MEMORY = -10,
        SYSTEM = -11,
        OVERFLOW = -12,

        NODATA = -5,
        ADDRFAMILY = -9,
        INPROGRESS = -100,
        CANCELED = -101,
        NOTCANCELED = -102,
        ALLDONE = -103,
        INTR = -104,
        IDN_ENCODE = -105,

        _,
    },
    .haiku, .dragonfly, .netbsd, .freebsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => enum(c_int) {
        /// 不支持 hostname 的地址族
        ADDRFAMILY = 1,
        /// 名称解析临时失败
        AGAIN = 2,
        /// ai_flags 的值无效
        BADFLAGS = 3,
        /// 名称解析发生不可恢复的失败
        FAIL = 4,
        /// 不支持 ai_family
        FAMILY = 5,
        /// 内存分配失败
        MEMORY = 6,
        /// 主机名未关联地址
        NODATA = 7,
        /// 未提供 hostname 和 servname,或其未知
        NONAME = 8,
        /// ai_socktype 不支持 servname
        SERVICE = 9,
        /// 不支持 ai_socktype
        SOCKTYPE = 10,
        /// 通过 errno 返回系统错误
        SYSTEM = 11,
        /// hints 的值无效
        BADHINTS = 12,
        /// 解析出的协议未知
        PROTOCOL = 13,
        /// 参数缓冲区溢出
        OVERFLOW = 14,
        _,
    },
    .illumos => enum(c_int) {
        /// 不支持 hostname 的地址族
        ADDRFAMILY = 1,
        /// 当前无法解析该名称
        AGAIN = 2,
        /// flags 参数的值无效
        BADFLAGS = 3,
        /// 名称解析发生不可恢复的失败
        FAIL = 4,
        /// 无法识别地址族
        FAMILY = 5,
        /// 内存分配失败
        MEMORY = 6,
        /// 主机名未关联地址
        NODATA = 7,
        /// 名称无法解析
        NONAME = 8,
        /// 无法识别此套接字类型的服务
        SERVICE = 9,
        /// 无法识别预期的套接字类型
        SOCKTYPE = 10,
        /// 通过 errno 返回系统错误
        SYSTEM = 11,
        /// 参数缓冲区溢出
        OVERFLOW = 12,
        /// 解析出的协议未知
        PROTOCOL = 13,

        _,
    },
    .openbsd => enum(c_int) {
        /// 不支持 hostname 的地址族
        ADDRFAMILY = -9,
        /// 当前无法解析该名称
        AGAIN = -3,
        /// flags 参数的值无效
        BADFLAGS = -1,
        /// 名称解析发生不可恢复的失败
        FAIL = -4,
        /// 无法识别地址族
        FAMILY = -6,
        /// 内存分配失败
        MEMORY = -10,
        /// 主机名未关联地址
        NODATA = -5,
        /// 名称无法解析
        NONAME = -2,
        /// 无法识别此套接字类型的服务
        SERVICE = -8,
        /// 无法识别预期的套接字类型
        SOCKTYPE = -7,
        /// 通过 errno 返回系统错误
        SYSTEM = -11,
        /// hints 的值无效
        BADHINTS = -12,
        /// 解析出的协议未知
        PROTOCOL = -13,
        /// 参数缓冲区溢出
        OVERFLOW = -14,
        _,
    },
    // https://github.com/SerenityOS/serenity/blob/d510d2aeb2facbd8f6c383d70fd1b033e1fee5dd/Userland/Libraries/LibC/netdb.h#L77-L88
    .serenity => enum(c_int) {
        ADDRFAMILY = 1,
        AGAIN = 2,
        BADFLAGS = 3,
        FAIL = 4,
        FAMILY = 5,
        MEMORY = 6,
        NODATA = 7,
        NONAME = 8,
        SERVICE = 9,
        SOCKTYPE = 10,
        SYSTEM = 11,
        OVERFLOW = 12,
        _,
    },
    else => void,
};

pub const dl_iterate_phdr_callback = *const fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.c) c_int;

pub const Stat = switch (native_os) {
    .emscripten => emscripten.Stat,
    .wasi => extern struct {
        // 与 lib/libc/include/wasm-wasi-musl/__struct_stat.h 中 wasi-libc 的 `struct stat` 一致。
        dev: dev_t,
        ino: ino_t,
        nlink: nlink_t,
        mode: mode_t,
        uid: uid_t,
        gid: gid_t,
        __pad0: c_uint = 0,
        rdev: dev_t,
        size: off_t,
        blksize: blksize_t,
        blocks: blkcnt_t,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        __reserved: [3]c_longlong = [3]c_longlong{ 0, 0, 0 },

        pub fn atime(self: @This()) timespec {
            return self.atim;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }

        pub fn fromFilestat(st: wasi.filestat_t) Stat {
            return .{
                .dev = st.dev,
                .ino = st.ino,
                .mode = switch (st.filetype) {
                    .UNKNOWN => 0,
                    .BLOCK_DEVICE => S.IFBLK,
                    .CHARACTER_DEVICE => S.IFCHR,
                    .DIRECTORY => S.IFDIR,
                    .REGULAR_FILE => S.IFREG,
                    .SOCKET_DGRAM => S.IFSOCK,
                    .SOCKET_STREAM => S.IFIFO,
                    .SYMBOLIC_LINK => S.IFLNK,
                    _ => 0,
                },
                .nlink = st.nlink,
                .size = @intCast(st.size),
                .atim = timespec.fromTimestamp(st.atim),
                .mtim = timespec.fromTimestamp(st.mtim),
                .ctim = timespec.fromTimestamp(st.ctim),

                .uid = 0,
                .gid = 0,
                .rdev = 0,
                .blksize = 0,
                .blocks = 0,
            };
        }
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        dev: i32,
        mode: u16,
        nlink: u16,
        ino: ino_t,
        uid: uid_t,
        gid: gid_t,
        rdev: i32,
        atimespec: timespec,
        mtimespec: timespec,
        ctimespec: timespec,
        birthtimespec: timespec,
        size: off_t,
        blocks: i64,
        blksize: i32,
        flags: u32,
        gen: u32,
        lspare: i32,
        qspare: [2]i64,

        pub fn atime(self: @This()) timespec {
            return self.atimespec;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtimespec;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctimespec;
        }

        pub fn birthtime(self: @This()) timespec {
            return self.birthtimespec;
        }
    },
    .freebsd => freebsd.Stat,
    .illumos => extern struct {
        dev: dev_t,
        ino: ino_t,
        mode: mode_t,
        nlink: nlink_t,
        uid: uid_t,
        gid: gid_t,
        rdev: dev_t,
        size: off_t,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        blksize: blksize_t,
        blocks: blkcnt_t,
        fstype: [16]u8,

        pub fn atime(self: @This()) timespec {
            return self.atim;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }
    },
    .netbsd => extern struct {
        dev: dev_t,
        mode: mode_t,
        ino: ino_t,
        nlink: nlink_t,
        uid: uid_t,
        gid: gid_t,
        rdev: dev_t,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        birthtim: timespec,
        size: off_t,
        blocks: blkcnt_t,
        blksize: blksize_t,
        flags: u32,
        gen: u32,
        __spare: [2]u32,

        pub fn atime(self: @This()) timespec {
            return self.atim;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }

        pub fn birthtime(self: @This()) timespec {
            return self.birthtim;
        }
    },
    .dragonfly => extern struct {
        ino: ino_t,
        nlink: c_uint,
        dev: c_uint,
        mode: c_ushort,
        padding1: u16,
        uid: uid_t,
        gid: gid_t,
        rdev: c_uint,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        size: c_ulong,
        blocks: i64,
        blksize: u32,
        flags: u32,
        gen: u32,
        lspare: i32,
        qspare1: i64,
        qspare2: i64,
        pub fn atime(self: @This()) timespec {
            return self.atim;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }
    },
    .haiku => extern struct {
        dev: dev_t,
        ino: ino_t,
        mode: mode_t,
        nlink: nlink_t,
        uid: uid_t,
        gid: gid_t,
        size: off_t,
        rdev: dev_t,
        blksize: blksize_t,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        crtim: timespec,
        type: u32,
        blocks: blkcnt_t,

        pub fn atime(self: @This()) timespec {
            return self.atim;
        }
        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }
        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }
        pub fn birthtime(self: @This()) timespec {
            return self.crtim;
        }
    },
    .openbsd => extern struct {
        mode: mode_t,
        dev: dev_t,
        ino: ino_t,
        nlink: nlink_t,
        uid: uid_t,
        gid: gid_t,
        rdev: dev_t,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        size: off_t,
        blocks: blkcnt_t,
        blksize: blksize_t,
        flags: u32,
        gen: u32,
        birthtim: timespec,

        pub fn atime(self: @This()) timespec {
            return self.atim;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }

        pub fn birthtime(self: @This()) timespec {
            return self.birthtim;
        }
    },
    // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/sys/stat.h#L53-L67
    .serenity => extern struct {
        dev: dev_t,
        ino: ino_t,
        mode: mode_t,
        nlink: nlink_t,
        uid: uid_t,
        gid: gid_t,
        rdev: dev_t,
        size: off_t,
        blksize: blksize_t,
        blocks: blkcnt_t,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,

        pub fn atime(self: @This()) timespec {
            return self.atim;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }
    },
    else => void,
};

pub const pthread_spinlock_t = switch (native_os) {
    .openbsd => openbsd.pthread_spinlock_t,
    .freebsd => extern struct {
        inner: ?*anyopaque = null,
    },
    .netbsd => extern struct {
        pts_magic: c_uint,
        spin: pthread_spin_t,
        pts_flags: c_int,
    },
    .windows => isize,
    else => c_int,
};

pub const pthread_mutex_t = switch (native_os) {
    .linux => extern struct {
        data: [data_len]u8 align(@alignOf(usize)) = @splat(0),

        const data_len = switch (native_abi) {
            .musl, .musleabi, .musleabihf => if (@sizeOf(usize) == 8) 40 else 24,
            .gnu, .gnuabin32, .gnuabi64, .gnueabi, .gnueabihf, .gnux32 => switch (native_arch) {
                .aarch64 => 48,
                .x86_64 => if (native_abi == .gnux32) 32 else 40,
                .mips64, .powerpc64, .powerpc64le, .sparc64 => 40,
                else => if (@sizeOf(usize) == 8) 40 else 24,
            },
            .android, .androideabi => if (@sizeOf(usize) == 8) 40 else 4,
            else => @compileError("unsupported ABI"),
        };
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        sig: c_long = 0x32AAABA7,
        data: [data_len]u8 = @splat(0),

        const data_len = if (@sizeOf(usize) == 8) 56 else 40;
    },
    .freebsd, .dragonfly, .openbsd => extern struct {
        inner: ?*anyopaque = null,
    },
    .hermit => extern struct {
        ptr: usize = maxInt(usize),
    },
    .netbsd => extern struct {
        magic: u32 = 0x33330003,
        errorcheck: padded_pthread_spin_t = 0,
        ceiling: padded_pthread_spin_t = 0,
        owner: usize = 0,
        waiters: ?*u8 = null,
        recursed: u32 = 0,
        spare2: ?*anyopaque = null,
    },
    .haiku => extern struct {
        flags: u32 = 0,
        lock: i32 = 0,
        unused: i32 = -42,
        owner: i32 = -1,
        owner_count: i32 = 0,
    },
    .illumos => extern struct {
        flag1: u16 = 0,
        flag2: u8 = 0,
        ceiling: u8 = 0,
        type: u16 = 0,
        magic: u16 = 0x4d58,
        lock: u64 = 0,
        data: u64 = 0,
    },
    .fuchsia => extern struct {
        data: [40]u8 align(@alignOf(usize)) = @splat(0),
    },
    .emscripten => extern struct {
        data: [24]u8 align(4) = @splat(0),
    },
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L68-L73
    .serenity => extern struct {
        lock: u32 = 0,
        owner: pthread_t = 0,
        level: c_int = 0,
        type: c_int = 0,
    },
    else => void,
};

pub const pthread_cond_t = switch (native_os) {
    .linux => extern struct {
        data: [48]u8 align(@alignOf(usize)) = @splat(0),
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        sig: c_long = 0x3CB0B1BB,
        data: [data_len]u8 = @splat(0),
        const data_len = if (@sizeOf(usize) == 8) 40 else 24;
    },
    .freebsd, .dragonfly, .openbsd => extern struct {
        inner: ?*anyopaque = null,
    },
    .hermit => extern struct {
        ptr: usize = maxInt(usize),
    },
    .netbsd => extern struct {
        magic: u32 = 0x55550005,
        lock: pthread_spin_t = 0,
        waiters_first: ?*u8 = null,
        waiters_last: ?*u8 = null,
        mutex: ?*pthread_mutex_t = null,
        private: ?*anyopaque = null,
    },
    .haiku => extern struct {
        flags: u32 = 0,
        unused: i32 = -42,
        mutex: ?*anyopaque = null,
        waiter_count: i32 = 0,
        lock: i32 = 0,
    },
    .illumos => extern struct {
        flag: [4]u8 = @splat(0),
        type: u16 = 0,
        magic: u16 = 0x4356,
        data: u64 = 0,
    },
    .fuchsia, .emscripten => extern struct {
        data: [48]u8 align(@alignOf(usize)) = @splat(0),
    },
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L80-L84
    .serenity => extern struct {
        mutex: ?*pthread_mutex_t = null,
        value: u32 = 0,
        clockid: clockid_t = .REALTIME_COARSE,
    },
    else => void,
};

pub const pthread_rwlock_t = switch (native_os) {
    .linux => switch (native_abi) {
        .android, .androideabi => switch (@sizeOf(usize)) {
            4 => extern struct {
                data: [40]u8 align(@alignOf(usize)) = @splat(0),
            },
            8 => extern struct {
                data: [56]u8 align(@alignOf(usize)) = @splat(0),
            },
            else => @compileError("impossible pointer size"),
        },
        else => extern struct {
            data: [56]u8 align(@alignOf(usize)) = @splat(0),
        },
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        sig: c_long = 0x2DA8B3B4,
        data: [192]u8 = @splat(0),
    },
    .freebsd, .dragonfly, .openbsd => extern struct {
        ptr: ?*anyopaque = null,
    },
    .hermit => extern struct {
        ptr: usize = maxInt(usize),
    },
    .netbsd => extern struct {
        magic: c_uint = 0x99990009,
        interlock: switch (builtin.cpu.arch) {
            .aarch64, .aarch64_be, .m68k, .sparc, .sparc64, .x86, .x86_64 => u8,
            .arm, .armeb, .powerpc => c_int,
            .mips, .mipsel, .mips64, .mips64el => c_uint,
            else => unreachable,
        } = 0,
        rblocked_first: ?*u8 = null,
        rblocked_last: ?*u8 = null,
        wblocked_first: ?*u8 = null,
        wblocked_last: ?*u8 = null,
        nreaders: c_uint = 0,
        owner: ?pthread_t = null,
        private: ?*anyopaque = null,
    },
    .illumos => extern struct {
        readers: i32 = 0,
        type: u16 = 0,
        magic: u16 = 0x5257,
        mutex: pthread_mutex_t = .{},
        readercv: pthread_cond_t = .{},
        writercv: pthread_cond_t = .{},
    },
    .fuchsia => extern struct {
        size: [56]u8 align(@alignOf(usize)) = @splat(0),
    },
    .emscripten => extern struct {
        size: [32]u8 align(4) = @splat(0),
    },
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L86
    .serenity => extern struct {
        inner: u64 = 0,
    },
    else => void,
};

pub const pthread_attr_t = switch (native_os) {
    .linux, .emscripten, .dragonfly => extern struct {
        __size: [56]u8,
        __align: c_long,
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        __sig: c_long,
        __opaque: [56]u8,
    },
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L75
    .freebsd, .openbsd, .serenity => extern struct {
        inner: ?*anyopaque = null,
    },
    .illumos => extern struct {
        mutexattr: ?*anyopaque = null,
    },
    .netbsd => extern struct {
        magic: u32,
        flags: i32,
        private: ?*anyopaque,
    },
    .haiku => extern struct {
        detach_state: i32,
        sched_priority: i32,
        stack_size: i32,
        guard_size: i32,
        stack_address: ?*anyopaque,
    },
    else => void,
};

pub const pthread_key_t = switch (native_os) {
    .linux, .emscripten => c_uint,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => c_ulong,
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L65
    .openbsd, .illumos, .serenity => c_int,
    else => void,
};

pub const padded_pthread_spin_t = switch (native_os) {
    .netbsd => switch (builtin.cpu.arch) {
        .x86, .x86_64 => u32,
        .sparc, .sparc64 => u32,
        else => pthread_spin_t,
    },
    else => void,
};

pub const pthread_spin_t = switch (native_os) {
    .netbsd => switch (builtin.cpu.arch) {
        .aarch64, .aarch64_be => u8,
        .mips, .mipsel, .mips64, .mips64el => u32,
        .powerpc, .powerpc64, .powerpc64le => i32,
        .x86, .x86_64 => u8,
        .arm, .armeb, .thumb, .thumbeb => i32,
        .sparc, .sparc64 => u8,
        .riscv32, .riscv64 => u32,
        else => @compileError("undefined pthread_spin_t for this arch"),
    },
    else => void,
};

pub const sem_t = switch (native_os) {
    .linux, .emscripten => extern struct {
        __size: [4 * @sizeOf(usize)]u8 align(@alignOf(usize)),
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => c_int,
    .freebsd => extern struct {
        _magic: u32,
        _kern: extern struct {
            _count: u32,
            _flags: u32,
        },
        _padding: u32,
    },
    .illumos => extern struct {
        count: u32 = 0,
        type: u16 = 0,
        magic: u16 = 0x534d,
        __pad1: [3]u64 = @splat(0),
        __pad2: [2]u64 = @splat(0),
    },
    .openbsd, .netbsd, .dragonfly => ?*opaque {},
    .haiku => extern struct {
        type: i32,
        u: extern union {
            named_sem_id: i32,
            unnamed_sem: i32,
        },
        padding: [2]i32,
    },
    // https://github.com/SerenityOS/serenity/blob/aae106e37b48f2158e68902293df1e4bf7b80c0f/Userland/Libraries/LibC/semaphore.h#L23-L27
    .serenity => extern struct {
        magic: u32,
        value: u32,
        flags: u8,
    },
    else => void,
};

/// 从 `kevent` 重命名为 `Kevent`,以避免与函数名冲突。
pub const Kevent = switch (native_os) {
    .netbsd => extern struct {
        ident: usize,
        filter: i32,
        flags: u32,
        fflags: u32,
        data: i64,
        udata: usize,
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        ident: usize,
        filter: i16,
        flags: u16,
        fflags: u32,
        data: isize,
        udata: usize,

        // macOS 的 sys/types.h 使用 #pragma pack(4),因此这些检查
        // 用于保证结构体布局一致。这些值来自
        // 使用 offsetof 宏的 C 代码。
        comptime {
            assert(@offsetOf(@This(), "ident") == 0);
            assert(@offsetOf(@This(), "filter") == 8);
            assert(@offsetOf(@This(), "flags") == 10);
            assert(@offsetOf(@This(), "fflags") == 12);
            assert(@offsetOf(@This(), "data") == 16);
            assert(@offsetOf(@This(), "udata") == 24);
        }
    },
    .freebsd => extern struct {
        /// 此事件的标识符。
        ident: usize,
        /// 事件过滤器。
        filter: i16,
        /// kqueue 的操作标志。
        flags: u16,
        /// 过滤器标志值。
        fflags: u32,
        /// 过滤器数据值。
        data: i64,
        /// 不透明的用户数据标识符。
        udata: usize,
        /// 将来的扩展。
        _ext: [4]u64 = @splat(0),
    },
    .dragonfly => extern struct {
        ident: usize,
        filter: c_short,
        flags: c_ushort,
        fflags: c_uint,
        data: isize,
        udata: usize,
    },
    .openbsd => extern struct {
        ident: usize,
        filter: c_short,
        flags: u16,
        fflags: c_uint,
        data: i64,
        udata: usize,
    },
    else => void,
};

pub const port_t = switch (native_os) {
    .illumos => c_int,
    else => void,
};

pub const port_event = switch (native_os) {
    .illumos => extern struct {
        events: u32,
        /// 事件源。
        source: u16,
        __pad: u16,
        /// 来源专属对象。
        object: ?*anyopaque,
        /// 用户 cookie。
        cookie: ?*anyopaque,
    },
    else => void,
};

pub const AT = switch (native_os) {
    .linux => linux.AT,
    .windows => struct {
        /// 移除目录,而非解除文件链接
        pub const REMOVEDIR = 0x200;
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const FDCWD = -2;
        /// 在访问检查中使用有效标识符
        pub const EACCESS = 0x0010;
        /// 操作符号链接本身而非目标
        pub const SYMLINK_NOFOLLOW = 0x0020;
        /// 作用于符号链接的目标
        pub const SYMLINK_FOLLOW = 0x0040;
        /// 路径指向目录
        pub const REMOVEDIR = 0x0080;
    },
    .freebsd => struct {
        /// 指定在 openat() 及类似系统调用中使用当前工作目录来确定相对文件路径目标的特殊值。
        ///
        ///
        pub const FDCWD = -100;
        /// 使用有效用户 ID 及组 ID 检查访问权限。
        pub const EACCESS = 0x0100;
        /// 不跟随符号链接
        pub const SYMLINK_NOFOLLOW = 0x0200;
        /// 跟随符号链接
        pub const SYMLINK_FOLLOW = 0x0400;
        /// 移除目录,而非文件
        pub const REMOVEDIR = 0x0800;
        /// 不位于 dirfd 下时失败
        pub const BENEATH = 0x1000;
    },
    .netbsd => struct {
        /// 指定在 openat() 及类似系统调用中使用当前工作目录来确定相对文件路径目标的特殊值。
        ///
        ///
        pub const FDCWD = -100;
        /// 使用有效用户 ID 及组 ID 检查访问权限。
        pub const EACCESS = 0x0100;
        /// 不跟随符号链接
        pub const SYMLINK_NOFOLLOW = 0x0200;
        /// 跟随符号链接
        pub const SYMLINK_FOLLOW = 0x0400;
        /// 移除目录,而非文件
        pub const REMOVEDIR = 0x0800;
    },
    .dragonfly => struct {
        pub const FDCWD = -328243;
        pub const SYMLINK_NOFOLLOW = 1;
        pub const REMOVEDIR = 2;
        pub const EACCESS = 4;
        pub const SYMLINK_FOLLOW = 8;
    },
    .openbsd => struct {
        /// 指定在 openat() 及类似系统调用中使用当前工作目录来确定相对文件路径目标的特殊值。
        ///
        ///
        pub const FDCWD = -100;
        /// 使用有效用户 ID 及组 ID 检查访问权限。
        pub const EACCESS = 0x01;
        /// 不跟随符号链接
        pub const SYMLINK_NOFOLLOW = 0x02;
        /// 跟随符号链接
        pub const SYMLINK_FOLLOW = 0x04;
        /// 移除目录,而非文件
        pub const REMOVEDIR = 0x08;
    },
    .haiku => struct {
        pub const FDCWD = -1;
        pub const SYMLINK_NOFOLLOW = 0x01;
        pub const SYMLINK_FOLLOW = 0x02;
        pub const REMOVEDIR = 0x04;
        pub const EACCESS = 0x08;
    },
    .illumos => struct {
        /// 指定在 openat() 及类似系统调用中使用当前工作目录来确定相对文件路径目标的特殊值。
        ///
        ///
        pub const FDCWD: fd_t = @bitCast(@as(u32, 0xffd19553));
        /// 不跟随符号链接
        pub const SYMLINK_NOFOLLOW = 0x1000;
        /// 跟随符号链接
        pub const SYMLINK_FOLLOW = 0x2000;
        /// 移除目录,而非文件
        pub const REMOVEDIR = 0x1;
        pub const TRIGGER = 0x2;
        /// 使用有效用户 ID 及组 ID 检查访问权限。
        pub const EACCESS = 0x4;
    },
    .emscripten => struct {
        pub const FDCWD = -100;
        pub const SYMLINK_NOFOLLOW = 0x100;
        pub const REMOVEDIR = 0x200;
        pub const SYMLINK_FOLLOW = 0x400;
        pub const NO_AUTOMOUNT = 0x800;
        pub const EMPTY_PATH = 0x1000;
        pub const STATX_SYNC_TYPE = 0x6000;
        pub const STATX_SYNC_AS_STAT = 0x0000;
        pub const STATX_FORCE_SYNC = 0x2000;
        pub const STATX_DONT_SYNC = 0x4000;
        pub const RECURSIVE = 0x8000;
    },
    .wasi => struct {
        // 匹配 lib/libc/include/wasm-wasi-musl/__header_fcntl.h 中的 `AT_*` 常量
        pub const EACCESS = 0x0;
        pub const SYMLINK_NOFOLLOW = 0x1;
        pub const SYMLINK_FOLLOW = 0x2;
        pub const REMOVEDIR = 0x4;
        /// 链接 libc 时,遵循其约定,以 -2 表示当前工作目录。
        /// 不链接 libc 时,Zig 采用不同约定:假定
        /// 当前工作目录是第一个预打开目录。可以通过
        /// 根源码文件中名为 `wasi_cwd` 的公开函数
        /// 覆盖此行为。
        pub const FDCWD: fd_t = if (builtin.link_libc) -2 else 3;
    },
    // https://github.com/SerenityOS/serenity/blob/2808b0376406a40e31293bb3bcb9170374e90506/Kernel/API/POSIX/fcntl.h#L49-L52
    .serenity => struct {
        pub const FDCWD = -100;
        pub const SYMLINK_NOFOLLOW = 0x100;
        pub const REMOVEDIR = 0x200;
        pub const EACCESS = 0x400;
    },
    else => void,
};

pub const O = switch (native_os) {
    .linux => linux.O,
    .emscripten => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        _2: u4 = 0,
        CREAT: bool = false,
        EXCL: bool = false,
        NOCTTY: bool = false,
        TRUNC: bool = false,
        APPEND: bool = false,
        NONBLOCK: bool = false,
        DSYNC: bool = false,
        ASYNC: bool = false,
        DIRECT: bool = false,
        LARGEFILE: bool = false,
        DIRECTORY: bool = false,
        NOFOLLOW: bool = false,
        NOATIME: bool = false,
        CLOEXEC: bool = false,
        SYNC: bool = false,
        PATH: bool = false,
        /// 通常必须同时设置 `DIRECTORY`,否则无效。
        TMPFILE: bool = false,
        _: u9 = 0,
    },
    .wasi => packed struct(u32) {
        // 与 lib/libc/include/wasm-wasi-musl/__header_fcntl.h 中的 `O_*` 位一致。
        APPEND: bool = false,
        DSYNC: bool = false,
        NONBLOCK: bool = false,
        RSYNC: bool = false,
        SYNC: bool = false,
        _5: u7 = 0,
        CREAT: bool = false,
        DIRECTORY: bool = false,
        EXCL: bool = false,
        TRUNC: bool = false,
        _16: u8 = 0,
        NOFOLLOW: bool = false,
        EXEC: bool = false,
        read: bool = false,
        SEARCH: bool = false,
        write: bool = false,
        // O_CLOEXEC、O_TTY_ININT、O_NOCTTY 在 wasi-musl 中均为 0,因此在 C 代码中被静默忽略,Zig 也无需映射。
        //
        _: u3 = 0,
    },
    .illumos => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NDELAY: bool = false,
        APPEND: bool = false,
        SYNC: bool = false,
        _5: u1 = 0,
        DSYNC: bool = false,
        NONBLOCK: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        NOCTTY: bool = false,
        _12: u1 = 0,
        LARGEFILE: bool = false,
        XATTR: bool = false,
        RSYNC: bool = false,
        _16: u1 = 0,
        NOFOLLOW: bool = false,
        NOLINKS: bool = false,
        _19: u2 = 0,
        SEARCH: bool = false,
        EXEC: bool = false,
        CLOEXEC: bool = false,
        DIRECTORY: bool = false,
        DIRECT: bool = false,
        _: u6 = 0,
    },
    .netbsd => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NONBLOCK: bool = false,
        APPEND: bool = false,
        SHLOCK: bool = false,
        EXLOCK: bool = false,
        ASYNC: bool = false,
        SYNC: bool = false,
        NOFOLLOW: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        _12: u3 = 0,
        NOCTTY: bool = false,
        DSYNC: bool = false,
        RSYNC: bool = false,
        ALT_IO: bool = false,
        DIRECT: bool = false,
        _20: u1 = 0,
        DIRECTORY: bool = false,
        CLOEXEC: bool = false,
        SEARCH: bool = false,
        _: u8 = 0,
    },
    .openbsd => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NONBLOCK: bool = false,
        APPEND: bool = false,
        SHLOCK: bool = false,
        EXLOCK: bool = false,
        ASYNC: bool = false,
        SYNC: bool = false,
        NOFOLLOW: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        _12: u3 = 0,
        NOCTTY: bool = false,
        CLOEXEC: bool = false,
        DIRECTORY: bool = false,
        _: u14 = 0,
    },
    .haiku => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        _2: u4 = 0,
        CLOEXEC: bool = false,
        NONBLOCK: bool = false,
        EXCL: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        APPEND: bool = false,
        NOCTTY: bool = false,
        NOTRAVERSE: bool = false,
        _14: u2 = 0,
        SYNC: bool = false,
        RSYNC: bool = false,
        DSYNC: bool = false,
        NOFOLLOW: bool = false,
        DIRECT: bool = false,
        DIRECTORY: bool = false,
        _: u10 = 0,
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NONBLOCK: bool = false,
        APPEND: bool = false,
        SHLOCK: bool = false,
        EXLOCK: bool = false,
        ASYNC: bool = false,
        SYNC: bool = false,
        NOFOLLOW: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        RESOLVE_BENEATH: bool = false,
        _13: u2 = 0,
        EVTONLY: bool = false,
        _16: u1 = 0,
        NOCTTY: bool = false,
        _18: u2 = 0,
        DIRECTORY: bool = false,
        SYMLINK: bool = false,
        DSYNC: bool = false,
        _23: u1 = 0,
        CLOEXEC: bool = false,
        _25: u4 = 0,
        ALERT: bool = false,
        _30: u1 = 0,
        POPUP: bool = false,
    },
    .dragonfly => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NONBLOCK: bool = false,
        APPEND: bool = false,
        SHLOCK: bool = false,
        EXLOCK: bool = false,
        ASYNC: bool = false,
        SYNC: bool = false,
        NOFOLLOW: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        _12: u3 = 0,
        NOCTTY: bool = false,
        DIRECT: bool = false,
        CLOEXEC: bool = false,
        FBLOCKING: bool = false,
        FNONBLOCKING: bool = false,
        FAPPEND: bool = false,
        FOFFSET: bool = false,
        FSYNCWRITE: bool = false,
        FASYNCWRITE: bool = false,
        _24: u3 = 0,
        DIRECTORY: bool = false,
        _: u4 = 0,
    },
    .freebsd => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NONBLOCK: bool = false,
        APPEND: bool = false,
        SHLOCK: bool = false,
        EXLOCK: bool = false,
        ASYNC: bool = false,
        SYNC: bool = false,
        NOFOLLOW: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        _12: u3 = 0,
        NOCTTY: bool = false,
        DIRECT: bool = false,
        DIRECTORY: bool = false,
        EXEC: bool = false,
        TTY_INIT: bool = false,
        CLOEXEC: bool = false,
        VERIFY: bool = false,
        PATH: bool = false,
        RESOLVE_BENEATH: bool = false,
        DSYNC: bool = false,
        EMPTY_PATH: bool = false,
        XATTR: bool = false,
        CLOFORK: bool = false,
        _28: u4 = 0,
    },
    // https://github.com/SerenityOS/serenity/blob/2808b0376406a40e31293bb3bcb9170374e90506/Kernel/API/POSIX/fcntl.h#L28-L43
    .serenity => packed struct(c_int) {
        ACCMODE: std.posix.ACCMODE = .NONE,
        EXEC: bool = false,
        CREAT: bool = false,
        EXCL: bool = false,
        NOCTTY: bool = false,
        TRUNC: bool = false,
        APPEND: bool = false,
        NONBLOCK: bool = false,
        DIRECTORY: bool = false,
        NOFOLLOW: bool = false,
        CLOEXEC: bool = false,
        DIRECT: bool = false,
        SYNC: bool = false,
        _: @Int(.unsigned, @bitSizeOf(c_int) - 14) = 0,
    },
    else => void,
};

pub const EXECVEAT = switch (native_os) {
    .linux => linux.EXECVEAT,
    else => void,
};

pub const MAP = switch (native_os) {
    .linux => linux.MAP,
    .emscripten => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
            SHARED_VALIDATE = 0x03,
        },
        FIXED: bool = false,
        ANONYMOUS: bool = false,
        _6: u2 = 0,
        GROWSDOWN: bool = false,
        _9: u2 = 0,
        DENYWRITE: bool = false,
        EXECUTABLE: bool = false,
        LOCKED: bool = false,
        NORESERVE: bool = false,
        POPULATE: bool = false,
        NONBLOCK: bool = false,
        STACK: bool = false,
        HUGETLB: bool = false,
        SYNC: bool = false,
        FIXED_NOREPLACE: bool = false,
        _: u11 = 0,
    },
    .illumos => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        RENAME: bool = false,
        NORESERVE: bool = false,
        @"32BIT": bool = false,
        ANONYMOUS: bool = false,
        ALIGN: bool = false,
        TEXT: bool = false,
        INITDATA: bool = false,
        _: u20 = 0,
    },
    .netbsd => packed struct(u32) {
        TYPE: enum(u2) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        REMAPDUP: bool = false,
        _3: u1 = 0,
        FIXED: bool = false,
        RENAME: bool = false,
        NORESERVE: bool = false,
        INHERIT: bool = false,
        _8: u1 = 0,
        HASSEMAPHORE: bool = false,
        TRYFIXED: bool = false,
        WIRED: bool = false,
        ANONYMOUS: bool = false,
        STACK: bool = false,
        _: u18 = 0,
    },
    .openbsd => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        _5: u7 = 0,
        ANONYMOUS: bool = false,
        _13: u1 = 0,
        STACK: bool = false,
        CONCEAL: bool = false,
        _: u16 = 0,
    },
    .haiku => packed struct(u32) {
        TYPE: enum(u2) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        ANONYMOUS: bool = false,
        NORESERVE: bool = false,
        _: u27 = 0,
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        _5: u1 = 0,
        NORESERVE: bool = false,
        _7: u2 = 0,
        HASSEMAPHORE: bool = false,
        NOCACHE: bool = false,
        JIT: bool = false,
        ANONYMOUS: bool = false,
        _: u19 = 0,
    },
    .dragonfly => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        RENAME: bool = false,
        NORESERVE: bool = false,
        INHERIT: bool = false,
        NOEXTEND: bool = false,
        HASSEMAPHORE: bool = false,
        STACK: bool = false,
        NOSYNC: bool = false,
        ANONYMOUS: bool = false,
        VPAGETABLE: bool = false,
        _14: u2 = 0,
        TRYFIXED: bool = false,
        NOCORE: bool = false,
        SIZEALIGN: bool = false,
        _: u13 = 0,
    },
    .freebsd => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        _5: u5 = 0,
        STACK: bool = false,
        NOSYNC: bool = false,
        ANONYMOUS: bool = false,
        GUARD: bool = false,
        EXCL: bool = false,
        _15: u2 = 0,
        NOCORE: bool = false,
        PREFAULT_READ: bool = false,
        @"32BIT": bool = false,
        _: u12 = 0,
    },
    // https://github.com/SerenityOS/serenity/blob/6d59d4d3d9e76e39112842ec487840828f1c9bfe/Kernel/API/POSIX/sys/mman.h#L16-L26
    .serenity => packed struct(c_int) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        ANONYMOUS: bool = false,
        STACK: bool = false,
        NORESERVE: bool = false,
        RANDOMIZED: bool = false,
        PURGEABLE: bool = false,
        FIXED_NOREPLACE: bool = false,
        _: @Int(.unsigned, @bitSizeOf(c_int) - 11) = 0,
    },
    else => void,
};

pub const MREMAP = switch (native_os) {
    .linux => linux.MREMAP,
    else => void,
};

/// 由 libc 用于传达失败。实际上不是底层系统调用的一部分。
pub const MAP_FAILED: *anyopaque = @ptrFromInt(maxInt(usize));

pub const cc_t = u8;

/// `termios` 结构体中 `cc` 数组的索引。
pub const V = switch (native_os) {
    .linux => linux.V,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .netbsd, .openbsd => enum {
        EOF,
        EOL,
        EOL2,
        ERASE,
        WERASE,
        KILL,
        REPRINT,
        reserved,
        INTR,
        QUIT,
        SUSP,
        DSUSP,
        START,
        STOP,
        LNEXT,
        DISCARD,
        MIN,
        TIME,
        STATUS,
    },
    .freebsd => enum {
        EOF,
        EOL,
        EOL2,
        ERASE,
        WERASE,
        KILL,
        REPRINT,
        ERASE2,
        INTR,
        QUIT,
        SUSP,
        DSUSP,
        START,
        STOP,
        LNEXT,
        DISCARD,
        MIN,
        TIME,
        STATUS,
    },
    .haiku => enum {
        INTR,
        QUIT,
        ERASE,
        KILL,
        EOF,
        EOL,
        EOL2,
        SWTCH,
        START,
        STOP,
        SUSP,
    },
    .illumos => enum {
        INTR,
        QUIT,
        ERASE,
        KILL,
        EOF,
        EOL,
        EOL2,
        SWTCH,
        START,
        STOP,
        SUSP,
        DSUSP,
        REPRINT,
        DISCARD,
        WERASE,
        LNEXT,
        STATUS,
        ERASE2,
    },
    .emscripten, .wasi => enum {
        INTR,
        QUIT,
        ERASE,
        KILL,
        EOF,
        TIME,
        MIN,
        SWTC,
        START,
        STOP,
        SUSP,
        EOL,
        REPRINT,
        DISCARD,
        WERASE,
        LNEXT,
        EOL2,
    },
    // https://github.com/SerenityOS/serenity/blob/d277cdfd4c7ed21d5248a83217ae03b9f890c3c8/Kernel/API/POSIX/termios.h#L32-L49
    .serenity => enum {
        INTR,
        QUIT,
        ERASE,
        KILL,
        EOF,
        TIME,
        MIN,
        SWTC,
        START,
        STOP,
        SUSP,
        EOL,
        REPRINT,
        DISCARD,
        WERASE,
        LNEXT,
        EOL2,
        INFO,
    },
    else => void,
};

pub const NCCS = switch (native_os) {
    .linux => linux.NCCS,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .freebsd, .netbsd, .openbsd, .dragonfly => 20,
    .haiku => 11,
    .illumos => 19,
    // https://github.com/SerenityOS/serenity/blob/d277cdfd4c7ed21d5248a83217ae03b9f890c3c8/Kernel/API/POSIX/termios.h#L15
    .emscripten, .wasi, .serenity => 32,
    else => void,
};

pub const termios = switch (native_os) {
    .linux => linux.termios,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        iflag: tc_iflag_t,
        oflag: tc_oflag_t,
        cflag: tc_cflag_t,
        lflag: tc_lflag_t,
        cc: [NCCS]cc_t,
        ispeed: speed_t align(8),
        ospeed: speed_t,
    },
    // https://github.com/SerenityOS/serenity/blob/d277cdfd4c7ed21d5248a83217ae03b9f890c3c8/Kernel/API/POSIX/termios.h#L21-L29
    .freebsd, .netbsd, .dragonfly, .openbsd, .serenity => extern struct {
        iflag: tc_iflag_t,
        oflag: tc_oflag_t,
        cflag: tc_cflag_t,
        lflag: tc_lflag_t,
        cc: [NCCS]cc_t,
        ispeed: speed_t,
        ospeed: speed_t,
    },
    .haiku => extern struct {
        iflag: tc_iflag_t,
        oflag: tc_oflag_t,
        cflag: tc_cflag_t,
        lflag: tc_lflag_t,
        line: cc_t,
        ispeed: speed_t,
        ospeed: speed_t,
        cc: [NCCS]cc_t,
    },
    .illumos => extern struct {
        iflag: tc_iflag_t,
        oflag: tc_oflag_t,
        cflag: tc_cflag_t,
        lflag: tc_lflag_t,
        cc: [NCCS]cc_t,
    },
    .emscripten, .wasi => extern struct {
        iflag: tc_iflag_t,
        oflag: tc_oflag_t,
        cflag: tc_cflag_t,
        lflag: tc_lflag_t,
        line: cc_t,
        cc: [NCCS]cc_t,
        ispeed: speed_t,
        ospeed: speed_t,
    },
    else => void,
};

pub const tc_iflag_t = switch (native_os) {
    .linux => linux.tc_iflag_t,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => packed struct(u64) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IXON: bool = false,
        IXOFF: bool = false,
        IXANY: bool = false,
        _12: u1 = 0,
        IMAXBEL: bool = false,
        IUTF8: bool = false,
        _: u49 = 0,
    },
    .netbsd, .freebsd, .dragonfly => packed struct(u32) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IXON: bool = false,
        IXOFF: bool = false,
        IXANY: bool = false,
        _12: u1 = 0,
        IMAXBEL: bool = false,
        _: u18 = 0,
    },
    .openbsd => packed struct(u32) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IXON: bool = false,
        IXOFF: bool = false,
        IXANY: bool = false,
        IUCLC: bool = false,
        IMAXBEL: bool = false,
        _: u18 = 0,
    },
    .haiku => packed struct(u32) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IUCLC: bool = false,
        IXON: bool = false,
        IXANY: bool = false,
        IXOFF: bool = false,
        _: u19 = 0,
    },
    .illumos => packed struct(u32) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IUCLC: bool = false,
        IXON: bool = false,
        IXANY: bool = false,
        _12: u1 = 0,
        IMAXBEL: bool = false,
        _14: u1 = 0,
        DOSMODE: bool = false,
        _: u16 = 0,
    },
    // https://github.com/SerenityOS/serenity/blob/d277cdfd4c7ed21d5248a83217ae03b9f890c3c8/Kernel/API/POSIX/termios.h#L52-L66
    .emscripten, .wasi, .serenity => packed struct(u32) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IUCLC: bool = false,
        IXON: bool = false,
        IXANY: bool = false,
        IXOFF: bool = false,
        IMAXBEL: bool = false,
        IUTF8: bool = false,
        _: u17 = 0,
    },
    else => void,
};

pub const tc_oflag_t = switch (native_os) {
    .linux => linux.tc_oflag_t,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => packed struct(u64) {
        OPOST: bool = false,
        ONLCR: bool = false,
        OXTABS: bool = false,
        ONOEOT: bool = false,
        OCRNL: bool = false,
        ONOCR: bool = false,
        ONLRET: bool = false,
        OFILL: bool = false,
        NLDLY: u2 = 0,
        TABDLY: u2 = 0,
        CRDLY: u2 = 0,
        FFDLY: u1 = 0,
        BSDLY: u1 = 0,
        VTDLY: u1 = 0,
        OFDEL: bool = false,
        _: u46 = 0,
    },
    .netbsd => packed struct(u32) {
        OPOST: bool = false,
        ONLCR: bool = false,
        OXTABS: bool = false,
        ONOEOT: bool = false,
        OCRNL: bool = false,
        _5: u1 = 0,
        ONOCR: bool = false,
        ONLRET: bool = false,
        _: u24 = 0,
    },
    .openbsd => packed struct(u32) {
        OPOST: bool = false,
        ONLCR: bool = false,
        OXTABS: bool = false,
        ONOEOT: bool = false,
        OCRNL: bool = false,
        OLCUC: bool = false,
        ONOCR: bool = false,
        ONLRET: bool = false,
        _: u24 = 0,
    },
    .freebsd, .dragonfly => packed struct(u32) {
        OPOST: bool = false,
        ONLCR: bool = false,
        _2: u1 = 0,
        ONOEOT: bool = false,
        OCRNL: bool = false,
        ONOCR: bool = false,
        ONLRET: bool = false,
        _: u25 = 0,
    },
    .illumos => packed struct(u32) {
        OPOST: bool = false,
        OLCUC: bool = false,
        ONLCR: bool = false,
        OCRNL: bool = false,
        ONOCR: bool = false,
        ONLRET: bool = false,
        OFILL: bool = false,
        OFDEL: bool = false,
        NLDLY: u1 = 0,
        CRDLY: u2 = 0,
        TABDLY: u2 = 0,
        BSDLY: u1 = 0,
        VTDLY: u1 = 0,
        FFDLY: u1 = 0,
        PAGEOUT: bool = false,
        WRAP: bool = false,
        _: u14 = 0,
    },
    // https://github.com/SerenityOS/serenity/blob/d277cdfd4c7ed21d5248a83217ae03b9f890c3c8/Kernel/API/POSIX/termios.h#L69-L97
    .haiku, .wasi, .emscripten, .serenity => packed struct(u32) {
        OPOST: bool = false,
        OLCUC: bool = false,
        ONLCR: bool = false,
        OCRNL: bool = false,
        ONOCR: bool = false,
        ONLRET: bool = false,
        OFILL: bool = false,
        OFDEL: bool = false,
        NLDLY: u1 = 0,
        CRDLY: u2 = 0,
        TABDLY: u2 = 0,
        BSDLY: u1 = 0,
        VTDLY: u1 = 0,
        FFDLY: u1 = 0,
        _: u16 = 0,
    },
    else => void,
};

pub const CSIZE = switch (native_os) {
    .linux => linux.CSIZE,
    .haiku => enum(u1) { CS7, CS8 },
    else => enum(u2) { CS5, CS6, CS7, CS8 },
};

pub const tc_cflag_t = switch (native_os) {
    .linux => linux.tc_cflag_t,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => packed struct(u64) {
        CIGNORE: bool = false,
        _1: u5 = 0,
        CSTOPB: bool = false,
        _7: u1 = 0,
        CSIZE: CSIZE = .CS5,
        _10: u1 = 0,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        CCTS_OFLOW: bool = false,
        CRTS_IFLOW: bool = false,
        CDTR_IFLOW: bool = false,
        CDSR_OFLOW: bool = false,
        CCAR_OFLOW: bool = false,
        _: u43 = 0,
    },
    .freebsd => packed struct(u32) {
        CIGNORE: bool = false,
        _1: u7 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        CCTS_OFLOW: bool = false,
        CRTS_IFLOW: bool = false,
        CDTR_IFLOW: bool = false,
        CDSR_OFLOW: bool = false,
        CCAR_OFLOW: bool = false,
        CNO_RTSDTR: bool = false,
        _: u10 = 0,
    },
    .netbsd => packed struct(u32) {
        CIGNORE: bool = false,
        _1: u7 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        CRTSCTS: bool = false,
        CDTRCTS: bool = false,
        _18: u2 = 0,
        MDMBUF: bool = false,
        _: u11 = 0,
    },
    .dragonfly => packed struct(u32) {
        CIGNORE: bool = false,
        _1: u7 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        CCTS_OFLOW: bool = false,
        CRTS_IFLOW: bool = false,
        CDTR_IFLOW: bool = false,
        CDSR_OFLOW: bool = false,
        CCAR_OFLOW: bool = false,
        _: u11 = 0,
    },
    .openbsd => packed struct(u32) {
        CIGNORE: bool = false,
        _1: u7 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        CRTSCTS: bool = false,
        _17: u3 = 0,
        MDMBUF: bool = false,
        _: u11 = 0,
    },
    .haiku => packed struct(u32) {
        _0: u5 = 0,
        CSIZE: CSIZE = .CS7,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        XLOBLK: bool = false,
        CTSFLOW: bool = false,
        RTSFLOW: bool = false,
        _: u17 = 0,
    },
    .illumos => packed struct(u32) {
        _0: u4 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        RCV1EN: bool = false,
        XMT1EN: bool = false,
        LOBLK: bool = false,
        XCLUDE: bool = false,
        _16: u4 = 0,
        PAREXT: bool = false,
        CBAUDEXT: bool = false,
        CIBAUDEXT: bool = false,
        _23: u7 = 0,
        CRTSXOFF: bool = false,
        CRTSCTS: bool = false,
    },
    .wasi, .emscripten => packed struct(u32) {
        _0: u4 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        _: u20 = 0,
    },
    // https://github.com/SerenityOS/serenity/blob/d277cdfd4c7ed21d5248a83217ae03b9f890c3c8/Kernel/API/POSIX/termios.h#L131-L141
    .serenity => packed struct(u32) {
        _0: u4 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        CBAUDEX: bool = false,
        _: u19 = 0,
    },
    else => void,
};

pub const tc_lflag_t = switch (native_os) {
    .linux => linux.tc_lflag_t,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => packed struct(u64) {
        ECHOKE: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHO: bool = false,
        ECHONL: bool = false,
        ECHOPRT: bool = false,
        ECHOCTL: bool = false,
        ISIG: bool = false,
        ICANON: bool = false,
        ALTWERASE: bool = false,
        IEXTEN: bool = false,
        EXTPROC: bool = false,
        _12: u10 = 0,
        TOSTOP: bool = false,
        FLUSHO: bool = false,
        _24: u1 = 0,
        NOKERNINFO: bool = false,
        _26: u3 = 0,
        PENDIN: bool = false,
        _30: u1 = 0,
        NOFLSH: bool = false,
        _: u32 = 0,
    },
    .netbsd, .freebsd, .dragonfly => packed struct(u32) {
        ECHOKE: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHO: bool = false,
        ECHONL: bool = false,
        ECHOPRT: bool = false,
        ECHOCTL: bool = false,
        ISIG: bool = false,
        ICANON: bool = false,
        ALTWERASE: bool = false,
        IEXTEN: bool = false,
        EXTPROC: bool = false,
        _12: u10 = 0,
        TOSTOP: bool = false,
        FLUSHO: bool = false,
        _24: u1 = 0,
        NOKERNINFO: bool = false,
        _26: u3 = 0,
        PENDIN: bool = false,
        _30: u1 = 0,
        NOFLSH: bool = false,
    },
    .openbsd => packed struct(u32) {
        ECHOKE: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHO: bool = false,
        ECHONL: bool = false,
        ECHOPRT: bool = false,
        ECHOCTL: bool = false,
        ISIG: bool = false,
        ICANON: bool = false,
        ALTWERASE: bool = false,
        IEXTEN: bool = false,
        EXTPROC: bool = false,
        _12: u10 = 0,
        TOSTOP: bool = false,
        FLUSHO: bool = false,
        XCASE: bool = false,
        NOKERNINFO: bool = false,
        _26: u3 = 0,
        PENDIN: bool = false,
        _30: u1 = 0,
        NOFLSH: bool = false,
    },
    .haiku => packed struct(u32) {
        ISIG: bool = false,
        ICANON: bool = false,
        XCASE: bool = false,
        ECHO: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHONL: bool = false,
        NOFLSH: bool = false,
        TOSTOP: bool = false,
        IEXTEN: bool = false,
        ECHOCTL: bool = false,
        ECHOPRT: bool = false,
        ECHOKE: bool = false,
        FLUSHO: bool = false,
        PENDIN: bool = false,
        _: u17 = 0,
    },
    .illumos => packed struct(u32) {
        ISIG: bool = false,
        ICANON: bool = false,
        XCASE: bool = false,
        ECHO: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHONL: bool = false,
        NOFLSH: bool = false,
        TOSTOP: bool = false,
        ECHOCTL: bool = false,
        ECHOPRT: bool = false,
        ECHOKE: bool = false,
        DEFECHO: bool = false,
        FLUSHO: bool = false,
        PENDIN: bool = false,
        IEXTEN: bool = false,
        _: u16 = 0,
    },
    .wasi, .emscripten => packed struct(u32) {
        ISIG: bool = false,
        ICANON: bool = false,
        _2: u1 = 0,
        ECHO: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHONL: bool = false,
        NOFLSH: bool = false,
        TOSTOP: bool = false,
        _9: u6 = 0,
        IEXTEN: bool = false,
        _: u16 = 0,
    },
    // https://github.com/SerenityOS/serenity/blob/d277cdfd4c7ed21d5248a83217ae03b9f890c3c8/Kernel/API/POSIX/termios.h#L168-L189
    .serenity => packed struct(u32) {
        ISIG: bool = false,
        ICANON: bool = false,
        XCASE: bool = false,
        ECHO: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHONL: bool = false,
        NOFLSH: bool = false,
        TOSTOP: bool = false,
        ECHOCTL: bool = false,
        ECHOPRT: bool = false,
        ECHOKE: bool = false,
        FLUSHO: bool = false,
        _13: u1 = 0,
        PENDIN: bool = false,
        IEXTEN: bool = false,
        EXTPROC: bool = false,
        _: u15 = 0,
    },
    else => void,
};

pub const speed_t = switch (native_os) {
    .linux => linux.speed_t,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .openbsd => enum(u64) {
        B0 = 0,
        B50 = 50,
        B75 = 75,
        B110 = 110,
        B134 = 134,
        B150 = 150,
        B200 = 200,
        B300 = 300,
        B600 = 600,
        B1200 = 1200,
        B1800 = 1800,
        B2400 = 2400,
        B4800 = 4800,
        B9600 = 9600,
        B19200 = 19200,
        B38400 = 38400,
        B7200 = 7200,
        B14400 = 14400,
        B28800 = 28800,
        B57600 = 57600,
        B76800 = 76800,
        B115200 = 115200,
        B230400 = 230400,
    },
    .freebsd, .netbsd => enum(c_uint) {
        B0 = 0,
        B50 = 50,
        B75 = 75,
        B110 = 110,
        B134 = 134,
        B150 = 150,
        B200 = 200,
        B300 = 300,
        B600 = 600,
        B1200 = 1200,
        B1800 = 1800,
        B2400 = 2400,
        B4800 = 4800,
        B9600 = 9600,
        B19200 = 19200,
        B38400 = 38400,
        B7200 = 7200,
        B14400 = 14400,
        B28800 = 28800,
        B57600 = 57600,
        B76800 = 76800,
        B115200 = 115200,
        B230400 = 230400,
        B460800 = 460800,
        B500000 = 500000,
        B921600 = 921600,
        B1000000 = 1000000,
        B1500000 = 1500000,
        B2000000 = 2000000,
        B2500000 = 2500000,
        B3000000 = 3000000,
        B3500000 = 3500000,
        B4000000 = 4000000,
    },
    .dragonfly => enum(c_uint) {
        B0 = 0,
        B50 = 50,
        B75 = 75,
        B110 = 110,
        B134 = 134,
        B150 = 150,
        B200 = 200,
        B300 = 300,
        B600 = 600,
        B1200 = 1200,
        B1800 = 1800,
        B2400 = 2400,
        B4800 = 4800,
        B9600 = 9600,
        B19200 = 19200,
        B38400 = 38400,
        B7200 = 7200,
        B14400 = 14400,
        B28800 = 28800,
        B57600 = 57600,
        B76800 = 76800,
        B115200 = 115200,
        B230400 = 230400,
        B460800 = 460800,
        B921600 = 921600,
    },
    .haiku => enum(u8) {
        B0 = 0x00,
        B50 = 0x01,
        B75 = 0x02,
        B110 = 0x03,
        B134 = 0x04,
        B150 = 0x05,
        B200 = 0x06,
        B300 = 0x07,
        B600 = 0x08,
        B1200 = 0x09,
        B1800 = 0x0A,
        B2400 = 0x0B,
        B4800 = 0x0C,
        B9600 = 0x0D,
        B19200 = 0x0E,
        B38400 = 0x0F,
        B57600 = 0x10,
        B115200 = 0x11,
        B230400 = 0x12,
        B31250 = 0x13,
    },
    .illumos => enum(c_uint) {
        B0 = 0,
        B50 = 1,
        B75 = 2,
        B110 = 3,
        B134 = 4,
        B150 = 5,
        B200 = 6,
        B300 = 7,
        B600 = 8,
        B1200 = 9,
        B1800 = 10,
        B2400 = 11,
        B4800 = 12,
        B9600 = 13,
        B19200 = 14,
        B38400 = 15,
        B57600 = 16,
        B76800 = 17,
        B115200 = 18,
        B153600 = 19,
        B230400 = 20,
        B307200 = 21,
        B460800 = 22,
        B921600 = 23,
        B1000000 = 24,
        B1152000 = 25,
        B1500000 = 26,
        B2000000 = 27,
        B2500000 = 28,
        B3000000 = 29,
        B3500000 = 30,
        B4000000 = 31,
    },
    // https://github.com/SerenityOS/serenity/blob/d277cdfd4c7ed21d5248a83217ae03b9f890c3c8/Kernel/API/POSIX/termios.h#L111-L159
    .emscripten, .wasi, .serenity => enum(u32) {
        B0 = 0o0000000,
        B50 = 0o0000001,
        B75 = 0o0000002,
        B110 = 0o0000003,
        B134 = 0o0000004,
        B150 = 0o0000005,
        B200 = 0o0000006,
        B300 = 0o0000007,
        B600 = 0o0000010,
        B1200 = 0o0000011,
        B1800 = 0o0000012,
        B2400 = 0o0000013,
        B4800 = 0o0000014,
        B9600 = 0o0000015,
        B19200 = 0o0000016,
        B38400 = 0o0000017,

        B57600 = 0o0010001,
        B115200 = 0o0010002,
        B230400 = 0o0010003,
        B460800 = 0o0010004,
        B500000 = 0o0010005,
        B576000 = 0o0010006,
        B921600 = 0o0010007,
        B1000000 = 0o0010010,
        B1152000 = 0o0010011,
        B1500000 = 0o0010012,
        B2000000 = 0o0010013,
        B2500000 = 0o0010014,
        B3000000 = 0o0010015,
        B3500000 = 0o0010016,
        B4000000 = 0o0010017,
    },
    else => void,
};

pub const whence_t = if (native_os == .wasi) std.os.wasi.whence_t else c_int;

pub const sig_atomic_t = switch (native_os) {
    // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L20
    .serenity => u32,
    else => c_int,
};

/// 最大信号编号 + 1
pub const NSIG = switch (native_os) {
    .linux => linux.NSIG,
    .windows => 23,
    .haiku => 65,
    .netbsd, .freebsd => 32,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => darwin.NSIG,
    .illumos => 75,
    // https://github.com/SerenityOS/serenity/blob/046c23f567a17758d762a33bdf04bacbfd088f9f/Kernel/API/POSIX/signal_numbers.h#L42
    .openbsd, .serenity => 33,
    .dragonfly => 64,
    else => {},
};

pub const MINSIGSTKSZ = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => 32768,
    .freebsd => switch (builtin.cpu.arch) {
        .powerpc64, .powerpc64le, .x86, .x86_64 => 2048,
        .arm, .aarch64, .riscv64 => 4096,
        else => @compileError("unsupported arch"),
    },
    .illumos => 2048,
    .haiku, .netbsd => 8192,
    .openbsd => 1 << openbsd.MAX_PAGE_SHIFT,
    // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L58
    .serenity => 4096,
    else => {},
};
pub const SIGSTKSZ = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => 131072,
    .netbsd, .freebsd => MINSIGSTKSZ + 32768,
    .illumos => 8192,
    .haiku => 16384,
    .openbsd => MINSIGSTKSZ + (1 << openbsd.MAX_PAGE_SHIFT) * 4,
    // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L59
    .serenity => 32768,
    else => {},
};
pub const SS = switch (native_os) {
    .linux => linux.SS,
    .openbsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .netbsd, .freebsd => struct {
        pub const ONSTACK = 1;
        pub const DISABLE = 4;
    },
    // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L54-L55
    .haiku, .illumos, .serenity => struct {
        pub const ONSTACK = 0x1;
        pub const DISABLE = 0x2;
    },
    else => void,
};

pub const EV = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        // https://github.com/apple-oss-distributions/xnu/blob/main/bsd/sys/event.h
        /// 将事件添加到 kq(隐含启用)
        pub const ADD = 0x0001;
        /// 从 kq 删除事件
        pub const DELETE = 0x0002;
        /// 启用事件
        pub const ENABLE = 0x0004;
        /// 禁用事件(不予报告)
        pub const DISABLE = 0x0008;
        /// 仅报告一次
        pub const ONESHOT = 0x0010;
        /// 报告后清除事件状态
        pub const CLEAR = 0x0020;
        /// 强制立即输出事件
        /// ……无论是否存在 ERROR
        /// ……对于支持标志的系统调用,
        ///     使用 KEVENT_FLAG_ERROR_EVENTS
        pub const RECEIPT = 0x0040;
        /// 报告后禁用事件
        pub const DISPATCH = 0x0080;
        /// 每个 udata 值对应唯一 kevent
        pub const UDATA_SPECIFIC = 0x0100;
        /// ……与 DELETE 组合使用时,会延迟删除,直到启用特定于 udata 的事件。
        /// 返回 EINPROGRESS 以表示延迟处理
        ///
        ///
        pub const DISPATCH2 = DISPATCH | UDATA_SPECIFIC;
        /// 报告源已消失
        /// ……仅与 DISPATCH2 配合时有效
        pub const VANISHED = 0x0200;
        /// 系统预留
        pub const SYSFLAGS = 0xF000;
        /// 筛选器专用标志
        pub const FLAG0 = 0x1000;
        /// 筛选器专用标志
        pub const FLAG1 = 0x2000;
        /// 检测到 EOF(返回值)
        pub const EOF = 0x8000;
        /// 发生错误,data 包含 errno(返回值)
        pub const ERROR = 0x4000;
        /// 对 EVFILT.READ 使用 poll(2) 语义
        pub const POLL = FLAG0;
        /// 输入时,描述符存在带外数据时过滤器应主动返回
        /// 输出时,表示描述符上存在带外数据
        pub const OOBAND = FLAG1;
    },
    .dragonfly => struct {
        pub const ADD = 1;
        pub const DELETE = 2;
        pub const ENABLE = 4;
        pub const DISABLE = 8;
        pub const ONESHOT = 16;
        pub const CLEAR = 32;
        pub const RECEIPT = 64;
        pub const DISPATCH = 128;
        pub const NODATA = 4096;
        pub const FLAG1 = 8192;
        pub const ERROR = 16384;
        pub const EOF = 32768;
        pub const SYSFLAGS = 61440;
    },
    .netbsd => struct {
        /// 将事件添加到 kq(隐含启用)
        pub const ADD = 0x0001;
        /// 从 kq 删除事件
        pub const DELETE = 0x0002;
        /// 启用事件
        pub const ENABLE = 0x0004;
        /// 禁用事件(不予报告)
        pub const DISABLE = 0x0008;
        /// 仅报告一次
        pub const ONESHOT = 0x0010;
        /// 报告后清除事件状态
        pub const CLEAR = 0x0020;
        /// 成功时强制 EV_ERROR,data=0
        pub const RECEIPT = 0x0040;
        /// 报告后禁用事件
        pub const DISPATCH = 0x0080;
        /// 筛选器专用标志
        pub const FLAG1 = 0x2000;
        /// 发生错误,data 包含 errno
        pub const ERROR = 0x4000;
        /// 检测到 EOF
        pub const EOF = 0x8000;
    },
    .freebsd => struct {
        // https://cgit.freebsd.org/src/tree/sys/sys/event.h
        /// 将事件添加到 kq(隐含启用)
        pub const ADD = 0x0001;
        /// 从 kq 删除事件
        pub const DELETE = 0x0002;
        /// 启用事件
        pub const ENABLE = 0x0004;
        /// 禁用事件(不予报告)
        pub const DISABLE = 0x0008;
        /// 启用 _ONESHOT 并强制触发
        pub const FORCEONESHOT = 0x0100;
        /// 不更新 udata 字段
        pub const KEEPUDATA = 0x0200;
        /// 仅报告一次
        pub const ONESHOT = 0x0010;
        /// 报告后清除事件状态
        pub const CLEAR = 0x0020;
        /// 强制立即输出事件
        /// ……无论是否存在 ERROR
        /// ……对于支持标志的系统调用,
        ///     使用 KEVENT_FLAG_ERROR_EVENTS
        pub const RECEIPT = 0x0040;
        /// 报告后禁用事件
        pub const DISPATCH = 0x0080;
        /// 系统预留
        pub const SYSFLAGS = 0xF000;
        /// 应丢弃备注
        pub const DROP = 0x1000;
        /// 过滤器专用标志 1
        pub const FLAG1 = 0x2000;
        /// 过滤器专用标志 2
        pub const FLAG2 = 0x4000;
        /// 检测到 EOF(返回值)
        pub const EOF = 0x8000;
        /// 发生错误时,事件数据包含 errno(返回值)
        pub const ERROR = 0x4000;
    },
    .openbsd => struct {
        pub const ADD = 0x0001;
        pub const DELETE = 0x0002;
        pub const ENABLE = 0x0004;
        pub const DISABLE = 0x0008;
        pub const ONESHOT = 0x0010;
        pub const CLEAR = 0x0020;
        pub const RECEIPT = 0x0040;
        pub const DISPATCH = 0x0080;
        pub const FLAG1 = 0x2000;
        pub const ERROR = 0x4000;
        pub const EOF = 0x8000;
    },
    .haiku => struct {
        /// 将事件添加到 kq(隐含启用)
        pub const ADD = 0x0001;
        /// 从 kq 删除事件
        pub const DELETE = 0x0002;
        /// 启用事件
        pub const ENABLE = 0x0004;
        /// 禁用事件(不予报告)
        pub const DISABLE = 0x0008;
        /// 仅报告一次
        pub const ONESHOT = 0x0010;
        /// 报告后清除事件状态
        pub const CLEAR = 0x0020;
        /// 强制立即输出事件
        /// ……无论是否存在 ERROR
        /// ……对于支持标志的系统调用,
        ///     使用 KEVENT_FLAG_ERROR_EVENTS
        pub const RECEIPT = 0x0040;
        /// 报告后禁用事件
        pub const DISPATCH = 0x0080;
    },
    else => void,
};

pub const EVFILT = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const READ = -1;
        pub const WRITE = -2;
        /// 已附加到 aio 请求
        pub const AIO = -3;
        /// 附加到 vnode
        pub const VNODE = -4;
        /// 附加到 struct proc
        pub const PROC = -5;
        /// 附加到 struct proc
        pub const SIGNAL = -6;
        /// 定时器
        pub const TIMER = -7;
        /// Mach 端口集合
        pub const MACHPORT = -8;
        /// 文件系统事件
        pub const FS = -9;
        /// 用户事件
        pub const USER = -10;
        /// 虚拟内存事件
        pub const VM = -12;
        /// 异常事件
        pub const EXCEPT = -15;
        pub const SYSCOUNT = 17;
    },
    .haiku => struct {
        pub const READ = -1;
        pub const WRITE = -2;
        /// 已附加到 aio 请求
        pub const AIO = -3;
        /// 附加到 vnode
        pub const VNODE = -4;
        /// 附加到 struct proc
        pub const PROC = -5;
        /// 附加到 struct proc
        pub const SIGNAL = -6;
        /// 定时器
        pub const TIMER = -7;
        /// 进程描述符
        pub const PROCDESC = -8;
        /// 文件系统事件
        pub const FS = -9;
        pub const LIO = -10;
        /// 用户事件
        pub const USER = -11;
        /// Sendfile 事件
        pub const SENDFILE = -12;
        pub const EMPTY = -13;
    },
    .dragonfly => struct {
        pub const FS = -10;
        pub const USER = -9;
        pub const EXCEPT = -8;
        pub const TIMER = -7;
        pub const SIGNAL = -6;
        pub const PROC = -5;
        pub const VNODE = -4;
        pub const AIO = -3;
        pub const WRITE = -2;
        pub const READ = -1;
        pub const SYSCOUNT = 10;
        pub const MARKER = 15;
    },
    .netbsd => struct {
        pub const READ = 0;
        pub const WRITE = 1;
        /// 已附加到 aio 请求
        pub const AIO = 2;
        /// 附加到 vnode
        pub const VNODE = 3;
        /// 附加到 struct proc
        pub const PROC = 4;
        /// 附加到 struct proc
        pub const SIGNAL = 5;
        /// 定时器
        pub const TIMER = 6;
        /// 文件系统事件
        pub const FS = 7;
        /// 用户事件
        pub const USER = 8;
        /// 空过滤器
        pub const EMPTY = 9;
    },
    .freebsd => struct {
        // https://cgit.freebsd.org/src/tree/sys/sys/event.h
        pub const READ = -1;
        pub const WRITE = -2;
        /// 已附加到 aio 请求
        pub const AIO = -3;
        /// 附加到 vnode
        pub const VNODE = -4;
        /// 附加到 struct proc
        pub const PROC = -5;
        /// 附加到 struct proc
        pub const SIGNAL = -6;
        /// 定时器
        pub const TIMER = -7;
        /// 进程描述符
        pub const PROCDESC = -8;
        /// 文件系统事件
        pub const FS = -9;
        /// 附加到 lio 请求
        pub const LIO = -10;
        /// 用户事件
        pub const USER = -11;
        /// Sendfile 事件
        pub const SENDFILE = -12;
        /// 清空发送套接字缓冲区
        pub const EMPTY = -13;
        /// 附加到 struct prison
        pub const JAIL = -14;
        /// 附加到 jail 描述符
        pub const JAILDESC = -15;
    },
    .openbsd => struct {
        pub const READ = -1;
        pub const WRITE = -2;
        pub const AIO = -3;
        pub const VNODE = -4;
        pub const PROC = -5;
        pub const SIGNAL = -6;
        pub const TIMER = -7;
        pub const DEVICE = -8;
        pub const EXCEPT = -9;
        pub const USER = -10;
    },
    else => void,
};

pub const NOTE = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        // https://github.com/apple-oss-distributions/xnu/blob/main/bsd/sys/event.h
        /// 输入时,TRIGGER 使事件被触发以供输出。
        pub const TRIGGER = 0x01000000;
        /// 忽略输入 fflags
        pub const FFNOP = 0x00000000;
        /// 与 fflags 按位与
        pub const FFAND = 0x40000000;
        /// 与 fflags 按位或
        pub const FFOR = 0x80000000;
        /// 复制 fflags
        pub const FFCOPY = 0xc0000000;
        /// 操作掩码
        pub const FFCTRLMASK = 0xc0000000;
        pub const FFLAGSMASK = 0x00ffffff;
        /// 低水位线
        pub const LOWAT = 0x00000001;
        /// 带外数据
        pub const OOB = 0x00000002;
        /// vnode 已移除
        pub const DELETE = 0x00000001;
        /// 数据内容已更改
        pub const WRITE = 0x00000002;
        /// 大小已增加
        pub const EXTEND = 0x00000004;
        /// 属性已更改
        pub const ATTRIB = 0x00000008;
        /// 链接计数已更改
        pub const LINK = 0x00000010;
        /// vnode 已重命名
        pub const RENAME = 0x00000020;
        /// vnode 访问权限已撤销
        pub const REVOKE = 0x00000040;
        /// 无特定 vnode 事件:用于测试 EVFILT_READ 激活。
        pub const NONE = 0x00000080;
        /// vnode 已被 flock(2) 解锁
        pub const FUNLOCK = 0x00000100;
        /// 进程已退出
        pub const EXIT = 0x80000000;
        /// 进程已派生
        pub const FORK = 0x40000000;
        /// 进程执行了 exec
        pub const EXEC = 0x20000000;
        /// 与 EVFILT_SIGNAL 共享
        pub const SIGNAL = 0x08000000;
        /// 要返回的退出状态,仅对子进程有效。
        pub const EXITSTATUS = 0x04000000;
        /// 提供退出原因的详细信息
        pub const EXIT_DETAIL = 0x02000000;
        /// 信号与退出状态的掩码
        pub const PDATAMASK = 0x000fffff;
        pub const PCTRLMASK = 0xf0000000;
        pub const EXIT_DETAIL_MASK = 0x00070000;
        pub const EXIT_DECRYPTFAIL = 0x00010000;
        pub const EXIT_MEMORY = 0x00020000;
        pub const EXIT_CSERROR = 0x00040000;
        /// 将对内存压力做出响应
        pub const VM_PRESSURE = 0x80000000;
        /// 出现内存压力时退出,可能先清理脏状态。
        pub const VM_PRESSURE_TERMINATE = 0x40000000;
        /// 内存压力出现时立即退出
        pub const VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000;
        /// 发生了错误
        pub const VM_ERROR = 0x10000000;
        /// data 的单位为秒
        pub const SECONDS = 0x00000001;
        /// data 的单位为微秒
        pub const USECONDS = 0x00000002;
        /// data 的单位为纳秒
        pub const NSECONDS = 0x00000004;
        /// 绝对超时时间
        pub const ABSOLUTE = 0x00000008;
        /// ext[1] 保存节能定时器允许的偏差
        pub const LEEWAY = 0x00000010;
        /// 系统仅进行最少量的定时器合并
        pub const CRITICAL = 0x00000020;
        /// 系统执行最大程度的定时器合并
        pub const BACKGROUND = 0x00000040;
        /// 带 ABSOLUTE:休眠期间计时器继续计时,仍使用 gettimeofday 纪元。
        /// 同时带 MACHTIME 和 ABSOLUTE:使用 Mach 连续时间纪元。
        /// 不带 ABSOLUTE:休眠期间继续计时。
        pub const MACH_CONTINUOUS_TIME = 0x00000080;
        /// data 以 mach 绝对时间为单位
        pub const MACHTIME = 0x00000100;
    },
    .dragonfly => struct {
        pub const FFNOP = 0;
        pub const TRACK = 1;
        pub const DELETE = 1;
        pub const LOWAT = 1;
        pub const TRACKERR = 2;
        pub const OOB = 2;
        pub const WRITE = 2;
        pub const EXTEND = 4;
        pub const CHILD = 4;
        pub const ATTRIB = 8;
        pub const LINK = 16;
        pub const RENAME = 32;
        pub const REVOKE = 64;
        pub const PDATAMASK = 1048575;
        pub const FFLAGSMASK = 16777215;
        pub const TRIGGER = 16777216;
        pub const EXEC = 536870912;
        pub const FFAND = 1073741824;
        pub const FORK = 1073741824;
        pub const EXIT = 2147483648;
        pub const FFOR = 2147483648;
        pub const FFCTRLMASK = 3221225472;
        pub const FFCOPY = 3221225472;
        pub const PCTRLMASK = 4026531840;
    },
    .netbsd => struct {
        /// 忽略输入 fflags
        pub const FFNOP = 0x00000000;
        /// 对 fflags 按位与
        pub const FFAND = 0x40000000;
        /// 对 fflags 按位或
        pub const FFOR = 0x80000000;
        /// 复制 fflags
        pub const FFCOPY = 0xc0000000;
        /// 操作掩码
        pub const FFCTRLMASK = 0xc0000000;
        pub const FFLAGSMASK = 0x00ffffff;
        /// 输入时,TRIGGER 使事件被触发以供输出。
        pub const TRIGGER = 0x01000000;
        /// 低水位线
        pub const LOWAT = 0x00000001;
        /// vnode 已移除
        pub const DELETE = 0x00000001;
        /// 数据内容已更改
        pub const WRITE = 0x00000002;
        /// 大小已增加
        pub const EXTEND = 0x00000004;
        /// 属性已更改
        pub const ATTRIB = 0x00000008;
        /// 链接计数已更改
        pub const LINK = 0x00000010;
        /// vnode 已重命名
        pub const RENAME = 0x00000020;
        /// vnode 访问权限已撤销
        pub const REVOKE = 0x00000040;
        /// vnode 已打开
        pub const OPEN = 0x00000080;
        /// 文件已关闭(无 FWRITE)
        pub const CLOSE = 0x00000100;
        /// 文件已关闭(FWRITE)
        pub const CLOSE_WRITE = 0x00000200;
        /// 文件被读取
        pub const READ = 0x00000400;
        /// 进程已退出
        pub const EXIT = 0x80000000;
        /// 进程已派生
        pub const FORK = 0x40000000;
        /// 进程执行了 exec
        pub const EXEC = 0x20000000;
        /// 信号与退出状态的掩码
        pub const PDATAMASK = 0x000fffff;
        pub const PCTRLMASK = 0xf0000000;
        /// 跨 fork 跟踪
        pub const TRACK = 0x00000001;
        /// 无法跟踪子进程
        pub const TRACKERR = 0x00000002;
        /// 我是子进程
        pub const CHILD = 0x00000004;
        /// 与 EVFILT_SIGNAL 共享
        pub const SIGNAL = 0x08000000;
        /// data 的单位为毫秒
        pub const MSECONDS = 0x00000000;
        /// data 的单位为秒
        pub const SECONDS = 0x00000001;
        /// data 的单位为微秒
        pub const USECONDS = 0x00000002;
        /// data 的单位为纳秒
        pub const NSECONDS = 0x00000003;
        /// 超时为绝对时间
        pub const ABSTIME = 0x00000010;
    },
    .freebsd => struct {
        /// 输入时,TRIGGER 使事件被触发以供输出。
        pub const TRIGGER = 0x01000000;
        /// 忽略输入 fflags
        pub const FFNOP = 0x00000000;
        /// 与 fflags 按位与
        pub const FFAND = 0x40000000;
        /// 与 fflags 按位或
        pub const FFOR = 0x80000000;
        /// 复制 fflags
        pub const FFCOPY = 0xc0000000;
        /// 操作掩码
        pub const FFCTRLMASK = 0xc0000000;
        pub const FFLAGSMASK = 0x00ffffff;
        /// 低水位线
        pub const LOWAT = 0x00000001;
        /// 行为与 poll() 类似
        pub const FILE_POLL = 0x00000002;
        /// vnode 已移除
        pub const DELETE = 0x00000001;
        /// 数据内容已更改
        pub const WRITE = 0x00000002;
        /// 大小已增加
        pub const EXTEND = 0x00000004;
        /// 属性已更改
        pub const ATTRIB = 0x00000008;
        /// 链接计数已更改
        pub const LINK = 0x00000010;
        /// vnode 已重命名
        pub const RENAME = 0x00000020;
        /// vnode 访问权限已撤销
        pub const REVOKE = 0x00000040;
        /// vnode 已打开
        pub const OPEN = 0x00000080;
        /// 文件已关闭,fd 不允许写入
        pub const CLOSE = 0x00000100;
        /// 文件已关闭,该文件描述符此前允许写入
        pub const CLOSE_WRITE = 0x00000200;
        /// 文件被读取
        pub const READ = 0x00000400;
        /// 进程已退出
        pub const EXIT = 0x80000000;
        /// 进程已派生
        pub const FORK = 0x40000000;
        /// 进程执行了 exec
        pub const EXEC = 0x20000000;
        /// 信号与退出状态的掩码
        pub const PDATAMASK = 0x000fffff;
        pub const PCTRLMASK = 0xf0000000;
        /// data 的单位为秒
        pub const SECONDS = 0x00000001;
        /// data 的单位为毫秒
        pub const MSECONDS = 0x00000002;
        /// data 的单位为微秒
        pub const USECONDS = 0x00000004;
        /// data 的单位为纳秒
        pub const NSECONDS = 0x00000008;
        /// 超时为绝对时间
        pub const ABSTIME = 0x00000010;
    },
    .openbsd => struct {
        // EVFILT.{READ|WRITE} 的数据/提示标志
        pub const LOWAT = 0x0001;
        pub const EOF = 0x0002;
        // EVFILT.EXCEPT 和 EVFILT.{READ|WRITE} 的数据/提示标志
        pub const OOB = 0x0004;
        // EVFILT.VNODE 的 data/hint 标志
        pub const DELETE = 0x0001;
        pub const WRITE = 0x0002;
        pub const EXTEND = 0x0004;
        pub const ATTRIB = 0x0008;
        pub const LINK = 0x0010;
        pub const RENAME = 0x0020;
        pub const REVOKE = 0x0040;
        pub const TRUNCATE = 0x0080;
        // EVFILT.PROC 的数据/提示标志
        pub const EXIT = 0x80000000;
        pub const FORK = 0x40000000;
        pub const EXEC = 0x20000000;
        pub const PDATAMASK = 0x000fffff;
        pub const PCTRLMASK = 0xf0000000;
        pub const TRACK = 0x00000001;
        pub const TRACKERR = 0x00000002;
        pub const CHILD = 0x00000004;
        // EVFILT.DEVICE 的数据/提示标志
        pub const CHANGE = 0x00000001;
        // EVFILT_USER 的数据/提示标志
        pub const FFNOP = 0x00000000;
        pub const FFAND = 0x40000000;
        pub const FFOR = 0x80000000;
        pub const FFCOPY = 0xc0000000;
        pub const FFCTRLMASK = 0xc0000000;
        pub const FFLAGSMASK = 0x00ffffff;
        pub const TRIGGER = 0x01000000;
    },
    else => void,
};

pub const FUTEX = switch (native_os) {
    .openbsd => openbsd.FUTEX,
    .serenity => serenity.FUTEX,
    else => void,
};

pub const MFD = switch (native_os) {
    .linux => linux.MFD,
    .freebsd => freebsd.MFD,
    else => void,
};

// 类 Unix 系统
pub const DIR = opaque {};
pub extern "c" fn opendir(pathname: [*:0]const u8) ?*DIR;
pub extern "c" fn fdopendir(fd: c_int) ?*DIR;
pub extern "c" fn rewinddir(dp: *DIR) void;
pub extern "c" fn closedir(dp: *DIR) c_int;
pub extern "c" fn telldir(dp: *DIR) c_long;
pub extern "c" fn seekdir(dp: *DIR, loc: c_long) void;

pub extern "c" fn sigwait(set: ?*sigset_t, sig: ?*c_int) c_int;

pub extern "c" fn alarm(seconds: c_uint) c_uint;

pub const close = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => darwin.@"close$NOCANCEL",
    else => private.close,
};

pub const clock_getres = switch (native_os) {
    .netbsd => private.__clock_getres50,
    else => private.clock_getres,
};

pub const clock_gettime = switch (native_os) {
    .netbsd => private.__clock_gettime50,
    else => private.clock_gettime,
};

pub const fstat = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => switch (native_arch) {
        .x86_64 => private.@"fstat$INODE64",
        else => private.fstat,
    },
    .netbsd => private.__fstat50,
    .linux => {},
    else => private.fstat,
};

pub const fstatat = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => switch (native_arch) {
        .x86_64 => private.@"fstatat$INODE64",
        else => private.fstatat,
    },
    .linux => {},
    else => private.fstatat,
};

pub extern "c" fn statx(dirfd: fd_t, path: [*:0]const u8, flags: u32, mask: linux.STATX, buf: *linux.Statx) c_int;

pub extern "c" fn getpwent() ?*passwd;
pub extern "c" fn endpwent() void;
pub extern "c" fn setpwent() void;
pub extern "c" fn getpwnam(name: [*:0]const u8) ?*passwd;
pub extern "c" fn getpwnam_r(name: [*:0]const u8, pwd: *passwd, buf: [*]u8, buflen: usize, result: *?*passwd) c_int;
pub extern "c" fn getpwuid(uid: uid_t) ?*passwd;
pub extern "c" fn getpwuid_r(uid: uid_t, pwd: *passwd, buf: [*]u8, buflen: usize, result: *?*passwd) c_int;
pub extern "c" fn getgrent() ?*group;
pub extern "c" fn setgrent() void;
pub extern "c" fn endgrent() void;
pub extern "c" fn getgrnam(name: [*:0]const u8) ?*group;
pub extern "c" fn getgrnam_r(name: [*:0]const u8, grp: *group, buf: [*]u8, buflen: usize, result: *?*group) c_int;
pub extern "c" fn getgrgid(gid: gid_t) ?*group;
pub extern "c" fn getgrgid_r(gid: gid_t, grp: *group, buf: [*]u8, buflen: usize, result: *?*group) c_int;
pub extern "c" fn getrlimit64(resource: rlimit_resource, rlim: *rlimit) c_int;
pub extern "c" fn lseek64(fd: fd_t, offset: i64, whence: c_int) i64;
pub extern "c" fn mmap64(addr: ?*align(page_size) anyopaque, len: usize, prot: PROT, flags: MAP, fd: fd_t, offset: i64) *anyopaque;
pub extern "c" fn open64(path: [*:0]const u8, oflag: O, ...) c_int;
pub extern "c" fn openat64(fd: c_int, path: [*:0]const u8, oflag: O, ...) c_int;
pub extern "c" fn pread64(fd: fd_t, buf: [*]u8, nbyte: usize, offset: i64) isize;
pub extern "c" fn preadv64(fd: c_int, iov: [*]const iovec, iovcnt: c_uint, offset: i64) isize;
pub extern "c" fn pwrite64(fd: fd_t, buf: [*]const u8, nbyte: usize, offset: i64) isize;
pub extern "c" fn pwritev64(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint, offset: i64) isize;
pub extern "c" fn sendfile64(out_fd: fd_t, in_fd: fd_t, offset: ?*i64, count: usize) isize;
pub extern "c" fn setrlimit64(resource: rlimit_resource, rlim: *const rlimit) c_int;

pub const arc4random_buf = switch (native_os) {
    .linux => if (builtin.abi.isAndroid() or
        (builtin.abi.isGnu() and versionCheck(.{ .major = 2, .minor = 36, .patch = 0 })))
        private.arc4random_buf
    else {},
    .dragonfly, .netbsd, .freebsd, .illumos, .openbsd, .serenity, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => private.arc4random_buf,
    else => {},
};
pub const getentropy = switch (native_os) {
    .linux => if (builtin.abi.isAndroid() and versionCheck(.{ .major = 28, .minor = 0, .patch = 0 })) private.getentropy else {},
    .emscripten => private.getentropy,
    else => {},
};
pub const getrandom = switch (native_os) {
    .freebsd => private.getrandom,
    .linux => if (builtin.abi.isMusl() or
        (builtin.abi.isGnu() and versionCheck(.{ .major = 2, .minor = 25, .patch = 0 })) or
        (builtin.abi.isAndroid() and versionCheck(.{ .major = 28, .minor = 0, .patch = 0 })))
        private.getrandom
    else {},
    else => {},
};

pub extern "c" fn sched_getaffinity(pid: c_int, size: usize, set: *cpu_set_t) c_int;
pub extern "c" fn eventfd(initval: c_uint, flags: c_uint) c_int;

pub extern "c" fn epoll_ctl(epfd: fd_t, op: c_uint, fd: fd_t, event: ?*epoll_event) c_int;
pub extern "c" fn epoll_create1(flags: c_uint) c_int;
pub extern "c" fn epoll_wait(epfd: fd_t, events: [*]epoll_event, maxevents: c_uint, timeout: c_int) c_int;
pub extern "c" fn epoll_pwait(
    epfd: fd_t,
    events: [*]epoll_event,
    maxevents: c_int,
    timeout: c_int,
    sigmask: *const sigset_t,
) c_int;

pub extern "c" fn timerfd_create(clockid: timerfd_clockid_t, flags: c_int) c_int;
pub extern "c" fn timerfd_settime(
    fd: c_int,
    flags: c_int,
    new_value: *const itimerspec,
    old_value: ?*itimerspec,
) c_int;
pub extern "c" fn timerfd_gettime(fd: c_int, curr_value: *itimerspec) c_int;

pub extern "c" fn inotify_init1(flags: c_uint) c_int;
pub extern "c" fn inotify_add_watch(fd: fd_t, pathname: [*:0]const u8, mask: u32) c_int;
pub extern "c" fn inotify_rm_watch(fd: fd_t, wd: c_int) c_int;

pub extern "c" fn fallocate64(fd: fd_t, mode: c_int, offset: off_t, len: off_t) c_int;
pub extern "c" fn fopen64(noalias filename: [*:0]const u8, noalias modes: [*:0]const u8) ?*FILE;
pub extern "c" fn ftruncate64(fd: c_int, length: off_t) c_int;
pub extern "c" fn fallocate(fd: fd_t, mode: c_int, offset: off_t, len: off_t) c_int;
pub const sendfile = switch (native_os) {
    .freebsd => freebsd.sendfile,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => darwin.sendfile,
    .linux => private.sendfile,
    else => {},
};

pub extern "c" fn getauxval(type: c_ulong) c_ulong;
pub extern "c" fn elf_aux_info(aux: c_int, buf: *anyopaque, buflen: c_int) c_int;

pub const HWCAP = switch (native_os) {
    .freebsd => switch (native_arch) {
        // FreeBSD 有意使 AT_HWCAP 与 Linux ABI 一致……
        else => std.os.linux.HWCAP,
        // ……但由于 Linux 采用 SYS_riscv_hwprobe 路径,FreeBSD
        // 定义的位比 Linux 更多:
        .riscv64 => struct {
            pub const ISA_A = 1 << 0;
            pub const ISA_B = 1 << 1;
            pub const ISA_C = 1 << 2;
            pub const ISA_D = 1 << 3;
            pub const ISA_F = 1 << 5;
            pub const ISA_H = 1 << 7;
            pub const ISA_I = 1 << 8;
            pub const ISA_M = 1 << 12;
            pub const ISA_V = 1 << 21;
        },
    },
    .illumos => switch (native_arch) {
        .x86, .x86_64 => struct {
            pub const FPU = 1 << 0;
            pub const TSC = 1 << 1;
            pub const CX8 = 1 << 2;
            pub const SEP = 1 << 3;
            pub const AMD_SYSC = 1 << 4;
            pub const CMOV = 1 << 5;
            pub const MMX = 1 << 6;
            pub const AMD_MMX = 1 << 7;
            pub const AMD_3DNow = 1 << 8;
            pub const AMD_3DNowx = 1 << 9;
            pub const FXSR = 1 << 10;
            pub const SSE = 1 << 11;
            pub const SSE2 = 1 << 12;
            pub const PAUSE = 1 << 13;
            pub const SSE3 = 1 << 14;
            pub const MON = 1 << 15;
            pub const CX16 = 1 << 16;
            pub const AHF = 1 << 17;
            pub const TSCP = 1 << 18;
            pub const AMD_SSE4A = 1 << 19;
            pub const POPCNT = 1 << 20;
            pub const AMD_LZCNT = 1 << 21;
            pub const SSSE3 = 1 << 22;
            pub const SSE4_1 = 1 << 23;
            pub const SSE4_2 = 1 << 24;
            pub const MOVBE = 1 << 25;
            pub const AES = 1 << 26;
            pub const PCLMULQDQ = 1 << 27;
            pub const XSAVE = 1 << 28;
            pub const AVX = 1 << 29;
            pub const VMX = 1 << 30;
            pub const AMD_SVM = 1 << 31;

            pub const @"2" = struct {
                pub const F16C = 1 << 0;
                pub const RDRAND = 1 << 1;
                pub const BMI1 = 1 << 2;
                pub const BMI2 = 1 << 3;
                pub const FMA = 1 << 4;
                pub const AVX2 = 1 << 5;
                pub const ADX = 1 << 6;
                pub const RDSEED = 1 << 7;
                pub const AVX512F = 1 << 8;
                pub const AVX512DQ = 1 << 9;
                pub const AVX512IFMA = 1 << 10;
                pub const AVX512PF = 1 << 11;
                pub const AVX512ER = 1 << 12;
                pub const AVX512CD = 1 << 13;
                pub const AVX512BW = 1 << 14;
                pub const AVX512VL = 1 << 15;
                pub const AVX512VBMI = 1 << 16;
                pub const AVX512VPOPCDQ = 1 << 17;
                pub const AVX512_4NNIW = 1 << 18;
                pub const AVX512_4FMAPS = 1 << 19;
                pub const SHA = 1 << 20;
                pub const FSGSBASE = 1 << 21;
                pub const CLFLUSHOPT = 1 << 22;
                pub const CLWB = 1 << 23;
                pub const MONITORX = 1 << 24;
                pub const CLZERO = 1 << 25;
                pub const AVX512_VNNI = 1 << 26;
                pub const VPCLMULQDQ = 1 << 27;
                pub const VAES = 1 << 28;
            };
        },
        else => struct {},
    },
    .linux => std.os.linux.HWCAP,
    .openbsd => switch (native_arch) {
        // 处理方式与 FreeBSD 相同。
        else => std.os.linux.HWCAP,
        .riscv64 => struct {
            pub const ISA_A = 1 << 0;
            pub const ISA_B = 1 << 1;
            pub const ISA_C = 1 << 2;
            pub const ISA_D = 1 << 3;
            pub const ISA_F = 1 << 5;
            pub const ISA_H = 1 << 7;
            pub const ISA_I = 1 << 8;
            pub const ISA_M = 1 << 12;
            pub const ISA_V = 1 << 21;

            pub const @"2" = struct {
                pub const ISA_ZBA = 1 << 0;
                pub const ISA_ZBB = 1 << 1;
                pub const ISA_ZBC = 1 << 2;
                pub const ISA_ZBS = 1 << 3;
                pub const ISA_ZFH = 1 << 4;
                pub const ISA_ZKT = 1 << 5;
                pub const ISA_ZVBB = 1 << 6;
                pub const ISA_ZVBC = 1 << 7;
                pub const ISA_ZVFH = 1 << 8;
                pub const ISA_ZVKG = 1 << 9;
                pub const ISA_ZVKNED = 1 << 10;
                pub const ISA_ZVKNHA = 1 << 11;
                pub const ISA_ZVKNHB = 1 << 12;
                pub const ISA_ZVKSED = 1 << 13;
                pub const ISA_ZVKSH = 1 << 14;
                pub const ISA_ZVKT = 1 << 15;
            };
        },
    },
    else => struct {},
};

pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;

pub const sigaltstack = switch (native_os) {
    .netbsd => private.__sigaltstack14,
    else => private.sigaltstack,
};

pub extern "c" fn memfd_create(name: [*:0]const u8, flags: c_uint) c_int;
pub const pipe2 = switch (native_os) {
    .dragonfly, .emscripten, .netbsd, .freebsd, .illumos, .openbsd, .linux, .serenity => private.pipe2,
    else => {},
};
pub const copy_file_range = switch (native_os) {
    .linux => private.copy_file_range,
    .freebsd => freebsd.copy_file_range,
    else => {},
};

pub extern "c" fn signalfd(fd: fd_t, mask: *const sigset_t, flags: u32) c_int;

pub extern "c" fn prlimit(pid: pid_t, resource: rlimit_resource, new_limit: *const rlimit, old_limit: *rlimit) c_int;
pub extern "c" fn mincore(
    addr: *align(page_size) anyopaque,
    length: usize,
    vec: [*]u8,
) c_int;

pub extern "c" fn madvise(
    addr: *align(page_size) anyopaque,
    length: usize,
    advice: u32,
) c_int;

pub const getdirentries = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => private.__getdirentries64,
    else => private.getdirentries,
};

pub const getdents = switch (native_os) {
    .netbsd => private.__getdents30,
    else => private.getdents,
};

pub const getrusage = switch (native_os) {
    .netbsd => private.__getrusage50,
    else => private.getrusage,
};

pub const gettimeofday = switch (native_os) {
    .netbsd => private.__gettimeofday50,
    else => private.gettimeofday,
};

pub const mlock = switch (native_os) {
    .windows, .wasi => {},
    else => private.mlock,
};

pub const mlock2 = switch (native_os) {
    .linux => private.mlock2,
    else => {},
};

pub const munlock = switch (native_os) {
    .windows, .wasi => {},
    else => private.munlock,
};

pub const mlockall = switch (native_os) {
    .linux, .freebsd, .dragonfly, .netbsd, .openbsd, .illumos => private.mlockall,
    else => {},
};

pub const munlockall = switch (native_os) {
    .linux, .freebsd, .dragonfly, .netbsd, .openbsd, .illumos => private.munlockall,
    else => {},
};

pub const msync = switch (native_os) {
    .netbsd => private.__msync13,
    else => private.msync,
};

pub const nanosleep = switch (native_os) {
    .netbsd => private.__nanosleep50,
    else => private.nanosleep,
};

pub const readdir = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => switch (native_arch) {
        .x86_64 => private.@"readdir$INODE64",
        else => private.readdir,
    },
    .windows => {},
    else => private.readdir,
};

pub const realpath = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => private.@"realpath$DARWIN_EXTSN",
    else => private.realpath,
};

pub const sched_yield = switch (native_os) {
    .netbsd => private.__libc_thr_yield,
    else => private.sched_yield,
};

pub const sigaction = switch (native_os) {
    .netbsd => private.__sigaction14,
    else => private.sigaction,
};

/// Zig 版 SIGRTMIN。实际为函数。
pub const sigrtmin = switch (native_os) {
    .openbsd => {},
    else => sigrt_private.sigrtmin,
};

/// Zig 版本的 SIGRTMAX。实际上是函数。
pub const sigrtmax = switch (native_os) {
    .openbsd => {},
    else => sigrt_private.sigrtmax,
};

const sigrt_private = struct {
    pub fn sigrtmin() u8 {
        return switch (native_os) {
            .freebsd => 65,
            .netbsd => 33,
            .illumos => @truncate(sysconf(@backingInt(_SC.SIGRT_MIN))),
            .haiku => @truncate(@as(c_uint, @bitCast(private.__signal_get_sigrtmin()))),
            else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmin()))),
        };
    }

    pub fn sigrtmax() u8 {
        return switch (native_os) {
            .freebsd => 126,
            .netbsd => 63,
            .illumos => @truncate(sysconf(@backingInt(_SC.SIGRT_MAX))),
            .haiku => @truncate(@as(c_uint, @bitCast(private.__signal_get_sigrtmax()))),
            else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmax()))),
        };
    }
};

pub const sigfillset = switch (native_os) {
    .netbsd => private.__sigfillset14,
    else => private.sigfillset,
};

pub const sigaddset = private.sigaddset;
pub const sigemptyset = switch (native_os) {
    .netbsd => private.__sigemptyset14,
    else => private.sigemptyset,
};
pub const sigdelset = private.sigdelset;
pub const sigismember = private.sigismember;

pub const sigprocmask = switch (native_os) {
    .netbsd => private.__sigprocmask14,
    else => private.sigprocmask,
};

pub const socket = switch (native_os) {
    .netbsd => private.__socket30,
    else => private.socket,
};

pub const socketpair = switch (native_os) {
    // https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/#unsupported\unavailable:
    .windows => {},
    else => private.socketpair,
};

pub const stat = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => switch (native_arch) {
        .x86_64 => private.@"stat$INODE64",
        else => private.stat,
    },
    else => private.stat,
};

pub const _msize = switch (native_os) {
    .windows => private._msize,
    else => {},
};
pub const malloc_size = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .serenity => private.malloc_size,
    else => {},
};
pub const malloc_usable_size = switch (native_os) {
    .freebsd, .linux, .serenity => private.malloc_usable_size,
    else => {},
};
pub const posix_memalign = switch (native_os) {
    .dragonfly, .netbsd, .freebsd, .illumos, .openbsd, .linux, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .serenity => private.posix_memalign,
    else => {},
};
pub const sysconf = switch (native_os) {
    .illumos => illumos.sysconf,
    else => private.sysconf,
};

pub const sf_hdtr = switch (native_os) {
    .freebsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        headers: ?[*]const iovec_const,
        hdr_cnt: c_int,
        trailers: ?[*]const iovec_const,
        trl_cnt: c_int,
    },
    else => void,
};

pub const flock = switch (native_os) {
    .windows, .wasi => {},
    else => private.flock,
};

pub const futex = switch (native_os) {
    .openbsd => openbsd.futex,
    .serenity => serenity.futex,
    else => {},
};

pub extern "c" var environ: [*:null]?[*:0]u8;

pub extern "c" fn fopen(noalias filename: [*:0]const u8, noalias modes: [*:0]const u8) ?*FILE;
pub extern "c" fn fclose(stream: *FILE) c_int;
pub extern "c" fn fwrite(noalias ptr: [*]const u8, size_of_type: usize, item_count: usize, noalias stream: *FILE) usize;
pub extern "c" fn fread(noalias ptr: [*]u8, size_of_type: usize, item_count: usize, noalias stream: *FILE) usize;

pub extern "c" fn printf(format: [*:0]const u8, ...) c_int;
pub extern "c" fn abort() noreturn;
pub extern "c" fn exit(code: c_int) noreturn;
pub extern "c" fn _Exit(code: c_int) noreturn;
pub extern "c" fn _exit(code: c_int) noreturn;
pub extern "c" fn isatty(fd: fd_t) c_int;
pub extern "c" fn lseek(fd: fd_t, offset: off_t, whence: whence_t) off_t;
pub extern "c" fn open(path: [*:0]const u8, oflag: O, ...) c_int;
pub extern "c" fn openat(fd: c_int, path: [*:0]const u8, oflag: O, ...) c_int;
pub extern "c" fn ftruncate(fd: c_int, length: off_t) c_int;
pub extern "c" fn raise(sig: SIG) c_int;
pub extern "c" fn read(fd: fd_t, buf: [*]u8, nbyte: usize) isize;
pub extern "c" fn readv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint) isize;
pub extern "c" fn pread(fd: fd_t, buf: [*]u8, nbyte: usize, offset: off_t) isize;
pub extern "c" fn preadv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint, offset: off_t) isize;
pub extern "c" fn writev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint) isize;
pub extern "c" fn pwritev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint, offset: off_t) isize;
pub extern "c" fn write(fd: fd_t, buf: [*]const u8, nbyte: usize) isize;
pub extern "c" fn pwrite(fd: fd_t, buf: [*]const u8, nbyte: usize, offset: off_t) isize;
pub extern "c" fn mmap(addr: ?*align(page_size) anyopaque, len: usize, prot: PROT, flags: MAP, fd: fd_t, offset: off_t) *anyopaque;
pub extern "c" fn munmap(addr: *align(page_size) const anyopaque, len: usize) c_int;
pub extern "c" fn mremap(addr: ?*align(page_size) const anyopaque, old_len: usize, new_len: usize, flags: MREMAP, ...) *anyopaque;
pub extern "c" fn mprotect(addr: *align(page_size) anyopaque, len: usize, prot: PROT) c_int;
pub extern "c" fn link(oldpath: [*:0]const u8, newpath: [*:0]const u8) c_int;
pub extern "c" fn linkat(oldfd: fd_t, oldpath: [*:0]const u8, newfd: fd_t, newpath: [*:0]const u8, flags: c_uint) c_int;
pub extern "c" fn unlink(path: [*:0]const u8) c_int;
pub extern "c" fn unlinkat(dirfd: fd_t, path: [*:0]const u8, flags: c_uint) c_int;
pub extern "c" fn getcwd(buf: [*]u8, size: usize) ?[*]u8;
pub extern "c" fn waitpid(pid: pid_t, status: ?*c_int, options: c_int) pid_t;

pub const wait4 = switch (native_os) {
    .netbsd => private.__wait450,
    else => private.wait4,
};

pub const fork = switch (native_os) {
    .dragonfly,
    .freebsd,
    .linux,
    .driverkit,
    .ios,
    .maccatalyst,
    .macos,
    .tvos,
    .visionos,
    .watchos,
    .netbsd,
    .openbsd,
    .illumos,
    .haiku,
    .serenity,
    => private.fork,
    else => {},
};
pub extern "c" fn access(path: [*:0]const u8, mode: c_uint) c_int;
pub extern "c" fn faccessat(dirfd: fd_t, path: [*:0]const u8, mode: c_uint, flags: c_uint) c_int;
pub extern "c" fn pipe(fds: *[2]fd_t) c_int;
pub extern "c" fn mkdir(path: [*:0]const u8, mode: mode_t) c_int;
pub extern "c" fn mkdirat(dirfd: fd_t, path: [*:0]const u8, mode: mode_t) c_int;
pub extern "c" fn symlink(existing: [*:0]const u8, new: [*:0]const u8) c_int;
pub extern "c" fn symlinkat(oldpath: [*:0]const u8, newdirfd: fd_t, newpath: [*:0]const u8) c_int;
pub extern "c" fn rename(old: [*:0]const u8, new: [*:0]const u8) c_int;
pub extern "c" fn renameat(olddirfd: fd_t, old: [*:0]const u8, newdirfd: fd_t, new: [*:0]const u8) c_int;
pub extern "c" fn chdir(path: [*:0]const u8) c_int;
pub extern "c" fn fchdir(fd: fd_t) c_int;
pub extern "c" fn execve(path: [*:0]const u8, argv: [*:null]const ?[*:0]const u8, envp: [*:null]const ?[*:0]const u8) c_int;
pub extern "c" fn execveat(dirfd: fd_t, path: [*:0]const u8, argv: [*:null]const ?[*:0]const u8, envp: [*:null]const ?[*:0]const u8, flags: EXECVEAT) c_int;
pub extern "c" fn dup(fd: fd_t) c_int;
pub extern "c" fn dup2(old_fd: fd_t, new_fd: fd_t) c_int;
pub extern "c" fn dup3(old: c_int, new: c_int, flags: c_uint) c_int;
pub extern "c" fn readlink(noalias path: [*:0]const u8, noalias buf: [*]u8, bufsize: usize) isize;
pub extern "c" fn readlinkat(dirfd: fd_t, noalias path: [*:0]const u8, noalias buf: [*]u8, bufsize: usize) isize;
pub extern "c" fn chmod(path: [*:0]const u8, mode: mode_t) c_int;
pub extern "c" fn fchmod(fd: fd_t, mode: mode_t) c_int;
pub extern "c" fn fchmodat(fd: fd_t, path: [*:0]const u8, mode: mode_t, flags: c_uint) c_int;
pub extern "c" fn fchown(fd: fd_t, owner: uid_t, group: gid_t) c_int;
pub extern "c" fn fchownat(fd: fd_t, path: [*:0]const u8, owner: uid_t, group: gid_t, flags: c_uint) c_int;
pub extern "c" fn umask(mode: mode_t) mode_t;

pub extern "c" fn rmdir(path: [*:0]const u8) c_int;
pub extern "c" fn getenv(name: [*:0]const u8) ?[*:0]u8;
pub extern "c" fn sysctl(name: [*]const c_int, namelen: c_uint, oldp: ?*anyopaque, oldlenp: ?*usize, newp: ?*anyopaque, newlen: usize) c_int;
pub extern "c" fn sysctlbyname(name: [*:0]const u8, oldp: ?*anyopaque, oldlenp: ?*usize, newp: ?*anyopaque, newlen: usize) c_int;
pub extern "c" fn sysctlnametomib(name: [*:0]const u8, mibp: ?*c_int, sizep: ?*usize) c_int;
pub extern "c" fn tcgetattr(fd: fd_t, termios_p: *termios) c_int;
pub extern "c" fn tcsetattr(fd: fd_t, optional_action: TCSA, termios_p: *const termios) c_int;
pub extern "c" fn fcntl(fd: fd_t, cmd: c_int, ...) c_int;
pub extern "c" fn uname(buf: *utsname) c_int;

pub extern "c" fn gethostname(name: [*]u8, len: usize) c_int;
pub extern "c" fn shutdown(socket: fd_t, how: c_int) c_int;
pub extern "c" fn bind(socket: fd_t, address: ?*const sockaddr, address_len: socklen_t) c_int;
pub extern "c" fn listen(sockfd: fd_t, backlog: c_uint) c_int;
pub extern "c" fn getsockname(sockfd: fd_t, noalias addr: *sockaddr, noalias addrlen: *socklen_t) c_int;
pub extern "c" fn getpeername(sockfd: fd_t, noalias addr: *sockaddr, noalias addrlen: *socklen_t) c_int;
pub extern "c" fn connect(sockfd: fd_t, sock_addr: *const sockaddr, addrlen: socklen_t) c_int;
pub extern "c" fn accept(sockfd: fd_t, noalias addr: ?*sockaddr, noalias addrlen: ?*socklen_t) c_int;
pub extern "c" fn accept4(sockfd: fd_t, noalias addr: ?*sockaddr, noalias addrlen: ?*socklen_t, flags: c_uint) c_int;
pub extern "c" fn getsockopt(sockfd: fd_t, level: i32, optname: u32, noalias optval: ?*anyopaque, noalias optlen: *socklen_t) c_int;
pub extern "c" fn setsockopt(sockfd: fd_t, level: i32, optname: u32, optval: ?*const anyopaque, optlen: socklen_t) c_int;
pub extern "c" fn send(sockfd: fd_t, buf: *const anyopaque, len: usize, flags: u32) isize;
pub extern "c" fn sendto(
    sockfd: fd_t,
    buf: *const anyopaque,
    len: usize,
    flags: u32,
    dest_addr: ?*const sockaddr,
    addrlen: socklen_t,
) isize;
pub extern "c" fn sendmsg(sockfd: fd_t, msg: *const msghdr_const, flags: u32) isize;
pub extern "c" fn sendmmsg(sockfd: fd_t, msgvec: [*]mmsghdr, n: c_uint, flags: u32) c_int;

pub extern "c" fn recv(
    sockfd: fd_t,
    arg1: ?*anyopaque,
    arg2: usize,
    arg3: c_int,
) if (native_os == .windows) c_int else isize;
pub extern "c" fn recvfrom(
    sockfd: fd_t,
    noalias buf: *anyopaque,
    len: usize,
    flags: u32,
    noalias src_addr: ?*sockaddr,
    noalias addrlen: ?*socklen_t,
) if (native_os == .windows) c_int else isize;

pub const recvmsg = switch (native_os) {
    .windows => {},
    else => private.recvmsg,
};

pub extern "c" fn kill(pid: pid_t, sig: SIG) c_int;

pub extern "c" fn setuid(uid: uid_t) c_int;
pub extern "c" fn setgid(gid: gid_t) c_int;
pub extern "c" fn seteuid(euid: uid_t) c_int;
pub extern "c" fn setegid(egid: gid_t) c_int;
pub extern "c" fn setreuid(ruid: uid_t, euid: uid_t) c_int;
pub extern "c" fn setregid(rgid: gid_t, egid: gid_t) c_int;
pub extern "c" fn setresuid(ruid: uid_t, euid: uid_t, suid: uid_t) c_int;
pub extern "c" fn setresgid(rgid: gid_t, egid: gid_t, sgid: gid_t) c_int;
pub extern "c" fn setpgid(pid: pid_t, pgid: pid_t) c_int;
pub extern "c" fn getuid() uid_t;
pub extern "c" fn getgid() gid_t;
pub extern "c" fn geteuid() uid_t;
pub extern "c" fn getegid() gid_t;
pub extern "c" fn getresuid(ruid: *uid_t, euid: *uid_t, suid: *uid_t) c_int;
pub extern "c" fn getresgid(rgid: *gid_t, egid: *gid_t, sgid: *gid_t) c_int;

pub extern "c" fn malloc(usize) ?*anyopaque;
pub extern "c" fn calloc(usize, usize) ?*anyopaque;
pub extern "c" fn realloc(?*anyopaque, usize) ?*anyopaque;
pub extern "c" fn free(?*anyopaque) void;

pub extern "c" fn futimes(fd: fd_t, times: ?*[2]timeval) c_int;
pub extern "c" fn utimes(path: [*:0]const u8, times: ?*[2]timeval) c_int;

pub extern "c" fn utimensat(dirfd: fd_t, pathname: [*:0]const u8, times: ?*const [2]timespec, flags: u32) c_int;
pub extern "c" fn futimens(fd: fd_t, times: ?*const [2]timespec) c_int;

pub extern "c" fn pthread_create(
    noalias newthread: *pthread_t,
    noalias attr: ?*const pthread_attr_t,
    start_routine: *const fn (?*anyopaque) callconv(.c) ?*anyopaque,
    noalias arg: ?*anyopaque,
) E;
pub const pthread_cancelstate = switch (native_os) {
    .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => enum(c_int) {
        ENABLE = 1,
        DISABLE = 0,
    },
    .linux => if (native_abi.isMusl()) enum(c_int) {
        ENABLE = 0,
        DISABLE = 1,
        MASKED = 2,
    } else if (native_abi.isGnu()) enum(c_int) {
        ENABLE = 0,
        DISABLE = 1,
    },
    else => void,
};
pub extern "c" fn pthread_setcancelstate(pthread_cancelstate, ?*pthread_cancelstate) E;
pub extern "c" fn pthread_cancel(pthread_t) E;
pub extern "c" fn pthread_attr_init(attr: *pthread_attr_t) E;
pub extern "c" fn pthread_attr_setstack(attr: *pthread_attr_t, stackaddr: *anyopaque, stacksize: usize) E;
pub extern "c" fn pthread_attr_setstacksize(attr: *pthread_attr_t, stacksize: usize) E;
pub extern "c" fn pthread_attr_setguardsize(attr: *pthread_attr_t, guardsize: usize) E;
pub extern "c" fn pthread_attr_destroy(attr: *pthread_attr_t) E;
pub extern "c" fn pthread_self() pthread_t;
pub extern "c" fn pthread_join(thread: pthread_t, arg_return: ?*?*anyopaque) E;
pub extern "c" fn pthread_detach(thread: pthread_t) E;
pub extern "c" fn pthread_atfork(
    prepare: ?*const fn () callconv(.c) void,
    parent: ?*const fn () callconv(.c) void,
    child: ?*const fn () callconv(.c) void,
) c_int;
pub extern "c" fn pthread_key_create(
    key: *pthread_key_t,
    destructor: ?*const fn (value: *anyopaque) callconv(.c) void,
) E;
pub extern "c" fn pthread_key_delete(key: pthread_key_t) E;
pub extern "c" fn pthread_getspecific(key: pthread_key_t) ?*anyopaque;
pub extern "c" fn pthread_setspecific(key: pthread_key_t, value: ?*anyopaque) c_int;
pub extern "c" fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *sigset_t) c_int;
pub const pthread_setname_np = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => darwin.pthread_setname_np,
    .illumos => illumos.pthread_setname_np,
    .netbsd => netbsd.pthread_setname_np,
    else => private.pthread_setname_np,
};

pub extern "c" fn pthread_getname_np(thread: pthread_t, name: [*:0]u8, len: usize) c_int;
pub extern "c" fn pthread_kill(pthread_t, signal: SIG) c_int;
pub extern "c" fn pthread_exit(ptr: ?*anyopaque) noreturn;

pub const pthread_threadid_np = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => private.pthread_threadid_np,
    else => {},
};

pub const caddr_t = ?[*]u8;

pub const ptrace = switch (native_os) {
    .linux, .serenity => private.ptrace,
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => darwin.ptrace,
    .dragonfly => dragonfly.ptrace,
    .freebsd => freebsd.ptrace,
    .netbsd => netbsd.ptrace,
    .openbsd => openbsd.ptrace,
    else => {},
};

pub extern "c" fn sem_init(sem: *sem_t, pshared: c_int, value: c_uint) c_int;
pub extern "c" fn sem_destroy(sem: *sem_t) c_int;
pub extern "c" fn sem_open(name: [*:0]const u8, flag: c_int, mode: mode_t, value: c_uint) *sem_t;
pub extern "c" fn sem_close(sem: *sem_t) c_int;
pub extern "c" fn sem_post(sem: *sem_t) c_int;
pub extern "c" fn sem_wait(sem: *sem_t) c_int;
pub extern "c" fn sem_trywait(sem: *sem_t) c_int;
pub extern "c" fn sem_timedwait(sem: *sem_t, abs_timeout: *const timespec) c_int;
pub extern "c" fn sem_getvalue(sem: *sem_t, sval: *c_int) c_int;

pub const shm_open = switch (native_os) {
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => darwin.shm_open,
    else => private.shm_open,
};
pub extern "c" fn shm_unlink(name: [*:0]const u8) c_int;

pub extern "c" fn kqueue() c_int;
pub extern "c" fn kevent(
    kq: c_int,
    changelist: [*]const Kevent,
    nchanges: c_int,
    eventlist: [*]Kevent,
    nevents: c_int,
    timeout: ?*const timespec,
) c_int;

pub extern "c" fn port_create() port_t;
pub extern "c" fn port_associate(
    port: port_t,
    source: u32,
    object: usize,
    events: u32,
    user_var: ?*anyopaque,
) c_int;
pub extern "c" fn port_dissociate(port: port_t, source: u32, object: usize) c_int;
pub extern "c" fn port_send(port: port_t, events: u32, user_var: ?*anyopaque) c_int;
pub extern "c" fn port_sendn(
    ports: [*]port_t,
    errors: []u32,
    num_ports: u32,
    events: u32,
    user_var: ?*anyopaque,
) c_int;
pub extern "c" fn port_get(port: port_t, event: *port_event, timeout: ?*timespec) c_int;
pub extern "c" fn port_getn(
    port: port_t,
    event_list: []port_event,
    max_events: u32,
    events_retrieved: *u32,
    timeout: ?*timespec,
) c_int;
pub extern "c" fn port_alert(port: port_t, flags: u32, events: u32, user_var: ?*anyopaque) c_int;

pub extern "c" fn getaddrinfo(
    noalias node: ?[*:0]const u8,
    noalias service: ?[*:0]const u8,
    noalias hints: ?*const addrinfo,
    /// 在 Linux 上,出错时不会修改 `res`;
    /// 向 `freeaddrinfo` 传入未定义指针可能导致崩溃。
    noalias res: *?*addrinfo,
) EAI;

pub extern "c" fn freeaddrinfo(res: *addrinfo) void;

pub extern "c" fn getnameinfo(
    noalias addr: *const sockaddr,
    addrlen: socklen_t,
    noalias host: ?[*]u8,
    hostlen: socklen_t,
    noalias serv: ?[*]u8,
    servlen: socklen_t,
    flags: NI,
) EAI;

pub extern "c" fn gai_strerror(errcode: EAI) [*:0]const u8;

pub extern "c" fn poll(fds: [*]pollfd, nfds: nfds_t, timeout: c_int) c_int;
pub extern "c" fn ppoll(fds: [*]pollfd, nfds: nfds_t, timeout: ?*const timespec, sigmask: ?*const sigset_t) c_int;

pub extern "c" fn dn_expand(
    msg: [*:0]const u8,
    eomorig: [*:0]const u8,
    comp_dn: [*:0]const u8,
    exp_dn: [*:0]u8,
    length: c_int,
) c_int;

pub const PTHREAD_PROCESS_PRIVATE: c_int = if (native_os.isDarwin())
    2
else
    0;

pub const PTHREAD_PROCESS_SHARED: c_int = 1;

pub extern "c" fn pthread_spin_init(spin: *pthread_spinlock_t, pshared: c_int) c_int;
pub extern "c" fn pthread_spin_lock(spin: *pthread_spinlock_t) c_int;
pub extern "c" fn pthread_spin_unlock(spin: *pthread_spinlock_t) c_int;
pub extern "c" fn pthread_spin_trylock(spin: *pthread_spinlock_t) c_int;
pub extern "c" fn pthread_spin_destroy(spin: *pthread_spinlock_t) c_int;

pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = .{};
pub extern "c" fn pthread_mutex_lock(mutex: *pthread_mutex_t) E;
pub extern "c" fn pthread_mutex_unlock(mutex: *pthread_mutex_t) E;
pub extern "c" fn pthread_mutex_trylock(mutex: *pthread_mutex_t) E;
pub extern "c" fn pthread_mutex_destroy(mutex: *pthread_mutex_t) E;

pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = .{};
pub extern "c" fn pthread_cond_wait(noalias cond: *pthread_cond_t, noalias mutex: *pthread_mutex_t) E;
pub extern "c" fn pthread_cond_timedwait(noalias cond: *pthread_cond_t, noalias mutex: *pthread_mutex_t, noalias abstime: *const timespec) E;
pub extern "c" fn pthread_cond_signal(cond: *pthread_cond_t) E;
pub extern "c" fn pthread_cond_broadcast(cond: *pthread_cond_t) E;
pub extern "c" fn pthread_cond_destroy(cond: *pthread_cond_t) E;

pub extern "c" fn pthread_rwlock_destroy(rwl: *pthread_rwlock_t) callconv(.c) E;
pub extern "c" fn pthread_rwlock_rdlock(rwl: *pthread_rwlock_t) callconv(.c) E;
pub extern "c" fn pthread_rwlock_wrlock(rwl: *pthread_rwlock_t) callconv(.c) E;
pub extern "c" fn pthread_rwlock_tryrdlock(rwl: *pthread_rwlock_t) callconv(.c) E;
pub extern "c" fn pthread_rwlock_trywrlock(rwl: *pthread_rwlock_t) callconv(.c) E;
pub extern "c" fn pthread_rwlock_unlock(rwl: *pthread_rwlock_t) callconv(.c) E;

pub const pthread_t = switch (native_os) {
    // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L64
    .serenity => c_int,
    else => *opaque {},
};
pub const FILE = opaque {};

pub extern "c" fn dlopen(path: ?[*:0]const u8, mode: RTLD) ?*anyopaque;
pub extern "c" fn dlclose(handle: *anyopaque) c_int;
pub extern "c" fn dlsym(handle: ?*anyopaque, symbol: [*:0]const u8) ?*anyopaque;
pub extern "c" fn dlerror() ?[*:0]u8;

pub const dladdr = if (native_os.isDarwin()) darwin.dladdr else {};
pub const dl_info = if (native_os.isDarwin()) darwin.dl_info else {};

pub extern "c" fn sync() void;
pub extern "c" fn syncfs(fd: c_int) c_int;
pub extern "c" fn fsync(fd: c_int) c_int;
pub extern "c" fn fdatasync(fd: c_int) c_int;

pub extern "c" fn prctl(option: c_int, ...) c_int;

pub extern "c" fn getrlimit(resource: rlimit_resource, rlim: *rlimit) c_int;
pub extern "c" fn setrlimit(resource: rlimit_resource, rlim: *const rlimit) c_int;

pub extern "c" fn fmemopen(noalias buf: ?*anyopaque, size: usize, noalias mode: [*:0]const u8) ?*FILE;

pub extern "c" fn syslog(priority: c_int, message: [*:0]const u8, ...) void;
pub extern "c" fn openlog(ident: [*:0]const u8, logopt: c_int, facility: c_int) void;
pub extern "c" fn closelog() void;
pub extern "c" fn setlogmask(maskpri: c_int) c_int;

pub extern "c" fn if_nametoindex([*:0]const u8) c_int;

pub extern "c" fn getpid() pid_t;
pub extern "c" fn getppid() pid_t;
pub extern "c" fn setsid() pid_t;

/// 这些值由实现定义,但至少在 musl 和 glibc 中完全相同:
/// - https://git.musl-libc.org/cgit/musl/tree/include/locale.h?id=ab31e9d6a0fa7c5c408856c89df2dfb12c344039#n18
/// - https://sourceware.org/git/?p=glibc.git;a=blob;f=locale/bits/locale.h;h=0fcbb66114be5fef0577dc9047256eb508c45919;hb=c90cfce849d010474e8cccf3e5bff49a2c8b141f#l26
pub const LC = enum(c_int) {
    CTYPE = 0,
    NUMERIC = 1,
    TIME = 2,
    COLLATE = 3,
    MONETARY = 4,
    MESSAGES = 5,
    ALL = 6,
    PAPER = 7,
    NAME = 8,
    ADDRESS = 9,
    TELEPHONE = 10,
    MEASUREMENT = 11,
    IDENTIFICATION = 12,
    _,
};

pub extern "c" fn setlocale(category: LC, locale: ?[*:0]const u8) ?[*:0]const u8;

pub const max_align_t = if (native_abi == .msvc or native_abi == .itanium)
    f64
else if (native_os.isDarwin())
    c_longdouble
else
    extern struct {
        a: c_longlong,
        b: c_longdouble,
    };

pub const div_t = extern struct {
    quot: c_int,
    rem: c_int,
};

pub const ldiv_t = extern struct {
    quot: c_long,
    rem: c_long,
};

pub const lldiv_t = extern struct {
    quot: c_longlong,
    rem: c_longlong,
};

pub const imaxdiv_t = extern struct {
    quot: intmax_t,
    rem: intmax_t,
};

pub const intmax_t = i64;
pub const uintmax_t = u64;

pub const wint_t = switch (builtin.target.os.tag) {
    .windows => u16,
    else => i32,
};

pub const wchar_t = switch (builtin.target.os.tag) {
    .windows => u16,
    else => if (builtin.target.cpu.arch.isArm() or builtin.target.cpu.arch.isAARCH64()) u32 else i32,
};

pub extern "c" fn pthread_getthreadid_np() c_int;
pub extern "c" fn pthread_set_name_np(thread: pthread_t, name: [*:0]const u8) void;
pub extern "c" fn pthread_get_name_np(thread: pthread_t, name: [*:0]u8, len: usize) void;

pub const TIMER = switch (native_os) {
    .linux, .emscripten => std.os.linux.TIMER,
    .openbsd, .netbsd, .wasi, .windows, .freebsd, .serenity => packed struct(u32) {
        ABSTIME: bool,
        _: u31 = 0,
    },
    else => void,
};

pub const clock_nanosleep = switch (native_os) {
    .linux, .emscripten, .netbsd, .wasi, .windows, .freebsd, .serenity => private.clock_nanosleep,
    else => {},
};

pub const ioctl = switch (native_os) {
    .windows, .wasi => {},
    else => private.ioctl,
};

pub extern "c" fn bzero(s: *anyopaque, n: usize) void;

pub const swab = switch (builtin.abi) {
    .msvc => private._swab,
    else => private.swab,
};

pub extern "c" fn strncmp(a: [*:0]const c_char, b: [*:0]const c_char, max: usize) c_int;
pub extern "c" fn strcasecmp(a: [*:0]const c_char, b: [*:0]const c_char) c_int;
pub extern "c" fn strncasecmp(a: [*:0]const c_char, b: [*:0]const c_char, max: usize) c_int;
pub const strdup = switch (builtin.abi) {
    .msvc => private._strdup,
    else => private.strdup,
};
pub extern "c" fn strnlen(s: [*:0]const c_char, n: usize) callconv(.c) usize;
pub extern "c" fn strndup(s: [*:0]const c_char, n: usize) ?[*:0]c_char;
pub extern "c" fn wcsnlen(s: [*:0]const wchar_t, n: usize) callconv(.c) usize;
pub const wcsdup = switch (builtin.abi) {
    .msvc => private._wcsdup,
    else => private.wcsdup,
};

pub extern "c" fn ffs(i: c_int) c_int;
pub extern "c" fn ffsl(i: c_long) c_long;
pub extern "c" fn ffsll(i: c_longlong) c_longlong;

pub extern "c" fn erand48(xsubi: *[3]c_ushort) f64;
pub extern "c" fn jrand48(xsubi: *[3]c_ushort) c_long;
pub extern "c" fn nrand48(xsubi: *[3]c_ushort) c_long;

pub extern "c" fn insque(element: *anyopaque, pred: ?*anyopaque) void;
pub extern "c" fn remque(element: *anyopaque) void;

pub extern "c" fn imaxabs(a: intmax_t) intmax_t;
pub extern "c" fn imaxdiv(a: intmax_t, b: intmax_t) imaxdiv_t;

pub extern "c" fn abs(a: c_int) c_int;
pub extern "c" fn labs(a: c_long) c_long;
pub extern "c" fn llabs(a: c_longlong) c_longlong;

pub extern "c" fn div(a: c_int, b: c_int) div_t;
pub extern "c" fn ldiv(a: c_long, b: c_long) ldiv_t;
pub extern "c" fn lldiv(a: c_longlong, b: c_longlong) lldiv_t;

pub extern "c" fn atoi(str: [*:0]const c_char) c_int;
pub extern "c" fn atol(str: [*:0]const c_char) c_long;
pub extern "c" fn atoll(str: [*:0]const c_char) c_longlong;

pub extern "c" fn strtol(noalias str: [*:0]const c_char, noalias str_end: ?*[*:0]c_char, base: c_int) callconv(.c) c_long;
pub extern "c" fn strtoll(noalias str: [*:0]const c_char, noalias str_end: ?*[*:0]c_char, base: c_int) callconv(.c) c_longlong;
pub extern "c" fn strtoul(noalias str: [*:0]const c_char, noalias str_end: ?*[*:0]c_char, base: c_int) callconv(.c) c_ulong;
pub extern "c" fn strtoull(noalias str: [*:0]const c_char, noalias str_end: ?*[*:0]c_char, base: c_int) callconv(.c) c_ulonglong;
pub extern "c" fn strtoimax(noalias str: [*:0]const c_char, noalias str_end: ?*[*:0]c_char, base: c_int) callconv(.c) intmax_t;
pub extern "c" fn strtoumax(noalias str: [*:0]const c_char, noalias str_end: ?*[*:0]c_char, base: c_int) callconv(.c) uintmax_t;

pub extern "c" fn bsearch(
    key: *const anyopaque,
    base: *const anyopaque,
    n: usize,
    size: usize,
    compare: *const fn (a: *const anyopaque, b: *const anyopaque) callconv(.c) c_int,
) ?*anyopaque;

// 数学
pub extern "c" fn atan(x: f64) f64;
pub extern "c" fn copysign(x: f64, y: f64) f64;
pub extern "c" fn fdim(x: f64, y: f64) f64;
pub extern "c" fn frexp(x: f64, e: *c_int) f64;
pub extern "c" fn hypot(x: f64, y: f64) f64;
pub extern "c" fn modff(x: f32, iptr: *f32) f32;
pub extern "c" fn modf(x: f64, iptr: *f64) f64;
pub extern "c" fn modfl(x: c_longdouble, iptr: *c_longdouble) c_longdouble;
pub extern "c" fn rintf(x: f32) f32;
pub extern "c" fn rint(x: f64) f64;
pub extern "c" fn rintl(x: c_longdouble) c_longdouble;

// 操作系统专属部分。各专属文件中的编译期断言会防止在错误操作系统上使用。
//

pub const AF_SUN = illumos.AF_SUN;
pub const AT_SUN = illumos.AT_SUN;
pub const FILE_EVENT = illumos.FILE_EVENT;
pub const GETCONTEXT = illumos.GETCONTEXT;
pub const GETUSTACK = illumos.GETUSTACK;
pub const PORT_ALERT = illumos.PORT_ALERT;
pub const PORT_SOURCE = illumos.PORT_SOURCE;
pub const POSIX_FADV = illumos.POSIX_FADV;
pub const SETCONTEXT = illumos.SETCONTEXT;
pub const SETUSTACK = illumos.GETUSTACK;
pub const SFD = illumos.SFD;
pub const ctid_t = illumos.ctid_t;
pub const file_obj = illumos.file_obj;
pub const id_t = illumos.id_t;
pub const lif_ifinfo_req = illumos.lif_ifinfo_req;
pub const lif_nd_req = illumos.lif_nd_req;
pub const lifreq = illumos.lifreq;
pub const major_t = illumos.major_t;
pub const minor_t = illumos.minor_t;
pub const poolid_t = illumos.poolid_t;
pub const port_notify = illumos.port_notify;
pub const priority = illumos.priority;
pub const procfs = illumos.procfs;
pub const projid_t = illumos.projid_t;
pub const signalfd_siginfo = illumos.signalfd_siginfo;
pub const taskid_t = illumos.taskid_t;
pub const zoneid_t = illumos.zoneid_t;

pub const B_ABSOLUTE_TIMEOUT = haiku.B_ABSOLUTE_TIMEOUT;
pub const B_OS_NAME_LENGTH = haiku.B_OS_NAME_LENGTH;
pub const B_TIMEOUT_REAL_TIME_BASE = haiku.B_TIMEOUT_REAL_TIME_BASE;
pub const DirEnt = haiku.DirEnt;
pub const _kern_acquire_sem_etc = haiku._kern_acquire_sem_etc;
pub const _kern_create_sem = haiku._kern_create_sem;
pub const _kern_delete_sem = haiku._kern_delete_sem;
pub const _kern_open_dir = haiku._kern_open_dir;
pub const _kern_read_dir = haiku._kern_read_dir;
pub const _kern_read_stat = haiku._kern_read_stat;
pub const _kern_release_sem_etc = haiku._kern_release_sem_etc;
pub const _kern_rewind_dir = haiku._kern_rewind_dir;
pub const area_id = haiku.area_id;
pub const find_thread = haiku.find_thread;
pub const get_system_info = haiku.get_system_info;
pub const on_exit_thread = haiku.on_exit_thread;
pub const port_id = haiku.port_id;
pub const readv_pos = haiku.readv_pos;
pub const sem_id = haiku.sem_id;
pub const status_t = haiku.status_t;
pub const system_info = haiku.system_info;
pub const team_id = haiku.team_id;
pub const thread_id = haiku.thread_id;
pub const writev_pos = haiku.writev_pos;

pub const AUTH = openbsd.AUTH;
pub const BI = openbsd.BI;
pub const PTHREAD_STACK_MIN = openbsd.PTHREAD_STACK_MIN;
pub const TCFLUSH = openbsd.TCFLUSH;
pub const TCIO = openbsd.TCIO;
pub const auth_approval = openbsd.auth_approval;
pub const auth_call = openbsd.auth_call;
pub const auth_cat = openbsd.auth_cat;
pub const auth_challenge = openbsd.auth_challenge;
pub const auth_check_change = openbsd.auth_check_change;
pub const auth_check_expire = openbsd.auth_check_expire;
pub const auth_checknologin = openbsd.auth_checknologin;
pub const auth_clean = openbsd.auth_clean;
pub const auth_close = openbsd.auth_close;
pub const auth_clrenv = openbsd.auth_clrenv;
pub const auth_clroption = openbsd.auth_clroption;
pub const auth_clroptions = openbsd.auth_clroptions;
pub const auth_getitem = openbsd.auth_getitem;
pub const auth_getpwd = openbsd.auth_getpwd;
pub const auth_getstate = openbsd.auth_getstate;
pub const auth_getvalue = openbsd.auth_getvalue;
pub const auth_item_t = openbsd.auth_item_t;
pub const auth_mkvalue = openbsd.auth_mkvalue;
pub const auth_open = openbsd.auth_open;
pub const auth_session_t = openbsd.auth_session_t;
pub const auth_setdata = openbsd.auth_setdata;
pub const auth_setenv = openbsd.auth_setenv;
pub const auth_setitem = openbsd.auth_setitem;
pub const auth_setoption = openbsd.auth_setoption;
pub const auth_setpwd = openbsd.auth_setpwd;
pub const auth_setstate = openbsd.auth_setstate;
pub const auth_userchallenge = openbsd.auth_userchallenge;
pub const auth_usercheck = openbsd.auth_usercheck;
pub const auth_userokay = openbsd.auth_userokay;
pub const auth_userresponse = openbsd.auth_userresponse;
pub const auth_verify = openbsd.auth_verify;
pub const bcrypt = openbsd.bcrypt;
pub const bcrypt_checkpass = openbsd.bcrypt_checkpass;
pub const bcrypt_gensalt = openbsd.bcrypt_gensalt;
pub const bcrypt_newhash = openbsd.bcrypt_newhash;
pub const getpwnam_shadow = openbsd.getpwnam_shadow;
pub const getpwuid_shadow = openbsd.getpwuid_shadow;
pub const getthrid = openbsd.getthrid;
pub const login_cap_t = openbsd.login_cap_t;
pub const login_close = openbsd.login_close;
pub const login_getcapbool = openbsd.login_getcapbool;
pub const login_getcapnum = openbsd.login_getcapnum;
pub const login_getcapsize = openbsd.login_getcapsize;
pub const login_getcapstr = openbsd.login_getcapstr;
pub const login_getcaptime = openbsd.login_getcaptime;
pub const login_getclass = openbsd.login_getclass;
pub const login_getstyle = openbsd.login_getstyle;
pub const pledge = openbsd.pledge;
pub const pw_dup = openbsd.pw_dup;
pub const setclasscontext = openbsd.setclasscontext;
pub const setpassent = openbsd.setpassent;
pub const setusercontext = openbsd.setusercontext;
pub const uid_from_user = openbsd.uid_from_user;
pub const unveil = openbsd.unveil;
pub const user_from_uid = openbsd.user_from_uid;

pub const CAP_RIGHTS_VERSION = freebsd.CAP_RIGHTS_VERSION;
pub const KINFO_FILE_SIZE = freebsd.KINFO_FILE_SIZE;
pub const UMTX_ABSTIME = freebsd.UMTX_ABSTIME;
pub const UMTX_OP = freebsd.UMTX_OP;
pub const _umtx_op = freebsd._umtx_op;
pub const _umtx_time = freebsd._umtx_time;
pub const cap_rights = freebsd.cap_rights;
pub const fflags_t = freebsd.fflags_t;
pub const fsblkcnt_t = freebsd.fsblkcnt_t;
pub const fsfilcnt_t = freebsd.fsfilcnt_t;
pub const kinfo_file = freebsd.kinfo_file;
pub const kinfo_getfile = freebsd.kinfo_getfile;

pub const CALENDAR_CLOCK = darwin.CALENDAR_CLOCK;
pub const COPYFILE = darwin.COPYFILE;
pub const CPUFAMILY = darwin.CPUFAMILY;
pub const PT = darwin.PT;
pub const DB_RECORDTYPE = darwin.DB_RECORDTYPE;
pub const EXC = darwin.EXC;
pub const EXCEPTION = darwin.EXCEPTION;
pub const KEVENT = darwin.KEVENT;
pub const MACH = darwin.MACH;
pub const MACH_MSG_TYPE = darwin.MACH_MSG_TYPE;
pub const MACH_PORT_RIGHT = darwin.MACH_PORT_RIGHT;
pub const MACH_TASK_BASIC_INFO = darwin.MACH_TASK_BASIC_INFO;
pub const MACH_TASK_BASIC_INFO_COUNT = darwin.MACH_TASK_BASIC_INFO_COUNT;
pub const MATTR = darwin.MATTR;
pub const NSVersionOfRunTimeLibrary = darwin.NSVersionOfRunTimeLibrary;
pub const OPEN_MAX = darwin.OPEN_MAX;
pub const OS = darwin.OS;
pub const POSIX_SPAWN = darwin.POSIX_SPAWN;
pub const SYSPROTO_EVENT = darwin.SYSPROTO_EVENT;
pub const SYSPROTO_CONTROL = darwin.SYSPROTO_CONTROL;
pub const TASK = darwin.TASK;
pub const TASK_NULL = darwin.TASK_NULL;
pub const TASK_VM_INFO = darwin.TASK_VM_INFO;
pub const TASK_VM_INFO_COUNT = darwin.TASK_VM_INFO_COUNT;
pub const THREAD = darwin.THREAD;
pub const THREAD_BASIC_INFO = darwin.THREAD_BASIC_INFO;
pub const THREAD_BASIC_INFO_COUNT = darwin.THREAD_BASIC_INFO_COUNT;
pub const THREAD_IDENTIFIER_INFO_COUNT = darwin.THREAD_IDENTIFIER_INFO_COUNT;
pub const THREAD_NULL = darwin.THREAD_NULL;
pub const THREAD_STATE_NONE = darwin.THREAD_STATE_NONE;
pub const UL = darwin.UL;
pub const VM = darwin.VM;
pub const _NSGetExecutablePath = darwin._NSGetExecutablePath;
pub const __getdirentries64 = darwin.__getdirentries64;
pub const __ulock_wait = darwin.__ulock_wait;
pub const __ulock_wait2 = darwin.__ulock_wait2;
pub const __ulock_wake = darwin.__ulock_wake;
pub const _dyld_get_image_header = darwin._dyld_get_image_header;
pub const _dyld_get_image_name = darwin._dyld_get_image_name;
pub const _dyld_get_image_vmaddr_slide = darwin._dyld_get_image_vmaddr_slide;
pub const _dyld_image_count = darwin._dyld_image_count;
pub const _dyld_get_image_header_containing_address = darwin._dyld_get_image_header_containing_address;
pub const dyld_image_path_containing_address = darwin.dyld_image_path_containing_address;
pub const _host_page_size = darwin._host_page_size;
pub const boolean_t = darwin.boolean_t;
pub const clock_get_time = darwin.clock_get_time;
pub const clock_serv_t = darwin.clock_serv_t;
pub const clock_res_t = darwin.clock_res_t;
pub const @"close$NOCANCEL" = darwin.@"close$NOCANCEL";
pub const dispatch = darwin.dispatch;
pub const fcopyfile = darwin.fcopyfile;
pub const renameatx_np = darwin.renameatx_np;
pub const host_t = darwin.host_t;
pub const integer_t = darwin.integer_t;
pub const ipc_space_t = darwin.ipc_space_t;
pub const ipc_space_port_t = darwin.ipc_space_port_t;
pub const kern_return_t = darwin.kern_return_t;
pub const vm_size_t = darwin.vm_size_t;
pub const kevent64 = darwin.kevent64;
pub const kevent64_s = darwin.kevent64_s;
pub const mach_absolute_time = darwin.mach_absolute_time;
pub const mach_continuous_time = darwin.mach_continuous_time;
pub const mach_hdr = darwin.mach_hdr;
pub const mach_host_self = darwin.mach_host_self;
pub const mach_msg = darwin.mach_msg;
pub const mach_msg_return_t = darwin.mach_msg_return_t;
pub const mach_msg_type_number_t = darwin.mach_msg_type_number_t;
pub const mach_port_allocate = darwin.mach_port_allocate;
pub const mach_port_array_t = darwin.mach_port_array_t;
pub const mach_port_deallocate = darwin.mach_port_deallocate;
pub const mach_port_insert_right = darwin.mach_port_insert_right;
pub const mach_port_name_t = darwin.mach_port_name_t;
pub const mach_port_t = darwin.mach_port_t;
pub const mach_task_basic_info = darwin.mach_task_basic_info;
pub const mach_task_self = darwin.mach_task_self;
pub const mach_timebase_info = darwin.mach_timebase_info;
pub const mach_timebase_info_data = darwin.mach_timebase_info_data;
pub const mach_timespec_t = darwin.mach_timespec_t;
pub const mach_vm_address_t = darwin.mach_vm_address_t;
pub const mach_vm_protect = darwin.mach_vm_protect;
pub const mach_vm_read = darwin.mach_vm_read;
pub const mach_vm_region = darwin.mach_vm_region;
pub const mach_vm_region_recurse = darwin.mach_vm_region_recurse;
pub const mach_vm_size_t = darwin.mach_vm_size_t;
pub const mach_vm_write = darwin.mach_vm_write;
pub const natural_t = darwin.natural_t;
pub const os_log_create = darwin.os_log_create;
pub const os_log_t = darwin.os_log_t;
pub const os_log_type_enabled = darwin.os_log_type_enabled;
pub const os_log_type_t = darwin.os_log_type_t;
pub const os_signpost_enabled = darwin.os_signpost_enabled;
pub const os_signpost_id_generate = darwin.os_signpost_id_generate;
pub const os_signpost_id_make_with_pointer = darwin.os_signpost_id_make_with_pointer;
pub const os_signpost_id_t = darwin.os_signpost_id_t;
pub const os_signpost_interval_begin = darwin.os_signpost_interval_begin;
pub const os_signpost_interval_end = darwin.os_signpost_interval_end;
pub const os_unfair_lock = darwin.os_unfair_lock;
pub const os_unfair_lock_assert_not_owner = darwin.os_unfair_lock_assert_not_owner;
pub const os_unfair_lock_assert_owner = darwin.os_unfair_lock_assert_owner;
pub const os_unfair_lock_lock = darwin.os_unfair_lock_lock;
pub const os_unfair_lock_t = darwin.os_unfair_lock_t;
pub const os_unfair_lock_trylock = darwin.os_unfair_lock_trylock;
pub const os_unfair_lock_unlock = darwin.os_unfair_lock_unlock;
pub const pid_for_task = darwin.pid_for_task;
pub const posix_spawn = darwin.posix_spawn;
pub const posix_spawn_file_actions_addchdir_np = darwin.posix_spawn_file_actions_addchdir_np;
pub const posix_spawn_file_actions_addclose = darwin.posix_spawn_file_actions_addclose;
pub const posix_spawn_file_actions_adddup2 = darwin.posix_spawn_file_actions_adddup2;
pub const posix_spawn_file_actions_addfchdir_np = darwin.posix_spawn_file_actions_addfchdir_np;
pub const posix_spawn_file_actions_addinherit_np = darwin.posix_spawn_file_actions_addinherit_np;
pub const posix_spawn_file_actions_addopen = darwin.posix_spawn_file_actions_addopen;
pub const posix_spawn_file_actions_destroy = darwin.posix_spawn_file_actions_destroy;
pub const posix_spawn_file_actions_init = darwin.posix_spawn_file_actions_init;
pub const posix_spawn_file_actions_t = darwin.posix_spawn_file_actions_t;
pub const posix_spawnattr_destroy = darwin.posix_spawnattr_destroy;
pub const posix_spawnattr_getflags = darwin.posix_spawnattr_getflags;
pub const posix_spawnattr_getpgroup = darwin.posix_spawnattr_getpgroup;
pub const posix_spawnattr_init = darwin.posix_spawnattr_init;
pub const posix_spawnattr_setflags = darwin.posix_spawnattr_setflags;
pub const posix_spawnattr_setpgroup = darwin.posix_spawnattr_setpgroup;
pub const posix_spawnattr_t = darwin.posix_spawnattr_t;
pub const posix_spawnp = darwin.posix_spawnp;
pub const pthread_attr_get_qos_class_np = darwin.pthread_attr_get_qos_class_np;
pub const pthread_attr_set_qos_class_np = darwin.pthread_attr_set_qos_class_np;
pub const pthread_get_qos_class_np = darwin.pthread_get_qos_class_np;
pub const pthread_set_qos_class_self_np = darwin.pthread_set_qos_class_self_np;
pub const qos_class_t = darwin.qos_class_t;
pub const task_flavor_t = darwin.task_flavor_t;
pub const task_for_pid = darwin.task_for_pid;
pub const task_get_exception_ports = darwin.task_get_exception_ports;
pub const task_info = darwin.task_info;
pub const task_info_t = darwin.task_info_t;
pub const task_name_t = darwin.task_name_t;
pub const task_resume = darwin.task_resume;
pub const task_set_exception_ports = darwin.task_set_exception_ports;
pub const task_suspend = darwin.task_suspend;
pub const task_threads = darwin.task_threads;
pub const task_vm_info_data_t = darwin.task_vm_info_data_t;
pub const thread_basic_info = darwin.thread_basic_info;
pub const thread_get_state = darwin.thread_get_state;
pub const thread_identifier_info = darwin.thread_identifier_info;
pub const thread_info = darwin.thread_info;
pub const thread_info_t = darwin.thread_info_t;
pub const thread_resume = darwin.thread_resume;
pub const thread_set_state = darwin.thread_set_state;
pub const vm_address_t = darwin.vm_address_t;
pub const vm_deallocate = darwin.vm_deallocate;
pub const vm_machine_attribute = darwin.vm_machine_attribute;
pub const vm_machine_attribute_t = darwin.vm_machine_attribute_t;
pub const vm_machine_attribute_val_t = darwin.vm_machine_attribute_val_t;
pub const vm_map_t = darwin.vm_map_t;
pub const vm_offset_t = darwin.vm_offset_t;
pub const vm_prot_t = darwin.vm_prot_t;
pub const vm_region_basic_info_64 = darwin.vm_region_basic_info_64;
pub const vm_region_extended_info = darwin.vm_region_extended_info;
pub const vm_region_info_t = darwin.vm_region_info_t;
pub const vm_region_recurse_info_t = darwin.vm_region_recurse_info_t;
pub const vm_region_submap_info_64 = darwin.vm_region_submap_info_64;
pub const vm_region_submap_short_info_64 = darwin.vm_region_submap_short_info_64;
pub const vm_region_top_info = darwin.vm_region_top_info;

pub const exception_behavior_array_t = darwin.exception_behavior_array_t;
pub const exception_behavior_t = darwin.exception_behavior_t;
pub const exception_data_t = darwin.exception_data_t;
pub const exception_data_type_t = darwin.exception_data_type_t;
pub const exception_flavor_array_t = darwin.exception_flavor_array_t;
pub const exception_handler_array_t = darwin.exception_handler_array_t;
pub const exception_handler_t = darwin.exception_handler_t;
pub const exception_mask_array_t = darwin.exception_mask_array_t;
pub const exception_mask_t = darwin.exception_mask_t;
pub const exception_port_array_t = darwin.exception_port_array_t;
pub const exception_port_t = darwin.exception_port_t;
pub const exception_type_t = darwin.exception_type_t;
pub const mach_exception_data_t = darwin.mach_exception_data_t;
pub const mach_exception_data_type_t = darwin.mach_exception_data_type_t;
pub const mach_msg_bits_t = darwin.mach_msg_bits_t;
pub const mach_msg_id_t = darwin.mach_msg_id_t;
pub const mach_msg_header_t = darwin.mach_msg_header_t;
pub const mach_msg_option_t = darwin.mach_msg_option_t;
pub const mach_msg_size_t = darwin.mach_msg_size_t;
pub const mach_msg_timeout_t = darwin.mach_msg_timeout_t;
pub const mach_msg_type_name_t = darwin.mach_msg_type_name_t;
pub const mach_port_right_t = darwin.mach_port_right_t;
pub const memory_object_offset_t = darwin.memory_object_offset_t;
pub const policy_t = darwin.policy_t;
pub const task_policy_flavor_t = darwin.task_policy_flavor_t;
pub const task_policy_t = darwin.task_policy_t;
pub const task_read_t = darwin.task_read_t;
pub const task_t = darwin.task_t;
pub const thread_act_t = darwin.thread_act_t;
pub const thread_flavor_t = darwin.thread_flavor_t;
pub const thread_port_t = darwin.thread_port_t;
pub const thread_state_flavor_t = darwin.thread_state_flavor_t;
pub const thread_state_t = darwin.thread_state_t;
pub const thread_t = darwin.thread_t;
pub const time_value_t = darwin.time_value_t;
pub const vm32_object_id_t = darwin.vm32_object_id_t;
pub const vm_behavior_t = darwin.vm_behavior_t;
pub const vm_inherit_t = darwin.vm_inherit_t;
pub const vm_map_read_t = darwin.vm_map_read_t;
pub const vm_object_id_t = darwin.vm_object_id_t;
pub const vm_region_flavor_t = darwin.vm_region_flavor_t;

pub const _ksiginfo = netbsd._ksiginfo;
pub const _lwp_self = netbsd._lwp_self;
pub const _lwp_park = netbsd.___lwp_park60;
pub const _lwp_unpark = netbsd._lwp_unpark;
pub const _lwp_unpark_all = netbsd._lwp_unpark_all;
pub const lwpid_t = netbsd.lwpid_t;

pub const lwp_gettid = dragonfly.lwp_gettid;
pub const umtx_sleep = dragonfly.umtx_sleep;
pub const umtx_wakeup = dragonfly.umtx_wakeup;

pub const PERF_EVENT = serenity.PERF_EVENT;
pub const disown = serenity.disown;
pub const profiling_enable = serenity.profiling_enable;
pub const profiling_disable = serenity.profiling_disable;
pub const profiling_free_buffer = serenity.profiling_free_buffer;
pub const purge = serenity.purge;
pub const perf_event = serenity.perf_event;
pub const perf_register_string = serenity.perf_register_string;
pub const get_stack_bounds = serenity.get_stack_bounds;
pub const anon_create = serenity.anon_create;
pub const getkeymap = serenity.getkeymap;
pub const setkeymap = serenity.setkeymap;

/// 由两个或多个操作系统共享的外部定义。
const private = struct {
    pub extern "c" fn strdup(s: [*:0]const c_char) ?[*:0]c_char;
    pub extern "c" fn _strdup(s: [*:0]const c_char) ?[*:0]c_char;
    pub extern "c" fn wcsdup(s: [*:0]const wchar_t) ?[*:0]wchar_t;
    pub extern "c" fn _wcsdup(s: [*:0]const wchar_t) ?[*:0]wchar_t;

    pub extern "c" fn swab(noalias from: *const anyopaque, noalias to: *anyopaque, n: isize) void;
    pub extern "c" fn _swab(noalias from: *const anyopaque, noalias to: *anyopaque, n: isize) void;

    extern "c" fn close(fd: fd_t) c_int;
    extern "c" fn clock_getres(clk_id: clockid_t, tp: *timespec) c_int;
    extern "c" fn clock_gettime(clk_id: clockid_t, tp: *timespec) c_int;
    extern "c" fn copy_file_range(fd_in: fd_t, off_in: ?*i64, fd_out: fd_t, off_out: ?*i64, len: usize, flags: c_uint) isize;
    extern "c" fn flock(fd: fd_t, operation: c_int) c_int;
    extern "c" fn fork() c_int;
    extern "c" fn fstat(fd: fd_t, buf: *Stat) c_int;
    extern "c" fn fstatat(dirfd: fd_t, path: [*:0]const u8, buf: *Stat, flag: u32) c_int;
    extern "c" fn getdirentries(fd: fd_t, buf_ptr: [*]u8, nbytes: usize, basep: *i64) isize;
    extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) switch (native_os) {
        .freebsd => isize,
        .illumos => usize,
        else => c_int,
    };
    extern "c" fn getrusage(who: c_int, usage: *rusage) c_int;
    extern "c" fn gettimeofday(noalias tv: ?*timeval, noalias tz: ?*timezone) c_int;
    extern "c" fn ioctl(fd: fd_t, request: c_int, ...) c_int;
    extern "c" fn msync(addr: *align(page_size) const anyopaque, len: usize, flags: c_int) c_int;
    extern "c" fn nanosleep(rqtp: *const timespec, rmtp: ?*timespec) c_int;
    extern "c" fn clock_nanosleep(clockid: clockid_t, flags: TIMER, t: *const timespec, remain: ?*timespec) c_int;
    extern "c" fn pipe2(fds: *[2]fd_t, flags: O) c_int;
    extern "c" fn readdir(dir: *DIR) ?*dirent;
    extern "c" fn realpath(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8;
    extern "c" fn recvmsg(sockfd: fd_t, msg: *msghdr, flags: u32) isize;
    extern "c" fn sched_yield() c_int;
    extern "c" fn sendfile(out_fd: fd_t, in_fd: fd_t, offset: ?*off_t, count: usize) isize;
    extern "c" fn sigaction(sig: SIG, noalias act: ?*const Sigaction, noalias oact: ?*Sigaction) c_int;
    extern "c" fn sigdelset(set: ?*sigset_t, signo: SIG) c_int;
    extern "c" fn sigaddset(set: ?*sigset_t, signo: SIG) c_int;
    extern "c" fn sigfillset(set: ?*sigset_t) c_int;
    extern "c" fn sigemptyset(set: ?*sigset_t) c_int;
    extern "c" fn sigismember(set: ?*const sigset_t, signo: SIG) c_int;
    extern "c" fn sigprocmask(how: c_int, noalias set: ?*const sigset_t, noalias oset: ?*sigset_t) c_int;
    extern "c" fn socket(domain: c_uint, sock_type: c_uint, protocol: c_uint) c_int;
    extern "c" fn socketpair(domain: c_uint, sock_type: c_uint, protocol: c_uint, sv: *[2]fd_t) c_int;
    extern "c" fn sigaltstack(ss: ?*const stack_t, old_ss: ?*stack_t) c_int;
    extern "c" fn sysconf(sc: c_int) c_long;
    extern "c" fn shm_open(name: [*:0]const u8, flag: c_int, mode: mode_t) c_int;
    extern "c" fn wait4(pid: pid_t, status: ?*c_int, options: c_int, ru: ?*rusage) pid_t;

    extern "c" fn pthread_setname_np(thread: pthread_t, name: [*:0]const u8) c_int;

    extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize;
    extern "c" fn getentropy(buffer: [*]u8, size: usize) c_int;
    extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void;

    extern "c" fn _msize(?*const anyopaque) usize;
    extern "c" fn malloc_size(?*const anyopaque) usize;
    extern "c" fn malloc_usable_size(?*const anyopaque) usize;
    extern "c" fn posix_memalign(memptr: *?*anyopaque, alignment: usize, size: usize) c_int;

    extern "c" fn mlock(addr: *align(page_size) const anyopaque, len: usize) c_int;
    extern "c" fn mlock2(addr: *align(page_size) const anyopaque, len: usize, flags: MLOCK) c_int;
    extern "c" fn munlock(addr: *align(page_size) const anyopaque, len: usize) c_int;
    extern "c" fn mlockall(flags: MCL) c_int;
    extern "c" fn munlockall() c_int;

    // Linux 及 https://github.com/SerenityOS/serenity/blob/502caef9a40bccc7459f9835f2174a601106299a/Userland/Libraries/LibC/sys/ptrace.cpp
    extern "c" fn ptrace(request: c_int, pid: pid_t, addr: ?*anyopaque, data: ?*anyopaque) c_long;

    /// macOS 现代化符号。
    /// x86_64 链接到带 $INODE64 后缀的符号,以支持 64 位。
    /// 注意,aarch64 不需要这些符号。
    extern "c" fn @"fstat$INODE64"(fd: fd_t, buf: *Stat) c_int;
    extern "c" fn @"fstatat$INODE64"(dirfd: fd_t, path: [*:0]const u8, buf: *Stat, flag: u32) c_int;
    extern "c" fn @"readdir$INODE64"(dir: *DIR) ?*dirent;
    extern "c" fn @"stat$INODE64"(noalias path: [*:0]const u8, noalias buf: *Stat) c_int;
    extern "c" fn stat(noalias path: [*:0]const u8, noalias buf: *Stat) c_int;

    /// macOS 的现代化符号。
    extern "c" fn @"realpath$DARWIN_EXTSN"(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8;
    extern "c" fn __getdirentries64(fd: fd_t, buf_ptr: [*]u8, buf_len: usize, basep: *i64) isize;

    extern "c" fn pthread_threadid_np(thread: ?pthread_t, thread_id: *u64) c_int;

    /// NetBSD 的现代化符号。
    extern "c" fn __clock_getres50(clk_id: clockid_t, tp: *timespec) c_int;
    extern "c" fn __clock_gettime50(clk_id: clockid_t, tp: *timespec) c_int;
    extern "c" fn __fstat50(fd: fd_t, buf: *Stat) c_int;
    extern "c" fn __getrusage50(who: c_int, usage: *rusage) c_int;
    extern "c" fn __gettimeofday50(noalias tv: ?*timeval, noalias tz: ?*timezone) c_int;
    extern "c" fn __libc_thr_yield() c_int;
    extern "c" fn __msync13(addr: *align(page_size) const anyopaque, len: usize, flags: c_int) c_int;
    extern "c" fn __nanosleep50(rqtp: *const timespec, rmtp: ?*timespec) c_int;
    extern "c" fn __sigaction14(sig: SIG, noalias act: ?*const Sigaction, noalias oact: ?*Sigaction) c_int;
    extern "c" fn __sigemptyset14(set: ?*sigset_t) c_int;
    extern "c" fn __sigfillset14(set: ?*sigset_t) c_int;
    extern "c" fn __sigprocmask14(how: c_int, noalias set: ?*const sigset_t, noalias oset: ?*sigset_t) c_int;
    extern "c" fn __socket30(domain: c_uint, sock_type: c_uint, protocol: c_uint) c_int;
    extern "c" fn __stat50(path: [*:0]const u8, buf: *Stat) c_int;
    extern "c" fn __getdents30(fd: c_int, buf_ptr: [*]u8, nbytes: usize) c_int;
    extern "c" fn __sigaltstack14(ss: ?*const stack_t, old_ss: ?*stack_t) c_int;
    extern "c" fn __wait450(pid: pid_t, status: ?*c_int, options: c_int, ru: ?*rusage) pid_t;

    extern "c" fn __libc_current_sigrtmin() c_int;
    extern "c" fn __libc_current_sigrtmax() c_int;
    extern "c" fn __signal_get_sigrtmin() c_int;
    extern "c" fn __signal_get_sigrtmax() c_int;

    // 每当某个操作系统又为 errno 位置选择独有的
    // 符号名称时,别忘了再添一个小丑!
    // 🤡🤡🤡🤡🤡🤡

    extern "c" fn ___errno() *c_int;
    extern "c" fn __errno() *c_int;
    extern "c" fn __errno_location() *c_int;
    extern "c" fn __error() *c_int;
    extern "c" fn _errno() *c_int;

    extern threadlocal var errno: c_int;

    fn errnoFromThreadLocal() *c_int {
        return &private.errno;
    }
};