1/*
2 * Copyright (C) 2004, 2007  Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 2000, 2001, 2003  Internet Software Consortium.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 * PERFORMANCE OF THIS SOFTWARE.
16 */
17
18/* $Id: stat.h,v 1.7 2007/06/19 23:47:20 tbox Exp $ */
19
20#ifndef ISC_STAT_H
21#define ISC_STAT_H 1
22
23#include <sys/stat.h>
24
25/* open() under unix allows setting of read/write permissions
26 * at the owner, group and other levels.  These don't exist in NT
27 * We'll just map them all to the NT equivalent
28 */
29
30#define S_IREAD	_S_IREAD	/* read permission, owner */
31#define S_IWRITE _S_IWRITE	/* write permission, owner */
32#define S_IEXEC _S_IEXEC	/* execute/search permission, owner */
33#define S_IRUSR _S_IREAD	/* Owner read permission */
34#define S_IWUSR _S_IWRITE	/* Owner write permission */
35#define S_IRGRP _S_IREAD	/* Group read permission */
36#define S_IWGRP _S_IWRITE	/* Group write permission */
37#define S_IROTH _S_IREAD	/* Other read permission */
38#define S_IWOTH _S_IWRITE	/* Other write permission */
39
40#define S_IFMT _S_IFMT		/* file type mask */
41#define S_IFDIR _S_IFDIR	/* directory */
42#define S_IFCHR _S_IFCHR	/* character special */
43#define S_IFIFO _S_IFIFO	/* pipe */
44#define S_IFREG _S_IFREG	/* regular */
45
46#ifndef S_ISDIR
47# define S_ISDIR(m)	(((m) & S_IFMT) == S_IFDIR)
48#endif
49#ifndef S_ISREG
50# define S_ISREG(m)	(((m) & S_IFMT) == S_IFREG)
51#endif
52
53#define O_RDONLY _O_RDONLY
54#define O_WRONLY _O_WRONLY
55#define O_RDWR _O_RDWR
56#define O_APPEND _O_APPEND
57#define O_CREAT _O_CREAT
58#define O_TRUNC _O_TRUNC
59#define O_EXCL _O_EXCL
60
61#endif /* ISC_STAT_H */
62