1258945Sroberto/*
2280849Scy * Copyright (C) 2004, 2007, 2009  Internet Systems Consortium, Inc. ("ISC")
3258945Sroberto * Copyright (C) 2000, 2001, 2003  Internet Software Consortium.
4258945Sroberto *
5258945Sroberto * Permission to use, copy, modify, and/or distribute this software for any
6258945Sroberto * purpose with or without fee is hereby granted, provided that the above
7258945Sroberto * copyright notice and this permission notice appear in all copies.
8258945Sroberto *
9258945Sroberto * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10258945Sroberto * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11258945Sroberto * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12258945Sroberto * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13258945Sroberto * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14258945Sroberto * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15258945Sroberto * PERFORMANCE OF THIS SOFTWARE.
16258945Sroberto */
17258945Sroberto
18280849Scy/* $Id: stat.h,v 1.9 2009/10/01 23:48:08 tbox Exp $ */
19258945Sroberto
20258945Sroberto#ifndef ISC_STAT_H
21258945Sroberto#define ISC_STAT_H 1
22258945Sroberto
23258945Sroberto#include <sys/stat.h>
24258945Sroberto
25258945Sroberto/* open() under unix allows setting of read/write permissions
26258945Sroberto * at the owner, group and other levels.  These don't exist in NT
27280849Scy * We'll just map them all to the NT equivalent
28258945Sroberto */
29258945Sroberto
30258945Sroberto#define S_IREAD	_S_IREAD	/* read permission, owner */
31258945Sroberto#define S_IWRITE _S_IWRITE	/* write permission, owner */
32258945Sroberto#define S_IEXEC _S_IEXEC	/* execute/search permission, owner */
33258945Sroberto#define S_IRUSR _S_IREAD	/* Owner read permission */
34258945Sroberto#define S_IWUSR _S_IWRITE	/* Owner write permission */
35258945Sroberto#define S_IRGRP _S_IREAD	/* Group read permission */
36258945Sroberto#define S_IWGRP _S_IWRITE	/* Group write permission */
37258945Sroberto#define S_IROTH _S_IREAD	/* Other read permission */
38258945Sroberto#define S_IWOTH _S_IWRITE	/* Other write permission */
39258945Sroberto
40280849Scy#ifndef S_IFMT
41280849Scy# define S_IFMT   _S_IFMT
42280849Scy#endif
43280849Scy#ifndef S_IFDIR
44280849Scy# define S_IFDIR  _S_IFDIR
45280849Scy#endif
46280849Scy#ifndef S_IFCHR
47280849Scy# define S_IFCHR  _S_IFCHR
48280849Scy#endif
49280849Scy#ifndef S_IFREG
50280849Scy# define S_IFREG  _S_IFREG
51280849Scy#endif
52258945Sroberto
53258945Sroberto#ifndef S_ISDIR
54258945Sroberto# define S_ISDIR(m)	(((m) & S_IFMT) == S_IFDIR)
55258945Sroberto#endif
56258945Sroberto#ifndef S_ISREG
57258945Sroberto# define S_ISREG(m)	(((m) & S_IFMT) == S_IFREG)
58258945Sroberto#endif
59258945Sroberto
60258945Sroberto#define O_RDONLY _O_RDONLY
61258945Sroberto#define O_WRONLY _O_WRONLY
62258945Sroberto#define O_RDWR _O_RDWR
63258945Sroberto#define O_APPEND _O_APPEND
64258945Sroberto#define O_CREAT _O_CREAT
65258945Sroberto#define O_TRUNC _O_TRUNC
66258945Sroberto#define O_EXCL _O_EXCL
67258945Sroberto
68258945Sroberto#endif /* ISC_STAT_H */
69