readdir(2) System Calls Manual readdir(2) NAZWA readdir - odczytanie wpisu w katalogu BIBLIOTEKA Standardowa biblioteka C (libc, -lc) SKLADNIA #include /* Definicja stalych SYS_* */ #include int syscall(SYS_readdir, unsigned int fd, struct old_linux_dirent *dirp, unsigned int count); Note: There is no definition of struct old_linux_dirent; see NOTES. OPIS Nie jest to funkcja, ktora cie interesuje. Opis implementacji interfejsu zgodnego z POSIX w bibliotece C znajduje sie w readdir(3). Niniejsza strona opisuje goly interfejs wywolania systemowego, ktory zostal zastapiony przez getdents(2). readdir() reads one old_linux_dirent structure from the directory referred to by the file descriptor fd into the buffer pointed to by dirp. The argument count is ignored; at most one old_linux_dirent structure is read. The old_linux_dirent structure is declared (privately in Linux kernel file fs/readdir.c) as follows: struct old_linux_dirent { unsigned long d_ino; /* numer i-wezla */ unsigned long d_offset; /* offset do tego old_linux_dirent */ unsigned short d_namlen; /* dlugosc tego d_name */ char d_name[1]; /* nazwa pliku (zakonczona znakiem NUL) */ } d_ino jest numerem i-wezla. d_off jest odlegloscia od poczatku katalogu do tego wpisu old_linux_dirent. d_reclen jest rozmiarem d_name, nie liczac konczacego znaku NUL ('\0'). d_name jest zakonczona znakiem NUL nazwa pliku. WARTOSC ZWRACANA On success, 1 is returned. On end of directory, 0 is returned. On error, -1 is returned, and errno is set to indicate the error. BLEDY EBADF Nieprawidlowy deskryptor fd. EFAULT Argument wskazuje poza przestrzen adresowa wywolujacego procesu. EINVAL Bufor na wynik jest za maly. ENOENT Nie ma takiego katalogu. ENOTDIR Deskryptor pliku nie odnosi sie do katalogu. WERSJE You will need to define the old_linux_dirent structure yourself. However, probably you should use readdir(3) instead. This system call does not exist on x86-64. STANDARDY Linux. ZOBACZ TAKZE getdents(2), readdir(3) TLUMACZENIE Autorami polskiego tlumaczenia niniejszej strony podrecznika sa: Przemek Borys i Andrzej Krzysztofowicz Niniejsze tlumaczenie jest wolna dokumentacja. Blizsze informacje o warunkach licencji mozna uzyskac zapoznajac sie z GNU General Public License w wersji 3 lub nowszej. Nie przyjmuje sie ZADNEJ ODPOWIEDZIALNOSCI. Bledy w tlumaczeniu strony podrecznika prosimy zglaszac na adres listy dyskusyjnej . Linux man-pages 6.06 31 pazdziernika 2023 r. readdir(2)