glibc/sysdeps
Sergey Bugaev 65392c8478 hurd: Implement O_TMPFILE
This is a flag that causes open () to create a new, unnamed file in the
same filesystem as the given directory. The file descriptor can be
simply used in the creating process as a temporary file, or shared with
children processes via fork (), or sent over a Unix socket. The file can
be left anonymous, in which case it will be deleted from the backing
file system once all copies of the file descriptor are closed, or given
a permanent name with a linkat () call, such as the following:

int fd = open ("/tmp", O_TMPFILE | O_RDWR, 0700);
/* Do something with the file... */
linkat (fd, "", AT_FDCWD, "/tmp/filename", AT_EMPTY_PATH);

In between creating the file and linking it to the file system, it is
possible to set the file content, mode, ownership, author, and other
attributes, so that the file visibly appears in the file system (perhaps
replacing another file) atomically, with all of its attributes already
set up.

The Hurd support for O_TMPFILE directly exposes the dir_mkfile RPC to
user programs. Previously, dir_mkfile was used by glibc internally, in
particular for implementing tmpfile (), but not exposed to user programs
through a Unix-level API.

O_TMPFILE was initially introduced by Linux. This implementation is
intended to be compatible with the Linux implementation, except that the
O_EXCL flag is not given the special meaning when used together with
O_TMPFILE, unlike on Linux.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Message-Id: <20230130125216.6254-3-bugaevc@gmail.com>
2023-02-01 23:32:21 +01:00
..
aarch64 AArch64: Improve strrchr 2023-01-17 15:09:18 +00:00
alpha Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
arc Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
arm Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
csky Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
generic Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
gnu Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hppa Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
htl Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hurd Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
i386 Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ia64 ia64: Regenerate ulps 2023-01-24 11:21:38 -05:00
ieee754 math: Suppress -O0 warnings for soft-fp fsqrt [BZ #19444] 2023-01-11 17:50:51 -03:00
loongarch Regenerate configure. 2023-01-31 17:51:40 -05:00
m68k Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
mach hurd: Implement O_TMPFILE 2023-02-01 23:32:21 +01:00
microblaze Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
mips Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
nios2 Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
nptl Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
or1k Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
posix Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
powerpc Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
pthread Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
riscv Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
s390 Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
sh Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
sparc sparc (64bit): Regenerate ulps 2023-01-24 11:21:50 -05:00
unix Linux: optimize clone3 internal usage 2023-02-01 08:42:11 -03:00
wordsize-32 Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
x86 x86: Cache computation for AMD architecture. 2023-01-18 19:28:54 +01:00
x86_64 x86: Fix strncat-avx2.S reading past length [BZ #30065] 2023-01-31 19:13:46 -06:00