1/19
Looks like no tags are added yet.
File descriptor
A small non-negative integer a process uses to refer to an open file
stdin / stdout / stderr
File descriptors 0, 1, and 2, opened automatically for every process
open()
Opens or creates a file and returns a file descriptor, or -1 on failure
O_RDONLY / O_WRONLY / O_RDWR
Open for reading only, writing only, or reading and writing
O_CREAT
Create the file if it doesn't exist (needs a mode argument)
O_TRUNC
Erase the file's contents if it already exists
O_APPEND
Every write goes to the end of the file
mode
The permissions for a newly created file, such as 0600
close()
Releases a file descriptor; returns 0 on success, -1 on error
read()
Reads up to count bytes; returns bytes read, 0 at end of file, -1 on error
write()
Writes count bytes from a buffer; returns bytes written or -1
lseek()
Moves the file pointer; returns the new offset from the start, or -1
SEEK_SET / SEEK_CUR / SEEK_END
Offset measured from the start, the current position, or the end of the file
File pointer (offset)
The current position in an open file, advanced automatically by read and write
creat / unlink / fcntl
Create an empty file / remove a file / control a file's attributes
IPC
Interprocess communication meaning communication between processes
Signal
An asynchronous event delivered to a process which can occur at any time
Signal handler
A function that runs when a signal arrives; afterward the process resumes where it left off
signal()
Installs a handler for a signal