getdents.c revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
#include "dirlib.h"
#if _dir_ok || _lib_getdents
#else
/*
* getdents
*
* read directory entries into directory block
*
* NOTE: directory entries must fit within DIRBLKSIZ boundaries
*/
#ifndef MAXNAMLEN
#define MAXNAMLEN 255
#endif
#if _lib_dirread
extern int dirread(int, char*, int);
#endif
extern int getdirentries(int, char*, int, long*);
#endif
{
{
return(-1);
}
{
#ifdef ENOTDIR
#else
#endif
return(-1);
}
{
long off;
}
#else
#if _lib_dirread
{
register char* sp; /* system */
char* u;
int n;
int m;
int i;
m = roundof(m, 8);
if (n > 0)
{
sp[n] = 0;
{
i = 0;
if (*sp++)
{
*u = 0;
}
}
}
}
#else
#else
{
register char* s;
register char* u;
int n;
int m;
/*
* we assume sizeof(struct dirent) > sizeof(struct direct)
*/
do
{
{
{
u = tmp;
*u++ = *s++;
*u = 0;
}
sp++;
}
}
#endif
#endif
#endif
}
#endif