summaryrefslogtreecommitdiffstats
path: root/sys/compat/svr4/svr4_fcntl.h
blob: 1a354a799457d92647a2e1b481063a53f4996cd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*-
 * Copyright (c) 1998 Mark Newton
 * Copyright (c) 1994 Christos Zoulas
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 * $FreeBSD$
 */

#ifndef	_SVR4_FCNTL_H_
#define	_SVR4_FCNTL_H_

#include <compat/svr4/svr4_types.h>
#include <sys/fcntl.h>

#define	SVR4_O_RDONLY		0x0000
#define	SVR4_O_WRONLY		0x0001
#define	SVR4_O_RDWR		0x0002
#define	SVR4_O_ACCMODE		0x0003
#define	SVR4_O_NDELAY		0x0004
#define	SVR4_O_APPEND		0x0008
#define	SVR4_O_SYNC		0x0010
#define	SVR4_O_NONBLOCK		0x0080
#define	SVR4_O_CREAT		0x0100
#define	SVR4_O_TRUNC		0x0200
#define	SVR4_O_EXCL		0x0400
#define	SVR4_O_NOCTTY		0x0800
#define	SVR4_O_PRIV		0x1000


#define	SVR4_FD_CLOEXEC		1

#define	SVR4_F_DUPFD		0
#define	SVR4_F_GETFD		1
#define	SVR4_F_SETFD		2
#define	SVR4_F_GETFL		3
#define	SVR4_F_SETFL		4
#define	SVR4_F_GETLK_SVR3	5
#define	SVR4_F_SETLK		6
#define	SVR4_F_SETLKW		7
#define	SVR4_F_CHKFL		8
#define SVR4_F_DUP2FD		9
#define	SVR4_F_ALLOCSP		10
#define	SVR4_F_FREESP		11

#define SVR4_F_ISSTREAM		13
#define	SVR4_F_GETLK		14
#define	SVR4_F_PRIV		15
#define	SVR4_F_NPRIV		16
#define	SVR4_F_QUOTACTL		17
#define	SVR4_F_BLOCKS		18
#define	SVR4_F_BLKSIZE		19
#define SVR4_F_RSETLK		20
#define SVR4_F_RGETLK		21
#define SVR4_F_RSETLKW		22
#define	SVR4_F_GETOWN		23
#define	SVR4_F_SETOWN		24
#define	SVR4_F_REVOKE		25
#define SVR4_F_HASREMOTELOCKS	26
#define SVR4_F_FREESP64		27

#define SVR4_F_GETLK64		33
#define SVR4_F_SETLK64		34
#define SVR4_F_SETLKW64		35

#define SVR4_F_SHARE		40
#define SVR4_F_UNSHARE		41

#define SVR4_F_CHSIZE_XENIX	0x6000
#define SVR4_F_RDCHK_XENIX	0x6001
#define SVR4_F_LK_UNLCK_XENIX	0x6300
#define SVR4_F_LK_LOCK_XENIX	0x7200
#define SVR4_F_LK_NBLCK_XENIX	0x6200
#define SVR4_F_LK_RLCK_XENIX	0x7100
#define SVR4_F_LK_NBRLCK_XENIX	0x6100

#define SVR4_LK_CMDTYPE(x)   (((x) >> 12) & 0x7)
#define SVR4_LK_LCKTYPE(x)   (((x) >> 8) & 0x7)

#define	SVR4_F_RDLCK	1
#define	SVR4_F_WRLCK	2
#define	SVR4_F_UNLCK	3

struct svr4_flock_svr3 {
	short		l_type;
	short		l_whence;
	svr4_off_t	l_start;
	svr4_off_t	l_len;
	short		l_sysid;
	svr4_o_pid_t	l_pid;
};


struct svr4_flock {
	short		l_type;
	short		l_whence;
	svr4_off_t	l_start;
	svr4_off_t	l_len;
	long		l_sysid;
	svr4_pid_t	l_pid;
	long		pad[4];
};

struct svr4_flock64 {
	short		l_type;
	short		l_whence;
	svr4_off64_t	l_start;
	svr4_off64_t	l_len;
	long		l_sysid;
	svr4_pid_t	l_pid;
	long		pad[4];
};
#endif /* !_SVR4_FCNTL_H_ */
OpenPOWER on IntegriCloud