date: “2016-12-01”
draft: false
title: “handle”
System Calls
File Operations
| System Call |
Description |
open() |
Attempts to open a file, returns a file descriptor |
read() |
Reads data from a file, returns the number of bytes read. |
write() |
Used to write the output to the terminal, uses a file descriptor |
close() |
Tells the kernel that the process no longer needs access to the file. Argument is a file descriptor |
access() |
Check user’s permissions for a file |
fstat() |
Looks for status information, such as the access rights, owner, and more |
Process Manipulation
| System Call |
Description |
fork() |
Create a new process, which becomes the child process of the caller |
execve() |
Loads and runs executables |
kill() |
Send a signal to any process group or process |
Memory Operations
| System Call |
Description |
malloc() |
C std lib call to allocate memory |
free() |
C std lib call to release memory |
mmap() |
Requests a segment of memory for the process to use |
munmap() |
Map or unmap files or devices into memory |
mprotect() |
Set access protections on a region of memory |
Data
| System Call |
Description |
socket() |
Create an endpoint for communication |
send() |
Send a message on a socket |
recv() |
Receive a message from a socket |