Skip to content
BSD syscall#89

svc · unix #89

getdtablesize

Returns the maximum number of file descriptors the calling process may open.

Prototype

int getdtablesize(void);

Returns: int

Version history

XNU tagmacOS#
xnu-1456.1.26macOS 10.6 Snow Leopard89
xnu-1699.24.8macOS 10.7 Lion89
xnu-2050.18.24macOS 10.8 Mountain Lion89
xnu-2422.115.4macOS 10.9 Mavericks89
xnu-2782.40.9macOS 10.10 Yosemite89
xnu-3247.1.106macOS 10.11 El Capitan89
xnu-3789.1.32macOS 10.12 Sierra89
xnu-4570.1.46macOS 10.13 High Sierra89
xnu-4903.221.2macOS 10.14 Mojave89
xnu-6153.11.26macOS 10.15 Catalina89
xnu-1486.2.11—89
xnu-1504.15.3—89
xnu-1504.3.12—89
xnu-1504.7.4—89
xnu-1504.9.17—89
xnu-1504.9.26—89
xnu-1504.9.37—89
xnu-1699.22.73—89
xnu-1699.22.81—89
xnu-1699.24.23—89
xnu-1699.26.8—89
xnu-1699.32.7—89
xnu-2050.22.13—89
xnu-2050.24.15—89
xnu-2050.48.11—89
xnu-2050.7.9—89
xnu-2050.9.2—89
xnu-2422.1.72—89
xnu-2422.100.13—89
xnu-2422.110.17—89
xnu-2422.90.20—89
xnu-2782.1.97—89
xnu-2782.10.72—89
xnu-2782.20.48—89
xnu-2782.30.5—89
xnu-3247.10.11—89
xnu-3248.20.55—89
xnu-3248.30.4—89
xnu-3248.40.184—89
xnu-3248.50.21—89
xnu-3248.60.10—89
xnu-3789.21.4—89
xnu-3789.31.2—89
xnu-3789.41.3—89
xnu-3789.51.2—89
xnu-3789.60.24—89
xnu-3789.70.16—89
xnu-4570.20.62—89
xnu-4570.31.3—89
xnu-4570.41.2—89
xnu-4570.51.1—89
xnu-4570.61.1—89
xnu-4570.71.2—89
xnu-4903.231.4—89
xnu-4903.241.1—89
xnu-4903.270.47—89
xnu-6153.101.6—89
xnu-6153.121.1—89
xnu-6153.141.1—89
xnu-6153.41.3—89
xnu-6153.61.1—89
xnu-6153.81.5—89

Notes

Equivalent to getrlimit(RLIMIT_NOFILE).rlim_cur in practice on macOS. Older code uses it to size select(2) bitmasks; modern code should prefer kqueue or poll and the actual RLIMIT_NOFILE value.

Related APIs

getrlimitsetrlimitproc_rlimit_controlgetrusage