.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright 1995 Andries Brouwer (aeb@cwi.nl) .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Written 11 June 1995 by Andries Brouwer .\" Modified 22 July 1995 by Michael Chastain : .\" Derived from 'readdir.2'. .\" German translation by René Tschirley .\" and Markus Kaufmann .\" .TH GETDENTS 2 "22. Juli 1995" "Linux 1.3.6" "Systemaufrufe" .SH BEZEICHNUNG getdents \- Abfrage von Verzeichniseinträgen .SH ZUSAMMENFASSUNG .nf .B #include .B #include .B #include .sp .B _syscall3(int, getdents, uint, fd, struct dirent *, dirp, uint, count); .sp .BI "int getdents(unsigned int " fd ", struct dirent *" dirp ", unsigned int " count ); .fi .SH BESCHREIBUNG .B getdents liest mehrere .IR dirent \-Strukturen aus dem Verzeichnis, das durch .I fd angegeben ist. Die Struktur wird im Speicherbereich .I dirp abgelegt. Der Parameter .I count gibt die Größe dieses Speicherbereiches an. .PP Die Struktur .I dirent ist definiert durch: .PP .RS .nf struct dirent { long d_ino; /* Inode-Nummer */ off_t d_off; /* Offset zum nächsten \fIdirent\fP */ unsigned short d_reclen; /* Länge dieses \fIdirent\fP */ char d_name [NAME_MAX+1]; /* Dateiname (Null-terminiert) */ } .fi .RE .PP .I d_ino ist die Nummer einer Inode. .I d_off ist die Distanz vom Beginn eines Verzeichnisses zum nächsten .IR dirent . .I d_reclen gibt die Größe dieses gesamten .IR dirent an. .I d_name ist ein mit Null terminierter Dateiname. .PP Diese Funktion ersetzt den Systemaufruf .BR readdir (2). .SH "RÜCKGABEWERT" Bei Erfolg wird die Anzahl der gelesenen Bytes geliefert, wenn am Ende des Verzeichnisses angekommen wurde, wird 0 geliefert, bei aufgetretenem Fehler wird -1 geliefert und .I errno wird entsprechend gesetzt. .SH "FEHLER" .TP .B EBADF .I fd ist kein gültiger Dateideskriptor. .TP .B ENOTDIR Der Dateideskriptor .I fd verweist nicht auf ein Verzeichnis. .SH "SIEHE AUCH" .BR readdir (2), .BR readdir (3).