1*c0b5d9fbSchristos /*	$NetBSD: stat.h,v 1.5 2022/09/23 12:15:35 christos Exp $	*/
2e2b1b9c0Schristos 
3e2b1b9c0Schristos /*
4e2b1b9c0Schristos  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
5e2b1b9c0Schristos  *
6*c0b5d9fbSchristos  * SPDX-License-Identifier: MPL-2.0
7*c0b5d9fbSchristos  *
8e2b1b9c0Schristos  * This Source Code Form is subject to the terms of the Mozilla Public
9e2b1b9c0Schristos  * License, v. 2.0.  If a copy of the MPL was not distributed with this
1073584a28Schristos  * file, you can obtain one at https://mozilla.org/MPL/2.0/.
11e2b1b9c0Schristos  *
12e2b1b9c0Schristos  * See the COPYRIGHT file distributed with this work for additional
13e2b1b9c0Schristos  * information regarding copyright ownership.
14e2b1b9c0Schristos  */
15e2b1b9c0Schristos 
16e2b1b9c0Schristos #ifndef ISC_STAT_H
17e2b1b9c0Schristos #define ISC_STAT_H 1
18e2b1b9c0Schristos 
19e2b1b9c0Schristos #include <sys/stat.h>
20e2b1b9c0Schristos 
21e2b1b9c0Schristos /*
22e2b1b9c0Schristos  * Windows doesn't typedef this.
23e2b1b9c0Schristos  */
24e2b1b9c0Schristos typedef unsigned short mode_t;
25e2b1b9c0Schristos 
26e2b1b9c0Schristos /* open() under unix allows setting of read/write permissions
27e2b1b9c0Schristos  * at the owner, group and other levels.  These don't exist in NT
28e2b1b9c0Schristos  * We'll just map them all to the NT equivalent
29e2b1b9c0Schristos  */
30e2b1b9c0Schristos 
31e2b1b9c0Schristos #define S_IREAD	 _S_IREAD  /* read permission, owner */
32e2b1b9c0Schristos #define S_IWRITE _S_IWRITE /* write permission, owner */
33e2b1b9c0Schristos #define S_IRUSR	 _S_IREAD  /* Owner read permission */
34e2b1b9c0Schristos #define S_IWUSR	 _S_IWRITE /* Owner write permission */
35e2b1b9c0Schristos #define S_IRGRP	 _S_IREAD  /* Group read permission */
36e2b1b9c0Schristos #define S_IWGRP	 _S_IWRITE /* Group write permission */
37e2b1b9c0Schristos #define S_IROTH	 _S_IREAD  /* Other read permission */
38e2b1b9c0Schristos #define S_IWOTH	 _S_IWRITE /* Other write permission */
39e2b1b9c0Schristos 
40e2b1b9c0Schristos #ifndef S_IFMT
41e2b1b9c0Schristos #define S_IFMT _S_IFMT
429742fdb4Schristos #endif /* ifndef S_IFMT */
43e2b1b9c0Schristos #ifndef S_IFDIR
44e2b1b9c0Schristos #define S_IFDIR _S_IFDIR
459742fdb4Schristos #endif /* ifndef S_IFDIR */
46e2b1b9c0Schristos #ifndef S_IFCHR
47e2b1b9c0Schristos #define S_IFCHR _S_IFCHR
489742fdb4Schristos #endif /* ifndef S_IFCHR */
49e2b1b9c0Schristos #ifndef S_IFREG
50e2b1b9c0Schristos #define S_IFREG _S_IFREG
519742fdb4Schristos #endif /* ifndef S_IFREG */
52e2b1b9c0Schristos 
53e2b1b9c0Schristos #ifndef S_ISDIR
54e2b1b9c0Schristos #define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
559742fdb4Schristos #endif /* ifndef S_ISDIR */
56e2b1b9c0Schristos #ifndef S_ISREG
57e2b1b9c0Schristos #define S_ISREG(m) (((m)&S_IFMT) == S_IFREG)
589742fdb4Schristos #endif /* ifndef S_ISREG */
59e2b1b9c0Schristos 
60e2b1b9c0Schristos #endif /* ISC_STAT_H */
61