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