144630Smckusick /* 244630Smckusick * Copyright (c) 1990 Jan-Simon Pendry 344630Smckusick * Copyright (c) 1990 Imperial College of Science, Technology & Medicine 461785Sbostic * Copyright (c) 1990, 1993 561785Sbostic * The Regents of the University of California. All rights reserved. 644630Smckusick * 744630Smckusick * This code is derived from software contributed to Berkeley by 844630Smckusick * Jan-Simon Pendry at Imperial College, London. 944630Smckusick * 1044630Smckusick * %sccs.include.redist.c% 1144630Smckusick * 12*69329Spendry * @(#)os-bsd44.h 8.2 (Berkeley) 05/10/95 1349685Spendry * 1452452Spendry * $Id: os-bsd44.h,v 5.2.2.1 1992/02/09 15:10:11 jsp beta $ 1549685Spendry * 1649685Spendry * 4.4 BSD definitions for Amd (automounter) 1744630Smckusick */ 1844630Smckusick 1944630Smckusick /* 2044630Smckusick * Does the compiler grok void * 2144630Smckusick */ 2244630Smckusick #define VOIDP 2344630Smckusick 2444630Smckusick /* 2544630Smckusick * Which version of the Sun RPC library we are using 2644630Smckusick * This is the implementation release number, not 2744630Smckusick * the protocol revision number. 2844630Smckusick */ 2947534Spendry #define RPC_4 3044630Smckusick 31*69329Spendry #include <sys/param.h> 32*69329Spendry #if BSD >= 199506 33*69329Spendry #define NFS_HDR "misc-bsd44l.h" 34*69329Spendry #define UFS_HDR "misc-bsd44l.h" 35*69329Spendry #endif 36*69329Spendry 3744630Smckusick /* 3844630Smckusick * Which version of the NFS interface are we using. 3944630Smckusick * This is the implementation release number, not 4044630Smckusick * the protocol revision number. 4144630Smckusick */ 4244630Smckusick #define NFS_44 4344630Smckusick #define HAS_TCP_NFS 4444630Smckusick 4544630Smckusick /* 4644630Smckusick * Does this OS have NDBM support? 4744630Smckusick */ 4844630Smckusick #define OS_HAS_NDBM 4944630Smckusick 5044630Smckusick /* 5147534Spendry * 4.4 doesn't provide NIS. 5247534Spendry */ 5347534Spendry #undef HAS_NIS_MAPS 5447534Spendry 5547534Spendry /* 5660218Spendry * OS provides strerror() 5760218Spendry */ 5860218Spendry #define HAS_STRERROR 5960218Spendry 6060218Spendry /* 6144630Smckusick * The mount table is obtained from the kernel 6244630Smckusick */ 6344630Smckusick #undef UPDATE_MTAB 6444630Smckusick 6544630Smckusick /* 6644630Smckusick * No mntent info on 4.4 BSD 6744630Smckusick */ 6844630Smckusick #undef MNTENT_HDR 6944630Smckusick 7044630Smckusick /* 7144630Smckusick * Name of filesystem types 7244630Smckusick */ 7344630Smckusick #define MOUNT_TYPE_NFS MOUNT_NFS 7444630Smckusick #define MOUNT_TYPE_UFS MOUNT_UFS 7544630Smckusick #undef MTAB_TYPE_UFS 7644630Smckusick #define MTAB_TYPE_UFS "ufs" 7744630Smckusick #define MTAB_TYPE_MFS "mfs" 7844630Smckusick 7944630Smckusick /* 8044630Smckusick * How to unmount filesystems 8144630Smckusick */ 8244630Smckusick #undef UNMOUNT_TRAP 8344630Smckusick #undef NEED_UMOUNT_FS 8444630Smckusick #define NEED_UMOUNT_BSD 8544630Smckusick 8644630Smckusick /* 8744630Smckusick * How to copy an address into an NFS filehandle 8844630Smckusick */ 8944630Smckusick #undef NFS_SA_DREF 90*69329Spendry #if BSD >= 199506 9144630Smckusick #define NFS_SA_DREF(dst, src) { \ 9244630Smckusick (dst).addr = (struct sockaddr *) (src); \ 9352452Spendry (dst).addrlen = sizeof(*src); \ 9444630Smckusick (dst).sotype = SOCK_DGRAM; \ 9544630Smckusick (dst).proto = 0; \ 96*69329Spendry (dst).fhsize = FHSIZE; \ 97*69329Spendry (dst).wsize = NFS_WSIZE; \ 98*69329Spendry (dst).rsize = NFS_RSIZE; \ 99*69329Spendry (dst).readdirsize = NFS_READDIRSIZE; \ 100*69329Spendry (dst).timeo = 10; \ 101*69329Spendry (dst).retrans = NFS_RETRANS; \ 102*69329Spendry (dst).maxgrouplist = NFS_MAXGRPS; \ 103*69329Spendry (dst).readahead = NFS_DEFRAHEAD; \ 104*69329Spendry (dst).leaseterm = 0; \ 105*69329Spendry (dst).deadthresh = 0; \ 10644630Smckusick } 107*69329Spendry #else 108*69329Spendry #define NFS_SA_DREF(dst, src) { \ 109*69329Spendry (dst).addr = (struct sockaddr *) (src); \ 110*69329Spendry (dst).addrlen = sizeof(*src); \ 111*69329Spendry (dst).sotype = SOCK_DGRAM; \ 112*69329Spendry (dst).proto = 0; \ 113*69329Spendry } 114*69329Spendry #endif 11544630Smckusick 11644630Smckusick /* 11744630Smckusick * Byte ordering 11844630Smckusick */ 11944630Smckusick #ifndef BYTE_ORDER 12044630Smckusick #include <machine/endian.h> 12144630Smckusick #endif /* BYTE_ORDER */ 12244630Smckusick 12344630Smckusick #undef ARCH_ENDIAN 12444630Smckusick #if BYTE_ORDER == LITTLE_ENDIAN 12544630Smckusick #define ARCH_ENDIAN "little" 12644630Smckusick #else 12744630Smckusick #if BYTE_ORDER == BIG_ENDIAN 12844630Smckusick #define ARCH_ENDIAN "big" 12944630Smckusick #else 13044630Smckusick XXX - Probably no hope of running Amd on this machine! 13144630Smckusick #endif /* BIG */ 13244630Smckusick #endif /* LITTLE */ 13344630Smckusick 13444630Smckusick /* 13544630Smckusick * Miscellaneous 4.4 BSD bits 13644630Smckusick */ 13744630Smckusick #define NEED_MNTOPT_PARSER 13844630Smckusick #define SHORT_MOUNT_NAME 13944630Smckusick 14044630Smckusick #define MNTMAXSTR 128 14144630Smckusick 14244630Smckusick #define MNTTYPE_UFS "ufs" /* Un*x file system */ 14344630Smckusick #define MNTTYPE_NFS "nfs" /* network file system */ 14444630Smckusick #define MNTTYPE_MFS "mfs" /* memory file system */ 14544630Smckusick #define MNTTYPE_IGNORE "ignore" /* No type specified, ignore this entry */ 14644630Smckusick 14744630Smckusick #define M_RDONLY MNT_RDONLY 14844630Smckusick #define M_SYNC MNT_SYNCHRONOUS 14944630Smckusick #define M_NOEXEC MNT_NOEXEC 15044630Smckusick #define M_NOSUID MNT_NOSUID 15144630Smckusick #define M_NODEV MNT_NODEV 15244630Smckusick 15344630Smckusick #define MNTOPT_SOFT "soft" /* soft mount */ 15444630Smckusick #define MNTOPT_INTR "intr" /* interrupts allowed */ 15544630Smckusick 15652452Spendry #define NFSMNT_HOSTNAME 0 /* hostname on 4.4 is not optional */ 15752452Spendry 15844630Smckusick struct mntent { 15944630Smckusick char *mnt_fsname; /* name of mounted file system */ 16044630Smckusick char *mnt_dir; /* file system path prefix */ 16144630Smckusick char *mnt_type; /* MNTTYPE_* */ 16244630Smckusick char *mnt_opts; /* MNTOPT* */ 16344630Smckusick int mnt_freq; /* dump frequency, in days */ 16444630Smckusick int mnt_passno; /* pass number on parallel fsck */ 16544630Smckusick }; 16644630Smckusick 16744630Smckusick /* 16844630Smckusick * Type of a file handle 16944630Smckusick */ 17044630Smckusick #undef NFS_FH_TYPE 171*69329Spendry #if BSD >= 199506 172*69329Spendry #define NFS_FH_TYPE void * 173*69329Spendry #else 17444630Smckusick #define NFS_FH_TYPE nfsv2fh_t * 175*69329Spendry #endif 17644630Smckusick 17744630Smckusick /* 17844630Smckusick * How to get a mount list 17944630Smckusick */ 18044630Smckusick #undef READ_MTAB_FROM_FILE 18144630Smckusick #define READ_MTAB_BSD_STYLE 18244630Smckusick 18344630Smckusick /* 18444630Smckusick * The data for the mount syscall needs the path in addition to the 18544630Smckusick * host name since that is the only source of information about the 18644630Smckusick * mounted filesystem. 18744630Smckusick */ 18844630Smckusick #define NFS_ARGS_NEEDS_PATH 18947534Spendry 19047534Spendry /* 19147534Spendry * 4.4 has RE support built in 19247534Spendry */ 19347534Spendry #undef RE_HDR 19447534Spendry #define RE_HDR <regexp.h> 195*69329Spendry 196*69329Spendry #if BSD >= 199506 197*69329Spendry #undef MTYPE_TYPE 198*69329Spendry #define MTYPE_TYPE char * 199*69329Spendry #define MOUNT_NFS "nfs" 200*69329Spendry #define MOUNT_UFS "ffs" 201*69329Spendry #define MOUNT_MFS "mfs" 202*69329Spendry #endif 203