RTEMS Logo

RTEMS 4.7.2 On-Line Library


Files and Directories Manager getdents - Get directory entries

PREV UP NEXT Bookshelf RTEMS POSIX API User's Guide

4.4.27: getdents - Get directory entries

CALLING SEQUENCE:

#include <unistd.h>
#include <linux/dirent.h>
#include <linux/unistd.h>

long getdents(
  int   dd_fd,
  char *dd_buf,
  int   dd_len
);

STATUS CODES:

A successful call to getdents returns th the number of bytes read. On end of directory, 0 is returned. When an error occurs, -1 is returned, and errno is set appropriately.

EBADF
Invalid file descriptor fd.
EFAULT
Argument points outside the calling process's address space.
EINVAL
Result buffer is too small.
ENOENT
No such directory.
ENOTDIR
File descriptor does not refer to a directory.

DESCRIPTION:

getdents reads several dirent structures from the directory pointed by fd into the memory area pointed to by dirp. The parameter count is the size of the memory area.

NOTES:

NONE


PREV UP NEXT Bookshelf RTEMS POSIX API User's Guide

Copyright © 1988-2004 OAR Corporation