popen with argv system with argv spawnvp with argv select nfds readfds writefds exceptfds timeout => [b c d e] pselect nfds readfds writefds exceptfds timeout sigmask => [b c d] nfds = (if (nil? allTheFds) 0 $else (extremum max (allTheFds))) + 1 fdSetSize pathconf _PC_NAME_MAX nanosleep clock_nanosleep getgroups : try group sizes from 1 up, in 2 complements, calling getgroups, checking the result and errno, if errno = EINVAL, recurse. max is ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1; make it whitelist-based. factor out non-POSIX parts into OS module. fcntl select poll pselect epoll dup3 is linux-specific. map (\e let value = (head (tail e)) in let index = (head e) in (if (index = 4) (value + 1) (if (index = 5) (value + 1900) value))) (enumerate $ run (POSIX.time [] ;\t POSIX.localtime t)) types: ANSI typedef jmp_buf ANSI typedef sig_atomic_t ANSI typedef va_list ANSI typedef ptrdiff_t ANSI typedef size_t ANSI typedef wchar_t ANSI typedef FILE ANSI typedef fpos_t ANSI typedef size_t ANSI typedef div_t ANSI typedef ldiv_t ANSI typedef size_t ANSI typedef wchar_t ANSI typedef size_t ANSI typedef clock_t ANSI typedef size_t ANSI typedef time_t POSIX typedef DIR POSIX typedef sigjmp_buf POSIX typedef clock_t POSIX typedef dev_t POSIX typedef gid_t POSIX typedef ino_t POSIX typedef mode_t POSIX typedef nlink_t POSIX typedef off_t POSIX typedef pid_t POSIX typedef size_t POSIX typedef ssize_t POSIX typedef uid_t POSIX typedef cc_t POSIX typedef speed_t POSIX typedef tcflag_t POSIX typedef size_t POSIX typedef ssize_t If you're going to provide any of these, then you should provide at least the ANSI C types ptrdiff_t, size_t, wchar_t, FILE, fpos_t, clock_t, and time_t. You should strongly consider providing the other ANSI C types jmp_buf, sig_atomic_t, div_t, and ldiv_t, not because they would be particularly useful, but simply because the additional implementation effort required would be quite trivial. va_list is probably the most problematic, since it is often dependent on the particular C compiler. nicer wrapper for posixSpawn!