diff --git a/usr.sbin/amd/amd/amd.c b/usr.sbin/amd/amd/amd.c index 4a565b5ef41f..5d2b082a802e 100644 --- a/usr.sbin/amd/amd/amd.c +++ b/usr.sbin/amd/amd/amd.c @@ -1,345 +1,346 @@ /* * Copyright (c) 1989 Jan-Simon Pendry * Copyright (c) 1989 Imperial College of Science, Technology & Medicine * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Jan-Simon Pendry at Imperial College, London. * * 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. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. * * @(#)amd.c 8.1 (Berkeley) 6/6/93 * - * $Id: amd.c,v 1.1.1.1 1994/05/26 05:22:00 rgrimes Exp $ + * $Id: amd.c,v 1.2 1995/08/24 10:22:06 dfr Exp $ * */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 1989, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ /* * Automounter */ #include "am.h" #include #include #include +#include #include char pid_fsname[16 + MAXHOSTNAMELEN]; /* "kiska.southseas.nz:(pid%d)" */ char *progname; /* "amd" */ #ifdef HAS_HOST #ifdef HOST_EXEC char *host_helper; #endif /* HOST_EXEC */ #endif /* HAS_HOST */ char *auto_dir = "/a"; char *hostdomain = "unknown.domain"; char hostname[MAXHOSTNAMELEN] = "localhost"; /* Hostname */ char hostd[2*MAXHOSTNAMELEN]; /* Host+domain */ char *op_sys = OS_REP; /* Name of current op_sys */ char *arch = ARCH_REP; /* Name of current architecture */ char *endian = ARCH_ENDIAN; /* Big or Little endian */ char *wire; int foreground = 1; /* This is the top-level server */ int mypid; /* Current process id */ int immediate_abort; /* Should close-down unmounts be retried */ struct in_addr myipaddr; /* (An) IP address of this host */ serv_state amd_state; struct amd_stats amd_stats; /* Server statistics */ time_t do_mapc_reload = 0; /* mapc_reload() call required? */ jmp_buf select_intr; int select_intr_valid; int orig_umask; /* * Signal handler: * SIGINT - tells amd to do a full shutdown, including unmounting all filesystem. * SIGTERM - tells amd to shutdown now. Just unmounts the automount nodes. */ static void sigterm(sig) int sig; { #ifdef SYS5_SIGNALS signal(sig, sigterm); #endif /* SYS5_SIGNALS */ switch (sig) { case SIGINT: immediate_abort = 15; break; case SIGTERM: immediate_abort = -1; /* fall through... */ default: plog(XLOG_WARNING, "WARNING: automounter going down on signal %d", sig); break; } if (select_intr_valid) longjmp(select_intr, sig); } /* * Hook for cache reload. * When a SIGHUP arrives it schedules a call to mapc_reload */ /*ARGSUSED*/ static void sighup(sig) int sig; { #ifdef SYS5_SIGNALS signal(sig, sighup); #endif /* SYS5_SIGNALS */ #ifdef DEBUG if (sig != SIGHUP) dlog("spurious call to sighup"); #endif /* DEBUG */ /* * Force a reload by zero'ing the timer */ if (amd_state == Run) do_mapc_reload = 0; } /*ARGSUSED*/ static void parent_exit(sig) int sig; { exit(0); } static int daemon_mode(P_void) { int bgpid; signal(SIGQUIT, parent_exit); bgpid = background(); if (bgpid != 0) { if (print_pid) { printf("%d\n", bgpid); fflush(stdout); } /* * Now wait for the automount points to * complete. */ for (;;) pause(); } signal(SIGQUIT, SIG_DFL); /* * Pretend we are in the foreground again */ foreground = 1; #ifdef TIOCNOTTY { int t = open("/dev/tty", O_RDWR); if (t < 0) { if (errno != ENXIO) /* not an error if already no controlling tty */ plog(XLOG_WARNING, "Could not open controlling tty: %m"); } else { if (ioctl(t, TIOCNOTTY, 0) < 0 && errno != ENOTTY) plog(XLOG_WARNING, "Could not disassociate tty (TIOCNOTTY): %m"); (void) close(t); } } #else (void) setpgrp(); #endif /* TIOCNOTTY */ return getppid(); } main(argc, argv) int argc; char *argv[]; { char *domdot; int ppid = 0; int error; /* * Make sure some built-in assumptions are true before we start */ assert(sizeof(nfscookie) >= sizeof (unsigned int)); assert(sizeof(int) >= 4); /* * Set processing status. */ amd_state = Start; /* * Determine program name */ if (argv[0]) { progname = strrchr(argv[0], '/'); if (progname && progname[1]) progname++; else progname = argv[0]; } if (!progname) progname = "amd"; /* * Initialise process id. This is kept * cached since it is used for generating * and using file handles. */ mypid = getpid(); /* * Get local machine name */ if (gethostname(hostname, sizeof(hostname)) < 0) { plog(XLOG_FATAL, "gethostname: %m"); going_down(1); } /* * Check it makes sense */ if (!*hostname) { plog(XLOG_FATAL, "host name is not set"); going_down(1); } /* * Partially initialise hostd[]. This * is completed in get_args(). */ if (domdot = strchr(hostname, '.')) { /* * Hostname already contains domainname. * Split out hostname and domainname * components */ *domdot++ = '\0'; hostdomain = domdot; } strcpy(hostd, hostname); /* * Trap interrupts for shutdowns. */ (void) signal(SIGINT, sigterm); /* * Hangups tell us to reload the cache */ (void) signal(SIGHUP, sighup); /* * Trap Terminate so that we can shutdown gracefully (some chance) */ (void) signal(SIGTERM, sigterm); /* * Trap Death-of-a-child. These allow us to * pick up the exit status of backgrounded mounts. * See "sched.c". */ (void) signal(SIGCHLD, sigchld); /* * Fix-up any umask problems. Most systems default * to 002 which is not too convenient for our purposes */ orig_umask = umask(0); /* * Figure out primary network name */ wire = getwire(); /* * Determine command-line arguments */ get_args(argc, argv); /* * Get our own IP address so that we * can mount the automounter. */ { struct sockaddr_in sin; get_myaddress(&sin); myipaddr.s_addr = sin.sin_addr.s_addr; } /* * Now check we are root. */ if (geteuid() != 0) { plog(XLOG_FATAL, "Must be root to mount filesystems (euid = %d)", geteuid()); going_down(1); } #ifdef HAS_NIS_MAPS /* * If the domain was specified then bind it here * to circumvent any default bindings that may * be done in the C library. */ if (domain && yp_bind(domain)) { plog(XLOG_FATAL, "Can't bind to domain \"%s\"", domain); going_down(1); } #endif /* HAS_NIS_MAPS */ #ifdef DEBUG Debug(D_DAEMON) #endif /* DEBUG */ ppid = daemon_mode(); sprintf(pid_fsname, "%s:(pid%d)", hostname, mypid); do_mapc_reload = clocktime() + ONE_HOUR; /* * Register automounter with system */ error = mount_automounter(ppid); if (error && ppid) kill(SIGALRM, ppid); going_down(error); abort(); } diff --git a/usr.sbin/amd/amd/misc_rpc.c b/usr.sbin/amd/amd/misc_rpc.c index e982f786f092..e7c9f396424f 100644 --- a/usr.sbin/amd/amd/misc_rpc.c +++ b/usr.sbin/amd/amd/misc_rpc.c @@ -1,333 +1,333 @@ /* * Copyright (c) 1990 Jan-Simon Pendry * Copyright (c) 1990 Imperial College of Science, Technology & Medicine * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Jan-Simon Pendry at Imperial College, London. * * 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. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. * * @(#)misc_rpc.c 8.1 (Berkeley) 6/6/93 * - * $Id: misc_rpc.c,v 1.1.1.1 1994/05/26 05:22:01 rgrimes Exp $ + * $Id: misc_rpc.c,v 1.2 1995/05/30 03:45:51 rgrimes Exp $ * */ /* * Additions to Sun RPC. */ #include "am.h" void rpc_msg_init P((struct rpc_msg *mp, u_long prog, u_long vers, u_long proc)); void rpc_msg_init(mp, prog, vers, proc) struct rpc_msg *mp; unsigned long prog, vers, proc; { /* * Initialise the message */ bzero((voidp) mp, sizeof(*mp)); mp->rm_xid = 0; mp->rm_direction = CALL; mp->rm_call.cb_rpcvers = RPC_MSG_VERSION; mp->rm_call.cb_prog = prog; mp->rm_call.cb_vers = vers; mp->rm_call.cb_proc = proc; } /* * Field reply to call to mountd */ int pickup_rpc_reply P((voidp pkt, int len, voidp where, xdrproc_t where_xdr)); int pickup_rpc_reply(pkt, len, where, where_xdr) voidp pkt; int len; voidp where; xdrproc_t where_xdr; { XDR reply_xdr; int ok; struct rpc_err err; struct rpc_msg reply_msg; int error = 0; /*bzero((voidp) &err, sizeof(err));*/ bzero((voidp) &reply_msg, sizeof(reply_msg)); reply_msg.acpted_rply.ar_results.where = (caddr_t) where; reply_msg.acpted_rply.ar_results.proc = where_xdr; xdrmem_create(&reply_xdr, pkt, len, XDR_DECODE); ok = xdr_replymsg(&reply_xdr, &reply_msg); if (!ok) { error = EIO; goto drop; } _seterr_reply(&reply_msg, &err); if (err.re_status != RPC_SUCCESS) { error = EIO; goto drop; } drop: if (reply_msg.rm_reply.rp_stat == MSG_ACCEPTED && reply_msg.acpted_rply.ar_verf.oa_base) { reply_xdr.x_op = XDR_FREE; (void)xdr_opaque_auth(&reply_xdr, &reply_msg.acpted_rply.ar_verf); } xdr_destroy(&reply_xdr); return error; } int make_rpc_packet P((char *buf, int buflen, unsigned long proc, struct rpc_msg *mp, voidp arg, xdrproc_t arg_xdr, AUTH *auth)); int make_rpc_packet(buf, buflen, proc, mp, arg, arg_xdr, auth) char *buf; int buflen; unsigned long proc; struct rpc_msg *mp; voidp arg; xdrproc_t arg_xdr; AUTH *auth; { XDR msg_xdr; int len; xdrmem_create(&msg_xdr, buf, buflen, XDR_ENCODE); /* * Basic protocol header */ if (!xdr_callhdr(&msg_xdr, mp)) return -EIO; /* * Called procedure number */ - if (!xdr_enum(&msg_xdr, &proc)) + if (!xdr_enum(&msg_xdr, (enum_t *)&proc)) return -EIO; /* * Authorization */ if (!AUTH_MARSHALL(auth, &msg_xdr)) return -EIO; /* * Arguments */ if (!(*arg_xdr)(&msg_xdr, arg)) return -EIO; /* * Determine length */ len = xdr_getpos(&msg_xdr); /* * Throw away xdr */ xdr_destroy(&msg_xdr); return len; } /* * Early RPC seems to be missing these.. * Extracted from the RPC 3.9 sources as indicated */ #ifdef NEED_XDR_POINTER /* @(#)xdr_reference.c 1.1 87/11/04 3.9 RPCSRC */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape * media and as a part of the software program in whole or part. Users * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 */ /* * xdr_pointer(): * * XDR a pointer to a possibly recursive data structure. This * differs with xdr_reference in that it can serialize/deserialiaze * trees correctly. * * What's sent is actually a union: * * union object_pointer switch (boolean b) { * case TRUE: object_data data; * case FALSE: void nothing; * } * * > objpp: Pointer to the pointer to the object. * > obj_size: size of the object. * > xdr_obj: routine to XDR an object. * */ bool_t xdr_pointer(xdrs,objpp,obj_size,xdr_obj) register XDR *xdrs; char **objpp; u_int obj_size; xdrproc_t xdr_obj; { bool_t more_data; more_data = (*objpp != NULL); if (! xdr_bool(xdrs,&more_data)) { return (FALSE); } if (! more_data) { *objpp = NULL; return (TRUE); } return (xdr_reference(xdrs,objpp,obj_size,xdr_obj)); } #endif /* NEED_XDR_POINTER */ #ifdef NEED_CLNT_SPERRNO /* @(#)clnt_perror.c 1.1 87/11/04 3.9 RPCSRC */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape * media and as a part of the software program in whole or part. Users * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 */ struct rpc_errtab { enum clnt_stat status; char *message; }; static struct rpc_errtab rpc_errlist[] = { { RPC_SUCCESS, "RPC: Success" }, { RPC_CANTENCODEARGS, "RPC: Can't encode arguments" }, { RPC_CANTDECODERES, "RPC: Can't decode result" }, { RPC_CANTSEND, "RPC: Unable to send" }, { RPC_CANTRECV, "RPC: Unable to receive" }, { RPC_TIMEDOUT, "RPC: Timed out" }, { RPC_VERSMISMATCH, "RPC: Incompatible versions of RPC" }, { RPC_AUTHERROR, "RPC: Authentication error" }, { RPC_PROGUNAVAIL, "RPC: Program unavailable" }, { RPC_PROGVERSMISMATCH, "RPC: Program/version mismatch" }, { RPC_PROCUNAVAIL, "RPC: Procedure unavailable" }, { RPC_CANTDECODEARGS, "RPC: Server can't decode arguments" }, { RPC_SYSTEMERROR, "RPC: Remote system error" }, { RPC_UNKNOWNHOST, "RPC: Unknown host" }, /* { RPC_UNKNOWNPROTO, "RPC: Unknown protocol" },*/ { RPC_PMAPFAILURE, "RPC: Port mapper failure" }, { RPC_PROGNOTREGISTERED, "RPC: Program not registered"}, { RPC_FAILED, "RPC: Failed (unspecified error)"} }; /* * This interface for use by clntrpc */ char * clnt_sperrno(stat) enum clnt_stat stat; { int i; for (i = 0; i < sizeof(rpc_errlist)/sizeof(struct rpc_errtab); i++) { if (rpc_errlist[i].status == stat) { return (rpc_errlist[i].message); } } return ("RPC: (unknown error code)"); } #endif /* NEED_CLNT_SPERRNO */ diff --git a/usr.sbin/amd/config/os-bsd44.h b/usr.sbin/amd/config/os-bsd44.h index 0c12d2242e6e..060f7d7efde8 100644 --- a/usr.sbin/amd/config/os-bsd44.h +++ b/usr.sbin/amd/config/os-bsd44.h @@ -1,201 +1,201 @@ /* * Copyright (c) 1990 Jan-Simon Pendry * Copyright (c) 1990 Imperial College of Science, Technology & Medicine * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Jan-Simon Pendry at Imperial College, London. * * 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. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. * * @(#)os-bsd44.h 8.1 (Berkeley) 6/6/93 * - * $Id: os-bsd44.h,v 1.3 1995/06/27 11:07:27 dfr Exp $ + * $Id: os-bsd44.h,v 1.4 1996/01/09 08:49:21 graichen Exp $ * * 4.4 BSD definitions for Amd (automounter) */ /* * Does the compiler grok void * */ #define VOIDP /* * Which version of the Sun RPC library we are using * This is the implementation release number, not * the protocol revision number. */ #define RPC_4 /* * Which version of the NFS interface are we using. * This is the implementation release number, not * the protocol revision number. */ #define NFS_44 #define HAS_TCP_NFS #define NFSv3 /* * Does this OS have NDBM support? */ #define OS_HAS_NDBM /* * 4.4 doesn't provide NIS, but FreeBSD does. */ #define HAS_NIS_MAPS /* * OS provides strerror() */ #define HAS_STRERROR /* * The mount table is obtained from the kernel */ #undef UPDATE_MTAB /* * No mntent info on 4.4 BSD */ #undef MNTENT_HDR /* * Name of filesystem types */ #define MOUNT_TYPE_NFS MOUNT_NFS #define MOUNT_TYPE_UFS MOUNT_UFS #undef MTAB_TYPE_UFS #define MTAB_TYPE_UFS "ufs" #define MTAB_TYPE_MFS "mfs" /* * How to unmount filesystems */ #undef UNMOUNT_TRAP #undef NEED_UMOUNT_FS #define NEED_UMOUNT_BSD /* * How to copy an address into an NFS filehandle */ #undef NFS_SA_DREF #define NFS_SA_DREF(dst, src) { \ (dst).addr = (struct sockaddr *) (src); \ (dst).addrlen = sizeof(*src); \ (dst).sotype = SOCK_DGRAM; \ (dst).proto = 0; \ } /* * Byte ordering */ #ifndef BYTE_ORDER #include #endif /* BYTE_ORDER */ #undef ARCH_ENDIAN #if BYTE_ORDER == LITTLE_ENDIAN #define ARCH_ENDIAN "little" #else #if BYTE_ORDER == BIG_ENDIAN #define ARCH_ENDIAN "big" #else XXX - Probably no hope of running Amd on this machine! #endif /* BIG */ #endif /* LITTLE */ /* * Miscellaneous 4.4 BSD bits */ #define NEED_MNTOPT_PARSER #define SHORT_MOUNT_NAME #define MNTMAXSTR 128 #define MNTTYPE_UFS "ufs" /* Un*x file system */ #define MNTTYPE_NFS "nfs" /* network file system */ #define MNTTYPE_MFS "mfs" /* memory file system */ #define MNTTYPE_IGNORE "ignore" /* No type specified, ignore this entry */ #define M_RDONLY MNT_RDONLY #define M_SYNC MNT_SYNCHRONOUS #define M_NOEXEC MNT_NOEXEC #define M_NOSUID MNT_NOSUID #define M_NODEV MNT_NODEV #define MNTOPT_SOFT "soft" /* soft mount */ #define MNTOPT_INTR "intr" /* interrupts allowed */ #define MNTOPT_NOCONN "noconn" /* no connection option allowed */ #define NFSMNT_HOSTNAME 0 /* hostname on 4.4 is not optional */ struct mntent { char *mnt_fsname; /* name of mounted file system */ char *mnt_dir; /* file system path prefix */ char *mnt_type; /* MNTTYPE_* */ char *mnt_opts; /* MNTOPT* */ int mnt_freq; /* dump frequency, in days */ int mnt_passno; /* pass number on parallel fsck */ }; /* * Type of a file handle */ #undef NFS_FH_TYPE #ifdef NFSv3 -#define NFS_FH_TYPE fhandle_t * +#define NFS_FH_TYPE u_char * #else #define NFS_FH_TYPE nfsv2fh_t * #endif /* * How to get a mount list */ #undef READ_MTAB_FROM_FILE #define READ_MTAB_BSD_STYLE /* * The data for the mount syscall needs the path in addition to the * host name since that is the only source of information about the * mounted filesystem. */ #define NFS_ARGS_NEEDS_PATH /* * 4.4 has RE support built in */ #undef RE_HDR #define RE_HDR /* * Need precise length links */ #define PRECISE_SYMLINKS