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