1 /* $NetBSD: osf1.h,v 1.25.6.1 2005/03/04 16:40:22 skrll Exp $ */
4 * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software
15 * must display the following acknowledgement:
16 * This product includes software developed by Christopher G. Demetriou
17 * for the NetBSD Project.
18 * 4. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #ifndef _COMPAT_OSF1_OSF1_H_
34 #define _COMPAT_OSF1_OSF1_H_
37 * Collected OSF/1 definitions and structures, sorted by OSF/1 header.
38 * Error numbers (errno.h) aren't here, since they're likely to change
39 * (additions) more often.
41 * This file is up to date as of Digital UNIX V4.0.
44 #include <sys/types.h>
45 #include <compat/osf1/osf1_errno.h>
46 #include <compat/osf1/osf1_signal.h>
49 * type and structure definitions used by other structures
52 typedef int16_t osf1_short
;
53 typedef int32_t osf1_int
;
54 typedef int64_t osf1_long
;
55 typedef u_int32_t osf1_u_int
;
57 typedef int32_t osf1_dev_t
;
58 typedef u_int32_t osf1_ino_t
;
59 typedef u_int32_t osf1_mode_t
;
60 typedef u_int16_t osf1_nlink_t
;
61 typedef u_int32_t osf1_uid_t
;
62 typedef u_int32_t osf1_gid_t
;
63 typedef u_int64_t osf1_off_t
;
64 typedef int32_t osf1_time_t
;
65 typedef u_int32_t osf1_uint_t
;
66 typedef u_int64_t osf1_sigset_t
;
67 typedef u_int64_t osf1_size_t
;
68 typedef u_int64_t osf1_fsid_t
;
69 typedef u_int64_t osf1_rlim_t
;
70 typedef void *osf1_data_ptr
; /* XXX hard to fix size */
71 typedef void *osf1_fcn_ptr
; /* XXX hard to fix size, bogus */
72 typedef osf1_int osf1_key_t
;
73 typedef osf1_int osf1_pid_t
;
74 typedef u_int64_t osf1_blksize_t
;
75 typedef u_int64_t osf1_blkcnt_t
;
77 struct osf1_timeval
{ /* time.h */
85 #define OSF1_F_OK 0 /* pseudo-flag */
86 #define OSF1_X_OK 0x01
87 #define OSF1_W_OK 0x02
88 #define OSF1_R_OK 0x04
93 union osf1_auxv_data
{
101 union osf1_auxv_data a_un
;
104 /* auxv entry types */
105 #define OSF1_AT_NULL 0
106 #define OSF1_AT_IGNORE 1
107 #define OSF1_AT_EXECFD 2
108 #define OSF1_AT_PHDR 3
109 #define OSF1_AT_PHENT 4
110 #define OSF1_AT_PHNUM 5
111 #define OSF1_AT_PAGESZ 6
112 #define OSF1_AT_BASE 7
113 #define OSF1_AT_FLAGS 8
114 #define OSF1_AT_ENTRY 9
115 #define OSF1_AT_EXEC_FILENAME 1001
116 #define OSF1_AT_EXEC_LOADER_FILENAME 1002
117 #define OSF1_AT_EXEC_LOADER_FLAGS 1003
120 /* exec.h/ldr_exec.h */
122 #define OSF1_LDR_EXEC_DEFAULT_LOADER "/sbin/loader"
124 /* exec_with_loader()/OSF1_AT_EXEC_LOADER_FLAGS flags regions */
125 #define OSF1_LDR_EXEC_SYSTEM_MASK 0xffff0000
126 #define OSF1_LDR_EXEC_USER_MASK 0xffff0000
128 /* OSF1_AT_EXEC_LOADER_FLAGS flags */
129 #define OSF1_LDR_EXEC_NOPRIVS_F 0x10000000
130 #define OSF1_LDR_EXEC_PTRACE_F 0x20000000
131 #define OSF1_LDR_EXEC_SETGID_F 0x40000000
132 #define OSF1_LDR_EXEC_SETUID_F 0x80000000
138 #define OSF1_F_DUPFD 0
139 #define OSF1_F_GETFD 1 /* uses flags, see below */
140 #define OSF1_F_SETFD 2 /* uses flags, see below */
141 #define OSF1_F_GETFL 3 /* uses flags, see below */
142 #define OSF1_F_SETFL 4 /* uses flags, see below */
143 #define OSF1_F_GETOWN 5
144 #define OSF1_F_SETOWN 6
145 #define OSF1_F_GETLK 7 /* uses osf1_flock, see below */
146 #define OSF1_F_SETLK 8 /* uses osf1_flock, see below */
147 #define OSF1_F_SETLKW 9 /* uses osf1_flock, see below */
148 #define OSF1_F_RGETLK 10 /* [lock mgr op] */
149 #define OSF1_F_RSETLK 11 /* [lock mgr op] */
150 #define OSF1_F_CNVT 12 /* [lock mgr op] */
151 #define OSF1_F_RSETLKW 13 /* [lock mgr op] */
152 #define OSF1_F_PURGEFS 14 /* [lock mgr op] */
153 #define OSF1_F_PURGENFS 15 /* [DECsafe op] */
155 /* fcntl GETFD/SETFD flags */
156 #define OSF1_FD_CLOEXEC 1
158 /* fcntl GETFL/SETFL flags, in addition to the O_* flags below */
159 #define OSF1_FASYNC 0x00000040
161 /* struct osf1_flock, for GETLK/SETLK/SETLKW */
170 /* GETLK/SETLK/SETLKW locking types */
171 #define OSF1_F_RDLCK 1
172 #define OSF1_F_WRLCK 2
173 #define OSF1_F_UNLCK 8
176 #define OSF1_O_RDONLY 0x00000000
177 #define OSF1_O_WRONLY 0x00000001
178 #define OSF1_O_RDWR 0x00000002
179 #define OSF1_O_ACCMODE 0x00000003 /* mask of RD and WR bits */
180 #define OSF1_O_NONBLOCK 0x00000004
181 #define OSF1_O_APPEND 0x00000008
183 #define OSF1_O_DEFER 0x00000020
187 #define OSF1_O_CREAT 0x00000200
188 #define OSF1_O_TRUNC 0x00000400
189 #define OSF1_O_EXCL 0x00000800
190 #define OSF1_O_NOCTTY 0x00001000
191 #define OSF1_O_SYNC 0x00004000
192 #define OSF1_O_NDELAY 0x00008000
193 #define OSF1_O_DRD 0x00008000 /* == O_NDELAY, DON'T USE */
197 #define OSF1_O_DSYNC 0x00080000
198 #define OSF1_O_RSYNC 0x00100000
204 #define OSF1_IOCPARM_MASK 0x1fff
205 #define OSF1_IOCPARM_LEN(x) (((x) >> 16) & OSF1_IOCPARM_MASK)
206 #define OSF1_IOCGROUP(x) (((x) >> 8) & 0xff)
207 #define OSF1_IOCCMD(x) ((x) & 0xff)
209 #define OSF1_IOCPARM_MAX 8192
210 #define OSF1_IOC_VOID 0x20000000
211 #define OSF1_IOC_OUT 0x40000000
212 #define OSF1_IOC_IN 0x80000000
213 #define OSF1_IOC_INOUT (OSF1_IOC_IN|OSF1_IOC_OUT)
214 #define OSF1_IOC_DIRMASK 0xe0000000
219 /* protection mask */
220 #define OSF1_PROT_NONE 0 /* pseudo-flag */
221 #define OSF1_PROT_READ 0x0001
222 #define OSF1_PROT_WRITE 0x0002
223 #define OSF1_PROT_EXEC 0x0004
226 #define OSF1_MAP_SHARED 0x0001
227 #define OSF1_MAP_PRIVATE 0x0002
229 #define OSF1_MAP_FILE 0 /* pseudo-flag */
230 #define OSF1_MAP_ANON 0x0010
231 #define OSF1_MAP_TYPE 0x00f0
233 #define OSF1_MAP_FIXED 0x0100
234 #define OSF1_MAP_VARIABLE 0 /* pseudo-flag */
236 #define OSF1_MAP_HASSEMAPHORE 0x0200
237 #define OSF1_MAP_INHERIT 0x0400
238 #define OSF1_MAP_UNALIGNED 0x0800
240 /* madvise operations */
241 #define OSF1_MADV_NORMAL 0
242 #define OSF1_MADV_RANDOM 1
243 #define OSF1_MADV_SEQUENTIAL 2
244 #define OSF1_MADV_WILLNEED 3
245 #define OSF1_MADV_DONTNEED_COMPAT 4
246 #define OSF1_MADV_SPACEAVAIL 5
247 #define OSF1_MADV_DONTNEED 6
252 /* file system type numbers */
253 #define OSF1_MOUNT_NONE 0
254 #define OSF1_MOUNT_UFS 1
255 #define OSF1_MOUNT_NFS 2
256 #define OSF1_MOUNT_MFS 3
257 #define OSF1_MOUNT_PC 4
258 #define OSF1_MOUNT_S5FS 5
259 #define OSF1_MOUNT_CDFS 6
260 #define OSF1_MOUNT_DFS 7
261 #define OSF1_MOUNT_EFS 8
262 #define OSF1_MOUNT_PROCFS 9
263 #define OSF1_MOUNT_MSFS 10
264 #define OSF1_MOUNT_FFM 11
265 #define OSF1_MOUNT_FDFS 12
266 #define OSF1_MOUNT_ADDON 13
267 #define OSF1_MOUNT_NFS3 14
269 #define OSF1_MNAMELEN 90
271 /* MFS mount argument structure */
272 struct osf1_mfs_args
{
278 /* NFS mount argument structure */
279 struct osf1_nfs_args
{
287 osf1_data_ptr hostname
;
292 osf1_data_ptr netname
;
293 osf1_data_ptr pathconf
;
296 /* NFS mount argument structure flags */
297 #define OSF1_NFSMNT_SOFT 0x00000001
298 #define OSF1_NFSMNT_WSIZE 0x00000002
299 #define OSF1_NFSMNT_RSIZE 0x00000004
300 #define OSF1_NFSMNT_TIMEO 0x00000008
301 #define OSF1_NFSMNT_RETRANS 0x00000010
302 #define OSF1_NFSMNT_HOSTNAME 0x00000020
303 #define OSF1_NFSMNT_INT 0x00000040
304 #define OSF1_NFSMNT_NOCONN 0x00000080
305 #define OSF1_NFSMNT_NOAC 0x00000100
306 #define OSF1_NFSMNT_ACREGMIN 0x00000200
307 #define OSF1_NFSMNT_ACREGMAX 0x00000400
308 #define OSF1_NFSMNT_ACDIRMIN 0x00000800
309 #define OSF1_NFSMNT_ACDIRMAX 0x00001000
310 #define OSF1_NFSMNT_NOCTO 0x00002000
311 #define OSF1_NFSMNT_POSIX 0x00004000
312 #define OSF1_NFSMNT_AUTO 0x00008000
313 #define OSF1_NFSMNT_SEC 0x00010000
314 #define OSF1_NFSMNT_TCP 0x00020000
315 #define OSF1_NFSMNT_PROPLIST 0x00040000
318 /* union of all mount argument structures */
319 union osf1_mount_info
{
320 struct osf1_mfs_args mfs_args
;
321 struct osf1_nfs_args nfs_args
;
325 /* statfs structure */
338 char f_mntonname
[OSF1_MNAMELEN
];
339 char f_mntfromname
[OSF1_MNAMELEN
];
340 union osf1_mount_info mount_info
;
347 #define OSF1_RB_AUTOBOOT 0 /* pseudo-flag */
349 #define OSF1_RB_ASKNAME 0x0001
350 #define OSF1_RB_SINGLE 0x0002
351 #define OSF1_RB_NOSYNC 0x0004
352 #define OSF1_RB_KDB 0x0004 /* == RB_NOSYNC; boot only? */
353 #define OSF1_RB_HALT 0x0008
354 #define OSF1_RB_INITNAME 0x0010
355 #define OSF1_RB_DFLTROOT 0x0020
356 #define OSF1_RB_ALTBOOT 0x0040
357 #define OSF1_RB_UNIPROC 0x0080
358 #define OSF1_RB_PARAM 0x0100
359 #define OSF1_RB_DUMP 0x0200
364 #define OSF1_RUSAGE_THREAD 1
365 #define OSF1_RUSAGE_SELF 0
366 #define OSF1_RUSAGE_CHILDREN -1
369 struct osf1_timeval ru_utime
;
370 struct osf1_timeval ru_stime
;
378 osf1_long ru_inblock
;
379 osf1_long ru_oublock
;
382 osf1_long ru_nsignals
;
387 #define OSF1_RLIMIT_CPU 0
388 #define OSF1_RLIMIT_FSIZE 1
389 #define OSF1_RLIMIT_DATA 2
390 #define OSF1_RLIMIT_STACK 3
391 #define OSF1_RLIMIT_CORE 4
392 #define OSF1_RLIMIT_RSS 5
393 #define OSF1_RLIMIT_NOFILE 6
394 #define OSF1_RLIMIT_AS 7
396 #define OSF1_RLIM_INFINITY 0x7fffffffffffffffL
406 #define OSF1_SEEK_SET 0
407 #define OSF1_SEEK_CUR 1
408 #define OSF1_SEEK_END 2
411 /* signal.h (some in machine/signal.h) */
413 struct osf1_sigaction
{
414 osf1_fcn_ptr osf1_sa_handler
;
415 osf1_sigset_t osf1_sa_mask
;
416 osf1_int osf1_sa_flags
;
417 osf1_int osf1_sa_signo
;
420 /* actually from sysmisc.h */
421 struct osf1_sigaltstack
{
427 /* sigaction flags */
428 #define OSF1_SA_ONSTACK 0x00000001
429 #define OSF1_SA_RESTART 0x00000002
430 #define OSF1_SA_NOCLDSTOP 0x00000004
431 #define OSF1_SA_NODEFER 0x00000008
432 #define OSF1_SA_RESETHAND 0x00000010
433 #define OSF1_SA_NOCLDWAIT 0x00000020
434 #define OSF1_SA_SIGINFO 0x00000040
436 /* sigaltstack flags */
437 #define OSF1_SS_ONSTACK 0x00000001
438 #define OSF1_SS_DISABLE 0x00000002
439 #define OSF1_SS_NOMASK 0x00000004
440 #define OSF1_SS_UCONTEXT 0x00000008
442 /* signal set manipulation macros */
443 #define osf1_sigmask(n) ((osf1_sigset_t)1 << ((n) - 1))
444 #define osf1_sigemptyset(s) (*(s) = (osf1_sigset_t)0)
445 #define osf1_sigismember(s, n) (*(s) & osf1_sigmask(n))
446 #define osf1_sigaddset(s, n) (*(s) |= osf1_sigmask(n))
452 osf1_data_ptr msg_name
;
453 osf1_u_int msg_namelen
;
454 osf1_data_ptr msg_iov
; /* struct osf1_iovec_xopen * */
455 osf1_u_int msg_iovlen
;
456 osf1_data_ptr msg_control
;
457 osf1_u_int msg_controllen
;
461 struct osf1_msghdr_xopen
{
462 osf1_data_ptr msg_name
;
463 osf1_size_t msg_namelen
;
464 osf1_data_ptr msg_iov
; /* struct osf1_iovec_xopen * */
466 osf1_data_ptr msg_control
;
467 osf1_size_t msg_controllen
;
471 /* max message iov len */
472 #define OSF1_MSG_MAXIOVLEN 16
474 /* send/recv-family message flags */
475 #define OSF1_MSG_OOB 0x0001
476 #define OSF1_MSG_PEEK 0x0002
477 #define OSF1_MSG_DONTROUTE 0x0004
478 #define OSF1_MSG_EOR 0x0008
479 #define OSF1_MSG_TRUNC 0x0010
480 #define OSF1_MSG_CTRUNC 0x0020
481 #define OSF1_MSG_WAITALL 0x0040
490 osf1_nlink_t st_nlink
;
495 osf1_time_t st_atime_sec
;
497 osf1_time_t st_mtime_sec
;
499 osf1_time_t st_ctime_sec
;
501 osf1_uint_t st_blksize
;
503 osf1_uint_t st_flags
;
509 osf1_int st_dead1
; /* was st_ino */
511 osf1_nlink_t st_nlink
;
512 osf1_short st_dead2
; /* something to do with nlink? */
518 osf1_time_t st_dead3
;
520 osf1_time_t st_dead4
;
522 osf1_time_t st_dead5
;
526 osf1_uint_t st_flags
;
527 osf1_uint_t st_generation
;
528 osf1_long st_unused1
[4];
531 osf1_time_t st_atime_sec
;
533 osf1_time_t st_mtime_sec
;
535 osf1_time_t st_ctime_sec
;
537 osf1_blksize_t st_blocksize
;
538 osf1_blkcnt_t st_blocks
;
543 #define OSF1_SI_SYSNAME 1
544 #define OSF1_SI_HOSTNAME 2
545 #define OSF1_SI_RELEASE 3
546 #define OSF1_SI_VERSION 4
547 #define OSF1_SI_MACHINE 5
548 #define OSF1_SI_ARCHITECTURE 6
549 #define OSF1_SI_HW_SERIAL 7
550 #define OSF1_SI_HW_PROVIDER 8
551 #define OSF1_SI_SRPC_DOMAIN 9
552 #define OSF1_SI_SET_HOSTNAME 258
553 #define OSF1_SI_SET_SYSNAME 259
554 #define OSF1_SI_SET_SRPC_DOMAIN 265
559 struct osf1_itimerval
{
560 struct osf1_timeval it_interval
;
561 struct osf1_timeval it_value
;
564 #define OSF1_ITIMER_REAL 0
565 #define OSF1_ITIMER_VIRTUAL 1
566 #define OSF1_ITIMER_PROF 2
568 struct osf1_timezone
{
569 osf1_int tz_minuteswest
;
576 #define osf1_major(x) ((((dev_t)(x)) >> 20) & 0x00000fff)
577 #define osf1_minor(x) ((((dev_t)(x)) >> 0) & 0x000fffff)
578 #define osf1_makedev(x,y) ((((dev_t)(x)) << 20) | ((dev_t)(y)))
584 osf1_data_ptr iov_base
;
588 struct osf1_iovec_xopen
{
589 osf1_data_ptr iov_base
;
594 /* unistd.h (user-land header) */
596 #define OSF1__PC_CHOWN_RESTRICTED 10
597 #define OSF1__PC_LINK_MAX 11
598 #define OSF1__PC_MAX_CANON 12
599 #define OSF1__PC_MAX_INPUT 13
600 #define OSF1__PC_NAME_MAX 14
601 #define OSF1__PC_NO_TRUNC 15
602 #define OSF1__PC_PATH_MAX 16
603 #define OSF1__PC_PIPE_BUF 17
604 #define OSF1__PC_VDISABLE 18
609 #define OSF1__SYS_NMLN 32
611 struct osf1_utsname
{
612 char sysname
[OSF1__SYS_NMLN
];
613 char nodename
[OSF1__SYS_NMLN
];
614 char release
[OSF1__SYS_NMLN
];
615 char version
[OSF1__SYS_NMLN
];
616 char machine
[OSF1__SYS_NMLN
];
622 /* wait3() and wait4() options. */
623 #define OSF1_WNOHANG 0x01
624 #define OSF1_WUNTRACED 0x02
626 /* XXX should have status word bits */
629 /* for set/get sysinfo */
631 struct osf1_cpu_info
{
636 u_int64_t cpus_present
;
637 u_int64_t cpus_running
;
638 u_int64_t cpu_binding
;
639 u_int64_t cpu_ex_binding
;
644 #define OSF_SET_IEEE_FP_CONTROL 14
646 #define OSF_GET_MAX_UPROCS 2
647 #define OSF_GET_PHYSMEM 19
648 #define OSF_GET_MAX_CPU 30
649 #define OSF_GET_IEEE_FP_CONTROL 45
650 #define OSF_GET_CPUS_IN_BOX 55
651 #define OSF_GET_CPU_INFO 59
652 #define OSF_GET_PROC_TYPE 60
653 #define OSF_GET_HWRPB 101
654 #define OSF_GET_PLATFORM_NAME 103
656 #endif /* _COMPAT_OSF1_OSF1_H_ */