Skip to content
BSD syscall#430

svc · unix #430

fileport_makeport

Wraps a file descriptor in a Mach port suitable for transfer across XPC or task ports.

Prototype

int fileport_makeport(int fd, user_addr_t portnamep);

Returns: int

Arguments

NameTypeDirDescription
fdint-
portnamepuser_addr_t-

Version history

XNU tagmacOS#
xnu-1699.24.8macOS 10.7 Lion430
xnu-2050.18.24macOS 10.8 Mountain Lion430
xnu-2422.115.4macOS 10.9 Mavericks430
xnu-2782.40.9macOS 10.10 Yosemite430
xnu-3247.1.106macOS 10.11 El Capitan430
xnu-3789.1.32macOS 10.12 Sierra430
xnu-4570.1.46macOS 10.13 High Sierra430
xnu-4903.221.2macOS 10.14 Mojave430
xnu-6153.11.26macOS 10.15 Catalina430
xnu-1504.15.3—432
xnu-1504.7.4—432
xnu-1504.9.17—432
xnu-1504.9.26—432
xnu-1504.9.37—432
xnu-1699.22.73—430
xnu-1699.22.81—430
xnu-1699.24.23—430
xnu-1699.26.8—430
xnu-1699.32.7—430
xnu-2050.22.13—430
xnu-2050.24.15—430
xnu-2050.48.11—430
xnu-2050.7.9—430
xnu-2050.9.2—430
xnu-2422.1.72—430
xnu-2422.100.13—430
xnu-2422.110.17—430
xnu-2422.90.20—430
xnu-2782.1.97—430
xnu-2782.10.72—430
xnu-2782.20.48—430
xnu-2782.30.5—430
xnu-3247.10.11—430
xnu-3248.20.55—430
xnu-3248.30.4—430
xnu-3248.40.184—430
xnu-3248.50.21—430
xnu-3248.60.10—430
xnu-3789.21.4—430
xnu-3789.31.2—430
xnu-3789.41.3—430
xnu-3789.51.2—430
xnu-3789.60.24—430
xnu-3789.70.16—430
xnu-4570.20.62—430
xnu-4570.31.3—430
xnu-4570.41.2—430
xnu-4570.51.1—430
xnu-4570.61.1—430
xnu-4570.71.2—430
xnu-4903.231.4—430
xnu-4903.241.1—430
xnu-4903.270.47—430
xnu-6153.101.6—430
xnu-6153.121.1—430
xnu-6153.141.1—430
xnu-6153.41.3—430
xnu-6153.61.1—430
xnu-6153.81.5—430

Notes

Foundational to how launchd, XPC and many Apple frameworks hand off open files between processes without copying data. The created port holds a reference on the fileglob until the receiver consumes it with fileport_makefd. The originating fd remains valid.

Detection

syscall::fileport_makeport:entry in DTrace. Port rights traffic is visible with `lsmp -p <pid>`.

Related APIs

fileport_makefdmach_msgxpc_connection_send_messagedupclose