/*
* Copyright (c) 1997-2014 Erez Zadok
* Copyright (c) 1990 Jan-Simon Pendry
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
* Copyright (c) 1990 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. 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.
*
*
* File: am-utils/include/am_compat.h
*
*/
/*
*
* This file contains compatibility functions and macros, all of which
* should be auto-discovered, but for one reason or another (mostly
* brain-damage on the part of system designers and header files) they cannot.
*
* Each compatibility macro/function must include instructions on how/when
* it can be removed the am-utils code.
*
*/
#ifndef cdfs_args_t
/*
* Solaris has an HSFS filesystem, but does not define hsfs_args.
* XXX: the definition here for solaris is wrong, since under solaris,
* hsfs_args should be a single integer used as a bit-field for options.
* so this code has to be fixed later. -Erez.
*/
struct hsfs_args {
char *fspec; /* name of filesystem to mount */
int norrip;
};
# define cdfs_args_t struct hsfs_args
# define HAVE_CDFS_ARGS_T_NORRIP
#endif /* not cdfs_args_t */
/*
* if does not define struct pc_args, assume integer bit-field (irix6)
*/
#if defined(HAVE_FS_PCFS) && !defined(pcfs_args_t)
# define pcfs_args_t u_int
#endif /* defined(HAVE_FS_PCFS) && !defined(pcfs_args_t) */
/*
* if does not define struct ufs_args, assume integer bit-field (linux)
*/
#if defined(HAVE_FS_UFS) && !defined(ufs_args_t)
# define ufs_args_t u_int
#endif /* defined(HAVE_FS_UFS) && !defined(ufs_args_t) */
/*
* if does not define struct udf_args, assume integer bit-field (linux)
*/
#if defined(HAVE_FS_UDF) && !defined(udf_args_t)
# define udf_args_t u_int
#endif /* defined(HAVE_FS_UDF) && !defined(udf_args_t) */
/*
* if does not define struct efs_args, assume integer bit-field (linux)
*/
#if defined(HAVE_FS_EFS) && !defined(efs_args_t)
# define efs_args_t u_int
#endif /* defined(HAVE_FS_EFS) && !defined(efs_args_t) */
/*
* If NFS3, then make sure that "proto" and "vers" mnttab options
* are available.
*/
#ifdef HAVE_FS_NFS3
# ifndef MNTTAB_OPT_VERS
# define MNTTAB_OPT_VERS "vers"
# endif /* not MNTTAB_OPT_VERS */
# ifndef MNTTAB_OPT_PROTO
# define MNTTAB_OPT_PROTO "proto"
# endif /* not MNTTAB_OPT_PROTO */
#endif /* not HAVE_FS_NFS3 */
/*
* If NFS4, then make sure that the "sec" mnttab option is available.
*/
#ifdef HAVE_FS_NFS4
# ifndef MNTTAB_OPT_SEC
# define MNTTAB_OPT_SEC "sec"
# endif /* not MNTTAB_OPT_SEC */
#endif /* not HAVE_FS_NFS4 */
/*
* If loop device (header file) exists, define mount table option
*/
#if defined(HAVE_LOOP_DEVICE) && !defined(MNTTAB_OPT_LOOP)
# define MNTTAB_OPT_LOOP "loop"
#endif /* defined(HAVE_LOOP_DEVICE) && !defined(MNTTAB_OPT_LOOP) */
/*
* Define a dummy struct netconfig for non-TLI systems
*/
#if !defined(HAVE_NETCONFIG_H) && !defined(HAVE_SYS_NETCONFIG_H)
struct netconfig {
int dummy;
};
#endif /* not HAVE_NETCONFIG_H and not HAVE_SYS_NETCONFIG_H */
/* some OSs don't define INADDR_NONE and assume it's unsigned -1 */
#ifndef INADDR_NONE
# define INADDR_NONE 0xffffffffU
#endif /* INADDR_NONE */
/* some OSs don't define INADDR_LOOPBACK */
#ifndef INADDR_LOOPBACK
# define INADDR_LOOPBACK 0x7f000001
#endif /* not INADDR_LOOPBACK */