posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
POSIX_FILE_SYSTEM

POSIX File System option group. More...

Files

file  dirent.h
 POSIX directory traversal API (<dirent.h>)
 
file  pathconf.h
 POSIX pathname configuration constants (<sys/pathconf.h>)
 
file  stat.h
 POSIX file status types and functions (<sys/stat.h>)
 

Macros

#define NAME_MAX   _XOPEN_NAME_MAX
 Maximum length of a file name component (XSI).
 
#define AT_FDCWD   ZVFS_AT_FDCWD
 Equivalent to "." in the current directory (used with *at() functions).
 
#define AT_EACCESS   ZVFS_AT_EACCESS
 Use effective IDs (faccessat flag).
 
#define AT_SYMLINK_NOFOLLOW   ZVFS_AT_SYMLINK_NOFOLLOW
 Do not follow symbolic links (*at flag).
 
#define AT_SYMLINK_FOLLOW   ZVFS_AT_SYMLINK_FOLLOW
 Follow symbolic links (*at flag).
 
#define AT_REMOVEDIR   ZVFS_AT_REMOVEDIR
 Remove directory (unlinkat flag).
 
#define POSIX_FADV_NORMAL   ZVFS_POSIX_FADV_NORMAL
 No advice (default access pattern).
 
#define POSIX_FADV_RANDOM   ZVFS_POSIX_FADV_RANDOM
 Data will be accessed in random order.
 
#define POSIX_FADV_SEQUENTIAL   ZVFS_POSIX_FADV_SEQUENTIAL
 Data will be accessed sequentially.
 
#define POSIX_FADV_WILLNEED   ZVFS_POSIX_FADV_WILLNEED
 Data will be needed in the near future.
 
#define POSIX_FADV_DONTNEED   ZVFS_POSIX_FADV_DONTNEED
 Data will not be accessed in the near future.
 
#define POSIX_FADV_NOREUSE   ZVFS_POSIX_FADV_NOREUSE
 Data will be accessed only once.
 
#define S_IFMT   ZVFS_MODE_IFMT
 Bit mask for the file type bits in st_mode.
 
#define S_IFBLK   ZVFS_MODE_IFBLK
 Block special file.
 
#define S_IFCHR   ZVFS_MODE_IFCHR
 Character special file.
 
#define S_IFIFO   ZVFS_MODE_IFIFO
 FIFO special file.
 
#define S_IFREG   ZVFS_MODE_IFREG
 Regular file.
 
#define S_IFDIR   ZVFS_MODE_IFDIR
 Directory.
 
#define S_IFLNK   ZVFS_MODE_IFLNK
 Symbolic link.
 
#define S_IFSOCK   ZVFS_MODE_IFSOCK
 Socket.
 
#define S_IFSHM   ZVFS_MODE_IFSHM
 Shared memory object (Zephyr extension).
 
#define S_IRWXU   ZVFS_S_IRWXU
 Read, write, execute permission for owner.
 
#define S_IRUSR   ZVFS_S_IRUSR
 Read permission for owner.
 
#define S_IWUSR   ZVFS_S_IWUSR
 Write permission for owner.
 
#define S_IXUSR   ZVFS_S_IXUSR
 Execute permission for owner.
 
#define S_IRWXG   ZVFS_S_IRWXG
 Read, write, execute permission for group.
 
#define S_IRGRP   ZVFS_S_IRGRP
 Read permission for group.
 
#define S_IWGRP   ZVFS_S_IWGRP
 Write permission for group.
 
#define S_IXGRP   ZVFS_S_IXGRP
 Execute permission for group.
 
#define S_IRWXO   ZVFS_S_IRWXO
 Read, write, execute permission for others.
 
#define S_IROTH   ZVFS_S_IROTH
 Read permission for others.
 
#define S_IWOTH   ZVFS_S_IWOTH
 Write permission for others.
 
#define S_IXOTH   ZVFS_S_IXOTH
 Execute permission for others.
 
#define S_ISUID   ZVFS_S_ISUID
 Set-user-ID bit.
 
#define S_ISGID   ZVFS_S_ISGID
 Set-group-ID bit.
 
#define S_ISVTX   ZVFS_S_ISVTX
 Sticky bit (restricted deletion).
 
#define S_ISBLK(m)   (((m) & S_IFMT) == S_IFBLK)
 Test whether m is a block special file.
 
#define S_ISCHR(m)   (((m) & S_IFMT) == S_IFCHR)
 Test whether m is a character special file.
 
#define S_ISDIR(m)   (((m) & S_IFMT) == S_IFDIR)
 Test whether m is a directory.
 
#define S_ISFIFO(m)   (((m) & S_IFMT) == S_IFIFO)
 Test whether m is a FIFO.
 
#define S_ISREG(m)   (((m) & S_IFMT) == S_IFREG)
 Test whether m is a regular file.
 
#define S_ISLNK(m)   (((m) & S_IFMT) == S_IFLNK)
 Test whether m is a symbolic link.
 
#define S_ISSOCK(m)   (((m) & S_IFMT) == S_IFSOCK)
 Test whether m is a socket.
 
#define S_TYPEISMQ(buf)   (0)
 Test whether the file is a message queue (always 0).
 
#define S_TYPEISSEM(buf)   (0)
 Test whether the file is a semaphore (always 0).
 
#define S_TYPEISSHM(st)   (((st)->st_mode & S_IFMT) == S_IFSHM)
 Test whether the file is a shared memory object.
 
#define S_TYPEISTMO(buf)   (0)
 Test whether the file is a typed memory object (always 0).
 
#define UTIME_NOW   -1
 Set st_atim or st_mtim to the current time (utimensat flag).
 
#define UTIME_OMIT   -2
 Leave st_atim or st_mtim unchanged (utimensat flag).
 
#define F_OK   0
 Test whether the file exists.
 
#define R_OK   4
 Test whether the file may be read.
 
#define W_OK   2
 Test whether the file may be written.
 
#define X_OK   1
 Test whether the file may be executed.
 

Typedefs

typedef void DIR
 Opaque directory stream type.
 

Functions

int alphasort (const struct dirent **d1, const struct dirent **d2)
 Compare two directory entries alphabetically (for use with scandir()).
 
int closedir (DIR *dirp)
 Close a directory stream.
 
int dirfd (DIR *dirp)
 Get the file descriptor for an open directory stream.
 
DIRfdopendir (int fd)
 Open a directory stream for a directory identified by a file descriptor.
 
DIRopendir (const char *dirname)
 Open a directory stream for a named directory.
 
struct direntreaddir (DIR *dirp)
 Read the next entry from a directory stream.
 
int readdir_r (DIR *ZRESTRICT dirp, struct dirent *ZRESTRICT entry, struct dirent **ZRESTRICT result)
 Read a directory entry into a caller-supplied buffer (thread-safe).
 
void rewinddir (DIR *dirp)
 Reset a directory stream to the beginning.
 
int scandir (const char *dir, struct dirent ***namelist, int(*sel)(const struct dirent *), int(*compar)(const struct dirent **, const struct dirent **))
 Scan a directory, optionally filtering and sorting the entries.
 
void seekdir (DIR *dirp, long loc)
 Set the position of a directory stream (XSI extension).
 
long telldir (DIR *dirp)
 Get the current position of a directory stream (XSI extension).
 
int posix_fadvise (int fd, off_t offset, off_t len, int advice)
 Declare an expected access pattern for a file region.
 
int posix_fallocate (int fd, off_t offset, off_t len)
 Guarantee that disk space is allocated for a file region.
 
int chmod (const char *path, mode_t mode)
 Change the mode of a file.
 
int fchmod (int fildes, mode_t mode)
 Change the mode of an open file.
 
int fchmodat (int fd, const char *path, mode_t mode, int flag)
 Change the mode of a file relative to a directory descriptor.
 
int fstat (int fildes, struct stat *buf)
 Get status of an open file.
 
int fstatat (int fd, const char *ZRESTRICT path, struct stat *ZRESTRICT buf, int flag)
 Get status of a file relative to a directory descriptor.
 
int futimens (int fildes, const struct timespec times[2])
 Set file access and modification times of an open file (nanosecond resolution).
 
int lstat (const char *ZRESTRICT path, struct stat *ZRESTRICT buf)
 Get status of a file (does not follow symbolic links).
 
int mkdir (const char *path, mode_t mode)
 Create a directory.
 
int mkdirat (int fd, const char *path, mode_t mode)
 Create a directory relative to a directory descriptor.
 
int mkfifo (const char *path, mode_t mode)
 Create a FIFO special file.
 
int mkfifoat (int fd, const char *path, mode_t mode)
 Create a FIFO special file relative to a directory descriptor.
 
int stat (const char *ZRESTRICT path, struct stat *ZRESTRICT buf)
 Get status of a file by path (follows symbolic links).
 
mode_t umask (mode_t cmask)
 Set the file mode creation mask.
 
int utimensat (int fd, const char *path, const struct timespec times[2], int flag)
 Set file access and modification times relative to a directory descriptor.
 
int access (const char *path, int amode)
 Determine accessibility of a file.
 
int chdir (const char *path)
 Change the current working directory.
 
int chown (const char *path, uid_t owner, gid_t group)
 Change the owner and group of a file.
 
int faccessat (int fd, const char *path, int amode, int flag)
 Determine accessibility of a file relative to a directory descriptor.
 
int fchdir (int fildes)
 Change the current working directory to the directory named by a file descriptor.
 
int fchown (int fildes, uid_t owner, gid_t group)
 Change the owner and group of an open file.
 
int fchownat (int fd, const char *path, uid_t owner, gid_t group, int flag)
 Change owner and group of a file relative to a directory descriptor.
 
long fpathconf (int fildes, int name)
 Determine the value of a configurable limit for an open file.
 
char * getcwd (char *buf, size_t size)
 Get the pathname of the current working directory.
 
int lchown (const char *path, uid_t owner, gid_t group)
 Change the owner and group of a symbolic link.
 
int link (const char *path1, const char *path2)
 Create a hard link.
 
int linkat (int fd1, const char *path1, int fd2, const char *path2, int flag)
 Create a hard link relative to directory file descriptors.
 
long pathconf (const char *path, int name)
 Determine the value of a configurable limit for a file path.
 
ssize_t readlink (const char *restrict path, char *restrict buf, size_t bufsize)
 Read the value of a symbolic link.
 
ssize_t readlinkat (int fd, const char *restrict path, char *restrict buf, size_t bufsize)
 Read the value of a symbolic link relative to a directory descriptor.
 
int rmdir (const char *path)
 Remove an empty directory.
 
int symlink (const char *path1, const char *path2)
 Create a symbolic link.
 
int symlinkat (const char *path1, int fd, const char *path2)
 Create a symbolic link relative to a directory file descriptor.
 
int truncate (const char *path, off_t length)
 Truncate a file on the filesystem to a specified length.
 
int unlink (const char *path)
 Remove a directory entry.
 
int unlinkat (int fd, const char *path, int flag)
 Remove a directory entry relative to a directory file descriptor.
 

Detailed Description

POSIX File System option group.

Covers access(), chdir(), chown(), getcwd(), link(), mkdir(), pathconf(), readlink(), rmdir(), stat(), symlink(), truncate(), unlink(), and related filesystem functions.

Macro Definition Documentation

◆ AT_EACCESS

#define AT_EACCESS   ZVFS_AT_EACCESS

Use effective IDs (faccessat flag).

Definition at line 137 of file fcntl.h.

◆ AT_FDCWD

#define AT_FDCWD   ZVFS_AT_FDCWD

Equivalent to "." in the current directory (used with *at() functions).

Definition at line 135 of file fcntl.h.

◆ AT_REMOVEDIR

#define AT_REMOVEDIR   ZVFS_AT_REMOVEDIR

Remove directory (unlinkat flag).

Definition at line 143 of file fcntl.h.

◆ AT_SYMLINK_FOLLOW

#define AT_SYMLINK_FOLLOW   ZVFS_AT_SYMLINK_FOLLOW

Follow symbolic links (*at flag).

Definition at line 141 of file fcntl.h.

◆ AT_SYMLINK_NOFOLLOW

#define AT_SYMLINK_NOFOLLOW   ZVFS_AT_SYMLINK_NOFOLLOW

Do not follow symbolic links (*at flag).

Definition at line 139 of file fcntl.h.

◆ F_OK

#define F_OK   0

Test whether the file exists.

Definition at line 54 of file unistd.h.

◆ NAME_MAX

#define NAME_MAX   _XOPEN_NAME_MAX

Maximum length of a file name component (XSI).

Definition at line 31 of file dirent.h.

◆ POSIX_FADV_DONTNEED

#define POSIX_FADV_DONTNEED   ZVFS_POSIX_FADV_DONTNEED

Data will not be accessed in the near future.

Definition at line 155 of file fcntl.h.

◆ POSIX_FADV_NOREUSE

#define POSIX_FADV_NOREUSE   ZVFS_POSIX_FADV_NOREUSE

Data will be accessed only once.

Definition at line 157 of file fcntl.h.

◆ POSIX_FADV_NORMAL

#define POSIX_FADV_NORMAL   ZVFS_POSIX_FADV_NORMAL

No advice (default access pattern).

Definition at line 147 of file fcntl.h.

◆ POSIX_FADV_RANDOM

#define POSIX_FADV_RANDOM   ZVFS_POSIX_FADV_RANDOM

Data will be accessed in random order.

Definition at line 149 of file fcntl.h.

◆ POSIX_FADV_SEQUENTIAL

#define POSIX_FADV_SEQUENTIAL   ZVFS_POSIX_FADV_SEQUENTIAL

Data will be accessed sequentially.

Definition at line 151 of file fcntl.h.

◆ POSIX_FADV_WILLNEED

#define POSIX_FADV_WILLNEED   ZVFS_POSIX_FADV_WILLNEED

Data will be needed in the near future.

Definition at line 153 of file fcntl.h.

◆ R_OK

#define R_OK   4

Test whether the file may be read.

Definition at line 59 of file unistd.h.

◆ S_IFBLK

#define S_IFBLK   ZVFS_MODE_IFBLK

Block special file.

Definition at line 136 of file stat.h.

◆ S_IFCHR

#define S_IFCHR   ZVFS_MODE_IFCHR

Character special file.

Definition at line 138 of file stat.h.

◆ S_IFDIR

#define S_IFDIR   ZVFS_MODE_IFDIR

Directory.

Definition at line 144 of file stat.h.

◆ S_IFIFO

#define S_IFIFO   ZVFS_MODE_IFIFO

FIFO special file.

Definition at line 140 of file stat.h.

◆ S_IFLNK

#define S_IFLNK   ZVFS_MODE_IFLNK

Symbolic link.

Definition at line 146 of file stat.h.

◆ S_IFMT

#define S_IFMT   ZVFS_MODE_IFMT

Bit mask for the file type bits in st_mode.

Definition at line 132 of file stat.h.

◆ S_IFREG

#define S_IFREG   ZVFS_MODE_IFREG

Regular file.

Definition at line 142 of file stat.h.

◆ S_IFSHM

#define S_IFSHM   ZVFS_MODE_IFSHM

Shared memory object (Zephyr extension).

Definition at line 150 of file stat.h.

◆ S_IFSOCK

#define S_IFSOCK   ZVFS_MODE_IFSOCK

Socket.

Definition at line 148 of file stat.h.

◆ S_IRGRP

#define S_IRGRP   ZVFS_S_IRGRP

Read permission for group.

Definition at line 164 of file stat.h.

◆ S_IROTH

#define S_IROTH   ZVFS_S_IROTH

Read permission for others.

Definition at line 172 of file stat.h.

◆ S_IRUSR

#define S_IRUSR   ZVFS_S_IRUSR

Read permission for owner.

Definition at line 156 of file stat.h.

◆ S_IRWXG

#define S_IRWXG   ZVFS_S_IRWXG

Read, write, execute permission for group.

Definition at line 162 of file stat.h.

◆ S_IRWXO

#define S_IRWXO   ZVFS_S_IRWXO

Read, write, execute permission for others.

Definition at line 170 of file stat.h.

◆ S_IRWXU

#define S_IRWXU   ZVFS_S_IRWXU

Read, write, execute permission for owner.

Definition at line 154 of file stat.h.

◆ S_ISBLK

#define S_ISBLK (   m)    (((m) & S_IFMT) == S_IFBLK)

Test whether m is a block special file.

Definition at line 187 of file stat.h.

◆ S_ISCHR

#define S_ISCHR (   m)    (((m) & S_IFMT) == S_IFCHR)

Test whether m is a character special file.

Definition at line 190 of file stat.h.

◆ S_ISDIR

#define S_ISDIR (   m)    (((m) & S_IFMT) == S_IFDIR)

Test whether m is a directory.

Definition at line 192 of file stat.h.

◆ S_ISFIFO

#define S_ISFIFO (   m)    (((m) & S_IFMT) == S_IFIFO)

Test whether m is a FIFO.

Definition at line 194 of file stat.h.

◆ S_ISGID

#define S_ISGID   ZVFS_S_ISGID

Set-group-ID bit.

Definition at line 180 of file stat.h.

◆ S_ISLNK

#define S_ISLNK (   m)    (((m) & S_IFMT) == S_IFLNK)

Test whether m is a symbolic link.

Definition at line 198 of file stat.h.

◆ S_ISREG

#define S_ISREG (   m)    (((m) & S_IFMT) == S_IFREG)

Test whether m is a regular file.

Definition at line 196 of file stat.h.

◆ S_ISSOCK

#define S_ISSOCK (   m)    (((m) & S_IFMT) == S_IFSOCK)

Test whether m is a socket.

Definition at line 200 of file stat.h.

◆ S_ISUID

#define S_ISUID   ZVFS_S_ISUID

Set-user-ID bit.

Definition at line 178 of file stat.h.

◆ S_ISVTX

#define S_ISVTX   ZVFS_S_ISVTX

Sticky bit (restricted deletion).

Definition at line 183 of file stat.h.

◆ S_IWGRP

#define S_IWGRP   ZVFS_S_IWGRP

Write permission for group.

Definition at line 166 of file stat.h.

◆ S_IWOTH

#define S_IWOTH   ZVFS_S_IWOTH

Write permission for others.

Definition at line 174 of file stat.h.

◆ S_IWUSR

#define S_IWUSR   ZVFS_S_IWUSR

Write permission for owner.

Definition at line 158 of file stat.h.

◆ S_IXGRP

#define S_IXGRP   ZVFS_S_IXGRP

Execute permission for group.

Definition at line 168 of file stat.h.

◆ S_IXOTH

#define S_IXOTH   ZVFS_S_IXOTH

Execute permission for others.

Definition at line 176 of file stat.h.

◆ S_IXUSR

#define S_IXUSR   ZVFS_S_IXUSR

Execute permission for owner.

Definition at line 160 of file stat.h.

◆ S_TYPEISMQ

#define S_TYPEISMQ (   buf)    (0)

Test whether the file is a message queue (always 0).

Definition at line 205 of file stat.h.

◆ S_TYPEISSEM

#define S_TYPEISSEM (   buf)    (0)

Test whether the file is a semaphore (always 0).

Definition at line 207 of file stat.h.

◆ S_TYPEISSHM

#define S_TYPEISSHM (   st)    (((st)->st_mode & S_IFMT) == S_IFSHM)

Test whether the file is a shared memory object.

Definition at line 209 of file stat.h.

◆ S_TYPEISTMO

#define S_TYPEISTMO (   buf)    (0)

Test whether the file is a typed memory object (always 0).

Definition at line 214 of file stat.h.

◆ UTIME_NOW

#define UTIME_NOW   -1

Set st_atim or st_mtim to the current time (utimensat flag).

Definition at line 218 of file stat.h.

◆ UTIME_OMIT

#define UTIME_OMIT   -2

Leave st_atim or st_mtim unchanged (utimensat flag).

Definition at line 220 of file stat.h.

◆ W_OK

#define W_OK   2

Test whether the file may be written.

Definition at line 64 of file unistd.h.

◆ X_OK

#define X_OK   1

Test whether the file may be executed.

Definition at line 69 of file unistd.h.

Typedef Documentation

◆ DIR

typedef void DIR

Opaque directory stream type.

Definition at line 40 of file dirent.h.

Function Documentation

◆ access()

int access ( const char *  path,
int  amode 
)

◆ alphasort()

int alphasort ( const struct dirent **  d1,
const struct dirent **  d2 
)

Compare two directory entries alphabetically (for use with scandir()).

Parameters
d1First directory entry.
d2Second directory entry.
Returns
Negative, zero, or positive per strcmp() semantics.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/alphasort.html

◆ chdir()

int chdir ( const char *  path)

Change the current working directory.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/chdir.html

◆ chmod()

int chmod ( const char *  path,
mode_t  mode 
)

Change the mode of a file.

◆ chown()

int chown ( const char *  path,
uid_t  owner,
gid_t  group 
)

Change the owner and group of a file.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html

◆ closedir()

int closedir ( DIR dirp)

Close a directory stream.

Parameters
dirpDirectory stream to close.
Returns
0 on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/closedir.html

◆ dirfd()

int dirfd ( DIR dirp)

Get the file descriptor for an open directory stream.

Parameters
dirpDirectory stream.
Returns
File descriptor on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dirfd.html

◆ faccessat()

int faccessat ( int  fd,
const char *  path,
int  amode,
int  flag 
)

Determine accessibility of a file relative to a directory descriptor.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/faccessat.html

◆ fchdir()

int fchdir ( int  fildes)

Change the current working directory to the directory named by a file descriptor.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html

◆ fchmod()

int fchmod ( int  fildes,
mode_t  mode 
)

Change the mode of an open file.

◆ fchmodat()

int fchmodat ( int  fd,
const char *  path,
mode_t  mode,
int  flag 
)

Change the mode of a file relative to a directory descriptor.

◆ fchown()

int fchown ( int  fildes,
uid_t  owner,
gid_t  group 
)

Change the owner and group of an open file.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchown.html

◆ fchownat()

int fchownat ( int  fd,
const char *  path,
uid_t  owner,
gid_t  group,
int  flag 
)

Change owner and group of a file relative to a directory descriptor.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchownat.html

◆ fdopendir()

DIR * fdopendir ( int  fd)

Open a directory stream for a directory identified by a file descriptor.

Parameters
fdFile descriptor for the directory.
Returns
Directory stream on success, or NULL on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdopendir.html

◆ fpathconf()

long fpathconf ( int  fildes,
int  name 
)

Determine the value of a configurable limit for an open file.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fpathconf.html

◆ fstat()

int fstat ( int  fildes,
struct stat buf 
)

Get status of an open file.

◆ fstatat()

int fstatat ( int  fd,
const char *ZRESTRICT  path,
struct stat *ZRESTRICT  buf,
int  flag 
)

Get status of a file relative to a directory descriptor.

◆ futimens()

int futimens ( int  fildes,
const struct timespec  times[2] 
)

Set file access and modification times of an open file (nanosecond resolution).

◆ getcwd()

char * getcwd ( char *  buf,
size_t  size 
)

Get the pathname of the current working directory.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html

◆ lchown()

int lchown ( const char *  path,
uid_t  owner,
gid_t  group 
)

Change the owner and group of a symbolic link.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html

◆ link()

int link ( const char *  path1,
const char *  path2 
)

◆ linkat()

int linkat ( int  fd1,
const char *  path1,
int  fd2,
const char *  path2,
int  flag 
)

Create a hard link relative to directory file descriptors.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/linkat.html

◆ lstat()

int lstat ( const char *ZRESTRICT  path,
struct stat *ZRESTRICT  buf 
)

Get status of a file (does not follow symbolic links).

◆ mkdir()

int mkdir ( const char *  path,
mode_t  mode 
)

Create a directory.

◆ mkdirat()

int mkdirat ( int  fd,
const char *  path,
mode_t  mode 
)

Create a directory relative to a directory descriptor.

◆ mkfifo()

int mkfifo ( const char *  path,
mode_t  mode 
)

Create a FIFO special file.

◆ mkfifoat()

int mkfifoat ( int  fd,
const char *  path,
mode_t  mode 
)

Create a FIFO special file relative to a directory descriptor.

◆ opendir()

DIR * opendir ( const char *  dirname)

Open a directory stream for a named directory.

Parameters
dirnamePath to the directory.
Returns
Directory stream on success, or NULL on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/opendir.html

◆ pathconf()

long pathconf ( const char *  path,
int  name 
)

Determine the value of a configurable limit for a file path.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pathconf.html

◆ posix_fadvise()

int posix_fadvise ( int  fd,
off_t  offset,
off_t  len,
int  advice 
)

Declare an expected access pattern for a file region.

Parameters
fdFile descriptor.
offsetStart of the region.
lenLength of the region in bytes (0 = to EOF).
adviceAccess pattern hint (POSIX_FADV_*).
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_fadvise.html

◆ posix_fallocate()

int posix_fallocate ( int  fd,
off_t  offset,
off_t  len 
)

Guarantee that disk space is allocated for a file region.

Parameters
fdFile descriptor.
offsetStart of the region.
lenLength of the region in bytes.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html

◆ readdir()

struct dirent * readdir ( DIR dirp)

Read the next entry from a directory stream.

Parameters
dirpDirectory stream.
Returns
Pointer to a struct dirent on success, or NULL at end-of-directory or on error.

◆ readdir_r()

int readdir_r ( DIR *ZRESTRICT  dirp,
struct dirent *ZRESTRICT  entry,
struct dirent **ZRESTRICT  result 
)

Read a directory entry into a caller-supplied buffer (thread-safe).

Parameters
dirpDirectory stream.
entryCaller-supplied buffer for the entry.
resultOutput: pointer to entry, or NULL at end-of-directory.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/readdir_r.html

◆ readlink()

ssize_t readlink ( const char *restrict  path,
char *restrict  buf,
size_t  bufsize 
)

◆ readlinkat()

ssize_t readlinkat ( int  fd,
const char *restrict  path,
char *restrict  buf,
size_t  bufsize 
)

Read the value of a symbolic link relative to a directory descriptor.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlinkat.html

◆ rewinddir()

void rewinddir ( DIR dirp)

Reset a directory stream to the beginning.

Parameters
dirpDirectory stream to rewind.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/rewinddir.html

◆ rmdir()

int rmdir ( const char *  path)

◆ scandir()

int scandir ( const char *  dir,
struct dirent ***  namelist,
int(*)(const struct dirent *)  sel,
int(*)(const struct dirent **, const struct dirent **)  compar 
)

Scan a directory, optionally filtering and sorting the entries.

Parameters
dirPath to the directory.
namelistOutput: allocated array of directory entry pointers.
selFilter function, or NULL to include all entries.
comparComparison function for sorting, or NULL for no sorting.
Returns
Number of entries in namelist on success, or -1 on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/scandir.html

◆ seekdir()

void seekdir ( DIR dirp,
long  loc 
)

Set the position of a directory stream (XSI extension).

Parameters
dirpDirectory stream.
locPosition value from telldir().
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/seekdir.html

◆ stat()

int stat ( const char *ZRESTRICT  path,
struct stat *ZRESTRICT  buf 
)

Get status of a file by path (follows symbolic links).

◆ symlink()

int symlink ( const char *  path1,
const char *  path2 
)

◆ symlinkat()

int symlinkat ( const char *  path1,
int  fd,
const char *  path2 
)

Create a symbolic link relative to a directory file descriptor.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/symlinkat.html

◆ telldir()

long telldir ( DIR dirp)

Get the current position of a directory stream (XSI extension).

Parameters
dirpDirectory stream.
Returns
Current position value, or -1 on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/telldir.html

◆ truncate()

int truncate ( const char *  path,
off_t  length 
)

Truncate a file on the filesystem to a specified length.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html

◆ umask()

mode_t umask ( mode_t  cmask)

Set the file mode creation mask.

◆ unlink()

int unlink ( const char *  path)

◆ unlinkat()

int unlinkat ( int  fd,
const char *  path,
int  flag 
)

Remove a directory entry relative to a directory file descriptor.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlinkat.html

◆ utimensat()

int utimensat ( int  fd,
const char *  path,
const struct timespec  times[2],
int  flag 
)

Set file access and modification times relative to a directory descriptor.