1235647Sgleb/*- 2235647Sgleb * Copyright (c) 1989, 1993 3235647Sgleb * The Regents of the University of California. All rights reserved. 4235647Sgleb * 5235647Sgleb * Redistribution and use in source and binary forms, with or without 6235647Sgleb * modification, are permitted provided that the following conditions 7235647Sgleb * are met: 8235647Sgleb * 1. Redistributions of source code must retain the above copyright 9235647Sgleb * notice, this list of conditions and the following disclaimer. 10235647Sgleb * 2. Redistributions in binary form must reproduce the above copyright 11235647Sgleb * notice, this list of conditions and the following disclaimer in the 12235647Sgleb * documentation and/or other materials provided with the distribution. 13235647Sgleb * 3. Neither the name of the University nor the names of its contributors 14235647Sgleb * may be used to endorse or promote products derived from this software 15235647Sgleb * without specific prior written permission. 16235647Sgleb * 17235647Sgleb * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18235647Sgleb * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19235647Sgleb * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20235647Sgleb * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21235647Sgleb * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22235647Sgleb * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23235647Sgleb * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24235647Sgleb * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25235647Sgleb * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26235647Sgleb * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27235647Sgleb * SUCH DAMAGE. 28235647Sgleb * 29235647Sgleb * $FreeBSD$ 30235647Sgleb */ 31235647Sgleb 32235647Sgleb#ifndef _GEN_PRIVATE_H_ 33235647Sgleb#define _GEN_PRIVATE_H_ 34235647Sgleb 35235647Sglebstruct _telldir; /* see telldir.h */ 36235647Sglebstruct pthread_mutex; 37235647Sgleb 38235647Sgleb/* 39235647Sgleb * Structure describing an open directory. 40235647Sgleb * 41235647Sgleb * NOTE. Change structure layout with care, at least dd_fd field has to 42235647Sgleb * remain unchanged to guarantee backward compatibility. 43235647Sgleb */ 44235647Sglebstruct _dirdesc { 45235647Sgleb int dd_fd; /* file descriptor associated with directory */ 46235647Sgleb long dd_loc; /* offset in current buffer */ 47235647Sgleb long dd_size; /* amount of data returned by getdirentries */ 48235647Sgleb char *dd_buf; /* data buffer */ 49235647Sgleb int dd_len; /* size of data buffer */ 50235647Sgleb long dd_seek; /* magic cookie returned by getdirentries */ 51235647Sgleb int dd_flags; /* flags for readdir */ 52235647Sgleb struct pthread_mutex *dd_lock; /* lock */ 53235647Sgleb struct _telldir *dd_td; /* telldir position recording */ 54235647Sgleb}; 55235647Sgleb 56235647Sgleb#define _dirfd(dirp) ((dirp)->dd_fd) 57235647Sgleb 58235647Sgleb#endif /* !_GEN_PRIVATE_H_ */ 59