diff --git a/book/src/kernel/linux-compatibility/README.md b/book/src/kernel/linux-compatibility/README.md index 545727416..c08a4a237 100644 --- a/book/src/kernel/linux-compatibility/README.md +++ b/book/src/kernel/linux-compatibility/README.md @@ -280,16 +280,16 @@ which are summarized in the table below. | 257 | openat | ✅ | [⚠️](syscall-flag-coverage/file-and-directory-operations/#open-and-openat) | | 258 | mkdirat | ✅ | 💯 | | 259 | mknodat | ✅ | 💯 | -| 260 | fchownat | ✅ | ❓ | +| 260 | fchownat | ✅ | 💯 | | 261 | futimesat | ✅ | 💯 | | 262 | newfstatat | ✅ | [⚠️](syscall-flag-coverage/file-and-directory-operations/#newfstatat) | -| 263 | unlinkat | ✅ | ❓ | -| 264 | renameat | ✅ | ❓ | -| 265 | linkat | ✅ | ❓ | +| 263 | unlinkat | ✅ | 💯 | +| 264 | renameat | ✅ | 💯 | +| 265 | linkat | ✅ | 💯 | | 266 | symlinkat | ✅ | 💯 | | 267 | readlinkat | ✅ | 💯 | | 268 | fchmodat | ✅ | 💯 | -| 269 | faccessat | ✅ | ❓ | +| 269 | faccessat | ✅ | 💯 | | 270 | pselect6 | ✅ | 💯 | | 271 | ppoll | ✅ | ❓ | | 272 | unshare | ✅ | ❓ | @@ -340,8 +340,8 @@ which are summarized in the table below. | 318 | getrandom | ✅ | [⚠️](syscall-flag-coverage/system-information-and-misc/#getrandom) | | 319 | memfd_create | ✅ | ❓ | | 322 | execveat | ✅ | ❓ | -| 327 | preadv2 | ✅ | ❓ | -| 328 | pwritev2 | ✅ | ❓ | +| 327 | preadv2 | ✅ | [⚠️](syscall-flag-coverage/file-and-directory-operations/#preadv2-and-pwritev2) | +| 328 | pwritev2 | ✅ | [⚠️](syscall-flag-coverage/file-and-directory-operations/#preadv2-and-pwritev2) | | 332 | statx | ✅ | ❓ | | 434 | pidfd_open | ✅ | ❓ | | 435 | clone3 | ✅ | ❓ | 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 83cff50bf..12d7ae1b2 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 @@ -81,3 +81,25 @@ Silently-ignored flags: For more information, see [the man page](https://man7.org/linux/man-pages/man2/newfstatat.2.html). + +### `preadv2` and `pwritev2` + +Supported functionality in SCML: + +```c +{{#include preadv2_and_pwritev2.scml}} +``` + +Silently-ignored flags: +* `RWF_DSYNC` +* `RWF_HIPRI` +* `RWF_SYNC` +* `RWF_NOWAIT` + +Unsupported flags: +* `RWF_APPEND` +* `RWF_NOAPPEND` +* `RWF_ATOMIC` + +For more information, +see [the man page](https://man7.org/linux/man-pages/man2/preadv2.2.html). 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 3ca98430f..976007955 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 @@ -44,6 +44,7 @@ fchdir(fd); // Change the name or location of a file rename(oldpath, newpath); +renameat(olddirfd, oldpath, newdirfd, newpath); // Delete a directory rmdir(path); @@ -53,9 +54,11 @@ creat(path, mode); // Make a new name for a file link(oldpath, newpath); +linkat(olddirfd, oldpath, newdirfd, newpath, flags = AT_EMPTY_PATH | AT_SYMLINK_FOLLOW); // Delete a name and possibly the file it refers to unlink(path); +unlinkat(dirfd, path, flags = AT_REMOVEDIR); // Make a new name for a file symlink(target, linkpath); @@ -75,6 +78,7 @@ fchmodat2(dirfd, path_ptr, mode, flags = AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW); chown(path, owner, group); fchown(fd, owner, group); lchown(path, owner, group); +fchownat(dirfd, path, owner, group, flags = AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW); // Set file mode creation mask umask(mask); @@ -111,3 +115,6 @@ flistxattr(fd, list, size); removexattr(path, name); lremovexattr(path, name); fremovexattr(fd, name); + +// Check user's permissions for a file +faccessat(dirfd, path, mode); diff --git a/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-and-directory-operations/preadv2_and_pwritev2.scml b/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-and-directory-operations/preadv2_and_pwritev2.scml new file mode 100644 index 000000000..2994d1128 --- /dev/null +++ b/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-and-directory-operations/preadv2_and_pwritev2.scml @@ -0,0 +1,5 @@ +// Read data from multiple buffers +preadv2(fd, iov, iovcnt, offset, flags = 0); + +// Write data to multiple buffers +pwritev2(fd, iov, iovcnt, offset, flags = 0);