summaryrefslogtreecommitdiffstats
path: root/upstream/archlinux/man2/getdents.2
diff options
context:
space:
mode:
Diffstat (limited to 'upstream/archlinux/man2/getdents.2')
-rw-r--r--upstream/archlinux/man2/getdents.215
1 files changed, 10 insertions, 5 deletions
diff --git a/upstream/archlinux/man2/getdents.2 b/upstream/archlinux/man2/getdents.2
index d57204bd..b77e7c81 100644
--- a/upstream/archlinux/man2/getdents.2
+++ b/upstream/archlinux/man2/getdents.2
@@ -8,7 +8,7 @@
.\" Derived from 'readdir.2'.
.\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond <esr@thyrsus.com>
.\"
-.TH getdents 2 2023-10-31 "Linux man-pages 6.06"
+.TH getdents 2 2024-05-02 "Linux man-pages 6.8"
.SH NAME
getdents, getdents64 \- get directory entries
.SH LIBRARY
@@ -67,7 +67,7 @@ structure is declared as follows:
.EX
struct linux_dirent {
unsigned long d_ino; /* Inode number */
- unsigned long d_off; /* Offset to next \fIlinux_dirent\fP */
+ unsigned long d_off; /* Not an offset; see below */
unsigned short d_reclen; /* Length of this \fIlinux_dirent\fP */
char d_name[]; /* Filename (null\-terminated) */
/* length is actually (d_reclen \- 2 \-
@@ -84,8 +84,12 @@ struct linux_dirent {
.I d_ino
is an inode number.
.I d_off
-is the distance from the start of the directory to the start of the next
-.IR linux_dirent .
+is a filesystem-specific value with no specific meaning to user space,
+though on older filesystems it used to be
+the distance from the start of the directory to the start of the next
+.IR linux_dirent ;
+see
+.BR readdir (3) .
.I d_reclen
is the size of this entire
.IR linux_dirent .
@@ -167,7 +171,7 @@ structures of the following type:
.EX
struct linux_dirent64 {
ino64_t d_ino; /* 64\-bit inode number */
- off64_t d_off; /* 64\-bit offset to next structure */
+ off64_t d_off; /* Not an offset; see getdents() */
unsigned short d_reclen; /* Size of this dirent */
unsigned char d_type; /* File type */
char d_name[]; /* Filename (null\-terminated) */
@@ -258,6 +262,7 @@ inode# file type d_reclen d_off d_name
#include <stdio.h>
#include <stdlib.h>
#include <sys/syscall.h>
+#include <sys/types.h>
#include <unistd.h>
\&
struct linux_dirent {