2025-08-07 09:44:27 +00:00
|
|
|
# File Descriptor and I/O Control
|
|
|
|
|
|
|
|
|
|
<!--
|
|
|
|
|
Put system calls such as
|
|
|
|
|
dup, dup2, dup3, fcntl, ioctl, pipe, pipe2, splice, tee, vmsplice, sendfile,
|
2025-11-28 09:33:16 +00:00
|
|
|
eventfd, eventfd2 and memfd_create
|
2025-08-07 09:44:27 +00:00
|
|
|
under this category.
|
|
|
|
|
-->
|
2025-08-19 03:40:58 +00:00
|
|
|
|
2025-11-11 02:09:03 +00:00
|
|
|
### `fcntl`
|
2025-08-19 03:40:58 +00:00
|
|
|
|
|
|
|
|
Supported functionality in SCML:
|
|
|
|
|
|
|
|
|
|
```c
|
2025-11-12 08:36:18 +00:00
|
|
|
{{#include fcntl.scml}}
|
2025-08-19 03:40:58 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Unsupported commands:
|
|
|
|
|
* `F_NOTIFY`
|
|
|
|
|
* `F_OFD_SETLK`, `F_OFD_SETLKW` and `F_OFD_GETLK`
|
|
|
|
|
* `F_GETOWN_EX` and `F_SETOWN_EX`
|
|
|
|
|
* `F_GETSIG` and `F_SETSIG`
|
|
|
|
|
* `F_SETLEASE` and `F_GETLEASE`
|
|
|
|
|
* `F_SETPIPE_SZ` and `F_GETPIPE_SZ`
|
|
|
|
|
* `F_GET_RW_HINT` and `F_SET_RW_HINT`
|
|
|
|
|
* `F_GET_FILE_RW_HINT` and `F_SET_FILE_RW_HINT`
|
|
|
|
|
|
|
|
|
|
For more information,
|
|
|
|
|
see [the man page](https://man7.org/linux/man-pages/man2/fcntl.2.html).
|
|
|
|
|
|
2025-11-11 02:09:03 +00:00
|
|
|
### `pipe` and `pipe2`
|
2025-08-19 03:40:58 +00:00
|
|
|
|
|
|
|
|
Supported functionality in SCML:
|
|
|
|
|
|
|
|
|
|
```c
|
2025-11-12 08:36:18 +00:00
|
|
|
{{#include pipe_and_pipe2.scml}}
|
2025-08-19 03:40:58 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Silently-ignored flags:
|
|
|
|
|
* `O_DIRECT`
|
|
|
|
|
* `O_NONBLOCK`
|
|
|
|
|
|
|
|
|
|
For more information,
|
|
|
|
|
see [the man page](https://man7.org/linux/man-pages/man2/pipe.2.html).
|
|
|
|
|
|
2025-11-11 02:09:03 +00:00
|
|
|
### `eventfd` and `eventfd2`
|
2025-08-19 03:40:58 +00:00
|
|
|
|
|
|
|
|
Supported functionality in SCML:
|
|
|
|
|
|
|
|
|
|
```c
|
2025-11-12 08:36:18 +00:00
|
|
|
{{#include eventfd_and_eventfd2.scml}}
|
2025-08-19 03:40:58 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Silently-ignored flags:
|
|
|
|
|
* `EFD_NONBLOCK`
|
|
|
|
|
* `EFD_SEMAPHORE`
|
|
|
|
|
|
|
|
|
|
For more information,
|
2025-11-11 02:09:03 +00:00
|
|
|
see [the man page](https://man7.org/linux/man-pages/man2/eventfd.2.html).
|
2025-11-28 09:33:16 +00:00
|
|
|
|
|
|
|
|
### `memfd_create`
|
|
|
|
|
|
|
|
|
|
Supported functionality in SCML:
|
|
|
|
|
|
|
|
|
|
```c
|
|
|
|
|
{{#include memfd_create.scml}}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Silently-ignored flags:
|
|
|
|
|
* `MFD_HUGETLB`
|
|
|
|
|
|
|
|
|
|
Unsupported flags:
|
|
|
|
|
* `MFD_HUGE_64KB`
|
|
|
|
|
* `MFD_HUGE_512KB`
|
|
|
|
|
* `MFD_HUGE_1MB`
|
|
|
|
|
* `MFD_HUGE_2MB`
|
|
|
|
|
* `MFD_HUGE_8MB`
|
|
|
|
|
* `MFD_HUGE_16MB`
|
|
|
|
|
* `MFD_HUGE_32MB`
|
|
|
|
|
* `MFD_HUGE_256MB`
|
|
|
|
|
* `MFD_HUGE_512MB`
|
|
|
|
|
* `MFD_HUGE_1GB`
|
|
|
|
|
* `MFD_HUGE_2GB`
|
|
|
|
|
* `MFD_HUGE_16GB`
|
|
|
|
|
|
|
|
|
|
For more information,
|
2025-12-10 02:09:13 +00:00
|
|
|
see [the man page](https://man7.org/linux/man-pages/man2/memfd_create.2.html).
|
|
|
|
|
|
|
|
|
|
### `epoll_ctl`
|
|
|
|
|
|
|
|
|
|
Supported functionality in SCML:
|
|
|
|
|
|
|
|
|
|
```c
|
|
|
|
|
{{#include epoll_ctl.scml}}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Unsupported flags in events:
|
|
|
|
|
* `EPOLLEXCLUSIVE`
|
|
|
|
|
* `EPOLLWAKEUP`
|
|
|
|
|
|
|
|
|
|
For more information,
|
|
|
|
|
see [the man page](https://man7.org/linux/man-pages/man2/epoll_ctl.2.html).
|