Files
oldlinux-files/Ref-docs/syscalls/syscalls_25.html
2024-02-19 00:21:47 -05:00

31 lines
1.5 KiB
HTML

<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - readdir</TITLE>
<P>Go to the <A HREF="syscalls_24.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_24.html">previous</A>, <A HREF="syscalls_26.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_26.html">next</A> section.<P>
<H2><A NAME="SEC25" HREF="syscalls_toc.html#SEC25" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC25">readdir</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>struct dirent *readdir(DIR *<VAR>dir</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>dir</VAR>: [in] the file descriptor of a directory.
<P>
<H3>DESCRIPTION</H3>
<P>
This call returns in a <CODE>dirent</CODE> structure the next entry of a
directory or <CODE>NULL</CODE> if the end is reached or an error occurs. The
area where the pointer returned by readdir points to is a static space
that is overwritten by subsequent calls to readdir.
<P>
(It there no way to implement that call in user space???)
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns a pointer to the <CODE>dirent</CODE> structure. On error,
returns -1 and sets <CODE>errno</CODE> to the following value: <CODE>EBADF</CODE>.
<P>
<P>Go to the <A HREF="syscalls_24.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_24.html">previous</A>, <A HREF="syscalls_26.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_26.html">next</A> section.<P>