asterinas/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-descriptor-and-io-control/README.md

119 lines
2.1 KiB
Markdown
Raw Normal View History

# 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
under this category.
-->
### `fcntl`
Supported functionality in SCML:
```c
{{#include fcntl.scml}}
```
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).
### `pipe` and `pipe2`
Supported functionality in SCML:
```c
{{#include pipe_and_pipe2.scml}}
```
Silently-ignored flags:
* `O_DIRECT`
* `O_NONBLOCK`
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/pipe.2.html).
### `eventfd` and `eventfd2`
Supported functionality in SCML:
```c
{{#include eventfd_and_eventfd2.scml}}
```
Silently-ignored flags:
* `EFD_NONBLOCK`
* `EFD_SEMAPHORE`
For more information,
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).
2025-12-10 11:19:04 +00:00
2025-12-17 03:28:04 +00:00
### `poll` and `ppoll`
2025-12-10 11:19:04 +00:00
Supported functionality in SCML:
```c
2025-12-17 03:28:04 +00:00
{{#include poll_and_ppoll.scml}}
2025-12-10 11:19:04 +00:00
```
Unsupported events:
* `POLLRDBAND`
* `POLLWRNORM`
* `POLLWRBAND`
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/poll.2.html).