Back to index

glibc  2.9
seekdir.c File Reference
#include <errno.h>
#include <stddef.h>
#include <dirent.h>
#include <unistd.h>
#include "dirstream.h"

Go to the source code of this file.


void seekdir (DIR *dirp, long int pos)

Function Documentation

void seekdir ( DIR *  dirp,
long int  pos 

Definition at line 28 of file seekdir.c.

  __libc_lock_lock (dirp->__lock);
  /* Change our entry index pointer to POS and discard any data already
     read.  The next `readdir' call will notice the empty block and read
     anew from the location in DIRP->__entry_ptr and reset the other state
     variables.  */
  dirp->__entry_ptr = pos;
  dirp->__size = 0;
  __libc_lock_unlock (dirp->__lock);