Skip to content

Commit 08265da

Browse files
committed
wishlist: mark unlinkat2() as in-progress
Move "Unlinking via two file descriptors" from TODO to In-Progress next to the related `AT_EMPTY_PATH` for `unlinkat()` entry. Rename the proposed syscall in the prototype to `unlinkat2()` to match the "two file descriptors" framing. Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
1 parent 43cfcb5 commit 08265da

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,22 @@ mounts.
195195
around only a file descriptor without having to keep the path around
196196
to be able to unlink the file/directory.
197197

198+
### Unlinking via two file descriptors
199+
200+
`unlinkat2(dir_fd, name, inode_fd)`: taking one file descriptor
201+
for the directory to remove a file in, and another one referring
202+
to the inode of the filename to remove. This call should only
203+
succeed if the specified filename still refers to the specified
204+
inode.
205+
206+
**Use-Case:** code that operates on a well-know path that might be
207+
shared by multiple programs that jointly manage it might want to
208+
safely remove a filename under the guarantee it still refers to
209+
the expected inode. As a specific example, consider lock files,
210+
that should be cleaned up only if they still refer to the assumed
211+
owner's instance, but leave the file in place if another process
212+
already took over the filename.
213+
198214
### `AT_EMPTY_PATH` support for `openat()` and `openat2()`
199215

200216
To get an operable version of an `O_PATH` file descriptors, it is
@@ -323,22 +339,6 @@ disk I/O. Consider implementation of a naive web browser which is
323339
pointed to `file://dev/zero`, not expecting an endless amount of
324340
data to read.
325341

326-
### Unlinking via two file descriptors
327-
328-
`unlinkat3(dir_fd, name, inode_fd)`: taking one file descriptor
329-
for the directory to remove a file in, and another one referring
330-
to the inode of the filename to remove. This call should only
331-
succeed if the specified filename still refers to the specified
332-
inode.
333-
334-
**Use-Case:** code that operates on a well-know path that might be
335-
shared by multiple programs that jointly manage it might want to
336-
safely remove a filename under the guarantee it still refers to
337-
the expected inode. As a specific example, consider lock files,
338-
that should be cleaned up only if they still refer to the assumed
339-
owner's instance, but leave the file in place if another process
340-
already took over the filename.
341-
342342
### Determining if a mount point belongs to the current user
343343

344344
Ability to determine if a mount point belongs to the current user

0 commit comments

Comments
 (0)