sunos_dirent.h revision 1.4
11.4Smaxv/*	$NetBSD: sunos_dirent.h,v 1.4 2018/12/19 13:57:51 maxv Exp $	 */
21.1Smycroft
31.2Schristos/*-
41.2Schristos * Copyright (c) 1994 The NetBSD Foundation, Inc.
51.1Smycroft * All rights reserved.
61.1Smycroft *
71.2Schristos * This code is derived from software contributed to The NetBSD Foundation
81.2Schristos * by Christos Zoulas.
91.2Schristos *
101.1Smycroft * Redistribution and use in source and binary forms, with or without
111.1Smycroft * modification, are permitted provided that the following conditions
121.1Smycroft * are met:
131.1Smycroft * 1. Redistributions of source code must retain the above copyright
141.1Smycroft *    notice, this list of conditions and the following disclaimer.
151.1Smycroft * 2. Redistributions in binary form must reproduce the above copyright
161.1Smycroft *    notice, this list of conditions and the following disclaimer in the
171.1Smycroft *    documentation and/or other materials provided with the distribution.
181.1Smycroft *
191.2Schristos * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
201.2Schristos * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
211.2Schristos * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
221.2Schristos * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
231.2Schristos * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
241.2Schristos * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
251.2Schristos * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
261.2Schristos * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
271.2Schristos * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
281.2Schristos * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
291.2Schristos * POSSIBILITY OF SUCH DAMAGE.
301.1Smycroft */
311.1Smycroft
321.1Smycroft#ifndef	_SUNOS_DIRENT_H_
331.1Smycroft#define	_SUNOS_DIRENT_H_
341.1Smycroft
351.1Smycroft#define SUNOS_MAXNAMLEN	255
361.1Smycroft
371.1Smycroftstruct sunos_dirent {
381.1Smycroft	long		d_off;
391.1Smycroft	u_long		d_fileno;
401.1Smycroft	u_short		d_reclen;
411.1Smycroft	u_short		d_namlen;
421.1Smycroft	char		d_name[SUNOS_MAXNAMLEN + 1];
431.1Smycroft};
441.1Smycroft
451.1Smycroft#define SUNOS_NAMEOFF(dp)       ((char *)&(dp)->d_name - (char *)dp)
461.1Smycroft#define SUNOS_RECLEN(de,namlen) ALIGN((SUNOS_NAMEOFF(de) + (namlen) + 1))
471.1Smycroft
481.4Smaxv#endif /* !_SUNOS_DIRENT_H_ */
49