Skip to content
BSD syscall#41

svc · unix #41

sys_dup

Internal XNU symbol name for the dup(2) syscall; the public wrapper is dup(2).

Prototype

int sys_dup(u_int fd);

Returns: int

Arguments

NameTypeDirDescription
fdu_int-

Version history

XNU tagmacOS#
xnu-7195.50.7.100.1macOS 11.0 Big Sur41
xnu-8019.41.5macOS 12.0 Monterey41
xnu-8792.41.9macOS 13.0 Ventura41
xnu-10002.1.13macOS 14.0 Sonoma41
xnu-11215.1.10macOS 15.0 Sequoia41
xnu-11417.101.15macOS 15.4 Sequoia41
xnu-12377.1.9macOS 26.0 Tahoe41
xnu-10002.41.941
xnu-10002.61.341
xnu-10002.81.541
xnu-10063.101.1541
xnu-10063.121.341
xnu-10063.141.141
xnu-11215.41.341
xnu-11215.61.541
xnu-11215.81.441
xnu-11417.121.641
xnu-11417.140.6941
xnu-12377.101.1541
xnu-12377.41.641
xnu-12377.61.1241
xnu-12377.81.441
xnu-7195.101.141
xnu-7195.121.341
xnu-7195.141.241
xnu-7195.60.7541
xnu-7195.81.341
xnu-8019.61.541
xnu-8019.80.2441
xnu-8020.101.441
xnu-8020.121.341
xnu-8020.140.4141
xnu-8792.61.241
xnu-8792.81.241
xnu-8796.101.541
xnu-8796.121.241
xnu-8796.141.341

Notes

Newer XNU branches prefix the C implementations of BSD syscalls with sys_ to avoid colliding with libc symbol names; the entry in the syscall table still exposes it as dup. See dup for behaviour.

Related APIs

dupdup2fcntlclose