xref: /csrg-svn/usr.sbin/amd/config/os-aix3.h (revision 61785)
144630Smckusick /*
244630Smckusick  * Copyright (c) 1990 Jan-Simon Pendry
344630Smckusick  * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
4*61785Sbostic  * Copyright (c) 1990, 1993
5*61785Sbostic  *	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*61785Sbostic  *	@(#)os-aix3.h	8.1 (Berkeley) 06/06/93
1349685Spendry  *
1453749Spendry  * $Id: os-aix3.h,v 5.2.2.2 1992/05/31 16:38:49 jsp Exp $
1549685Spendry  *
1649685Spendry  * AIX 3.1 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  */
2944630Smckusick #define	RPC_4
3044630Smckusick 
3144630Smckusick /*
3244630Smckusick  * Which version of the NFS interface are we using.
3344630Smckusick  * This is the implementation release number, not
3444630Smckusick  * the protocol revision number.
3544630Smckusick  */
3644630Smckusick #define	NFS_AIX3
3744630Smckusick 
3844630Smckusick /*
3944630Smckusick  * Does this OS have NDBM support?
4044630Smckusick  */
4144630Smckusick #define OS_HAS_NDBM
4244630Smckusick 
4344630Smckusick /*
4444630Smckusick  * The mount table is obtained from the kernel
4544630Smckusick  */
4644630Smckusick #undef	UPDATE_MTAB
4744630Smckusick 
4844630Smckusick /*
4944630Smckusick  * Pick up BSD bits from include files
5053749Spendry  * Try for 4.4 compatibility if available (AIX 3.2 and later)
5144630Smckusick  */
5253749Spendry #define	_BSD 44
5344630Smckusick 
5444630Smckusick /*
5544630Smckusick  * No mntent info on AIX 3
5644630Smckusick  */
5744630Smckusick #undef	MNTENT_HDR
5844630Smckusick #define	MNTENT_HDR <sys/mntctl.h>
5944630Smckusick 
6044630Smckusick /*
6144630Smckusick  * Name of filesystem types
6244630Smckusick  */
6344630Smckusick #define	MOUNT_TYPE_NFS	MNT_NFS
6444630Smckusick #define	MOUNT_TYPE_UFS	MNT_JFS
6544630Smckusick #undef MTAB_TYPE_UFS
6644630Smckusick #define	MTAB_TYPE_UFS	"jfs"
6744630Smckusick 
6844630Smckusick /*
6944630Smckusick  * How to unmount filesystems
7044630Smckusick  */
7144630Smckusick #undef MOUNT_TRAP
7244630Smckusick #define	MOUNT_TRAP(type, mnt, flag, mnt_data) \
7344630Smckusick 	aix3_mount(mnt->mnt_fsname, mnt->mnt_dir, flag, type, mnt_data, mnt->mnt_opts)
7444630Smckusick #undef	UNMOUNT_TRAP
7544630Smckusick #define	UNMOUNT_TRAP(mnt)	uvmount(mnt->mnt_passno, 0)
7644630Smckusick 
7744630Smckusick 
7844630Smckusick /*
7944630Smckusick  * Byte ordering
8044630Smckusick  */
8144630Smckusick #ifndef BYTE_ORDER
8244630Smckusick #include <sys/machine.h>
8344630Smckusick #endif /* BYTE_ORDER */
8444630Smckusick 
8544630Smckusick #undef ARCH_ENDIAN
8644630Smckusick #if BYTE_ORDER == LITTLE_ENDIAN
8744630Smckusick #define ARCH_ENDIAN "little"
8844630Smckusick #else
8944630Smckusick #if BYTE_ORDER == BIG_ENDIAN
9044630Smckusick #define ARCH_ENDIAN "big"
9144630Smckusick #else
9244630Smckusick XXX - Probably no hope of running Amd on this machine!
9344630Smckusick #endif /* BIG */
9444630Smckusick #endif /* LITTLE */
9544630Smckusick 
9644630Smckusick /*
9744630Smckusick  * Miscellaneous AIX 3 bits
9844630Smckusick  */
9944630Smckusick #define	NEED_MNTOPT_PARSER
10044630Smckusick #define	SHORT_MOUNT_NAME
10144630Smckusick 
10244630Smckusick #define	MNTMAXSTR       128
10344630Smckusick 
10444630Smckusick #define	MNTTYPE_UFS	"jfs"		/* Un*x file system */
10544630Smckusick #define	MNTTYPE_NFS	"nfs"		/* network file system */
10644630Smckusick #define	MNTTYPE_IGNORE	"ignore"	/* No type specified, ignore this entry */
10744630Smckusick 
10844630Smckusick struct mntent {
10944630Smckusick 	char	*mnt_fsname;	/* name of mounted file system */
11044630Smckusick 	char	*mnt_dir;	/* file system path prefix */
11144630Smckusick 	char	*mnt_type;	/* MNTTYPE_* */
11244630Smckusick 	char	*mnt_opts;	/* MNTOPT* */
11344630Smckusick 	int	mnt_freq;	/* dump frequency, in days */
11444630Smckusick 	int	mnt_passno;	/* pass number on parallel fsck */
11544630Smckusick };
11644630Smckusick 
11744630Smckusick #define	NFS_HDR "misc-aix3.h"
11844630Smckusick #define	UFS_HDR "misc-aix3.h"
11944630Smckusick #undef NFS_FH_DREF
12047534Spendry #define	NFS_FH_DREF(dst, src) { (dst) = *(src); }
12144630Smckusick #undef NFS_SA_DREF
12244630Smckusick #define	NFS_SA_DREF(dst, src) { (dst).addr = *(src); }
12344630Smckusick #define	M_RDONLY MNT_READONLY
12444630Smckusick 
12544630Smckusick /*
12644630Smckusick  * How to get a mount list
12744630Smckusick  */
12844630Smckusick #undef	READ_MTAB_FROM_FILE
12944630Smckusick #define	READ_MTAB_AIX3_STYLE
13044630Smckusick 
13144630Smckusick /*
13244630Smckusick  * The data for the mount syscall needs the path in addition to the
13344630Smckusick  * host name since that is the only source of information about the
13444630Smckusick  * mounted filesystem.
13544630Smckusick #define	NFS_ARGS_NEEDS_PATH
13644630Smckusick  */
13744630Smckusick 
13844630Smckusick #define	NFS_LOMAP	34
13944630Smckusick #define	NFS_HIMAP	99
14044630Smckusick #define NFS_ERROR_MAPPING \
14144630Smckusick static nfs_errormap[] = {	     0,75,77,99,99,99, \
14244630Smckusick 			99,99,99,99,99,78,99,99,99,79, \
14344630Smckusick 			99,99,70,99,35,36,37,38,39,40, \
14444630Smckusick 			41,42,43,44,45,46,47,48,49,50, \
14544630Smckusick 			51,52,53,54,55,56,57,58,60,61, \
14644630Smckusick 			64,65,99,67,68,62,63,66,69,68, \
14744630Smckusick 			99,99,99,71,99,99,99,99,99,99 \
14844630Smckusick 			};
14944630Smckusick 
15047534Spendry #define	MOUNT_HELPER_SOURCE "mount_aix.c"
15144630Smckusick 
15244630Smckusick /*
15344630Smckusick  * Need this too
15444630Smckusick  */
15544630Smckusick #include <time.h>
156