gen-private.h revision 302408
155714Skris/*- 255714Skris * Copyright (c) 1989, 1993 355714Skris * The Regents of the University of California. All rights reserved. 455714Skris * 555714Skris * Redistribution and use in source and binary forms, with or without 655714Skris * modification, are permitted provided that the following conditions 755714Skris * are met: 855714Skris * 1. Redistributions of source code must retain the above copyright 955714Skris * notice, this list of conditions and the following disclaimer. 1055714Skris * 2. Redistributions in binary form must reproduce the above copyright 1155714Skris * notice, this list of conditions and the following disclaimer in the 1255714Skris * documentation and/or other materials provided with the distribution. 1355714Skris * 3. Neither the name of the University nor the names of its contributors 1455714Skris * may be used to endorse or promote products derived from this software 1555714Skris * without specific prior written permission. 1655714Skris * 1755714Skris * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1855714Skris * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1955714Skris * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2055714Skris * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2155714Skris * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2255714Skris * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2355714Skris * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2455714Skris * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2555714Skris * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2655714Skris * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2755714Skris * SUCH DAMAGE. 2855714Skris * 2955714Skris * $FreeBSD: stable/11/lib/libc/gen/gen-private.h 268531 2014-07-11 16:16:26Z jhb $ 3055714Skris */ 3155714Skris 3255714Skris#ifndef _GEN_PRIVATE_H_ 3355714Skris#define _GEN_PRIVATE_H_ 3455714Skris 3555714Skrisstruct _telldir; /* see telldir.h */ 3655714Skrisstruct pthread_mutex; 3755714Skris 3855714Skris/* 3955714Skris * Structure describing an open directory. 4055714Skris * 4155714Skris * NOTE. Change structure layout with care, at least dd_fd field has to 4255714Skris * remain unchanged to guarantee backward compatibility. 4355714Skris */ 4455714Skrisstruct _dirdesc { 4555714Skris int dd_fd; /* file descriptor associated with directory */ 4655714Skris long dd_loc; /* offset in current buffer */ 4755714Skris long dd_size; /* amount of data returned by getdirentries */ 4855714Skris char *dd_buf; /* data buffer */ 4955714Skris int dd_len; /* size of data buffer */ 5055714Skris long dd_seek; /* magic cookie returned by getdirentries */ 5155714Skris int dd_flags; /* flags for readdir */ 5255714Skris struct pthread_mutex *dd_lock; /* lock */ 5355714Skris struct _telldir *dd_td; /* telldir position recording */ 5455714Skris}; 5555714Skris 5655714Skris#define _dirfd(dirp) ((dirp)->dd_fd) 5755714Skris 5855714Skris#endif /* !_GEN_PRIVATE_H_ */ 5955714Skris