dir3d.c revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major/***********************************************************************
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major* This software is part of the ast package *
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major* Copyright (c) 1989-2011 AT&T Intellectual Property *
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major* and is licensed under the *
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major* Eclipse Public License, Version 1.0 *
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major* by AT&T Intellectual Property *
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major* A copy of the License is available at *
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major* http://www.eclipse.org/org/documents/epl-v10.html *
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major* Information and Software Systems Research *
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major* AT&T Research *
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major* Florham Park NJ *
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major* Glenn Fowler <gsf@research.att.com> *
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major* David Korn <dgk@research.att.com> *
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major* Eduardo Krell <ekrell@adexus.cl> *
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major***********************************************************************/
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major * 3d directory(3)
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major * NOTE: there are 3 limitations to this implementation
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major * (1) opendir() allocates one file descriptor for each directory
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major * view and these remain open until closedir()
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major * (2) telldir() offsets are encoded with the directory view level
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major * and TELLDIR() offset, and the directory view level takes
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major * TABBITS bits, so TELLDIR() offsets are limited to (32-TABBITS)
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major * bits, but that would be one big physical directory
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major * (3) if dirent.d_type supported then directory stat.st_nlink is
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major * inflated to foil viewpath subdirectory counting that would
386650a8957e131311273ee84a4a4113ad5e3fe2Peter Major * skip lower view subdirs not reflected in the top level st_nlink
static int intercepted;
DIR*
register char* path;
int oerrno;
long visits = 0;
intercepted++;
intercepted = 0;
path[n] = 0;
intercepted = 0;
intercepted = 0;
return dirp;
if (dirp)
if (intercepted++)
intercepted--;
intercepted--;
struct dirent*
if (intercepted++)
intercepted--;
intercepted--;
#ifdef D_FILENO
#ifdef D_FILENO
intercepted--;
int lev;
if (intercepted++)
intercepted--;
if (pos)
intercepted--;
if (intercepted++)
intercepted--;
#if !_nosys_readdir64
struct dirent64*
if (intercepted++)
intercepted--;
intercepted--;
#ifdef D_FILENO
#ifdef D_FILENO
intercepted--;
return dp;
int lev;
if (intercepted++)
intercepted--;
if (pos)
intercepted--;
if (intercepted)
#include "dirlib.h"
#if defined(SYS3D_opendir)
#if defined(SYS3D_readdir)
#if defined(SYS3D_seekdir)
#if defined(SYS3D_telldir)
#if defined(SYS3D_closedir)
#ifndef DIRBLKSIZ
#ifdef DIRBLK
#ifdef DIRBUF
#include "getdents.c"
#include "opendir.c"
#include "readdir.c"
#include "telldir.c"
#include "seekdir.c"
#if !_nosys_readdir64
#if defined(SYS3D_readdir64)
#if !_nosys_seekdir64
#if defined(SYS3D_seekdir64)
#if !_nosys_telldir64
#if defined(SYS3D_telldir64)
#include "readdir.c"
#if !_nosys_telldir64
#include "telldir.c"
#if !_nosys_seekdir64
#include "seekdir.c"