am_compat.h revision 310490
1/*
2 * Copyright (c) 1997-2014 Erez Zadok
3 * Copyright (c) 1990 Jan-Simon Pendry
4 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
5 * Copyright (c) 1990 The Regents of the University of California.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by
9 * Jan-Simon Pendry at Imperial College, London.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 *    notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 *    notice, this list of conditions and the following disclaimer in the
18 *    documentation and/or other materials provided with the distribution.
19 * 3. Neither the name of the University nor the names of its contributors
20 *    may be used to endorse or promote products derived from this software
21 *    without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 *
36 * File: am-utils/include/am_compat.h
37 *
38 */
39
40/*
41 *
42 * This file contains compatibility functions and macros, all of which
43 * should be auto-discovered, but for one reason or another (mostly
44 * brain-damage on the part of system designers and header files) they cannot.
45 *
46 * Each compatibility macro/function must include instructions on how/when
47 * it can be removed the am-utils code.
48 *
49 */
50
51#ifndef _AM_COMPAT_H
52# define _AM_COMPAT_H
53
54/*
55 * incomplete mount options definitions (sunos4, irix6, linux, etc.)
56 */
57
58
59/*
60 * Complete MNTTAB_OPT_* options based on MNT2_NFS_OPT_* mount options.
61 */
62#if defined(MNT2_NFS_OPT_ACDIRMAX) && !defined(MNTTAB_OPT_ACDIRMAX)
63# define MNTTAB_OPT_ACDIRMAX "acdirmax"
64#endif /* defined(MNT2_NFS_OPT_ACDIRMAX) && !defined(MNTTAB_OPT_ACDIRMAX) */
65
66#if defined(MNT2_NFS_OPT_ACDIRMIN) && !defined(MNTTAB_OPT_ACDIRMIN)
67# define MNTTAB_OPT_ACDIRMIN "acdirmin"
68#endif /* defined(MNT2_NFS_OPT_ACDIRMIN) && !defined(MNTTAB_OPT_ACDIRMIN) */
69
70#if defined(MNT2_NFS_OPT_ACREGMAX) && !defined(MNTTAB_OPT_ACREGMAX)
71# define MNTTAB_OPT_ACREGMAX "acregmax"
72#endif /* defined(MNT2_NFS_OPT_ACREGMAX) && !defined(MNTTAB_OPT_ACREGMAX) */
73
74#if defined(MNT2_NFS_OPT_ACREGMIN) && !defined(MNTTAB_OPT_ACREGMIN)
75# define MNTTAB_OPT_ACREGMIN "acregmin"
76#endif /* defined(MNT2_NFS_OPT_ACREGMIN) && !defined(MNTTAB_OPT_ACREGMIN) */
77
78#if !defined(MNTTAB_OPT_IGNORE)
79/* SunOS 4.1.x and others define "noauto" option, but not "auto" */
80# if defined(MNTTAB_OPT_NOAUTO) && !defined(MNTTAB_OPT_AUTO)
81#  define MNTTAB_OPT_AUTO "auto"
82# endif /* defined(MNTTAB_OPT_NOAUTO) && !defined(MNTTAB_OPT_AUTO) */
83#endif /* !defined(MNTTAB_OPT_IGNORE) */
84
85#if defined(MNT2_NFS_OPT_NOAC) && !defined(MNTTAB_OPT_NOAC)
86# define MNTTAB_OPT_NOAC "noac"
87#endif /* defined(MNT2_NFS_OPT_NOAC) && !defined(MNTTAB_OPT_NOAC) */
88
89#if defined(MNT2_NFS_OPT_NOACL) && !defined(MNTTAB_OPT_NOACL)
90# define MNTTAB_OPT_NOACL "noacl"
91#endif /* defined(MNT2_NFS_OPT_NOACL) && !defined(MNTTAB_OPT_NOACL) */
92
93#if defined(MNT2_NFS_OPT_NOCONN) && !defined(MNTTAB_OPT_NOCONN)
94# define MNTTAB_OPT_NOCONN "noconn"
95# ifndef MNTTAB_OPT_CONN
96#  define MNTTAB_OPT_CONN "conn"
97# endif /* MNTTAB_OPT_CONN */
98#endif /* defined(MNT2_NFS_OPT_NOCONN) && !defined(MNTTAB_OPT_NOCONN) */
99
100#if defined(MNT2_NFS_OPT_PGTHRESH) && !defined(MNTTAB_OPT_PGTHRESH)
101# define MNTTAB_OPT_PGTHRESH "pgthresh"
102#endif /* defined(MNT2_NFS_OPT_PGTHRESH) && !defined(MNTTAB_OPT_PGTHRESH) */
103
104#if defined(MNT2_NFS_OPT_PRIVATE) && !defined(MNTTAB_OPT_PRIVATE)
105# define MNTTAB_OPT_PRIVATE "private"
106#endif /* defined(MNT2_NFS_OPT_PRIVATE) && !defined(MNTTAB_OPT_PRIVATE) */
107
108#if defined(MNT2_NFS_OPT_RETRANS) && !defined(MNTTAB_OPT_RETRANS)
109# define MNTTAB_OPT_RETRANS "retrans"
110#endif /* defined(MNT2_NFS_OPT_RETRANS) && !defined(MNTTAB_OPT_RETRANS) */
111
112#if defined(MNT2_NFS_OPT_RSIZE) && !defined(MNTTAB_OPT_RSIZE)
113# define MNTTAB_OPT_RSIZE "rsize"
114#endif /* defined(MNT2_NFS_OPT_RSIZE) && !defined(MNTTAB_OPT_RSIZE) */
115
116#if defined(MNT2_NFS_OPT_SOFT) && !defined(MNTTAB_OPT_SOFT)
117# define MNTTAB_OPT_SOFT "soft"
118# ifndef MNTTAB_OPT_HARD
119#  define MNTTAB_OPT_HARD "hard"
120# endif /* not MNTTAB_OPT_HARD */
121#endif /* defined(MNT2_NFS_OPT_SOFT) && !defined(MNTTAB_OPT_SOFT) */
122
123#if defined(MNT2_NFS_OPT_TIMEO) && !defined(MNTTAB_OPT_TIMEO)
124# define MNTTAB_OPT_TIMEO "timeo"
125#endif /* defined(MNT2_NFS_OPT_TIMEO) && !defined(MNTTAB_OPT_TIMEO) */
126
127#if defined(MNT2_NFS_OPT_WSIZE) && !defined(MNTTAB_OPT_WSIZE)
128# define MNTTAB_OPT_WSIZE "wsize"
129#endif /* defined(MNT2_NFS_OPT_WSIZE) && !defined(MNTTAB_OPT_WSIZE) */
130
131#if defined(MNT2_NFS_OPT_MAXGRPS) && !defined(MNTTAB_OPT_MAXGROUPS)
132# define MNTTAB_OPT_MAXGROUPS "maxgroups"
133#endif /* defined(MNT2_NFS_OPT_MAXGRPS) && !defined(MNTTAB_OPT_MAXGROUPS) */
134
135#if defined(MNT2_NFS_OPT_PROPLIST) && !defined(MNTTAB_OPT_PROPLIST)
136# define MNTTAB_OPT_PROPLIST "proplist"
137#endif /* defined(MNT2_NFS_OPT_PROPLIST) && !defined(MNTTAB_OPT_PROPLIST) */
138
139#if defined(MNT2_NFS_OPT_NONLM) && !defined(MNTTAB_OPT_NOLOCK)
140# define MNTTAB_OPT_NOLOCK "nolock"
141#endif /* defined(MNT2_NFS_OPT_NONLM) && !defined(MNTTAB_OPT_NOLOCK) */
142
143#if defined(MNT2_NFS_OPT_XLATECOOKIE) && !defined(MNTTAB_OPT_XLATECOOKIE)
144# define MNTTAB_OPT_XLATECOOKIE "xlatecookie"
145#endif /* defined(MNT2_NFS_OPT_XLATECOOKIE) && !defined(MNTTAB_OPT_XLATECOOKIE) */
146
147/*
148 * Complete MNTTAB_OPT_* options based on MNT2_CDFS_OPT_* mount options.
149 */
150#if defined(MNT2_CDFS_OPT_DEFPERM) && !defined(MNTTAB_OPT_DEFPERM)
151# define MNTTAB_OPT_DEFPERM "defperm"
152#endif /* defined(MNT2_CDFS_OPT_DEFPERM) && !defined(MNTTAB_OPT_DEFPERM) */
153
154#if defined(MNT2_CDFS_OPT_NODEFPERM) && !defined(MNTTAB_OPT_NODEFPERM)
155# define MNTTAB_OPT_NODEFPERM "nodefperm"
156/*
157 * DEC OSF/1 V3.x/Digital UNIX V4.0 have M_NODEFPERM only, but
158 * both mnttab ops.
159 */
160# ifndef MNTTAB_OPT_DEFPERM
161#  define MNTTAB_OPT_DEFPERM "defperm"
162# endif /* not MNTTAB_OPT_DEFPERM */
163#endif /* defined(MNT2_CDFS_OPT_NODEFPERM) && !defined(MNTTAB_OPT_NODEFPERM) */
164
165#if defined(MNT2_CDFS_OPT_NOVERSION) && !defined(MNTTAB_OPT_NOVERSION)
166# define MNTTAB_OPT_NOVERSION "noversion"
167#endif /* defined(MNT2_CDFS_OPT_NOVERSION) && !defined(MNTTAB_OPT_NOVERSION) */
168
169#if defined(MNT2_CDFS_OPT_RRIP) && !defined(MNTTAB_OPT_RRIP)
170# define MNTTAB_OPT_RRIP "rrip"
171#endif /* defined(MNT2_CDFS_OPT_RRIP) && !defined(MNTTAB_OPT_RRIP) */
172#if defined(MNT2_CDFS_OPT_NORRIP) && !defined(MNTTAB_OPT_NORRIP)
173# define MNTTAB_OPT_NORRIP "norrip"
174#endif /* defined(MNT2_CDFS_OPT_NORRIP) && !defined(MNTTAB_OPT_NORRIP) */
175
176#if defined(MNT2_CDFS_OPT_GENS) && !defined(MNTTAB_OPT_GENS)
177# define MNTTAB_OPT_GENS "gens"
178#endif /* defined(MNT2_CDFS_OPT_GENS) && !defined(MNTTAB_OPT_GENS) */
179
180#if defined(MNT2_CDFS_OPT_EXTATT) && !defined(MNTTAB_OPT_EXTATT)
181# define MNTTAB_OPT_EXTATT "extatt"
182#endif /* defined(MNT2_CDFS_OPT_EXTATT) && !defined(MNTTAB_OPT_EXTATT) */
183
184#if defined(MNT2_CDFS_OPT_NOJOLIET) && !defined(MNTTAB_OPT_NOJOLIET)
185# define MNTTAB_OPT_NOJOLIET "nojoliet"
186#endif /* defined(MNT2_CDFS_OPT_NOJOLIET) && !defined(MNTTAB_OPT_NOJOLIET) */
187
188#if defined(MNT2_CDFS_OPT_NOCASETRANS) && !defined(MNTTAB_OPT_NOCASETRANS)
189# define MNTTAB_OPT_NOCASETRANS "nocasetrans"
190#endif /* defined(MNT2_CDFS_OPT_NOCASETRANS) && !defined(MNTTAB_OPT_NOCASETRANS) */
191
192#if defined(MNT2_CDFS_OPT_RRCASEINS) && !defined(MNTTAB_OPT_RRCASEINS)
193# define MNTTAB_OPT_RRCASEINS "rrcaseins"
194#endif /* defined(MNT2_CDFS_OPT_RRCASEINS) && !defined(MNTTAB_OPT_RRCASEINS) */
195
196/*
197 * Complete MNTTAB_OPT_* options based on MNT2_UDF_OPT_* mount options.
198 */
199#if defined(MNT2_UDF_OPT_CLOSESESSION) && !defined(MNTTAB_OPT_CLOSESESSION)
200# define MNTTAB_OPT_CLOSESESSION "closesession"
201#endif /* defined(MNT2_UDF_OPT_CLOSESESSION) && !defined(MNTTAB_OPT_CLOSESESSION) */
202
203/*
204 * Complete MNTTAB_OPT_* options based on MNT2_PCFS_OPT_* mount options.
205 */
206#if defined(MNT2_PCFS_OPT_LONGNAME) && !defined(MNTTAB_OPT_LONGNAME)
207# define MNTTAB_OPT_LONGNAME "longnames"
208#endif /* defined(MNT2_PCFS_OPT_LONGNAME) && !defined(MNTTAB_OPT_LONGNAME) */
209#if defined(MNT2_PCFS_OPT_NOWIN95) && !defined(MNTTAB_OPT_NOWIN95)
210# define MNTTAB_OPT_NOWIN95 "nowin95"
211#endif /* defined(MNT2_PCFS_OPT_NOWIN95) && !defined(MNTTAB_OPT_NOWIN95) */
212#if defined(MNT2_PCFS_OPT_SHORTNAME) && !defined(MNTTAB_OPT_SHORTNAME)
213# define MNTTAB_OPT_SHORTNAME "shortnames"
214#endif /* defined(MNT2_PCFS_OPT_SHORTNAME) && !defined(MNTTAB_OPT_SHORTNAME) */
215
216/*
217 * Complete MNTTAB_OPT_* options based on MNT2_GEN_OPT_* mount options.
218 */
219#if defined(MNT2_GEN_OPT_GRPID) && !defined(MNTTAB_OPT_GRPID)
220# define MNTTAB_OPT_GRPID "grpid"
221#endif /* defined(MNT2_GEN_OPT_GRPID) && !defined(MNTTAB_OPT_GRPID) */
222
223#if defined(MNT2_GEN_OPT_NOCACHE) && !defined(MNTTAB_OPT_NOCACHE)
224# define MNTTAB_OPT_NOCACHE "nocache"
225#endif /* defined(MNT2_GEN_OPT_NOCACHE) && !defined(MNTTAB_OPT_NOCACHE) */
226
227#if defined(MNT2_GEN_OPT_NOSUID) && !defined(MNTTAB_OPT_NOSUID)
228# define MNTTAB_OPT_NOSUID "nosuid"
229#endif /* defined(MNT2_GEN_OPT_NOSUID) && !defined(MNTTAB_OPT_NOSUID) */
230
231#if defined(MNT2_GEN_OPT_OVERLAY) && !defined(MNTTAB_OPT_OVERLAY)
232# define MNTTAB_OPT_OVERLAY "overlay"
233#endif /* defined(MNT2_GEN_OPT_OVERLAY) && !defined(MNTTAB_OPT_OVERLAY) */
234
235/*
236 * Complete MNTTAB_OPT_* options and their inverse based on MNT2_GEN_OPT_*
237 * options.
238 */
239#if defined(MNT2_GEN_OPT_NODEV) && !defined(MNTTAB_OPT_NODEV)
240# define MNTTAB_OPT_NODEV "nodev"
241#endif /* defined(MNT2_GEN_OPT_NODEV) && !defined(MNTTAB_OPT_NODEV) */
242
243#if defined(MNT2_GEN_OPT_NOEXEC) && !defined(MNTTAB_OPT_NOEXEC)
244# define MNTTAB_OPT_NOEXEC "noexec"
245/* this is missing under some versions of Linux */
246# ifndef MNTTAB_OPT_EXEC
247#  define MNTTAB_OPT_EXEC "exec"
248# endif /* not MNTTAB_OPT_EXEC */
249#endif /* defined(MNT2_GEN_OPT_NOEXEC) && !defined(MNTTAB_OPT_NOEXEC) */
250
251#if defined(MNT2_GEN_OPT_QUOTA) && !defined(MNTTAB_OPT_QUOTA)
252# define MNTTAB_OPT_QUOTA "quota"
253#endif /* defined(MNT2_GEN_OPT_QUOTA) && !defined(MNTTAB_OPT_QUOTA) */
254
255#if defined(MNT2_GEN_OPT_SYNC) && !defined(MNTTAB_OPT_SYNC)
256# define MNTTAB_OPT_SYNC "sync"
257#endif /* defined(MNT2_GEN_OPT_SYNC) && !defined(MNTTAB_OPT_SYNC) */
258
259#if defined(MNT2_GEN_OPT_LOG) && !defined(MNTTAB_OPT_LOG)
260# define MNTTAB_OPT_LOG "log"
261#endif /* defined(MNT2_GEN_OPT_LOG) && !defined(MNTTAB_OPT_LOG) */
262
263#if defined(MNT2_GEN_OPT_NOATIME) && !defined(MNTTAB_OPT_NOATIME)
264# define MNTTAB_OPT_NOATIME "noatime"
265#endif /* defined(MNT2_GEN_OPT_NOATIME) && !defined(MNTTAB_OPT_NOATIME) */
266
267#if defined(MNT2_GEN_OPT_NODEVMTIME) && !defined(MNTTAB_OPT_NODEVMTIME)
268# define MNTTAB_OPT_NODEVMTIME "nodevmtime"
269#endif /* defined(MNT2_GEN_OPT_NODEVMTIME) && !defined(MNTTAB_OPT_NODEVMTIME) */
270
271#if defined(MNT2_GEN_OPT_SOFTDEP) && !defined(MNTTAB_OPT_SOFTDEP)
272# define MNTTAB_OPT_SOFTDEP "softdep"
273#endif /* defined(MNT2_GEN_OPT_SOFTDEP) && !defined(MNTTAB_OPT_SOFTDEP) */
274
275#if defined(MNT2_GEN_OPT_SYMPERM) && !defined(MNTTAB_OPT_SYMPERM)
276# define MNTTAB_OPT_SYMPERM "symperm"
277#endif /* defined(MNT2_GEN_OPT_SYMPERM) && !defined(MNTTAB_OPT_SYMPERM) */
278
279#if defined(MNT2_GEN_OPT_UNION) && !defined(MNTTAB_OPT_UNION)
280# define MNTTAB_OPT_UNION "union"
281#endif /* defined(MNT2_GEN_OPT_UNION) && !defined(MNTTAB_OPT_UNION) */
282
283/*
284 * Add missing MNTTAB_OPT_* options.
285 */
286#ifndef MNTTAB_OPT_ACTIMEO
287# define MNTTAB_OPT_ACTIMEO "actimeo"
288#endif /* not MNTTAB_OPT_ACTIMEO */
289
290#ifndef MNTTAB_OPT_INTR
291# define MNTTAB_OPT_INTR "intr"
292#endif /* not MNTTAB_OPT_INTR */
293
294#ifndef MNTTAB_OPT_PORT
295# define MNTTAB_OPT_PORT "port"
296#endif /* not MNTTAB_OPT_PORT */
297
298#ifndef MNTTAB_OPT_PUBLIC
299# define MNTTAB_OPT_PUBLIC "public"
300#endif /* not MNTTAB_OPT_PUBLIC */
301
302#ifndef MNTTAB_OPT_RETRANS
303# define MNTTAB_OPT_RETRANS "retrans"
304#endif /* not MNTTAB_OPT_RETRANS */
305
306#ifndef MNTTAB_OPT_RETRY
307# define MNTTAB_OPT_RETRY "retry"
308#endif /* not MNTTAB_OPT_RETRY */
309
310#ifndef MNTTAB_OPT_RO
311# define MNTTAB_OPT_RO "ro"
312#endif /* not MNTTAB_OPT_RO */
313
314#ifndef MNTTAB_OPT_RSIZE
315# define MNTTAB_OPT_RSIZE "rsize"
316#endif /* not MNTTAB_OPT_RSIZE */
317
318#ifndef MNTTAB_OPT_RW
319# define MNTTAB_OPT_RW "rw"
320#endif /* not MNTTAB_OPT_RW */
321
322#ifndef MNTTAB_OPT_TIMEO
323# define MNTTAB_OPT_TIMEO "timeo"
324#endif /* not MNTTAB_OPT_TIMEO */
325
326#ifndef MNTTAB_OPT_WSIZE
327# define MNTTAB_OPT_WSIZE "wsize"
328#endif /* not MNTTAB_OPT_WSIZE */
329
330/* next four are useful for pcfs mounts */
331#ifndef MNTTAB_OPT_USER
332# define MNTTAB_OPT_USER "user"
333#endif /* not MNTTAB_OPT_USER */
334#ifndef MNTTAB_OPT_GROUP
335# define MNTTAB_OPT_GROUP "group"
336#endif /* not MNTTAB_OPT_GROUP */
337#ifndef MNTTAB_OPT_MASK
338# define MNTTAB_OPT_MASK "mask"
339#endif /* not MNTTAB_OPT_MASK */
340#ifndef MNTTAB_OPT_DIRMASK
341# define MNTTAB_OPT_DIRMASK "dirmask"
342#endif /* not MNTTAB_OPT_DIRMASK */
343
344/* useful for udf mounts */
345#ifndef MNTTAB_OPT_USER
346# define MNTTAB_OPT_USER "user"
347#endif /* not MNTTAB_OPT_USER */
348#ifndef MNTTAB_OPT_GROUP
349# define MNTTAB_OPT_GROUP "group"
350#endif /* not MNTTAB_OPT_GROUP */
351#ifndef MNTTAB_OPT_GMTOFF
352# define MNTTAB_OPT_GMTOFF "gmtoff"
353#endif /* not MNTTAB_OPT_GMTOFF */
354#ifndef MNTTAB_OPT_SESSIONNR
355# define MNTTAB_OPT_SESSIONNR "sessionnr"
356#endif /* not MNTTAB_OPT_SESSIONNR */
357
358/*
359 * Incomplete filesystem definitions (sunos4, irix6, solaris2)
360 */
361#if defined(HAVE_FS_CDFS) && defined(MOUNT_TYPE_CDFS) && !defined(MNTTYPE_CDFS)
362# define MNTTYPE_CDFS "hsfs"
363#endif /* defined(HAVE_FS_CDFS) && defined(MOUNT_TYPE_CDFS) && !defined(MNTTYPE_CDFS) */
364
365#ifndef cdfs_args_t
366/*
367 * Solaris has an HSFS filesystem, but does not define hsfs_args.
368 * XXX: the definition here for solaris is wrong, since under solaris,
369 * hsfs_args should be a single integer used as a bit-field for options.
370 * so this code has to be fixed later.  -Erez.
371 */
372struct hsfs_args {
373        char *fspec;    /* name of filesystem to mount */
374        int norrip;
375};
376# define cdfs_args_t struct hsfs_args
377# define HAVE_CDFS_ARGS_T_NORRIP
378#endif /* not cdfs_args_t */
379
380/*
381 * if does not define struct pc_args, assume integer bit-field (irix6)
382 */
383#if defined(HAVE_FS_PCFS) && !defined(pcfs_args_t)
384# define pcfs_args_t u_int
385#endif /* defined(HAVE_FS_PCFS) && !defined(pcfs_args_t) */
386
387/*
388 * if does not define struct ufs_args, assume integer bit-field (linux)
389 */
390#if defined(HAVE_FS_UFS) && !defined(ufs_args_t)
391# define ufs_args_t u_int
392#endif /* defined(HAVE_FS_UFS) && !defined(ufs_args_t) */
393
394/*
395 * if does not define struct udf_args, assume integer bit-field (linux)
396 */
397#if defined(HAVE_FS_UDF) && !defined(udf_args_t)
398# define udf_args_t u_int
399#endif /* defined(HAVE_FS_UDF) && !defined(udf_args_t) */
400
401/*
402 * if does not define struct efs_args, assume integer bit-field (linux)
403 */
404#if defined(HAVE_FS_EFS) && !defined(efs_args_t)
405# define efs_args_t u_int
406#endif /* defined(HAVE_FS_EFS) && !defined(efs_args_t) */
407
408#if defined(HAVE_FS_TMPFS) && !defined(tmpfs_args_t)
409# define tmpfs_args_t u_int
410#endif /* defined(HAVE_FS_TMPFS) && !defined(tmpfs_args_t) */
411
412/*
413 * if does not define struct xfs_args, assume integer bit-field (linux)
414 */
415#if defined(HAVE_FS_XFS) && !defined(xfs_args_t)
416# define xfs_args_t u_int
417#endif /* defined(HAVE_FS_XFS) && !defined(xfs_args_t) */
418#if defined(HAVE_FS_EXT) && !defined(ext_args_t)
419# define ext_args_t u_int
420#endif /* defined(HAVE_FS_EXT) && !defined(ext_args_t) */
421
422#if defined(HAVE_FS_AUTOFS) && defined(MOUNT_TYPE_AUTOFS) && !defined(MNTTYPE_AUTOFS)
423# define MNTTYPE_AUTOFS "autofs"
424#endif /* defined(HAVE_FS_AUTOFS) && defined(MOUNT_TYPE_AUTOFS) && !defined(MNTTYPE_AUTOFS) */
425
426/*
427 * If NFS3, then make sure that "proto" and "vers" mnttab options
428 * are available.
429 */
430#ifdef HAVE_FS_NFS3
431# ifndef MNTTAB_OPT_VERS
432#  define MNTTAB_OPT_VERS "vers"
433# endif /* not MNTTAB_OPT_VERS */
434# ifndef MNTTAB_OPT_PROTO
435#  define MNTTAB_OPT_PROTO "proto"
436# endif /* not MNTTAB_OPT_PROTO */
437#endif /* not HAVE_FS_NFS3 */
438
439/*
440 * If NFS4, then make sure that the "sec" mnttab option is available.
441 */
442#ifdef HAVE_FS_NFS4
443# ifndef MNTTAB_OPT_SEC
444#  define MNTTAB_OPT_SEC "sec"
445# endif /* not MNTTAB_OPT_SEC */
446#endif /* not HAVE_FS_NFS4 */
447/*
448 * If loop device (header file) exists, define mount table option
449 */
450#if defined(HAVE_LOOP_DEVICE) && !defined(MNTTAB_OPT_LOOP)
451# define MNTTAB_OPT_LOOP "loop"
452#endif /* defined(HAVE_LOOP_DEVICE) && !defined(MNTTAB_OPT_LOOP) */
453
454/*
455 * Define a dummy struct netconfig for non-TLI systems
456 */
457#if !defined(HAVE_NETCONFIG_H) && !defined(HAVE_SYS_NETCONFIG_H)
458struct netconfig {
459  int dummy;
460};
461#endif /* not HAVE_NETCONFIG_H and not HAVE_SYS_NETCONFIG_H */
462
463/* some OSs don't define INADDR_NONE and assume it's unsigned -1 */
464#ifndef INADDR_NONE
465# define INADDR_NONE	0xffffffffU
466#endif /* INADDR_NONE */
467/* some OSs don't define INADDR_LOOPBACK */
468#ifndef INADDR_LOOPBACK
469# define INADDR_LOOPBACK	0x7f000001
470#endif /* not INADDR_LOOPBACK */
471
472#endif /* not _AM_COMPAT_H */
473