xref: /original-bsd/usr.sbin/amd/config/os-aix3.h (revision 52960f3f)
1 /*
2  * Copyright (c) 1990 Jan-Simon Pendry
3  * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
4  * Copyright (c) 1990, 1993
5  *	The Regents of the University of California.  All rights reserved.
6  *
7  * This code is derived from software contributed to Berkeley by
8  * Jan-Simon Pendry at Imperial College, London.
9  *
10  * %sccs.include.redist.c%
11  *
12  *	@(#)os-aix3.h	8.1 (Berkeley) 06/06/93
13  *
14  * $Id: os-aix3.h,v 5.2.2.2 1992/05/31 16:38:49 jsp Exp $
15  *
16  * AIX 3.1 definitions for Amd (automounter)
17  */
18 
19 /*
20  * Does the compiler grok void *
21  */
22 #define	VOIDP
23 
24 /*
25  * Which version of the Sun RPC library we are using
26  * This is the implementation release number, not
27  * the protocol revision number.
28  */
29 #define	RPC_4
30 
31 /*
32  * Which version of the NFS interface are we using.
33  * This is the implementation release number, not
34  * the protocol revision number.
35  */
36 #define	NFS_AIX3
37 
38 /*
39  * Does this OS have NDBM support?
40  */
41 #define OS_HAS_NDBM
42 
43 /*
44  * The mount table is obtained from the kernel
45  */
46 #undef	UPDATE_MTAB
47 
48 /*
49  * Pick up BSD bits from include files
50  * Try for 4.4 compatibility if available (AIX 3.2 and later)
51  */
52 #define	_BSD 44
53 
54 /*
55  * No mntent info on AIX 3
56  */
57 #undef	MNTENT_HDR
58 #define	MNTENT_HDR <sys/mntctl.h>
59 
60 /*
61  * Name of filesystem types
62  */
63 #define	MOUNT_TYPE_NFS	MNT_NFS
64 #define	MOUNT_TYPE_UFS	MNT_JFS
65 #undef MTAB_TYPE_UFS
66 #define	MTAB_TYPE_UFS	"jfs"
67 
68 /*
69  * How to unmount filesystems
70  */
71 #undef MOUNT_TRAP
72 #define	MOUNT_TRAP(type, mnt, flag, mnt_data) \
73 	aix3_mount(mnt->mnt_fsname, mnt->mnt_dir, flag, type, mnt_data, mnt->mnt_opts)
74 #undef	UNMOUNT_TRAP
75 #define	UNMOUNT_TRAP(mnt)	uvmount(mnt->mnt_passno, 0)
76 
77 
78 /*
79  * Byte ordering
80  */
81 #ifndef BYTE_ORDER
82 #include <sys/machine.h>
83 #endif /* BYTE_ORDER */
84 
85 #undef ARCH_ENDIAN
86 #if BYTE_ORDER == LITTLE_ENDIAN
87 #define ARCH_ENDIAN "little"
88 #else
89 #if BYTE_ORDER == BIG_ENDIAN
90 #define ARCH_ENDIAN "big"
91 #else
92 XXX - Probably no hope of running Amd on this machine!
93 #endif /* BIG */
94 #endif /* LITTLE */
95 
96 /*
97  * Miscellaneous AIX 3 bits
98  */
99 #define	NEED_MNTOPT_PARSER
100 #define	SHORT_MOUNT_NAME
101 
102 #define	MNTMAXSTR       128
103 
104 #define	MNTTYPE_UFS	"jfs"		/* Un*x file system */
105 #define	MNTTYPE_NFS	"nfs"		/* network file system */
106 #define	MNTTYPE_IGNORE	"ignore"	/* No type specified, ignore this entry */
107 
108 struct mntent {
109 	char	*mnt_fsname;	/* name of mounted file system */
110 	char	*mnt_dir;	/* file system path prefix */
111 	char	*mnt_type;	/* MNTTYPE_* */
112 	char	*mnt_opts;	/* MNTOPT* */
113 	int	mnt_freq;	/* dump frequency, in days */
114 	int	mnt_passno;	/* pass number on parallel fsck */
115 };
116 
117 #define	NFS_HDR "misc-aix3.h"
118 #define	UFS_HDR "misc-aix3.h"
119 #undef NFS_FH_DREF
120 #define	NFS_FH_DREF(dst, src) { (dst) = *(src); }
121 #undef NFS_SA_DREF
122 #define	NFS_SA_DREF(dst, src) { (dst).addr = *(src); }
123 #define	M_RDONLY MNT_READONLY
124 
125 /*
126  * How to get a mount list
127  */
128 #undef	READ_MTAB_FROM_FILE
129 #define	READ_MTAB_AIX3_STYLE
130 
131 /*
132  * The data for the mount syscall needs the path in addition to the
133  * host name since that is the only source of information about the
134  * mounted filesystem.
135 #define	NFS_ARGS_NEEDS_PATH
136  */
137 
138 #define	NFS_LOMAP	34
139 #define	NFS_HIMAP	99
140 #define NFS_ERROR_MAPPING \
141 static nfs_errormap[] = {	     0,75,77,99,99,99, \
142 			99,99,99,99,99,78,99,99,99,79, \
143 			99,99,70,99,35,36,37,38,39,40, \
144 			41,42,43,44,45,46,47,48,49,50, \
145 			51,52,53,54,55,56,57,58,60,61, \
146 			64,65,99,67,68,62,63,66,69,68, \
147 			99,99,99,71,99,99,99,99,99,99 \
148 			};
149 
150 #define	MOUNT_HELPER_SOURCE "mount_aix.c"
151 
152 /*
153  * Need this too
154  */
155 #include <time.h>
156