2
* See the file LICENSE for redistribution information.
4
* Copyright (c) 1997-2001
5
* Sleepycat Software. All rights reserved.
11
static const char revid[] = "$Id: os_oflags.c,v 11.8 2001/04/27 17:16:24 bostic Exp $";
14
#ifndef NO_SYSTEM_INCLUDES
15
#include <sys/types.h>
25
* Convert open(2) flags to DB flags.
27
* PUBLIC: u_int32_t __db_oflags __P((int));
41
dbflags |= DB_TRUNCATE;
45
* Convert POSIX 1003.1 open(2) mode flags to DB flags. This isn't
46
* an exact science as few POSIX implementations have a flag value
47
* for O_RDONLY, it's simply the lack of a write flag.
50
#define O_ACCMODE (O_RDONLY | O_RDWR | O_WRONLY)
52
switch (oflags & O_ACCMODE) {
65
* Convert a permission string to the correct open(2) flags.
67
* PUBLIC: int __db_omode __P((const char *));
77
#define S_IRUSR S_IREAD /* R for owner */
80
#define S_IWUSR S_IWRITE /* W for owner */
83
#define S_IRGRP 0 /* R for group */
86
#define S_IWGRP 0 /* W for group */
89
#define S_IROTH 0 /* R for other */
92
#define S_IWOTH 0 /* W for other */
96
#define S_IRUSR 0000400 /* R for owner */
97
#define S_IWUSR 0000200 /* W for owner */
98
#define S_IRGRP 0000040 /* R for group */
99
#define S_IWGRP 0000020 /* W for group */
100
#define S_IROTH 0000004 /* R for other */
101
#define S_IWOTH 0000002 /* W for other */
103
#endif /* DB_WIN32 */