POSIX defines a portable Unix API: files, processes, pipes, sockets, and threads. C plus POSIX powers most Linux/macOS systems software.
Common POSIX calls
open,read,write,close— file descriptorsfork,exec,wait— processespthread_create— threads (pthread library)socket— networking
stdio vs POSIX I/O
FILE* buffering is convenient; file descriptors integrate with select/poll and pipes.
Important interview questions and answers
- Q: POSIX vs C standard?
A: C standard is language + libc basics; POSIX adds OS services beyond ISO C. - Q: fork() does what?
A: Creates a child process copying the address space—classic Unix process model.
Self-check
- Name one POSIX call not in ISO C.
- What is a file descriptor?
Interview prep
- POSIX vs ISO C?
ISO C defines language and core libc; POSIX adds Unix OS APIs—processes, fds, pthreads, sockets.
- fork()?
Creates child process duplicating parent memory image—cornerstone of Unix process model.