Skip to content
Standard libraryZig 0.17.0Official documentation
Sourcestd/c.zig

Source line 1

std.c.__getdirentries64

alias

Source line 11780

Alias of std.c.darwin.__getdirentries64

std.c.__ulock_wait

alias

Source line 11781

Alias of std.c.darwin.__ulock_wait

std.c.__ulock_wait2

alias

Source line 11782

Alias of std.c.darwin.__ulock_wait2

std.c.__ulock_wake

alias

Source line 11783

Alias of std.c.darwin.__ulock_wake

std.c._dyld_get_image_header

alias

Source line 11784

Alias of std.c.darwin._dyld_get_image_header

std.c._dyld_get_image_header_containing_address

alias

Source line 11788

Alias of std.c.darwin._dyld_get_image_header_containing_address

std.c._dyld_get_image_name

alias

Source line 11785

Alias of std.c.darwin._dyld_get_image_name

std.c._dyld_get_image_vmaddr_slide

alias

Source line 11786

Alias of std.c.darwin._dyld_get_image_vmaddr_slide

std.c._dyld_image_count

alias

Source line 11787

Alias of std.c.darwin._dyld_image_count

std.c._errno

constant

Source line 7335

std.c._exit

function

Source line 11066

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

Parameters

code: c_int

std.c._Exit

function

Source line 11065

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

Parameters

code: c_int

std.c._host_page_size

alias

Source line 11790

Alias of std.c.darwin._host_page_size

std.c._kern_acquire_sem_etc

alias

Source line 11652

Alias of std.c.haiku._kern_acquire_sem_etc

std.c._kern_create_sem

alias

Source line 11653

Alias of std.c.haiku._kern_create_sem

std.c._kern_delete_sem

alias

Source line 11654

Alias of std.c.haiku._kern_delete_sem

std.c._kern_open_dir

alias

Source line 11655

Alias of std.c.haiku._kern_open_dir

std.c._kern_read_dir

alias

Source line 11656

Alias of std.c.haiku._kern_read_dir

std.c._kern_read_stat

alias

Source line 11657

Alias of std.c.haiku._kern_read_stat

std.c._kern_release_sem_etc

alias

Source line 11658

Alias of std.c.haiku._kern_release_sem_etc

std.c._kern_rewind_dir

alias

Source line 11659

Alias of std.c.haiku._kern_rewind_dir

std.c._ksiginfo

alias

Source line 11950

Alias of std.c.netbsd._ksiginfo

std.c._lwp_park

alias

Source line 11952

Alias of std.c.netbsd.___lwp_park60

std.c._lwp_self

alias

Source line 11951

Alias of std.c.netbsd._lwp_self

std.c._lwp_unpark

alias

Source line 11953

Alias of std.c.netbsd._lwp_unpark

std.c._lwp_unpark_all

alias

Source line 11954

Alias of std.c.netbsd._lwp_unpark_all

std.c._mh_execute_header

variable

Source line 42

The value of the link editor defined symbol _MH_EXECUTE_SYM is the address of the mach header in a Mach-O executable file type. It does not appear in any file type other than a MH_EXECUTE file type. The type of the symbol is absolute as the header is not part of any section. This symbol is populated when linking the system's libc, which is guaranteed on this operating system. However when building object files or libraries, the system libc won't be linked until the final executable. So we export a weak symbol here, to be overridden by the real one.

mach_hdr

std.c._msize

constant

Source line 11013

std.c._NSGetExecutablePath

alias

Source line 11779

Alias of std.c.darwin._NSGetExecutablePath

std.c._SC

type

Source line 2681

std.c._umtx_op

alias

Source line 11738

Alias of std.c.freebsd._umtx_op

std.c._umtx_time

alias

Source line 11739

Alias of std.c.freebsd._umtx_time

std.c.@"close$NOCANCEL"

alias

Source line 11795

Alias of std.c.darwin.@"close$NOCANCEL"

std.c.abort

function

Source line 11063

pub extern "c" fn abort() noreturn

std.c.abs

function

Source line 11577

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

Parameters

a: c_int

std.c.accept

function

Source line 11158

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

Parameters

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

std.c.accept_filter_arg

type

Source line 4141

std.c.accept4

function

Source line 11159

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

Parameters

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

std.c.access

function

Source line 11116

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

Parameters

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

std.c.addrinfo

type

Source line 4992

std.c.AF

type

Source line 5417

std.c.AF_SUN

alias

Source line 11620

Alias of std.c.illumos.AF_SUN

std.c.AF.@"802"

constant

Source line 5573

std.c.AF.ALG

constant

Source line 5456

std.c.AF.APPLETALK

constant

Source line 5424

std.c.AF.APPLETALK

constant

Source line 5485

std.c.AF.APPLETALK

constant

Source line 5525

std.c.AF.APPLETALK

constant

Source line 5571

std.c.AF.APPLETALK

constant

Source line 5610

std.c.AF.APPLETALK

constant

Source line 5647

std.c.AF.APPLETALK

constant

Source line 5666

std.c.AF.APPLETALK

constant

Source line 5683

std.c.AF.ARP

constant

Source line 5545

std.c.AF.ARP

constant

Source line 5620

std.c.AF.ASH

constant

Source line 5438

std.c.AF.ATM

constant

Source line 5540

std.c.AF.ATM

constant

Source line 5657

std.c.AF.ATMPVC

constant

Source line 5427

std.c.AF.ATMSVC

constant

Source line 5440

std.c.AF.AX25

constant

Source line 5422

std.c.AF.BLUETOOTH

constant

Source line 5449

std.c.AF.BLUETOOTH

constant

Source line 5546

std.c.AF.BLUETOOTH

constant

Source line 5621

std.c.AF.BLUETOOTH

constant

Source line 5659

std.c.AF.BLUETOOTH

constant

Source line 5675

std.c.AF.BLUETOOTH

constant

Source line 5689

std.c.AF.BRIDGE

constant

Source line 5426

std.c.AF.CAIF

constant

Source line 5455

std.c.AF.CAN

constant

Source line 5447

std.c.AF.CAN

constant

Source line 5625

std.c.AF.CCITT

constant

Source line 5479

std.c.AF.CCITT

constant

Source line 5519

std.c.AF.CCITT

constant

Source line 5565

std.c.AF.CCITT

constant

Source line 5604

std.c.AF.CCITT

constant

Source line 5642

std.c.AF.CHAOS

constant

Source line 5473

std.c.AF.CHAOS

constant

Source line 5513

std.c.AF.CHAOS

constant

Source line 5560

std.c.AF.CHAOS

constant

Source line 5598

std.c.AF.CHAOS

constant

Source line 5637

std.c.AF.CNT

constant

Source line 5490

std.c.AF.CNT

constant

Source line 5530

std.c.AF.CNT

constant

Source line 5614

std.c.AF.CNT

constant

Source line 5651

std.c.AF.COIP

constant

Source line 5489

std.c.AF.COIP

constant

Source line 5529

std.c.AF.COIP

constant

Source line 5613

std.c.AF.COIP

constant

Source line 5650

std.c.AF.DATAKIT

constant

Source line 5478

std.c.AF.DATAKIT

constant

Source line 5518

std.c.AF.DATAKIT

constant

Source line 5564

std.c.AF.DATAKIT

constant

Source line 5603

std.c.AF.DATAKIT

constant

Source line 5641

std.c.AF.DECnet

constant

Source line 5431

std.c.AF.DECnet

constant

Source line 5481

std.c.AF.DECnet

constant

Source line 5521

std.c.AF.DECnet

constant

Source line 5567

std.c.AF.DECnet

constant

Source line 5606

std.c.AF.DLI

constant

Source line 5482

std.c.AF.DLI

constant

Source line 5522

std.c.AF.DLI

constant

Source line 5568

std.c.AF.DLI

constant

Source line 5607

std.c.AF.DLI

constant

Source line 5644

std.c.AF.DLI

constant

Source line 5670

std.c.AF.E164

alias

Source line 5496

Alias of std.c.AF.ISDN

std.c.AF.E164

alias

Source line 5536

Alias of std.c.AF.ISDN

std.c.AF.E164

alias

Source line 5618

Alias of std.c.AF.ISDN

std.c.AF.ECMA

constant

Source line 5477

std.c.AF.ECMA

constant

Source line 5517

std.c.AF.ECMA

constant

Source line 5563

std.c.AF.ECMA

constant

Source line 5602

std.c.AF.ECMA

constant

Source line 5640

std.c.AF.ECONET

constant

Source line 5439

std.c.AF.ETHER

constant

Source line 5626

std.c.AF.FILE

alias

Source line 5509

Alias of std.c.AF.LOCAL

std.c.AF.FILE

alias

Source line 5556

Alias of std.c.AF.UNIX

std.c.AF.GOSIP

constant

Source line 5577

std.c.AF.HYLINK

constant

Source line 5484

std.c.AF.HYLINK

constant

Source line 5524

std.c.AF.HYLINK

constant

Source line 5570

std.c.AF.HYLINK

constant

Source line 5609

std.c.AF.HYLINK

constant

Source line 5646

std.c.AF.IEEE80211

constant

Source line 5547

std.c.AF.IEEE80211

constant

Source line 5622

std.c.AF.IEEE802154

constant

Source line 5454

std.c.AF.IMPLINK

constant

Source line 5471

std.c.AF.IMPLINK

constant

Source line 5511

std.c.AF.IMPLINK

constant

Source line 5558

std.c.AF.IMPLINK

constant

Source line 5596

std.c.AF.IMPLINK

constant

Source line 5635

std.c.AF.INET

constant

Source line 5421

std.c.AF.INET

constant

Source line 5469

std.c.AF.INET

constant

Source line 5510

std.c.AF.INET

constant

Source line 5557

std.c.AF.INET

constant

Source line 5595

std.c.AF.INET

constant

Source line 5634

std.c.AF.INET

constant

Source line 5665

std.c.AF.INET

constant

Source line 5682

std.c.AF.INET

constant

Source line 5698

std.c.AF.INET_OFFLOAD

constant

Source line 5585

std.c.AF.INET_SDP

constant

Source line 5548

std.c.AF.INET6

constant

Source line 5429

std.c.AF.INET6

constant

Source line 5498

std.c.AF.INET6

constant

Source line 5538

std.c.AF.INET6

constant

Source line 5581

std.c.AF.INET6

constant

Source line 5616

std.c.AF.INET6

constant

Source line 5655

std.c.AF.INET6

constant

Source line 5669

std.c.AF.INET6

constant

Source line 5684

std.c.AF.INET6

constant

Source line 5699

std.c.AF.INET6_SDP

constant

Source line 5549

std.c.AF.IPX

constant

Source line 5423

std.c.AF.IPX

constant

Source line 5492

std.c.AF.IPX

constant

Source line 5532

std.c.AF.IPX

constant

Source line 5578

std.c.AF.IPX

constant

Source line 5615

std.c.AF.IPX

constant

Source line 5652

std.c.AF.IPX

constant

Source line 5671

std.c.AF.IRDA

constant

Source line 5443

std.c.AF.ISDN

constant

Source line 5452

std.c.AF.ISDN

constant

Source line 5495

std.c.AF.ISDN

constant

Source line 5535

std.c.AF.ISDN

constant

Source line 5617

std.c.AF.ISDN

constant

Source line 5654

std.c.AF.ISDN

constant

Source line 5690

std.c.AF.ISO

constant

Source line 5475

std.c.AF.ISO

constant

Source line 5515

std.c.AF.ISO

constant

Source line 5600

std.c.AF.ISO

constant

Source line 5639

std.c.AF.IUCV

constant

Source line 5450

std.c.AF.KCM

constant

Source line 5459

std.c.AF.KEY

constant

Source line 5434

std.c.AF.KEY

constant

Source line 5497

std.c.AF.KEY

constant

Source line 5582

std.c.AF.KEY

constant

Source line 5685

std.c.AF.LAT

constant

Source line 5483

std.c.AF.LAT

constant

Source line 5523

std.c.AF.LAT

constant

Source line 5569

std.c.AF.LAT

constant

Source line 5608

std.c.AF.LAT

constant

Source line 5645

std.c.AF.LINK

constant

Source line 5487

std.c.AF.LINK

constant

Source line 5527

std.c.AF.LINK

constant

Source line 5580

std.c.AF.LINK

constant

Source line 5612

std.c.AF.LINK

constant

Source line 5649

std.c.AF.LINK

constant

Source line 5668

std.c.AF.LLC

constant

Source line 5446

std.c.AF.LOCAL

constant

Source line 5420

std.c.AF.LOCAL

constant

Source line 5467

std.c.AF.LOCAL

alias

Source line 5508

Alias of std.c.AF.UNIX

std.c.AF.LOCAL

alias

Source line 5555

Alias of std.c.AF.UNIX

std.c.AF.LOCAL

constant

Source line 5593

std.c.AF.LOCAL

constant

Source line 5633

std.c.AF.LOCAL

constant

Source line 5673

std.c.AF.LOCAL

alias

Source line 5681

Alias of std.c.AF.UNIX

std.c.AF.LOCAL

constant

Source line 5696

std.c.AF.LX_NETLINK

constant

Source line 5588

std.c.AF.MAX

constant

Source line 5461

std.c.AF.MAX

constant

Source line 5503

std.c.AF.MAX

constant

Source line 5550

std.c.AF.MAX

constant

Source line 5589

std.c.AF.MAX

constant

Source line 5627

std.c.AF.MAX

constant

Source line 5661

std.c.AF.MAX

constant

Source line 5676

std.c.AF.MAX

constant

Source line 5691

std.c.AF.MAX

constant

Source line 5700

std.c.AF.MPLS

constant

Source line 5623

std.c.AF.MPLS

constant

Source line 5660

std.c.AF.MPLS

constant

Source line 5688

std.c.AF.NATM

constant

Source line 5499

std.c.AF.NATM

constant

Source line 5539

std.c.AF.NATM

constant

Source line 5619

std.c.AF.NATM

constant

Source line 5656

std.c.AF.NBS

constant

Source line 5562

std.c.AF.NCA

constant

Source line 5583

std.c.AF.NETBEUI

constant

Source line 5432

std.c.AF.NETBIOS

constant

Source line 5501

std.c.AF.NETBIOS

constant

Source line 5514

std.c.AF.NETBIOS

constant

Source line 5638

std.c.AF.NETGRAPH

constant

Source line 5542

std.c.AF.NETGRAPH

constant

Source line 5658

std.c.AF.NETLINK

constant

Source line 5435

std.c.AF.NETROM

constant

Source line 5425

std.c.AF.NFC

constant

Source line 5457

std.c.AF.NIT

constant

Source line 5572

std.c.AF.NOTIFY

constant

Source line 5672

std.c.AF.NS

constant

Source line 5474

std.c.AF.NS

constant

Source line 5561

std.c.AF.NS

constant

Source line 5599

std.c.AF.OROUTE

constant

Source line 5611

std.c.AF.OSI

alias

Source line 5476

Alias of std.c.AF.ISO

std.c.AF.OSI

alias

Source line 5516

Alias of std.c.AF.ISO

std.c.AF.OSI

constant

Source line 5574

std.c.AF.OSI

alias

Source line 5601

Alias of std.c.AF.ISO

std.c.AF.OSI

alias

Source line 5631

Alias of std.c.AF.ISO

std.c.AF.OSINET

constant

Source line 5576

std.c.AF.PACKET

constant

Source line 5437

std.c.AF.PACKET

constant

Source line 5587

std.c.AF.PHONET

constant

Source line 5453

std.c.AF.PIP

constant

Source line 5494

std.c.AF.POLICY

constant

Source line 5584

std.c.AF.PPP

constant

Source line 5502

std.c.AF.PPPOX

constant

Source line 5444

std.c.AF.pseudo_HDRCMPLT

constant

Source line 5541

std.c.AF.pseudo_KEY

constant

Source line 5537

std.c.AF.pseudo_PIP

constant

Source line 5534

std.c.AF.pseudo_RTIP

constant

Source line 5531

std.c.AF.pseudo_XTP

constant

Source line 5528

std.c.AF.PUP

constant

Source line 5472

std.c.AF.PUP

constant

Source line 5512

std.c.AF.PUP

constant

Source line 5559

std.c.AF.PUP

constant

Source line 5597

std.c.AF.PUP

constant

Source line 5636

std.c.AF.QIPCRTR

constant

Source line 5460

std.c.AF.RDS

constant

Source line 5441

std.c.AF.ROSE

constant

Source line 5430

std.c.AF.ROUTE

alias

Source line 5436

Alias of std.c.AF.NETLINK

std.c.AF.ROUTE

constant

Source line 5486

std.c.AF.ROUTE

constant

Source line 5526

std.c.AF.ROUTE

constant

Source line 5579

std.c.AF.ROUTE

constant

Source line 5624

std.c.AF.ROUTE

constant

Source line 5648

std.c.AF.ROUTE

constant

Source line 5667

std.c.AF.ROUTE

constant

Source line 5686

std.c.AF.RTIP

constant

Source line 5491

std.c.AF.RXRPC

constant

Source line 5451

std.c.AF.SCLUSTER

constant

Source line 5544

std.c.AF.SECURITY

constant

Source line 5433

std.c.AF.SIP

constant

Source line 5493

std.c.AF.SIP

constant

Source line 5533

std.c.AF.SIP

constant

Source line 5653

std.c.AF.SLOW

constant

Source line 5543

std.c.AF.SNA

constant

Source line 5442

std.c.AF.SNA

constant

Source line 5480

std.c.AF.SNA

constant

Source line 5520

std.c.AF.SNA

constant

Source line 5566

std.c.AF.SNA

constant

Source line 5605

std.c.AF.SNA

constant

Source line 5643

std.c.AF.SNA

constant

Source line 5687

std.c.AF.SYS_CONTROL

constant

Source line 5470

std.c.AF.SYSTEM

constant

Source line 5500

std.c.AF.TIPC

constant

Source line 5448

std.c.AF.TRILL

constant

Source line 5586

std.c.AF.UNIX

constant

Source line 5419

std.c.AF.UNIX

alias

Source line 5468

Alias of std.c.AF.LOCAL

std.c.AF.UNIX

constant

Source line 5507

std.c.AF.UNIX

constant

Source line 5554

std.c.AF.UNIX

alias

Source line 5594

Alias of std.c.AF.LOCAL

std.c.AF.UNIX

alias

Source line 5632

Alias of std.c.AF.LOCAL

std.c.AF.UNIX

alias

Source line 5674

Alias of std.c.AF.LOCAL

std.c.AF.UNIX

constant

Source line 5680

std.c.AF.UNIX

alias

Source line 5697

Alias of std.c.AF.LOCAL

std.c.AF.UNSPEC

constant

Source line 5418

std.c.AF.UNSPEC

constant

Source line 5466

std.c.AF.UNSPEC

constant

Source line 5506

std.c.AF.UNSPEC

constant

Source line 5553

std.c.AF.UNSPEC

constant

Source line 5592

std.c.AF.UNSPEC

constant

Source line 5630

std.c.AF.UNSPEC

constant

Source line 5664

std.c.AF.UNSPEC

constant

Source line 5679

std.c.AF.UNSPEC

constant

Source line 5695

std.c.AF.VSOCK

constant

Source line 5458

std.c.AF.WANPIPE

constant

Source line 5445

std.c.AF.X25

constant

Source line 5428

std.c.AF.X25

constant

Source line 5575

std.c.AF.XTP

constant

Source line 5488

std.c.AI

type

Source line 7536

std.c.alarm

function

Source line 10577

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

Parameters

seconds: c_uint

std.c.anon_create

alias

Source line 11970

Alias of std.c.serenity.anon_create

std.c.arc4random_buf

constant

Source line 10641

std.c.ARCH

type

Source line 271

std.c.area_id

alias

Source line 11660

Alias of std.c.haiku.area_id

std.c.assert

alias

Source line 10

Alias of std.debug.assert

std.c.AT

type

Source line 8523

std.c.AT_SUN

alias

Source line 11621

Alias of std.c.illumos.AT_SUN

std.c.AT.BENEATH

constant

Source line 8554

Fail if not under dirfd

std.c.AT.EACCESS

constant

Source line 8532

Use effective ids in access check

std.c.AT.EACCESS

constant

Source line 8546

Check access using effective user and group ID

std.c.AT.EACCESS

constant

Source line 8562

Check access using effective user and group ID

std.c.AT.EACCESS

constant

Source line 8574

std.c.AT.EACCESS

constant

Source line 8583

Check access using effective user and group ID

std.c.AT.EACCESS

constant

Source line 8596

std.c.AT.EACCESS

constant

Source line 8611

Check access using effective user and group ID

std.c.AT.EACCESS

constant

Source line 8628

std.c.AT.EACCESS

constant

Source line 8644

std.c.AT.EMPTY_PATH

constant

Source line 8619

std.c.AT.FDCWD

constant

Source line 8530

std.c.AT.FDCWD

constant

Source line 8544

Magic value that specify the use of the current working directory to determine the target of relative file paths in the openat() and similar syscalls.

std.c.AT.FDCWD

constant

Source line 8560

Magic value that specify the use of the current working directory to determine the target of relative file paths in the openat() and similar syscalls.

std.c.AT.FDCWD

constant

Source line 8571

std.c.AT.FDCWD

constant

Source line 8581

Magic value that specify the use of the current working directory to determine the target of relative file paths in the openat() and similar syscalls.

std.c.AT.FDCWD

constant

Source line 8592

std.c.AT.FDCWD

constant

Source line 8602

Magic value that specify the use of the current working directory to determine the target of relative file paths in the openat() and similar syscalls.

fd_t

std.c.AT.FDCWD

constant

Source line 8614

std.c.AT.FDCWD

constant

Source line 8637

When linking libc, we follow their convention and use -2 for current working directory. However, without libc, Zig does a different convention: it assumes the current working directory is the first preopen. This behavior can be overridden with a public function called wasi_cwd in the root source file.

fd_t

std.c.AT.FDCWD

constant

Source line 8641

std.c.AT.NO_AUTOMOUNT

constant

Source line 8618

std.c.AT.RECURSIVE

constant

Source line 8624

std.c.AT.REMOVEDIR

constant

Source line 8527

Remove directory instead of unlinking file

std.c.AT.REMOVEDIR

constant

Source line 8538

Path refers to directory

std.c.AT.REMOVEDIR

constant

Source line 8552

Remove directory instead of file

std.c.AT.REMOVEDIR

constant

Source line 8568

Remove directory instead of file

std.c.AT.REMOVEDIR

constant

Source line 8573

std.c.AT.REMOVEDIR

constant

Source line 8589

Remove directory instead of file

std.c.AT.REMOVEDIR

constant

Source line 8595

std.c.AT.REMOVEDIR

constant

Source line 8608

Remove directory instead of file

std.c.AT.REMOVEDIR

constant

Source line 8616

std.c.AT.REMOVEDIR

constant

Source line 8631

std.c.AT.REMOVEDIR

constant

Source line 8643

std.c.AT.STATX_DONT_SYNC

constant

Source line 8623

std.c.AT.STATX_FORCE_SYNC

constant

Source line 8622

std.c.AT.STATX_SYNC_AS_STAT

constant

Source line 8621

std.c.AT.STATX_SYNC_TYPE

constant

Source line 8620

std.c.AT.SYMLINK_FOLLOW

constant

Source line 8536

Act on target of symlink

std.c.AT.SYMLINK_FOLLOW

constant

Source line 8550

Follow symbolic link

std.c.AT.SYMLINK_FOLLOW

constant

Source line 8566

Follow symbolic link

std.c.AT.SYMLINK_FOLLOW

constant

Source line 8575

std.c.AT.SYMLINK_FOLLOW

constant

Source line 8587

Follow symbolic link

std.c.AT.SYMLINK_FOLLOW

constant

Source line 8594

std.c.AT.SYMLINK_FOLLOW

constant

Source line 8606

Follow symbolic link

std.c.AT.SYMLINK_FOLLOW

constant

Source line 8617

std.c.AT.SYMLINK_FOLLOW

constant

Source line 8630

std.c.AT.SYMLINK_NOFOLLOW

constant

Source line 8534

Act on the symlink itself not the target

std.c.AT.SYMLINK_NOFOLLOW

constant

Source line 8548

Do not follow symbolic links

std.c.AT.SYMLINK_NOFOLLOW

constant

Source line 8564

Do not follow symbolic links

std.c.AT.SYMLINK_NOFOLLOW

constant

Source line 8572

std.c.AT.SYMLINK_NOFOLLOW

constant

Source line 8585

Do not follow symbolic links

std.c.AT.SYMLINK_NOFOLLOW

constant

Source line 8593

std.c.AT.SYMLINK_NOFOLLOW

constant

Source line 8604

Do not follow symbolic links

std.c.AT.SYMLINK_NOFOLLOW

constant

Source line 8615

std.c.AT.SYMLINK_NOFOLLOW

constant

Source line 8629

std.c.AT.SYMLINK_NOFOLLOW

constant

Source line 8642

std.c.AT.TRIGGER

constant

Source line 8609

std.c.atan

function

Source line 11605

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

Parameters

x: f64

std.c.atoi

function

Source line 11585

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

Parameters

str: [*:0]const c_char

std.c.atol

function

Source line 11586

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

Parameters

str: [*:0]const c_char

std.c.atoll

function

Source line 11587

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

Parameters

str: [*:0]const c_char

std.c.AUTH

alias

Source line 11673

Alias of std.c.openbsd.AUTH

std.c.auth_approval

alias

Source line 11678

Alias of std.c.openbsd.auth_approval

std.c.auth_call

alias

Source line 11679

Alias of std.c.openbsd.auth_call

std.c.auth_cat

alias

Source line 11680

Alias of std.c.openbsd.auth_cat

std.c.auth_challenge

alias

Source line 11681

Alias of std.c.openbsd.auth_challenge

std.c.auth_check_change

alias

Source line 11682

Alias of std.c.openbsd.auth_check_change

std.c.auth_check_expire

alias

Source line 11683

Alias of std.c.openbsd.auth_check_expire

std.c.auth_checknologin

alias

Source line 11684

Alias of std.c.openbsd.auth_checknologin

std.c.auth_clean

alias

Source line 11685

Alias of std.c.openbsd.auth_clean

std.c.auth_close

alias

Source line 11686

Alias of std.c.openbsd.auth_close

std.c.auth_clrenv

alias

Source line 11687

Alias of std.c.openbsd.auth_clrenv

std.c.auth_clroption

alias

Source line 11688

Alias of std.c.openbsd.auth_clroption

std.c.auth_clroptions

alias

Source line 11689

Alias of std.c.openbsd.auth_clroptions

std.c.auth_getitem

alias

Source line 11690

Alias of std.c.openbsd.auth_getitem

std.c.auth_getpwd

alias

Source line 11691

Alias of std.c.openbsd.auth_getpwd

std.c.auth_getstate

alias

Source line 11692

Alias of std.c.openbsd.auth_getstate

std.c.auth_getvalue

alias

Source line 11693

Alias of std.c.openbsd.auth_getvalue

std.c.auth_item_t

alias

Source line 11694

Alias of std.c.openbsd.auth_item_t

std.c.auth_mkvalue

alias

Source line 11695

Alias of std.c.openbsd.auth_mkvalue

std.c.auth_open

alias

Source line 11696

Alias of std.c.openbsd.auth_open

std.c.auth_session_t

alias

Source line 11697

Alias of std.c.openbsd.auth_session_t

std.c.auth_setdata

alias

Source line 11698

Alias of std.c.openbsd.auth_setdata

std.c.auth_setenv

alias

Source line 11699

Alias of std.c.openbsd.auth_setenv

std.c.auth_setitem

alias

Source line 11700

Alias of std.c.openbsd.auth_setitem

std.c.auth_setoption

alias

Source line 11701

Alias of std.c.openbsd.auth_setoption

std.c.auth_setpwd

alias

Source line 11702

Alias of std.c.openbsd.auth_setpwd

std.c.auth_setstate

alias

Source line 11703

Alias of std.c.openbsd.auth_setstate

std.c.auth_userchallenge

alias

Source line 11704

Alias of std.c.openbsd.auth_userchallenge

std.c.auth_usercheck

alias

Source line 11705

Alias of std.c.openbsd.auth_usercheck

std.c.auth_userokay

alias

Source line 11706

Alias of std.c.openbsd.auth_userokay

std.c.auth_userresponse

alias

Source line 11707

Alias of std.c.openbsd.auth_userresponse

std.c.auth_verify

alias

Source line 11708

Alias of std.c.openbsd.auth_verify

std.c.B_ABSOLUTE_TIMEOUT

alias

Source line 11648

Alias of std.c.haiku.B_ABSOLUTE_TIMEOUT

std.c.B_OS_NAME_LENGTH

alias

Source line 11649

Alias of std.c.haiku.B_OS_NAME_LENGTH

std.c.B_TIMEOUT_REAL_TIME_BASE

alias

Source line 11650

Alias of std.c.haiku.B_TIMEOUT_REAL_TIME_BASE

std.c.bcrypt

alias

Source line 11709

Alias of std.c.openbsd.bcrypt

std.c.bcrypt_checkpass

alias

Source line 11710

Alias of std.c.openbsd.bcrypt_checkpass

std.c.bcrypt_gensalt

alias

Source line 11711

Alias of std.c.openbsd.bcrypt_gensalt

std.c.bcrypt_newhash

alias

Source line 11712

Alias of std.c.openbsd.bcrypt_newhash

std.c.BI

alias

Source line 11674

Alias of std.c.openbsd.BI

std.c.bind

function

Source line 11153

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

Parameters

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

std.c.blkcnt_t

type

Source line 254

std.c.blksize_t

type

Source line 196

std.c.boolean_t

alias

Source line 11791

Alias of std.c.darwin.boolean_t

std.c.bsearch

function

Source line 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

Parameters

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

constant

Source line 1

std.c.bzero

function

Source line 11541

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

Parameters

s: *anyopaque
n: usize

std.c.c

alias

Source line 8

Alias of std.c

std.c.caddr_t

type

Source line 11283

std.c.CALENDAR_CLOCK

alias

Source line 11747

Alias of std.c.darwin.CALENDAR_CLOCK

std.c.calloc

function

Source line 11213

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

Parameters

calloc: usize
usize: usize

std.c.cap_rights

alias

Source line 11740

Alias of std.c.freebsd.cap_rights

std.c.CAP_RIGHTS_VERSION

alias

Source line 11734

Alias of std.c.freebsd.CAP_RIGHTS_VERSION

std.c.cc_t

type

Source line 9054

std.c.chdir

function

Source line 11125

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

Parameters

path: [*:0]const u8

std.c.chmod

function

Source line 11134

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

Parameters

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

std.c.CLOCK

alias

Source line 293

Alias of std.c.clockid_t

std.c.clock_get_time

alias

Source line 11792

Alias of std.c.darwin.clock_get_time

std.c.clock_getres

constant

Source line 10584

std.c.clock_gettime

constant

Source line 10589

std.c.clock_nanosleep

constant

Source line 11531

std.c.clock_res_t

alias

Source line 11794

Alias of std.c.darwin.clock_res_t

std.c.clock_serv_t

alias

Source line 11793

Alias of std.c.darwin.clock_serv_t

std.c.clock_t

type

Source line 4152

std.c.clockid_t

type

Source line 294

std.c.close

constant

Source line 10579

std.c.closedir

function

Source line 10571

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

Parameters

dp: *DIR

std.c.closelog

function

Source line 11444

pub extern "c" fn closelog() void

std.c.cmsg_align

constant

Source line 4450

std.c.cmsghdr

type

Source line 4409

std.c.common_linux_Sigaction

container

Source line 3317

A common format for the Sigaction struct across a variety of Linux flavors.

Fields

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

type

Source line 3318

std.c.common_linux_Sigaction.sigaction_fn

type

Source line 3319

std.c.connect

function

Source line 11157

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

Parameters

sockfd: fd_t
sock_addr: *const sockaddr
addrlen: socklen_t

std.c.copy_file_range

constant

Source line 10842

std.c.COPYFILE

alias

Source line 11748

Alias of std.c.darwin.COPYFILE

std.c.copysign

function

Source line 11606

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

Parameters

x: f64
y: f64

std.c.CPU

type

Source line 1389

std.c.CPU_COUNT

type

Source line 381

std.c.cpu_set_t

type

Source line 4164

std.c.CPU.AA64PFR0

constant

Source line 1399

std.c.CPU.AA64PFR1

constant

Source line 1400

std.c.CPU.AA64SMFR0

constant

Source line 1401

std.c.CPU.AA64ZFR0

constant

Source line 1402

std.c.CPU.COMPATIBLE

constant

Source line 1392

std.c.CPU.ID_AA64ISAR0

constant

Source line 1393

std.c.CPU.ID_AA64ISAR1

constant

Source line 1394

std.c.CPU.ID_AA64ISAR2

constant

Source line 1395

std.c.CPU.ID_AA64MMFR0

constant

Source line 1396

std.c.CPU.ID_AA64MMFR1

constant

Source line 1397

std.c.CPU.ID_AA64MMFR2

constant

Source line 1398

std.c.CPU.LED_BLINK

constant

Source line 1404

std.c.CPU.LIDACTION

constant

Source line 1403

std.c.CPUFAMILY

alias

Source line 11749

Alias of std.c.darwin.CPUFAMILY

std.c.CSIZE

type

Source line 9441

std.c.ctid_t

alias

Source line 11631

Alias of std.c.illumos.ctid_t

std.c.CTL

type

Source line 1331

std.c.CTL.DDB

constant

Source line 1372

std.c.CTL.DEBUG

constant

Source line 1338

std.c.CTL.DEBUG

constant

Source line 1346

std.c.CTL.DEBUG

constant

Source line 1354

std.c.CTL.DEBUG

constant

Source line 1368

std.c.CTL.DEBUG

constant

Source line 1381

std.c.CTL.FS

constant

Source line 1366

std.c.CTL.HW

constant

Source line 1339

std.c.CTL.HW

constant

Source line 1355

std.c.CTL.HW

constant

Source line 1369

std.c.CTL.HW

constant

Source line 1382

std.c.CTL.KERN

constant

Source line 1334

std.c.CTL.KERN

constant

Source line 1345

std.c.CTL.KERN

constant

Source line 1350

std.c.CTL.KERN

constant

Source line 1364

std.c.CTL.KERN

constant

Source line 1377

std.c.CTL.LWKT

constant

Source line 1358

std.c.CTL.MACHDEP

constant

Source line 1340

std.c.CTL.MACHDEP

constant

Source line 1356

std.c.CTL.MACHDEP

constant

Source line 1370

std.c.CTL.MACHDEP

constant

Source line 1383

std.c.CTL.MAXID

constant

Source line 1359

std.c.CTL.MAXID

constant

Source line 1385

std.c.CTL.MAXNAME

constant

Source line 1360

std.c.CTL.NET

constant

Source line 1337

std.c.CTL.NET

constant

Source line 1353

std.c.CTL.NET

constant

Source line 1367

std.c.CTL.NET

constant

Source line 1380

std.c.CTL.P1003_1B

constant

Source line 1342

std.c.CTL.SYSCTL

constant

Source line 1333

std.c.CTL.UNSPEC

constant

Source line 1349

std.c.CTL.UNSPEC

constant

Source line 1363

std.c.CTL.UNSPEC

constant

Source line 1376

std.c.CTL.USER

constant

Source line 1341

std.c.CTL.USER

constant

Source line 1357

std.c.CTL.USER

constant

Source line 1384

std.c.CTL.VFS

constant

Source line 1336

std.c.CTL.VFS

constant

Source line 1352

std.c.CTL.VFS

constant

Source line 1373

std.c.CTL.VFS

constant

Source line 1379

std.c.CTL.VM

constant

Source line 1335

std.c.CTL.VM

constant

Source line 1351

std.c.CTL.VM

constant

Source line 1365

std.c.CTL.VM

constant

Source line 1378

std.c.darwin

alias

Source line 17

Alias of std.c.darwin

std.c.DB_RECORDTYPE

alias

Source line 11751

Alias of std.c.darwin.DB_RECORDTYPE

std.c.dev_t

type

Source line 150

std.c.DIR

container

Source line 10567

std.c.dirent

type

Source line 7438

std.c.DirEnt

alias

Source line 11651

Alias of std.c.haiku.DirEnt

std.c.dirent.reclen

function

Source line 7495

pub fn reclen(self: dirent) u16

Parameters

self: dirent

std.c.dirent64

type

Source line 7525

std.c.disown

alias

Source line 11962

Alias of std.c.serenity.disown

std.c.dispatch

alias

Source line 11796

Alias of std.c.darwin.dispatch

std.c.div

function

Source line 11581

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

Parameters

a: c_int
b: c_int

std.c.div_t

container

Source line 11485

Fields

quot: c_int
rem: c_int

std.c.dl_info

type

Source line 11428

std.c.dl_iterate_phdr

function

Source line 10830

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

Parameters

callback: dl_iterate_phdr_callback
data: ?*anyopaque

std.c.dl_iterate_phdr_callback

type

Source line 7856

std.c.dl_phdr_info

type

Source line 4169

std.c.dladdr

constant

Source line 11427

std.c.dlclose

function

Source line 11423

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

Parameters

handle: *anyopaque

std.c.dlerror

function

Source line 11425

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

std.c.dlopen

function

Source line 11422

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

Parameters

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

std.c.dlsym

function

Source line 11424

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

Parameters

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

std.c.dn_expand

function

Source line 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

Parameters

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

std.c.dragonfly

alias

Source line 21

Alias of std.c.dragonfly

std.c.DT

type

Source line 5982

std.c.DT.BLK

constant

Source line 5990

std.c.DT.BLK

constant

Source line 6001

std.c.DT.CHR

constant

Source line 5988

std.c.DT.CHR

constant

Source line 5999

std.c.DT.DBF

constant

Source line 6006

std.c.DT.DIR

constant

Source line 5989

std.c.DT.DIR

constant

Source line 6000

std.c.DT.FIFO

constant

Source line 5987

std.c.DT.FIFO

constant

Source line 5998

std.c.DT.LNK

constant

Source line 5992

std.c.DT.LNK

constant

Source line 6003

std.c.DT.REG

constant

Source line 5991

std.c.DT.REG

constant

Source line 6002

std.c.DT.SOCK

constant

Source line 5993

std.c.DT.SOCK

constant

Source line 6004

std.c.DT.UNKNOWN

constant

Source line 5986

std.c.DT.UNKNOWN

constant

Source line 5997

std.c.DT.WHT

constant

Source line 5994

std.c.DT.WHT

constant

Source line 6005

std.c.dummy_execute_header

variable

Source line 43

mach_hdr

std.c.dup

function

Source line 11129

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

Parameters

fd: fd_t

std.c.dup2

function

Source line 11130

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

Parameters

old_fd: fd_t
new_fd: fd_t

std.c.dup3

function

Source line 11131

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

Parameters

old: c_int
new: c_int
flags: c_uint

std.c.dyld_image_path_containing_address

alias

Source line 11789

Alias of std.c.darwin.dyld_image_path_containing_address

std.c.E

type

Source line 386

std.c.EAI

type

Source line 7688

std.c.elf_aux_info

function

Source line 10703

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

Parameters

aux: c_int
buf: *anyopaque
buflen: c_int

std.c.Elf_Symndx

type

Source line 840

std.c.emscripten

alias

Source line 13

Alias of std.os.emscripten

std.c.endgrent

function

Source line 10624

pub extern "c" fn endgrent() void

std.c.endpwent

function

Source line 10616

pub extern "c" fn endpwent() void

std.c.environ

variable

Source line 11055

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

std.c.epoll_create1

function

Source line 10668

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

Parameters

flags: c_uint

std.c.epoll_ctl

function

Source line 10667

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

Parameters

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

std.c.epoll_event

type

Source line 4207

std.c.epoll_pwait

function

Source line 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

Parameters

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

std.c.epoll_wait

function

Source line 10669

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

Parameters

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

std.c.erand48

function

Source line 11567

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

Parameters

xsubi: *[3]c_ushort

std.c.errno

function

Source line 76

Get the errno if rc is -1 and SUCCESS if rc is not -1.

pub fn errno(rc: anytype) E

std.c.EV

type

Source line 9986

std.c.EV.ADD

constant

Source line 9990

add event to kq (implies enable)

std.c.EV.ADD

constant

Source line 10035

std.c.EV.ADD

constant

Source line 10051

add event to kq (implies enable)

std.c.EV.ADD

constant

Source line 10076

add event to kq (implies enable)

std.c.EV.ADD

constant

Source line 10112

std.c.EV.ADD

constant

Source line 10126

add event to kq (implies enable)

std.c.EV.CLEAR

constant

Source line 10000

clear event state after reporting

std.c.EV.CLEAR

constant

Source line 10040

std.c.EV.CLEAR

constant

Source line 10061

clear event state after reporting

std.c.EV.CLEAR

constant

Source line 10090

clear event state after reporting

std.c.EV.CLEAR

constant

Source line 10117

std.c.EV.CLEAR

constant

Source line 10136

clear event state after reporting

std.c.EV.DELETE

constant

Source line 9992

delete event from kq

std.c.EV.DELETE

constant

Source line 10036

std.c.EV.DELETE

constant

Source line 10053

delete event from kq

std.c.EV.DELETE

constant

Source line 10078

delete event from kq

std.c.EV.DELETE

constant

Source line 10113

std.c.EV.DELETE

constant

Source line 10128

delete event from kq

std.c.EV.DISABLE

constant

Source line 9996

disable event (not reported)

std.c.EV.DISABLE

constant

Source line 10038

std.c.EV.DISABLE

constant

Source line 10057

disable event (not reported)

std.c.EV.DISABLE

constant

Source line 10082

disable event (not reported)

std.c.EV.DISABLE

constant

Source line 10115

std.c.EV.DISABLE

constant

Source line 10132

disable event (not reported)

std.c.EV.DISPATCH

constant

Source line 10007

disable event after reporting

std.c.EV.DISPATCH

constant

Source line 10042

std.c.EV.DISPATCH

constant

Source line 10065

disable event after reporting

std.c.EV.DISPATCH

constant

Source line 10097

disable event after reporting

std.c.EV.DISPATCH

constant

Source line 10119

std.c.EV.DISPATCH

constant

Source line 10143

disable event after reporting

std.c.EV.DISPATCH2

constant

Source line 10014

... in combination with DELETE will defer delete until udata-specific event enabled. EINPROGRESS will be returned to indicate the deferral

std.c.EV.DROP

constant

Source line 10101

note should be dropped

std.c.EV.ENABLE

constant

Source line 9994

enable event

std.c.EV.ENABLE

constant

Source line 10037

std.c.EV.ENABLE

constant

Source line 10055

enable event

std.c.EV.ENABLE

constant

Source line 10080

enable event

std.c.EV.ENABLE

constant

Source line 10114

std.c.EV.ENABLE

constant

Source line 10130

enable event

std.c.EV.EOF

constant

Source line 10025

EOF detected (return value)

std.c.EV.EOF

constant

Source line 10046

std.c.EV.EOF

constant

Source line 10071

EOF detected

std.c.EV.EOF

constant

Source line 10107

EOF detected (return value)

std.c.EV.EOF

constant

Source line 10122

std.c.EV.ERROR

constant

Source line 10027

error, data contains errno (return value)

std.c.EV.ERROR

constant

Source line 10045

std.c.EV.ERROR

constant

Source line 10069

error, data contains errno

std.c.EV.ERROR

constant

Source line 10109

error, event data contains errno (return value)

std.c.EV.ERROR

constant

Source line 10121

std.c.EV.FLAG0

constant

Source line 10021

filter-specific flag

std.c.EV.FLAG1

constant

Source line 10023

filter-specific flag

std.c.EV.FLAG1

constant

Source line 10044

std.c.EV.FLAG1

constant

Source line 10067

filter-specific flag

std.c.EV.FLAG1

constant

Source line 10103

filter-specific flag 1

std.c.EV.FLAG1

constant

Source line 10120

std.c.EV.FLAG2

constant

Source line 10105

filter-specific flag 2

std.c.EV.FORCEONESHOT

constant

Source line 10084

enable _ONESHOT and force trigger

std.c.EV.KEEPUDATA

constant

Source line 10086

do not update the udata field

std.c.EV.NODATA

constant

Source line 10043

std.c.EV.ONESHOT

constant

Source line 9998

only report one occurrence

std.c.EV.ONESHOT

constant

Source line 10039

std.c.EV.ONESHOT

constant

Source line 10059

only report one occurrence

std.c.EV.ONESHOT

constant

Source line 10088

only report one occurrence

std.c.EV.ONESHOT

constant

Source line 10116

std.c.EV.ONESHOT

constant

Source line 10134

only report one occurrence

std.c.EV.OOBAND

alias

Source line 10032

on input, filter should actively return in the presence of OOB on the descriptor on output, indicates the presence of OOB data on the descriptor

Alias of std.c.EV.FLAG1

std.c.EV.POLL

alias

Source line 10029

use poll(2) semantics for EVFILT.READ

Alias of std.c.EV.FLAG0

std.c.EV.RECEIPT

constant

Source line 10005

force immediate event output ... with or without ERROR ... use KEVENT_FLAG_ERROR_EVENTS on syscalls supporting flags

std.c.EV.RECEIPT

constant

Source line 10041

std.c.EV.RECEIPT

constant

Source line 10063

force EV_ERROR on success, data=0

std.c.EV.RECEIPT

constant

Source line 10095

force immediate event output ... with or without ERROR ... use KEVENT_FLAG_ERROR_EVENTS on syscalls supporting flags

std.c.EV.RECEIPT

constant

Source line 10118

std.c.EV.RECEIPT

constant

Source line 10141

force immediate event output ... with or without ERROR ... use KEVENT_FLAG_ERROR_EVENTS on syscalls supporting flags

std.c.EV.SYSFLAGS

constant

Source line 10019

reserved by system

std.c.EV.SYSFLAGS

constant

Source line 10047

std.c.EV.SYSFLAGS

constant

Source line 10099

reserved by system

std.c.EV.UDATA_SPECIFIC

constant

Source line 10009

unique kevent per udata value

std.c.EV.VANISHED

constant

Source line 10017

report that source has vanished ... only valid with DISPATCH2

std.c.eventfd

function

Source line 10665

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

Parameters

initval: c_uint
flags: c_uint

std.c.EVFILT

type

Source line 10148

std.c.EVFILT.AIO

constant

Source line 10153

attached to aio requests

std.c.EVFILT.AIO

constant

Source line 10178

attached to aio requests

std.c.EVFILT.AIO

constant

Source line 10206

std.c.EVFILT.AIO

constant

Source line 10216

attached to aio requests

std.c.EVFILT.AIO

constant

Source line 10237

attached to aio requests

std.c.EVFILT.AIO

constant

Source line 10266

std.c.EVFILT.DEVICE

constant

Source line 10271

std.c.EVFILT.EMPTY

constant

Source line 10196

std.c.EVFILT.EMPTY

constant

Source line 10230

Empty filter

std.c.EVFILT.EMPTY

constant

Source line 10257

empty send socket buf

std.c.EVFILT.EXCEPT

constant

Source line 10171

Exception events

std.c.EVFILT.EXCEPT

constant

Source line 10201

std.c.EVFILT.EXCEPT

constant

Source line 10272

std.c.EVFILT.FS

constant

Source line 10165

Filesystem events

std.c.EVFILT.FS

constant

Source line 10190

Filesystem events

std.c.EVFILT.FS

constant

Source line 10199

std.c.EVFILT.FS

constant

Source line 10226

Filesystem events

std.c.EVFILT.FS

constant

Source line 10249

Filesystem events

std.c.EVFILT.JAIL

constant

Source line 10259

attached to struct prison

std.c.EVFILT.JAILDESC

constant

Source line 10261

attached to jail descriptors

std.c.EVFILT.LIO

constant

Source line 10191

std.c.EVFILT.LIO

constant

Source line 10251

attached to lio requests

std.c.EVFILT.MACHPORT

constant

Source line 10163

Mach portsets

std.c.EVFILT.MARKER

constant

Source line 10210

std.c.EVFILT.PROC

constant

Source line 10157

attached to struct proc

std.c.EVFILT.PROC

constant

Source line 10182

attached to struct proc

std.c.EVFILT.PROC

constant

Source line 10204

std.c.EVFILT.PROC

constant

Source line 10220

attached to struct proc

std.c.EVFILT.PROC

constant

Source line 10241

attached to struct proc

std.c.EVFILT.PROC

constant

Source line 10268

std.c.EVFILT.PROCDESC

constant

Source line 10188

Process descriptors

std.c.EVFILT.PROCDESC

constant

Source line 10247

Process descriptors

std.c.EVFILT.READ

constant

Source line 10150

std.c.EVFILT.READ

constant

Source line 10175

std.c.EVFILT.READ

constant

Source line 10208

std.c.EVFILT.READ

constant

Source line 10213

std.c.EVFILT.READ

constant

Source line 10234

std.c.EVFILT.READ

constant

Source line 10264

std.c.EVFILT.SENDFILE

constant

Source line 10195

Sendfile events

std.c.EVFILT.SENDFILE

constant

Source line 10255

Sendfile events

std.c.EVFILT.SIGNAL

constant

Source line 10159

attached to struct proc

std.c.EVFILT.SIGNAL

constant

Source line 10184

attached to struct proc

std.c.EVFILT.SIGNAL

constant

Source line 10203

std.c.EVFILT.SIGNAL

constant

Source line 10222

attached to struct proc

std.c.EVFILT.SIGNAL

constant

Source line 10243

attached to struct proc

std.c.EVFILT.SIGNAL

constant

Source line 10269

std.c.EVFILT.SYSCOUNT

constant

Source line 10172

std.c.EVFILT.SYSCOUNT

constant

Source line 10209

std.c.EVFILT.TIMER

constant

Source line 10161

timers

std.c.EVFILT.TIMER

constant

Source line 10186

timers

std.c.EVFILT.TIMER

constant

Source line 10202

std.c.EVFILT.TIMER

constant

Source line 10224

timers

std.c.EVFILT.TIMER

constant

Source line 10245

timers

std.c.EVFILT.TIMER

constant

Source line 10270

std.c.EVFILT.USER

constant

Source line 10167

User events

std.c.EVFILT.USER

constant

Source line 10193

User events

std.c.EVFILT.USER

constant

Source line 10200

std.c.EVFILT.USER

constant

Source line 10228

User events

std.c.EVFILT.USER

constant

Source line 10253

User events

std.c.EVFILT.USER

constant

Source line 10273

std.c.EVFILT.VM

constant

Source line 10169

Virtual memory events

std.c.EVFILT.VNODE

constant

Source line 10155

attached to vnodes

std.c.EVFILT.VNODE

constant

Source line 10180

attached to vnodes

std.c.EVFILT.VNODE

constant

Source line 10205

std.c.EVFILT.VNODE

constant

Source line 10218

attached to vnodes

std.c.EVFILT.VNODE

constant

Source line 10239

attached to vnodes

std.c.EVFILT.VNODE

constant

Source line 10267

std.c.EVFILT.WRITE

constant

Source line 10151

std.c.EVFILT.WRITE

constant

Source line 10176

std.c.EVFILT.WRITE

constant

Source line 10207

std.c.EVFILT.WRITE

constant

Source line 10214

std.c.EVFILT.WRITE

constant

Source line 10235

std.c.EVFILT.WRITE

constant

Source line 10265

std.c.EXC

alias

Source line 11752

Alias of std.c.darwin.EXC

std.c.EXCEPTION

alias

Source line 11753

Alias of std.c.darwin.EXCEPTION

std.c.exception_behavior_array_t

alias

Source line 11908

Alias of std.c.darwin.exception_behavior_array_t

std.c.exception_behavior_t

alias

Source line 11909

Alias of std.c.darwin.exception_behavior_t

std.c.exception_data_t

alias

Source line 11910

Alias of std.c.darwin.exception_data_t

std.c.exception_data_type_t

alias

Source line 11911

Alias of std.c.darwin.exception_data_type_t

std.c.exception_flavor_array_t

alias

Source line 11912

Alias of std.c.darwin.exception_flavor_array_t

std.c.exception_handler_array_t

alias

Source line 11913

Alias of std.c.darwin.exception_handler_array_t

std.c.exception_handler_t

alias

Source line 11914

Alias of std.c.darwin.exception_handler_t

std.c.exception_mask_array_t

alias

Source line 11915

Alias of std.c.darwin.exception_mask_array_t

std.c.exception_mask_t

alias

Source line 11916

Alias of std.c.darwin.exception_mask_t

std.c.exception_port_array_t

alias

Source line 11917

Alias of std.c.darwin.exception_port_array_t

std.c.exception_port_t

alias

Source line 11918

Alias of std.c.darwin.exception_port_t

std.c.exception_type_t

alias

Source line 11919

Alias of std.c.darwin.exception_type_t

std.c.execve

function

Source line 11127

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

Parameters

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

std.c.execveat

function

Source line 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

Parameters

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

std.c.EXECVEAT

type

Source line 8887

std.c.exit

function

Source line 11064

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

Parameters

code: c_int

std.c.F

type

Source line 845

Command flags for fcntl(2).

std.c.F_OK

constant

Source line 1238

Test for existence of file.

std.c.F.ADD_SEALS

constant

Source line 994

std.c.F.ADDFILESIGS

constant

Source line 908

add signature from same file (used by dyld for shared libs)

std.c.F.ADDFILESIGS_FOR_DYLD_SIM

constant

Source line 940

Add signature from same file, only if it is signed by Apple (used by dyld for simulator)

std.c.F.ADDFILESIGS_RETURN

constant

Source line 944

Add signature from same file, return end offset in structure on success

std.c.F.ADDSIGS

constant

Source line 906

add detached signatures

std.c.F.ALLOCSP

constant

Source line 1084

Allocate file space

std.c.F.BADFD

constant

Source line 1100

Create Poison FD

std.c.F.BARRIERFSYNC

constant

Source line 942

fsync + issue barrier to drive

std.c.F.BLKSIZE

constant

Source line 1069

Get optimal I/O block size

std.c.F.BLOCKS

constant

Source line 1067

Get number of BLKSIZE blocks allocated

std.c.F.CANCEL

constant

Source line 1019

Cancel an async lock request.

std.c.F.CHECK_LV

constant

Source line 946

Check if Library Validation allows this Mach-O file to be mapped into the calling process

std.c.F.CHKCLEAN

constant

Source line 880

Used for regression test

std.c.F.CHKFL

constant

Source line 1050

Unused

std.c.F.CLOSEM

constant

Source line 1142

std.c.F.DUP2FD

constant

Source line 1052

Duplicate fildes at third arg

std.c.F.DUP2FD

constant

Source line 1172

std.c.F.DUP2FD_CLOEXEC

constant

Source line 992

DUP2FD with FD_CLOEXEC set.

std.c.F.DUP2FD_CLOEXEC

constant

Source line 1054

Like DUP2FD with O_CLOEXEC set EINVAL is fildes matches arg1

std.c.F.DUP2FD_CLOEXEC

constant

Source line 1174

std.c.F.DUPFD

constant

Source line 857

duplicate file descriptor

std.c.F.DUPFD

constant

Source line 962

Duplicate file descriptor.

std.c.F.DUPFD

constant

Source line 1037

Duplicate fildes

std.c.F.DUPFD

constant

Source line 1132

std.c.F.DUPFD

constant

Source line 1159

std.c.F.DUPFD

constant

Source line 1178

std.c.F.DUPFD

constant

Source line 1194

std.c.F.DUPFD

constant

Source line 1213

std.c.F.DUPFD_CLOEXEC

constant

Source line 952

mark the dup with FD_CLOEXEC

std.c.F.DUPFD_CLOEXEC

constant

Source line 990

DUPFD with FD_CLOEXEC set.

std.c.F.DUPFD_CLOEXEC

constant

Source line 1056

Like DUPFD with O_CLOEXEC set

std.c.F.DUPFD_CLOEXEC

constant

Source line 1144

std.c.F.DUPFD_CLOEXEC

constant

Source line 1173

std.c.F.DUPFD_CLOEXEC

constant

Source line 1187

std.c.F.DUPFD_CLOEXEC

constant

Source line 1222

std.c.F.FINDSIGS

constant

Source line 938

Add detached code signatures (used by dyld for shared libs)

std.c.F.FLUSH_DATA

constant

Source line 878

std.c.F.FREESP

constant

Source line 1086

Free file space

std.c.F.FREEZE_FS

constant

Source line 900

"freeze" all fs operations

std.c.F.FULLFSYNC

constant

Source line 896

fsync + ask the drive to flush to the media

std.c.F.GET_SEALS

constant

Source line 995

std.c.F.GETCODEDIR

constant

Source line 925

Returns the code directory, with associated hashes, to the caller

std.c.F.GETFD

constant

Source line 850

std.c.F.GETFD

constant

Source line 859

get file descriptor flags

std.c.F.GETFD

constant

Source line 964

Get file descriptor flags.

std.c.F.GETFD

constant

Source line 1039

Get fildes flags

std.c.F.GETFD

constant

Source line 1133

std.c.F.GETFD

constant

Source line 1160

std.c.F.GETFD

constant

Source line 1179

std.c.F.GETFD

constant

Source line 1195

std.c.F.GETFD

constant

Source line 1214

std.c.F.GETFL

constant

Source line 852

std.c.F.GETFL

constant

Source line 863

get file status flags

std.c.F.GETFL

constant

Source line 968

Get file status flags.

std.c.F.GETFL

constant

Source line 1043

Get file flags

std.c.F.GETFL

constant

Source line 1135

std.c.F.GETFL

constant

Source line 1165

std.c.F.GETFL

constant

Source line 1181

std.c.F.GETFL

constant

Source line 1197

std.c.F.GETFL

constant

Source line 1216

std.c.F.GETLK

constant

Source line 871

get record locking information

std.c.F.GETLK

constant

Source line 978

Get record locking information.

std.c.F.GETLK

constant

Source line 1088

Get file lock

std.c.F.GETLK

constant

Source line 1139

std.c.F.GETLK

constant

Source line 1169

std.c.F.GETLK

constant

Source line 1184

std.c.F.GETLK

constant

Source line 1203

std.c.F.GETLK

constant

Source line 1219

std.c.F.GETLKPID

constant

Source line 919

get record locking information, per-process

std.c.F.GETNOSIGPIPE

constant

Source line 929

Status of SIGPIPE for this fd

std.c.F.GETNOSIGPIPE

constant

Source line 1145

std.c.F.GETOWN

constant

Source line 867

get SIGIO/SIGURG proc/pgrp

std.c.F.GETOWN

constant

Source line 973

Get SIGIO/SIGURG proc/pgrrp.

std.c.F.GETOWN

constant

Source line 1071

Get owner (socket emulation)

std.c.F.GETOWN

constant

Source line 1137

std.c.F.GETOWN

constant

Source line 1167

std.c.F.GETOWN

constant

Source line 1200

std.c.F.GETOWN_EX

constant

Source line 1022

std.c.F.GETOWNER_UIDS

constant

Source line 1024

std.c.F.GETPATH

constant

Source line 894

return the full path of the fd

std.c.F.GETPATH

constant

Source line 1147

std.c.F.GETPATH

constant

Source line 1175

std.c.F.GETPATH_MTMINFO

constant

Source line 923

return the full path of the FD, but error in specific mtmd circumstances

std.c.F.GETPROTECTIONCLASS

constant

Source line 913

Get the protection class of a file from the EA, returns int

std.c.F.GETPROTECTIONLEVEL

constant

Source line 936

Get the protection version number for this filesystem

std.c.F.GETXFL

constant

Source line 1045

Get file flags including open-only flags

std.c.F.GLOBAL_NOCACHE

constant

Source line 904

turn data caching off/on (globally) for this file

std.c.F.HASREMOTELOCKS

constant

Source line 1077

Does vp have NFS locks private to lock manager

std.c.F.ISSTREAM

constant

Source line 1059

Is the file desc. a stream ?

std.c.F.ISTTY

constant

Source line 1218

std.c.F.KINFO

constant

Source line 997

Return kinfo_file for a file descriptor.

std.c.F.LOCK

constant

Source line 1030

Lock a region for exclusive use

std.c.F.LOCK

constant

Source line 1155

std.c.F.LOG2PHYS

constant

Source line 892

file offset to device offset

std.c.F.LOG2PHYS_EXT

constant

Source line 917

file offset to device offset, extended

std.c.F.MAXFD

constant

Source line 1143

std.c.F.NOCACHE

constant

Source line 890

turn data caching off/on for this fd

std.c.F.NODIRECT

constant

Source line 911

used in conjunction with F.NOCACHE to indicate that DIRECT, synchronous writes should not be used (i.e. its ok to temporarily create cached pages)

std.c.F.NODNY

constant

Source line 1121

Don't deny others access

std.c.F.NPRIV

constant

Source line 1063

Turn off private access to file

std.c.F.OFD_GETLK

constant

Source line 1090

Get file lock owned by file

std.c.F.OFD_SETLK

constant

Source line 1092

Set file lock owned by file

std.c.F.OFD_SETLKW

constant

Source line 1094

Set file lock owned by file and wait

std.c.F.PATHPKG_CHECK

constant

Source line 898

find which component (if any) is a package

std.c.F.PREALLOCATE

constant

Source line 882

Preallocate storage

std.c.F.PRIV

constant

Source line 1061

Turn on private access to file

std.c.F.PUNCHHOLE

constant

Source line 948

Deallocate a range of the file

std.c.F.QUOTACTL

constant

Source line 1065

UFS quota call

std.c.F.RDACC

constant

Source line 1113

Read-only share access

std.c.F.RDADVISE

constant

Source line 886

Issue an advisory read async with no copy to user

std.c.F.RDAHEAD

constant

Source line 888

turn read ahead off/on for this fd

std.c.F.RDDNY

constant

Source line 1123

Deny others read share access

std.c.F.RDLCK

constant

Source line 954

shared or read lock

std.c.F.RDLCK

constant

Source line 1011

Shared or read lock.

std.c.F.RDLCK

constant

Source line 1103

Read lock

std.c.F.RDLCK

constant

Source line 1149

std.c.F.RDLCK

constant

Source line 1161

std.c.F.RDLCK

constant

Source line 1189

std.c.F.RDLCK

constant

Source line 1207

std.c.F.RDLCK

constant

Source line 1225

std.c.F.READAHEAD

constant

Source line 987

Read ahead.

std.c.F.REVOKE

constant

Source line 1075

Object reuse revoke access to file desc.

std.c.F.RMDNY

constant

Source line 1129

private flag: Deny delete share access

std.c.F.RWACC

constant

Source line 1117

Read-Write share access

std.c.F.RWDNY

constant

Source line 1127

Deny others read or write share access

std.c.F.SEAL_GROW

constant

Source line 1005

May not grow.

std.c.F.SEAL_SEAL

constant

Source line 1001

Prevent adding sealings.

std.c.F.SEAL_SHRINK

constant

Source line 1003

May not shrink

std.c.F.SEAL_WRITE

constant

Source line 1007

May not write.

std.c.F.SETBACKINGSTORE

constant

Source line 921

Mark the file as being the backing store for another filesystem

std.c.F.SETFD

constant

Source line 851

std.c.F.SETFD

constant

Source line 861

set file descriptor flags

std.c.F.SETFD

constant

Source line 966

Set file descriptor flags.

std.c.F.SETFD

constant

Source line 1041

Set fildes flags

std.c.F.SETFD

constant

Source line 1134

std.c.F.SETFD

constant

Source line 1162

std.c.F.SETFD

constant

Source line 1180

std.c.F.SETFD

constant

Source line 1196

std.c.F.SETFD

constant

Source line 1215

std.c.F.SETFL

constant

Source line 853

std.c.F.SETFL

constant

Source line 865

set file status flags

std.c.F.SETFL

constant

Source line 970

Set file status flags.

std.c.F.SETFL

constant

Source line 1047

Set file flags

std.c.F.SETFL

constant

Source line 1136

std.c.F.SETFL

constant

Source line 1166

std.c.F.SETFL

constant

Source line 1182

std.c.F.SETFL

constant

Source line 1198

std.c.F.SETFL

constant

Source line 1217

std.c.F.SETLK

constant

Source line 873

set record locking information

std.c.F.SETLK

constant

Source line 980

Set record locking information.

std.c.F.SETLK

constant

Source line 1080

Set file lock

std.c.F.SETLK

constant

Source line 1140

std.c.F.SETLK

constant

Source line 1170

std.c.F.SETLK

constant

Source line 1185

std.c.F.SETLK

constant

Source line 1204

std.c.F.SETLK

constant

Source line 1220

std.c.F.SETLK_REMOTE

constant

Source line 985

Debugging support for remote locks.

std.c.F.SETLKW

constant

Source line 875

F.SETLK; wait if blocked

std.c.F.SETLKW

constant

Source line 982

Set record locking information and wait if blocked.

std.c.F.SETLKW

constant

Source line 1082

Set file lock and wait

std.c.F.SETLKW

constant

Source line 1141

std.c.F.SETLKW

constant

Source line 1171

std.c.F.SETLKW

constant

Source line 1186

std.c.F.SETLKW

constant

Source line 1205

std.c.F.SETLKW

constant

Source line 1221

std.c.F.SETLKWTIMEOUT

constant

Source line 877

F.SETLK; wait if blocked, return on timeout

std.c.F.SETNOSIGPIPE

constant

Source line 927

No SIGPIPE generated on EPIPE

std.c.F.SETNOSIGPIPE

constant

Source line 1146

std.c.F.SETOWN

constant

Source line 869

set SIGIO/SIGURG proc/pgrp

std.c.F.SETOWN

constant

Source line 975

Set SIGIO/SIGURG proc/pgrrp.

std.c.F.SETOWN

constant

Source line 1073

Set owner (socket emulation)

std.c.F.SETOWN

constant

Source line 1138

std.c.F.SETOWN

constant

Source line 1168

std.c.F.SETOWN

constant

Source line 1201

std.c.F.SETOWN_EX

constant

Source line 1021

std.c.F.SETPROTECTIONCLASS

constant

Source line 915

Set the protection class of a file for the EA, requires int

std.c.F.SETSIZE

constant

Source line 884

Truncate a file without zeroing space

std.c.F.SHARE

constant

Source line 1096

Set a file share reservation

std.c.F.SINGLE_WRITER

constant

Source line 934

file being written to a by single writer... if throttling enabled, writes may be broken into smaller chunks with throttling in between

std.c.F.TEST

constant

Source line 1034

Test a region for other processes locks

std.c.F.TEST

constant

Source line 1157

std.c.F.THAW_FS

constant

Source line 902

"thaw" all fs operations

std.c.F.TLOCK

constant

Source line 1032

Test and lock a region for exclusive use

std.c.F.TLOCK

constant

Source line 1156

std.c.F.TRANSCODEKEY

constant

Source line 931

For some cases, we need to rewrap the key for AKS/MKB

std.c.F.TRIM_ACTIVE_FILE

constant

Source line 950

Trim an active file

std.c.F.ULOCK

constant

Source line 1028

Unlock a previously locked region

std.c.F.ULOCK

constant

Source line 1154

std.c.F.UNLCK

constant

Source line 956

unlock

std.c.F.UNLCK

constant

Source line 1013

Unlock.

std.c.F.UNLCK

constant

Source line 1107

Remove lock(s)

std.c.F.UNLCK

constant

Source line 1151

std.c.F.UNLCK

constant

Source line 1163

std.c.F.UNLCK

constant

Source line 1190

std.c.F.UNLCK

constant

Source line 1208

std.c.F.UNLCK

constant

Source line 1227

std.c.F.UNLCKSYS

constant

Source line 1017

Purge locks for a given system ID.

std.c.F.UNLKSYS

constant

Source line 1109

remove remote locks for a given system

std.c.F.UNSHARE

constant

Source line 1098

Remove a file share reservation

std.c.F.WRACC

constant

Source line 1115

Write-only share access

std.c.F.WRDNY

constant

Source line 1125

Deny others write share access

std.c.F.WRLCK

constant

Source line 958

exclusive or write lock

std.c.F.WRLCK

constant

Source line 1015

Exclusive or write lock.

std.c.F.WRLCK

constant

Source line 1105

Write lock

std.c.F.WRLCK

constant

Source line 1150

std.c.F.WRLCK

constant

Source line 1164

std.c.F.WRLCK

constant

Source line 1191

std.c.F.WRLCK

constant

Source line 1209

std.c.F.WRLCK

constant

Source line 1226

std.c.faccessat

function

Source line 11117

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

Parameters

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

std.c.fallocate

function

Source line 10694

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

Parameters

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

std.c.fallocate64

function

Source line 10691

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

Parameters

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

std.c.fchdir

function

Source line 11126

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

Parameters

fd: fd_t

std.c.fchmod

function

Source line 11135

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

Parameters

fd: fd_t
mode: mode_t

std.c.fchmodat

function

Source line 11136

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

Parameters

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

std.c.fchown

function

Source line 11137

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

Parameters

fd: fd_t
owner: uid_t
group: gid_t

std.c.fchownat

function

Source line 11138

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

Parameters

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

std.c.fclose

function

Source line 11058

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

Parameters

stream: *FILE

std.c.fcntl

function

Source line 11148

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

Parameters

fd: fd_t
cmd: c_int

std.c.fcopyfile

alias

Source line 11797

Alias of std.c.darwin.fcopyfile

std.c.FD_CLOEXEC

constant

Source line 1231

std.c.fd_t

type

Source line 263

std.c.fdatasync

function

Source line 11433

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

Parameters

fd: c_int

std.c.fdim

function

Source line 11607

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

Parameters

x: f64
y: f64

std.c.fdopendir

function

Source line 10569

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

Parameters

fd: c_int

std.c.fflags_t

alias

Source line 11741

Alias of std.c.freebsd.fflags_t

std.c.ffs

function

Source line 11563

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

Parameters

i: c_int

std.c.ffsl

function

Source line 11564

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

Parameters

i: c_long

std.c.ffsll

function

Source line 11565

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

Parameters

i: c_longlong

std.c.FILE

container

Source line 11420

std.c.FILE_EVENT

alias

Source line 11622

Alias of std.c.illumos.FILE_EVENT

std.c.file_obj

alias

Source line 11632

Alias of std.c.illumos.file_obj

std.c.find_thread

alias

Source line 11661

Alias of std.c.haiku.find_thread

std.c.flock

constant

Source line 11044

std.c.Flock

type

Source line 1262

std.c.fmemopen

function

Source line 11440

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

Parameters

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

std.c.fopen

function

Source line 11057

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

Parameters

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

std.c.fopen64

function

Source line 10692

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

Parameters

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

std.c.fork

constant

Source line 11097

std.c.fread

function

Source line 11060

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

Parameters

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

std.c.free

function

Source line 11215

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

Parameters

free: ?*anyopaque

std.c.freeaddrinfo

function

Source line 11357

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

Parameters

res: *addrinfo

std.c.freebsd

alias

Source line 18

Alias of std.c.freebsd

std.c.frexp

function

Source line 11608

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

Parameters

x: f64
e: *c_int

std.c.fsblkcnt_t

alias

Source line 11742

Alias of std.c.freebsd.fsblkcnt_t

std.c.fsfilcnt_t

alias

Source line 11743

Alias of std.c.freebsd.fsfilcnt_t

std.c.fstat

constant

Source line 10594

std.c.fstatat

constant

Source line 10604

std.c.fsync

function

Source line 11432

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

Parameters

fd: c_int

std.c.ftruncate

function

Source line 11071

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

Parameters

fd: c_int
length: off_t

std.c.ftruncate64

function

Source line 10693

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

Parameters

fd: c_int
length: off_t

std.c.futex

constant

Source line 11049

std.c.FUTEX

type

Source line 10554

std.c.futimens

function

Source line 11221

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

Parameters

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

std.c.futimes

function

Source line 11217

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

Parameters

fd: fd_t
times: ?*[2]timeval

std.c.fwrite

function

Source line 11059

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

Parameters

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

std.c.gai_strerror

function

Source line 11369

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

Parameters

errcode: EAI

std.c.get_stack_bounds

alias

Source line 11969

Alias of std.c.serenity.get_stack_bounds

std.c.get_system_info

alias

Source line 11662

Alias of std.c.haiku.get_system_info

std.c.getaddrinfo

function

Source line 11348

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

Parameters

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

On Linux, res will not be modified on error and freeaddrinfo will potentially crash if you pass it an undefined pointer

std.c.getauxval

function

Source line 10702

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

Parameters

type: c_ulong

std.c.GETCONTEXT

alias

Source line 11623

Alias of std.c.illumos.GETCONTEXT

std.c.getcwd

function

Source line 11089

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

Parameters

buf: [*]u8
size: usize

std.c.getdents

constant

Source line 10868

std.c.getdirentries

constant

Source line 10863

std.c.getegid

function

Source line 11208

pub extern "c" fn getegid() gid_t

std.c.getentropy

constant

Source line 10649

std.c.getenv

function

Source line 11142

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

Parameters

name: [*:0]const u8

std.c.geteuid

function

Source line 11207

pub extern "c" fn geteuid() uid_t

std.c.getgid

function

Source line 11206

pub extern "c" fn getgid() gid_t

std.c.getgrent

function

Source line 10622

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

std.c.getgrgid

function

Source line 10627

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

Parameters

gid: gid_t

std.c.getgrgid_r

function

Source line 10628

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

Parameters

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

std.c.getgrnam

function

Source line 10625

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

Parameters

name: [*:0]const u8

std.c.getgrnam_r

function

Source line 10626

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

Parameters

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

std.c.gethostname

function

Source line 11151

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

Parameters

name: [*]u8
len: usize

std.c.getkeymap

alias

Source line 11971

Alias of std.c.serenity.getkeymap

std.c.getnameinfo

function

Source line 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

Parameters

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

std.c.getpeername

function

Source line 11156

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

Parameters

sockfd: fd_t
addr: *sockaddr
addrlen: *socklen_t

std.c.getpid

function

Source line 11449

pub extern "c" fn getpid() pid_t

std.c.getppid

function

Source line 11450

pub extern "c" fn getppid() pid_t

std.c.getpwent

function

Source line 10615

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

std.c.getpwnam

function

Source line 10618

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

Parameters

name: [*:0]const u8

std.c.getpwnam_r

function

Source line 10619

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

Parameters

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

std.c.getpwnam_shadow

alias

Source line 11713

Alias of std.c.openbsd.getpwnam_shadow

std.c.getpwuid

function

Source line 10620

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

Parameters

uid: uid_t

std.c.getpwuid_r

function

Source line 10621

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

Parameters

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

std.c.getpwuid_shadow

alias

Source line 11714

Alias of std.c.openbsd.getpwuid_shadow

std.c.getrandom

constant

Source line 10654

std.c.getresgid

function

Source line 11210

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

Parameters

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

std.c.getresuid

function

Source line 11209

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

Parameters

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

std.c.getrlimit

function

Source line 11437

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

Parameters

resource: rlimit_resource
rlim: *rlimit

std.c.getrlimit64

function

Source line 10629

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

Parameters

resource: rlimit_resource
rlim: *rlimit

std.c.getrusage

constant

Source line 10873

std.c.getsockname

function

Source line 11155

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

Parameters

sockfd: fd_t
addr: *sockaddr
addrlen: *socklen_t

std.c.getsockopt

function

Source line 11160

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

Parameters

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

std.c.getthrid

alias

Source line 11715

Alias of std.c.openbsd.getthrid

std.c.gettimeofday

constant

Source line 10878

std.c.getuid

function

Source line 11205

pub extern "c" fn getuid() uid_t

std.c.GETUSTACK

alias

Source line 11624

Alias of std.c.illumos.GETUSTACK

std.c.gid_t

type

Source line 189

std.c.group

type

Source line 244

std.c.haiku

alias

Source line 22

Alias of std.c.haiku

std.c.HOST_NAME_MAX

constant

Source line 1314

std.c.host_t

alias

Source line 11799

Alias of std.c.darwin.host_t

std.c.HW

type

Source line 1410

std.c.HW.ALLOWPOWERDOWN

constant

Source line 1447

std.c.HW.BYTEORDER

constant

Source line 1415

std.c.HW.BYTEORDER

constant

Source line 1429

std.c.HW.CPUSPEED

constant

Source line 1437

std.c.HW.DISKCOUNT

constant

Source line 1435

std.c.HW.DISKNAMES

constant

Source line 1419

std.c.HW.DISKNAMES

constant

Source line 1433

std.c.HW.DISKSTATS

constant

Source line 1420

std.c.HW.DISKSTATS

constant

Source line 1434

std.c.HW.FLOATINGPT

constant

Source line 1421

std.c.HW.MACHINE

constant

Source line 1412

std.c.HW.MACHINE

constant

Source line 1426

std.c.HW.MACHINE_ARCH

constant

Source line 1422

std.c.HW.MODEL

constant

Source line 1413

std.c.HW.MODEL

constant

Source line 1427

std.c.HW.NCPU

constant

Source line 1414

std.c.HW.NCPU

constant

Source line 1428

std.c.HW.NCPUFOUND

constant

Source line 1446

std.c.HW.NCPUONLINE

constant

Source line 1450

std.c.HW.PAGESIZE

constant

Source line 1418

std.c.HW.PAGESIZE

constant

Source line 1432

std.c.HW.PERFPOLICY

constant

Source line 1448

std.c.HW.PHYSMEM

constant

Source line 1416

std.c.HW.PHYSMEM

constant

Source line 1430

std.c.HW.PHYSMEM64

constant

Source line 1444

std.c.HW.POWER

constant

Source line 1451

std.c.HW.PRODUCT

constant

Source line 1440

std.c.HW.REALMEM

constant

Source line 1423

std.c.HW.SENSORS

constant

Source line 1436

std.c.HW.SERIALNO

constant

Source line 1442

std.c.HW.SETPERF

constant

Source line 1438

std.c.HW.SMT

constant

Source line 1449

std.c.HW.USERMEM

constant

Source line 1417

std.c.HW.USERMEM

constant

Source line 1431

std.c.HW.USERMEM64

constant

Source line 1445

std.c.HW.UUID

constant

Source line 1443

std.c.HW.VENDOR

constant

Source line 1439

std.c.HW.VERSION

constant

Source line 1441

std.c.HWCAP

type

Source line 10705

std.c.HWCAP.@"2"

namespace

Source line 10758

std.c.HWCAP.@"2"

namespace

Source line 10807

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

constant

Source line 10765

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

constant

Source line 10764

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

constant

Source line 10778

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

constant

Source line 10777

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

constant

Source line 10785

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

constant

Source line 10773

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

constant

Source line 10772

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

constant

Source line 10768

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

constant

Source line 10771

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

constant

Source line 10767

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

constant

Source line 10769

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

constant

Source line 10770

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

constant

Source line 10775

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

constant

Source line 10774

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

constant

Source line 10776

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

constant

Source line 10761

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

constant

Source line 10762

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

constant

Source line 10781

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

constant

Source line 10782

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

constant

Source line 10784

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

constant

Source line 10759

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

constant

Source line 10763

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

constant

Source line 10780

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

constant

Source line 10808

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

constant

Source line 10809

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

constant

Source line 10810

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

constant

Source line 10811

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

constant

Source line 10812

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

constant

Source line 10813

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

constant

Source line 10814

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

constant

Source line 10815

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

constant

Source line 10816

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

constant

Source line 10817

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

constant

Source line 10818

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

constant

Source line 10819

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

constant

Source line 10820

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

constant

Source line 10821

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

constant

Source line 10822

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

constant

Source line 10823

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

constant

Source line 10783

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

constant

Source line 10760

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

constant

Source line 10766

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

constant

Source line 10779

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

constant

Source line 10787

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

constant

Source line 10786

std.c.HWCAP.AES

constant

Source line 10751

std.c.HWCAP.AHF

constant

Source line 10742

std.c.HWCAP.AMD_3DNow

constant

Source line 10733

std.c.HWCAP.AMD_3DNowx

constant

Source line 10734

std.c.HWCAP.AMD_LZCNT

constant

Source line 10746

std.c.HWCAP.AMD_MMX

constant

Source line 10732

std.c.HWCAP.AMD_SSE4A

constant

Source line 10744

std.c.HWCAP.AMD_SVM

constant

Source line 10756

std.c.HWCAP.AMD_SYSC

constant

Source line 10729

std.c.HWCAP.AVX

constant

Source line 10754

std.c.HWCAP.CMOV

constant

Source line 10730

std.c.HWCAP.CX16

constant

Source line 10741

std.c.HWCAP.CX8

constant

Source line 10727

std.c.HWCAP.FPU

constant

Source line 10725

std.c.HWCAP.FXSR

constant

Source line 10735

std.c.HWCAP.ISA_A

constant

Source line 10712

std.c.HWCAP.ISA_A

constant

Source line 10797

std.c.HWCAP.ISA_B

constant

Source line 10713

std.c.HWCAP.ISA_B

constant

Source line 10798

std.c.HWCAP.ISA_C

constant

Source line 10714

std.c.HWCAP.ISA_C

constant

Source line 10799

std.c.HWCAP.ISA_D

constant

Source line 10715

std.c.HWCAP.ISA_D

constant

Source line 10800

std.c.HWCAP.ISA_F

constant

Source line 10716

std.c.HWCAP.ISA_F

constant

Source line 10801

std.c.HWCAP.ISA_H

constant

Source line 10717

std.c.HWCAP.ISA_H

constant

Source line 10802

std.c.HWCAP.ISA_I

constant

Source line 10718

std.c.HWCAP.ISA_I

constant

Source line 10803

std.c.HWCAP.ISA_M

constant

Source line 10719

std.c.HWCAP.ISA_M

constant

Source line 10804

std.c.HWCAP.ISA_V

constant

Source line 10720

std.c.HWCAP.ISA_V

constant

Source line 10805

std.c.HWCAP.MMX

constant

Source line 10731

std.c.HWCAP.MON

constant

Source line 10740

std.c.HWCAP.MOVBE

constant

Source line 10750

std.c.HWCAP.PAUSE

constant

Source line 10738

std.c.HWCAP.PCLMULQDQ

constant

Source line 10752

std.c.HWCAP.POPCNT

constant

Source line 10745

std.c.HWCAP.SEP

constant

Source line 10728

std.c.HWCAP.SSE

constant

Source line 10736

std.c.HWCAP.SSE2

constant

Source line 10737

std.c.HWCAP.SSE3

constant

Source line 10739

std.c.HWCAP.SSE4_1

constant

Source line 10748

std.c.HWCAP.SSE4_2

constant

Source line 10749

std.c.HWCAP.SSSE3

constant

Source line 10747

std.c.HWCAP.TSC

constant

Source line 10726

std.c.HWCAP.TSCP

constant

Source line 10743

std.c.HWCAP.VMX

constant

Source line 10755

std.c.HWCAP.XSAVE

constant

Source line 10753

std.c.hypot

function

Source line 11609

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

Parameters

x: f64
y: f64

std.c.id_t

alias

Source line 11633

Alias of std.c.illumos.id_t

std.c.if_nametoindex

function

Source line 11447

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

Parameters

if_nametoindex: [*:0]const u8

std.c.IFNAMESIZE

constant

Source line 7211

std.c.ifreq

type

Source line 4211

std.c.illumos

alias

Source line 19

Alias of std.c.illumos

std.c.imaxabs

function

Source line 11574

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

Parameters

std.c.imaxdiv

function

Source line 11575

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

Parameters

std.c.imaxdiv_t

container

Source line 11500

Fields

quot: intmax_t
rem: intmax_t

std.c.in_pktinfo

type

Source line 4237

std.c.in_port_t

type

Source line 5408

std.c.in6_pktinfo

type

Source line 4248

std.c.ino_t

type

Source line 80

std.c.inotify_add_watch

function

Source line 10688

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

Parameters

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

std.c.inotify_init1

function

Source line 10687

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

Parameters

flags: c_uint

std.c.inotify_rm_watch

function

Source line 10689

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

Parameters

fd: fd_t
wd: c_int

std.c.insque

function

Source line 11571

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

Parameters

element: *anyopaque
pred: ?*anyopaque

std.c.integer_t

alias

Source line 11800

Alias of std.c.darwin.integer_t

std.c.intmax_t

type

Source line 11505

std.c.IOCPARM_MASK

type

Source line 3869

std.c.ioctl

constant

Source line 11536

std.c.IOV_MAX

constant

Source line 1322

std.c.iovec

alias

Source line 29

Alias of std.posix.iovec

std.c.iovec_const

alias

Source line 30

Alias of std.posix.iovec_const

std.c.IP

type

Source line 6848

std.c.ipc_space_port_t

alias

Source line 11802

Alias of std.c.darwin.ipc_space_port_t

std.c.ipc_space_t

alias

Source line 11801

Alias of std.c.darwin.ipc_space_t

std.c.IPPROTO

type

Source line 6249

std.c.IPPROTO.@"3PC"

constant

Source line 6337

Third Party Connect

std.c.IPPROTO.@"3PC"

constant

Source line 6667

std.c.IPPROTO.ADFS

constant

Source line 6403

Any distributed FS

std.c.IPPROTO.ADFS

constant

Source line 6700

std.c.IPPROTO.AH

constant

Source line 6369

IP6 Auth Header

std.c.IPPROTO.AH

constant

Source line 6529

IPsec Authentication Hdr.

std.c.IPPROTO.AH

constant

Source line 6595

authentication header

std.c.IPPROTO.AH

constant

Source line 6683

std.c.IPPROTO.AH

constant

Source line 6754

std.c.IPPROTO.AH

constant

Source line 6802

authentication header

std.c.IPPROTO.AH

constant

Source line 6842

std.c.IPPROTO.AHIP

constant

Source line 6389

any host internal protocol

std.c.IPPROTO.AHIP

constant

Source line 6693

std.c.IPPROTO.APES

constant

Source line 6465

any private encr. scheme

std.c.IPPROTO.APES

constant

Source line 6731

std.c.IPPROTO.ARGUS

constant

Source line 6297

Argus

std.c.IPPROTO.ARGUS

constant

Source line 6647

std.c.IPPROTO.AX25

constant

Source line 6453

AX.25 Frames

std.c.IPPROTO.AX25

constant

Source line 6725

std.c.IPPROTO.BHA

constant

Source line 6365

BHA

std.c.IPPROTO.BHA

constant

Source line 6681

std.c.IPPROTO.BLT

constant

Source line 6329

Bulk Data Transfer

std.c.IPPROTO.BLT

constant

Source line 6663

std.c.IPPROTO.BRSATMON

constant

Source line 6419

BackRoom SATNET Monitoring

std.c.IPPROTO.BRSATMON

constant

Source line 6708

std.c.IPPROTO.CARP

constant

Source line 6483

CARP

std.c.IPPROTO.CARP

constant

Source line 6619

Common Address Resolution Protocol

std.c.IPPROTO.CARP

constant

Source line 6735

std.c.IPPROTO.CARP

constant

Source line 6826

Common Address Resolution Protocol

std.c.IPPROTO.CFTP

constant

Source line 6391

CFTP

std.c.IPPROTO.CFTP

constant

Source line 6694

std.c.IPPROTO.CHAOS

constant

Source line 6303

Chaos

std.c.IPPROTO.CHAOS

constant

Source line 6650

std.c.IPPROTO.CMTP

constant

Source line 6345

Control Message Transport

std.c.IPPROTO.CMTP

constant

Source line 6671

std.c.IPPROTO.CPHB

constant

Source line 6413

Comp. Prot. HeartBeat

std.c.IPPROTO.CPHB

constant

Source line 6705

std.c.IPPROTO.CPNX

constant

Source line 6411

Comp. Prot. Net. Executive

std.c.IPPROTO.CPNX

constant

Source line 6704

std.c.IPPROTO.DCCP

constant

Source line 6335

Datagram Congestion Control Protocol

std.c.IPPROTO.DCCP

constant

Source line 6581

DCCP

std.c.IPPROTO.DDP

constant

Source line 6343

Datagram Delivery

std.c.IPPROTO.DDP

constant

Source line 6670

std.c.IPPROTO.DGP

constant

Source line 6439

dissimilar gateway prot.

std.c.IPPROTO.DGP

constant

Source line 6718

std.c.IPPROTO.DIVERT

constant

Source line 6738

std.c.IPPROTO.DONE

constant

Source line 6740

std.c.IPPROTO.DSTOPTS

constant

Source line 6387

IP6 destination option

std.c.IPPROTO.DSTOPTS

constant

Source line 6535

Destination options

std.c.IPPROTO.DSTOPTS

constant

Source line 6605

IP6 destination option

std.c.IPPROTO.DSTOPTS

constant

Source line 6692

std.c.IPPROTO.DSTOPTS

constant

Source line 6757

std.c.IPPROTO.DSTOPTS

constant

Source line 6812

IP6 destination option

std.c.IPPROTO.EGP

constant

Source line 6287

exterior gateway protocol

std.c.IPPROTO.EGP

constant

Source line 6511

exterior gateway protocol

std.c.IPPROTO.EGP

constant

Source line 6571

exterior gateway protocol

std.c.IPPROTO.EGP

constant

Source line 6642

std.c.IPPROTO.EGP

constant

Source line 6780

exterior gateway protocol

std.c.IPPROTO.EMCON

constant

Source line 6299

EMCON

std.c.IPPROTO.EMCON

constant

Source line 6648

std.c.IPPROTO.ENCAP

constant

Source line 6463

encapsulation header

std.c.IPPROTO.ENCAP

constant

Source line 6507

IP in IP encapsulation

std.c.IPPROTO.ENCAP

constant

Source line 6611

encapsulation header

std.c.IPPROTO.ENCAP

constant

Source line 6730

std.c.IPPROTO.ENCAP

constant

Source line 6818

encapsulation header

std.c.IPPROTO.EON

constant

Source line 6427

ISO cnlp

std.c.IPPROTO.EON

constant

Source line 6541

ISO clnp

std.c.IPPROTO.EON

constant

Source line 6607

ISO cnlp

std.c.IPPROTO.EON

constant

Source line 6712

std.c.IPPROTO.EON

constant

Source line 6814

ISO cnlp

std.c.IPPROTO.ESP

constant

Source line 6367

IP6 Encap Sec. Payload

std.c.IPPROTO.ESP

constant

Source line 6527

IPsec Encap. Sec. Payload

std.c.IPPROTO.ESP

constant

Source line 6593

encap. security payload

std.c.IPPROTO.ESP

constant

Source line 6682

std.c.IPPROTO.ESP

constant

Source line 6753

std.c.IPPROTO.ESP

constant

Source line 6800

encap. security payload

std.c.IPPROTO.ESP

constant

Source line 6841

std.c.IPPROTO.ETHERIP

constant

Source line 6461

Ethernet IP encapsulation

std.c.IPPROTO.ETHERIP

constant

Source line 6609

Ethernet-in-IP

std.c.IPPROTO.ETHERIP

constant

Source line 6729

std.c.IPPROTO.ETHERIP

constant

Source line 6758

std.c.IPPROTO.ETHERIP

constant

Source line 6816

Ethernet-in-IP

std.c.IPPROTO.FRAGMENT

constant

Source line 6355

IP6 fragmentation header

std.c.IPPROTO.FRAGMENT

constant

Source line 6523

Fragment header for IPv6

std.c.IPPROTO.FRAGMENT

constant

Source line 6587

IP6 fragmentation header

std.c.IPPROTO.FRAGMENT

constant

Source line 6676

std.c.IPPROTO.FRAGMENT

constant

Source line 6752

std.c.IPPROTO.FRAGMENT

constant

Source line 6794

IP6 fragmentation header

std.c.IPPROTO.GGP

constant

Source line 6279

gateway^2 (deprecated)

std.c.IPPROTO.GGP

constant

Source line 6505

gateway^2 (deprecated)

std.c.IPPROTO.GGP

constant

Source line 6563

gateway^2 (deprecated)

std.c.IPPROTO.GGP

constant

Source line 6638

std.c.IPPROTO.GGP

constant

Source line 6772

gateway^2 (deprecated)

std.c.IPPROTO.GMTP

constant

Source line 6467

GMTP

std.c.IPPROTO.GMTP

constant

Source line 6732

std.c.IPPROTO.GRE

constant

Source line 6361

General Routing Encap.

std.c.IPPROTO.GRE

constant

Source line 6591

GRE encaps RFC 1701

std.c.IPPROTO.GRE

constant

Source line 6679

std.c.IPPROTO.GRE

constant

Source line 6798

GRE encaps RFC 1701

std.c.IPPROTO.HELLO

constant

Source line 6393

"hello" routing protocol

std.c.IPPROTO.HELLO

constant

Source line 6537

"hello" routing protocol

std.c.IPPROTO.HELLO

constant

Source line 6695

std.c.IPPROTO.HIP

constant

Source line 6477

IP6 Host Identity Protocol

std.c.IPPROTO.HMP

constant

Source line 6309

Host Monitoring

std.c.IPPROTO.HMP

constant

Source line 6653

std.c.IPPROTO.HOPOPTS

constant

Source line 6275

IP6 hop-by-hop options

std.c.IPPROTO.HOPOPTS

constant

Source line 6499

Hop by hop header for IPv6

std.c.IPPROTO.HOPOPTS

constant

Source line 6557

IP6 hop-by-hop options

std.c.IPPROTO.HOPOPTS

constant

Source line 6636

std.c.IPPROTO.HOPOPTS

constant

Source line 6745

std.c.IPPROTO.HOPOPTS

constant

Source line 6766

IP6 hop-by-hop options

std.c.IPPROTO.ICMP

constant

Source line 6253

std.c.IPPROTO.ICMP

constant

Source line 6265

control message protocol

std.c.IPPROTO.ICMP

constant

Source line 6501

control message protocol

std.c.IPPROTO.ICMP

constant

Source line 6559

control message protocol

std.c.IPPROTO.ICMP

constant

Source line 6631

std.c.IPPROTO.ICMP

constant

Source line 6746

std.c.IPPROTO.ICMP

constant

Source line 6768

control message protocol

std.c.IPPROTO.ICMP

constant

Source line 6835

std.c.IPPROTO.ICMPV6

constant

Source line 6254

std.c.IPPROTO.ICMPV6

constant

Source line 6383

ICMP6

std.c.IPPROTO.ICMPV6

constant

Source line 6531

ICMP for IPv6

std.c.IPPROTO.ICMPV6

constant

Source line 6601

ICMP6

std.c.IPPROTO.ICMPV6

constant

Source line 6690

std.c.IPPROTO.ICMPV6

constant

Source line 6755

std.c.IPPROTO.ICMPV6

constant

Source line 6808

ICMP6

std.c.IPPROTO.ICMPV6

constant

Source line 6843

std.c.IPPROTO.IDP

constant

Source line 6313

xns idp

std.c.IPPROTO.IDP

constant

Source line 6517

xns idp

std.c.IPPROTO.IDP

constant

Source line 6577

xns idp

std.c.IPPROTO.IDP

constant

Source line 6655

std.c.IPPROTO.IDP

constant

Source line 6786

xns idp

std.c.IPPROTO.IDPR

constant

Source line 6339

InterDomain Policy Routing

std.c.IPPROTO.IDPR

constant

Source line 6668

std.c.IPPROTO.IDRP

constant

Source line 6357

InterDomain Routing

std.c.IPPROTO.IDRP

constant

Source line 6677

std.c.IPPROTO.IGMP

constant

Source line 6277

group mgmt protocol

std.c.IPPROTO.IGMP

constant

Source line 6503

group control protocol

std.c.IPPROTO.IGMP

constant

Source line 6561

group mgmt protocol

std.c.IPPROTO.IGMP

constant

Source line 6637

std.c.IPPROTO.IGMP

constant

Source line 6747

std.c.IPPROTO.IGMP

constant

Source line 6770

group mgmt protocol

std.c.IPPROTO.IGMP

constant

Source line 6836

std.c.IPPROTO.IGP

constant

Source line 6437

NSFNET-IGP

std.c.IPPROTO.IGP

constant

Source line 6717

std.c.IPPROTO.IGRP

constant

Source line 6443

Cisco/GXS IGRP

std.c.IPPROTO.IGRP

constant

Source line 6720

std.c.IPPROTO.IL

constant

Source line 6349

IL transport protocol

std.c.IPPROTO.IL

constant

Source line 6673

std.c.IPPROTO.INLSP

constant

Source line 6371

Integ. Net Layer Security

std.c.IPPROTO.INLSP

constant

Source line 6684

std.c.IPPROTO.INP

constant

Source line 6333

Merit Internodal

std.c.IPPROTO.INP

constant

Source line 6665

std.c.IPPROTO.IP

constant

Source line 6257

std.c.IPPROTO.IP

constant

Source line 6263

dummy for IP

std.c.IPPROTO.IP

constant

Source line 6497

dummy for IP

std.c.IPPROTO.IP

constant

Source line 6555

dummy for IP

std.c.IPPROTO.IP

constant

Source line 6630

std.c.IPPROTO.IP

constant

Source line 6744

std.c.IPPROTO.IP

constant

Source line 6764

dummy for IP

std.c.IPPROTO.IP

constant

Source line 6834

std.c.IPPROTO.IPCOMP

constant

Source line 6469

payload compression (IPComp)

std.c.IPPROTO.IPCOMP

constant

Source line 6615

IP Payload Comp. Protocol

std.c.IPPROTO.IPCOMP

constant

Source line 6733

std.c.IPPROTO.IPCOMP

constant

Source line 6822

IP Payload Comp. Protocol

std.c.IPPROTO.IPCV

constant

Source line 6409

Packet Core Utility

std.c.IPPROTO.IPCV

constant

Source line 6703

std.c.IPPROTO.IPEIP

constant

Source line 6455

IP encapsulated in IP

std.c.IPPROTO.IPEIP

constant

Source line 6726

std.c.IPPROTO.IPIP

alias

Source line 6283

for compatibility

Alias of std.c.IPPROTO.IPV4

std.c.IPPROTO.IPIP

constant

Source line 6567

IP inside IP

std.c.IPPROTO.IPIP

alias

Source line 6640

Alias of std.c.IPPROTO.IPV4

std.c.IPPROTO.IPIP

constant

Source line 6776

IP inside IP

std.c.IPPROTO.IPIP

constant

Source line 6837

std.c.IPPROTO.IPPC

constant

Source line 6401

Pluribus Packet Core

std.c.IPPROTO.IPPC

constant

Source line 6699

std.c.IPPROTO.IPV4

constant

Source line 6281

IPv4 encapsulation

std.c.IPPROTO.IPV4

constant

Source line 6565

IP header

std.c.IPPROTO.IPV4

constant

Source line 6639

std.c.IPPROTO.IPV4

alias

Source line 6774

IP header

Alias of std.c.IPPROTO.IPIP

std.c.IPPROTO.IPV6

constant

Source line 6258

std.c.IPPROTO.IPV6

constant

Source line 6271

IP6 header

std.c.IPPROTO.IPV6

constant

Source line 6519

IPv6 encapsulated in IP

std.c.IPPROTO.IPV6

constant

Source line 6583

IP6 header

std.c.IPPROTO.IPV6

constant

Source line 6634

std.c.IPPROTO.IPV6

constant

Source line 6750

std.c.IPPROTO.IPV6

constant

Source line 6790

IP6 header

std.c.IPPROTO.IPV6

constant

Source line 6840

std.c.IPPROTO.IPV6_ICMP

constant

Source line 6599

IPv6 ICMP

std.c.IPPROTO.IPV6_ICMP

constant

Source line 6806

IPv6 ICMP

std.c.IPPROTO.IRTP

constant

Source line 6325

Reliable Transaction

std.c.IPPROTO.IRTP

constant

Source line 6661

std.c.IPPROTO.KRYPTOLAN

constant

Source line 6397

Kryptolan

std.c.IPPROTO.KRYPTOLAN

constant

Source line 6697

std.c.IPPROTO.L2TP

constant

Source line 6621

L2TPv3

std.c.IPPROTO.LARP

constant

Source line 6449

Locus Address Resoloution

std.c.IPPROTO.LARP

constant

Source line 6723

std.c.IPPROTO.LEAF1

constant

Source line 6319

Leaf-1

std.c.IPPROTO.LEAF1

constant

Source line 6658

std.c.IPPROTO.LEAF2

constant

Source line 6321

Leaf-2

std.c.IPPROTO.LEAF2

constant

Source line 6659

std.c.IPPROTO.MAX

constant

Source line 6739

std.c.IPPROTO.MAX

constant

Source line 6760

std.c.IPPROTO.MEAS

constant

Source line 6307

DCN Measurement Subsystems

std.c.IPPROTO.MEAS

constant

Source line 6652

std.c.IPPROTO.MH

constant

Source line 6473

IPv6 Mobility Header

std.c.IPPROTO.MHRP

constant

Source line 6363

Mobile Host Routing

std.c.IPPROTO.MHRP

constant

Source line 6680

std.c.IPPROTO.MICP

constant

Source line 6457

Mobile Int.ing control

std.c.IPPROTO.MICP

constant

Source line 6727

std.c.IPPROTO.MOBILE

constant

Source line 6377

IP Mobility

std.c.IPPROTO.MOBILE

constant

Source line 6597

IP Mobility RFC 2004

std.c.IPPROTO.MOBILE

constant

Source line 6687

std.c.IPPROTO.MOBILE

constant

Source line 6804

IP Mobility RFC 2004

std.c.IPPROTO.MPLS

constant

Source line 6487

MPLS-in-IP

std.c.IPPROTO.MTP

constant

Source line 6451

Multicast Transport

std.c.IPPROTO.MTP

constant

Source line 6724

std.c.IPPROTO.MUX

constant

Source line 6305

Multiplexing

std.c.IPPROTO.MUX

constant

Source line 6651

std.c.IPPROTO.ND

constant

Source line 6421

Sun net disk proto (temp.)

std.c.IPPROTO.ND

constant

Source line 6539

UNOFFICIAL net disk proto

std.c.IPPROTO.ND

constant

Source line 6709

std.c.IPPROTO.NHRP

constant

Source line 6375

Next Hop Resolution

std.c.IPPROTO.NHRP

constant

Source line 6686

std.c.IPPROTO.NONE

constant

Source line 6385

IP6 no next header

std.c.IPPROTO.NONE

constant

Source line 6533

No next header for IPv6

std.c.IPPROTO.NONE

constant

Source line 6603

IP6 no next header

std.c.IPPROTO.NONE

constant

Source line 6691

std.c.IPPROTO.NONE

constant

Source line 6756

std.c.IPPROTO.NONE

constant

Source line 6810

IP6 no next header

std.c.IPPROTO.NSP

constant

Source line 6331

Network Services

std.c.IPPROTO.NSP

constant

Source line 6664

std.c.IPPROTO.NVPII

constant

Source line 6293

network voice protocol

std.c.IPPROTO.NVPII

constant

Source line 6645

std.c.IPPROTO.OSPF

constant

Source line 6543

OSPF

std.c.IPPROTO.OSPFIGP

constant

Source line 6445

OSPFIGP

std.c.IPPROTO.OSPFIGP

constant

Source line 6721

std.c.IPPROTO.PFSYNC

constant

Source line 6489

PFSYNC

std.c.IPPROTO.PFSYNC

constant

Source line 6625

PFSYNC

std.c.IPPROTO.PFSYNC

constant

Source line 6737

std.c.IPPROTO.PFSYNC

constant

Source line 6828

PFSYNC

std.c.IPPROTO.PGM

constant

Source line 6485

PGM

std.c.IPPROTO.PGM

constant

Source line 6736

std.c.IPPROTO.PIGP

constant

Source line 6289

private interior gateway

std.c.IPPROTO.PIGP

constant

Source line 6643

std.c.IPPROTO.PIM

constant

Source line 6481

Protocol Independent Mcast

std.c.IPPROTO.PIM

constant

Source line 6545

PIM routing protocol

std.c.IPPROTO.PIM

constant

Source line 6613

Protocol indep. multicast

std.c.IPPROTO.PIM

constant

Source line 6734

std.c.IPPROTO.PIM

constant

Source line 6820

Protocol indep. multicast

std.c.IPPROTO.PRM

constant

Source line 6311

Packet Radio Measurement

std.c.IPPROTO.PRM

constant

Source line 6654

std.c.IPPROTO.PROTO_SDP

constant

Source line 6551

Sockets Direct Protocol

std.c.IPPROTO.PUP

constant

Source line 6295

pup

std.c.IPPROTO.PUP

constant

Source line 6513

pup

std.c.IPPROTO.PUP

constant

Source line 6573

pup

std.c.IPPROTO.PUP

constant

Source line 6646

std.c.IPPROTO.PUP

constant

Source line 6782

pup

std.c.IPPROTO.PVP

constant

Source line 6417

Packet Video Protocol

std.c.IPPROTO.PVP

constant

Source line 6707

std.c.IPPROTO.RAW

constant

Source line 6259

std.c.IPPROTO.RAW

constant

Source line 6273

raw IP packet

std.c.IPPROTO.RAW

constant

Source line 6549

raw IP packet

std.c.IPPROTO.RAW

constant

Source line 6627

raw IP packet

std.c.IPPROTO.RAW

constant

Source line 6635

std.c.IPPROTO.RAW

constant

Source line 6759

std.c.IPPROTO.RAW

constant

Source line 6830

raw IP packet

std.c.IPPROTO.RAW

constant

Source line 6844

std.c.IPPROTO.RCCMON

constant

Source line 6291

BBN RCC Monitoring

std.c.IPPROTO.RCCMON

constant

Source line 6644

std.c.IPPROTO.RDP

constant

Source line 6323

Reliable Data

std.c.IPPROTO.RDP

constant

Source line 6660

std.c.IPPROTO.RESERVED_253

constant

Source line 6491

Reserved

std.c.IPPROTO.RESERVED_254

constant

Source line 6493

Reserved

std.c.IPPROTO.ROUTING

constant

Source line 6353

IP6 routing header

std.c.IPPROTO.ROUTING

constant

Source line 6521

Routing header for IPv6

std.c.IPPROTO.ROUTING

constant

Source line 6585

IP6 routing header

std.c.IPPROTO.ROUTING

constant

Source line 6675

std.c.IPPROTO.ROUTING

constant

Source line 6751

std.c.IPPROTO.ROUTING

constant

Source line 6792

IP6 routing header

std.c.IPPROTO.RSVP

constant

Source line 6359

resource reservation

std.c.IPPROTO.RSVP

constant

Source line 6525

rsvp

std.c.IPPROTO.RSVP

constant

Source line 6589

resource reservation

std.c.IPPROTO.RSVP

constant

Source line 6678

std.c.IPPROTO.RSVP

constant

Source line 6796

resource reservation

std.c.IPPROTO.RVD

constant

Source line 6399

Remote Virtual Disk

std.c.IPPROTO.RVD

constant

Source line 6698

std.c.IPPROTO.SATEXPAK

constant

Source line 6395

SATNET/Backroom EXPAK

std.c.IPPROTO.SATEXPAK

constant

Source line 6696

std.c.IPPROTO.SATMON

constant

Source line 6405

Satnet Monitoring

std.c.IPPROTO.SATMON

constant

Source line 6701

std.c.IPPROTO.SCCSP

constant

Source line 6459

Semaphore Comm. security

std.c.IPPROTO.SCCSP

constant

Source line 6728

std.c.IPPROTO.SCTP

constant

Source line 6471

SCTP

std.c.IPPROTO.SCTP

constant

Source line 6547

Stream Control

std.c.IPPROTO.SCTP

constant

Source line 6623

SCTP

std.c.IPPROTO.SDRP

constant

Source line 6351

Source Demand Routing

std.c.IPPROTO.SDRP

constant

Source line 6674

std.c.IPPROTO.SEP

constant

Source line 6666

std.c.IPPROTO.SHIM6

constant

Source line 6479

IP6 Shim6 Protocol

std.c.IPPROTO.SKIP

constant

Source line 6381

SKIP

std.c.IPPROTO.SKIP

constant

Source line 6689

std.c.IPPROTO.SRPC

constant

Source line 6447

Strite RPC protocol

std.c.IPPROTO.SRPC

constant

Source line 6722

std.c.IPPROTO.ST

constant

Source line 6285

Stream protocol II

std.c.IPPROTO.ST

constant

Source line 6641

std.c.IPPROTO.SVMTP

constant

Source line 6431

Secure VMTP

std.c.IPPROTO.SVMTP

constant

Source line 6714

std.c.IPPROTO.SWIPE

constant

Source line 6373

IP with encryption

std.c.IPPROTO.SWIPE

constant

Source line 6685

std.c.IPPROTO.TCF

constant

Source line 6441

TCF

std.c.IPPROTO.TCF

constant

Source line 6719

std.c.IPPROTO.TCP

constant

Source line 6255

std.c.IPPROTO.TCP

constant

Source line 6267

tcp

std.c.IPPROTO.TCP

constant

Source line 6509

tcp

std.c.IPPROTO.TCP

constant

Source line 6569

tcp

std.c.IPPROTO.TCP

constant

Source line 6632

std.c.IPPROTO.TCP

constant

Source line 6748

std.c.IPPROTO.TCP

constant

Source line 6778

tcp

std.c.IPPROTO.TCP

constant

Source line 6838

std.c.IPPROTO.TLSP

constant

Source line 6379

Transport Layer Security

std.c.IPPROTO.TLSP

constant

Source line 6688

std.c.IPPROTO.TP

constant

Source line 6327

tp-4 w/ class negotiation

std.c.IPPROTO.TP

constant

Source line 6579

tp-4 w/ class negotiation

std.c.IPPROTO.TP

constant

Source line 6662

std.c.IPPROTO.TP

constant

Source line 6788

tp-4 w/ class negotiation

std.c.IPPROTO.TPXX

constant

Source line 6347

TP++ Transport

std.c.IPPROTO.TPXX

constant

Source line 6672

std.c.IPPROTO.TRUNK1

constant

Source line 6315

Trunk-1

std.c.IPPROTO.TRUNK1

constant

Source line 6656

std.c.IPPROTO.TRUNK2

constant

Source line 6317

Trunk-2

std.c.IPPROTO.TRUNK2

constant

Source line 6657

std.c.IPPROTO.TTP

constant

Source line 6435

TTP

std.c.IPPROTO.TTP

constant

Source line 6716

std.c.IPPROTO.UDP

constant

Source line 6256

std.c.IPPROTO.UDP

constant

Source line 6269

user datagram protocol

std.c.IPPROTO.UDP

constant

Source line 6515

user datagram protocol

std.c.IPPROTO.UDP

constant

Source line 6575

user datagram protocol

std.c.IPPROTO.UDP

constant

Source line 6633

std.c.IPPROTO.UDP

constant

Source line 6749

std.c.IPPROTO.UDP

constant

Source line 6784

user datagram protocol

std.c.IPPROTO.UDP

constant

Source line 6839

std.c.IPPROTO.UDPLITE

constant

Source line 6475

UDP-Lite

std.c.IPPROTO.UNKNOWN

constant

Source line 6741

std.c.IPPROTO.VINES

constant

Source line 6433

Banyon VINES

std.c.IPPROTO.VINES

constant

Source line 6715

std.c.IPPROTO.VISA

constant

Source line 6407

VISA Protocol

std.c.IPPROTO.VISA

constant

Source line 6702

std.c.IPPROTO.VMTP

constant

Source line 6429

VMTP

std.c.IPPROTO.VMTP

constant

Source line 6713

std.c.IPPROTO.VRRP

constant

Source line 6617

VRRP RFC 2338

std.c.IPPROTO.VRRP

constant

Source line 6824

VRRP RFC 2338

std.c.IPPROTO.WBEXPAK

constant

Source line 6425

WIDEBAND EXPAK

std.c.IPPROTO.WBEXPAK

constant

Source line 6711

std.c.IPPROTO.WBMON

constant

Source line 6423

WIDEBAND Monitoring

std.c.IPPROTO.WBMON

constant

Source line 6710

std.c.IPPROTO.WSN

constant

Source line 6415

Wang Span Network

std.c.IPPROTO.WSN

constant

Source line 6706

std.c.IPPROTO.XNET

constant

Source line 6301

Cross Net Debugger

std.c.IPPROTO.XNET

constant

Source line 6649

std.c.IPPROTO.XTP

constant

Source line 6341

XTP

std.c.IPPROTO.XTP

constant

Source line 6669

std.c.IPTOS

type

Source line 6872

std.c.IPV6

type

Source line 6860

std.c.isatty

function

Source line 11067

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

Parameters

fd: fd_t

std.c.itimerspec

type

Source line 4264

std.c.jrand48

function

Source line 11568

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

Parameters

xsubi: *[3]c_ushort

std.c.KERN

type

Source line 1455

std.c.kern_return_t

alias

Source line 11803

Alias of std.c.darwin.kern_return_t

std.c.KERN.AFFINITY

constant

Source line 1669

std.c.KERN.AIOMAX

constant

Source line 1674

std.c.KERN.AIOPROCMAX

constant

Source line 1675

std.c.KERN.AIOTHREADS

constant

Source line 1676

std.c.KERN.ALLOWDT

constant

Source line 1586

std.c.KERN.ALLOWKMEM

constant

Source line 1573

std.c.KERN.ARGMAX

constant

Source line 1488

std.c.KERN.ARGMAX

constant

Source line 1532

std.c.KERN.ARGMAX

constant

Source line 1635

std.c.KERN.AUDIO

constant

Source line 1605

std.c.KERN.BOOTFILE

constant

Source line 1511

std.c.KERN.BOOTFILE

constant

Source line 1656

std.c.KERN.BOOTTIME

constant

Source line 1506

std.c.KERN.BOOTTIME

constant

Source line 1543

std.c.KERN.BOOTTIME

constant

Source line 1648

std.c.KERN.CACHEPCT

constant

Source line 1593

std.c.KERN.CCPU

constant

Source line 1566

std.c.KERN.CHECKOPENEVT

constant

Source line 1696

std.c.KERN.CLASSIC

constant

Source line 1671

std.c.KERN.CLASSICHANDLER

constant

Source line 1673

std.c.KERN.CLOCKRATE

constant

Source line 1495

std.c.KERN.CLOCKRATE

constant

Source line 1536

std.c.KERN.CLOCKRATE

constant

Source line 1639

std.c.KERN.CONSBUF

constant

Source line 1604

std.c.KERN.CONSBUFSIZE

constant

Source line 1603

std.c.KERN.CONSDEV

constant

Source line 1596

std.c.KERN.COREDUMP

constant

Source line 1679

std.c.KERN.COREFILE

constant

Source line 1678

std.c.KERN.CPTIME

constant

Source line 1561

std.c.KERN.CPTIME2

constant

Source line 1592

std.c.KERN.CPUSTATS

constant

Source line 1606

std.c.KERN.DOMAINNAME

constant

Source line 1544

std.c.KERN.DOMAINNAME

constant

Source line 1650

std.c.KERN.DUMMY

constant

Source line 1516

std.c.KERN.DUMMY

constant

Source line 1661

std.c.KERN.DUMPDEV

constant

Source line 1514

std.c.KERN.DUMPDEV

constant

Source line 1659

std.c.KERN.EVCOUNT

constant

Source line 1589

std.c.KERN.EXEC

constant

Source line 1672

std.c.KERN.FILE

constant

Source line 1498

std.c.KERN.FILE

constant

Source line 1594

std.c.KERN.FILE

constant

Source line 1642

std.c.KERN.FORKSTAT

constant

Source line 1563

std.c.KERN.FSCALE

constant

Source line 1567

std.c.KERN.FSYNC

constant

Source line 1554

std.c.KERN.GLOBAL_PTRACE

constant

Source line 1602

std.c.KERN.HOSTID

constant

Source line 1494

std.c.KERN.HOSTID

constant

Source line 1535

std.c.KERN.HOSTID

constant

Source line 1638

std.c.KERN.HOSTNAME

constant

Source line 1493

std.c.KERN.HOSTNAME

constant

Source line 1534

std.c.KERN.HOSTNAME

constant

Source line 1637

std.c.KERN.INTRCNT

constant

Source line 1584

std.c.KERN.IOV_MAX

constant

Source line 1463

std.c.KERN.IOV_MAX

constant

Source line 1470

std.c.KERN.IOV_MAX

constant

Source line 1520

std.c.KERN.IPC

constant

Source line 1515

std.c.KERN.IPC

constant

Source line 1660

std.c.KERN.JOB_CONTROL

constant

Source line 1504

std.c.KERN.JOB_CONTROL

constant

Source line 1541

std.c.KERN.JOB_CONTROL

constant

Source line 1646

std.c.KERN.KDEBUG

constant

Source line 1652

std.c.KERN.LOGSIGEXIT

constant

Source line 1519

std.c.KERN.LOGSIGEXIT

constant

Source line 1664

std.c.KERN.LOW_PRI_DELAY

constant

Source line 1684

std.c.KERN.LOW_PRI_WINDOW

constant

Source line 1683

std.c.KERN.MALLOCSTATS

constant

Source line 1560

std.c.KERN.MAXCLUSTERS

constant

Source line 1588

std.c.KERN.MAXFILES

constant

Source line 1486

std.c.KERN.MAXFILES

constant

Source line 1531

std.c.KERN.MAXFILES

constant

Source line 1634

std.c.KERN.MAXFILESPERPROC

constant

Source line 1512

std.c.KERN.MAXFILESPERPROC

constant

Source line 1657

std.c.KERN.MAXID

constant

Source line 1522

std.c.KERN.MAXID

constant

Source line 1698

std.c.KERN.MAXLOCKSPERUID

constant

Source line 1591

std.c.KERN.MAXPARTITIONS

constant

Source line 1545

std.c.KERN.MAXPARTITIONS

constant

Source line 1651

std.c.KERN.MAXPOSIXLOCKSPERUID

constant

Source line 1521

std.c.KERN.MAXPROC

constant

Source line 1484

std.c.KERN.MAXPROC

constant

Source line 1530

std.c.KERN.MAXPROC

constant

Source line 1633

std.c.KERN.MAXPROCPERUID

constant

Source line 1513

std.c.KERN.MAXPROCPERUID

constant

Source line 1658

std.c.KERN.MAXTHREAD

constant

Source line 1547

std.c.KERN.MAXVNODES

constant

Source line 1482

std.c.KERN.MAXVNODES

constant

Source line 1529

std.c.KERN.MAXVNODES

constant

Source line 1632

std.c.KERN.MBSTAT

constant

Source line 1580

std.c.KERN.MSGBUF

constant

Source line 1569

std.c.KERN.MSGBUFSIZE

constant

Source line 1559

std.c.KERN.NCHSTATS

constant

Source line 1562

std.c.KERN.NETBOOT

constant

Source line 1667

std.c.KERN.NETLIVELOCKS

constant

Source line 1597

std.c.KERN.NFILES

constant

Source line 1577

std.c.KERN.NGROUPS

constant

Source line 1503

std.c.KERN.NGROUPS

constant

Source line 1540

std.c.KERN.NGROUPS

constant

Source line 1645

std.c.KERN.NISDOMAINNAME

constant

Source line 1507

std.c.KERN.NISDOMAINNAME

constant

Source line 1649

std.c.KERN.NOSUIDCOREDUMP

constant

Source line 1553

std.c.KERN.NPROCS

constant

Source line 1568

std.c.KERN.NSELCOLL

constant

Source line 1564

std.c.KERN.NTHREADS

constant

Source line 1548

std.c.KERN.NTP_PLL

constant

Source line 1510

std.c.KERN.NTP_PLL

constant

Source line 1655

std.c.KERN.NUMVNODES

constant

Source line 1579

std.c.KERN.NX_PROTECTION

constant

Source line 1687

std.c.KERN.OSRELDATE

constant

Source line 1509

std.c.KERN.OSRELDATE

constant

Source line 1654

std.c.KERN.OSRELEASE

constant

Source line 1476

std.c.KERN.OSRELEASE

constant

Source line 1526

std.c.KERN.OSRELEASE

constant

Source line 1629

std.c.KERN.OSREV

constant

Source line 1478

std.c.KERN.OSREV

constant

Source line 1527

std.c.KERN.OSREV

constant

Source line 1630

std.c.KERN.OSTYPE

constant

Source line 1474

std.c.KERN.OSTYPE

constant

Source line 1525

std.c.KERN.OSTYPE

constant

Source line 1628

std.c.KERN.OSVERSION

constant

Source line 1549

std.c.KERN.OSVERSION

constant

Source line 1692

std.c.KERN.PFSTATUS

constant

Source line 1607

std.c.KERN.POOL

constant

Source line 1570

std.c.KERN.POOL_DEBUG

constant

Source line 1598

std.c.KERN.POSIX

constant

Source line 1685

std.c.KERN.POSIX1

constant

Source line 1502

std.c.KERN.POSIX1

constant

Source line 1539

std.c.KERN.POSIX1

constant

Source line 1644

std.c.KERN.PROC

constant

Source line 1458

struct: process entries

std.c.KERN.PROC

constant

Source line 1497

std.c.KERN.PROC

constant

Source line 1587

std.c.KERN.PROC

constant

Source line 1641

std.c.KERN.PROC_ALL

constant

Source line 1473

std.c.KERN.PROC_ALL

constant

Source line 1612

std.c.KERN.PROC_ARGS

constant

Source line 1467

struct: process argv/env

std.c.KERN.PROC_ARGS

constant

Source line 1487

std.c.KERN.PROC_ARGS

constant

Source line 1576

std.c.KERN.PROC_ARGV

constant

Source line 1622

std.c.KERN.PROC_CWD

constant

Source line 1489

std.c.KERN.PROC_CWD

constant

Source line 1599

std.c.KERN.PROC_ENV

constant

Source line 1624

std.c.KERN.PROC_FILEDESC

constant

Source line 1462

file descriptors for process

std.c.KERN.PROC_FLAG_LWP

constant

Source line 1501

std.c.KERN.PROC_FLAGMASK

constant

Source line 1499

std.c.KERN.PROC_KTHREAD

constant

Source line 1619

std.c.KERN.PROC_NARGV

constant

Source line 1623

std.c.KERN.PROC_NENV

constant

Source line 1625

std.c.KERN.PROC_NOBROADCASTKILL

constant

Source line 1600

std.c.KERN.PROC_PATHNAME

constant

Source line 1460

path to executable

std.c.KERN.PROC_PATHNAME

constant

Source line 1469

path to executable

std.c.KERN.PROC_PATHNAME

constant

Source line 1490

std.c.KERN.PROC_PGRP

constant

Source line 1477

std.c.KERN.PROC_PGRP

constant

Source line 1614

std.c.KERN.PROC_PID

constant

Source line 1475

std.c.KERN.PROC_PID

constant

Source line 1613

std.c.KERN.PROC_RUID

constant

Source line 1485

std.c.KERN.PROC_RUID

constant

Source line 1618

std.c.KERN.PROC_SESSION

constant

Source line 1479

std.c.KERN.PROC_SESSION

constant

Source line 1615

std.c.KERN.PROC_SHOW_THREADS

constant

Source line 1620

std.c.KERN.PROC_SIGTRAMP

constant

Source line 1492

std.c.KERN.PROC_TTY

constant

Source line 1481

std.c.KERN.PROC_TTY

constant

Source line 1616

std.c.KERN.PROC_UID

constant

Source line 1483

std.c.KERN.PROC_UID

constant

Source line 1617

std.c.KERN.PROC_VMMAP

constant

Source line 1601

std.c.KERN.PROCARGS

constant

Source line 1666

std.c.KERN.PROCARGS2

constant

Source line 1677

std.c.KERN.PROCDELAYTERM

constant

Source line 1681

std.c.KERN.PROCNAME

constant

Source line 1689

std.c.KERN.PROF

constant

Source line 1500

std.c.KERN.PROF

constant

Source line 1538

std.c.KERN.PROF

constant

Source line 1643

std.c.KERN.PS_STRINGS

constant

Source line 1517

std.c.KERN.PS_STRINGS

constant

Source line 1662

std.c.KERN.RAGEVNODE

constant

Source line 1694

std.c.KERN.RAWPARTITION

constant

Source line 1546

std.c.KERN.SAFEBOOT

constant

Source line 1693

std.c.KERN.SAVED_IDS

constant

Source line 1505

std.c.KERN.SAVED_IDS

constant

Source line 1542

std.c.KERN.SAVED_IDS

constant

Source line 1647

std.c.KERN.SECURELVL

constant

Source line 1491

std.c.KERN.SECURELVL

constant

Source line 1533

std.c.KERN.SECURELVL

constant

Source line 1636

std.c.KERN.SEMINFO

constant

Source line 1582

std.c.KERN.SHMINFO

constant

Source line 1583

std.c.KERN.SHREG_PRIVATIZABLE

constant

Source line 1682

std.c.KERN.SOMAXCONN

constant

Source line 1550

std.c.KERN.SOMINCONN

constant

Source line 1551

std.c.KERN.SPECULATIVE_READS

constant

Source line 1691

std.c.KERN.SPLASSERT

constant

Source line 1575

std.c.KERN.STACKGAPRANDOM

constant

Source line 1571

std.c.KERN.SUGID_COREDUMP

constant

Source line 1680

std.c.KERN.SYMFILE

constant

Source line 1665

std.c.KERN.SYSV

constant

Source line 1668

std.c.KERN.SYSVIPC_INFO

constant

Source line 1572

std.c.KERN.SYSVMSG

constant

Source line 1555

std.c.KERN.SYSVSEM

constant

Source line 1556

std.c.KERN.SYSVSHM

constant

Source line 1557

std.c.KERN.TFP

constant

Source line 1688

std.c.KERN.THALTSTACK

constant

Source line 1690

std.c.KERN.THREADNAME

constant

Source line 1697

std.c.KERN.TIMECOUNTER

constant

Source line 1590

std.c.KERN.TIMEOUT_STATS

constant

Source line 1608

std.c.KERN.TRANSLATE

constant

Source line 1670

std.c.KERN.TTY

constant

Source line 1565

std.c.KERN.TTY

constant

Source line 1695

std.c.KERN.TTYCOUNT

constant

Source line 1578

std.c.KERN.UPDATEINTERVAL

constant

Source line 1508

std.c.KERN.UPDATEINTERVAL

constant

Source line 1653

std.c.KERN.USRSTACK

constant

Source line 1518

std.c.KERN.USRSTACK32

constant

Source line 1663

std.c.KERN.USRSTACK64

constant

Source line 1686

std.c.KERN.UTC_OFFSET

constant

Source line 1609

std.c.KERN.VERSION

constant

Source line 1480

std.c.KERN.VERSION

constant

Source line 1528

std.c.KERN.VERSION

constant

Source line 1631

std.c.KERN.VIDEO

constant

Source line 1610

std.c.KERN.VNODE

constant

Source line 1496

std.c.KERN.VNODE

constant

Source line 1640

std.c.KERN.WATCHDOG

constant

Source line 1585

std.c.KERN.WITNESS

constant

Source line 1581

std.c.KERN.WITNESSWATCH

constant

Source line 1574

std.c.KERN.WXABORT

constant

Source line 1595

std.c.kevent

function

Source line 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

Parameters

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

std.c.Kevent

type

Source line 8440

Renamed from kevent to Kevent to avoid conflict with function name.

std.c.KEVENT

alias

Source line 11754

Alias of std.c.darwin.KEVENT

std.c.kevent64

alias

Source line 11805

Alias of std.c.darwin.kevent64

std.c.kevent64_s

alias

Source line 11806

Alias of std.c.darwin.kevent64_s

std.c.kill

function

Source line 11194

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

Parameters

pid: pid_t
sig: SIG

std.c.kinfo_file

alias

Source line 11744

Alias of std.c.freebsd.kinfo_file

std.c.KINFO_FILE_SIZE

alias

Source line 11735

Alias of std.c.freebsd.KINFO_FILE_SIZE

std.c.kinfo_getfile

alias

Source line 11745

Alias of std.c.freebsd.kinfo_getfile

std.c.kqueue

function

Source line 11311

pub extern "c" fn kqueue() c_int

std.c.labs

function

Source line 11578

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

Parameters

a: c_long

std.c.LC

container

Source line 11456

Fields

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

function

Source line 11582

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

Parameters

a: c_long
b: c_long

std.c.ldiv_t

container

Source line 11490

Fields

quot: c_long
rem: c_long

std.c.lif_ifinfo_req

alias

Source line 11634

Alias of std.c.illumos.lif_ifinfo_req

std.c.lif_nd_req

alias

Source line 11635

Alias of std.c.illumos.lif_nd_req

std.c.lifreq

alias

Source line 11636

Alias of std.c.illumos.lifreq

std.c.linger

type

Source line 4272

std.c.link

function

Source line 11085

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

Parameters

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

std.c.linkat

function

Source line 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

Parameters

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

std.c.linux

alias

Source line 12

Alias of std.os.linux

std.c.listen

function

Source line 11154

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

Parameters

sockfd: fd_t
backlog: c_uint

std.c.llabs

function

Source line 11579

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

Parameters

a: c_longlong

std.c.lldiv

function

Source line 11583

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

Parameters

a: c_longlong
b: c_longlong

std.c.lldiv_t

container

Source line 11495

Fields

quot: c_longlong
rem: c_longlong

std.c.LOCK

alias

Source line 31

Alias of std.posix.LOCK

std.c.login_cap_t

alias

Source line 11716

Alias of std.c.openbsd.login_cap_t

std.c.login_close

alias

Source line 11717

Alias of std.c.openbsd.login_close

std.c.login_getcapbool

alias

Source line 11718

Alias of std.c.openbsd.login_getcapbool

std.c.login_getcapnum

alias

Source line 11719

Alias of std.c.openbsd.login_getcapnum

std.c.login_getcapsize

alias

Source line 11720

Alias of std.c.openbsd.login_getcapsize

std.c.login_getcapstr

alias

Source line 11721

Alias of std.c.openbsd.login_getcapstr

std.c.login_getcaptime

alias

Source line 11722

Alias of std.c.openbsd.login_getcaptime

std.c.login_getclass

alias

Source line 11723

Alias of std.c.openbsd.login_getclass

std.c.login_getstyle

alias

Source line 11724

Alias of std.c.openbsd.login_getstyle

std.c.lseek

function

Source line 11068

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

Parameters

fd: fd_t
offset: off_t
whence: whence_t

std.c.lseek64

function

Source line 10630

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

Parameters

fd: fd_t
offset: i64
whence: c_int

std.c.lwp_gettid

alias

Source line 11957

Alias of std.c.dragonfly.lwp_gettid

std.c.lwpid_t

alias

Source line 11955

Alias of std.c.netbsd.lwpid_t

std.c.MACH

alias

Source line 11755

Alias of std.c.darwin.MACH

std.c.mach_absolute_time

alias

Source line 11807

Alias of std.c.darwin.mach_absolute_time

std.c.mach_continuous_time

alias

Source line 11808

Alias of std.c.darwin.mach_continuous_time

std.c.mach_exception_data_t

alias

Source line 11920

Alias of std.c.darwin.mach_exception_data_t

std.c.mach_exception_data_type_t

alias

Source line 11921

Alias of std.c.darwin.mach_exception_data_type_t

std.c.mach_hdr

alias

Source line 11809

Alias of std.c.darwin.mach_hdr

std.c.mach_host_self

alias

Source line 11810

Alias of std.c.darwin.mach_host_self

std.c.mach_msg

alias

Source line 11811

Alias of std.c.darwin.mach_msg

std.c.mach_msg_bits_t

alias

Source line 11922

Alias of std.c.darwin.mach_msg_bits_t

std.c.mach_msg_header_t

alias

Source line 11924

Alias of std.c.darwin.mach_msg_header_t

std.c.mach_msg_id_t

alias

Source line 11923

Alias of std.c.darwin.mach_msg_id_t

std.c.mach_msg_option_t

alias

Source line 11925

Alias of std.c.darwin.mach_msg_option_t

std.c.mach_msg_return_t

alias

Source line 11812

Alias of std.c.darwin.mach_msg_return_t

std.c.mach_msg_size_t

alias

Source line 11926

Alias of std.c.darwin.mach_msg_size_t

std.c.mach_msg_timeout_t

alias

Source line 11927

Alias of std.c.darwin.mach_msg_timeout_t

std.c.MACH_MSG_TYPE

alias

Source line 11756

Alias of std.c.darwin.MACH_MSG_TYPE

std.c.mach_msg_type_name_t

alias

Source line 11928

Alias of std.c.darwin.mach_msg_type_name_t

std.c.mach_msg_type_number_t

alias

Source line 11813

Alias of std.c.darwin.mach_msg_type_number_t

std.c.mach_port_allocate

alias

Source line 11814

Alias of std.c.darwin.mach_port_allocate

std.c.mach_port_array_t

alias

Source line 11815

Alias of std.c.darwin.mach_port_array_t

std.c.mach_port_deallocate

alias

Source line 11816

Alias of std.c.darwin.mach_port_deallocate

std.c.mach_port_insert_right

alias

Source line 11817

Alias of std.c.darwin.mach_port_insert_right

std.c.mach_port_name_t

alias

Source line 11818

Alias of std.c.darwin.mach_port_name_t

std.c.MACH_PORT_RIGHT

alias

Source line 11757

Alias of std.c.darwin.MACH_PORT_RIGHT

std.c.mach_port_right_t

alias

Source line 11929

Alias of std.c.darwin.mach_port_right_t

std.c.mach_port_t

alias

Source line 11819

Alias of std.c.darwin.mach_port_t

std.c.mach_task_basic_info

alias

Source line 11820

Alias of std.c.darwin.mach_task_basic_info

std.c.MACH_TASK_BASIC_INFO

alias

Source line 11758

Alias of std.c.darwin.MACH_TASK_BASIC_INFO

std.c.MACH_TASK_BASIC_INFO_COUNT

alias

Source line 11759

Alias of std.c.darwin.MACH_TASK_BASIC_INFO_COUNT

std.c.mach_task_self

alias

Source line 11821

Alias of std.c.darwin.mach_task_self

std.c.mach_timebase_info

alias

Source line 11822

Alias of std.c.darwin.mach_timebase_info

std.c.mach_timebase_info_data

alias

Source line 11823

Alias of std.c.darwin.mach_timebase_info_data

std.c.mach_timespec_t

alias

Source line 11824

Alias of std.c.darwin.mach_timespec_t

std.c.mach_vm_address_t

alias

Source line 11825

Alias of std.c.darwin.mach_vm_address_t

std.c.mach_vm_protect

alias

Source line 11826

Alias of std.c.darwin.mach_vm_protect

std.c.mach_vm_read

alias

Source line 11827

Alias of std.c.darwin.mach_vm_read

std.c.mach_vm_region

alias

Source line 11828

Alias of std.c.darwin.mach_vm_region

std.c.mach_vm_region_recurse

alias

Source line 11829

Alias of std.c.darwin.mach_vm_region_recurse

std.c.mach_vm_size_t

alias

Source line 11830

Alias of std.c.darwin.mach_vm_size_t

std.c.mach_vm_write

alias

Source line 11831

Alias of std.c.darwin.mach_vm_write

std.c.MADV

type

Source line 1702

std.c.MADV.ACCESS_DEFAULT

constant

Source line 1746

default access

std.c.MADV.ACCESS_LWP

constant

Source line 1748

next LWP to access heavily

std.c.MADV.ACCESS_MANY

constant

Source line 1750

many processes to access heavily

std.c.MADV.AUTOSYNC

constant

Source line 1727

std.c.MADV.AUTOSYNC

constant

Source line 1764

std.c.MADV.CAN_REUSE

constant

Source line 1715

std.c.MADV.CONTROL_END

alias

Source line 1756

Alias of std.c.MADV.SETMAP

std.c.MADV.CONTROL_START

alias

Source line 1761

Alias of std.c.MADV.INVAL

std.c.MADV.CORE

constant

Source line 1729

std.c.MADV.CORE

constant

Source line 1766

std.c.MADV.DONTNEED

constant

Source line 1710

std.c.MADV.DONTNEED

constant

Source line 1724

std.c.MADV.DONTNEED

constant

Source line 1742

don't need these pages

std.c.MADV.DONTNEED

constant

Source line 1757

std.c.MADV.DONTNEED

constant

Source line 1775

std.c.MADV.DONTNEED

constant

Source line 1785

std.c.MADV.FREE

constant

Source line 1711

std.c.MADV.FREE

constant

Source line 1725

std.c.MADV.FREE

constant

Source line 1744

contents can be freed

std.c.MADV.FREE

constant

Source line 1762

std.c.MADV.FREE

constant

Source line 1787

std.c.MADV.FREE_REUSABLE

constant

Source line 1713

std.c.MADV.FREE_REUSE

constant

Source line 1714

std.c.MADV.INVAL

constant

Source line 1767

std.c.MADV.NOCORE

constant

Source line 1728

std.c.MADV.NOCORE

constant

Source line 1765

std.c.MADV.NORMAL

constant

Source line 1706

std.c.MADV.NORMAL

constant

Source line 1720

std.c.MADV.NORMAL

constant

Source line 1734

no further special treatment

std.c.MADV.NORMAL

constant

Source line 1760

std.c.MADV.NORMAL

constant

Source line 1772

std.c.MADV.NORMAL

constant

Source line 1781

std.c.MADV.NOSYNC

constant

Source line 1726

std.c.MADV.NOSYNC

constant

Source line 1763

std.c.MADV.PAGEOUT

constant

Source line 1716

std.c.MADV.PROTECT

constant

Source line 1730

std.c.MADV.PURGE

constant

Source line 1752

contents will be purged

std.c.MADV.RANDOM

constant

Source line 1707

std.c.MADV.RANDOM

constant

Source line 1721

std.c.MADV.RANDOM

constant

Source line 1736

expect random page references

std.c.MADV.RANDOM

constant

Source line 1758

std.c.MADV.RANDOM

constant

Source line 1778

std.c.MADV.RANDOM

constant

Source line 1782

std.c.MADV.SEQUENTIAL

constant

Source line 1708

std.c.MADV.SEQUENTIAL

constant

Source line 1722

std.c.MADV.SEQUENTIAL

constant

Source line 1738

expect sequential page references

std.c.MADV.SEQUENTIAL

constant

Source line 1755

std.c.MADV.SEQUENTIAL

constant

Source line 1777

std.c.MADV.SEQUENTIAL

constant

Source line 1783

std.c.MADV.SET_NONVOLATILE

constant

Source line 1774

std.c.MADV.SET_VOLATILE

constant

Source line 1773

std.c.MADV.SETMAP

constant

Source line 1768

std.c.MADV.SPACEAVAIL

constant

Source line 1786

std.c.MADV.WILLNEED

constant

Source line 1709

std.c.MADV.WILLNEED

constant

Source line 1723

std.c.MADV.WILLNEED

constant

Source line 1740

will need these pages

std.c.MADV.WILLNEED

constant

Source line 1759

std.c.MADV.WILLNEED

constant

Source line 1776

std.c.MADV.WILLNEED

constant

Source line 1784

std.c.MADV.ZERO

constant

Source line 1717

std.c.MADV.ZERO_WIRED_PAGES

constant

Source line 1712

std.c.madvise

function

Source line 10857

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

Parameters

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

std.c.major_t

alias

Source line 11637

Alias of std.c.illumos.major_t

std.c.malloc

function

Source line 11212

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

Parameters

malloc: usize

std.c.malloc_size

constant

Source line 11017

std.c.malloc_usable_size

constant

Source line 11021

std.c.MAP

type

Source line 8892

std.c.MAP_FAILED

constant

Source line 9052

Used by libc to communicate failure. Not actually part of the underlying syscall.

*anyopaque

std.c.MATTR

alias

Source line 11760

Alias of std.c.darwin.MATTR

std.c.max_align_t

type

Source line 11475

std.c.maxInt

alias

Source line 9

Alias of std.math.maxInt

std.c.MAXNAMLEN

constant

Source line 7518

std.c.MCL

type

Source line 1791

std.c.memfd_create

function

Source line 10837

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

Parameters

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

std.c.memory_object_offset_t

alias

Source line 11930

Alias of std.c.darwin.memory_object_offset_t

std.c.MFD

type

Source line 10560

std.c.mincore

function

Source line 10851

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

Parameters

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

std.c.minor_t

alias

Source line 11638

Alias of std.c.illumos.minor_t

std.c.MINSIGSTKSZ

constant

Source line 9948

std.c.mkdir

function

Source line 11119

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

Parameters

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

std.c.mkdirat

function

Source line 11120

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

Parameters

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

std.c.mlock

constant

Source line 10883

std.c.MLOCK

type

Source line 1805

std.c.mlock2

constant

Source line 10888

std.c.mlockall

constant

Source line 10898

std.c.mmap

function

Source line 11081

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

Parameters

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

std.c.mmap64

function

Source line 10631

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

Parameters

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

std.c.mmsghdr

type

Source line 4401

std.c.mode_t

type

Source line 160

std.c.modf

function

Source line 11611

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

Parameters

x: f64
iptr: *f64

std.c.modff

function

Source line 11610

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

Parameters

x: f32
iptr: *f32

std.c.modfl

function

Source line 11612

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

Parameters

x: c_longdouble
iptr: *c_longdouble

std.c.mprotect

function

Source line 11084

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

Parameters

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

std.c.mremap

function

Source line 11083

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

Parameters

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

std.c.MREMAP

type

Source line 9046

std.c.MSF

type

Source line 1809

std.c.MSF.ASYNC

constant

Source line 1813

std.c.MSF.ASYNC

constant

Source line 1823

std.c.MSF.ASYNC

constant

Source line 1827

std.c.MSF.ASYNC

constant

Source line 1832

std.c.MSF.ASYNC

constant

Source line 1839

std.c.MSF.DEACTIVATE

constant

Source line 1818

deactivate, leave mapped

std.c.MSF.INVALIDATE

constant

Source line 1814

std.c.MSF.INVALIDATE

constant

Source line 1824

std.c.MSF.INVALIDATE

constant

Source line 1829

std.c.MSF.INVALIDATE

constant

Source line 1833

std.c.MSF.INVALIDATE

constant

Source line 1840

std.c.MSF.KILLPAGES

constant

Source line 1816

invalidate, leave mapped

std.c.MSF.SYNC

constant

Source line 1819

std.c.MSF.SYNC

constant

Source line 1822

std.c.MSF.SYNC

constant

Source line 1828

std.c.MSF.SYNC

constant

Source line 1834

std.c.MSF.SYNC

constant

Source line 1838

std.c.MSG

type

Source line 6010

std.c.MSG.BCAST

constant

Source line 6024

std.c.MSG.BCAST

constant

Source line 6070

std.c.MSG.BCAST

constant

Source line 6088

std.c.MSG.CMSG_CLOEXEC

constant

Source line 6056

std.c.MSG.CMSG_CLOEXEC

constant

Source line 6073

std.c.MSG.CMSG_CLOEXEC

constant

Source line 6091

std.c.MSG.CMSG_CLOEXEC

constant

Source line 6106

std.c.MSG.CMSG_CLOEXEC

constant

Source line 6122

std.c.MSG.CMSG_CLOFORK

constant

Source line 6093

std.c.MSG.CMSG_CLOFORK

constant

Source line 6107

std.c.MSG.CMSG_CLOFORK

constant

Source line 6123

std.c.MSG.COMPAT

constant

Source line 6053

std.c.MSG.CTRUNC

constant

Source line 6021

std.c.MSG.CTRUNC

constant

Source line 6032

std.c.MSG.CTRUNC

constant

Source line 6047

std.c.MSG.CTRUNC

constant

Source line 6067

std.c.MSG.CTRUNC

constant

Source line 6085

std.c.MSG.CTRUNC

constant

Source line 6101

std.c.MSG.CTRUNC

constant

Source line 6116

std.c.MSG.DONTROUTE

constant

Source line 6018

std.c.MSG.DONTROUTE

constant

Source line 6035

std.c.MSG.DONTROUTE

constant

Source line 6044

std.c.MSG.DONTROUTE

constant

Source line 6064

std.c.MSG.DONTROUTE

constant

Source line 6082

std.c.MSG.DONTROUTE

constant

Source line 6098

std.c.MSG.DONTROUTE

constant

Source line 6114

std.c.MSG.DONTWAIT

constant

Source line 6023

std.c.MSG.DONTWAIT

constant

Source line 6037

std.c.MSG.DONTWAIT

constant

Source line 6049

std.c.MSG.DONTWAIT

constant

Source line 6069

std.c.MSG.DONTWAIT

constant

Source line 6087

std.c.MSG.DONTWAIT

constant

Source line 6103

std.c.MSG.DONTWAIT

constant

Source line 6119

std.c.MSG.EOF

constant

Source line 6026

std.c.MSG.EOF

constant

Source line 6050

std.c.MSG.EOR

constant

Source line 6019

std.c.MSG.EOR

constant

Source line 6039

std.c.MSG.EOR

constant

Source line 6045

std.c.MSG.EOR

constant

Source line 6065

std.c.MSG.EOR

constant

Source line 6083

std.c.MSG.EOR

constant

Source line 6099

std.c.MSG.EOR

constant

Source line 6115

std.c.MSG.FBLOCKING

constant

Source line 6108

std.c.MSG.FNONBLOCKING

constant

Source line 6109

std.c.MSG.MCAST

constant

Source line 6025

std.c.MSG.MCAST

constant

Source line 6071

std.c.MSG.MCAST

constant

Source line 6089

std.c.MSG.MORETOCOME

constant

Source line 6058

std.c.MSG.NBIO

constant

Source line 6052

std.c.MSG.NBIO

constant

Source line 6074

std.c.MSG.NOSIGNAL

constant

Source line 6027

std.c.MSG.NOSIGNAL

constant

Source line 6038

std.c.MSG.NOSIGNAL

constant

Source line 6055

std.c.MSG.NOSIGNAL

constant

Source line 6072

std.c.MSG.NOSIGNAL

constant

Source line 6090

std.c.MSG.NOSIGNAL

constant

Source line 6104

std.c.MSG.NOSIGNAL

constant

Source line 6121

std.c.MSG.NOTIFICATION

constant

Source line 6051

std.c.MSG.NOTIFICATION

constant

Source line 6076

std.c.MSG.NOTIFICATION

constant

Source line 6120

std.c.MSG.OOB

constant

Source line 6016

std.c.MSG.OOB

constant

Source line 6034

std.c.MSG.OOB

constant

Source line 6042

std.c.MSG.OOB

constant

Source line 6062

std.c.MSG.OOB

constant

Source line 6080

std.c.MSG.OOB

constant

Source line 6096

std.c.MSG.OOB

constant

Source line 6112

std.c.MSG.PEEK

constant

Source line 6017

std.c.MSG.PEEK

constant

Source line 6033

std.c.MSG.PEEK

constant

Source line 6043

std.c.MSG.PEEK

constant

Source line 6063

std.c.MSG.PEEK

constant

Source line 6081

std.c.MSG.PEEK

constant

Source line 6097

std.c.MSG.PEEK

constant

Source line 6113

std.c.MSG.SOCALLBCK

constant

Source line 6054

std.c.MSG.SYNC

constant

Source line 6105

std.c.MSG.TLSAPPDATA

constant

Source line 6059

std.c.MSG.TRUNC

constant

Source line 6020

std.c.MSG.TRUNC

constant

Source line 6031

std.c.MSG.TRUNC

constant

Source line 6046

std.c.MSG.TRUNC

constant

Source line 6066

std.c.MSG.TRUNC

constant

Source line 6084

std.c.MSG.TRUNC

constant

Source line 6100

std.c.MSG.TRUNC

constant

Source line 6117

std.c.MSG.WAITALL

constant

Source line 6022

std.c.MSG.WAITALL

constant

Source line 6036

std.c.MSG.WAITALL

constant

Source line 6048

std.c.MSG.WAITALL

constant

Source line 6068

std.c.MSG.WAITALL

constant

Source line 6086

std.c.MSG.WAITALL

constant

Source line 6102

std.c.MSG.WAITALL

constant

Source line 6118

std.c.MSG.WAITFORONE

constant

Source line 6057

std.c.MSG.WAITFORONE

constant

Source line 6075

std.c.MSG.WAITFORONE

constant

Source line 6092

std.c.msghdr

type

Source line 4303

std.c.msghdr_const

type

Source line 4366

std.c.msync

constant

Source line 10908

std.c.munlock

constant

Source line 10893

std.c.munlockall

constant

Source line 10903

std.c.munmap

function

Source line 11082

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

Parameters

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

std.c.MuslOnlyPadding

type-function

Source line 4347

There are several instances of struct fields that POSIX defines as either int or socklen_t, but on Linux are size_t. glibc ignores POSIX, and uses the Linux kernel's definitions. musl on the other hand aims to be POSIX-ly correct, and defines those fields in a manner aligning with POSIX.

musl works around this incompatibility between the 64-bit Linux ABI and the POSIX specification by adding padding fields on either side depending on host endianness:

#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

To emulate this quirk of musl, the MuslOnlyPadding field is used in these structs

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

On 32-bit and non-musl systems, these fields will be zero sized, and ignored.

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

Parameters

endian: std.builtin.Endian

std.c.NAME_MAX

constant

Source line 1844

std.c.nanosleep

constant

Source line 10913

std.c.native_abi

constant

Source line 2

std.c.native_arch

constant

Source line 3

std.c.native_endian

constant

Source line 5

std.c.native_os

constant

Source line 4

std.c.natural_t

alias

Source line 11832

Alias of std.c.darwin.natural_t

std.c.NCCS

type

Source line 9177

std.c.netbsd

alias

Source line 20

Alias of std.c.netbsd

std.c.nfds_t

type

Source line 4510

std.c.NI

type

Source line 7618

std.c.nlink_t

type

Source line 170

std.c.NOTE

type

Source line 10278

std.c.NOTE.ABSOLUTE

constant

Source line 10350

absolute timeout

std.c.NOTE.ABSTIME

constant

Source line 10454

timeout is absolute

std.c.NOTE.ABSTIME

constant

Source line 10514

timeout is absolute

std.c.NOTE.ATTRIB

constant

Source line 10305

attributes changed

std.c.NOTE.ATTRIB

constant

Source line 10374

std.c.NOTE.ATTRIB

constant

Source line 10413

attributes changed

std.c.NOTE.ATTRIB

constant

Source line 10481

attributes changed

std.c.NOTE.ATTRIB

constant

Source line 10526

std.c.NOTE.BACKGROUND

constant

Source line 10356

system does maximum timer coalescing

std.c.NOTE.CHANGE

constant

Source line 10541

std.c.NOTE.CHILD

constant

Source line 10373

std.c.NOTE.CHILD

constant

Source line 10442

am a child process

std.c.NOTE.CHILD

constant

Source line 10539

std.c.NOTE.CLOSE

constant

Source line 10423

file closed (no FWRITE)

std.c.NOTE.CLOSE

constant

Source line 10491

file closed, fd did not allow write

std.c.NOTE.CLOSE_WRITE

constant

Source line 10425

file closed (FWRITE)

std.c.NOTE.CLOSE_WRITE

constant

Source line 10493

file closed, fd did allow write

std.c.NOTE.CRITICAL

constant

Source line 10354

system does minimal timer coalescing

std.c.NOTE.DELETE

constant

Source line 10299

vnode was removed

std.c.NOTE.DELETE

constant

Source line 10367

std.c.NOTE.DELETE

constant

Source line 10407

vnode was removed

std.c.NOTE.DELETE

constant

Source line 10475

vnode was removed

std.c.NOTE.DELETE

constant

Source line 10523

std.c.NOTE.EOF

constant

Source line 10519

std.c.NOTE.EXEC

constant

Source line 10321

process exec'd

std.c.NOTE.EXEC

constant

Source line 10381

std.c.NOTE.EXEC

constant

Source line 10433

process exec'd

std.c.NOTE.EXEC

constant

Source line 10501

process exec'd

std.c.NOTE.EXEC

constant

Source line 10534

std.c.NOTE.EXIT

constant

Source line 10317

process exited

std.c.NOTE.EXIT

constant

Source line 10384

std.c.NOTE.EXIT

constant

Source line 10429

process exited

std.c.NOTE.EXIT

constant

Source line 10497

process exited

std.c.NOTE.EXIT

constant

Source line 10532

std.c.NOTE.EXIT_CSERROR

constant

Source line 10334

std.c.NOTE.EXIT_DECRYPTFAIL

constant

Source line 10332

std.c.NOTE.EXIT_DETAIL

constant

Source line 10327

provide details on reasons for exit

std.c.NOTE.EXIT_DETAIL_MASK

constant

Source line 10331

std.c.NOTE.EXIT_MEMORY

constant

Source line 10333

std.c.NOTE.EXITSTATUS

constant

Source line 10325

exit status to be returned, valid for child process only

std.c.NOTE.EXTEND

constant

Source line 10303

size increased

std.c.NOTE.EXTEND

constant

Source line 10372

std.c.NOTE.EXTEND

constant

Source line 10411

size increased

std.c.NOTE.EXTEND

constant

Source line 10479

size increased

std.c.NOTE.EXTEND

constant

Source line 10525

std.c.NOTE.FFAND

constant

Source line 10286

and fflags

std.c.NOTE.FFAND

constant

Source line 10382

std.c.NOTE.FFAND

constant

Source line 10394

AND fflags

std.c.NOTE.FFAND

constant

Source line 10462

and fflags

std.c.NOTE.FFAND

constant

Source line 10544

std.c.NOTE.FFCOPY

constant

Source line 10290

copy fflags

std.c.NOTE.FFCOPY

constant

Source line 10387

std.c.NOTE.FFCOPY

constant

Source line 10398

copy fflags

std.c.NOTE.FFCOPY

constant

Source line 10466

copy fflags

std.c.NOTE.FFCOPY

constant

Source line 10546

std.c.NOTE.FFCTRLMASK

constant

Source line 10292

mask for operations

std.c.NOTE.FFCTRLMASK

constant

Source line 10386

std.c.NOTE.FFCTRLMASK

constant

Source line 10400

masks for operations

std.c.NOTE.FFCTRLMASK

constant

Source line 10468

mask for operations

std.c.NOTE.FFCTRLMASK

constant

Source line 10547

std.c.NOTE.FFLAGSMASK

constant

Source line 10293

std.c.NOTE.FFLAGSMASK

constant

Source line 10379

std.c.NOTE.FFLAGSMASK

constant

Source line 10401

std.c.NOTE.FFLAGSMASK

constant

Source line 10469

std.c.NOTE.FFLAGSMASK

constant

Source line 10548

std.c.NOTE.FFNOP

constant

Source line 10284

ignore input fflags

std.c.NOTE.FFNOP

constant

Source line 10365

std.c.NOTE.FFNOP

constant

Source line 10392

ignore input fflags

std.c.NOTE.FFNOP

constant

Source line 10460

ignore input fflags

std.c.NOTE.FFNOP

constant

Source line 10543

std.c.NOTE.FFOR

constant

Source line 10288

or fflags

std.c.NOTE.FFOR

constant

Source line 10385

std.c.NOTE.FFOR

constant

Source line 10396

OR fflags

std.c.NOTE.FFOR

constant

Source line 10464

or fflags

std.c.NOTE.FFOR

constant

Source line 10545

std.c.NOTE.FILE_POLL

constant

Source line 10473

behave like poll()

std.c.NOTE.FORK

constant

Source line 10319

process forked

std.c.NOTE.FORK

constant

Source line 10383

std.c.NOTE.FORK

constant

Source line 10431

process forked

std.c.NOTE.FORK

constant

Source line 10499

process forked

std.c.NOTE.FORK

constant

Source line 10533

std.c.NOTE.FUNLOCK

constant

Source line 10315

vnode was unlocked by flock(2)

std.c.NOTE.LEEWAY

constant

Source line 10352

ext[1] holds leeway for power aware timers

std.c.NOTE.LINK

constant

Source line 10307

link count changed

std.c.NOTE.LINK

constant

Source line 10375

std.c.NOTE.LINK

constant

Source line 10415

link count changed

std.c.NOTE.LINK

constant

Source line 10483

link count changed

std.c.NOTE.LINK

constant

Source line 10527

std.c.NOTE.LOWAT

constant

Source line 10295

low water mark

std.c.NOTE.LOWAT

constant

Source line 10368

std.c.NOTE.LOWAT

constant

Source line 10405

low water mark

std.c.NOTE.LOWAT

constant

Source line 10471

low water mark

std.c.NOTE.LOWAT

constant

Source line 10518

std.c.NOTE.MACH_CONTINUOUS_TIME

constant

Source line 10360

with ABSOLUTE: causes the timer to continue to tick across sleep, still uses gettimeofday epoch with MACHTIME and ABSOLUTE: uses mach continuous time epoch without ABSOLUTE: continues to tick across sleep

std.c.NOTE.MACHTIME

constant

Source line 10362

data is mach absolute time units

std.c.NOTE.MSECONDS

constant

Source line 10446

data is milliseconds

std.c.NOTE.MSECONDS

constant

Source line 10508

data is milliseconds

std.c.NOTE.NONE

constant

Source line 10313

No specific vnode event: to test for EVFILT_READ activation

std.c.NOTE.NSECONDS

constant

Source line 10348

data is nanoseconds

std.c.NOTE.NSECONDS

constant

Source line 10452

data is nanoseconds

std.c.NOTE.NSECONDS

constant

Source line 10512

data is nanoseconds

std.c.NOTE.OOB

constant

Source line 10297

OOB data

std.c.NOTE.OOB

constant

Source line 10370

std.c.NOTE.OOB

constant

Source line 10521

std.c.NOTE.OPEN

constant

Source line 10421

vnode was opened

std.c.NOTE.OPEN

constant

Source line 10489

vnode was opened

std.c.NOTE.PCTRLMASK

constant

Source line 10330

std.c.NOTE.PCTRLMASK

constant

Source line 10388

std.c.NOTE.PCTRLMASK

constant

Source line 10436

std.c.NOTE.PCTRLMASK

constant

Source line 10504

std.c.NOTE.PCTRLMASK

constant

Source line 10536

std.c.NOTE.PDATAMASK

constant

Source line 10329

mask for signal & exit status

std.c.NOTE.PDATAMASK

constant

Source line 10378

std.c.NOTE.PDATAMASK

constant

Source line 10435

mask for signal & exit status

std.c.NOTE.PDATAMASK

constant

Source line 10503

mask for signal & exit status

std.c.NOTE.PDATAMASK

constant

Source line 10535

std.c.NOTE.READ

constant

Source line 10427

file was read

std.c.NOTE.READ

constant

Source line 10495

file was read

std.c.NOTE.RENAME

constant

Source line 10309

vnode was renamed

std.c.NOTE.RENAME

constant

Source line 10376

std.c.NOTE.RENAME

constant

Source line 10417

vnode was renamed

std.c.NOTE.RENAME

constant

Source line 10485

vnode was renamed

std.c.NOTE.RENAME

constant

Source line 10528

std.c.NOTE.REVOKE

constant

Source line 10311

vnode access was revoked

std.c.NOTE.REVOKE

constant

Source line 10377

std.c.NOTE.REVOKE

constant

Source line 10419

vnode access was revoked

std.c.NOTE.REVOKE

constant

Source line 10487

vnode access was revoked

std.c.NOTE.REVOKE

constant

Source line 10529

std.c.NOTE.SECONDS

constant

Source line 10344

data is seconds

std.c.NOTE.SECONDS

constant

Source line 10448

data is seconds

std.c.NOTE.SECONDS

constant

Source line 10506

data is seconds

std.c.NOTE.SIGNAL

constant

Source line 10323

shared with EVFILT_SIGNAL

std.c.NOTE.SIGNAL

constant

Source line 10444

shared with EVFILT_SIGNAL

std.c.NOTE.TRACK

constant

Source line 10366

std.c.NOTE.TRACK

constant

Source line 10438

follow across forks

std.c.NOTE.TRACK

constant

Source line 10537

std.c.NOTE.TRACKERR

constant

Source line 10369

std.c.NOTE.TRACKERR

constant

Source line 10440

could not track child

std.c.NOTE.TRACKERR

constant

Source line 10538

std.c.NOTE.TRIGGER

constant

Source line 10282

On input, TRIGGER causes the event to be triggered for output.

std.c.NOTE.TRIGGER

constant

Source line 10380

std.c.NOTE.TRIGGER

constant

Source line 10403

On input, TRIGGER causes the event to be triggered for output.

std.c.NOTE.TRIGGER

constant

Source line 10458

On input, TRIGGER causes the event to be triggered for output.

std.c.NOTE.TRIGGER

constant

Source line 10549

std.c.NOTE.TRUNCATE

constant

Source line 10530

std.c.NOTE.USECONDS

constant

Source line 10346

data is microseconds

std.c.NOTE.USECONDS

constant

Source line 10450

data is microseconds

std.c.NOTE.USECONDS

constant

Source line 10510

data is microseconds

std.c.NOTE.VM_ERROR

constant

Source line 10342

there was an error

std.c.NOTE.VM_PRESSURE

constant

Source line 10336

will react on memory pressure

std.c.NOTE.VM_PRESSURE_SUDDEN_TERMINATE

constant

Source line 10340

will quit immediately on memory pressure

std.c.NOTE.VM_PRESSURE_TERMINATE

constant

Source line 10338

will quit on memory pressure, possibly after cleaning up dirty state

std.c.NOTE.WRITE

constant

Source line 10301

data contents changed

std.c.NOTE.WRITE

constant

Source line 10371

std.c.NOTE.WRITE

constant

Source line 10409

data contents changed

std.c.NOTE.WRITE

constant

Source line 10477

data contents changed

std.c.NOTE.WRITE

constant

Source line 10524

std.c.nrand48

function

Source line 11569

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

Parameters

xsubi: *[3]c_ushort

std.c.NSIG

constant

Source line 9935

maximum signal number + 1

std.c.NSVersionOfRunTimeLibrary

alias

Source line 11761

Alias of std.c.darwin.NSVersionOfRunTimeLibrary

std.c.O

type

Source line 8649

std.c.off_t

type

Source line 90

std.c.on_exit_thread

alias

Source line 11663

Alias of std.c.haiku.on_exit_thread

std.c.open

function

Source line 11069

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

Parameters

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

std.c.OPEN_MAX

alias

Source line 11762

Alias of std.c.darwin.OPEN_MAX

std.c.open64

function

Source line 10632

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

Parameters

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

std.c.openat

function

Source line 11070

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

Parameters

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

std.c.openat64

function

Source line 10633

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

Parameters

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

std.c.openbsd

alias

Source line 23

Alias of std.c.openbsd

std.c.opendir

function

Source line 10568

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

Parameters

pathname: [*:0]const u8

std.c.openlog

function

Source line 11443

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

Parameters

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

std.c.OS

alias

Source line 11763

Alias of std.c.darwin.OS

std.c.os_log_create

alias

Source line 11833

Alias of std.c.darwin.os_log_create

std.c.os_log_t

alias

Source line 11834

Alias of std.c.darwin.os_log_t

std.c.os_log_type_enabled

alias

Source line 11835

Alias of std.c.darwin.os_log_type_enabled

std.c.os_log_type_t

alias

Source line 11836

Alias of std.c.darwin.os_log_type_t

std.c.os_signpost_enabled

alias

Source line 11837

Alias of std.c.darwin.os_signpost_enabled

std.c.os_signpost_id_generate

alias

Source line 11838

Alias of std.c.darwin.os_signpost_id_generate

std.c.os_signpost_id_make_with_pointer

alias

Source line 11839

Alias of std.c.darwin.os_signpost_id_make_with_pointer

std.c.os_signpost_id_t

alias

Source line 11840

Alias of std.c.darwin.os_signpost_id_t

std.c.os_signpost_interval_begin

alias

Source line 11841

Alias of std.c.darwin.os_signpost_interval_begin

std.c.os_signpost_interval_end

alias

Source line 11842

Alias of std.c.darwin.os_signpost_interval_end

std.c.os_unfair_lock

alias

Source line 11843

Alias of std.c.darwin.os_unfair_lock

std.c.os_unfair_lock_assert_not_owner

alias

Source line 11844

Alias of std.c.darwin.os_unfair_lock_assert_not_owner

std.c.os_unfair_lock_assert_owner

alias

Source line 11845

Alias of std.c.darwin.os_unfair_lock_assert_owner

std.c.os_unfair_lock_lock

alias

Source line 11846

Alias of std.c.darwin.os_unfair_lock_lock

std.c.os_unfair_lock_t

alias

Source line 11847

Alias of std.c.darwin.os_unfair_lock_t

std.c.os_unfair_lock_trylock

alias

Source line 11848

Alias of std.c.darwin.os_unfair_lock_trylock

std.c.os_unfair_lock_unlock

alias

Source line 11849

Alias of std.c.darwin.os_unfair_lock_unlock

std.c.padded_pthread_spin_t

type

Source line 8378

std.c.page_size

alias

Source line 11

Alias of std.heap.page_size_min

std.c.passwd

type

Source line 205

std.c.PATH_MAX

constant

Source line 1854

std.c.perf_event

alias

Source line 11967

Alias of std.c.serenity.perf_event

std.c.PERF_EVENT

alias

Source line 11961

Alias of std.c.serenity.PERF_EVENT

std.c.perf_event_attr

type

Source line 4520

std.c.perf_register_string

alias

Source line 11968

Alias of std.c.serenity.perf_register_string

std.c.PF

type

Source line 5704

std.c.PF.@"802"

constant

Source line 5853

std.c.PF.APPLETALK

constant

Source line 5711

std.c.PF.APPLETALK

constant

Source line 5770

std.c.PF.APPLETALK

constant

Source line 5807

std.c.PF.APPLETALK

constant

Source line 5851

std.c.PF.APPLETALK

constant

Source line 5889

std.c.PF.APPLETALK

constant

Source line 5916

std.c.PF.APPLETALK

constant

Source line 5960

std.c.PF.ARP

constant

Source line 5825

std.c.PF.ARP

constant

Source line 5899

std.c.PF.ATM

constant

Source line 5821

std.c.PF.ATM

constant

Source line 5936

std.c.PF.ATMPVC

constant

Source line 5714

std.c.PF.AX25

constant

Source line 5709

std.c.PF.BLUETOOTH

constant

Source line 5826

std.c.PF.BLUETOOTH

constant

Source line 5900

std.c.PF.BLUETOOTH

constant

Source line 5930

std.c.PF.BLUETOOTH

constant

Source line 5953

std.c.PF.BLUETOOTH

constant

Source line 5967

std.c.PF.BRIDGE

constant

Source line 5713

std.c.PF.CAN

constant

Source line 5903

std.c.PF.CCITT

constant

Source line 5764

std.c.PF.CCITT

constant

Source line 5802

std.c.PF.CCITT

constant

Source line 5845

std.c.PF.CCITT

constant

Source line 5883

std.c.PF.CCITT

constant

Source line 5937

std.c.PF.CHAOS

constant

Source line 5758

std.c.PF.CHAOS

constant

Source line 5796

std.c.PF.CHAOS

constant

Source line 5840

std.c.PF.CHAOS

constant

Source line 5877

std.c.PF.CHAOS

constant

Source line 5913

std.c.PF.CNT

constant

Source line 5775

std.c.PF.CNT

constant

Source line 5812

std.c.PF.CNT

constant

Source line 5893

std.c.PF.CNT

constant

Source line 5919

std.c.PF.COIP

constant

Source line 5774

std.c.PF.COIP

constant

Source line 5811

std.c.PF.COIP

constant

Source line 5892

std.c.PF.COIP

constant

Source line 5925

std.c.PF.DATAKIT

constant

Source line 5763

std.c.PF.DATAKIT

constant

Source line 5801

std.c.PF.DATAKIT

constant

Source line 5844

std.c.PF.DATAKIT

constant

Source line 5882

std.c.PF.DATAKIT

constant

Source line 5914

std.c.PF.DECnet

constant

Source line 5766

std.c.PF.DECnet

constant

Source line 5803

std.c.PF.DECnet

constant

Source line 5847

std.c.PF.DECnet

constant

Source line 5885

std.c.PF.DECnet

constant

Source line 5943

std.c.PF.DECnet

constant

Source line 5962

std.c.PF.DLI

constant

Source line 5767

std.c.PF.DLI

constant

Source line 5804

std.c.PF.DLI

constant

Source line 5848

std.c.PF.DLI

constant

Source line 5886

std.c.PF.DLI

constant

Source line 5935

std.c.PF.E164

constant

Source line 5897

std.c.PF.ECMA

constant

Source line 5762

std.c.PF.ECMA

constant

Source line 5800

std.c.PF.ECMA

constant

Source line 5843

std.c.PF.ECMA

constant

Source line 5881

std.c.PF.ECMA

constant

Source line 5933

std.c.PF.ETHER

constant

Source line 5904

std.c.PF.FILE

alias

Source line 5836

Alias of std.c.PF.UNIX

std.c.PF.GOSIP

constant

Source line 5857

std.c.PF.HYLINK

constant

Source line 5769

std.c.PF.HYLINK

constant

Source line 5806

std.c.PF.HYLINK

constant

Source line 5850

std.c.PF.HYLINK

constant

Source line 5888

std.c.PF.HYLINK

constant

Source line 5921

std.c.PF.IEEE80211

constant

Source line 5827

std.c.PF.IMPLINK

constant

Source line 5756

std.c.PF.IMPLINK

constant

Source line 5794

std.c.PF.IMPLINK

constant

Source line 5838

std.c.PF.IMPLINK

constant

Source line 5875

std.c.PF.IMPLINK

constant

Source line 5909

std.c.PF.INET

constant

Source line 5708

std.c.PF.INET

constant

Source line 5755

std.c.PF.INET

constant

Source line 5793

std.c.PF.INET

constant

Source line 5837

std.c.PF.INET

constant

Source line 5874

std.c.PF.INET

constant

Source line 5915

std.c.PF.INET

constant

Source line 5947

std.c.PF.INET

constant

Source line 5959

std.c.PF.INET

constant

Source line 5975

std.c.PF.INET_SDP

constant

Source line 5828

std.c.PF.INET6

constant

Source line 5782

std.c.PF.INET6

constant

Source line 5819

std.c.PF.INET6

constant

Source line 5861

std.c.PF.INET6

constant

Source line 5894

std.c.PF.INET6

constant

Source line 5908

std.c.PF.INET6

constant

Source line 5950

std.c.PF.INET6

constant

Source line 5961

std.c.PF.INET6

constant

Source line 5976

std.c.PF.INET6_SDP

constant

Source line 5829

std.c.PF.IPX

constant

Source line 5710

std.c.PF.IPX

constant

Source line 5777

std.c.PF.IPX

constant

Source line 5814

std.c.PF.IPX

constant

Source line 5858

std.c.PF.IPX

constant

Source line 5895

std.c.PF.IPX

constant

Source line 5934

std.c.PF.ISDN

constant

Source line 5780

std.c.PF.ISDN

constant

Source line 5817

std.c.PF.ISDN

constant

Source line 5896

std.c.PF.ISDN

constant

Source line 5938

std.c.PF.ISDN

constant

Source line 5968

std.c.PF.ISO

constant

Source line 5760

std.c.PF.ISO

constant

Source line 5798

std.c.PF.ISO

constant

Source line 5879

std.c.PF.ISO

constant

Source line 5911

std.c.PF.KEY

constant

Source line 5781

std.c.PF.KEY

constant

Source line 5818

std.c.PF.KEY

constant

Source line 5862

std.c.PF.KEY

constant

Source line 5923

std.c.PF.KEY

constant

Source line 5963

std.c.PF.LAT

constant

Source line 5768

std.c.PF.LAT

constant

Source line 5805

std.c.PF.LAT

constant

Source line 5849

std.c.PF.LAT

constant

Source line 5887

std.c.PF.LAT

constant

Source line 5940

std.c.PF.LINK

constant

Source line 5772

std.c.PF.LINK

constant

Source line 5809

std.c.PF.LINK

constant

Source line 5860

std.c.PF.LINK

constant

Source line 5891

std.c.PF.LINK

constant

Source line 5920

std.c.PF.LINK

constant

Source line 5949

std.c.PF.LOCAL

constant

Source line 5707

std.c.PF.LOCAL

constant

Source line 5753

std.c.PF.LOCAL

constant

Source line 5791

std.c.PF.LOCAL

alias

Source line 5835

Alias of std.c.PF.UNIX

std.c.PF.LOCAL

constant

Source line 5872

std.c.PF.LOCAL

constant

Source line 5927

std.c.PF.LOCAL

constant

Source line 5951

std.c.PF.LOCAL

constant

Source line 5957

std.c.PF.LOCAL

constant

Source line 5973

std.c.PF.LX_NETLINK

constant

Source line 5867

std.c.PF.MAX

constant

Source line 5787

std.c.PF.MAX

constant

Source line 5830

std.c.PF.MAX

constant

Source line 5868

std.c.PF.MAX

constant

Source line 5905

std.c.PF.MAX

constant

Source line 5922

std.c.PF.MAX

constant

Source line 5969

std.c.PF.MAX

constant

Source line 5978

std.c.PF.MPLS

constant

Source line 5901

std.c.PF.MPLS

constant

Source line 5966

std.c.PF.NATM

constant

Source line 5783

std.c.PF.NATM

constant

Source line 5820

std.c.PF.NATM

constant

Source line 5898

std.c.PF.NATM

constant

Source line 5929

std.c.PF.NBS

constant

Source line 5842

std.c.PF.NCA

constant

Source line 5863

std.c.PF.NETBIOS

constant

Source line 5785

std.c.PF.NETBIOS

constant

Source line 5797

std.c.PF.NETBIOS

constant

Source line 5928

std.c.PF.NETGRAPH

constant

Source line 5822

std.c.PF.NETGRAPH

constant

Source line 5932

std.c.PF.NETROM

constant

Source line 5712

std.c.PF.NIT

constant

Source line 5852

std.c.PF.NS

constant

Source line 5759

std.c.PF.NS

constant

Source line 5841

std.c.PF.NS

constant

Source line 5878

std.c.PF.OROUTE

constant

Source line 5890

std.c.PF.OSI

constant

Source line 5761

std.c.PF.OSI

constant

Source line 5799

std.c.PF.OSI

constant

Source line 5854

std.c.PF.OSI

constant

Source line 5880

std.c.PF.OSI

constant

Source line 5918

std.c.PF.OSINET

constant

Source line 5856

std.c.PF.PACKET

constant

Source line 5866

std.c.PF.PF_ALG

constant

Source line 5743

std.c.PF.PF_ASH

constant

Source line 5725

std.c.PF.PF_ATMSVC

constant

Source line 5727

std.c.PF.PF_BLUETOOTH

constant

Source line 5736

std.c.PF.PF_CAIF

constant

Source line 5742

std.c.PF.PF_CAN

constant

Source line 5734

std.c.PF.PF_DECnet

constant

Source line 5718

std.c.PF.PF_ECONET

constant

Source line 5726

std.c.PF.PF_IEEE802154

constant

Source line 5741

std.c.PF.PF_INET6

constant

Source line 5716

std.c.PF.PF_IRDA

constant

Source line 5730

std.c.PF.PF_ISDN

constant

Source line 5739

std.c.PF.PF_IUCV

constant

Source line 5737

std.c.PF.PF_KCM

constant

Source line 5746

std.c.PF.PF_KEY

constant

Source line 5721

std.c.PF.PF_LLC

constant

Source line 5733

std.c.PF.PF_MAX

constant

Source line 5748

std.c.PF.PF_NETBEUI

constant

Source line 5719

std.c.PF.PF_NETLINK

constant

Source line 5722

std.c.PF.PF_NFC

constant

Source line 5744

std.c.PF.PF_PACKET

constant

Source line 5724

std.c.PF.PF_PHONET

constant

Source line 5740

std.c.PF.PF_PPPOX

constant

Source line 5731

std.c.PF.PF_QIPCRTR

constant

Source line 5747

std.c.PF.PF_RDS

constant

Source line 5728

std.c.PF.PF_ROSE

constant

Source line 5717

std.c.PF.PF_ROUTE

constant

Source line 5723

std.c.PF.PF_RXRPC

constant

Source line 5738

std.c.PF.PF_SECURITY

constant

Source line 5720

std.c.PF.PF_SNA

constant

Source line 5729

std.c.PF.PF_TIPC

constant

Source line 5735

std.c.PF.PF_VSOCK

constant

Source line 5745

std.c.PF.PF_WANPIPE

constant

Source line 5732

std.c.PF.PIP

constant

Source line 5779

std.c.PF.PIP

constant

Source line 5816

std.c.PF.PIP

constant

Source line 5912

std.c.PF.POLICY

constant

Source line 5864

std.c.PF.PPP

constant

Source line 5786

std.c.PF.PUP

constant

Source line 5757

std.c.PF.PUP

constant

Source line 5795

std.c.PF.PUP

constant

Source line 5839

std.c.PF.PUP

constant

Source line 5876

std.c.PF.PUP

constant

Source line 5924

std.c.PF.ROUTE

constant

Source line 5771

std.c.PF.ROUTE

constant

Source line 5808

std.c.PF.ROUTE

constant

Source line 5859

std.c.PF.ROUTE

constant

Source line 5902

std.c.PF.ROUTE

constant

Source line 5910

std.c.PF.ROUTE

constant

Source line 5948

std.c.PF.ROUTE

constant

Source line 5964

std.c.PF.RTIP

constant

Source line 5778

std.c.PF.RTIP

constant

Source line 5815

std.c.PF.RTIP

constant

Source line 5939

std.c.PF.SCLUSTER

constant

Source line 5824

std.c.PF.SIP

constant

Source line 5776

std.c.PF.SIP

constant

Source line 5813

std.c.PF.SIP

constant

Source line 5917

std.c.PF.SLOW

constant

Source line 5823

std.c.PF.SNA

constant

Source line 5765

std.c.PF.SNA

constant

Source line 5846

std.c.PF.SNA

constant

Source line 5884

std.c.PF.SNA

constant

Source line 5926

std.c.PF.SNA

constant

Source line 5965

std.c.PF.SYSTEM

constant

Source line 5784

std.c.PF.TRILL

constant

Source line 5865

std.c.PF.UNIX

constant

Source line 5706

std.c.PF.UNIX

constant

Source line 5754

std.c.PF.UNIX

constant

Source line 5792

std.c.PF.UNIX

constant

Source line 5834

std.c.PF.UNIX

constant

Source line 5873

std.c.PF.UNIX

constant

Source line 5941

std.c.PF.UNIX

constant

Source line 5952

std.c.PF.UNIX

constant

Source line 5958

std.c.PF.UNIX

constant

Source line 5974

std.c.PF.UNSPEC

constant

Source line 5705

std.c.PF.UNSPEC

constant

Source line 5752

std.c.PF.UNSPEC

constant

Source line 5790

std.c.PF.UNSPEC

constant

Source line 5833

std.c.PF.UNSPEC

constant

Source line 5871

std.c.PF.UNSPEC

constant

Source line 5931

std.c.PF.UNSPEC

constant

Source line 5946

std.c.PF.UNSPEC

constant

Source line 5956

std.c.PF.UNSPEC

constant

Source line 5977

std.c.PF.X25

constant

Source line 5715

std.c.PF.X25

constant

Source line 5855

std.c.PF.XTP

constant

Source line 5773

std.c.PF.XTP

constant

Source line 5810

std.c.PF.XTP

constant

Source line 5942

std.c.pid_for_task

alias

Source line 11850

Alias of std.c.darwin.pid_for_task

std.c.pid_t

type

Source line 4524

std.c.pipe

function

Source line 11118

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

Parameters

fds: *[2]fd_t

std.c.pipe2

constant

Source line 10838

std.c.pledge

alias

Source line 11725

Alias of std.c.openbsd.pledge

std.c.policy_t

alias

Source line 11931

Alias of std.c.darwin.policy_t

std.c.poll

function

Source line 11371

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

Parameters

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

std.c.POLL

type

Source line 1863

std.c.POLL.ATTRIB

constant

Source line 1886

std.c.POLL.ERR

constant

Source line 1871

std.c.POLL.ERR

constant

Source line 1890

std.c.POLL.ERR

constant

Source line 1914

some poll error occurred.

std.c.POLL.ERR

constant

Source line 1934

Non-testable events (may not be specified in events).

std.c.POLL.ERR

constant

Source line 1954

Non-testable events (may not be specified in events field).

std.c.POLL.ERR

constant

Source line 1973

errors pending

std.c.POLL.ERR

constant

Source line 1983

std.c.POLL.ERR

constant

Source line 1997

std.c.POLL.ET

constant

Source line 1941

std.c.POLL.EXTEND

constant

Source line 1885

std.c.POLL.HUP

constant

Source line 1872

std.c.POLL.HUP

constant

Source line 1891

std.c.POLL.HUP

constant

Source line 1916

file descriptor was "hung up".

std.c.POLL.HUP

constant

Source line 1935

std.c.POLL.HUP

constant

Source line 1955

std.c.POLL.HUP

constant

Source line 1975

disconnected

std.c.POLL.HUP

constant

Source line 1984

std.c.POLL.HUP

constant

Source line 1998

std.c.POLL.IN

alias

Source line 1869

Alias of std.c.POLL.RDNORM

std.c.POLL.IN

constant

Source line 1877

std.c.POLL.IN

constant

Source line 1898

any readable data available.

std.c.POLL.IN

constant

Source line 1923

std.c.POLL.IN

constant

Source line 1945

Testable events (may be specified in events field).

std.c.POLL.IN

constant

Source line 1960

any readable data available

std.c.POLL.IN

constant

Source line 1980

std.c.POLL.IN

constant

Source line 1994

std.c.POLL.INIGNEOF

constant

Source line 1912

like IN, except ignore EOF.

std.c.POLL.NLINK

constant

Source line 1887

std.c.POLL.NORM

alias

Source line 1987

Alias of std.c.POLL.RDNORM

std.c.POLL.NVAL

constant

Source line 1873

std.c.POLL.NVAL

constant

Source line 1892

std.c.POLL.NVAL

constant

Source line 1918

requested events "invalid".

std.c.POLL.NVAL

constant

Source line 1936

std.c.POLL.NVAL

constant

Source line 1956

std.c.POLL.NVAL

constant

Source line 1977

invalid file descriptor

std.c.POLL.NVAL

constant

Source line 1985

std.c.POLL.NVAL

constant

Source line 1999

std.c.POLL.ONESHOT

constant

Source line 1940

std.c.POLL.OUT

alias

Source line 1870

Alias of std.c.POLL.WRNORM

std.c.POLL.OUT

constant

Source line 1879

std.c.POLL.OUT

constant

Source line 1902

file descriptor is writeable.

std.c.POLL.OUT

constant

Source line 1925

std.c.POLL.OUT

constant

Source line 1947

std.c.POLL.OUT

constant

Source line 1962

file descriptor is writeable

std.c.POLL.OUT

constant

Source line 1982

std.c.POLL.OUT

constant

Source line 1996

std.c.POLL.PRI

constant

Source line 1878

std.c.POLL.PRI

constant

Source line 1900

OOB/Urgent readable data.

std.c.POLL.PRI

constant

Source line 1924

std.c.POLL.PRI

constant

Source line 1946

std.c.POLL.PRI

constant

Source line 1970

high priority readable data

std.c.POLL.PRI

constant

Source line 1981

std.c.POLL.PRI

constant

Source line 1995

std.c.POLL.RDBAND

constant

Source line 1882

std.c.POLL.RDBAND

constant

Source line 1908

OOB/Urgent readable data.

std.c.POLL.RDBAND

constant

Source line 1928

std.c.POLL.RDBAND

constant

Source line 1950

std.c.POLL.RDBAND

constant

Source line 1966

priority readable data

std.c.POLL.RDBAND

constant

Source line 1989

std.c.POLL.RDHUP

constant

Source line 1931

Read-side hangup.

std.c.POLL.RDHUP

constant

Source line 2003

std.c.POLL.RDNORM

constant

Source line 1867

std.c.POLL.RDNORM

constant

Source line 1880

std.c.POLL.RDNORM

constant

Source line 1904

non-OOB/URG data available.

std.c.POLL.RDNORM

constant

Source line 1926

std.c.POLL.RDNORM

constant

Source line 1948

std.c.POLL.RDNORM

alias

Source line 1963

Alias of std.c.POLL.IN

std.c.POLL.RDNORM

constant

Source line 1986

std.c.POLL.RDNORM

alias

Source line 2000

Alias of std.c.POLL.IN

std.c.POLL.REMOVE

constant

Source line 1939

Events to control /dev/poll (not specified in revents)

std.c.POLL.STANDARD

constant

Source line 1894

std.c.POLL.STANDARD

constant

Source line 1920

std.c.POLL.WRBAND

constant

Source line 1883

std.c.POLL.WRBAND

constant

Source line 1910

OOB/Urgent data can be written.

std.c.POLL.WRBAND

constant

Source line 1929

std.c.POLL.WRBAND

constant

Source line 1951

std.c.POLL.WRBAND

constant

Source line 1968

priority data can be written

std.c.POLL.WRBAND

constant

Source line 1990

std.c.POLL.WRBAND

constant

Source line 2002

std.c.POLL.WRITE

constant

Source line 1888

std.c.POLL.WRNORM

constant

Source line 1868

std.c.POLL.WRNORM

alias

Source line 1881

Alias of std.c.POLL.OUT

std.c.POLL.WRNORM

alias

Source line 1906

no write type differentiation.

Alias of std.c.POLL.OUT

std.c.POLL.WRNORM

constant

Source line 1927

std.c.POLL.WRNORM

alias

Source line 1949

Alias of std.c.POLL.OUT

std.c.POLL.WRNORM

alias

Source line 1964

Alias of std.c.POLL.OUT

std.c.POLL.WRNORM

alias

Source line 1988

Alias of std.c.POLL.OUT

std.c.POLL.WRNORM

alias

Source line 2001

Alias of std.c.POLL.OUT

std.c.pollfd

type

Source line 4532

std.c.poolid_t

alias

Source line 11639

Alias of std.c.illumos.poolid_t

std.c.port_alert

function

Source line 11346

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

Parameters

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

std.c.PORT_ALERT

alias

Source line 11625

Alias of std.c.illumos.PORT_ALERT

std.c.port_associate

function

Source line 11322

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

Parameters

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

std.c.port_create

function

Source line 11321

pub extern "c" fn port_create() port_t

std.c.port_dissociate

function

Source line 11329

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

Parameters

port: port_t
source: u32
object: usize

std.c.port_event

type

Source line 8509

std.c.port_get

function

Source line 11338

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

Parameters

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

std.c.port_getn

function

Source line 11339

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

Parameters

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

std.c.port_id

alias

Source line 11664

Alias of std.c.haiku.port_id

std.c.port_notify

alias

Source line 11640

Alias of std.c.illumos.port_notify

std.c.port_send

function

Source line 11330

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

Parameters

port: port_t
events: u32
user_var: ?*anyopaque

std.c.port_sendn

function

Source line 11331

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

Parameters

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

std.c.PORT_SOURCE

alias

Source line 11626

Alias of std.c.illumos.PORT_SOURCE

std.c.port_t

type

Source line 8504

std.c.posix_cmsghdr

container

Source line 4440

Fields

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

std.c.POSIX_FADV

alias

Source line 11627

Alias of std.c.illumos.POSIX_FADV

std.c.posix_memalign

constant

Source line 11025

std.c.posix_msghdr

container

Source line 4352

Fields

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

container

Source line 4387

Fields

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

alias

Source line 11851

Alias of std.c.darwin.posix_spawn

std.c.POSIX_SPAWN

alias

Source line 11764

Alias of std.c.darwin.POSIX_SPAWN

std.c.posix_spawn_file_actions_addchdir_np

alias

Source line 11852

Alias of std.c.darwin.posix_spawn_file_actions_addchdir_np

std.c.posix_spawn_file_actions_addclose

alias

Source line 11853

Alias of std.c.darwin.posix_spawn_file_actions_addclose

std.c.posix_spawn_file_actions_adddup2

alias

Source line 11854

Alias of std.c.darwin.posix_spawn_file_actions_adddup2

std.c.posix_spawn_file_actions_addfchdir_np

alias

Source line 11855

Alias of std.c.darwin.posix_spawn_file_actions_addfchdir_np

std.c.posix_spawn_file_actions_addinherit_np

alias

Source line 11856

Alias of std.c.darwin.posix_spawn_file_actions_addinherit_np

std.c.posix_spawn_file_actions_addopen

alias

Source line 11857

Alias of std.c.darwin.posix_spawn_file_actions_addopen

std.c.posix_spawn_file_actions_destroy

alias

Source line 11858

Alias of std.c.darwin.posix_spawn_file_actions_destroy

std.c.posix_spawn_file_actions_init

alias

Source line 11859

Alias of std.c.darwin.posix_spawn_file_actions_init

std.c.posix_spawn_file_actions_t

alias

Source line 11860

Alias of std.c.darwin.posix_spawn_file_actions_t

std.c.posix_spawnattr_destroy

alias

Source line 11861

Alias of std.c.darwin.posix_spawnattr_destroy

std.c.posix_spawnattr_getflags

alias

Source line 11862

Alias of std.c.darwin.posix_spawnattr_getflags

std.c.posix_spawnattr_getpgroup

alias

Source line 11863

Alias of std.c.darwin.posix_spawnattr_getpgroup

std.c.posix_spawnattr_init

alias

Source line 11864

Alias of std.c.darwin.posix_spawnattr_init

std.c.posix_spawnattr_setflags

alias

Source line 11865

Alias of std.c.darwin.posix_spawnattr_setflags

std.c.posix_spawnattr_setpgroup

alias

Source line 11866

Alias of std.c.darwin.posix_spawnattr_setpgroup

std.c.posix_spawnattr_t

alias

Source line 11867

Alias of std.c.darwin.posix_spawnattr_t

std.c.posix_spawnp

alias

Source line 11868

Alias of std.c.darwin.posix_spawnp

std.c.ppoll

function

Source line 11372

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

Parameters

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

std.c.PR

type

Source line 7331

std.c.prctl

function

Source line 11435

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

Parameters

option: c_int

std.c.pread

function

Source line 11075

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

Parameters

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

std.c.pread64

function

Source line 10634

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

Parameters

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

std.c.preadv

function

Source line 11076

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

Parameters

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

std.c.preadv64

function

Source line 10635

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

Parameters

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

std.c.printf

function

Source line 11062

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

Parameters

format: [*:0]const u8

std.c.priority

alias

Source line 11641

Alias of std.c.illumos.priority

std.c.private

namespace

Source line 11975

External definitions shared by two or more operating systems.

std.c.private.___errno

function

Source line 12087

extern "c" fn ___errno() *c_int

std.c.private.__clock_getres50

function

Source line 12060

netbsd modernized symbols.

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

Parameters

clk_id: clockid_t
tp: *timespec

std.c.private.__clock_gettime50

function

Source line 12061

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

Parameters

clk_id: clockid_t
tp: *timespec

std.c.private.__errno

function

Source line 12088

extern "c" fn __errno() *c_int

std.c.private.__errno_location

function

Source line 12089

extern "c" fn __errno_location() *c_int

std.c.private.__error

function

Source line 12090

extern "c" fn __error() *c_int

std.c.private.__fstat50

function

Source line 12062

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

Parameters

fd: fd_t
buf: *Stat

std.c.private.__getdents30

function

Source line 12074

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

Parameters

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

std.c.private.__getdirentries64

function

Source line 12055

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

Parameters

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

std.c.private.__getrusage50

function

Source line 12063

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

Parameters

who: c_int
usage: *rusage

std.c.private.__gettimeofday50

function

Source line 12064

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

Parameters

tv: ?*timeval
tz: ?*timezone

std.c.private.__libc_current_sigrtmax

function

Source line 12079

extern "c" fn __libc_current_sigrtmax() c_int

std.c.private.__libc_current_sigrtmin

function

Source line 12078

extern "c" fn __libc_current_sigrtmin() c_int

std.c.private.__libc_thr_yield

function

Source line 12065

extern "c" fn __libc_thr_yield() c_int

std.c.private.__msync13

function

Source line 12066

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

Parameters

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

std.c.private.__nanosleep50

function

Source line 12067

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

Parameters

rqtp: *const timespec
rmtp: ?*timespec

std.c.private.__sigaction14

function

Source line 12068

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

Parameters

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

std.c.private.__sigaltstack14

function

Source line 12075

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

Parameters

ss: ?*const stack_t
old_ss: ?*stack_t

std.c.private.__sigemptyset14

function

Source line 12069

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

Parameters

set: ?*sigset_t

std.c.private.__sigfillset14

function

Source line 12070

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

Parameters

set: ?*sigset_t

std.c.private.__signal_get_sigrtmax

function

Source line 12081

extern "c" fn __signal_get_sigrtmax() c_int

std.c.private.__signal_get_sigrtmin

function

Source line 12080

extern "c" fn __signal_get_sigrtmin() c_int

std.c.private.__sigprocmask14

function

Source line 12071

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

Parameters

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

std.c.private.__socket30

function

Source line 12072

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

Parameters

domain: c_uint
sock_type: c_uint
protocol: c_uint

std.c.private.__stat50

function

Source line 12073

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

Parameters

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

std.c.private.__wait450

function

Source line 12076

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

Parameters

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

std.c.private._errno

function

Source line 12091

extern "c" fn _errno() *c_int

std.c.private._msize

function

Source line 12030

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

Parameters

_msize: ?*const anyopaque

std.c.private._strdup

function

Source line 11977

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

Parameters

s: [*:0]const c_char

std.c.private._swab

function

Source line 11982

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

Parameters

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

std.c.private._wcsdup

function

Source line 11979

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

Parameters

s: [*:0]const wchar_t

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

function

Source line 12047

macos modernized symbols. x86_64 links to $INODE64 suffix for 64-bit support. Note these are not necessary on aarch64.

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

Parameters

fd: fd_t
buf: *Stat

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

function

Source line 12048

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

Parameters

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

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

function

Source line 12049

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

Parameters

dir: *DIR

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

function

Source line 12054

macos modernized symbols.

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

Parameters

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

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

function

Source line 12050

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

Parameters

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

std.c.private.arc4random_buf

function

Source line 12028

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

Parameters

buf: [*]u8
len: usize

std.c.private.clock_getres

function

Source line 11985

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

Parameters

clk_id: clockid_t
tp: *timespec

std.c.private.clock_gettime

function

Source line 11986

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

Parameters

clk_id: clockid_t
tp: *timespec

std.c.private.clock_nanosleep

function

Source line 12003

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

Parameters

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

std.c.private.close

function

Source line 11984

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

Parameters

fd: fd_t

std.c.private.copy_file_range

function

Source line 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

Parameters

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

std.c.private.errno

variable

Source line 12093

c_int

std.c.private.errnoFromThreadLocal

function

Source line 12095

fn errnoFromThreadLocal() *c_int

std.c.private.flock

function

Source line 11988

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

Parameters

fd: fd_t
operation: c_int

std.c.private.fork

function

Source line 11989

extern "c" fn fork() c_int

std.c.private.fstat

function

Source line 11990

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

Parameters

fd: fd_t
buf: *Stat

std.c.private.fstatat

function

Source line 11991

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

Parameters

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

std.c.private.getdents

function

Source line 11993

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

Parameters

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

std.c.private.getdirentries

function

Source line 11992

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

Parameters

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

std.c.private.getentropy

function

Source line 12027

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

Parameters

buffer: [*]u8
size: usize

std.c.private.getrandom

function

Source line 12026

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

Parameters

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

std.c.private.getrusage

function

Source line 11998

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

Parameters

who: c_int
usage: *rusage

std.c.private.gettimeofday

function

Source line 11999

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

Parameters

tv: ?*timeval
tz: ?*timezone

std.c.private.ioctl

function

Source line 12000

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

Parameters

fd: fd_t
request: c_int

std.c.private.malloc_size

function

Source line 12031

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

Parameters

malloc_size: ?*const anyopaque

std.c.private.malloc_usable_size

function

Source line 12032

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

Parameters

malloc_usable_size: ?*const anyopaque

std.c.private.mlock

function

Source line 12035

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

Parameters

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

std.c.private.mlock2

function

Source line 12036

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

Parameters

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

std.c.private.mlockall

function

Source line 12038

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

Parameters

flags: MCL

std.c.private.msync

function

Source line 12001

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

Parameters

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

std.c.private.munlock

function

Source line 12037

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

Parameters

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

std.c.private.munlockall

function

Source line 12039

extern "c" fn munlockall() c_int

std.c.private.nanosleep

function

Source line 12002

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

Parameters

rqtp: *const timespec
rmtp: ?*timespec

std.c.private.pipe2

function

Source line 12004

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

Parameters

fds: *[2]fd_t
flags: O

std.c.private.posix_memalign

function

Source line 12033

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

Parameters

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

std.c.private.pthread_setname_np

function

Source line 12024

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

Parameters

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

std.c.private.pthread_threadid_np

function

Source line 12057

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

Parameters

thread: ?pthread_t
thread_id: *u64

std.c.private.ptrace

function

Source line 12042

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

Parameters

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

std.c.private.readdir

function

Source line 12005

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

Parameters

dir: *DIR

std.c.private.realpath

function

Source line 12006

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

Parameters

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

std.c.private.recvmsg

function

Source line 12007

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

Parameters

sockfd: fd_t
msg: *msghdr
flags: u32

std.c.private.sched_yield

function

Source line 12008

extern "c" fn sched_yield() c_int

std.c.private.sendfile

function

Source line 12009

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

Parameters

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

std.c.private.shm_open

function

Source line 12021

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

Parameters

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

std.c.private.sigaction

function

Source line 12010

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

Parameters

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

std.c.private.sigaddset

function

Source line 12012

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

Parameters

set: ?*sigset_t
signo: SIG

std.c.private.sigaltstack

function

Source line 12019

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

Parameters

ss: ?*const stack_t
old_ss: ?*stack_t

std.c.private.sigdelset

function

Source line 12011

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

Parameters

set: ?*sigset_t
signo: SIG

std.c.private.sigemptyset

function

Source line 12014

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

Parameters

set: ?*sigset_t

std.c.private.sigfillset

function

Source line 12013

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

Parameters

set: ?*sigset_t

std.c.private.sigismember

function

Source line 12015

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

Parameters

set: ?*const sigset_t
signo: SIG

std.c.private.sigprocmask

function

Source line 12016

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

Parameters

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

std.c.private.socket

function

Source line 12017

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

Parameters

domain: c_uint
sock_type: c_uint
protocol: c_uint

std.c.private.socketpair

function

Source line 12018

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

Parameters

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

std.c.private.stat

function

Source line 12051

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

Parameters

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

std.c.private.strdup

function

Source line 11976

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

Parameters

s: [*:0]const c_char

std.c.private.swab

function

Source line 11981

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

Parameters

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

std.c.private.sysconf

function

Source line 12020

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

Parameters

sc: c_int

std.c.private.wait4

function

Source line 12022

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

Parameters

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

std.c.private.wcsdup

function

Source line 11978

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

Parameters

s: [*:0]const wchar_t

std.c.prlimit

function

Source line 10850

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

Parameters

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

std.c.procfs

alias

Source line 11642

Alias of std.c.illumos.procfs

std.c.profiling_disable

alias

Source line 11964

Alias of std.c.serenity.profiling_disable

std.c.profiling_enable

alias

Source line 11963

Alias of std.c.serenity.profiling_enable

std.c.profiling_free_buffer

alias

Source line 11965

Alias of std.c.serenity.profiling_free_buffer

std.c.projid_t

alias

Source line 11643

Alias of std.c.illumos.projid_t

std.c.PROT

type

Source line 2009

Basic memory protection flags

std.c.PT

alias

Source line 11750

Alias of std.c.darwin.PT

std.c.pthread_atfork

function

Source line 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

Parameters

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

std.c.pthread_attr_destroy

function

Source line 11250

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

Parameters

std.c.pthread_attr_get_qos_class_np

alias

Source line 11869

Alias of std.c.darwin.pthread_attr_get_qos_class_np

std.c.pthread_attr_init

function

Source line 11246

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

Parameters

std.c.pthread_attr_set_qos_class_np

alias

Source line 11870

Alias of std.c.darwin.pthread_attr_set_qos_class_np

std.c.pthread_attr_setguardsize

function

Source line 11249

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

Parameters

attr: *pthread_attr_t
guardsize: usize

std.c.pthread_attr_setstack

function

Source line 11247

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

Parameters

attr: *pthread_attr_t
stackaddr: *anyopaque
stacksize: usize

std.c.pthread_attr_setstacksize

function

Source line 11248

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

Parameters

attr: *pthread_attr_t
stacksize: usize

std.c.pthread_attr_t

type

Source line 8339

std.c.pthread_cancel

function

Source line 11245

pub extern "c" fn pthread_cancel(pthread_t) E

Parameters

pthread_cancel: pthread_t

std.c.pthread_cancelstate

type

Source line 11229

std.c.pthread_cond_broadcast

function

Source line 11405

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

Parameters

std.c.pthread_cond_destroy

function

Source line 11406

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

Parameters

std.c.PTHREAD_COND_INITIALIZER

constant

Source line 11401

pthread_cond_t

std.c.pthread_cond_signal

function

Source line 11404

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

Parameters

std.c.pthread_cond_t

type

Source line 8229

std.c.pthread_cond_t.data_len

constant

Source line 8236

std.c.pthread_cond_timedwait

function

Source line 11403

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

Parameters

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

std.c.pthread_cond_wait

function

Source line 11402

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

Parameters

std.c.pthread_create

function

Source line 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

Parameters

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

std.c.pthread_detach

function

Source line 11253

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

Parameters

thread: pthread_t

std.c.pthread_exit

function

Source line 11276

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

Parameters

ptr: ?*anyopaque

std.c.pthread_get_name_np

function

Source line 11520

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

Parameters

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

std.c.pthread_get_qos_class_np

alias

Source line 11871

Alias of std.c.darwin.pthread_get_qos_class_np

std.c.pthread_getname_np

function

Source line 11274

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

Parameters

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

std.c.pthread_getspecific

function

Source line 11264

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

Parameters

std.c.pthread_getthreadid_np

function

Source line 11518

pub extern "c" fn pthread_getthreadid_np() c_int

std.c.pthread_join

function

Source line 11252

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

Parameters

thread: pthread_t
arg_return: ?*?*anyopaque

std.c.pthread_key_create

function

Source line 11259

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

Parameters

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

std.c.pthread_key_delete

function

Source line 11263

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

Parameters

std.c.pthread_key_t

type

Source line 8370

std.c.pthread_kill

function

Source line 11275

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

Parameters

pthread_kill: pthread_t
signal: SIG

std.c.pthread_mutex_destroy

function

Source line 11399

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

Parameters

mutex: *pthread_mutex_t

std.c.PTHREAD_MUTEX_INITIALIZER

constant

Source line 11395

pthread_mutex_t

std.c.pthread_mutex_lock

function

Source line 11396

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

Parameters

mutex: *pthread_mutex_t

std.c.pthread_mutex_t

type

Source line 8160

std.c.pthread_mutex_t.data_len

constant

Source line 8164

std.c.pthread_mutex_t.data_len

constant

Source line 8180

std.c.pthread_mutex_trylock

function

Source line 11398

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

Parameters

mutex: *pthread_mutex_t

std.c.pthread_mutex_unlock

function

Source line 11397

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

Parameters

mutex: *pthread_mutex_t

std.c.PTHREAD_PROCESS_PRIVATE

constant

Source line 11382

c_int

std.c.PTHREAD_PROCESS_SHARED

constant

Source line 11387

c_int

std.c.pthread_rwlock_destroy

function

Source line 11408

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

Parameters

std.c.pthread_rwlock_rdlock

function

Source line 11409

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

Parameters

std.c.pthread_rwlock_t

type

Source line 8277

std.c.pthread_rwlock_tryrdlock

function

Source line 11411

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

Parameters

std.c.pthread_rwlock_trywrlock

function

Source line 11412

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

Parameters

std.c.pthread_rwlock_unlock

function

Source line 11413

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

Parameters

std.c.pthread_rwlock_wrlock

function

Source line 11410

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

Parameters

std.c.pthread_self

function

Source line 11251

pub extern "c" fn pthread_self() pthread_t

std.c.pthread_set_name_np

function

Source line 11519

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

Parameters

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

std.c.pthread_set_qos_class_self_np

alias

Source line 11872

Alias of std.c.darwin.pthread_set_qos_class_self_np

std.c.pthread_setcancelstate

function

Source line 11244

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

Parameters

pthread_setcancelstate: pthread_cancelstate
pthread_cancelstate: ?*pthread_cancelstate

std.c.pthread_setname_np

constant

Source line 11267

std.c.pthread_setspecific

function

Source line 11265

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

Parameters

key: pthread_key_t
value: ?*anyopaque

std.c.pthread_sigmask

function

Source line 11266

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

Parameters

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

std.c.pthread_spin_destroy

function

Source line 11393

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

Parameters

std.c.pthread_spin_init

function

Source line 11389

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

Parameters

spin: *pthread_spinlock_t
pshared: c_int

std.c.pthread_spin_lock

function

Source line 11390

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

Parameters

std.c.pthread_spin_t

type

Source line 8387

std.c.pthread_spin_trylock

function

Source line 11392

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

Parameters

std.c.pthread_spin_unlock

function

Source line 11391

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

Parameters

std.c.pthread_spinlock_t

type

Source line 8146

std.c.PTHREAD_STACK_MIN

alias

Source line 11675

Alias of std.c.openbsd.PTHREAD_STACK_MIN

std.c.pthread_t

type

Source line 11415

std.c.pthread_threadid_np

constant

Source line 11278

std.c.ptrace

constant

Source line 11285

std.c.purge

alias

Source line 11966

Alias of std.c.serenity.purge

std.c.pw_dup

alias

Source line 11726

Alias of std.c.openbsd.pw_dup

std.c.pwrite

function

Source line 11080

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

Parameters

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

std.c.pwrite64

function

Source line 10636

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

Parameters

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

std.c.pwritev

function

Source line 11078

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

Parameters

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

std.c.pwritev64

function

Source line 10637

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

Parameters

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

std.c.qos_class_t

alias

Source line 11873

Alias of std.c.darwin.qos_class_t

std.c.R_OK

constant

Source line 1256

Test for read permission.

std.c.raise

function

Source line 11072

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

Parameters

sig: SIG

std.c.read

function

Source line 11073

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

Parameters

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

std.c.readdir

constant

Source line 10918

std.c.readlink

function

Source line 11132

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

Parameters

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

std.c.readlinkat

function

Source line 11133

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

Parameters

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

std.c.readv

function

Source line 11074

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

Parameters

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

std.c.readv_pos

alias

Source line 11665

Alias of std.c.haiku.readv_pos

std.c.realloc

function

Source line 11214

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

Parameters

realloc: ?*anyopaque
anyopaque: usize

std.c.realpath

constant

Source line 10927

std.c.recv

function

Source line 11174

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

Parameters

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

std.c.recvfrom

function

Source line 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

Parameters

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

std.c.recvmsg

constant

Source line 11189

std.c.remque

function

Source line 11572

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

Parameters

element: *anyopaque

std.c.rename

function

Source line 11123

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

Parameters

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

std.c.renameat

function

Source line 11124

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

Parameters

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

std.c.renameatx_np

alias

Source line 11798

Alias of std.c.darwin.renameatx_np

std.c.rewinddir

function

Source line 10570

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

Parameters

dp: *DIR

std.c.rint

function

Source line 11614

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

Parameters

x: f64

std.c.rintf

function

Source line 11613

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

Parameters

x: f32

std.c.rintl

function

Source line 11615

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

Parameters

x: c_longdouble

std.c.RLIM

type

Source line 2023

std.c.rlim_t

type

Source line 4548

std.c.RLIM.INFINITY

constant

Source line 2029

No limit

rlim_t

std.c.RLIM.INFINITY

constant

Source line 2036

No limit

rlim_t

std.c.RLIM.SAVED_CUR

alias

Source line 2032

Alias of std.c.RLIM.INFINITY

std.c.RLIM.SAVED_CUR

constant

Source line 2038

rlim_t

std.c.RLIM.SAVED_MAX

alias

Source line 2031

Alias of std.c.RLIM.INFINITY

std.c.RLIM.SAVED_MAX

constant

Source line 2037

rlim_t

std.c.rlimit

type

Source line 4557

std.c.rlimit_resource

type

Source line 4568

std.c.rlimit_resource.AS

constant

Source line 4583

rlimit_resource

std.c.rlimit_resource.AS

constant

Source line 4603

rlimit_resource

std.c.rlimit_resource.AS

constant

Source line 4615

rlimit_resource

std.c.rlimit_resource.AS

constant

Source line 4632

rlimit_resource

std.c.rlimit_resource.AS

constant

Source line 4649

rlimit_resource

std.c.rmdir

function

Source line 11141

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

Parameters

path: [*:0]const u8

std.c.RTLD

type

Source line 7352

std.c.rusage

type

Source line 4675

std.c.rusage.CHILDREN

constant

Source line 4697

std.c.rusage.CHILDREN

constant

Source line 4718

std.c.rusage.CHILDREN

constant

Source line 4741

std.c.rusage.CHILDREN

constant

Source line 4762

std.c.rusage.CHILDREN

constant

Source line 4784

std.c.rusage.SELF

constant

Source line 4696

std.c.rusage.SELF

constant

Source line 4717

std.c.rusage.SELF

constant

Source line 4740

std.c.rusage.SELF

constant

Source line 4761

std.c.rusage.SELF

constant

Source line 4783

std.c.rusage.THREAD

constant

Source line 4719

std.c.rusage.THREAD

constant

Source line 4763

std.c.S

type

Source line 2042

std.c.S.BLKSIZE

constant

Source line 2363

std.c.S.BLKSIZE

constant

Source line 2484

std.c.S.IEXEC

alias

Source line 2360

Alias of std.c.S.IXUSR

std.c.S.IEXEC

alias

Source line 2533

Alias of std.c.S.IXUSR

std.c.S.IFBLK

constant

Source line 2047

std.c.S.IFBLK

constant

Source line 2090

std.c.S.IFBLK

constant

Source line 2150

std.c.S.IFBLK

constant

Source line 2210

std.c.S.IFBLK

constant

Source line 2277

std.c.S.IFBLK

constant

Source line 2337

std.c.S.IFBLK

constant

Source line 2402

std.c.S.IFBLK

constant

Source line 2463

std.c.S.IFBLK

constant

Source line 2519

std.c.S.IFCHR

constant

Source line 2048

std.c.S.IFCHR

constant

Source line 2088

std.c.S.IFCHR

constant

Source line 2148

std.c.S.IFCHR

constant

Source line 2208

std.c.S.IFCHR

constant

Source line 2275

std.c.S.IFCHR

constant

Source line 2335

std.c.S.IFCHR

constant

Source line 2404

std.c.S.IFCHR

constant

Source line 2461

std.c.S.IFCHR

constant

Source line 2518

std.c.S.IFDIR

constant

Source line 2049

std.c.S.IFDIR

constant

Source line 2089

std.c.S.IFDIR

constant

Source line 2149

std.c.S.IFDIR

constant

Source line 2209

std.c.S.IFDIR

constant

Source line 2276

std.c.S.IFDIR

constant

Source line 2336

std.c.S.IFDIR

constant

Source line 2403

std.c.S.IFDIR

constant

Source line 2462

std.c.S.IFDIR

constant

Source line 2517

std.c.S.IFDOOR

constant

Source line 2215

SunOS 2.6 Door

std.c.S.IFIFO

constant

Source line 2050

std.c.S.IFIFO

constant

Source line 2087

std.c.S.IFIFO

constant

Source line 2147

std.c.S.IFIFO

constant

Source line 2207

std.c.S.IFIFO

constant

Source line 2274

std.c.S.IFIFO

constant

Source line 2334

std.c.S.IFIFO

constant

Source line 2405

std.c.S.IFIFO

constant

Source line 2460

std.c.S.IFIFO

constant

Source line 2521

std.c.S.IFLNK

constant

Source line 2051

std.c.S.IFLNK

constant

Source line 2092

std.c.S.IFLNK

constant

Source line 2152

std.c.S.IFLNK

constant

Source line 2212

std.c.S.IFLNK

constant

Source line 2279

std.c.S.IFLNK

constant

Source line 2339

std.c.S.IFLNK

constant

Source line 2400

std.c.S.IFLNK

constant

Source line 2465

std.c.S.IFLNK

constant

Source line 2522

std.c.S.IFMT

constant

Source line 2052

std.c.S.IFMT

constant

Source line 2085

std.c.S.IFMT

constant

Source line 2145

std.c.S.IFMT

constant

Source line 2205

std.c.S.IFMT

constant

Source line 2272

std.c.S.IFMT

constant

Source line 2332

std.c.S.IFMT

constant

Source line 2398

std.c.S.IFMT

constant

Source line 2458

std.c.S.IFMT

constant

Source line 2516

std.c.S.IFPORT

constant

Source line 2217

Solaris 10 Event Port

std.c.S.IFREG

constant

Source line 2053

std.c.S.IFREG

constant

Source line 2091

std.c.S.IFREG

constant

Source line 2151

std.c.S.IFREG

constant

Source line 2211

std.c.S.IFREG

constant

Source line 2278

std.c.S.IFREG

constant

Source line 2338

std.c.S.IFREG

constant

Source line 2401

std.c.S.IFREG

constant

Source line 2464

std.c.S.IFREG

constant

Source line 2520

std.c.S.IFSOCK

constant

Source line 2054

std.c.S.IFSOCK

constant

Source line 2093

std.c.S.IFSOCK

constant

Source line 2153

std.c.S.IFSOCK

constant

Source line 2213

std.c.S.IFSOCK

constant

Source line 2280

std.c.S.IFSOCK

constant

Source line 2340

std.c.S.IFSOCK

constant

Source line 2399

std.c.S.IFSOCK

constant

Source line 2466

std.c.S.IFSOCK

constant

Source line 2523

std.c.S.IFWHT

constant

Source line 2094

std.c.S.IFWHT

constant

Source line 2154

std.c.S.IFWHT

constant

Source line 2281

std.c.S.IFWHT

constant

Source line 2341

std.c.S.INDEX_DIR

constant

Source line 2406

std.c.S.IREAD

alias

Source line 2359

Alias of std.c.S.IRUSR

std.c.S.IREAD

alias

Source line 2531

Alias of std.c.S.IRUSR

std.c.S.IRGRP

constant

Source line 2104

std.c.S.IRGRP

constant

Source line 2164

std.c.S.IRGRP

constant

Source line 2227

std.c.S.IRGRP

constant

Source line 2291

std.c.S.IRGRP

constant

Source line 2351

std.c.S.IRGRP

constant

Source line 2417

std.c.S.IRGRP

constant

Source line 2476

std.c.S.IRGRP

constant

Source line 2534

std.c.S.IROTH

constant

Source line 2108

std.c.S.IROTH

constant

Source line 2168

std.c.S.IROTH

constant

Source line 2231

std.c.S.IROTH

constant

Source line 2295

std.c.S.IROTH

constant

Source line 2355

std.c.S.IROTH

constant

Source line 2421

std.c.S.IROTH

constant

Source line 2480

std.c.S.IROTH

constant

Source line 2537

std.c.S.IRUSR

constant

Source line 2100

std.c.S.IRUSR

constant

Source line 2160

std.c.S.IRUSR

constant

Source line 2223

std.c.S.IRUSR

constant

Source line 2287

std.c.S.IRUSR

constant

Source line 2347

std.c.S.IRUSR

constant

Source line 2413

std.c.S.IRUSR

constant

Source line 2472

std.c.S.IRUSR

constant

Source line 2528

std.c.S.IRWXG

constant

Source line 2103

std.c.S.IRWXG

constant

Source line 2163

std.c.S.IRWXG

constant

Source line 2226

std.c.S.IRWXG

constant

Source line 2290

std.c.S.IRWXG

constant

Source line 2350

std.c.S.IRWXG

constant

Source line 2416

std.c.S.IRWXG

constant

Source line 2475

std.c.S.IRWXG

constant

Source line 2543

std.c.S.IRWXO

constant

Source line 2107

std.c.S.IRWXO

constant

Source line 2167

std.c.S.IRWXO

constant

Source line 2230

std.c.S.IRWXO

constant

Source line 2294

std.c.S.IRWXO

constant

Source line 2354

std.c.S.IRWXO

constant

Source line 2420

std.c.S.IRWXO

constant

Source line 2479

std.c.S.IRWXO

constant

Source line 2544

std.c.S.IRWXU

constant

Source line 2099

std.c.S.IRWXU

constant

Source line 2159

std.c.S.IRWXU

constant

Source line 2222

std.c.S.IRWXU

constant

Source line 2286

std.c.S.IRWXU

constant

Source line 2346

std.c.S.IRWXU

constant

Source line 2412

std.c.S.IRWXU

constant

Source line 2471

std.c.S.IRWXU

constant

Source line 2541

std.c.S.ISBLK

function

Source line 2056

pub fn ISBLK(m: u32) bool

Parameters

m: u32

std.c.S.ISBLK

function

Source line 2124

pub fn ISBLK(m: u32) bool

Parameters

m: u32

std.c.S.ISBLK

function

Source line 2184

pub fn ISBLK(m: u32) bool

Parameters

m: u32

std.c.S.ISBLK

function

Source line 2247

pub fn ISBLK(m: u32) bool

Parameters

m: u32

std.c.S.ISBLK

function

Source line 2311

pub fn ISBLK(m: u32) bool

Parameters

m: u32

std.c.S.ISBLK

function

Source line 2377

pub fn ISBLK(m: u32) bool

Parameters

m: u32

std.c.S.ISBLK

function

Source line 2433

pub fn ISBLK(m: u32) bool

Parameters

m: u32

std.c.S.ISBLK

function

Source line 2498

pub fn ISBLK(m: u32) bool

Parameters

m: u32

std.c.S.ISBLK

function

Source line 2554

pub fn ISBLK(m: u32) bool

Parameters

m: u32

std.c.S.ISCHR

function

Source line 2060

pub fn ISCHR(m: u32) bool

Parameters

m: u32

std.c.S.ISCHR

function

Source line 2116

pub fn ISCHR(m: u32) bool

Parameters

m: u32

std.c.S.ISCHR

function

Source line 2176

pub fn ISCHR(m: u32) bool

Parameters

m: u32

std.c.S.ISCHR

function

Source line 2239

pub fn ISCHR(m: u32) bool

Parameters

m: u32

std.c.S.ISCHR

function

Source line 2303

pub fn ISCHR(m: u32) bool

Parameters

m: u32

std.c.S.ISCHR

function

Source line 2369

pub fn ISCHR(m: u32) bool

Parameters

m: u32

std.c.S.ISCHR

function

Source line 2441

pub fn ISCHR(m: u32) bool

Parameters

m: u32

std.c.S.ISCHR

function

Source line 2490

pub fn ISCHR(m: u32) bool

Parameters

m: u32

std.c.S.ISCHR

function

Source line 2550

pub fn ISCHR(m: u32) bool

Parameters

m: u32

std.c.S.ISDIR

function

Source line 2064

pub fn ISDIR(m: u32) bool

Parameters

m: u32

std.c.S.ISDIR

function

Source line 2120

pub fn ISDIR(m: u32) bool

Parameters

m: u32

std.c.S.ISDIR

function

Source line 2180

pub fn ISDIR(m: u32) bool

Parameters

m: u32

std.c.S.ISDIR

function

Source line 2243

pub fn ISDIR(m: u32) bool

Parameters

m: u32

std.c.S.ISDIR

function

Source line 2307

pub fn ISDIR(m: u32) bool

Parameters

m: u32

std.c.S.ISDIR

function

Source line 2373

pub fn ISDIR(m: u32) bool

Parameters

m: u32

std.c.S.ISDIR

function

Source line 2437

pub fn ISDIR(m: u32) bool

Parameters

m: u32

std.c.S.ISDIR

function

Source line 2494

pub fn ISDIR(m: u32) bool

Parameters

m: u32

std.c.S.ISDIR

function

Source line 2546

pub fn ISDIR(m: u32) bool

Parameters

m: u32

std.c.S.ISDOOR

function

Source line 2263

pub fn ISDOOR(m: u32) bool

Parameters

m: u32

std.c.S.ISFIFO

function

Source line 2068

pub fn ISFIFO(m: u32) bool

Parameters

m: u32

std.c.S.ISFIFO

function

Source line 2112

pub fn ISFIFO(m: u32) bool

Parameters

m: u32

std.c.S.ISFIFO

function

Source line 2172

pub fn ISFIFO(m: u32) bool

Parameters

m: u32

std.c.S.ISFIFO

function

Source line 2235

pub fn ISFIFO(m: u32) bool

Parameters

m: u32

std.c.S.ISFIFO

function

Source line 2299

pub fn ISFIFO(m: u32) bool

Parameters

m: u32

std.c.S.ISFIFO

function

Source line 2365

pub fn ISFIFO(m: u32) bool

Parameters

m: u32

std.c.S.ISFIFO

function

Source line 2445

pub fn ISFIFO(m: u32) bool

Parameters

m: u32

std.c.S.ISFIFO

function

Source line 2486

pub fn ISFIFO(m: u32) bool

Parameters

m: u32

std.c.S.ISFIFO

function

Source line 2562

pub fn ISFIFO(m: u32) bool

Parameters

m: u32

std.c.S.ISGID

constant

Source line 2097

std.c.S.ISGID

constant

Source line 2157

std.c.S.ISGID

constant

Source line 2220

std.c.S.ISGID

constant

Source line 2284

std.c.S.ISGID

constant

Source line 2344

std.c.S.ISGID

constant

Source line 2410

std.c.S.ISGID

constant

Source line 2469

std.c.S.ISGID

constant

Source line 2526

std.c.S.ISINDEX

function

Source line 2453

pub fn ISINDEX(m: u32) bool

Parameters

m: u32

std.c.S.ISLNK

function

Source line 2072

pub fn ISLNK(m: u32) bool

Parameters

m: u32

std.c.S.ISLNK

function

Source line 2132

pub fn ISLNK(m: u32) bool

Parameters

m: u32

std.c.S.ISLNK

function

Source line 2192

pub fn ISLNK(m: u32) bool

Parameters

m: u32

std.c.S.ISLNK

function

Source line 2255

pub fn ISLNK(m: u32) bool

Parameters

m: u32

std.c.S.ISLNK

function

Source line 2319

pub fn ISLNK(m: u32) bool

Parameters

m: u32

std.c.S.ISLNK

function

Source line 2385

pub fn ISLNK(m: u32) bool

Parameters

m: u32

std.c.S.ISLNK

function

Source line 2429

pub fn ISLNK(m: u32) bool

Parameters

m: u32

std.c.S.ISLNK

function

Source line 2506

pub fn ISLNK(m: u32) bool

Parameters

m: u32

std.c.S.ISLNK

function

Source line 2566

pub fn ISLNK(m: u32) bool

Parameters

m: u32

std.c.S.ISPORT

function

Source line 2267

pub fn ISPORT(m: u32) bool

Parameters

m: u32

std.c.S.ISREG

function

Source line 2076

pub fn ISREG(m: u32) bool

Parameters

m: u32

std.c.S.ISREG

function

Source line 2128

pub fn ISREG(m: u32) bool

Parameters

m: u32

std.c.S.ISREG

function

Source line 2188

pub fn ISREG(m: u32) bool

Parameters

m: u32

std.c.S.ISREG

function

Source line 2251

pub fn ISREG(m: u32) bool

Parameters

m: u32

std.c.S.ISREG

function

Source line 2315

pub fn ISREG(m: u32) bool

Parameters

m: u32

std.c.S.ISREG

function

Source line 2381

pub fn ISREG(m: u32) bool

Parameters

m: u32

std.c.S.ISREG

function

Source line 2425

pub fn ISREG(m: u32) bool

Parameters

m: u32

std.c.S.ISREG

function

Source line 2502

pub fn ISREG(m: u32) bool

Parameters

m: u32

std.c.S.ISREG

function

Source line 2558

pub fn ISREG(m: u32) bool

Parameters

m: u32

std.c.S.ISSOCK

function

Source line 2080

pub fn ISSOCK(m: u32) bool

Parameters

m: u32

std.c.S.ISSOCK

function

Source line 2136

pub fn ISSOCK(m: u32) bool

Parameters

m: u32

std.c.S.ISSOCK

function

Source line 2196

pub fn ISSOCK(m: u32) bool

Parameters

m: u32

std.c.S.ISSOCK

function

Source line 2259

pub fn ISSOCK(m: u32) bool

Parameters

m: u32

std.c.S.ISSOCK

function

Source line 2323

pub fn ISSOCK(m: u32) bool

Parameters

m: u32

std.c.S.ISSOCK

function

Source line 2389

pub fn ISSOCK(m: u32) bool

Parameters

m: u32

std.c.S.ISSOCK

function

Source line 2449

pub fn ISSOCK(m: u32) bool

Parameters

m: u32

std.c.S.ISSOCK

function

Source line 2510

pub fn ISSOCK(m: u32) bool

Parameters

m: u32

std.c.S.ISSOCK

function

Source line 2570

pub fn ISSOCK(m: u32) bool

Parameters

m: u32

std.c.S.ISTXT

constant

Source line 2362

std.c.S.ISUID

constant

Source line 2096

std.c.S.ISUID

constant

Source line 2156

std.c.S.ISUID

constant

Source line 2219

std.c.S.ISUID

constant

Source line 2283

std.c.S.ISUID

constant

Source line 2343

std.c.S.ISUID

constant

Source line 2409

std.c.S.ISUID

constant

Source line 2468

std.c.S.ISUID

constant

Source line 2525

std.c.S.ISVTX

constant

Source line 2098

std.c.S.ISVTX

constant

Source line 2158

std.c.S.ISVTX

constant

Source line 2221

std.c.S.ISVTX

constant

Source line 2285

std.c.S.ISVTX

constant

Source line 2345

std.c.S.ISVTX

constant

Source line 2411

std.c.S.ISVTX

constant

Source line 2470

std.c.S.ISVTX

constant

Source line 2527

std.c.S.IUMSK

constant

Source line 2408

std.c.S.IWGRP

constant

Source line 2105

std.c.S.IWGRP

constant

Source line 2165

std.c.S.IWGRP

constant

Source line 2228

std.c.S.IWGRP

constant

Source line 2292

std.c.S.IWGRP

constant

Source line 2352

std.c.S.IWGRP

constant

Source line 2418

std.c.S.IWGRP

constant

Source line 2477

std.c.S.IWGRP

constant

Source line 2535

std.c.S.IWHT

function

Source line 2140

pub fn IWHT(m: u32) bool

Parameters

m: u32

std.c.S.IWHT

function

Source line 2200

pub fn IWHT(m: u32) bool

Parameters

m: u32

std.c.S.IWHT

function

Source line 2327

pub fn IWHT(m: u32) bool

Parameters

m: u32

std.c.S.IWHT

function

Source line 2393

pub fn IWHT(m: u32) bool

Parameters

m: u32

std.c.S.IWOTH

constant

Source line 2109

std.c.S.IWOTH

constant

Source line 2169

std.c.S.IWOTH

constant

Source line 2232

std.c.S.IWOTH

constant

Source line 2296

std.c.S.IWOTH

constant

Source line 2356

std.c.S.IWOTH

constant

Source line 2422

std.c.S.IWOTH

constant

Source line 2481

std.c.S.IWOTH

constant

Source line 2538

std.c.S.IWRITE

alias

Source line 2361

Alias of std.c.S.IWUSR

std.c.S.IWRITE

alias

Source line 2532

Alias of std.c.S.IWUSR

std.c.S.IWUSR

constant

Source line 2101

std.c.S.IWUSR

constant

Source line 2161

std.c.S.IWUSR

constant

Source line 2224

std.c.S.IWUSR

constant

Source line 2288

std.c.S.IWUSR

constant

Source line 2348

std.c.S.IWUSR

constant

Source line 2414

std.c.S.IWUSR

constant

Source line 2473

std.c.S.IWUSR

constant

Source line 2529

std.c.S.IXGRP

constant

Source line 2106

std.c.S.IXGRP

constant

Source line 2166

std.c.S.IXGRP

constant

Source line 2229

std.c.S.IXGRP

constant

Source line 2293

std.c.S.IXGRP

constant

Source line 2353

std.c.S.IXGRP

constant

Source line 2419

std.c.S.IXGRP

constant

Source line 2478

std.c.S.IXGRP

constant

Source line 2536

std.c.S.IXOTH

constant

Source line 2110

std.c.S.IXOTH

constant

Source line 2170

std.c.S.IXOTH

constant

Source line 2233

std.c.S.IXOTH

constant

Source line 2297

std.c.S.IXOTH

constant

Source line 2357

std.c.S.IXOTH

constant

Source line 2423

std.c.S.IXOTH

constant

Source line 2482

std.c.S.IXOTH

constant

Source line 2539

std.c.S.IXUSR

constant

Source line 2102

std.c.S.IXUSR

constant

Source line 2162

std.c.S.IXUSR

constant

Source line 2225

std.c.S.IXUSR

constant

Source line 2289

std.c.S.IXUSR

constant

Source line 2349

std.c.S.IXUSR

constant

Source line 2415

std.c.S.IXUSR

constant

Source line 2474

std.c.S.IXUSR

constant

Source line 2530

std.c.SA

type

Source line 2576

std.c.sa_family_t

type

Source line 5409

std.c.SA.@"64REGSET"

constant

Source line 2597

signal handler with SIGINFO args with 64bit regs information

std.c.SA.NOCLDSTOP

constant

Source line 2587

do not generate SIG.CHLD on child stop

std.c.SA.NOCLDSTOP

constant

Source line 2603

std.c.SA.NOCLDSTOP

constant

Source line 2620

std.c.SA.NOCLDSTOP

constant

Source line 2634

std.c.SA.NOCLDSTOP

constant

Source line 2649

std.c.SA.NOCLDSTOP

constant

Source line 2656

std.c.SA.NOCLDWAIT

constant

Source line 2591

don't keep zombies around

std.c.SA.NOCLDWAIT

constant

Source line 2605

std.c.SA.NOCLDWAIT

constant

Source line 2614

std.c.SA.NOCLDWAIT

constant

Source line 2622

std.c.SA.NOCLDWAIT

constant

Source line 2630

std.c.SA.NOCLDWAIT

constant

Source line 2635

std.c.SA.NOCLDWAIT

constant

Source line 2651

std.c.SA.NOCLDWAIT

constant

Source line 2657

std.c.SA.NODEFER

constant

Source line 2589

don't mask the signal we're delivering

std.c.SA.NODEFER

constant

Source line 2604

std.c.SA.NODEFER

constant

Source line 2613

std.c.SA.NODEFER

constant

Source line 2621

std.c.SA.NODEFER

constant

Source line 2629

std.c.SA.NODEFER

constant

Source line 2637

std.c.SA.NODEFER

constant

Source line 2650

std.c.SA.NODEFER

constant

Source line 2661

std.c.SA.NOMASK

alias

Source line 2641

Alias of std.c.SA.NODEFER

std.c.SA.NOMASK

alias

Source line 2663

Alias of std.c.SA.NODEFER

std.c.SA.ONESHOT

alias

Source line 2643

Alias of std.c.SA.RESETHAND

std.c.SA.ONESHOT

alias

Source line 2664

Alias of std.c.SA.RESETHAND

std.c.SA.ONSTACK

constant

Source line 2581

take signal on signal stack

std.c.SA.ONSTACK

constant

Source line 2600

std.c.SA.ONSTACK

constant

Source line 2609

std.c.SA.ONSTACK

constant

Source line 2617

std.c.SA.ONSTACK

constant

Source line 2626

std.c.SA.ONSTACK

constant

Source line 2639

std.c.SA.ONSTACK

constant

Source line 2646

std.c.SA.ONSTACK

constant

Source line 2659

std.c.SA.RESETHAND

constant

Source line 2585

reset to SIG.DFL when taking signal

std.c.SA.RESETHAND

constant

Source line 2602

std.c.SA.RESETHAND

constant

Source line 2610

std.c.SA.RESETHAND

constant

Source line 2619

std.c.SA.RESETHAND

constant

Source line 2628

std.c.SA.RESETHAND

constant

Source line 2636

std.c.SA.RESETHAND

constant

Source line 2648

std.c.SA.RESETHAND

constant

Source line 2662

std.c.SA.RESTART

constant

Source line 2583

restart system on signal return

std.c.SA.RESTART

constant

Source line 2601

std.c.SA.RESTART

constant

Source line 2611

std.c.SA.RESTART

constant

Source line 2618

std.c.SA.RESTART

constant

Source line 2627

std.c.SA.RESTART

constant

Source line 2638

std.c.SA.RESTART

constant

Source line 2647

std.c.SA.RESTART

constant

Source line 2660

std.c.SA.SIGINFO

constant

Source line 2593

signal handler with SIGINFO args

std.c.SA.SIGINFO

constant

Source line 2606

std.c.SA.SIGINFO

constant

Source line 2612

std.c.SA.SIGINFO

constant

Source line 2623

std.c.SA.SIGINFO

constant

Source line 2631

std.c.SA.SIGINFO

constant

Source line 2640

std.c.SA.SIGINFO

constant

Source line 2652

std.c.SA.SIGINFO

constant

Source line 2658

std.c.SA.STACK

alias

Source line 2642

Alias of std.c.SA.ONSTACK

std.c.SA.USERTRAMP

constant

Source line 2595

do not bounce off kernel's sigtramp

std.c.SC

type

Source line 2676

std.c.sched_getaffinity

function

Source line 10664

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

Parameters

pid: c_int
size: usize
set: *cpu_set_t

std.c.sched_yield

constant

Source line 10932

std.c.SCM

type

Source line 7156

std.c.SCM.BINTIME

constant

Source line 7178

std.c.SCM.CREDS

constant

Source line 7177

std.c.SCM.CREDS

constant

Source line 7188

std.c.SCM.CREDS

constant

Source line 7194

std.c.SCM.CREDS

constant

Source line 7205

std.c.SCM.CREDS2

constant

Source line 7182

std.c.SCM.MONOTONIC

constant

Source line 7180

std.c.SCM.REALTIME

constant

Source line 7179

std.c.SCM.RIGHTS

constant

Source line 7160

std.c.SCM.RIGHTS

constant

Source line 7166

std.c.SCM.RIGHTS

constant

Source line 7171

std.c.SCM.RIGHTS

constant

Source line 7175

std.c.SCM.RIGHTS

constant

Source line 7186

std.c.SCM.RIGHTS

constant

Source line 7192

std.c.SCM.RIGHTS

constant

Source line 7198

std.c.SCM.RIGHTS

constant

Source line 7203

std.c.SCM.TIME_INFO

constant

Source line 7181

std.c.SCM.TIMESTAMP

constant

Source line 7162

std.c.SCM.TIMESTAMP

constant

Source line 7170

std.c.SCM.TIMESTAMP

constant

Source line 7176

std.c.SCM.TIMESTAMP

constant

Source line 7187

std.c.SCM.TIMESTAMP

constant

Source line 7193

std.c.SCM.TIMESTAMP

constant

Source line 7199

std.c.SCM.TIMESTAMP

constant

Source line 7204

std.c.SCM.TIMESTAMP_MONOTONIC

constant

Source line 7206

std.c.SCM.UCRED

constant

Source line 7161

std.c.SEEK

type

Source line 2736

std.c.SEEK.CUR

constant

Source line 2741

wasi.whence_t

std.c.SEEK.CUR

constant

Source line 2747

std.c.SEEK.CUR

constant

Source line 2752

std.c.SEEK.DATA

constant

Source line 2754

std.c.SEEK.END

constant

Source line 2742

wasi.whence_t

std.c.SEEK.END

constant

Source line 2748

std.c.SEEK.END

constant

Source line 2753

std.c.SEEK.HOLE

constant

Source line 2755

std.c.SEEK.SET

constant

Source line 2740

wasi.whence_t

std.c.SEEK.SET

constant

Source line 2746

std.c.SEEK.SET

constant

Source line 2751

std.c.seekdir

function

Source line 10573

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

Parameters

dp: *DIR
loc: c_long

std.c.sem_close

function

Source line 11298

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

Parameters

sem: *sem_t

std.c.sem_destroy

function

Source line 11296

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

Parameters

sem: *sem_t

std.c.sem_getvalue

function

Source line 11303

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

Parameters

sem: *sem_t
sval: *c_int

std.c.sem_id

alias

Source line 11666

Alias of std.c.haiku.sem_id

std.c.sem_init

function

Source line 11295

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

Parameters

sem: *sem_t
pshared: c_int
value: c_uint

std.c.sem_open

function

Source line 11297

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

Parameters

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

std.c.sem_post

function

Source line 11299

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

Parameters

sem: *sem_t

std.c.sem_t

type

Source line 8401

std.c.sem_timedwait

function

Source line 11302

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

Parameters

sem: *sem_t
abs_timeout: *const timespec

std.c.sem_trywait

function

Source line 11301

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

Parameters

sem: *sem_t

std.c.sem_wait

function

Source line 11300

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

Parameters

sem: *sem_t

std.c.send

function

Source line 11162

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

Parameters

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

std.c.sendfile

constant

Source line 10695

std.c.sendfile64

function

Source line 10638

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

Parameters

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

std.c.sendmmsg

function

Source line 11172

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

Parameters

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

std.c.sendmsg

function

Source line 11171

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

Parameters

sockfd: fd_t
msg: *const msghdr_const
flags: u32

std.c.sendto

function

Source line 11163

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

Parameters

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

std.c.serenity

alias

Source line 24

Alias of std.c.serenity

std.c.setclasscontext

alias

Source line 11727

Alias of std.c.openbsd.setclasscontext

std.c.SETCONTEXT

alias

Source line 11628

Alias of std.c.illumos.SETCONTEXT

std.c.setegid

function

Source line 11199

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

Parameters

egid: gid_t

std.c.seteuid

function

Source line 11198

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

Parameters

euid: uid_t

std.c.setgid

function

Source line 11197

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

Parameters

gid: gid_t

std.c.setgrent

function

Source line 10623

pub extern "c" fn setgrent() void

std.c.setkeymap

alias

Source line 11972

Alias of std.c.serenity.setkeymap

std.c.setlocale

function

Source line 11473

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

Parameters

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

std.c.setlogmask

function

Source line 11445

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

Parameters

maskpri: c_int

std.c.setpassent

alias

Source line 11728

Alias of std.c.openbsd.setpassent

std.c.setpgid

function

Source line 11204

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

Parameters

pid: pid_t
pgid: pid_t

std.c.setpwent

function

Source line 10617

pub extern "c" fn setpwent() void

std.c.setregid

function

Source line 11201

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

Parameters

rgid: gid_t
egid: gid_t

std.c.setresgid

function

Source line 11203

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

Parameters

rgid: gid_t
egid: gid_t
sgid: gid_t

std.c.setresuid

function

Source line 11202

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

Parameters

ruid: uid_t
euid: uid_t
suid: uid_t

std.c.setreuid

function

Source line 11200

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

Parameters

ruid: uid_t
euid: uid_t

std.c.setrlimit

function

Source line 11438

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

Parameters

resource: rlimit_resource
rlim: *const rlimit

std.c.setrlimit64

function

Source line 10639

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

Parameters

resource: rlimit_resource
rlim: *const rlimit

std.c.setsid

function

Source line 11451

pub extern "c" fn setsid() pid_t

std.c.setsockopt

function

Source line 11161

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

Parameters

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

std.c.setuid

function

Source line 11196

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

Parameters

uid: uid_t

std.c.setusercontext

alias

Source line 11729

Alias of std.c.openbsd.setusercontext

std.c.SETUSTACK

alias

Source line 11629

Alias of std.c.illumos.GETUSTACK

std.c.sf_hdtr

type

Source line 11034

std.c.SFD

alias

Source line 11630

Alias of std.c.illumos.SFD

std.c.shm_open

constant

Source line 11305

std.c.shm_unlink

function

Source line 11309

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

Parameters

name: [*:0]const u8

std.c.SHUT

type

Source line 2759

std.c.SHUT.RD

constant

Source line 2764

std.c.SHUT.RDWR

constant

Source line 2766

std.c.SHUT.WR

constant

Source line 2765

std.c.shutdown

function

Source line 11152

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

Parameters

socket: fd_t
how: c_int

std.c.SIG

type

Source line 2771

Signal types

std.c.sig_atomic_t

type

Source line 9928

std.c.SIG.ACK

constant

Source line 2803

acknowledge

std.c.SIG.BIT

function

Source line 2905

pub inline fn BIT(sig: usize) usize

Parameters

sig: usize

std.c.SIG.BIT

function

Source line 2975

pub inline fn BIT(sig: usize) usize

Parameters

sig: usize

std.c.SIG.BIT

function

Source line 3050

pub inline fn BIT(sig: usize) usize

Parameters

sig: usize

std.c.SIG.BLOCK

constant

Source line 2814

block specified signal set

std.c.SIG.BLOCK

constant

Source line 2888

std.c.SIG.BLOCK

constant

Source line 2962

std.c.SIG.BLOCK

constant

Source line 3037

std.c.SIG.BLOCK

constant

Source line 3098

std.c.SIG.BLOCK

constant

Source line 3149

std.c.SIG.BLOCK

constant

Source line 3197

std.c.SIG.BLOCK

constant

Source line 3244

std.c.SIG.CATCH

constant

Source line 3194

?Sigaction.handler_fn

std.c.SIG.CLD

constant

Source line 2984

SIG

std.c.SIG.DFL

constant

Source line 2795

default signal action

std.c.SIG.DFL

constant

Source line 2809

?Sigaction.handler_fn

std.c.SIG.DFL

constant

Source line 2892

?Sigaction.handler_fn

std.c.SIG.DFL

constant

Source line 2954

?Sigaction.handler_fn

std.c.SIG.DFL

constant

Source line 3030

?Sigaction.handler_fn

std.c.SIG.DFL

constant

Source line 3094

?Sigaction.handler_fn

std.c.SIG.DFL

constant

Source line 3143

?Sigaction.handler_fn

std.c.SIG.DFL

constant

Source line 3191

?Sigaction.handler_fn

std.c.SIG.DFL

constant

Source line 3240

?Sigaction.handler_fn

std.c.SIG.ERR

constant

Source line 2805

Signal error value (returned by signal call on error)

std.c.SIG.ERR

constant

Source line 2808

?Sigaction.handler_fn

std.c.SIG.ERR

constant

Source line 2894

?Sigaction.handler_fn

std.c.SIG.ERR

constant

Source line 2955

?Sigaction.handler_fn

std.c.SIG.ERR

constant

Source line 3032

?Sigaction.handler_fn

std.c.SIG.ERR

constant

Source line 3096

?Sigaction.handler_fn

std.c.SIG.ERR

constant

Source line 3145

?Sigaction.handler_fn

std.c.SIG.ERR

constant

Source line 3193

?Sigaction.handler_fn

std.c.SIG.ERR

constant

Source line 3241

?Sigaction.handler_fn

std.c.SIG.GET

constant

Source line 2799

return current value

std.c.SIG.HOLD

constant

Source line 2811

?Sigaction.handler_fn

std.c.SIG.HOLD

constant

Source line 2957

?Sigaction.handler_fn

std.c.SIG.HOLD

constant

Source line 3147

?Sigaction.handler_fn

std.c.SIG.HOLD

constant

Source line 3195

?Sigaction.handler_fn

std.c.SIG.IDX

function

Source line 2899

pub inline fn IDX(sig: usize) usize

Parameters

sig: usize

std.c.SIG.IDX

function

Source line 2969

pub inline fn IDX(sig: usize) usize

Parameters

sig: usize

std.c.SIG.IDX

function

Source line 3044

pub inline fn IDX(sig: usize) usize

Parameters

sig: usize

std.c.SIG.IGN

constant

Source line 2797

ignore signal

std.c.SIG.IGN

constant

Source line 2810

?Sigaction.handler_fn

std.c.SIG.IGN

constant

Source line 2893

?Sigaction.handler_fn

std.c.SIG.IGN

constant

Source line 2956

?Sigaction.handler_fn

std.c.SIG.IGN

constant

Source line 3031

?Sigaction.handler_fn

std.c.SIG.IGN

constant

Source line 3095

?Sigaction.handler_fn

std.c.SIG.IGN

constant

Source line 3144

?Sigaction.handler_fn

std.c.SIG.IGN

constant

Source line 3192

?Sigaction.handler_fn

std.c.SIG.IGN

constant

Source line 3242

?Sigaction.handler_fn

std.c.SIG.IO

constant

Source line 3153

SIG

std.c.SIG.IOT

constant

Source line 2820

SIG

std.c.SIG.IOT

constant

Source line 2912

SIG

std.c.SIG.IOT

constant

Source line 2983

SIG

std.c.SIG.IOT

constant

Source line 3057

SIG

std.c.SIG.IOT

constant

Source line 3104

SIG

std.c.SIG.IOT

constant

Source line 3154

SIG

std.c.SIG.IOT

constant

Source line 3201

SIG

std.c.SIG.LWP

constant

Source line 2913

SIG

std.c.SIG.MAXSIG

constant

Source line 2897

std.c.SIG.MAXSIG

constant

Source line 2960

std.c.SIG.MAXSIG

constant

Source line 3035

std.c.SIG.POLL

constant

Source line 2821

SIG

std.c.SIG.POLL

constant

Source line 2982

SIG

std.c.SIG.RTMAX

constant

Source line 2916

std.c.SIG.RTMAX

constant

Source line 2967

std.c.SIG.RTMAX

constant

Source line 3042

std.c.SIG.RTMIN

constant

Source line 2915

std.c.SIG.RTMIN

constant

Source line 2966

std.c.SIG.RTMIN

constant

Source line 3041

std.c.SIG.SETMASK

constant

Source line 2818

set specified signal set

std.c.SIG.SETMASK

constant

Source line 2890

std.c.SIG.SETMASK

constant

Source line 2964

std.c.SIG.SETMASK

constant

Source line 3039

std.c.SIG.SETMASK

constant

Source line 3100

std.c.SIG.SETMASK

constant

Source line 3151

std.c.SIG.SETMASK

constant

Source line 3199

std.c.SIG.SETMASK

constant

Source line 3246

std.c.SIG.SGE

constant

Source line 2801

signal gets error

std.c.SIG.UNBLOCK

constant

Source line 2816

unblock specified signal set

std.c.SIG.UNBLOCK

constant

Source line 2889

std.c.SIG.UNBLOCK

constant

Source line 2963

std.c.SIG.UNBLOCK

constant

Source line 3038

std.c.SIG.UNBLOCK

constant

Source line 3099

std.c.SIG.UNBLOCK

constant

Source line 3150

std.c.SIG.UNBLOCK

constant

Source line 3198

std.c.SIG.UNBLOCK

constant

Source line 3245

std.c.SIG.VALID

function

Source line 2908

pub inline fn VALID(sig: usize) usize

Parameters

sig: usize

std.c.SIG.VALID

function

Source line 2978

pub inline fn VALID(sig: usize) usize

Parameters

sig: usize

std.c.SIG.VALID

function

Source line 3053

pub inline fn VALID(sig: usize) usize

Parameters

sig: usize

std.c.SIG.WORD

function

Source line 2902

pub inline fn WORD(sig: usize) usize

Parameters

sig: usize

std.c.SIG.WORD

function

Source line 2972

pub inline fn WORD(sig: usize) usize

Parameters

sig: usize

std.c.SIG.WORD

function

Source line 3047

pub inline fn WORD(sig: usize) usize

Parameters

sig: usize

std.c.SIG.WORDS

constant

Source line 2896

std.c.SIG.WORDS

constant

Source line 2959

std.c.SIG.WORDS

constant

Source line 3034

std.c.SIG.WORDS

constant

Source line 3102

std.c.sigaction

constant

Source line 10937

std.c.Sigaction

type

Source line 3331

Renamed from sigaction to Sigaction to avoid conflict with function name.

std.c.Sigaction.handler_fn

type

Source line 3340

std.c.Sigaction.handler_fn

type

Source line 3351

std.c.Sigaction.handler_fn

type

Source line 3364

std.c.Sigaction.handler_fn

type

Source line 3377

std.c.Sigaction.handler_fn

type

Source line 3393

std.c.Sigaction.handler_fn

type

Source line 3404

std.c.Sigaction.handler_fn

type

Source line 3418

std.c.Sigaction.handler_fn

type

Source line 3432

std.c.Sigaction.handler_fn

type

Source line 3451

std.c.Sigaction.handler_fn

type

Source line 3466

std.c.Sigaction.sigaction_fn

type

Source line 3341

std.c.Sigaction.sigaction_fn

type

Source line 3352

std.c.Sigaction.sigaction_fn

type

Source line 3365

std.c.Sigaction.sigaction_fn

type

Source line 3378

std.c.Sigaction.sigaction_fn

type

Source line 3394

std.c.Sigaction.sigaction_fn

type

Source line 3405

std.c.Sigaction.sigaction_fn

type

Source line 3419

std.c.Sigaction.sigaction_fn

type

Source line 3433

std.c.Sigaction.sigaction_fn

type

Source line 3452

std.c.Sigaction.sigaction_fn

type

Source line 3467

std.c.sigaddset

alias

Source line 10981

Alias of std.c.private.sigaddset

std.c.sigaltstack

constant

Source line 10832

std.c.sigdelset

alias

Source line 10986

Alias of std.c.private.sigdelset

std.c.sigemptyset

constant

Source line 10982

std.c.sigfillset

constant

Source line 10976

std.c.siginfo_t

type

Source line 4789

std.c.sigismember

alias

Source line 10987

Alias of std.c.private.sigismember

std.c.signalfd

function

Source line 10848

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

Parameters

fd: fd_t
mask: *const sigset_t
flags: u32

std.c.signalfd_siginfo

alias

Source line 11644

Alias of std.c.illumos.signalfd_siginfo

std.c.sigprocmask

constant

Source line 10989

std.c.sigrt_private

namespace

Source line 10954

std.c.sigrt_private.sigrtmax

function

Source line 10965

pub fn sigrtmax() u8

std.c.sigrt_private.sigrtmin

function

Source line 10955

pub fn sigrtmin() u8

std.c.sigrtmax

constant

Source line 10949

Zig's version of SIGRTMAX. Actually a function.

std.c.sigrtmin

constant

Source line 10943

Zig's version of SIGRTMIN. Actually a function.

std.c.sigset_t

type

Source line 4969

std.c.SIGSTKSZ

constant

Source line 9962

std.c.sigval

type

Source line 4982

std.c.sigval_t

type

Source line 2668

std.c.sigwait

function

Source line 10575

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

Parameters

set: ?*sigset_t
sig: ?*c_int

std.c.SIOCGIFINDEX

type

Source line 3286

std.c.SO

type

Source line 6903

std.c.SO.ACCEPTCONN

constant

Source line 6909

std.c.SO.ACCEPTCONN

constant

Source line 6938

std.c.SO.ACCEPTCONN

constant

Source line 6978

std.c.SO.ACCEPTCONN

constant

Source line 7012

std.c.SO.ACCEPTCONN

constant

Source line 7040

std.c.SO.ACCEPTCONN

constant

Source line 7067

std.c.SO.ACCEPTCONN

constant

Source line 7092

std.c.SO.ACCEPTCONN

constant

Source line 7135

std.c.SO.ACCEPTFILTER

constant

Source line 6918

std.c.SO.ACCEPTFILTER

constant

Source line 6949

std.c.SO.ACCEPTFILTER

constant

Source line 7022

std.c.SO.ACCEPTFILTER

constant

Source line 7051

std.c.SO.ALLZONES

constant

Source line 7005

std.c.SO.ANON_MLP

constant

Source line 6998

std.c.SO.BINDANY

constant

Source line 7102

std.c.SO.BINDTODEVICE

constant

Source line 7087

std.c.SO.BINDTODEVICE

constant

Source line 7130

std.c.SO.BINTIME

constant

Source line 6950

std.c.SO.BROADCAST

constant

Source line 6913

std.c.SO.BROADCAST

constant

Source line 6942

std.c.SO.BROADCAST

constant

Source line 6982

std.c.SO.BROADCAST

constant

Source line 7016

std.c.SO.BROADCAST

constant

Source line 7044

std.c.SO.BROADCAST

constant

Source line 7068

std.c.SO.BROADCAST

constant

Source line 7096

std.c.SO.BROADCAST

constant

Source line 7133

std.c.SO.CPUHINT

constant

Source line 7064

std.c.SO.DEBUG

constant

Source line 6908

std.c.SO.DEBUG

constant

Source line 6937

std.c.SO.DEBUG

constant

Source line 6977

std.c.SO.DEBUG

constant

Source line 7011

std.c.SO.DEBUG

constant

Source line 7039

std.c.SO.DEBUG

constant

Source line 7069

std.c.SO.DEBUG

constant

Source line 7091

std.c.SO.DEBUG

constant

Source line 7128

std.c.SO.DGRAM_ERRIND

constant

Source line 6986

std.c.SO.DOMAIN

constant

Source line 6974

std.c.SO.DOMAIN

constant

Source line 7000

std.c.SO.DOMAIN

constant

Source line 7116

std.c.SO.DONTROUTE

constant

Source line 6912

std.c.SO.DONTROUTE

constant

Source line 6941

std.c.SO.DONTROUTE

constant

Source line 6981

std.c.SO.DONTROUTE

constant

Source line 7015

std.c.SO.DONTROUTE

constant

Source line 7043

std.c.SO.DONTROUTE

constant

Source line 7070

std.c.SO.DONTROUTE

constant

Source line 7095

std.c.SO.DONTROUTE

constant

Source line 7136

std.c.SO.ERROR

constant

Source line 6925

std.c.SO.ERROR

constant

Source line 6961

std.c.SO.ERROR

constant

Source line 6995

std.c.SO.ERROR

constant

Source line 7030

std.c.SO.ERROR

constant

Source line 7061

std.c.SO.ERROR

constant

Source line 7084

std.c.SO.ERROR

constant

Source line 7110

std.c.SO.ERROR

constant

Source line 7124

std.c.SO.EXCLBIND

constant

Source line 7006

std.c.SO.KEEPALIVE

constant

Source line 6911

std.c.SO.KEEPALIVE

constant

Source line 6940

std.c.SO.KEEPALIVE

constant

Source line 6980

std.c.SO.KEEPALIVE

constant

Source line 7014

std.c.SO.KEEPALIVE

constant

Source line 7042

std.c.SO.KEEPALIVE

constant

Source line 7071

std.c.SO.KEEPALIVE

constant

Source line 7094

std.c.SO.KEEPALIVE

constant

Source line 7131

std.c.SO.LABEL

constant

Source line 6963

std.c.SO.LINGER

constant

Source line 6915

std.c.SO.LINGER

constant

Source line 6944

std.c.SO.LINGER

constant

Source line 6984

std.c.SO.LINGER

constant

Source line 7018

std.c.SO.LINGER

constant

Source line 7046

std.c.SO.LINGER

constant

Source line 7076

std.c.SO.LINGER

constant

Source line 7098

std.c.SO.LINGER

constant

Source line 7134

std.c.SO.LINGER_SEC

constant

Source line 6934

std.c.SO.LISTENINCQLEN

constant

Source line 6967

std.c.SO.LISTENQLEN

constant

Source line 6966

std.c.SO.LISTENQLIMIT

constant

Source line 6965

std.c.SO.MAC_EXEMPT

constant

Source line 6999

std.c.SO.MAC_IMPLICIT

constant

Source line 7007

std.c.SO.MAX_PACING_RATE

constant

Source line 6973

std.c.SO.NETPROC

constant

Source line 7112

std.c.SO.NKE

constant

Source line 6929

std.c.SO.NO_DDP

constant

Source line 6952

std.c.SO.NO_OFFLOAD

constant

Source line 6951

std.c.SO.NOADDRERR

constant

Source line 6931

std.c.SO.NOHEADER

constant

Source line 7034

std.c.SO.NONBLOCK

constant

Source line 7086

std.c.SO.NOSIGPIPE

constant

Source line 6930

std.c.SO.NOSIGPIPE

constant

Source line 6948

std.c.SO.NOSIGPIPE

constant

Source line 7021

std.c.SO.NOSIGPIPE

constant

Source line 7050

std.c.SO.NREAD

constant

Source line 6928

std.c.SO.NWRITE

constant

Source line 6932

std.c.SO.OOBINLINE

constant

Source line 6916

std.c.SO.OOBINLINE

constant

Source line 6945

std.c.SO.OOBINLINE

constant

Source line 6985

std.c.SO.OOBINLINE

constant

Source line 7019

std.c.SO.OOBINLINE

constant

Source line 7047

std.c.SO.OOBINLINE

constant

Source line 7072

std.c.SO.OOBINLINE

constant

Source line 7099

std.c.SO.OOBINLINE

constant

Source line 7137

std.c.SO.OVERFLOWED

constant

Source line 7032

std.c.SO.PASSCRED

constant

Source line 7053

std.c.SO.PEERCRED

constant

Source line 7088

std.c.SO.PEERCRED

constant

Source line 7114

std.c.SO.PEERCRED

constant

Source line 7125

std.c.SO.PEERLABEL

constant

Source line 6964

std.c.SO.PROTOCOL

constant

Source line 6970

std.c.SO.PROTOCOL

constant

Source line 7117

std.c.SO.PROTOTYPE

alias

Source line 6971

Alias of std.c.SO.PROTOCOL

std.c.SO.PROTOTYPE

constant

Source line 6997

std.c.SO.RCVBUF

constant

Source line 6920

std.c.SO.RCVBUF

constant

Source line 6956

std.c.SO.RCVBUF

constant

Source line 6990

std.c.SO.RCVBUF

constant

Source line 7027

std.c.SO.RCVBUF

constant

Source line 7056

std.c.SO.RCVBUF

constant

Source line 7081

std.c.SO.RCVBUF

constant

Source line 7105

std.c.SO.RCVBUF

constant

Source line 7126

std.c.SO.RCVLOWAT

constant

Source line 6922

std.c.SO.RCVLOWAT

constant

Source line 6958

std.c.SO.RCVLOWAT

constant

Source line 6992

std.c.SO.RCVLOWAT

constant

Source line 7029

std.c.SO.RCVLOWAT

constant

Source line 7058

std.c.SO.RCVLOWAT

constant

Source line 7082

std.c.SO.RCVLOWAT

constant

Source line 7107

std.c.SO.RCVLOWAT

constant

Source line 7139

std.c.SO.RCVPSH

constant

Source line 7001

std.c.SO.RCVTIMEO

constant

Source line 6924

std.c.SO.RCVTIMEO

constant

Source line 6960

std.c.SO.RCVTIMEO

constant

Source line 6994

std.c.SO.RCVTIMEO

constant

Source line 7036

std.c.SO.RCVTIMEO

constant

Source line 7060

std.c.SO.RCVTIMEO

constant

Source line 7083

std.c.SO.RCVTIMEO

constant

Source line 7109

std.c.SO.RCVTIMEO

constant

Source line 7121

std.c.SO.RECVUCRED

constant

Source line 6987

std.c.SO.RERROR

constant

Source line 7024

std.c.SO.RERROR

constant

Source line 7052

std.c.SO.REUSEADDR

constant

Source line 6910

std.c.SO.REUSEADDR

constant

Source line 6939

std.c.SO.REUSEADDR

constant

Source line 6979

std.c.SO.REUSEADDR

constant

Source line 7013

std.c.SO.REUSEADDR

constant

Source line 7041

std.c.SO.REUSEADDR

constant

Source line 7073

std.c.SO.REUSEADDR

constant

Source line 7093

std.c.SO.REUSEADDR

constant

Source line 7129

std.c.SO.REUSEPORT

constant

Source line 6917

std.c.SO.REUSEPORT

constant

Source line 6946

std.c.SO.REUSEPORT

constant

Source line 7020

std.c.SO.REUSEPORT

constant

Source line 7048

std.c.SO.REUSEPORT

constant

Source line 7074

std.c.SO.REUSEPORT

constant

Source line 7100

std.c.SO.REUSEPORT_LB

constant

Source line 6953

std.c.SO.REUSESHAREUID

constant

Source line 6933

std.c.SO.RTABLE

constant

Source line 7113

std.c.SO.SECATTR

constant

Source line 7003

std.c.SO.SETFIB

constant

Source line 6968

std.c.SO.SNDBUF

constant

Source line 6919

std.c.SO.SNDBUF

constant

Source line 6955

std.c.SO.SNDBUF

constant

Source line 6989

std.c.SO.SNDBUF

constant

Source line 7026

std.c.SO.SNDBUF

constant

Source line 7055

std.c.SO.SNDBUF

constant

Source line 7078

std.c.SO.SNDBUF

constant

Source line 7104

std.c.SO.SNDBUF

constant

Source line 7127

std.c.SO.SNDLOWAT

constant

Source line 6921

std.c.SO.SNDLOWAT

constant

Source line 6957

std.c.SO.SNDLOWAT

constant

Source line 6991

std.c.SO.SNDLOWAT

constant

Source line 7028

std.c.SO.SNDLOWAT

constant

Source line 7057

std.c.SO.SNDLOWAT

constant

Source line 7079

std.c.SO.SNDLOWAT

constant

Source line 7106

std.c.SO.SNDLOWAT

constant

Source line 7138

std.c.SO.SNDSPACE

constant

Source line 7063

std.c.SO.SNDTIMEO

constant

Source line 6923

std.c.SO.SNDTIMEO

constant

Source line 6959

std.c.SO.SNDTIMEO

constant

Source line 6993

std.c.SO.SNDTIMEO

constant

Source line 7035

std.c.SO.SNDTIMEO

constant

Source line 7059

std.c.SO.SNDTIMEO

constant

Source line 7080

std.c.SO.SNDTIMEO

constant

Source line 7108

std.c.SO.SNDTIMEO

constant

Source line 7122

std.c.SO.SPLICE

constant

Source line 7115

std.c.SO.TIMESTAMP

constant

Source line 6947

std.c.SO.TIMESTAMP

constant

Source line 7004

std.c.SO.TIMESTAMP

constant

Source line 7023

std.c.SO.TIMESTAMP

constant

Source line 7049

std.c.SO.TIMESTAMP

constant

Source line 7101

std.c.SO.TIMESTAMP

constant

Source line 7132

std.c.SO.TS_CLOCK

constant

Source line 6972

std.c.SO.TYPE

constant

Source line 6926

std.c.SO.TYPE

constant

Source line 6962

std.c.SO.TYPE

constant

Source line 6996

std.c.SO.TYPE

constant

Source line 7031

std.c.SO.TYPE

constant

Source line 7062

std.c.SO.TYPE

constant

Source line 7085

std.c.SO.TYPE

constant

Source line 7111

std.c.SO.TYPE

constant

Source line 7123

std.c.SO.USELOOPBACK

constant

Source line 6914

std.c.SO.USELOOPBACK

constant

Source line 6943

std.c.SO.USELOOPBACK

constant

Source line 6983

std.c.SO.USELOOPBACK

constant

Source line 7017

std.c.SO.USELOOPBACK

constant

Source line 7045

std.c.SO.USELOOPBACK

constant

Source line 7075

std.c.SO.USELOOPBACK

constant

Source line 7097

std.c.SO.USER_COOKIE

constant

Source line 6969

std.c.SO.VRRP

constant

Source line 7008

std.c.SO.ZEROIZE

constant

Source line 7103

std.c.SOCK

type

Source line 6127

std.c.SOCK.CLOEXEC

constant

Source line 6142

Not actually supported by Darwin, but Zig supplies a shim. This numerical value is not ABI-stable. It need only not conflict with any other SOCK bits.

std.c.SOCK.CLOEXEC

constant

Source line 6155

std.c.SOCK.CLOEXEC

constant

Source line 6172

std.c.SOCK.CLOEXEC

constant

Source line 6183

std.c.SOCK.CLOEXEC

constant

Source line 6195

std.c.SOCK.CLOEXEC

constant

Source line 6206

std.c.SOCK.CLOEXEC

constant

Source line 6215

std.c.SOCK.CLOEXEC

constant

Source line 6227

std.c.SOCK.CONN_DGRAM

constant

Source line 6180

std.c.SOCK.DCCP

alias

Source line 6181

Alias of std.c.SOCK.CONN_DGRAM

std.c.SOCK.DGRAM

constant

Source line 6133

std.c.SOCK.DGRAM

constant

Source line 6150

std.c.SOCK.DGRAM

constant

Source line 6160

Datagram.

std.c.SOCK.DGRAM

constant

Source line 6176

std.c.SOCK.DGRAM

constant

Source line 6190

std.c.SOCK.DGRAM

constant

Source line 6200

std.c.SOCK.DGRAM

constant

Source line 6210

std.c.SOCK.DGRAM

constant

Source line 6221

std.c.SOCK.FLAGS_MASK

constant

Source line 6186

std.c.SOCK.MAXADDRLEN

constant

Source line 6137

std.c.SOCK.MAXADDRLEN

constant

Source line 6194

std.c.SOCK.MISC

constant

Source line 6203

std.c.SOCK.NDELAY

constant

Source line 6171

std.c.SOCK.NONBLOCK

constant

Source line 6146

Not actually supported by Darwin, but Zig supplies a shim. This numerical value is not ABI-stable. It need only not conflict with any other SOCK bits.

std.c.SOCK.NONBLOCK

constant

Source line 6156

std.c.SOCK.NONBLOCK

constant

Source line 6170

std.c.SOCK.NONBLOCK

constant

Source line 6184

std.c.SOCK.NONBLOCK

constant

Source line 6196

std.c.SOCK.NONBLOCK

constant

Source line 6205

std.c.SOCK.NONBLOCK

constant

Source line 6216

std.c.SOCK.NONBLOCK

constant

Source line 6226

std.c.SOCK.NOSIGPIPE

constant

Source line 6185

std.c.SOCK.RAW

constant

Source line 6134

std.c.SOCK.RAW

constant

Source line 6151

std.c.SOCK.RAW

constant

Source line 6164

Raw-protocol interface.

std.c.SOCK.RAW

constant

Source line 6177

std.c.SOCK.RAW

constant

Source line 6191

std.c.SOCK.RAW

constant

Source line 6201

std.c.SOCK.RAW

constant

Source line 6211

std.c.SOCK.RAW

constant

Source line 6222

std.c.SOCK.RDM

constant

Source line 6135

std.c.SOCK.RDM

constant

Source line 6152

std.c.SOCK.RDM

constant

Source line 6166

Reliably-delivered message.

std.c.SOCK.RDM

constant

Source line 6178

std.c.SOCK.RDM

constant

Source line 6192

std.c.SOCK.RDM

constant

Source line 6212

std.c.SOCK.RDM

constant

Source line 6223

std.c.SOCK.SEQPACKET

constant

Source line 6136

std.c.SOCK.SEQPACKET

constant

Source line 6153

std.c.SOCK.SEQPACKET

constant

Source line 6168

Sequenced packed stream.

std.c.SOCK.SEQPACKET

constant

Source line 6179

std.c.SOCK.SEQPACKET

constant

Source line 6193

std.c.SOCK.SEQPACKET

constant

Source line 6202

std.c.SOCK.SEQPACKET

constant

Source line 6213

std.c.SOCK.SEQPACKET

constant

Source line 6224

std.c.SOCK.STREAM

constant

Source line 6132

std.c.SOCK.STREAM

constant

Source line 6149

std.c.SOCK.STREAM

constant

Source line 6162

STREAM.

std.c.SOCK.STREAM

constant

Source line 6175

std.c.SOCK.STREAM

constant

Source line 6189

std.c.SOCK.STREAM

constant

Source line 6199

std.c.SOCK.STREAM

constant

Source line 6209

std.c.SOCK.STREAM

constant

Source line 6220

std.c.sockaddr

type

Source line 5067

std.c.sockaddr.in

container

Source line 5086

Fields

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

container

Source line 5129

Fields

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

container

Source line 5170

Fields

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

container

Source line 5212

Fields

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

container

Source line 5257

Fields

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

container

Source line 5300

Fields

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

container

Source line 5343

Fields

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

container

Source line 5379

Fields

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

std.c.sockaddr.in_addr

type

Source line 5377

std.c.sockaddr.in6

container

Source line 5093

Fields

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

container

Source line 5137

Fields

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

container

Source line 5177

Fields

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

container

Source line 5220

Fields

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

container

Source line 5265

Fields

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

container

Source line 5308

Fields

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

container

Source line 5351

Fields

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

container

Source line 5385

Fields

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

std.c.sockaddr.in6_addr

type

Source line 5378

std.c.sockaddr.SS_MAXSIZE

constant

Source line 5075

std.c.sockaddr.SS_MAXSIZE

constant

Source line 5117

std.c.sockaddr.SS_MAXSIZE

constant

Source line 5159

std.c.sockaddr.SS_MAXSIZE

constant

Source line 5200

std.c.sockaddr.SS_MAXSIZE

constant

Source line 5245

std.c.sockaddr.SS_MAXSIZE

constant

Source line 5288

std.c.sockaddr.SS_MAXSIZE

constant

Source line 5331

std.c.sockaddr.storage

container

Source line 5076

Fields

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

std.c.sockaddr.storage

container

Source line 5118

Fields

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

std.c.sockaddr.storage

container

Source line 5160

Fields

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

std.c.sockaddr.storage

container

Source line 5201

Fields

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

std.c.sockaddr.storage

container

Source line 5246

Fields

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

std.c.sockaddr.storage

container

Source line 5289

Fields

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

std.c.sockaddr.storage

container

Source line 5332

Fields

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

std.c.sockaddr.un

container

Source line 5103

UNIX domain socket

Fields

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

std.c.sockaddr.un

container

Source line 5146

Fields

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

std.c.sockaddr.un

container

Source line 5187

Definitions for UNIX IPC domain.

Fields

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

std.c.sockaddr.un

container

Source line 5230

Definitions for UNIX IPC domain.

Fields

len: u8 = @sizeOf(un)

total sockaddr length

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

path name

std.c.sockaddr.un

container

Source line 5274

Fields

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

std.c.sockaddr.un

container

Source line 5317

Fields

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

std.c.sockaddr.un

container

Source line 5361

Definitions for UNIX IPC domain.

Fields

len: u8 = @sizeOf(un)

total sockaddr length

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

path name

std.c.sockaddr.un

container

Source line 5395

Fields

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

std.c.sockaddr.UNIX_PATH_MAX

constant

Source line 5394

std.c.socket

constant

Source line 10994

std.c.socketpair

constant

Source line 10999

std.c.socklen_t

type

Source line 5402

std.c.SOL

type

Source line 6884

std.c.SOL.FILTER

constant

Source line 6895

std.c.SOL.PACKET

constant

Source line 6894

std.c.SOL.ROUTE

constant

Source line 6893

std.c.SOL.SOCKET

constant

Source line 6889

std.c.SOL.SOCKET

constant

Source line 6892

std.c.SOL.SOCKET

constant

Source line 6899

std.c.SOMAXCONN

type

Source line 7143

std.c.speed_t

type

Source line 9743

std.c.SS

type

Source line 9972

std.c.SS.DISABLE

constant

Source line 9976

std.c.SS.DISABLE

constant

Source line 9981

std.c.SS.ONSTACK

constant

Source line 9975

std.c.SS.ONSTACK

constant

Source line 9980

std.c.stack_t

type

Source line 7221

std.c.stat

constant

Source line 11005

std.c.Stat

type

Source line 7858

std.c.Stat.atime

function

Source line 7878

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

Parameters

self: @This()

std.c.Stat.atime

function

Source line 7939

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

Parameters

self: @This()

std.c.Stat.atime

function

Source line 7972

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

Parameters

self: @This()

std.c.Stat.atime

function

Source line 8003

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

Parameters

self: @This()

std.c.Stat.atime

function

Source line 8039

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

Parameters

self: @This()

std.c.Stat.atime

function

Source line 8068

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

Parameters

self: @This()

std.c.Stat.atime

function

Source line 8099

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

Parameters

self: @This()

std.c.Stat.atime

function

Source line 8131

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

Parameters

self: @This()

std.c.Stat.birthtime

function

Source line 7951

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

Parameters

self: @This()

std.c.Stat.birthtime

function

Source line 8015

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

Parameters

self: @This()

std.c.Stat.birthtime

function

Source line 8077

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

Parameters

self: @This()

std.c.Stat.birthtime

function

Source line 8111

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

Parameters

self: @This()

std.c.Stat.ctime

function

Source line 7886

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

Parameters

self: @This()

std.c.Stat.ctime

function

Source line 7947

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

Parameters

self: @This()

std.c.Stat.ctime

function

Source line 7980

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

Parameters

self: @This()

std.c.Stat.ctime

function

Source line 8011

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

Parameters

self: @This()

std.c.Stat.ctime

function

Source line 8047

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

Parameters

self: @This()

std.c.Stat.ctime

function

Source line 8074

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

Parameters

self: @This()

std.c.Stat.ctime

function

Source line 8107

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

Parameters

self: @This()

std.c.Stat.ctime

function

Source line 8139

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

Parameters

self: @This()

std.c.Stat.fromFilestat

function

Source line 7890

pub fn fromFilestat(st: wasi.filestat_t) Stat

Parameters

std.c.Stat.mtime

function

Source line 7882

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

Parameters

self: @This()

std.c.Stat.mtime

function

Source line 7943

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

Parameters

self: @This()

std.c.Stat.mtime

function

Source line 7976

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

Parameters

self: @This()

std.c.Stat.mtime

function

Source line 8007

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

Parameters

self: @This()

std.c.Stat.mtime

function

Source line 8043

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

Parameters

self: @This()

std.c.Stat.mtime

function

Source line 8071

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

Parameters

self: @This()

std.c.Stat.mtime

function

Source line 8103

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

Parameters

self: @This()

std.c.Stat.mtime

function

Source line 8135

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

Parameters

self: @This()

std.c.status_t

alias

Source line 11667

Alias of std.c.haiku.status_t

std.c.statx

function

Source line 10613

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

Parameters

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

std.c.std

alias

Source line 7

Alias of std

std.c.STDERR_FILENO

constant

Source line 3305

std.c.STDIN_FILENO

constant

Source line 3295

std.c.STDOUT_FILENO

constant

Source line 3300

std.c.strcasecmp

function

Source line 11549

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

Parameters

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

std.c.strdup

constant

Source line 11551

std.c.strncasecmp

function

Source line 11550

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

Parameters

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

std.c.strncmp

function

Source line 11548

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

Parameters

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

std.c.strndup

function

Source line 11556

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

Parameters

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

std.c.strnlen

function

Source line 11555

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

Parameters

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

std.c.strtoimax

function

Source line 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

Parameters

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

std.c.strtol

function

Source line 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

Parameters

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

std.c.strtoll

function

Source line 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

Parameters

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

std.c.strtoul

function

Source line 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

Parameters

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

std.c.strtoull

function

Source line 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

Parameters

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

std.c.strtoumax

function

Source line 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

Parameters

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

std.c.suseconds_t

type

Source line 7254

std.c.swab

constant

Source line 11543

std.c.symlink

function

Source line 11121

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

Parameters

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

std.c.symlinkat

function

Source line 11122

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

Parameters

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

std.c.sync

function

Source line 11430

pub extern "c" fn sync() void

std.c.syncfs

function

Source line 11431

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

Parameters

fd: c_int

std.c.SYS

type

Source line 3311

std.c.sysconf

constant

Source line 11029

std.c.sysctl

function

Source line 11143

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

Parameters

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

std.c.sysctlbyname

function

Source line 11144

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

Parameters

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

std.c.sysctlnametomib

function

Source line 11145

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

Parameters

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

std.c.syslog

function

Source line 11442

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

Parameters

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

std.c.SYSPROTO_CONTROL

alias

Source line 11766

Alias of std.c.darwin.SYSPROTO_CONTROL

std.c.SYSPROTO_EVENT

alias

Source line 11765

Alias of std.c.darwin.SYSPROTO_EVENT

std.c.system_info

alias

Source line 11668

Alias of std.c.haiku.system_info

std.c.T

type

Source line 3478

std.c.T.CFLSH

constant

Source line 3521

std.c.T.CFLSH

constant

Source line 3686

std.c.T.CFLSH

constant

Source line 3859

std.c.T.CGETA

constant

Source line 3515

std.c.T.CGETA

constant

Source line 3680

std.c.T.CGETBITS

constant

Source line 3689

std.c.T.CGETS

constant

Source line 3528

std.c.T.CGETS

constant

Source line 3855

std.c.T.CQUERYCONNECTED

constant

Source line 3688

std.c.T.CSADRAIN

constant

Source line 3532

std.c.T.CSANOW

constant

Source line 3530

std.c.T.CSBRK

constant

Source line 3519

std.c.T.CSBRK

constant

Source line 3685

std.c.T.CSETA

constant

Source line 3516

std.c.T.CSETA

constant

Source line 3681

std.c.T.CSETAF

constant

Source line 3518

std.c.T.CSETAF

constant

Source line 3682

std.c.T.CSETAW

constant

Source line 3517

std.c.T.CSETAW

constant

Source line 3683

std.c.T.CSETDTR

constant

Source line 3690

std.c.T.CSETRTS

constant

Source line 3691

std.c.T.CSETS

constant

Source line 3529

std.c.T.CSETS

constant

Source line 3856

std.c.T.CSETSF

constant

Source line 3533

std.c.T.CSETSF

constant

Source line 3858

std.c.T.CSETSW

constant

Source line 3531

std.c.T.CSETSW

constant

Source line 3857

std.c.T.CVTIME

constant

Source line 3694

std.c.T.CWAITEVENT

constant

Source line 3684

std.c.T.CXONC

constant

Source line 3520

std.c.T.CXONC

constant

Source line 3687

std.c.T.FIONBIO

constant

Source line 3504

std.c.T.FIONBIO

constant

Source line 3707

std.c.T.FIONREAD

constant

Source line 3501

std.c.T.FIONREAD

constant

Source line 3706

std.c.T.IOCCBRK

constant

Source line 3509

std.c.T.IOCCBRK

constant

Source line 3563

clear break bit

std.c.T.IOCCBRK

constant

Source line 3604

std.c.T.IOCCBRK

constant

Source line 3701

std.c.T.IOCCBRK

constant

Source line 3710

std.c.T.IOCCBRK

constant

Source line 3809

std.c.T.IOCCDTR

constant

Source line 3567

clear data terminal ready

std.c.T.IOCCDTR

constant

Source line 3605

std.c.T.IOCCDTR

constant

Source line 3711

std.c.T.IOCCDTR

constant

Source line 3811

std.c.T.IOCCONS

constant

Source line 3502

std.c.T.IOCCONS

constant

Source line 3606

std.c.T.IOCCONS

constant

Source line 3712

std.c.T.IOCCONS

constant

Source line 3838

std.c.T.IOCDCDTIMESTAMP

constant

Source line 3607

std.c.T.IOCDCDTIMESTAMP

constant

Source line 3713

std.c.T.IOCDCDTIMESTAMP

constant

Source line 3846

std.c.T.IOCDRAIN

constant

Source line 3608

std.c.T.IOCDRAIN

constant

Source line 3714

std.c.T.IOCDRAIN

constant

Source line 3842

std.c.T.IOCEXCL

constant

Source line 3488

std.c.T.IOCEXCL

constant

Source line 3547

std.c.T.IOCEXCL

constant

Source line 3609

std.c.T.IOCEXCL

constant

Source line 3715

std.c.T.IOCEXCL

constant

Source line 3799

std.c.T.IOCEXT

constant

Source line 3610

std.c.T.IOCEXT

constant

Source line 3716

std.c.T.IOCEXT

constant

Source line 3840

std.c.T.IOCFLAG_CDTRCTS

constant

Source line 3611

std.c.T.IOCFLAG_CDTRCTS

constant

Source line 3717

std.c.T.IOCFLAG_CLOCAL

constant

Source line 3612

std.c.T.IOCFLAG_CLOCAL

constant

Source line 3718

std.c.T.IOCFLAG_CRTSCTS

constant

Source line 3613

std.c.T.IOCFLAG_CRTSCTS

constant

Source line 3719

std.c.T.IOCFLAG_MDMBUF

constant

Source line 3614

std.c.T.IOCFLAG_MDMBUF

constant

Source line 3720

std.c.T.IOCFLAG_SOFTCAR

constant

Source line 3615

std.c.T.IOCFLAG_SOFTCAR

constant

Source line 3721

std.c.T.IOCFLUSH

constant

Source line 3549

std.c.T.IOCFLUSH

constant

Source line 3616

std.c.T.IOCFLUSH

constant

Source line 3722

std.c.T.IOCFLUSH

constant

Source line 3801

std.c.T.IOCGDRAINWAIT

constant

Source line 3848

std.c.T.IOCGETA

constant

Source line 3617

std.c.T.IOCGETA

constant

Source line 3723

std.c.T.IOCGETA

constant

Source line 3802

std.c.T.IOCGETC

constant

Source line 3551

std.c.T.IOCGETD

constant

Source line 3507

std.c.T.IOCGETD

constant

Source line 3541

std.c.T.IOCGETD

constant

Source line 3618

std.c.T.IOCGETD

constant

Source line 3724

std.c.T.IOCGETD

constant

Source line 3806

std.c.T.IOCGETLD

constant

Source line 3535

std.c.T.IOCGETP

constant

Source line 3544

std.c.T.IOCGFLAGS

constant

Source line 3619

std.c.T.IOCGFLAGS

constant

Source line 3725

std.c.T.IOCGLINED

constant

Source line 3620

std.c.T.IOCGLINED

constant

Source line 3726

std.c.T.IOCGLTC

constant

Source line 3571

get local special chars

std.c.T.IOCGPGRP

constant

Source line 3491

std.c.T.IOCGPGRP

constant

Source line 3583

get pgrp of tty

std.c.T.IOCGPGRP

constant

Source line 3621

std.c.T.IOCGPGRP

constant

Source line 3695

std.c.T.IOCGPGRP

constant

Source line 3727

std.c.T.IOCGPGRP

constant

Source line 3812

std.c.T.IOCGPGRP

constant

Source line 3853

std.c.T.IOCGPPS

constant

Source line 3537

std.c.T.IOCGPPSEV

constant

Source line 3539

std.c.T.IOCGPTN

constant

Source line 3511

std.c.T.IOCGPTN

constant

Source line 3865

std.c.T.IOCGQSIZE

constant

Source line 3622

std.c.T.IOCGQSIZE

constant

Source line 3728

std.c.T.IOCGRANTPT

constant

Source line 3623

std.c.T.IOCGRANTPT

constant

Source line 3729

std.c.T.IOCGSID

constant

Source line 3510

std.c.T.IOCGSID

constant

Source line 3587

get session id on ctty

std.c.T.IOCGSID

constant

Source line 3624

std.c.T.IOCGSID

constant

Source line 3704

std.c.T.IOCGSID

constant

Source line 3730

std.c.T.IOCGSID

constant

Source line 3837

std.c.T.IOCGSIZE

constant

Source line 3625

std.c.T.IOCGSIZE

constant

Source line 3731

std.c.T.IOCGSOFTCAR

constant

Source line 3525

std.c.T.IOCGWINSZ

constant

Source line 3481

std.c.T.IOCGWINSZ

constant

Source line 3495

std.c.T.IOCGWINSZ

constant

Source line 3522

std.c.T.IOCGWINSZ

constant

Source line 3626

std.c.T.IOCGWINSZ

constant

Source line 3692

std.c.T.IOCGWINSZ

constant

Source line 3732

std.c.T.IOCGWINSZ

constant

Source line 3833

std.c.T.IOCGWINSZ

constant

Source line 3860

std.c.T.IOCHPCL

constant

Source line 3543

std.c.T.IOCISPTMASTER

constant

Source line 3849

std.c.T.IOCLBIC

constant

Source line 3555

bic local mode bits

std.c.T.IOCLBIS

constant

Source line 3553

bis local mode bits

std.c.T.IOCLGET

constant

Source line 3559

get local modes

std.c.T.IOCLSET

constant

Source line 3557

set entire local mode word

std.c.T.IOCM_CAR

constant

Source line 3631

std.c.T.IOCM_CAR

constant

Source line 3737

std.c.T.IOCM_CAR

constant

Source line 3794

std.c.T.IOCM_CD

constant

Source line 3632

std.c.T.IOCM_CD

constant

Source line 3738

std.c.T.IOCM_CD

constant

Source line 3795

std.c.T.IOCM_CTS

constant

Source line 3633

std.c.T.IOCM_CTS

constant

Source line 3739

std.c.T.IOCM_CTS

constant

Source line 3793

std.c.T.IOCM_DSR

constant

Source line 3634

std.c.T.IOCM_DSR

constant

Source line 3740

std.c.T.IOCM_DSR

constant

Source line 3798

std.c.T.IOCM_DTR

constant

Source line 3635

std.c.T.IOCM_DTR

constant

Source line 3741

std.c.T.IOCM_DTR

constant

Source line 3789

std.c.T.IOCM_LE

constant

Source line 3636

std.c.T.IOCM_LE

constant

Source line 3742

std.c.T.IOCM_LE

constant

Source line 3788

std.c.T.IOCM_RI

constant

Source line 3637

std.c.T.IOCM_RI

constant

Source line 3743

std.c.T.IOCM_RI

constant

Source line 3797

std.c.T.IOCM_RNG

constant

Source line 3638

std.c.T.IOCM_RNG

constant

Source line 3744

std.c.T.IOCM_RNG

constant

Source line 3796

std.c.T.IOCM_RTS

constant

Source line 3639

std.c.T.IOCM_RTS

constant

Source line 3745

std.c.T.IOCM_RTS

constant

Source line 3790

std.c.T.IOCM_SR

constant

Source line 3640

std.c.T.IOCM_SR

constant

Source line 3746

std.c.T.IOCM_SR

constant

Source line 3792

std.c.T.IOCM_ST

constant

Source line 3641

std.c.T.IOCM_ST

constant

Source line 3747

std.c.T.IOCM_ST

constant

Source line 3791

std.c.T.IOCMBIC

constant

Source line 3499

std.c.T.IOCMBIC

constant

Source line 3595

bic modem bits

std.c.T.IOCMBIC

constant

Source line 3627

std.c.T.IOCMBIC

constant

Source line 3703

std.c.T.IOCMBIC

constant

Source line 3733

std.c.T.IOCMBIC

constant

Source line 3830

std.c.T.IOCMBIS

constant

Source line 3498

std.c.T.IOCMBIS

constant

Source line 3593

bis modem bits

std.c.T.IOCMBIS

constant

Source line 3628

std.c.T.IOCMBIS

constant

Source line 3702

std.c.T.IOCMBIS

constant

Source line 3734

std.c.T.IOCMBIS

constant

Source line 3829

std.c.T.IOCMGDTRWAIT

constant

Source line 3844

std.c.T.IOCMGET

constant

Source line 3497

std.c.T.IOCMGET

constant

Source line 3597

get all modem bits

std.c.T.IOCMGET

constant

Source line 3629

std.c.T.IOCMGET

constant

Source line 3698

std.c.T.IOCMGET

constant

Source line 3735

std.c.T.IOCMGET

constant

Source line 3831

std.c.T.IOCMODG

constant

Source line 3786

std.c.T.IOCMODS

constant

Source line 3787

std.c.T.IOCMSDTRWAIT

constant

Source line 3843

std.c.T.IOCMSET

constant

Source line 3500

std.c.T.IOCMSET

constant

Source line 3591

set all modem bits

std.c.T.IOCMSET

constant

Source line 3630

std.c.T.IOCMSET

constant

Source line 3699

std.c.T.IOCMSET

constant

Source line 3736

std.c.T.IOCMSET

constant

Source line 3828

std.c.T.IOCNOTTY

constant

Source line 3505

std.c.T.IOCNOTTY

constant

Source line 3575

void tty association

std.c.T.IOCNOTTY

constant

Source line 3642

std.c.T.IOCNOTTY

constant

Source line 3748

std.c.T.IOCNOTTY

constant

Source line 3816

std.c.T.IOCNOTTY

constant

Source line 3863

std.c.T.IOCNXCL

constant

Source line 3489

std.c.T.IOCNXCL

constant

Source line 3548

std.c.T.IOCNXCL

constant

Source line 3643

std.c.T.IOCNXCL

constant

Source line 3749

std.c.T.IOCNXCL

constant

Source line 3800

std.c.T.IOCOUTQ

constant

Source line 3493

std.c.T.IOCOUTQ

constant

Source line 3573

driver output queue size

std.c.T.IOCOUTQ

constant

Source line 3644

std.c.T.IOCOUTQ

constant

Source line 3750

std.c.T.IOCOUTQ

constant

Source line 3814

std.c.T.IOCPKT

constant

Source line 3503

std.c.T.IOCPKT

constant

Source line 3645

std.c.T.IOCPKT

constant

Source line 3751

std.c.T.IOCPKT

constant

Source line 3817

std.c.T.IOCPKT_DATA

constant

Source line 3646

std.c.T.IOCPKT_DATA

constant

Source line 3752

std.c.T.IOCPKT_DATA

constant

Source line 3818

std.c.T.IOCPKT_DOSTOP

constant

Source line 3647

std.c.T.IOCPKT_DOSTOP

constant

Source line 3753

std.c.T.IOCPKT_DOSTOP

constant

Source line 3824

std.c.T.IOCPKT_FLUSHREAD

constant

Source line 3648

std.c.T.IOCPKT_FLUSHREAD

constant

Source line 3754

std.c.T.IOCPKT_FLUSHREAD

constant

Source line 3819

std.c.T.IOCPKT_FLUSHWRITE

constant

Source line 3649

std.c.T.IOCPKT_FLUSHWRITE

constant

Source line 3755

std.c.T.IOCPKT_FLUSHWRITE

constant

Source line 3820

std.c.T.IOCPKT_IOCTL

constant

Source line 3650

std.c.T.IOCPKT_IOCTL

constant

Source line 3756

std.c.T.IOCPKT_IOCTL

constant

Source line 3825

std.c.T.IOCPKT_NOSTOP

constant

Source line 3651

std.c.T.IOCPKT_NOSTOP

constant

Source line 3757

std.c.T.IOCPKT_NOSTOP

constant

Source line 3823

std.c.T.IOCPKT_START

constant

Source line 3652

std.c.T.IOCPKT_START

constant

Source line 3758

std.c.T.IOCPKT_START

constant

Source line 3822

std.c.T.IOCPKT_STOP

constant

Source line 3653

std.c.T.IOCPKT_STOP

constant

Source line 3759

std.c.T.IOCPKT_STOP

constant

Source line 3821

std.c.T.IOCPTMGET

constant

Source line 3654

std.c.T.IOCPTMGET

constant

Source line 3760

std.c.T.IOCPTSNAME

constant

Source line 3655

std.c.T.IOCPTSNAME

constant

Source line 3761

std.c.T.IOCRCVFRAME

constant

Source line 3656

std.c.T.IOCRCVFRAME

constant

Source line 3762

std.c.T.IOCREMOTE

constant

Source line 3657

std.c.T.IOCREMOTE

constant

Source line 3763

std.c.T.IOCREMOTE

constant

Source line 3832

std.c.T.IOCSBRK

constant

Source line 3508

std.c.T.IOCSBRK

constant

Source line 3561

set break bit

std.c.T.IOCSBRK

constant

Source line 3658

std.c.T.IOCSBRK

constant

Source line 3700

std.c.T.IOCSBRK

constant

Source line 3764

std.c.T.IOCSBRK

constant

Source line 3808

std.c.T.IOCSCTTY

constant

Source line 3490

std.c.T.IOCSCTTY

constant

Source line 3577

get a ctty

std.c.T.IOCSCTTY

constant

Source line 3659

std.c.T.IOCSCTTY

constant

Source line 3697

std.c.T.IOCSCTTY

constant

Source line 3765

std.c.T.IOCSCTTY

constant

Source line 3839

std.c.T.IOCSCTTY

constant

Source line 3861

std.c.T.IOCSDRAINWAIT

constant

Source line 3847

std.c.T.IOCSDTR

constant

Source line 3565

set data terminal ready

std.c.T.IOCSDTR

constant

Source line 3660

std.c.T.IOCSDTR

constant

Source line 3766

std.c.T.IOCSDTR

constant

Source line 3810

std.c.T.IOCSETA

constant

Source line 3661

std.c.T.IOCSETA

constant

Source line 3767

std.c.T.IOCSETA

constant

Source line 3803

std.c.T.IOCSETAF

constant

Source line 3662

std.c.T.IOCSETAF

constant

Source line 3768

std.c.T.IOCSETAF

constant

Source line 3805

std.c.T.IOCSETAW

constant

Source line 3663

std.c.T.IOCSETAW

constant

Source line 3769

std.c.T.IOCSETAW

constant

Source line 3804

std.c.T.IOCSETC

constant

Source line 3550

std.c.T.IOCSETD

constant

Source line 3506

std.c.T.IOCSETD

constant

Source line 3542

std.c.T.IOCSETD

constant

Source line 3664

std.c.T.IOCSETD

constant

Source line 3770

std.c.T.IOCSETD

constant

Source line 3807

std.c.T.IOCSETLD

constant

Source line 3534

std.c.T.IOCSETN

constant

Source line 3546

std.c.T.IOCSETP

constant

Source line 3545

std.c.T.IOCSFLAGS

constant

Source line 3665

std.c.T.IOCSFLAGS

constant

Source line 3771

std.c.T.IOCSIG

constant

Source line 3512

std.c.T.IOCSIG

constant

Source line 3666

std.c.T.IOCSIG

constant

Source line 3772

std.c.T.IOCSIG

constant

Source line 3841

std.c.T.IOCSLINED

constant

Source line 3667

std.c.T.IOCSLINED

constant

Source line 3773

std.c.T.IOCSLTC

constant

Source line 3569

set local special chars

std.c.T.IOCSPGRP

constant

Source line 3492

std.c.T.IOCSPGRP

constant

Source line 3585

set pgrp of tty

std.c.T.IOCSPGRP

constant

Source line 3668

std.c.T.IOCSPGRP

constant

Source line 3696

std.c.T.IOCSPGRP

constant

Source line 3774

std.c.T.IOCSPGRP

constant

Source line 3813

std.c.T.IOCSPGRP

constant

Source line 3854

std.c.T.IOCSPPS

constant

Source line 3538

std.c.T.IOCSQSIZE

constant

Source line 3669

std.c.T.IOCSQSIZE

constant

Source line 3775

std.c.T.IOCSSIZE

constant

Source line 3670

std.c.T.IOCSSIZE

constant

Source line 3776

std.c.T.IOCSSOFTCAR

constant

Source line 3526

std.c.T.IOCSTART

constant

Source line 3581

start output, like ^Q

std.c.T.IOCSTART

constant

Source line 3671

std.c.T.IOCSTART

constant

Source line 3777

std.c.T.IOCSTART

constant

Source line 3827

std.c.T.IOCSTAT

constant

Source line 3672

std.c.T.IOCSTAT

constant

Source line 3778

std.c.T.IOCSTAT

constant

Source line 3836

std.c.T.IOCSTI

constant

Source line 3494

std.c.T.IOCSTI

constant

Source line 3589

simulate terminal input

std.c.T.IOCSTI

constant

Source line 3673

std.c.T.IOCSTI

constant

Source line 3779

std.c.T.IOCSTI

constant

Source line 3815

std.c.T.IOCSTI

constant

Source line 3862

std.c.T.IOCSTOP

constant

Source line 3579

stop output, like ^S

std.c.T.IOCSTOP

constant

Source line 3674

std.c.T.IOCSTOP

constant

Source line 3780

std.c.T.IOCSTOP

constant

Source line 3826

std.c.T.IOCSWINSZ

constant

Source line 3496

std.c.T.IOCSWINSZ

constant

Source line 3523

std.c.T.IOCSWINSZ

constant

Source line 3675

std.c.T.IOCSWINSZ

constant

Source line 3693

std.c.T.IOCSWINSZ

constant

Source line 3781

std.c.T.IOCSWINSZ

constant

Source line 3834

std.c.T.IOCSWINSZ

constant

Source line 3864

std.c.T.IOCTIMESTAMP

constant

Source line 3845

std.c.T.IOCUCNTL

constant

Source line 3676

std.c.T.IOCUCNTL

constant

Source line 3782

std.c.T.IOCUCNTL

constant

Source line 3835

std.c.T.IOCXMTFRAME

constant

Source line 3677

std.c.T.IOCXMTFRAME

constant

Source line 3783

std.c.T.ior

function

Source line 3483

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

Parameters

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

std.c.T.tioc

function

Source line 3599

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

Parameters

t: u16
num: u8

std.c.TASK

alias

Source line 11767

Alias of std.c.darwin.TASK

std.c.task_flavor_t

alias

Source line 11874

Alias of std.c.darwin.task_flavor_t

std.c.task_for_pid

alias

Source line 11875

Alias of std.c.darwin.task_for_pid

std.c.task_get_exception_ports

alias

Source line 11876

Alias of std.c.darwin.task_get_exception_ports

std.c.task_info

alias

Source line 11877

Alias of std.c.darwin.task_info

std.c.task_info_t

alias

Source line 11878

Alias of std.c.darwin.task_info_t

std.c.task_name_t

alias

Source line 11879

Alias of std.c.darwin.task_name_t

std.c.TASK_NULL

alias

Source line 11768

Alias of std.c.darwin.TASK_NULL

std.c.task_policy_flavor_t

alias

Source line 11932

Alias of std.c.darwin.task_policy_flavor_t

std.c.task_policy_t

alias

Source line 11933

Alias of std.c.darwin.task_policy_t

std.c.task_read_t

alias

Source line 11934

Alias of std.c.darwin.task_read_t

std.c.task_resume

alias

Source line 11880

Alias of std.c.darwin.task_resume

std.c.task_set_exception_ports

alias

Source line 11881

Alias of std.c.darwin.task_set_exception_ports

std.c.task_suspend

alias

Source line 11882

Alias of std.c.darwin.task_suspend

std.c.task_t

alias

Source line 11935

Alias of std.c.darwin.task_t

std.c.task_threads

alias

Source line 11883

Alias of std.c.darwin.task_threads

std.c.TASK_VM_INFO

alias

Source line 11769

Alias of std.c.darwin.TASK_VM_INFO

std.c.TASK_VM_INFO_COUNT

alias

Source line 11770

Alias of std.c.darwin.TASK_VM_INFO_COUNT

std.c.task_vm_info_data_t

alias

Source line 11884

Alias of std.c.darwin.task_vm_info_data_t

std.c.taskid_t

alias

Source line 11645

Alias of std.c.illumos.taskid_t

std.c.tc_cflag_t

type

Source line 9447

std.c.tc_iflag_t

type

Source line 9238

std.c.tc_lflag_t

type

Source line 9596

std.c.tc_oflag_t

type

Source line 9349

std.c.TCFLUSH

alias

Source line 11676

Alias of std.c.openbsd.TCFLUSH

std.c.tcgetattr

function

Source line 11146

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

Parameters

fd: fd_t
termios_p: *termios

std.c.TCIO

alias

Source line 11677

Alias of std.c.openbsd.TCIO

std.c.TCP

type

Source line 6231

std.c.TCP.MAXSEG

constant

Source line 6245

std.c.TCP.NODELAY

constant

Source line 6244

std.c.TCSA

alias

Source line 3874

Alias of std.posix.TCSA

std.c.tcsetattr

function

Source line 11147

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

Parameters

fd: fd_t
optional_action: TCSA
termios_p: *const termios

std.c.team_id

alias

Source line 11669

Alias of std.c.haiku.team_id

std.c.telldir

function

Source line 10572

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

Parameters

dp: *DIR

std.c.termios

type

Source line 9187

std.c.TFD

type

Source line 3875

std.c.THREAD

alias

Source line 11771

Alias of std.c.darwin.THREAD

std.c.thread_act_t

alias

Source line 11936

Alias of std.c.darwin.thread_act_t

std.c.thread_basic_info

alias

Source line 11885

Alias of std.c.darwin.thread_basic_info

std.c.THREAD_BASIC_INFO

alias

Source line 11772

Alias of std.c.darwin.THREAD_BASIC_INFO

std.c.THREAD_BASIC_INFO_COUNT

alias

Source line 11773

Alias of std.c.darwin.THREAD_BASIC_INFO_COUNT

std.c.thread_flavor_t

alias

Source line 11937

Alias of std.c.darwin.thread_flavor_t

std.c.thread_get_state

alias

Source line 11886

Alias of std.c.darwin.thread_get_state

std.c.thread_id

alias

Source line 11670

Alias of std.c.haiku.thread_id

std.c.thread_identifier_info

alias

Source line 11887

Alias of std.c.darwin.thread_identifier_info

std.c.THREAD_IDENTIFIER_INFO_COUNT

alias

Source line 11774

Alias of std.c.darwin.THREAD_IDENTIFIER_INFO_COUNT

std.c.thread_info

alias

Source line 11888

Alias of std.c.darwin.thread_info

std.c.thread_info_t

alias

Source line 11889

Alias of std.c.darwin.thread_info_t

std.c.THREAD_NULL

alias

Source line 11775

Alias of std.c.darwin.THREAD_NULL

std.c.thread_port_t

alias

Source line 11938

Alias of std.c.darwin.thread_port_t

std.c.thread_resume

alias

Source line 11890

Alias of std.c.darwin.thread_resume

std.c.thread_set_state

alias

Source line 11891

Alias of std.c.darwin.thread_set_state

std.c.thread_state_flavor_t

alias

Source line 11939

Alias of std.c.darwin.thread_state_flavor_t

std.c.THREAD_STATE_NONE

alias

Source line 11776

Alias of std.c.darwin.THREAD_STATE_NONE

std.c.thread_state_t

alias

Source line 11940

Alias of std.c.darwin.thread_state_t

std.c.thread_t

alias

Source line 11941

Alias of std.c.darwin.thread_t

std.c.time_t

type

Source line 7244

std.c.time_value_t

alias

Source line 11942

Alias of std.c.darwin.time_value_t

std.c.TIMER

type

Source line 11522

std.c.TIMERFD_CLOCK

alias

Source line 282

Alias of std.c.timerfd_clockid_t

std.c.timerfd_clockid_t

type

Source line 283

std.c.timerfd_create

function

Source line 10678

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

Parameters

clockid: timerfd_clockid_t
flags: c_int

std.c.timerfd_gettime

function

Source line 10685

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

Parameters

fd: c_int
curr_value: *itimerspec

std.c.timerfd_settime

function

Source line 10679

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

Parameters

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

std.c.timespec

type

Source line 120

std.c.timespec.fromTimestamp

function

Source line 128

pub fn fromTimestamp(tm: wasi.timestamp_t) timespec

Parameters

std.c.timespec.toTimestamp

function

Source line 137

pub fn toTimestamp(ts: timespec) wasi.timestamp_t

Parameters

ts: timespec

std.c.timeval

type

Source line 7262

std.c.timezone

type

Source line 7278

std.c.uid_from_user

alias

Source line 11730

Alias of std.c.openbsd.uid_from_user

std.c.uid_t

type

Source line 182

std.c.uintmax_t

type

Source line 11506

std.c.UL

alias

Source line 11777

Alias of std.c.darwin.UL

std.c.umask

function

Source line 11139

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

Parameters

mode: mode_t

std.c.UMTX_ABSTIME

alias

Source line 11736

Alias of std.c.freebsd.UMTX_ABSTIME

std.c.UMTX_OP

alias

Source line 11737

Alias of std.c.freebsd.UMTX_OP

std.c.umtx_sleep

alias

Source line 11958

Alias of std.c.dragonfly.umtx_sleep

std.c.umtx_wakeup

alias

Source line 11959

Alias of std.c.dragonfly.umtx_wakeup

std.c.uname

function

Source line 11149

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

Parameters

buf: *utsname

std.c.unlink

function

Source line 11087

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

Parameters

path: [*:0]const u8

std.c.unlinkat

function

Source line 11088

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

Parameters

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

std.c.unveil

alias

Source line 11731

Alias of std.c.openbsd.unveil

std.c.user_desc

type

Source line 7289

std.c.user_from_uid

alias

Source line 11732

Alias of std.c.openbsd.user_from_uid

std.c.UTIME

type

Source line 98

For use with utimensat and futimens.

std.c.UTIME.NOW

constant

Source line 100

timespec

std.c.UTIME.NOW

constant

Source line 105

timespec

std.c.UTIME.NOW

constant

Source line 110

timespec

std.c.UTIME.NOW

constant

Source line 114

timespec

std.c.UTIME.OMIT

constant

Source line 101

timespec

std.c.UTIME.OMIT

constant

Source line 106

timespec

std.c.UTIME.OMIT

constant

Source line 111

timespec

std.c.UTIME.OMIT

constant

Source line 115

timespec

std.c.utimensat

function

Source line 11220

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

Parameters

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

std.c.utimes

function

Source line 11218

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

Parameters

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

std.c.utsname

type

Source line 7293

std.c.utsname.UTSNAME_ENTRY_LEN

constant

Source line 7327

std.c.V

type

Source line 9057

Indices into the cc array in the termios struct.

std.c.VDSO

type

Source line 3879

std.c.versionCheck

function

Source line 57

  • If not linking libc, returns false.
  • If linking musl libc, returns true.
  • If linking GNU libc (glibc), returns true if the target version is greater than or equal to version.
  • If linking Android libc (bionic), returns true if the target API level is greater than or equal to version.major, ignoring other components.
  • If linking a libc other than these, returns false.
pub inline fn versionCheck(comptime version: std.SemanticVersion) bool

Parameters

version: std.SemanticVersion

std.c.VM

alias

Source line 11778

Alias of std.c.darwin.VM

std.c.vm_address_t

alias

Source line 11892

Alias of std.c.darwin.vm_address_t

std.c.vm_behavior_t

alias

Source line 11944

Alias of std.c.darwin.vm_behavior_t

std.c.vm_deallocate

alias

Source line 11893

Alias of std.c.darwin.vm_deallocate

std.c.vm_inherit_t

alias

Source line 11945

Alias of std.c.darwin.vm_inherit_t

std.c.vm_machine_attribute

alias

Source line 11894

Alias of std.c.darwin.vm_machine_attribute

std.c.vm_machine_attribute_t

alias

Source line 11895

Alias of std.c.darwin.vm_machine_attribute_t

std.c.vm_machine_attribute_val_t

alias

Source line 11896

Alias of std.c.darwin.vm_machine_attribute_val_t

std.c.vm_map_read_t

alias

Source line 11946

Alias of std.c.darwin.vm_map_read_t

std.c.vm_map_t

alias

Source line 11897

Alias of std.c.darwin.vm_map_t

std.c.vm_object_id_t

alias

Source line 11947

Alias of std.c.darwin.vm_object_id_t

std.c.vm_offset_t

alias

Source line 11898

Alias of std.c.darwin.vm_offset_t

std.c.vm_prot_t

alias

Source line 11899

Alias of std.c.darwin.vm_prot_t

std.c.vm_region_basic_info_64

alias

Source line 11900

Alias of std.c.darwin.vm_region_basic_info_64

std.c.vm_region_extended_info

alias

Source line 11901

Alias of std.c.darwin.vm_region_extended_info

std.c.vm_region_flavor_t

alias

Source line 11948

Alias of std.c.darwin.vm_region_flavor_t

std.c.vm_region_info_t

alias

Source line 11902

Alias of std.c.darwin.vm_region_info_t

std.c.vm_region_recurse_info_t

alias

Source line 11903

Alias of std.c.darwin.vm_region_recurse_info_t

std.c.vm_region_submap_info_64

alias

Source line 11904

Alias of std.c.darwin.vm_region_submap_info_64

std.c.vm_region_submap_short_info_64

alias

Source line 11905

Alias of std.c.darwin.vm_region_submap_short_info_64

std.c.vm_region_top_info

alias

Source line 11906

Alias of std.c.darwin.vm_region_top_info

std.c.vm_size_t

alias

Source line 11804

Alias of std.c.darwin.vm_size_t

std.c.vm32_object_id_t

alias

Source line 11943

Alias of std.c.darwin.vm32_object_id_t

std.c.W

type

Source line 3883

std.c.W_OK

constant

Source line 1250

Test for write permission.

std.c.W.CONTINUED

constant

Source line 3920

std.c.W.CONTINUED

constant

Source line 3949

std.c.W.CONTINUED

constant

Source line 3982

std.c.W.CONTINUED

constant

Source line 4015

std.c.W.CONTINUED

constant

Source line 4043

std.c.W.CONTINUED

constant

Source line 4075

std.c.W.CONTINUED

constant

Source line 4108

std.c.W.EXITED

constant

Source line 3922

std.c.W.EXITED

constant

Source line 3945

std.c.W.EXITED

constant

Source line 3984

std.c.W.EXITED

constant

Source line 4018

std.c.W.EXITED

constant

Source line 4044

std.c.W.EXITED

constant

Source line 4107

std.c.W.EXITSTATUS

function

Source line 3892

pub fn EXITSTATUS(x: u32) u8

Parameters

x: u32

std.c.W.EXITSTATUS

function

Source line 3925

pub fn EXITSTATUS(s: u32) u8

Parameters

s: u32

std.c.W.EXITSTATUS

function

Source line 3953

pub fn EXITSTATUS(s: u32) u8

Parameters

s: u32

std.c.W.EXITSTATUS

function

Source line 3987

pub fn EXITSTATUS(s: u32) u8

Parameters

s: u32

std.c.W.EXITSTATUS

function

Source line 4021

pub fn EXITSTATUS(s: u32) u8

Parameters

s: u32

std.c.W.EXITSTATUS

function

Source line 4048

pub fn EXITSTATUS(s: u32) u8

Parameters

s: u32

std.c.W.EXITSTATUS

function

Source line 4077

pub fn EXITSTATUS(s: u32) u8

Parameters

s: u32

std.c.W.EXITSTATUS

function

Source line 4111

pub fn EXITSTATUS(s: u32) u8

Parameters

s: u32

std.c.W.IFCONTINUED

function

Source line 3966

pub fn IFCONTINUED(s: u32) bool

Parameters

s: u32

std.c.W.IFCONTINUED

function

Source line 4000

pub fn IFCONTINUED(s: u32) bool

Parameters

s: u32

std.c.W.IFCONTINUED

function

Source line 4090

pub fn IFCONTINUED(s: u32) bool

Parameters

s: u32

std.c.W.IFCONTINUED

function

Source line 4135

pub fn IFCONTINUED(s: u32) bool

Parameters

s: u32

std.c.W.IFEXITED

function

Source line 3901

pub fn IFEXITED(x: u32) bool

Parameters

x: u32

std.c.W.IFEXITED

function

Source line 3934

pub fn IFEXITED(s: u32) bool

Parameters

s: u32

std.c.W.IFEXITED

function

Source line 3962

pub fn IFEXITED(s: u32) bool

Parameters

s: u32

std.c.W.IFEXITED

function

Source line 3996

pub fn IFEXITED(s: u32) bool

Parameters

s: u32

std.c.W.IFEXITED

function

Source line 4030

pub fn IFEXITED(s: u32) bool

Parameters

s: u32

std.c.W.IFEXITED

function

Source line 4060

pub fn IFEXITED(s: u32) bool

Parameters

s: u32

std.c.W.IFEXITED

function

Source line 4086

pub fn IFEXITED(s: u32) bool

Parameters

s: u32

std.c.W.IFEXITED

function

Source line 4123

pub fn IFEXITED(s: u32) bool

Parameters

s: u32

std.c.W.IFSIGNALED

function

Source line 3907

pub fn IFSIGNALED(x: u32) bool

Parameters

x: u32

std.c.W.IFSIGNALED

function

Source line 3940

pub fn IFSIGNALED(s: u32) bool

Parameters

s: u32

std.c.W.IFSIGNALED

function

Source line 3974

pub fn IFSIGNALED(s: u32) bool

Parameters

s: u32

std.c.W.IFSIGNALED

function

Source line 4008

pub fn IFSIGNALED(s: u32) bool

Parameters

s: u32

std.c.W.IFSIGNALED

function

Source line 4036

pub fn IFSIGNALED(s: u32) bool

Parameters

s: u32

std.c.W.IFSIGNALED

function

Source line 4068

pub fn IFSIGNALED(s: u32) bool

Parameters

s: u32

std.c.W.IFSIGNALED

function

Source line 4098

pub fn IFSIGNALED(s: u32) bool

Parameters

s: u32

std.c.W.IFSIGNALED

function

Source line 4131

pub fn IFSIGNALED(s: u32) bool

Parameters

s: u32

std.c.W.IFSTOPPED

function

Source line 3904

pub fn IFSTOPPED(x: u32) bool

Parameters

x: u32

std.c.W.IFSTOPPED

function

Source line 3937

pub fn IFSTOPPED(s: u32) bool

Parameters

s: u32

std.c.W.IFSTOPPED

function

Source line 3970

pub fn IFSTOPPED(s: u32) bool

Parameters

s: u32

std.c.W.IFSTOPPED

function

Source line 4004

pub fn IFSTOPPED(s: u32) bool

Parameters

s: u32

std.c.W.IFSTOPPED

function

Source line 4033

pub fn IFSTOPPED(s: u32) bool

Parameters

s: u32

std.c.W.IFSTOPPED

function

Source line 4064

pub fn IFSTOPPED(s: u32) bool

Parameters

s: u32

std.c.W.IFSTOPPED

function

Source line 4094

pub fn IFSTOPPED(s: u32) bool

Parameters

s: u32

std.c.W.IFSTOPPED

function

Source line 4127

pub fn IFSTOPPED(s: u32) bool

Parameters

s: u32

std.c.W.NOHANG

constant

Source line 3888

[XSI] no hang in wait/no child to reap

std.c.W.NOHANG

constant

Source line 3917

std.c.W.NOHANG

constant

Source line 3950

std.c.W.NOHANG

constant

Source line 3979

std.c.W.NOHANG

constant

Source line 4013

std.c.W.NOHANG

constant

Source line 4041

std.c.W.NOHANG

constant

Source line 4073

std.c.W.NOHANG

constant

Source line 4104

std.c.W.NOWAIT

constant

Source line 3921

std.c.W.NOWAIT

constant

Source line 3951

std.c.W.NOWAIT

constant

Source line 3983

std.c.W.NOWAIT

constant

Source line 4017

std.c.W.NOWAIT

constant

Source line 4046

std.c.W.NOWAIT

constant

Source line 4109

std.c.W.status

function

Source line 3911

fn status(x: u32) u32

Parameters

x: u32

std.c.W.stopped

constant

Source line 3914

std.c.W.STOPPED

alias

Source line 3919

Alias of std.c.W.UNTRACED

std.c.W.STOPPED

alias

Source line 3948

Alias of std.c.W.UNTRACED

std.c.W.STOPPED

alias

Source line 3981

Alias of std.c.W.UNTRACED

std.c.W.STOPPED

alias

Source line 4016

Alias of std.c.W.UNTRACED

std.c.W.STOPPED

constant

Source line 4045

std.c.W.STOPPED

alias

Source line 4106

Alias of std.c.W.UNTRACED

std.c.W.STOPSIG

function

Source line 3898

pub fn STOPSIG(x: u32) SIG

Parameters

x: u32

std.c.W.STOPSIG

function

Source line 3931

pub fn STOPSIG(s: u32) SIG

Parameters

s: u32

std.c.W.STOPSIG

function

Source line 3959

pub fn STOPSIG(s: u32) SIG

Parameters

s: u32

std.c.W.STOPSIG

function

Source line 3993

pub fn STOPSIG(s: u32) SIG

Parameters

s: u32

std.c.W.STOPSIG

function

Source line 4027

pub fn STOPSIG(s: u32) SIG

Parameters

s: u32

std.c.W.STOPSIG

function

Source line 4056

pub fn STOPSIG(s: u32) SIG

Parameters

s: u32

std.c.W.STOPSIG

function

Source line 4083

pub fn STOPSIG(s: u32) SIG

Parameters

s: u32

std.c.W.STOPSIG

function

Source line 4115

pub fn STOPSIG(s: u32) SIG

Parameters

s: u32

std.c.W.TERMSIG

function

Source line 3895

pub fn TERMSIG(x: u32) SIG

Parameters

x: u32

std.c.W.TERMSIG

function

Source line 3928

pub fn TERMSIG(s: u32) SIG

Parameters

s: u32

std.c.W.TERMSIG

function

Source line 3956

pub fn TERMSIG(s: u32) SIG

Parameters

s: u32

std.c.W.TERMSIG

function

Source line 3990

pub fn TERMSIG(s: u32) SIG

Parameters

s: u32

std.c.W.TERMSIG

function

Source line 4024

pub fn TERMSIG(s: u32) SIG

Parameters

s: u32

std.c.W.TERMSIG

function

Source line 4052

pub fn TERMSIG(s: u32) SIG

Parameters

s: u32

std.c.W.TERMSIG

function

Source line 4080

pub fn TERMSIG(s: u32) SIG

Parameters

s: u32

std.c.W.TERMSIG

function

Source line 4119

pub fn TERMSIG(s: u32) SIG

Parameters

s: u32

std.c.W.TRAPPED

constant

Source line 3923

std.c.W.TRAPPED

constant

Source line 3946

std.c.W.TRAPPED

constant

Source line 3985

std.c.W.TRAPPED

constant

Source line 4019

std.c.W.UNTRACED

constant

Source line 3890

[XSI] notify on stop, untraced child

std.c.W.UNTRACED

constant

Source line 3918

std.c.W.UNTRACED

constant

Source line 3947

std.c.W.UNTRACED

constant

Source line 3980

std.c.W.UNTRACED

constant

Source line 4014

std.c.W.UNTRACED

constant

Source line 4042

std.c.W.UNTRACED

constant

Source line 4074

std.c.W.UNTRACED

constant

Source line 4105

std.c.wait4

constant

Source line 11092

std.c.waitpid

function

Source line 11090

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

Parameters

pid: pid_t
status: ?*c_int
options: c_int

std.c.wasi

alias

Source line 14

Alias of std.os.wasi

std.c.wchar_t

type

Source line 11513

std.c.wcsdup

constant

Source line 11558

std.c.wcsnlen

function

Source line 11557

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

Parameters

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

std.c.whence_t

type

Source line 9926

std.c.windows

alias

Source line 15

Alias of std.os.windows

std.c.winsize

alias

Source line 32

Alias of std.posix.winsize

std.c.wint_t

type

Source line 11508

std.c.write

function

Source line 11079

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

Parameters

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

std.c.writev

function

Source line 11077

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

Parameters

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

std.c.writev_pos

alias

Source line 11671

Alias of std.c.haiku.writev_pos

std.c.ws2_32

alias

Source line 16

Alias of std.os.windows.ws2_32

std.c.X_OK

constant

Source line 1244

Test for execute or search permission.

std.c.zoneid_t

alias

Source line 11646

Alias of std.c.illumos.zoneid_t

Source code

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");

// These constants are shared among all operating systems even when not linking
// 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;

/// The value of the link editor defined symbol _MH_EXECUTE_SYM is the address
/// of the mach header in a Mach-O executable file type.  It does not appear in
/// any file type other than a MH_EXECUTE file type.  The type of the symbol is
/// absolute as the header is not part of any section.
/// This symbol is populated when linking the system's libc, which is guaranteed
/// on this operating system. However when building object files or libraries,
/// the system libc won't be linked until the final executable. So we
/// export a weak symbol here, to be overridden by the real one.
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 });
    }
}

/// * If not linking libc, returns `false`.
/// * If linking musl libc, returns `true`.
/// * If linking GNU libc (glibc), returns `true` if the target version is greater than or equal to
///   `version`.
/// * If linking Android libc (bionic), returns `true` if the target API level is greater than or
///   equal to `version.major`, ignoring other components.
/// * If linking a libc other than these, returns `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;
        }
    };
}

/// Get the errno if rc is -1 and SUCCESS if rc is not -1.
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,
};

/// For use with `utimensat` and `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 and musl define dev_t as u64, while in Linux kernel it is 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 emulates 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, // username
        passwd: ?[*:0]const u8, // user password
        uid: uid_t, // user ID
        gid: gid_t, // group ID
        gecos: ?[*:0]const u8, // user information
        dir: ?[*:0]const u8, // home directory
        shell: ?[*:0]const u8, // shell program
    },
    .netbsd, .openbsd, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        name: ?[*:0]const u8, // user name
        passwd: ?[*:0]const u8, // encrypted password
        uid: uid_t, // user uid
        gid: gid_t, // user gid
        change: time_t, // password change time
        class: ?[*:0]const u8, // user access class
        gecos: ?[*:0]const u8, // Honeywell login info
        dir: ?[*:0]const u8, // home directory
        shell: ?[*:0]const u8, // default shell
        expire: time_t, // account expiration
    },
    .dragonfly, .freebsd => extern struct {
        name: ?[*:0]const u8, // user name
        passwd: ?[*:0]const u8, // encrypted password
        uid: uid_t, // user uid
        gid: gid_t, // user gid
        change: time_t, // password change time
        class: ?[*:0]const u8, // user access class
        gecos: ?[*:0]const u8, // Honeywell login info
        dir: ?[*:0]const u8, // home directory
        shell: ?[*:0]const u8, // default shell
        expire: time_t, // account expiration
        fields: c_int, // internal
    },
    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,
};

// For use with posix.timerfd_create()
// Actually, the parameter for the timerfd_create() function is an integer,
// which means that the developer has to figure out which value is appropriate.
// To make this easier and, above all, safer, because an incorrect value leads
// to a panic, an enum is introduced which only allows the values
// that actually work.
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) {
        /// system-wide monotonic clock (aka system time)
        MONOTONIC = 0,
        /// system-wide real time clock
        REALTIME = -1,
        /// clock measuring the used CPU time of the current process
        PROCESS_CPUTIME_ID = -2,
        /// clock measuring the used CPU time of the current thread
        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) {
        /// No error occurred.
        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,
        /// Also means `DEADLOCK`.
        DEADLK = 36,
        NAMETOOLONG = 38,
        NOLCK = 39,
        NOSYS = 40,
        NOTEMPTY = 41,

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

        // POSIX Supplement
        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) {
        /// No error occurred.
        SUCCESS = 0,
        /// Not super-user
        PERM = 1,
        /// No such file or directory
        NOENT = 2,
        /// No such process
        SRCH = 3,
        /// interrupted system call
        INTR = 4,
        /// I/O error
        IO = 5,
        /// No such device or address
        NXIO = 6,
        /// Arg list too long
        @"2BIG" = 7,
        /// Exec format error
        NOEXEC = 8,
        /// Bad file number
        BADF = 9,
        /// No children
        CHILD = 10,
        /// Resource temporarily unavailable.
        /// also: WOULDBLOCK: Operation would block.
        AGAIN = 11,
        /// Not enough core
        NOMEM = 12,
        /// Permission denied
        ACCES = 13,
        /// Bad address
        FAULT = 14,
        /// Block device required
        NOTBLK = 15,
        /// Mount device busy
        BUSY = 16,
        /// File exists
        EXIST = 17,
        /// Cross-device link
        XDEV = 18,
        /// No such device
        NODEV = 19,
        /// Not a directory
        NOTDIR = 20,
        /// Is a directory
        ISDIR = 21,
        /// Invalid argument
        INVAL = 22,
        /// File table overflow
        NFILE = 23,
        /// Too many open files
        MFILE = 24,
        /// Inappropriate ioctl for device
        NOTTY = 25,
        /// Text file busy
        TXTBSY = 26,
        /// File too large
        FBIG = 27,
        /// No space left on device
        NOSPC = 28,
        /// Illegal seek
        SPIPE = 29,
        /// Read only file system
        ROFS = 30,
        /// Too many links
        MLINK = 31,
        /// Broken pipe
        PIPE = 32,
        /// Math arg out of domain of func
        DOM = 33,
        /// Math result not representable
        RANGE = 34,
        /// No message of desired type
        NOMSG = 35,
        /// Identifier removed
        IDRM = 36,
        /// Channel number out of range
        CHRNG = 37,
        /// Level 2 not synchronized
        L2NSYNC = 38,
        /// Level 3 halted
        L3HLT = 39,
        /// Level 3 reset
        L3RST = 40,
        /// Link number out of range
        LNRNG = 41,
        /// Protocol driver not attached
        UNATCH = 42,
        /// No CSI structure available
        NOCSI = 43,
        /// Level 2 halted
        L2HLT = 44,
        /// Deadlock condition.
        DEADLK = 45,
        /// No record locks available.
        NOLCK = 46,
        /// Operation canceled
        CANCELED = 47,
        /// Operation not supported
        NOTSUP = 48,

        // Filesystem Quotas
        /// Disc quota exceeded
        DQUOT = 49,

        // Convergent Error Returns
        /// invalid exchange
        BADE = 50,
        /// invalid request descriptor
        BADR = 51,
        /// exchange full
        XFULL = 52,
        /// no anode
        NOANO = 53,
        /// invalid request code
        BADRQC = 54,
        /// invalid slot
        BADSLT = 55,
        /// file locking deadlock error
        DEADLOCK = 56,
        /// bad font file fmt
        BFONT = 57,

        // Interprocess Robust Locks
        /// process died with the lock
        OWNERDEAD = 58,
        /// lock is not recoverable
        NOTRECOVERABLE = 59,
        /// locked lock was unmapped
        LOCKUNMAPPED = 72,
        /// Facility is not active
        NOTACTIVE = 73,
        /// multihop attempted
        MULTIHOP = 74,
        /// trying to read unreadable message
        BADMSG = 77,
        /// path name is too long
        NAMETOOLONG = 78,
        /// value too large to be stored in data type
        OVERFLOW = 79,
        /// given log. name not unique
        NOTUNIQ = 80,
        /// f.d. invalid for this operation
        BADFD = 81,
        /// Remote address changed
        REMCHG = 82,

        // Stream Problems
        /// Device not a stream
        NOSTR = 60,
        /// no data (for no delay io)
        NODATA = 61,
        /// timer expired
        TIME = 62,
        /// out of streams resources
        NOSR = 63,
        /// Machine is not on the network
        NONET = 64,
        /// Package not installed
        NOPKG = 65,
        /// The object is remote
        REMOTE = 66,
        /// the link has been severed
        NOLINK = 67,
        /// advertise error
        ADV = 68,
        /// srmount error
        SRMNT = 69,
        /// Communication error on send
        COMM = 70,
        /// Protocol error
        PROTO = 71,

        // Shared Library Problems
        /// Can't access a needed shared lib.
        LIBACC = 83,
        /// Accessing a corrupted shared lib.
        LIBBAD = 84,
        /// .lib section in a.out corrupted.
        LIBSCN = 85,
        /// Attempting to link in too many libs.
        LIBMAX = 86,
        /// Attempting to exec a shared library.
        LIBEXEC = 87,
        /// Illegal byte sequence.
        ILSEQ = 88,
        /// Unsupported file system operation
        NOSYS = 89,
        /// Symbolic link loop
        LOOP = 90,
        /// Restartable system call
        RESTART = 91,
        /// if pipe/FIFO, don't sleep in stream head
        STRPIPE = 92,
        /// directory not empty
        NOTEMPTY = 93,
        /// Too many users (for UFS)
        USERS = 94,

        // BSD Networking Software
        // Argument Errors
        /// Socket operation on non-socket
        NOTSOCK = 95,
        /// Destination address required
        DESTADDRREQ = 96,
        /// Message too long
        MSGSIZE = 97,
        /// Protocol wrong type for socket
        PROTOTYPE = 98,
        /// Protocol not available
        NOPROTOOPT = 99,
        /// Protocol not supported
        PROTONOSUPPORT = 120,
        /// Socket type not supported
        SOCKTNOSUPPORT = 121,
        /// Operation not supported on socket
        OPNOTSUPP = 122,
        /// Protocol family not supported
        PFNOSUPPORT = 123,
        /// Address family not supported by
        AFNOSUPPORT = 124,
        /// Address already in use
        ADDRINUSE = 125,
        /// Can't assign requested address
        ADDRNOTAVAIL = 126,

        // Operational Errors
        /// Network is down
        NETDOWN = 127,
        /// Network is unreachable
        NETUNREACH = 128,
        /// Network dropped connection because
        NETRESET = 129,
        /// Software caused connection abort
        CONNABORTED = 130,
        /// Connection reset by peer
        CONNRESET = 131,
        /// No buffer space available
        NOBUFS = 132,
        /// Socket is already connected
        ISCONN = 133,
        /// Socket is not connected
        NOTCONN = 134,
        /// Can't send after socket shutdown
        SHUTDOWN = 143,
        /// Too many references: can't splice
        TOOMANYREFS = 144,
        /// Connection timed out
        TIMEDOUT = 145,
        /// Connection refused
        CONNREFUSED = 146,
        /// Host is down
        HOSTDOWN = 147,
        /// No route to host
        HOSTUNREACH = 148,
        /// operation already in progress
        ALREADY = 149,
        /// operation now in progress
        INPROGRESS = 150,

        // SUN Network File System
        /// Stale NFS file handle
        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,
};
/// Command flags for fcntl(2).
pub const F = switch (native_os) {
    .linux => linux.F,
    .emscripten => emscripten.F,
    .wasi => struct {
        // Match `F_*` constants from lib/libc/include/wasm-wasi-musl/__header_fcntl.h
        pub const GETFD = 1;
        pub const SETFD = 2;
        pub const GETFL = 3;
        pub const SETFL = 4;
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        /// duplicate file descriptor
        pub const DUPFD = 0;
        /// get file descriptor flags
        pub const GETFD = 1;
        /// set file descriptor flags
        pub const SETFD = 2;
        /// get file status flags
        pub const GETFL = 3;
        /// set file status flags
        pub const SETFL = 4;
        /// get SIGIO/SIGURG proc/pgrp
        pub const GETOWN = 5;
        /// set SIGIO/SIGURG proc/pgrp
        pub const SETOWN = 6;
        /// get record locking information
        pub const GETLK = 7;
        /// set record locking information
        pub const SETLK = 8;
        /// F.SETLK; wait if blocked
        pub const SETLKW = 9;
        /// F.SETLK; wait if blocked, return on timeout
        pub const SETLKWTIMEOUT = 10;
        pub const FLUSH_DATA = 40;
        /// Used for regression test
        pub const CHKCLEAN = 41;
        /// Preallocate storage
        pub const PREALLOCATE = 42;
        /// Truncate a file without zeroing space
        pub const SETSIZE = 43;
        /// Issue an advisory read async with no copy to user
        pub const RDADVISE = 44;
        /// turn read ahead off/on for this fd
        pub const RDAHEAD = 45;
        /// turn data caching off/on for this fd
        pub const NOCACHE = 48;
        /// file offset to device offset
        pub const LOG2PHYS = 49;
        /// return the full path of the fd
        pub const GETPATH = 50;
        /// fsync + ask the drive to flush to the media
        pub const FULLFSYNC = 51;
        /// find which component (if any) is a package
        pub const PATHPKG_CHECK = 52;
        /// "freeze" all fs operations
        pub const FREEZE_FS = 53;
        /// "thaw" all fs operations
        pub const THAW_FS = 54;
        /// turn data caching off/on (globally) for this file
        pub const GLOBAL_NOCACHE = 55;
        /// add detached signatures
        pub const ADDSIGS = 59;
        /// add signature from same file (used by dyld for shared libs)
        pub const ADDFILESIGS = 61;
        /// used in conjunction with F.NOCACHE to indicate that DIRECT, synchronous writes
        /// should not be used (i.e. its ok to temporarily create cached pages)
        pub const NODIRECT = 62;
        /// Get the protection class of a file from the EA, returns int
        pub const GETPROTECTIONCLASS = 63;
        /// Set the protection class of a file for the EA, requires int
        pub const SETPROTECTIONCLASS = 64;
        /// file offset to device offset, extended
        pub const LOG2PHYS_EXT = 65;
        /// get record locking information, per-process
        pub const GETLKPID = 66;
        /// Mark the file as being the backing store for another filesystem
        pub const SETBACKINGSTORE = 70;
        /// return the full path of the FD, but error in specific mtmd circumstances
        pub const GETPATH_MTMINFO = 71;
        /// Returns the code directory, with associated hashes, to the caller
        pub const GETCODEDIR = 72;
        /// No SIGPIPE generated on EPIPE
        pub const SETNOSIGPIPE = 73;
        /// Status of SIGPIPE for this fd
        pub const GETNOSIGPIPE = 74;
        /// For some cases, we need to rewrap the key for AKS/MKB
        pub const TRANSCODEKEY = 75;
        /// file being written to a by single writer... if throttling enabled, writes
        /// may be broken into smaller chunks with throttling in between
        pub const SINGLE_WRITER = 76;
        /// Get the protection version number for this filesystem
        pub const GETPROTECTIONLEVEL = 77;
        /// Add detached code signatures (used by dyld for shared libs)
        pub const FINDSIGS = 78;
        /// Add signature from same file, only if it is signed by Apple (used by dyld for simulator)
        pub const ADDFILESIGS_FOR_DYLD_SIM = 83;
        /// fsync + issue barrier to drive
        pub const BARRIERFSYNC = 85;
        /// Add signature from same file, return end offset in structure on success
        pub const ADDFILESIGS_RETURN = 97;
        /// Check if Library Validation allows this Mach-O file to be mapped into the calling process
        pub const CHECK_LV = 98;
        /// Deallocate a range of the file
        pub const PUNCHHOLE = 99;
        /// Trim an active file
        pub const TRIM_ACTIVE_FILE = 100;
        /// mark the dup with FD_CLOEXEC
        pub const DUPFD_CLOEXEC = 67;
        /// shared or read lock
        pub const RDLCK = 1;
        /// unlock
        pub const UNLCK = 2;
        /// exclusive or write lock
        pub const WRLCK = 3;
    },
    .freebsd => struct {
        /// Duplicate file descriptor.
        pub const DUPFD = 0;
        /// Get file descriptor flags.
        pub const GETFD = 1;
        /// Set file descriptor flags.
        pub const SETFD = 2;
        /// Get file status flags.
        pub const GETFL = 3;
        /// Set file status flags.
        pub const SETFL = 4;

        /// Get SIGIO/SIGURG proc/pgrrp.
        pub const GETOWN = 5;
        /// Set SIGIO/SIGURG proc/pgrrp.
        pub const SETOWN = 6;

        /// Get record locking information.
        pub const GETLK = 11;
        /// Set record locking information.
        pub const SETLK = 12;
        /// Set record locking information and wait if blocked.
        pub const SETLKW = 13;

        /// Debugging support for remote locks.
        pub const SETLK_REMOTE = 14;
        /// Read ahead.
        pub const READAHEAD = 15;

        /// DUPFD with FD_CLOEXEC set.
        pub const DUPFD_CLOEXEC = 17;
        /// DUP2FD with FD_CLOEXEC set.
        pub const DUP2FD_CLOEXEC = 18;

        pub const ADD_SEALS = 19;
        pub const GET_SEALS = 20;
        /// Return `kinfo_file` for a file descriptor.
        pub const KINFO = 22;

        // Seals (ADD_SEALS, GET_SEALS)
        /// Prevent adding sealings.
        pub const SEAL_SEAL = 0x0001;
        /// May not shrink
        pub const SEAL_SHRINK = 0x0002;
        /// May not grow.
        pub const SEAL_GROW = 0x0004;
        /// May not write.
        pub const SEAL_WRITE = 0x0008;

        // Record locking flags (GETLK, SETLK, SETLKW).
        /// Shared or read lock.
        pub const RDLCK = 1;
        /// Unlock.
        pub const UNLCK = 2;
        /// Exclusive or write lock.
        pub const WRLCK = 3;
        /// Purge locks for a given system ID.
        pub const UNLCKSYS = 4;
        /// Cancel an async lock request.
        pub const CANCEL = 5;

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

        pub const GETOWNER_UIDS = 17;
    },
    .illumos => struct {
        /// Unlock a previously locked region
        pub const ULOCK = 0;
        /// Lock a region for exclusive use
        pub const LOCK = 1;
        /// Test and lock a region for exclusive use
        pub const TLOCK = 2;
        /// Test a region for other processes locks
        pub const TEST = 3;

        /// Duplicate fildes
        pub const DUPFD = 0;
        /// Get fildes flags
        pub const GETFD = 1;
        /// Set fildes flags
        pub const SETFD = 2;
        /// Get file flags
        pub const GETFL = 3;
        /// Get file flags including open-only flags
        pub const GETXFL = 45;
        /// Set file flags
        pub const SETFL = 4;

        /// Unused
        pub const CHKFL = 8;
        /// Duplicate fildes at third arg
        pub const DUP2FD = 9;
        /// Like DUP2FD with O_CLOEXEC set EINVAL is fildes matches arg1
        pub const DUP2FD_CLOEXEC = 36;
        /// Like DUPFD with O_CLOEXEC set
        pub const DUPFD_CLOEXEC = 37;

        /// Is the file desc. a stream ?
        pub const ISSTREAM = 13;
        /// Turn on private access to file
        pub const PRIV = 15;
        /// Turn off private access to file
        pub const NPRIV = 16;
        /// UFS quota call
        pub const QUOTACTL = 17;
        /// Get number of BLKSIZE blocks allocated
        pub const BLOCKS = 18;
        /// Get optimal I/O block size
        pub const BLKSIZE = 19;
        /// Get owner (socket emulation)
        pub const GETOWN = 23;
        /// Set owner (socket emulation)
        pub const SETOWN = 24;
        /// Object reuse revoke access to file desc.
        pub const REVOKE = 25;
        /// Does vp have NFS locks private to lock manager
        pub const HASREMOTELOCKS = 26;

        /// Set file lock
        pub const SETLK = 6;
        /// Set file lock and wait
        pub const SETLKW = 7;
        /// Allocate file space
        pub const ALLOCSP = 10;
        /// Free file space
        pub const FREESP = 11;
        /// Get file lock
        pub const GETLK = 14;
        /// Get file lock owned by file
        pub const OFD_GETLK = 47;
        /// Set file lock owned by file
        pub const OFD_SETLK = 48;
        /// Set file lock owned by file and wait
        pub const OFD_SETLKW = 49;
        /// Set a file share reservation
        pub const SHARE = 40;
        /// Remove a file share reservation
        pub const UNSHARE = 41;
        /// Create Poison FD
        pub const BADFD = 46;

        /// Read lock
        pub const RDLCK = 1;
        /// Write lock
        pub const WRLCK = 2;
        /// Remove lock(s)
        pub const UNLCK = 3;
        /// remove remote locks for a given system
        pub const UNLKSYS = 4;

        // f_access values
        /// Read-only share access
        pub const RDACC = 0x1;
        /// Write-only share access
        pub const WRACC = 0x2;
        /// Read-Write share access
        pub const RWACC = 0x3;

        // f_deny values
        /// Don't deny others access
        pub const NODNY = 0x0;
        /// Deny others read share access
        pub const RDDNY = 0x1;
        /// Deny others write share access
        pub const WRDNY = 0x2;
        /// Deny others read or write share access
        pub const RWDNY = 0x3;
        /// private flag: Deny delete share access
        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,
};

/// Test for existence of file.
pub const F_OK = switch (native_os) {
    .linux => linux.F_OK,
    .emscripten => emscripten.F_OK,
    else => 0,
};
/// Test for execute or search permission.
pub const X_OK = switch (native_os) {
    .linux => linux.X_OK,
    .emscripten => emscripten.X_OK,
    else => 1,
};
/// Test for write permission.
pub const W_OK = switch (native_os) {
    .linux => linux.W_OK,
    .emscripten => emscripten.W_OK,
    else => 2,
};
/// Test for read permission.
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 {
        /// Starting offset.
        start: off_t,
        /// Number of consecutive bytes to be locked.
        /// A value of 0 means to the end of the file.
        len: off_t,
        /// Lock owner.
        pid: pid_t,
        /// Lock type.
        type: i16,
        /// Type of the start member.
        whence: i16,
        /// Remote system id or zero for local.
        sysid: i32,
    },
    .illumos => extern struct {
        type: c_short,
        whence: c_short,
        start: off_t,
        // len == 0 means until end of file.
        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 {
        /// struct: process entries
        pub const PROC = 14;
        /// path to executable
        pub const PROC_PATHNAME = 12;
        /// file descriptors for process
        pub const PROC_FILEDESC = 33;
        pub const IOV_MAX = 35;
    },
    .netbsd => struct {
        /// struct: process argv/env
        pub const PROC_ARGS = 48;
        /// path to executable
        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 {
        /// no further special treatment
        pub const NORMAL = 0;
        /// expect random page references
        pub const RANDOM = 1;
        /// expect sequential page references
        pub const SEQUENTIAL = 2;
        /// will need these pages
        pub const WILLNEED = 3;
        /// don't need these pages
        pub const DONTNEED = 4;
        /// contents can be freed
        pub const FREE = 5;
        /// default access
        pub const ACCESS_DEFAULT = 6;
        /// next LWP to access heavily
        pub const ACCESS_LWP = 7;
        /// many processes to access heavily
        pub const ACCESS_MANY = 8;
        /// contents will be purged
        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;
        /// invalidate, leave mapped
        pub const KILLPAGES = 0x4;
        /// deactivate, leave mapped
        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's headers make this 256, to contain room for the terminating null
    // character, but POSIX definition says that NAME_MAX does not include the
    // terminating null.
    // 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 {
        /// any readable data available.
        pub const IN = 0x0001;
        /// OOB/Urgent readable data.
        pub const PRI = 0x0002;
        /// file descriptor is writeable.
        pub const OUT = 0x0004;
        /// non-OOB/URG data available.
        pub const RDNORM = 0x0040;
        /// no write type differentiation.
        pub const WRNORM = OUT;
        /// OOB/Urgent readable data.
        pub const RDBAND = 0x0080;
        /// OOB/Urgent data can be written.
        pub const WRBAND = 0x0100;
        /// like IN, except ignore EOF.
        pub const INIGNEOF = 0x2000;
        /// some poll error occurred.
        pub const ERR = 0x0008;
        /// file descriptor was "hung up".
        pub const HUP = 0x0010;
        /// requested events "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;
        /// Read-side hangup.
        pub const RDHUP = 0x4000;

        /// Non-testable events (may not be specified in events).
        pub const ERR = 0x0008;
        pub const HUP = 0x0010;
        pub const NVAL = 0x0020;

        /// Events to control `/dev/poll` (not specified in revents)
        pub const REMOVE = 0x0800;
        pub const ONESHOT = 0x1000;
        pub const ET = 0x2000;
    },
    .dragonfly, .netbsd => struct {
        /// Testable events (may be specified in events field).
        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;

        /// Non-testable events (may not be specified in events field).
        pub const ERR = 0x0008;
        pub const HUP = 0x0010;
        pub const NVAL = 0x0020;
    },
    .haiku => struct {
        /// any readable data available
        pub const IN = 0x0001;
        /// file descriptor is writeable
        pub const OUT = 0x0002;
        pub const RDNORM = IN;
        pub const WRNORM = OUT;
        /// priority readable data
        pub const RDBAND = 0x0008;
        /// priority data can be written
        pub const WRBAND = 0x0010;
        /// high priority readable data
        pub const PRI = 0x0020;

        /// errors pending
        pub const ERR = 0x0004;
        /// disconnected
        pub const HUP = 0x0080;
        /// invalid file descriptor
        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,
};

/// Basic memory protection flags
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 {
        /// No limit
        pub const INFINITY: rlim_t = (1 << 63) - 1;

        pub const SAVED_MAX = INFINITY;
        pub const SAVED_CUR = INFINITY;
    },
    .illumos => struct {
        /// No limit
        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 {
        // Match `S_*` constants from lib/libc/include/wasm-wasi-musl/__mode_t.h
        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 Event Port
        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 {
        /// take signal on signal stack
        pub const ONSTACK = 0x0001;
        /// restart system on signal return
        pub const RESTART = 0x0002;
        /// reset to SIG.DFL when taking signal
        pub const RESETHAND = 0x0004;
        /// do not generate SIG.CHLD on child stop
        pub const NOCLDSTOP = 0x0008;
        /// don't mask the signal we're delivering
        pub const NODEFER = 0x0010;
        /// don't keep zombies around
        pub const NOCLDWAIT = 0x0020;
        /// signal handler with SIGINFO args
        pub const SIGINFO = 0x0040;
        /// do not bounce off kernel's sigtramp
        pub const USERTRAMP = 0x0100;
        /// signal handler with SIGINFO args with 64bit regs information
        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;
    },
};

/// Signal types
pub const SIG = switch (native_os) {
    .linux => linux.SIG,
    .emscripten => emscripten.SIG,
    .windows => enum(u32) {
        /// interrupt
        INT = 2,
        /// illegal instruction - invalid function image
        ILL = 4,
        /// floating point exception
        FPE = 8,
        /// segment violation
        SEGV = 11,
        /// Software termination signal from kill
        TERM = 15,
        /// Ctrl-Break sequence
        BREAK = 21,
        /// abnormal termination triggered by abort call
        ABRT = 22,
        /// SIGABRT compatible with other platforms, same as SIGABRT
        ABRT_COMPAT = 6,
        _,

        // Signal action codes
        /// default signal action
        pub const DFL = 0;
        /// ignore signal
        pub const IGN = 1;
        /// return current value
        pub const GET = 2;
        /// signal gets error
        pub const SGE = 3;
        /// acknowledge
        pub const ACK = 4;
        /// Signal error value (returned by signal call on error)
        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);

        /// block specified signal set
        pub const BLOCK = 1;
        /// unblock specified signal set
        pub const UNBLOCK = 2;
        /// set specified signal set
        pub const SETMASK = 3;

        pub const IOT: SIG = .ABRT;
        pub const POLL: SIG = .EMT;

        /// hangup
        HUP = 1,
        /// interrupt
        INT = 2,
        /// quit
        QUIT = 3,
        /// illegal instruction (not reset when caught)
        ILL = 4,
        /// trace trap (not reset when caught)
        TRAP = 5,
        /// abort()
        ABRT = 6,
        /// EMT instruction
        EMT = 7,
        /// floating point exception
        FPE = 8,
        /// kill (cannot be caught or ignored)
        KILL = 9,
        /// bus error
        BUS = 10,
        /// segmentation violation
        SEGV = 11,
        /// bad argument to system call
        SYS = 12,
        /// write on a pipe with no one to read it
        PIPE = 13,
        /// alarm clock
        ALRM = 14,
        /// software termination signal from kill
        TERM = 15,
        /// urgent condition on IO channel
        URG = 16,
        /// sendable stop signal not from tty
        STOP = 17,
        /// stop signal from tty
        TSTP = 18,
        /// continue a stopped process
        CONT = 19,
        /// to parent on child stop or exit
        CHLD = 20,
        /// to readers pgrp upon background tty read
        TTIN = 21,
        /// like TTIN for output if (tp->t_local&LTOSTOP)
        TTOU = 22,
        /// input/output possible signal
        IO = 23,
        /// exceeded CPU time limit
        XCPU = 24,
        /// exceeded file size limit
        XFSZ = 25,
        /// virtual time alarm
        VTALRM = 26,
        /// profiling time alarm
        PROF = 27,
        /// window size changes
        WINCH = 28,
        /// information request
        INFO = 29,
        /// user defined signal 1
        USR1 = 30,
        /// user defined signal 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,
};

/// A common format for the Sigaction struct across a variety of Linux flavors.
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 library will fill this in
};

/// Renamed from `sigaction` to `Sigaction` to avoid conflict with function name.
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;

        /// signal handler
        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },
        /// see signal options
        flags: c_uint,
        /// signal mask to apply
        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;

        /// signal options
        flags: c_uint,
        /// signal handler
        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },
        /// signal mask to apply
        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;

        /// signal handler
        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },

        /// signal mask to apply
        mask: sigset_t,

        /// see signal options
        flags: i32,

        /// will be passed to the signal handler, BeOS extension
        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;

        /// signal handler
        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },
        /// signal mask to apply
        mask: sigset_t,
        /// signal options
        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);
        // Softcarrier ioctls
        pub const IOCGSOFTCAR = tioc('T', 105);
        pub const IOCSSOFTCAR = tioc('T', 106);
        // termios ioctls
        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 ioctls
        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);
        /// bis local mode bits
        pub const IOCLBIS = tioc('t', 127);
        /// bic local mode bits
        pub const IOCLBIC = tioc('t', 126);
        /// set entire local mode word
        pub const IOCLSET = tioc('t', 125);
        /// get local modes
        pub const IOCLGET = tioc('t', 124);
        /// set break bit
        pub const IOCSBRK = tioc('t', 123);
        /// clear break bit
        pub const IOCCBRK = tioc('t', 122);
        /// set data terminal ready
        pub const IOCSDTR = tioc('t', 121);
        /// clear data terminal ready
        pub const IOCCDTR = tioc('t', 120);
        /// set local special chars
        pub const IOCSLTC = tioc('t', 117);
        /// get local special chars
        pub const IOCGLTC = tioc('t', 116);
        /// driver output queue size
        pub const IOCOUTQ = tioc('t', 115);
        /// void tty association
        pub const IOCNOTTY = tioc('t', 113);
        /// get a ctty
        pub const IOCSCTTY = tioc('t', 132);
        /// stop output, like ^S
        pub const IOCSTOP = tioc('t', 111);
        /// start output, like ^Q
        pub const IOCSTART = tioc('t', 110);
        /// get pgrp of tty
        pub const IOCGPGRP = tioc('t', 20);
        /// set pgrp of tty
        pub const IOCSPGRP = tioc('t', 21);
        /// get session id on ctty
        pub const IOCGSID = tioc('t', 22);
        /// simulate terminal input
        pub const IOCSTI = tioc('t', 23);
        /// set all modem bits
        pub const IOCMSET = tioc('t', 26);
        /// bis modem bits
        pub const IOCMBIS = tioc('t', 27);
        /// bic modem bits
        pub const IOCMBIC = tioc('t', 28);
        /// get all modem bits
        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] no hang in wait/no child to reap
        pub const NOHANG = 0x00000001;
        /// [XSI] notify on stop, untraced child
        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 {
        /// Module relocation base.
        addr: std.elf.Addr,
        /// Module name.
        name: ?[*:0]const u8,
        /// Pointer to module's phdr.
        phdr: [*]std.elf.ElfN.Phdr,
        /// Number of entries in phdr.
        phnum: u16,
        /// Total number of loads.
        adds: u64,
        /// Total number of unloads.
        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,
        /// Incremented when a new object is mapped into the process.
        adds: u64,
        /// Incremented when an object is unmapped from the process.
        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 {
        // Not actually in a union, but the stdlib expects one for 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, // non-zero to linger on close
        linger: i32, // time to linger in seconds
    },
    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,
};

/// There are several instances of struct fields that POSIX defines as either int or socklen_t, but
/// on Linux are size_t. glibc ignores POSIX, and uses the Linux kernel's definitions. musl on the
/// other hand aims to be POSIX-ly correct, and defines those fields in a manner aligning with
/// POSIX.
///
/// musl works around this incompatibility between the 64-bit Linux ABI and the POSIX specification
/// by adding padding fields on either side depending on host endianness:
///
///     #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
///
/// To emulate this quirk of musl, the MuslOnlyPadding field is used in these structs
///
///     pad0: MuslOnlyPadding(.big) = 0,
///     msg_controllen: socklen_t,
///     pad1: MuslOnlyPadding(.little) = 0,
///
/// On 32-bit and non-musl systems, these fields will be zero sized, and ignored.
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,
};

// Alignment used by POSIX specified CMSG_* Macros
// 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 {
        /// Soft limit
        cur: rlim_t,
        /// Hard limit
        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 {
        // Signal number.
        signo: SIG,
        // Errno association.
        errno: c_int,
        /// Signal code.
        ///
        /// Cause of signal, one of the SI_ macros or signal-specific values, i.e.
        /// one of the FPE_... values for SIGFPE.
        /// This value is equivalent to the second argument to an old-style FreeBSD
        /// signal handler.
        code: c_int,
        /// Sending process.
        pid: pid_t,
        /// Sender's ruid.
        uid: uid_t,
        /// Exit value.
        status: c_int,
        /// Faulting instruction.
        addr: *allowzero anyopaque,
        /// Signal value.
        value: sigval,
        reason: extern union {
            fault: extern struct {
                /// Machine specific trap code.
                trapno: c_int,
            },
            timer: extern struct {
                timerid: c_int,
                overrun: c_int,
            },
            mesgq: extern struct {
                mqd: c_int,
            },
            poll: extern struct {
                /// Band event for SIGPOLL. UNUSED.
                band: c_long,
            },
            spare: extern struct {
                spare1: c_long,
                spare2: [7]c_int,
            },
        },
    },
    .illumos => extern struct {
        signo: SIG,
        code: c_int,
        errno: c_int,
        // 64bit architectures insert 4bytes of padding here, this is done by
        // correctly aligning the reason field
        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 not currently available for 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 and musl present a 1024-bit sigset_t, while kernel's is 128-bit or less.
    .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 domain socket
        pub const un = extern struct {
            len: u8 = @sizeOf(un),
            family: sa_family_t = AF.UNIX,
            path: [104]u8,
        };
    },
    .freebsd => extern struct {
        /// total length
        len: u8,
        /// address family
        family: sa_family_t,
        /// actually longer; address value
        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 {
        /// address family
        family: sa_family_t,

        /// actually longer; address value
        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,
        };

        /// Definitions for UNIX IPC domain.
        pub const un = extern struct {
            family: sa_family_t = AF.UNIX,
            path: [108]u8,
        };
    },
    .netbsd => extern struct {
        /// total length
        len: u8,
        /// address family
        family: sa_family_t,
        /// actually longer; address value
        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,
        };

        /// Definitions for UNIX IPC domain.
        pub const un = extern struct {
            /// total sockaddr length
            len: u8 = @sizeOf(un),

            family: sa_family_t = AF.LOCAL,

            /// path name
            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 {
        /// total length
        len: u8,
        /// address family
        family: sa_family_t,
        /// actually longer; address value
        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 {
        /// total length
        len: u8,
        /// address family
        family: sa_family_t,
        /// actually longer; address value
        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,
        };

        /// Definitions for UNIX IPC domain.
        pub const un = extern struct {
            /// total sockaddr length
            len: u8 = @sizeOf(un),

            family: sa_family_t = AF.LOCAL,

            /// path name
            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;

        /// Not actually supported by Darwin, but Zig supplies a shim.
        /// This numerical value is not ABI-stable. It need only not conflict
        /// with any other `SOCK` bits.
        pub const CLOEXEC = 1 << 15;
        /// Not actually supported by Darwin, but Zig supplies a shim.
        /// This numerical value is not ABI-stable. It need only not conflict
        /// with any other `SOCK` bits.
        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 {
        /// Datagram.
        pub const DGRAM = 1;
        /// STREAM.
        pub const STREAM = 2;
        /// Raw-protocol interface.
        pub const RAW = 4;
        /// Reliably-delivered message.
        pub const RDM = 5;
        /// Sequenced packed stream.
        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 {
        /// dummy for IP
        pub const IP = 0;
        /// control message protocol
        pub const ICMP = 1;
        /// tcp
        pub const TCP = 6;
        /// user datagram protocol
        pub const UDP = 17;
        /// IP6 header
        pub const IPV6 = 41;
        /// raw IP packet
        pub const RAW = 255;
        /// IP6 hop-by-hop options
        pub const HOPOPTS = 0;
        /// group mgmt protocol
        pub const IGMP = 2;
        /// gateway^2 (deprecated)
        pub const GGP = 3;
        /// IPv4 encapsulation
        pub const IPV4 = 4;
        /// for compatibility
        pub const IPIP = IPV4;
        /// Stream protocol II
        pub const ST = 7;
        /// exterior gateway protocol
        pub const EGP = 8;
        /// private interior gateway
        pub const PIGP = 9;
        /// BBN RCC Monitoring
        pub const RCCMON = 10;
        /// network voice protocol
        pub const NVPII = 11;
        /// pup
        pub const PUP = 12;
        /// Argus
        pub const ARGUS = 13;
        /// EMCON
        pub const EMCON = 14;
        /// Cross Net Debugger
        pub const XNET = 15;
        /// Chaos
        pub const CHAOS = 16;
        /// Multiplexing
        pub const MUX = 18;
        /// DCN Measurement Subsystems
        pub const MEAS = 19;
        /// Host Monitoring
        pub const HMP = 20;
        /// Packet Radio Measurement
        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;
        /// Reliable Data
        pub const RDP = 27;
        /// Reliable Transaction
        pub const IRTP = 28;
        /// tp-4 w/ class negotiation
        pub const TP = 29;
        /// Bulk Data Transfer
        pub const BLT = 30;
        /// Network Services
        pub const NSP = 31;
        /// Merit Internodal
        pub const INP = 32;
        /// Datagram Congestion Control Protocol
        pub const DCCP = 33;
        /// Third Party Connect
        pub const @"3PC" = 34;
        /// InterDomain Policy Routing
        pub const IDPR = 35;
        /// XTP
        pub const XTP = 36;
        /// Datagram Delivery
        pub const DDP = 37;
        /// Control Message Transport
        pub const CMTP = 38;
        /// TP++ Transport
        pub const TPXX = 39;
        /// IL transport protocol
        pub const IL = 40;
        /// Source Demand Routing
        pub const SDRP = 42;
        /// IP6 routing header
        pub const ROUTING = 43;
        /// IP6 fragmentation header
        pub const FRAGMENT = 44;
        /// InterDomain Routing
        pub const IDRP = 45;
        /// resource reservation
        pub const RSVP = 46;
        /// General Routing Encap.
        pub const GRE = 47;
        /// Mobile Host Routing
        pub const MHRP = 48;
        /// BHA
        pub const BHA = 49;
        /// IP6 Encap Sec. Payload
        pub const ESP = 50;
        /// IP6 Auth Header
        pub const AH = 51;
        /// Integ. Net Layer Security
        pub const INLSP = 52;
        /// IP with encryption
        pub const SWIPE = 53;
        /// Next Hop Resolution
        pub const NHRP = 54;
        /// IP Mobility
        pub const MOBILE = 55;
        /// Transport Layer Security
        pub const TLSP = 56;
        /// SKIP
        pub const SKIP = 57;
        /// ICMP6
        pub const ICMPV6 = 58;
        /// IP6 no next header
        pub const NONE = 59;
        /// IP6 destination option
        pub const DSTOPTS = 60;
        /// any host internal protocol
        pub const AHIP = 61;
        /// CFTP
        pub const CFTP = 62;
        /// "hello" routing protocol
        pub const HELLO = 63;
        /// SATNET/Backroom EXPAK
        pub const SATEXPAK = 64;
        /// Kryptolan
        pub const KRYPTOLAN = 65;
        /// Remote Virtual Disk
        pub const RVD = 66;
        /// Pluribus Packet Core
        pub const IPPC = 67;
        /// Any distributed FS
        pub const ADFS = 68;
        /// Satnet Monitoring
        pub const SATMON = 69;
        /// VISA Protocol
        pub const VISA = 70;
        /// Packet Core Utility
        pub const IPCV = 71;
        /// Comp. Prot. Net. Executive
        pub const CPNX = 72;
        /// Comp. Prot. HeartBeat
        pub const CPHB = 73;
        /// Wang Span Network
        pub const WSN = 74;
        /// Packet Video Protocol
        pub const PVP = 75;
        /// BackRoom SATNET Monitoring
        pub const BRSATMON = 76;
        /// Sun net disk proto (temp.)
        pub const ND = 77;
        /// WIDEBAND Monitoring
        pub const WBMON = 78;
        /// WIDEBAND EXPAK
        pub const WBEXPAK = 79;
        /// ISO cnlp
        pub const EON = 80;
        /// VMTP
        pub const VMTP = 81;
        /// Secure VMTP
        pub const SVMTP = 82;
        /// Banyon VINES
        pub const VINES = 83;
        /// TTP
        pub const TTP = 84;
        /// NSFNET-IGP
        pub const IGP = 85;
        /// dissimilar gateway prot.
        pub const DGP = 86;
        /// TCF
        pub const TCF = 87;
        /// Cisco/GXS IGRP
        pub const IGRP = 88;
        /// OSPFIGP
        pub const OSPFIGP = 89;
        /// Strite RPC protocol
        pub const SRPC = 90;
        /// Locus Address Resoloution
        pub const LARP = 91;
        /// Multicast Transport
        pub const MTP = 92;
        /// AX.25 Frames
        pub const AX25 = 93;
        /// IP encapsulated in IP
        pub const IPEIP = 94;
        /// Mobile Int.ing control
        pub const MICP = 95;
        /// Semaphore Comm. security
        pub const SCCSP = 96;
        /// Ethernet IP encapsulation
        pub const ETHERIP = 97;
        /// encapsulation header
        pub const ENCAP = 98;
        /// any private encr. scheme
        pub const APES = 99;
        /// GMTP
        pub const GMTP = 100;
        /// payload compression (IPComp)
        pub const IPCOMP = 108;
        /// SCTP
        pub const SCTP = 132;
        /// IPv6 Mobility Header
        pub const MH = 135;
        /// UDP-Lite
        pub const UDPLITE = 136;
        /// IP6 Host Identity Protocol
        pub const HIP = 139;
        /// IP6 Shim6 Protocol
        pub const SHIM6 = 140;
        /// Protocol Independent Mcast
        pub const PIM = 103;
        /// CARP
        pub const CARP = 112;
        /// PGM
        pub const PGM = 113;
        /// MPLS-in-IP
        pub const MPLS = 137;
        /// PFSYNC
        pub const PFSYNC = 240;
        /// Reserved
        pub const RESERVED_253 = 253;
        /// Reserved
        pub const RESERVED_254 = 254;
    },
    .illumos => struct {
        /// dummy for IP
        pub const IP = 0;
        /// Hop by hop header for IPv6
        pub const HOPOPTS = 0;
        /// control message protocol
        pub const ICMP = 1;
        /// group control protocol
        pub const IGMP = 2;
        /// gateway^2 (deprecated)
        pub const GGP = 3;
        /// IP in IP encapsulation
        pub const ENCAP = 4;
        /// tcp
        pub const TCP = 6;
        /// exterior gateway protocol
        pub const EGP = 8;
        /// pup
        pub const PUP = 12;
        /// user datagram protocol
        pub const UDP = 17;
        /// xns idp
        pub const IDP = 22;
        /// IPv6 encapsulated in IP
        pub const IPV6 = 41;
        /// Routing header for IPv6
        pub const ROUTING = 43;
        /// Fragment header for IPv6
        pub const FRAGMENT = 44;
        /// rsvp
        pub const RSVP = 46;
        /// IPsec Encap. Sec. Payload
        pub const ESP = 50;
        /// IPsec Authentication Hdr.
        pub const AH = 51;
        /// ICMP for IPv6
        pub const ICMPV6 = 58;
        /// No next header for IPv6
        pub const NONE = 59;
        /// Destination options
        pub const DSTOPTS = 60;
        /// "hello" routing protocol
        pub const HELLO = 63;
        /// UNOFFICIAL net disk proto
        pub const ND = 77;
        /// ISO clnp
        pub const EON = 80;
        /// OSPF
        pub const OSPF = 89;
        /// PIM routing protocol
        pub const PIM = 103;
        /// Stream Control
        pub const SCTP = 132;
        /// raw IP packet
        pub const RAW = 255;
        /// Sockets Direct Protocol
        pub const PROTO_SDP = 257;
    },
    .netbsd => struct {
        /// dummy for IP
        pub const IP = 0;
        /// IP6 hop-by-hop options
        pub const HOPOPTS = 0;
        /// control message protocol
        pub const ICMP = 1;
        /// group mgmt protocol
        pub const IGMP = 2;
        /// gateway^2 (deprecated)
        pub const GGP = 3;
        /// IP header
        pub const IPV4 = 4;
        /// IP inside IP
        pub const IPIP = 4;
        /// tcp
        pub const TCP = 6;
        /// exterior gateway protocol
        pub const EGP = 8;
        /// pup
        pub const PUP = 12;
        /// user datagram protocol
        pub const UDP = 17;
        /// xns idp
        pub const IDP = 22;
        /// tp-4 w/ class negotiation
        pub const TP = 29;
        /// DCCP
        pub const DCCP = 33;
        /// IP6 header
        pub const IPV6 = 41;
        /// IP6 routing header
        pub const ROUTING = 43;
        /// IP6 fragmentation header
        pub const FRAGMENT = 44;
        /// resource reservation
        pub const RSVP = 46;
        /// GRE encaps RFC 1701
        pub const GRE = 47;
        /// encap. security payload
        pub const ESP = 50;
        /// authentication header
        pub const AH = 51;
        /// IP Mobility RFC 2004
        pub const MOBILE = 55;
        /// IPv6 ICMP
        pub const IPV6_ICMP = 58;
        /// ICMP6
        pub const ICMPV6 = 58;
        /// IP6 no next header
        pub const NONE = 59;
        /// IP6 destination option
        pub const DSTOPTS = 60;
        /// ISO cnlp
        pub const EON = 80;
        /// Ethernet-in-IP
        pub const ETHERIP = 97;
        /// encapsulation header
        pub const ENCAP = 98;
        /// Protocol indep. multicast
        pub const PIM = 103;
        /// IP Payload Comp. Protocol
        pub const IPCOMP = 108;
        /// VRRP RFC 2338
        pub const VRRP = 112;
        /// Common Address Resolution Protocol
        pub const CARP = 112;
        /// L2TPv3
        pub const L2TP = 115;
        /// SCTP
        pub const SCTP = 132;
        /// PFSYNC
        pub const PFSYNC = 240;
        /// raw IP packet
        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 {
        /// dummy for IP
        pub const IP = 0;
        /// IP6 hop-by-hop options
        pub const HOPOPTS = IPPROTO.IP;
        /// control message protocol
        pub const ICMP = 1;
        /// group mgmt protocol
        pub const IGMP = 2;
        /// gateway^2 (deprecated)
        pub const GGP = 3;
        /// IP header
        pub const IPV4 = IPIP;
        /// IP inside IP
        pub const IPIP = 4;
        /// tcp
        pub const TCP = 6;
        /// exterior gateway protocol
        pub const EGP = 8;
        /// pup
        pub const PUP = 12;
        /// user datagram protocol
        pub const UDP = 17;
        /// xns idp
        pub const IDP = 22;
        /// tp-4 w/ class negotiation
        pub const TP = 29;
        /// IP6 header
        pub const IPV6 = 41;
        /// IP6 routing header
        pub const ROUTING = 43;
        /// IP6 fragmentation header
        pub const FRAGMENT = 44;
        /// resource reservation
        pub const RSVP = 46;
        /// GRE encaps RFC 1701
        pub const GRE = 47;
        /// encap. security payload
        pub const ESP = 50;
        /// authentication header
        pub const AH = 51;
        /// IP Mobility RFC 2004
        pub const MOBILE = 55;
        /// IPv6 ICMP
        pub const IPV6_ICMP = 58;
        /// ICMP6
        pub const ICMPV6 = 58;
        /// IP6 no next header
        pub const NONE = 59;
        /// IP6 destination option
        pub const DSTOPTS = 60;
        /// ISO cnlp
        pub const EON = 80;
        /// Ethernet-in-IP
        pub const ETHERIP = 97;
        /// encapsulation header
        pub const ENCAP = 98;
        /// Protocol indep. multicast
        pub const PIM = 103;
        /// IP Payload Comp. Protocol
        pub const IPCOMP = 108;
        /// VRRP RFC 2338
        pub const VRRP = 112;
        /// Common Address Resolution Protocol
        pub const CARP = 112;
        /// PFSYNC
        pub const PFSYNC = 240;
        /// raw IP packet
        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 {
        /// Signal stack base.
        sp: *anyopaque,
        /// Signal stack length.
        size: usize,
        /// SS_DISABLE and/or 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 {
        /// seconds
        sec: time_t,
        /// microseconds
        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 {
        /// File number of entry.
        fileno: ino_t,
        /// Directory offset of entry.
        off: off_t,
        /// Length of this record.
        reclen: u16,
        /// File type, one of DT_.
        type: u8,
        pad0: u8 = 0,
        /// Length of the name member.
        namlen: u16,
        pad1: u16 = 0,
        /// Name of entry.
        name: [255:0]u8,
    },
    .illumos => extern struct {
        /// Inode number of entry.
        ino: ino_t,
        /// Offset of this entry on disk.
        off: off_t,
        /// Length of this record.
        reclen: u16,
        /// File name.
        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) {
    /// address family for hostname not supported
    ADDRFAMILY = 1,
    /// temporary failure in name resolution
    AGAIN = 2,
    /// invalid value for ai_flags
    BADFLAGS = 3,
    /// non-recoverable failure in name resolution
    FAIL = 4,
    /// ai_family not supported
    FAMILY = 5,
    /// memory allocation failure
    MEMORY = 6,
    /// no address associated with hostname
    NODATA = 7,
    /// hostname nor servname provided, or not known
    NONAME = 8,
    /// servname not supported for ai_socktype
    SERVICE = 9,
    /// ai_socktype not supported
    SOCKTYPE = 10,
    /// system error returned in errno
    SYSTEM = 11,
    /// invalid value for hints
    BADHINTS = 12,
    /// resolved protocol is unknown
    PROTOCOL = 13,
    /// argument buffer overflow
    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) {
        /// address family for hostname not supported
        ADDRFAMILY = 1,
        /// temporary failure in name resolution
        AGAIN = 2,
        /// invalid value for ai_flags
        BADFLAGS = 3,
        /// non-recoverable failure in name resolution
        FAIL = 4,
        /// ai_family not supported
        FAMILY = 5,
        /// memory allocation failure
        MEMORY = 6,
        /// no address associated with hostname
        NODATA = 7,
        /// hostname nor servname provided, or not known
        NONAME = 8,
        /// servname not supported for ai_socktype
        SERVICE = 9,
        /// ai_socktype not supported
        SOCKTYPE = 10,
        /// system error returned in errno
        SYSTEM = 11,
        /// invalid value for hints
        BADHINTS = 12,
        /// resolved protocol is unknown
        PROTOCOL = 13,
        /// argument buffer overflow
        OVERFLOW = 14,
        _,
    },
    .illumos => enum(c_int) {
        /// address family for hostname not supported
        ADDRFAMILY = 1,
        /// name could not be resolved at this time
        AGAIN = 2,
        /// flags parameter had an invalid value
        BADFLAGS = 3,
        /// non-recoverable failure in name resolution
        FAIL = 4,
        /// address family not recognized
        FAMILY = 5,
        /// memory allocation failure
        MEMORY = 6,
        /// no address associated with hostname
        NODATA = 7,
        /// name does not resolve
        NONAME = 8,
        /// service not recognized for socket type
        SERVICE = 9,
        /// intended socket type was not recognized
        SOCKTYPE = 10,
        /// system error returned in errno
        SYSTEM = 11,
        /// argument buffer overflow
        OVERFLOW = 12,
        /// resolved protocol is unknown
        PROTOCOL = 13,

        _,
    },
    .openbsd => enum(c_int) {
        /// address family for hostname not supported
        ADDRFAMILY = -9,
        /// name could not be resolved at this time
        AGAIN = -3,
        /// flags parameter had an invalid value
        BADFLAGS = -1,
        /// non-recoverable failure in name resolution
        FAIL = -4,
        /// address family not recognized
        FAMILY = -6,
        /// memory allocation failure
        MEMORY = -10,
        /// no address associated with hostname
        NODATA = -5,
        /// name does not resolve
        NONAME = -2,
        /// service not recognized for socket type
        SERVICE = -8,
        /// intended socket type was not recognized
        SOCKTYPE = -7,
        /// system error returned in errno
        SYSTEM = -11,
        /// invalid value for hints
        BADHINTS = -12,
        /// resolved protocol is unknown
        PROTOCOL = -13,
        /// argument buffer overflow
        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 {
        // Match wasi-libc's `struct stat` in lib/libc/include/wasm-wasi-musl/__struct_stat.h
        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,
};

/// Renamed from `kevent` to `Kevent` to avoid conflict with function name.
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,

        // sys/types.h on macos uses #pragma pack(4) so these checks are
        // to make sure the struct is laid out the same. These values were
        // produced from C code using the offsetof macro.
        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 {
        /// Identifier for this event.
        ident: usize,
        /// Filter for event.
        filter: i16,
        /// Action flags for kqueue.
        flags: u16,
        /// Filter flag value.
        fflags: u32,
        /// Filter data value.
        data: i64,
        /// Opaque user data identifier.
        udata: usize,
        /// Future extensions.
        _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,
        /// Event source.
        source: u16,
        __pad: u16,
        /// Source-specific object.
        object: ?*anyopaque,
        /// User cookie.
        cookie: ?*anyopaque,
    },
    else => void,
};

pub const AT = switch (native_os) {
    .linux => linux.AT,
    .windows => struct {
        /// Remove directory instead of unlinking file
        pub const REMOVEDIR = 0x200;
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const FDCWD = -2;
        /// Use effective ids in access check
        pub const EACCESS = 0x0010;
        /// Act on the symlink itself not the target
        pub const SYMLINK_NOFOLLOW = 0x0020;
        /// Act on target of symlink
        pub const SYMLINK_FOLLOW = 0x0040;
        /// Path refers to directory
        pub const REMOVEDIR = 0x0080;
    },
    .freebsd => struct {
        /// Magic value that specify the use of the current working directory
        /// to determine the target of relative file paths in the openat() and
        /// similar syscalls.
        pub const FDCWD = -100;
        /// Check access using effective user and group ID
        pub const EACCESS = 0x0100;
        /// Do not follow symbolic links
        pub const SYMLINK_NOFOLLOW = 0x0200;
        /// Follow symbolic link
        pub const SYMLINK_FOLLOW = 0x0400;
        /// Remove directory instead of file
        pub const REMOVEDIR = 0x0800;
        /// Fail if not under dirfd
        pub const BENEATH = 0x1000;
    },
    .netbsd => struct {
        /// Magic value that specify the use of the current working directory
        /// to determine the target of relative file paths in the openat() and
        /// similar syscalls.
        pub const FDCWD = -100;
        /// Check access using effective user and group ID
        pub const EACCESS = 0x0100;
        /// Do not follow symbolic links
        pub const SYMLINK_NOFOLLOW = 0x0200;
        /// Follow symbolic link
        pub const SYMLINK_FOLLOW = 0x0400;
        /// Remove directory instead of file
        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 {
        /// Magic value that specify the use of the current working directory
        /// to determine the target of relative file paths in the openat() and
        /// similar syscalls.
        pub const FDCWD = -100;
        /// Check access using effective user and group ID
        pub const EACCESS = 0x01;
        /// Do not follow symbolic links
        pub const SYMLINK_NOFOLLOW = 0x02;
        /// Follow symbolic link
        pub const SYMLINK_FOLLOW = 0x04;
        /// Remove directory instead of file
        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 {
        /// Magic value that specify the use of the current working directory
        /// to determine the target of relative file paths in the openat() and
        /// similar syscalls.
        pub const FDCWD: fd_t = @bitCast(@as(u32, 0xffd19553));
        /// Do not follow symbolic links
        pub const SYMLINK_NOFOLLOW = 0x1000;
        /// Follow symbolic link
        pub const SYMLINK_FOLLOW = 0x2000;
        /// Remove directory instead of file
        pub const REMOVEDIR = 0x1;
        pub const TRIGGER = 0x2;
        /// Check access using effective user and group 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 {
        // Match `AT_*` constants in lib/libc/include/wasm-wasi-musl/__header_fcntl.h
        pub const EACCESS = 0x0;
        pub const SYMLINK_NOFOLLOW = 0x1;
        pub const SYMLINK_FOLLOW = 0x2;
        pub const REMOVEDIR = 0x4;
        /// When linking libc, we follow their convention and use -2 for current working directory.
        /// However, without libc, Zig does a different convention: it assumes the
        /// current working directory is the first preopen. This behavior can be
        /// overridden with a public function called `wasi_cwd` in the root source
        /// file.
        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,
        /// This is typically invalid without also setting `DIRECTORY`.
        TMPFILE: bool = false,
        _: u9 = 0,
    },
    .wasi => packed struct(u32) {
        // Match `O_*` bits from lib/libc/include/wasm-wasi-musl/__header_fcntl.h
        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 are 0 in wasi-musl, so they're silently
        // ignored in C code.  Thus no mapping in 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,
};

/// Used by libc to communicate failure. Not actually part of the underlying syscall.
pub const MAP_FAILED: *anyopaque = @ptrFromInt(maxInt(usize));

pub const cc_t = u8;

/// Indices into the `cc` array in the `termios` struct.
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,
};

/// maximum signal number + 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
        /// add event to kq (implies enable)
        pub const ADD = 0x0001;
        /// delete event from kq
        pub const DELETE = 0x0002;
        /// enable event
        pub const ENABLE = 0x0004;
        /// disable event (not reported)
        pub const DISABLE = 0x0008;
        /// only report one occurrence
        pub const ONESHOT = 0x0010;
        /// clear event state after reporting
        pub const CLEAR = 0x0020;
        /// force immediate event output
        /// ... with or without ERROR
        /// ... use KEVENT_FLAG_ERROR_EVENTS
        ///     on syscalls supporting flags
        pub const RECEIPT = 0x0040;
        /// disable event after reporting
        pub const DISPATCH = 0x0080;
        /// unique kevent per udata value
        pub const UDATA_SPECIFIC = 0x0100;
        /// ... in combination with DELETE
        /// will defer delete until udata-specific
        /// event enabled. EINPROGRESS will be
        /// returned to indicate the deferral
        pub const DISPATCH2 = DISPATCH | UDATA_SPECIFIC;
        /// report that source has vanished
        /// ... only valid with DISPATCH2
        pub const VANISHED = 0x0200;
        /// reserved by system
        pub const SYSFLAGS = 0xF000;
        /// filter-specific flag
        pub const FLAG0 = 0x1000;
        /// filter-specific flag
        pub const FLAG1 = 0x2000;
        /// EOF detected (return value)
        pub const EOF = 0x8000;
        /// error, data contains errno (return value)
        pub const ERROR = 0x4000;
        /// use poll(2) semantics for EVFILT.READ
        pub const POLL = FLAG0;
        /// on input, filter should actively return in the presence of OOB on the descriptor
        /// on output, indicates the presence of OOB data on the descriptor
        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 {
        /// add event to kq (implies enable)
        pub const ADD = 0x0001;
        /// delete event from kq
        pub const DELETE = 0x0002;
        /// enable event
        pub const ENABLE = 0x0004;
        /// disable event (not reported)
        pub const DISABLE = 0x0008;
        /// only report one occurrence
        pub const ONESHOT = 0x0010;
        /// clear event state after reporting
        pub const CLEAR = 0x0020;
        /// force EV_ERROR on success, data=0
        pub const RECEIPT = 0x0040;
        /// disable event after reporting
        pub const DISPATCH = 0x0080;
        /// filter-specific flag
        pub const FLAG1 = 0x2000;
        /// error, data contains errno
        pub const ERROR = 0x4000;
        /// EOF detected
        pub const EOF = 0x8000;
    },
    .freebsd => struct {
        // https://cgit.freebsd.org/src/tree/sys/sys/event.h
        /// add event to kq (implies enable)
        pub const ADD = 0x0001;
        /// delete event from kq
        pub const DELETE = 0x0002;
        /// enable event
        pub const ENABLE = 0x0004;
        /// disable event (not reported)
        pub const DISABLE = 0x0008;
        /// enable _ONESHOT and force trigger
        pub const FORCEONESHOT = 0x0100;
        /// do not update the udata field
        pub const KEEPUDATA = 0x0200;
        /// only report one occurrence
        pub const ONESHOT = 0x0010;
        /// clear event state after reporting
        pub const CLEAR = 0x0020;
        /// force immediate event output
        /// ... with or without ERROR
        /// ... use KEVENT_FLAG_ERROR_EVENTS
        ///     on syscalls supporting flags
        pub const RECEIPT = 0x0040;
        /// disable event after reporting
        pub const DISPATCH = 0x0080;
        /// reserved by system
        pub const SYSFLAGS = 0xF000;
        /// note should be dropped
        pub const DROP = 0x1000;
        /// filter-specific flag 1
        pub const FLAG1 = 0x2000;
        /// filter-specific flag 2
        pub const FLAG2 = 0x4000;
        /// EOF detected (return value)
        pub const EOF = 0x8000;
        /// error, event data contains errno (return value)
        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 {
        /// add event to kq (implies enable)
        pub const ADD = 0x0001;
        /// delete event from kq
        pub const DELETE = 0x0002;
        /// enable event
        pub const ENABLE = 0x0004;
        /// disable event (not reported)
        pub const DISABLE = 0x0008;
        /// only report one occurrence
        pub const ONESHOT = 0x0010;
        /// clear event state after reporting
        pub const CLEAR = 0x0020;
        /// force immediate event output
        /// ... with or without ERROR
        /// ... use KEVENT_FLAG_ERROR_EVENTS
        ///     on syscalls supporting flags
        pub const RECEIPT = 0x0040;
        /// disable event after reporting
        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;
        /// attached to aio requests
        pub const AIO = -3;
        /// attached to vnodes
        pub const VNODE = -4;
        /// attached to struct proc
        pub const PROC = -5;
        /// attached to struct proc
        pub const SIGNAL = -6;
        /// timers
        pub const TIMER = -7;
        /// Mach portsets
        pub const MACHPORT = -8;
        /// Filesystem events
        pub const FS = -9;
        /// User events
        pub const USER = -10;
        /// Virtual memory events
        pub const VM = -12;
        /// Exception events
        pub const EXCEPT = -15;
        pub const SYSCOUNT = 17;
    },
    .haiku => struct {
        pub const READ = -1;
        pub const WRITE = -2;
        /// attached to aio requests
        pub const AIO = -3;
        /// attached to vnodes
        pub const VNODE = -4;
        /// attached to struct proc
        pub const PROC = -5;
        /// attached to struct proc
        pub const SIGNAL = -6;
        /// timers
        pub const TIMER = -7;
        /// Process descriptors
        pub const PROCDESC = -8;
        /// Filesystem events
        pub const FS = -9;
        pub const LIO = -10;
        /// User events
        pub const USER = -11;
        /// Sendfile events
        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;
        /// attached to aio requests
        pub const AIO = 2;
        /// attached to vnodes
        pub const VNODE = 3;
        /// attached to struct proc
        pub const PROC = 4;
        /// attached to struct proc
        pub const SIGNAL = 5;
        /// timers
        pub const TIMER = 6;
        /// Filesystem events
        pub const FS = 7;
        /// User events
        pub const USER = 8;
        /// Empty filter
        pub const EMPTY = 9;
    },
    .freebsd => struct {
        // https://cgit.freebsd.org/src/tree/sys/sys/event.h
        pub const READ = -1;
        pub const WRITE = -2;
        /// attached to aio requests
        pub const AIO = -3;
        /// attached to vnodes
        pub const VNODE = -4;
        /// attached to struct proc
        pub const PROC = -5;
        /// attached to struct proc
        pub const SIGNAL = -6;
        /// timers
        pub const TIMER = -7;
        /// Process descriptors
        pub const PROCDESC = -8;
        /// Filesystem events
        pub const FS = -9;
        /// attached to lio requests
        pub const LIO = -10;
        /// User events
        pub const USER = -11;
        /// Sendfile events
        pub const SENDFILE = -12;
        /// empty send socket buf
        pub const EMPTY = -13;
        /// attached to struct prison
        pub const JAIL = -14;
        /// attached to jail descriptors
        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
        /// On input, TRIGGER causes the event to be triggered for output.
        pub const TRIGGER = 0x01000000;
        /// ignore input fflags
        pub const FFNOP = 0x00000000;
        /// and fflags
        pub const FFAND = 0x40000000;
        /// or fflags
        pub const FFOR = 0x80000000;
        /// copy fflags
        pub const FFCOPY = 0xc0000000;
        /// mask for operations
        pub const FFCTRLMASK = 0xc0000000;
        pub const FFLAGSMASK = 0x00ffffff;
        /// low water mark
        pub const LOWAT = 0x00000001;
        /// OOB data
        pub const OOB = 0x00000002;
        /// vnode was removed
        pub const DELETE = 0x00000001;
        /// data contents changed
        pub const WRITE = 0x00000002;
        /// size increased
        pub const EXTEND = 0x00000004;
        /// attributes changed
        pub const ATTRIB = 0x00000008;
        /// link count changed
        pub const LINK = 0x00000010;
        /// vnode was renamed
        pub const RENAME = 0x00000020;
        /// vnode access was revoked
        pub const REVOKE = 0x00000040;
        /// No specific vnode event: to test for EVFILT_READ activation
        pub const NONE = 0x00000080;
        /// vnode was unlocked by flock(2)
        pub const FUNLOCK = 0x00000100;
        /// process exited
        pub const EXIT = 0x80000000;
        /// process forked
        pub const FORK = 0x40000000;
        /// process exec'd
        pub const EXEC = 0x20000000;
        /// shared with EVFILT_SIGNAL
        pub const SIGNAL = 0x08000000;
        /// exit status to be returned, valid for child process only
        pub const EXITSTATUS = 0x04000000;
        /// provide details on reasons for exit
        pub const EXIT_DETAIL = 0x02000000;
        /// mask for signal & exit status
        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;
        /// will react on memory pressure
        pub const VM_PRESSURE = 0x80000000;
        /// will quit on memory pressure, possibly after cleaning up dirty state
        pub const VM_PRESSURE_TERMINATE = 0x40000000;
        /// will quit immediately on memory pressure
        pub const VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000;
        /// there was an error
        pub const VM_ERROR = 0x10000000;
        /// data is seconds
        pub const SECONDS = 0x00000001;
        /// data is microseconds
        pub const USECONDS = 0x00000002;
        /// data is nanoseconds
        pub const NSECONDS = 0x00000004;
        /// absolute timeout
        pub const ABSOLUTE = 0x00000008;
        /// ext[1] holds leeway for power aware timers
        pub const LEEWAY = 0x00000010;
        /// system does minimal timer coalescing
        pub const CRITICAL = 0x00000020;
        /// system does maximum timer coalescing
        pub const BACKGROUND = 0x00000040;
        /// with ABSOLUTE: causes the timer to continue to tick across sleep, still uses gettimeofday epoch
        /// with MACHTIME and ABSOLUTE: uses mach continuous time epoch
        /// without ABSOLUTE: continues to tick across sleep
        pub const MACH_CONTINUOUS_TIME = 0x00000080;
        /// data is mach absolute time units
        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 {
        /// ignore input fflags
        pub const FFNOP = 0x00000000;
        /// AND fflags
        pub const FFAND = 0x40000000;
        /// OR fflags
        pub const FFOR = 0x80000000;
        /// copy fflags
        pub const FFCOPY = 0xc0000000;
        /// masks for operations
        pub const FFCTRLMASK = 0xc0000000;
        pub const FFLAGSMASK = 0x00ffffff;
        /// On input, TRIGGER causes the event to be triggered for output.
        pub const TRIGGER = 0x01000000;
        /// low water mark
        pub const LOWAT = 0x00000001;
        /// vnode was removed
        pub const DELETE = 0x00000001;
        /// data contents changed
        pub const WRITE = 0x00000002;
        /// size increased
        pub const EXTEND = 0x00000004;
        /// attributes changed
        pub const ATTRIB = 0x00000008;
        /// link count changed
        pub const LINK = 0x00000010;
        /// vnode was renamed
        pub const RENAME = 0x00000020;
        /// vnode access was revoked
        pub const REVOKE = 0x00000040;
        /// vnode was opened
        pub const OPEN = 0x00000080;
        /// file closed (no FWRITE)
        pub const CLOSE = 0x00000100;
        /// file closed (FWRITE)
        pub const CLOSE_WRITE = 0x00000200;
        /// file was read
        pub const READ = 0x00000400;
        /// process exited
        pub const EXIT = 0x80000000;
        /// process forked
        pub const FORK = 0x40000000;
        /// process exec'd
        pub const EXEC = 0x20000000;
        /// mask for signal & exit status
        pub const PDATAMASK = 0x000fffff;
        pub const PCTRLMASK = 0xf0000000;
        /// follow across forks
        pub const TRACK = 0x00000001;
        /// could not track child
        pub const TRACKERR = 0x00000002;
        /// am a child process
        pub const CHILD = 0x00000004;
        /// shared with EVFILT_SIGNAL
        pub const SIGNAL = 0x08000000;
        /// data is milliseconds
        pub const MSECONDS = 0x00000000;
        /// data is seconds
        pub const SECONDS = 0x00000001;
        /// data is microseconds
        pub const USECONDS = 0x00000002;
        /// data is nanoseconds
        pub const NSECONDS = 0x00000003;
        /// timeout is absolute
        pub const ABSTIME = 0x00000010;
    },
    .freebsd => struct {
        /// On input, TRIGGER causes the event to be triggered for output.
        pub const TRIGGER = 0x01000000;
        /// ignore input fflags
        pub const FFNOP = 0x00000000;
        /// and fflags
        pub const FFAND = 0x40000000;
        /// or fflags
        pub const FFOR = 0x80000000;
        /// copy fflags
        pub const FFCOPY = 0xc0000000;
        /// mask for operations
        pub const FFCTRLMASK = 0xc0000000;
        pub const FFLAGSMASK = 0x00ffffff;
        /// low water mark
        pub const LOWAT = 0x00000001;
        /// behave like poll()
        pub const FILE_POLL = 0x00000002;
        /// vnode was removed
        pub const DELETE = 0x00000001;
        /// data contents changed
        pub const WRITE = 0x00000002;
        /// size increased
        pub const EXTEND = 0x00000004;
        /// attributes changed
        pub const ATTRIB = 0x00000008;
        /// link count changed
        pub const LINK = 0x00000010;
        /// vnode was renamed
        pub const RENAME = 0x00000020;
        /// vnode access was revoked
        pub const REVOKE = 0x00000040;
        /// vnode was opened
        pub const OPEN = 0x00000080;
        /// file closed, fd did not allow write
        pub const CLOSE = 0x00000100;
        /// file closed, fd did allow write
        pub const CLOSE_WRITE = 0x00000200;
        /// file was read
        pub const READ = 0x00000400;
        /// process exited
        pub const EXIT = 0x80000000;
        /// process forked
        pub const FORK = 0x40000000;
        /// process exec'd
        pub const EXEC = 0x20000000;
        /// mask for signal & exit status
        pub const PDATAMASK = 0x000fffff;
        pub const PCTRLMASK = 0xf0000000;
        /// data is seconds
        pub const SECONDS = 0x00000001;
        /// data is milliseconds
        pub const MSECONDS = 0x00000002;
        /// data is microseconds
        pub const USECONDS = 0x00000004;
        /// data is nanoseconds
        pub const NSECONDS = 0x00000008;
        /// timeout is absolute
        pub const ABSTIME = 0x00000010;
    },
    .openbsd => struct {
        // data/hint flags for EVFILT.{READ|WRITE}
        pub const LOWAT = 0x0001;
        pub const EOF = 0x0002;
        // data/hint flags for EVFILT.EXCEPT and EVFILT.{READ|WRITE}
        pub const OOB = 0x0004;
        // data/hint flags for EVFILT.VNODE
        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;
        // data/hint flags for 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;
        // data/hint flags for EVFILT.DEVICE
        pub const CHANGE = 0x00000001;
        // data/hint flags for 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-like systems
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 deliberately matches the Linux ABI for AT_HWCAP...
        else => std.os.linux.HWCAP,
        // ... but because Linux went the SYS_riscv_hwprobe route, FreeBSD
        // defines more bits than Linux does:
        .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) {
        // Same deal as for 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's version of SIGRTMIN.  Actually a function.
pub const sigrtmin = switch (native_os) {
    .openbsd => {},
    else => sigrt_private.sigrtmin,
};

/// Zig's version of SIGRTMAX.  Actually a function.
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,
    /// On Linux, `res` will not be modified on error and `freeaddrinfo` will
    /// potentially crash if you pass it an undefined pointer
    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;

/// These are implementation defined but share identical values in at least musl and 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;

// Math
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;

// OS-specific bits. These are protected from being used on the wrong OS by
// comptime assertions inside each OS-specific file.

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;

/// External definitions shared by two or more operating systems.
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 and 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 modernized symbols.
    /// x86_64 links to $INODE64 suffix for 64-bit support.
    /// Note these are not necessary on 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 modernized symbols.
    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 modernized symbols.
    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;

    // Don't forget to add another clown when an OS picks yet another unique
    // symbol name for errno location!
    // 🤡🤡🤡🤡🤡🤡

    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;
    }
};