Re: [RFC v1] man/man2/at.2: Add page
flat view
From: Alejandro Colomar <alx+linux-man@kernel.org>
Date: 2026-10-23 17:42:09
Also in:
linux-man
at(2) System Calls Manual at(2)
NAME
at - identify a file at directory specified by file de‐
scriptor
SYNOPSIS
#include <fcntl.h> /* Definition of AT_* constants */
long ...at(int dirfd, const char *path, ..., int flags, ...);
DESCRIPTION
The *at() system calls perform an action on a file speci‐
fied by the combination of dirfd, path, and flags.
If path is absolute, then dirfd is ignored.
If path is relative, then it is interpreted relative to
the directory referred to by the file descriptor dirfd.
If path is relative and dirfd is the special value AT_FD‐
CWD, then path is interpreted relative to the current
working directory of the calling process.
The flags argument is a bit mask created by ORing together
0 or more of the following values (some system calls may
support more values).
AT_EMPTY_PATH (since Linux 2.6.39)
If path is an empty string, operate on the file re‐
ferred to by dirfd (which may have been obtained
using the open(2) O_PATH flag). In this case,
dirfd can refer to any type of file, not just a di‐
rectory. If dirfd is AT_FDCWD, the call operates
on the current working directory. This flag is
Linux-specific; define _GNU_SOURCE to obtain its
definition.
AT_SYMLINK_NOFOLLOW
If path is a symbolic link, do not dereference it:
instead operate on the link itself.
ERRORS
Some common errors for these system calls:
EACCES
Search permission is denied on a component of the
path prefix. (See also path_resolution(7).)
EBADF path is relative but dirfd is neither AT_FDCWD nor
a valid file descriptor.
EFAULT
path points outside your accessible address space.
EINVAL
Invalid flags specified in flags.
ELOOP Too many symbolic links were encountered in resolv‐
ing path.
ENAMETOOLONG
path is longer than PATH_MAX.
ENOENT
The file does not exist.
ENOENT
path is an empty string, but AT_EMPTY_PATH is not
specified in flags.
ENOENT
A component of the path prefix is a dangling sym‐
bolic link.
ENOTDIR
A component of the path prefix is not a directory.
ENOTDIR
path is relative and dirfd is a file descriptor re‐
ferring to a file other than a directory.
VERSIONS
On older kernels where these system calls are unavailable,
the glibc wrapper functions emulate them. When path is
relative, glibc constructs a pathname based on the sym‐
bolic link in /proc/self/fd that corresponds to the dirfd
argument.
STANDARDS
TODO.
HISTORY
TODO.
CAVEATS
Most of these system calls are named with an 'at' suffix,
although some new system calls don't have this suffix.
SEE ALSO
openat(2), path_resolution(7), symlink(7)
Linux man-pages (unreleased) (date) at(2)
--
<https://www.alejandro-colomar.es> Attachments
- signature.asc [application/pgp-signature] 833 bytes