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-bsd44.h 8.2 (Berkeley) 05/10/95 13 * 14 * $Id: os-bsd44.h,v 5.2.2.1 1992/02/09 15:10:11 jsp beta $ 15 * 16 * 4.4 BSD 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 #include <sys/param.h> 32 #if BSD >= 199506 33 #define NFS_HDR "misc-bsd44l.h" 34 #define UFS_HDR "misc-bsd44l.h" 35 #endif 36 37 /* 38 * Which version of the NFS interface are we using. 39 * This is the implementation release number, not 40 * the protocol revision number. 41 */ 42 #define NFS_44 43 #define HAS_TCP_NFS 44 45 /* 46 * Does this OS have NDBM support? 47 */ 48 #define OS_HAS_NDBM 49 50 /* 51 * 4.4 doesn't provide NIS. 52 */ 53 #undef HAS_NIS_MAPS 54 55 /* 56 * OS provides strerror() 57 */ 58 #define HAS_STRERROR 59 60 /* 61 * The mount table is obtained from the kernel 62 */ 63 #undef UPDATE_MTAB 64 65 /* 66 * No mntent info on 4.4 BSD 67 */ 68 #undef MNTENT_HDR 69 70 /* 71 * Name of filesystem types 72 */ 73 #define MOUNT_TYPE_NFS MOUNT_NFS 74 #define MOUNT_TYPE_UFS MOUNT_UFS 75 #undef MTAB_TYPE_UFS 76 #define MTAB_TYPE_UFS "ufs" 77 #define MTAB_TYPE_MFS "mfs" 78 79 /* 80 * How to unmount filesystems 81 */ 82 #undef UNMOUNT_TRAP 83 #undef NEED_UMOUNT_FS 84 #define NEED_UMOUNT_BSD 85 86 /* 87 * How to copy an address into an NFS filehandle 88 */ 89 #undef NFS_SA_DREF 90 #if BSD >= 199506 91 #define NFS_SA_DREF(dst, src) { \ 92 (dst).addr = (struct sockaddr *) (src); \ 93 (dst).addrlen = sizeof(*src); \ 94 (dst).sotype = SOCK_DGRAM; \ 95 (dst).proto = 0; \ 96 (dst).fhsize = FHSIZE; \ 97 (dst).wsize = NFS_WSIZE; \ 98 (dst).rsize = NFS_RSIZE; \ 99 (dst).readdirsize = NFS_READDIRSIZE; \ 100 (dst).timeo = 10; \ 101 (dst).retrans = NFS_RETRANS; \ 102 (dst).maxgrouplist = NFS_MAXGRPS; \ 103 (dst).readahead = NFS_DEFRAHEAD; \ 104 (dst).leaseterm = 0; \ 105 (dst).deadthresh = 0; \ 106 } 107 #else 108 #define NFS_SA_DREF(dst, src) { \ 109 (dst).addr = (struct sockaddr *) (src); \ 110 (dst).addrlen = sizeof(*src); \ 111 (dst).sotype = SOCK_DGRAM; \ 112 (dst).proto = 0; \ 113 } 114 #endif 115 116 /* 117 * Byte ordering 118 */ 119 #ifndef BYTE_ORDER 120 #include <machine/endian.h> 121 #endif /* BYTE_ORDER */ 122 123 #undef ARCH_ENDIAN 124 #if BYTE_ORDER == LITTLE_ENDIAN 125 #define ARCH_ENDIAN "little" 126 #else 127 #if BYTE_ORDER == BIG_ENDIAN 128 #define ARCH_ENDIAN "big" 129 #else 130 XXX - Probably no hope of running Amd on this machine! 131 #endif /* BIG */ 132 #endif /* LITTLE */ 133 134 /* 135 * Miscellaneous 4.4 BSD bits 136 */ 137 #define NEED_MNTOPT_PARSER 138 #define SHORT_MOUNT_NAME 139 140 #define MNTMAXSTR 128 141 142 #define MNTTYPE_UFS "ufs" /* Un*x file system */ 143 #define MNTTYPE_NFS "nfs" /* network file system */ 144 #define MNTTYPE_MFS "mfs" /* memory file system */ 145 #define MNTTYPE_IGNORE "ignore" /* No type specified, ignore this entry */ 146 147 #define M_RDONLY MNT_RDONLY 148 #define M_SYNC MNT_SYNCHRONOUS 149 #define M_NOEXEC MNT_NOEXEC 150 #define M_NOSUID MNT_NOSUID 151 #define M_NODEV MNT_NODEV 152 153 #define MNTOPT_SOFT "soft" /* soft mount */ 154 #define MNTOPT_INTR "intr" /* interrupts allowed */ 155 156 #define NFSMNT_HOSTNAME 0 /* hostname on 4.4 is not optional */ 157 158 struct mntent { 159 char *mnt_fsname; /* name of mounted file system */ 160 char *mnt_dir; /* file system path prefix */ 161 char *mnt_type; /* MNTTYPE_* */ 162 char *mnt_opts; /* MNTOPT* */ 163 int mnt_freq; /* dump frequency, in days */ 164 int mnt_passno; /* pass number on parallel fsck */ 165 }; 166 167 /* 168 * Type of a file handle 169 */ 170 #undef NFS_FH_TYPE 171 #if BSD >= 199506 172 #define NFS_FH_TYPE void * 173 #else 174 #define NFS_FH_TYPE nfsv2fh_t * 175 #endif 176 177 /* 178 * How to get a mount list 179 */ 180 #undef READ_MTAB_FROM_FILE 181 #define READ_MTAB_BSD_STYLE 182 183 /* 184 * The data for the mount syscall needs the path in addition to the 185 * host name since that is the only source of information about the 186 * mounted filesystem. 187 */ 188 #define NFS_ARGS_NEEDS_PATH 189 190 /* 191 * 4.4 has RE support built in 192 */ 193 #undef RE_HDR 194 #define RE_HDR <regexp.h> 195 196 #if BSD >= 199506 197 #undef MTYPE_TYPE 198 #define MTYPE_TYPE char * 199 #define MOUNT_NFS "nfs" 200 #define MOUNT_UFS "ffs" 201 #define MOUNT_MFS "mfs" 202 #endif 203