diff --git a/book/src/kernel/linux-compatibility/README.md b/book/src/kernel/linux-compatibility/README.md index ad2d5811e..81ce2b2db 100644 --- a/book/src/kernel/linux-compatibility/README.md +++ b/book/src/kernel/linux-compatibility/README.md @@ -93,7 +93,7 @@ which are summarized in the table below. | 70 | msgrcv | ❌ | N/A | | 71 | msgctl | ❌ | N/A | | 72 | fcntl | ✅ | [⚠️](syscall-flag-coverage/file-descriptor-and-io-control/#fcntl) | -| 73 | flock | ✅ | ❓ | +| 73 | flock | ✅ | 💯 | | 74 | fsync | ✅ | 💯 | | 75 | fdatasync | ✅ | 💯 | | 76 | truncate | ✅ | 💯 | @@ -305,7 +305,7 @@ which are summarized in the table below. | 282 | signalfd | ✅ | 💯 | | 283 | timerfd_create | ✅ | [⚠️](syscall-flag-coverage/signals-and-timers/#timerfd_create) | | 284 | eventfd | ✅ | 💯 | -| 285 | fallocate | ✅ | ❓ | +| 285 | fallocate | ✅ | [⚠️](syscall-flag-coverage/file-and-directory-operations/#fallocate) | | 286 | timerfd_settime | ✅ | [⚠️](syscall-flag-coverage/signals-and-timers/#timerfd_settime) | | 287 | timerfd_gettime | ✅ | 💯 | | 288 | accept4 | ✅ | [⚠️](syscall-flag-coverage/networking-and-sockets/#accept-and-accept4) | diff --git a/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-and-directory-operations/README.md b/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-and-directory-operations/README.md index 21a198ffa..8728e060e 100644 --- a/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-and-directory-operations/README.md +++ b/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-and-directory-operations/README.md @@ -140,3 +140,20 @@ Silently-ignored masks: For more information, see [the man page](https://man7.org/linux/man-pages/man2/statx.2.html). + +### `fallocate` + +Supported functionality in SCML: + +```c +{{#include fallocate.scml}} +``` + +Unsupported modes: +* `FALLOC_FL_UNSHARE_RANGE` +* `FALLOC_FL_COLLAPSE_RANGE` +* `FALLOC_FL_ZERO_RANGE` +* `FALLOC_FL_INSERT_RANGE` + +For more information, +see [the man page](https://man7.org/linux/man-pages/man2/fallocate.2.html). diff --git a/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-and-directory-operations/fallocate.scml b/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-and-directory-operations/fallocate.scml new file mode 100644 index 000000000..c634264d7 --- /dev/null +++ b/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-and-directory-operations/fallocate.scml @@ -0,0 +1,5 @@ +// Allocate disk space within the range specified +fallocate(fd, mode = FALLOC_FL_KEEP_SIZE, offset, size); + +// Deallocate space (create a hole) while keeping the file size unchanged +fallocate(fd, mode = FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, offset, size); diff --git a/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-and-directory-operations/fully_covered.scml b/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-and-directory-operations/fully_covered.scml index 976007955..26fb7d478 100644 --- a/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-and-directory-operations/fully_covered.scml +++ b/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-and-directory-operations/fully_covered.scml @@ -118,3 +118,6 @@ fremovexattr(fd, name); // Check user's permissions for a file faccessat(dirfd, path, mode); + +// Apply or remove an advisory lock on an open file +flock(fd, op = LOCK_SH | LOCK_EX | LOCK_UN | LOCK_NB);