src/net/fds.bend checks
raw source on the hub · import 0x44d563db508054425e12f3226cb92a4f/src/net/fds.bend as Fds
1 import
import Base
Definitions
def Fds.spare source · line 10 · raw
U32
def Fds.room source · line 13 · raw
@+limit:U32 -> U32
def Fds.unlimited source · line 24 · raw
U32
The process's soft descriptor limit, from what the host reports at startup (Hvf.nofile): the soft and hard limits (4294967295 for unlimited or more), the most descriptors the runtime's poller takes (top: FD_SETSIZE, 1024, on macOS; 65536 on Linux), and whether the soft limit must be no more than top (exact: macOS's select() fails past FD_SETSIZE, so the kernel must never hand out a larger descriptor). It aims at the hard limit or top, whichever is lower: exactly that when exact; otherwise only ever raised to it, and an unlimited soft limit stays.
def Fds.soft.go source · line 27 · raw
@exact:Bool -> @+cur:U32 -> @+want:U32 -> U32
def Fds.soft source · line 34 · raw
@+cur:U32 -> @+max:U32 -> @+top:U32 -> @exact:Bool -> U32