[BACK]Return to ksh_stat.h CVS log [TXT][DIR] Up to [local] / src / bin / ksh

File: [local] / src / bin / ksh / Attic / ksh_stat.h (download)

Revision 1.3, Tue Oct 1 02:05:39 1996 UTC (27 years, 8 months ago) by downsj
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4, OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1, OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.2: +3 -3 lines

Integrate pdksh 5.2.9.

/*	$OpenBSD: ksh_stat.h,v 1.3 1996/10/01 02:05:39 downsj Exp $	*/

/* Wrapper around the ugly sys/stat includes/ifdefs */

/* assumes <sys/types.h> already included */
#include <sys/stat.h>

#ifndef HAVE_LSTAT
# define lstat(path, buf)	stat(path, buf)
#endif /* HAVE_LSTAT */

#ifdef STAT_MACROS_BROKEN
# undef S_ISREG
# undef S_ISDIR
# undef S_ISCHR
# undef S_ISBLK
# undef S_ISFIFO
# undef S_ISSOCK
# undef S_ISLNK
#endif /* STAT_MACROS_BROKEN */

#if !defined(S_ISREG) && defined(S_IFREG)
# define S_ISREG(m)	(((m) & S_IFMT) == S_IFREG)
#endif /* S_ISREG */
#if !defined(S_ISDIR) && defined(S_IFDIR)
# define S_ISDIR(m)	(((m) & S_IFMT) == S_IFDIR)
#endif /* S_ISDIR */
#if !defined(S_ISCHR) && defined(S_IFCHR)
# define S_ISCHR(m)	(((m) & S_IFMT) == S_IFCHR)
#endif /* S_ISCHR */
#if !defined(S_ISBLK) && defined(S_IFBLK)
# define S_ISBLK(m)	(((m) & S_IFMT) == S_IFBLK)
#endif /* S_ISBLK */
#if !defined(S_ISFIFO) && defined(S_IFIFO)
# define S_ISFIFO(m)	(((m) & S_IFMT) == S_IFIFO)
#endif /* S_ISFIFO */
#if !defined(S_ISLNK) && defined(S_IFLNK)
# define S_ISLNK(m)	(((m) & S_IFMT) == S_IFLNK)
#endif /* S_ISLNK */
#if !defined(S_ISSOCK) && defined(S_IFSOCK)
# define S_ISSOCK(m)	(((m) & S_IFMT) == S_IFSOCK)
#endif /* S_ISSOCK */
#if !defined(S_ISCDF) && defined(S_CDF)
# define S_ISCDF(m)	(S_ISDIR(m) && ((m) & S_CDF))
#endif /* S_ISSOCK */

#ifndef S_ISVTX
# define S_ISVTX	01000	/* sticky bit */
#endif /* S_ISVTX */

#ifndef S_IXUSR
# define S_IXUSR	00100	/* user execute bit */
#endif /* S_IXUSR */
#ifndef S_IXGRP
# define S_IXGRP	00010	/* user execute bit */
#endif /* S_IXGRP */
#ifndef S_IXOTH
# define S_IXOTH	00001	/* user execute bit */
#endif /* S_IXOTH */