API Reference¶
This section provides quick lookup pages for common Linux userspace and kernel APIs used in the labs.
The goal is not to replace the Linux man pages or kernel documentation. Instead, this section explains each API in the context of the lab code, common embedded Linux usage, and typical mistakes found during development.
API Groups¶
| Group | Example APIs |
|---|---|
| POSIX I/O | open, read, write, close, fcntl, pipe, dup, errno |
| Process and Signal | fork, sigaction, sigprocmask, kill, waitpid |
| Network Socket | socket, bind, listen, accept, connect, recv, send, setsockopt, inet_ntop |
| Event Loop | epoll_create1, epoll_ctl, epoll_wait, timerfd_create, timerfd_settime, signalfd, eventfd, poll, select |
| IPC | socketpair, sendmsg, recvmsg, SCM_RIGHTS, shm_open, ftruncate, mmap, mq_open, sem_init, sem_wait, sem_post |
| Kernel Driver | file_operations, alloc_chrdev_region, cdev_add, device_create, copy_to_user, poll_wait, fasync_helper, devm_gpiod_get |
| Subsystem | devm_iio_device_alloc, iio_push_to_buffers, input_report_key, input_sync, gpiod_to_irq, devm_hwmon_device_register_with_info |
Documentation Style¶
Each API page follows a consistent layout:
- Purpose
- Header
- Prototype
- Parameters
- Return Value
- Minimal Example
- Common Pitfalls
- Related Topics
Refactor Status¶
Phase 6 expands the API reference from topic-level summaries into focused per-API lookup pages. Phase 8 adds subsystem-focused API pages for IIO, Input, GPIO, and hwmon. Phase 10 adds POSIX I/O, process/signal, and network socket API references.
Build and Platform Driver Helpers¶
Phase 11 adds a small set of kernel driver helper references used by platform-driver and Device Tree workflows: