2 * Copyright (c) 1997-2006 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.
8 * This code is derived from software contributed to Berkeley by
9 * Jan-Simon Pendry at Imperial College, London.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
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. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgment:
21 * This product includes software developed by the University of
22 * California, Berkeley and its contributors.
23 * 4. Neither the name of the University nor the names of its contributors
24 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * File: am-utils/include/am_defs.h
45 * Definitions that are not specific to the am-utils package, but
46 * are rather generic, and can be used elsewhere.
53 * Actions to take if ANSI C.
57 /* for function prototypes */
60 #else /* not STDC_HEADERS */
61 /* empty function prototypes */
66 # define strrchr rindex
67 # endif /* not HAVE_STRCHR */
68 char *strchr(), *strrchr(), *strdup();
69 #endif /* not STDC_HEADERS */
72 * Handle gcc __attribute__ if available.
75 /* This feature is available in gcc versions 2.5 and later. */
76 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
77 # define __attribute__(Spec) /* empty */
78 # endif /* __GNUC__ < 2 ... */
80 * The __-protected variants of `format' and `printf' attributes
81 * are accepted by gcc versions 2.6.4 (effectively 2.7) and later.
83 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
84 # define __format__ format
85 # define __printf__ printf
86 # endif /* __GNUC__ < 2 ... */
87 #endif /* not __attribute__ */
90 * How to handle signals of any type
92 #ifdef HAVE_SYS_WAIT_H
93 # include <sys/wait.h>
94 #endif /* HAVE_SYS_WAIT_H */
96 # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
97 #endif /* not WEXITSTATUS */
99 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
100 #endif /* not WIFEXITED */
103 * Actions to take regarding <time.h> and <sys/time.h>.
105 #if TIME_WITH_SYS_TIME
106 # include <sys/time.h>
109 * AIX 5.2 needs struct sigevent from signal.h to be defined, but I
110 * don't want to move the inclusion of signal.h this early into this
111 * file. Luckily, amd doesn't need the size of this structure in any
112 * other structure that it uses. So we sidestep it for now.
115 # endif /* _ALL_SOURCE */
117 #else /* not TIME_WITH_SYS_TIME */
119 # include <sys/time.h>
120 # else /* not HAVE_SYS_TIME_H */
122 # endif /* not HAVE_SYS_TIME_H */
123 #endif /* not TIME_WITH_SYS_TIME */
126 * Actions to take if <machine/endian.h> exists.
128 #ifdef HAVE_MACHINE_ENDIAN_H
129 # include <machine/endian.h>
130 #endif /* HAVE_MACHINE_ENDIAN_H */
133 * Big-endian or little-endian?
135 #ifdef WORDS_BIGENDIAN
136 # define ARCH_ENDIAN "big"
137 #else /* not WORDS_BIGENDIAN */
138 # define ARCH_ENDIAN "little"
139 #endif /* not WORDS_BIGENDIAN */
142 * Actions to take if HAVE_SYS_TYPES_H is defined.
145 # include <sys/types.h>
146 #endif /* HAVE_SYS_TYPES_H */
149 * Actions to take if HAVE_LIMITS_H is defined.
153 #endif /* HAVE_LIMITS_H */
156 * Actions to take if HAVE_UNISTD_H is defined.
160 #endif /* HAVE_UNISTD_H */
162 /* after <unistd.h>, check if this is a POSIX.1 system */
163 #ifdef _POSIX_VERSION
164 /* Code for POSIX.1 systems. */
165 #endif /* _POSIX_VERSION */
168 * Variable length argument lists.
169 * Must use only one of the two!
174 * On Solaris 2.6, <sys/varargs.h> is included in <sys/fs/autofs.h>
175 * So this ensures that only one is included.
177 # ifndef _SYS_VARARGS_H
178 # define _SYS_VARARGS_H
179 # endif /* not _SYS_VARARGS_H */
180 #else /* not HAVE_STDARG_H */
181 # ifdef HAVE_VARARGS_H
182 # include <varargs.h>
183 # endif /* HAVE_VARARGS_H */
184 #endif /* not HAVE_STDARG_H */
187 * Pick the right header file and macros for directory processing functions.
191 # define NAMLEN(dirent) strlen((dirent)->d_name)
192 #else /* not HAVE_DIRENT_H */
193 # define dirent direct
194 # define NAMLEN(dirent) (dirent)->d_namlen
196 # include <sys/ndir.h>
197 # endif /* HAVE_SYS_NDIR_H */
199 # include <sys/dir.h>
200 # endif /* HAVE_SYS_DIR_H */
203 # endif /* HAVE_NDIR_H */
204 #endif /* not HAVE_DIRENT_H */
207 * Actions to take if HAVE_FCNTL_H is defined.
210 # ifdef HAVE_LINUX_LOOP_H
211 /* so I can mount large files as loop devices */
212 /* XXX: need to move these two LARGEFILE defines to a better place */
213 # define _LARGEFILE64_SOURCE
214 # define __USE_LARGEFILE64
215 # endif /* HAVE_LINUX_LOOP_H */
217 #endif /* HAVE_FCNTL_H */
220 * Actions to take if HAVE_MEMORY_H is defined.
224 #endif /* HAVE_MEMORY_H */
227 * Actions to take if HAVE_SYS_FILE_H is defined.
230 # include <sys/file.h>
231 #endif /* HAVE_SYS_FILE_H */
234 * Actions to take if HAVE_SYS_IOCTL_H is defined.
237 # include <sys/ioctl.h>
238 #endif /* HAVE_SYS_IOCTL_H */
241 * Actions to take if HAVE_SYSLOG_H or HAVE_SYS_SYSLOG_H is defined.
245 #else /* not HAVE_SYSLOG_H */
246 # if HAVE_SYS_SYSLOG_H
247 # include <sys/syslog.h>
248 # endif /* HAVE_SYS_SYSLOG_H */
249 #endif /* HAVE_SYSLOG_H */
252 * Actions to take if <sys/param.h> exists.
254 #ifdef HAVE_SYS_PARAM_H
255 # include <sys/param.h>
256 #endif /* HAVE_SYS_PARAM_H */
259 * Actions to take if <sys/socket.h> exists.
261 #ifdef HAVE_SYS_SOCKET_H
262 # include <sys/socket.h>
263 #endif /* HAVE_SYS_SOCKET_H */
266 * Actions to take if <rpc/rpc.h> exists.
268 #ifdef HAVE_RPC_RPC_H
270 * Turn on PORTMAP, so that additional header files would get included
271 * and the important definition for UDPMSGSIZE is included too.
275 # endif /* not PORTMAP */
276 # include <rpc/rpc.h>
277 # ifndef XDRPROC_T_TYPE
278 typedef bool_t (*xdrproc_t) __P ((XDR *, __ptr_t, ...));
279 # endif /* not XDRPROC_T_TYPE */
280 #endif /* HAVE_RPC_RPC_H */
283 * Actions to take if <rpc/types.h> exists.
285 #ifdef HAVE_RPC_TYPES_H
286 # include <rpc/types.h>
287 #endif /* HAVE_RPC_TYPES_H */
290 * Actions to take if <rpc/xdr.h> exists.
292 /* Prevent multiple inclusion on Ultrix 4 */
293 #if defined(HAVE_RPC_XDR_H) && !defined(__XDR_HEADER__)
294 # include <rpc/xdr.h>
295 #endif /* defined(HAVE_RPC_XDR_H) && !defined(__XDR_HEADER__) */
298 * Actions to take if <malloc.h> exists.
299 * Don't include malloc.h if stdlib.h exists, because modern
300 * systems complain if you use malloc.h instead of stdlib.h.
301 * XXX: let's hope there are no systems out there that need both.
303 #if defined(HAVE_MALLOC_H) && !defined(HAVE_STDLIB_H)
305 #endif /* defined(HAVE_MALLOC_H) && !defined(HAVE_STDLIB_H) */
308 * Actions to take if <mntent.h> exists.
311 /* some systems need <stdio.h> before <mntent.h> is included */
314 # endif /* HAVE_STDIO_H */
316 #endif /* HAVE_MNTENT_H */
319 * Actions to take if <sys/errno.h> exists.
321 #ifdef HAVE_SYS_ERRNO_H
322 # include <sys/errno.h>
324 #endif /* HAVE_SYS_ERRNO_H */
327 * Actions to take if <sys/fsid.h> exists.
329 #ifdef HAVE_SYS_FSID_H
330 # include <sys/fsid.h>
331 #endif /* HAVE_SYS_FSID_H */
334 * Actions to take if <sys/utsname.h> exists.
336 #ifdef HAVE_SYS_UTSNAME_H
337 # include <sys/utsname.h>
338 #endif /* HAVE_SYS_UTSNAME_H */
341 * Actions to take if <sys/mntent.h> exists.
343 #ifdef HAVE_SYS_MNTENT_H
344 # include <sys/mntent.h>
345 #endif /* HAVE_SYS_MNTENT_H */
348 * Actions to take if <ndbm.h> or <db1/ndbm.h> exist.
349 * Should be included before <rpcsvc/yp_prot.h> because on some systems
350 * like Linux, it also defines "struct datum".
355 /* ensure that struct datum is not included again from <rpcsvc/yp_prot.h> */
357 # endif /* not DATUM */
358 #endif /* HAVE_MAP_NDBM */
361 * Actions to take if <net/errno.h> exists.
363 #ifdef HAVE_NET_ERRNO_H
364 # include <net/errno.h>
365 #endif /* HAVE_NET_ERRNO_H */
368 * Actions to take if <net/if.h> exists.
372 #endif /* HAVE_NET_IF_H */
375 * Actions to take if <net/route.h> exists.
377 #ifdef HAVE_NET_ROUTE_H
378 # include <net/route.h>
379 #endif /* HAVE_NET_ROUTE_H */
382 * Actions to take if <sys/mbuf.h> exists.
384 #ifdef HAVE_SYS_MBUF_H
385 # include <sys/mbuf.h>
387 * OSF4 (DU-4.0) defines m_next and m_data also in <sys/mount.h> so I must
388 # undefine them here to avoid conflicts.
397 * AIX 3 defines MFREE and m_flags also in <sys/mount.h>.
401 # endif /* m_flags */
405 #endif /* HAVE_SYS_MBUF_H */
408 * Actions to take if <sys/mman.h> exists.
410 #ifdef HAVE_SYS_MMAN_H
411 # include <sys/mman.h>
412 #endif /* HAVE_SYS_MMAN_H */
415 * Actions to take if <netdb.h> exists.
419 #endif /* HAVE_NETDB_H */
422 * Actions to take if <netdir.h> exists.
426 #endif /* HAVE_NETDIR_H */
429 * Actions to take if <net/if_var.h> exists.
431 #ifdef HAVE_NET_IF_VAR_H
432 # include <net/if_var.h>
433 #endif /* HAVE_NET_IF_VAR_H */
436 * Actions to take if <netinet/if_ether.h> exists.
438 #ifdef HAVE_NETINET_IF_ETHER_H
439 # include <netinet/if_ether.h>
440 #endif /* HAVE_NETINET_IF_ETHER_H */
443 * Actions to take if <netinet/in.h> exists.
445 #ifdef HAVE_NETINET_IN_H
446 # include <netinet/in.h>
447 #endif /* HAVE_NETINET_IN_H */
450 * Actions to take if <rpcsvc/yp_prot.h> exists.
452 #ifdef HAVE_RPCSVC_YP_PROT_H
453 # ifdef HAVE_BAD_HEADERS
454 /* avoid circular dependency in aix 4.3 with <rpcsvc/ypclnt.h> */
455 struct ypall_callback;
456 # endif /* HAVE_BAD_HEADERS */
457 # include <rpcsvc/yp_prot.h>
458 #endif /* HAVE_RPCSVC_YP_PROT_H */
461 * Actions to take if <rpcsvc/ypclnt.h> exists.
463 #ifdef HAVE_RPCSVC_YPCLNT_H
464 # include <rpcsvc/ypclnt.h>
465 #endif /* HAVE_RPCSVC_YPCLNT_H */
468 * Actions to take if <sys/ucred.h> exists.
470 #ifdef HAVE_SYS_UCRED_H
471 # include <sys/ucred.h>
472 #endif /* HAVE_SYS_UCRED_H */
476 * Actions to take if <sys/mount.h> exists.
478 #ifdef HAVE_SYS_MOUNT_H
480 * Some operating systems must define these variables to get
481 * NFS and other definitions included.
485 # endif /* not NFSCLIENT */
488 # endif /* not NFS */
491 # endif /* not PCFS */
494 # endif /* not LOFS */
497 # endif /* not RFS */
500 # endif /* not MSDOSFS */
503 # endif /* not MFS */
506 # endif /* not CD9660 */
507 # include <sys/mount.h>
508 #endif /* HAVE_SYS_MOUNT_H */
510 #ifdef HAVE_SYS_VMOUNT_H
511 # include <sys/vmount.h>
512 #endif /* HAVE_SYS_VMOUNT_H */
515 * Actions to take if <linux/fs.h> exists.
516 * There is no point in including this on a glibc2 system,
517 * we're only asking for trouble
519 #if defined HAVE_LINUX_FS_H && (!defined __GLIBC__ || __GLIBC__ < 2)
521 * There are various conflicts in definitions between RedHat Linux, newer
522 * 2.2 kernels, and <netinet/in.h> and <linux/fs.h>.
524 # ifdef HAVE_SOCKETBITS_H
525 /* conflicts with <socketbits.h> */
526 # define _LINUX_SOCKET_H
536 # if defined(__GLIBC__) && __GLIBC__ >= 2
537 /* conflicts with <waitflags.h> */
540 # endif /* defined(__GLIBC__) && __GLIBC__ >= 2 */
541 /* conflicts with <statfsbuf.h> */
542 # define _SYS_STATFS_H
543 # endif /* HAVE_SOCKETBITS_H */
546 # if defined(__GLIBC__) && __GLIBC__ >= 2
547 /* conflicts with <bits/waitflags.h> (RedHat/Linux 6.0 and kernels 2.2 */
550 # endif /* defined(__GLIBC__) && __GLIBC__ >= 2 */
551 # endif /* _SYS_WAIT_H */
553 # ifdef HAVE_LINUX_POSIX_TYPES_H
554 # include <linux/posix_types.h>
555 # endif /* HAVE_LINUX_POSIX_TYPES_H */
556 # ifndef _LINUX_BYTEORDER_GENERIC_H
557 # define _LINUX_BYTEORDER_GENERIC_H
558 # endif /* _LINUX_BYTEORDER_GENERIC_H */
559 /* conflicts with <sys/mount.h> in 2.[12] kernels */
573 # undef MS_NODIRATIME
579 # undef MS_SYNCHRONOUS
582 /* conflicts with <statfsbuf.h> */
583 # define _SYS_STATFS_H
584 # endif /* _SYS_MOUNT_H */
585 # ifndef _LINUX_STRING_H_
586 # define _LINUX_STRING_H_
587 # endif /* not _LINUX_STRING_H_ */
588 # ifdef HAVE_LINUX_KDEV_T_H
590 # include <linux/kdev_t.h>
592 # endif /* HAVE_LINUX_KDEV_T_H */
593 # ifdef HAVE_LINUX_LIST_H
595 # include <linux/list.h>
597 # endif /* HAVE_LINUX_LIST_H */
598 # include <linux/fs.h>
599 #endif /* HAVE_LINUX_FS_H && (!__GLIBC__ || __GLIBC__ < 2) */
601 #ifdef HAVE_CDFS_CDFS_MOUNT_H
602 # include <cdfs/cdfs_mount.h>
603 #endif /* HAVE_CDFS_CDFS_MOUNT_H */
605 #ifdef HAVE_CDFS_CDFSMOUNT_H
606 # include <cdfs/cdfsmount.h>
607 #endif /* HAVE_CDFS_CDFSMOUNT_H */
610 * Actions to take if <linux/loop.h> exists.
612 #ifdef HAVE_LINUX_LOOP_H
613 # ifdef HAVE_LINUX_POSIX_TYPES_H
614 # include <linux/posix_types.h>
615 # endif /* HAVE_LINUX_POSIX_TYPES_H */
616 /* next dev_t lines needed due to changes in kernel code */
618 # define dev_t unsigned short /* compatible with Red Hat and SuSE */
619 # include <linux/loop.h>
620 #endif /* HAVE_LINUX_LOOP_H */
623 * AUTOFS PROTOCOL HEADER FILES:
627 * Actions to take if <linux/auto_fs[4].h> exists.
628 * We really don't want <linux/fs.h> pulled in here
632 #endif /* _LINUX_FS_H */
633 #ifdef HAVE_LINUX_AUTO_FS4_H
634 # include <linux/auto_fs4.h>
635 #else /* not HAVE_LINUX_AUTO_FS4_H */
636 # ifdef HAVE_LINUX_AUTO_FS_H
637 # include <linux/auto_fs.h>
638 # endif /* HAVE_LINUX_AUTO_FS_H */
639 #endif /* not HAVE_LINUX_AUTO_FS4_H */
642 * Actions to take if <sys/fs/autofs.h> exists.
644 #ifdef HAVE_SYS_FS_AUTOFS_H
645 # include <sys/fs/autofs.h>
646 #endif /* HAVE_SYS_FS_AUTOFS_H */
649 * Actions to take if <rpcsvc/autofs_prot.h> or <sys/fs/autofs_prot.h> exist.
651 #ifdef HAVE_RPCSVC_AUTOFS_PROT_H
652 # include <rpcsvc/autofs_prot.h>
653 #else /* not HAVE_RPCSVC_AUTOFS_PROT_H */
654 # ifdef HAVE_SYS_FS_AUTOFS_PROT_H
655 # include <sys/fs/autofs_prot.h>
656 # endif /* HAVE_SYS_FS_AUTOFS_PROT_H */
657 #endif /* not HAVE_RPCSVC_AUTOFS_PROT_H */
660 * Actions to take if <lber.h> exists.
661 * This header file is required before <ldap.h> can be included.
665 #endif /* HAVE_LBER_H */
668 * Actions to take if <ldap.h> exists.
672 #endif /* HAVE_LDAP_H */
674 /****************************************************************************
676 ** We always include am-utils' amu_autofs_prot.h. **
677 ** That is actually defined in "conf/autofs/autofs_${autofs_style}.h" **
678 ****************************************************************************/
679 #include <amu_autofs_prot.h>
683 * NFS PROTOCOL HEADER FILES:
687 * Actions to take if <nfs/export.h> exists.
689 #ifdef HAVE_NFS_EXPORT_H
690 # include <nfs/export.h>
691 #endif /* HAVE_NFS_EXPORT_H */
693 /****************************************************************************
695 ** We always include am-utils' amu_nfs_prot.h. **
696 ** That is actually defined in "conf/nfs_prot/nfs_prot_${host_os_name}.h" **
697 ****************************************************************************/
698 #include <amu_nfs_prot.h>
701 * DO NOT INCLUDE THESE FILES:
702 * They conflicts with other NFS headers and are generally not needed.
704 #ifdef DO_NOT_INCLUDE
705 # ifdef HAVE_NFS_NFS_CLNT_H
706 # include <nfs/nfs_clnt.h>
707 # endif /* HAVE_NFS_NFS_CLNT_H */
708 # ifdef HAVE_LINUX_NFS_H
709 # include <linux/nfs.h>
710 # endif /* HAVE_LINUX_NFS_H */
711 #endif /* DO NOT INCLUDE */
714 * Actions to take if one of the nfs headers exists.
716 #ifdef HAVE_NFS_NFS_GFS_H
717 # include <nfs/nfs_gfs.h>
718 #endif /* HAVE_NFS_NFS_GFS_H */
719 #ifdef HAVE_NFS_MOUNT_H
720 # include <nfs/mount.h>
721 #endif /* HAVE_NFS_MOUNT_H */
722 #ifdef HAVE_NFS_NFS_MOUNT_H_off
723 /* broken on nextstep3 (includes non-existing headers) */
724 # include <nfs/nfs_mount.h>
725 #endif /* HAVE_NFS_NFS_MOUNT_H */
726 #ifdef HAVE_NFS_PATHCONF_H
727 # include <nfs/pathconf.h>
728 #endif /* HAVE_NFS_PATHCONF_H */
729 #ifdef HAVE_SYS_FS_NFS_MOUNT_H
730 # include <sys/fs/nfs/mount.h>
731 #endif /* HAVE_SYS_FS_NFS_MOUNT_H */
732 #ifdef HAVE_SYS_FS_NFS_NFS_CLNT_H
733 # include <sys/fs/nfs/nfs_clnt.h>
734 #endif /* HAVE_SYS_FS_NFS_NFS_CLNT_H */
735 #ifdef HAVE_SYS_FS_NFS_CLNT_H
736 # include <sys/fs/nfs_clnt.h>
737 #endif /* HAVE_SYS_FS_NFS_CLNT_H */
739 /* complex rules for linux/nfs_mount.h: broken on so many systems */
740 #ifdef HAVE_LINUX_NFS_MOUNT_H
741 # ifndef _LINUX_NFS_H
742 # define _LINUX_NFS_H
743 # endif /* not _LINUX_NFS_H */
744 # ifndef _LINUX_NFS2_H
745 # define _LINUX_NFS2_H
746 # endif /* not _LINUX_NFS2_H */
747 # ifndef _LINUX_NFS3_H
748 # define _LINUX_NFS3_H
749 # endif /* not _LINUX_NFS3_H */
750 # ifndef _LINUX_NFS_FS_H
751 # define _LINUX_NFS_FS_H
752 # endif /* not _LINUX_NFS_FS_H */
755 # endif /* not _LINUX_IN_H */
758 # endif /* __KERNEL__ */
759 # include <linux/nfs_mount.h>
761 #endif /* HAVE_LINUX_NFS_MOUNT_H */
764 * Actions to take if <pwd.h> exists.
768 #endif /* HAVE_PWD_H */
771 * Actions to take if <hesiod.h> exists.
775 #endif /* HAVE_HESIOD_H */
778 * Actions to take if <arpa/nameser.h> exists.
779 * Should be included before <resolv.h>.
781 #ifdef HAVE_ARPA_NAMESER_H
784 # endif /* NOERROR */
786 * Conflicts with <sys/tpicommon.h> which is included from <sys/tiuser.h>
787 * on Solaris 2.6 systems. So undefine it first.
791 # endif /* T_UNSPEC */
792 # include <arpa/nameser.h>
793 #endif /* HAVE_ARPA_NAMESER_H */
796 * Actions to take if <arpa/inet.h> exists.
798 #ifdef HAVE_ARPA_INET_H
799 # ifdef HAVE_BAD_HEADERS
800 /* aix 4.3: avoid including <net/if_dl.h> */
802 # endif /* HAVE_BAD_HEADERS */
803 # include <arpa/inet.h>
804 #endif /* HAVE_ARPA_INET_H */
807 * Actions to take if <resolv.h> exists.
811 * On AIX 5.2, both <resolv.h> and <arpa/nameser_compat.h> define MAXDNAME,
812 * if compiling with gcc -D_USE_IRS (so that we get extern definitions for
813 * hstrerror() and others).
815 # if defined(_AIX) && defined(MAXDNAME) && defined(_USE_IRS)
817 # endif /* defined(_AIX) && defined(MAXDNAME) && defined(_USE_IRS) */
819 #endif /* HAVE_RESOLV_H */
822 * Actions to take if <sys/uio.h> exists.
824 #ifdef HAVE_SYS_UIO_H
825 # include <sys/uio.h>
826 #endif /* HAVE_SYS_UIO_H */
829 * Actions to take if <sys/fs/cachefs_fs.h> exists.
831 #ifdef HAVE_SYS_FS_CACHEFS_FS_H
832 # include <sys/fs/cachefs_fs.h>
833 #endif /* HAVE_SYS_FS_CACHEFS_FS_H */
836 * Actions to take if <sys/fs/pc_fs.h> exists.
838 #ifdef HAVE_SYS_FS_PC_FS_H
839 # include <sys/fs/pc_fs.h>
840 #endif /* HAVE_SYS_FS_PC_FS_H */
843 * Actions to take if <msdosfs/msdosfsmount.h> exists.
845 #ifdef HAVE_MSDOSFS_MSDOSFSMOUNT_H
846 # include <msdosfs/msdosfsmount.h>
847 #endif /* HAVE_MSDOSFS_MSDOSFSMOUNT_H */
850 * Actions to take if <fs/msdosfs/msdosfsmount.h> exists.
852 #ifdef HAVE_FS_MSDOSFS_MSDOSFSMOUNT_H
853 # include <fs/msdosfs/msdosfsmount.h>
854 #endif /* HAVE_FS_MSDOSFS_MSDOSFSMOUNT_H */
857 * Actions to take if <sys/fs/tmp.h> exists.
859 #ifdef HAVE_SYS_FS_TMP_H
860 # include <sys/fs/tmp.h>
861 #endif /* HAVE_SYS_FS_TMP_H */
864 * Actions to take if <sys/fs/ufs_mount.h> exists.
866 #ifdef HAVE_SYS_FS_UFS_MOUNT_H
867 # include <sys/fs/ufs_mount.h>
868 #endif /* HAVE_SYS_FS_UFS_MOUNT_H */
869 #ifdef HAVE_UFS_UFS_UFSMOUNT_H_off
870 # error do not include this file here because on netbsd/openbsd it
871 # error causes errors with other header files. Instead, add it to the
872 # error specific conf/nfs_prot_*.h file.
873 # include <ufs/ufs/ufsmount.h>
874 #endif /* HAVE_UFS_UFS_UFSMOUNT_H_off */
877 * Actions to take if <sys/fs/efs_clnt.h> exists.
879 #ifdef HAVE_SYS_FS_EFS_CLNT_H
880 # include <sys/fs/efs_clnt.h>
881 #endif /* HAVE_SYS_FS_EFS_CLNT_H */
884 * Actions to take if <sys/fs/xfs_clnt.h> exists.
886 #ifdef HAVE_SYS_FS_XFS_CLNT_H
887 # include <sys/fs/xfs_clnt.h>
888 #endif /* HAVE_SYS_FS_XFS_CLNT_H */
891 * Actions to take if <assert.h> exists.
895 #endif /* HAVE_ASSERT_H */
898 * Actions to take if <cfs.h> exists.
902 #endif /* HAVE_CFS_H */
905 * Actions to take if <cluster.h> exists.
907 #ifdef HAVE_CLUSTER_H
908 # include <cluster.h>
909 #endif /* HAVE_CLUSTER_H */
912 * Actions to take if <ctype.h> exists.
916 #endif /* HAVE_CTYPE_H */
919 * Actions to take if <errno.h> exists.
923 #endif /* HAVE_ERRNO_H */
926 * Actions to take if <grp.h> exists.
930 #endif /* HAVE_GRP_H */
933 * Actions to take if <hsfs/hsfs.h> exists.
935 #ifdef HAVE_HSFS_HSFS_H
936 # include <hsfs/hsfs.h>
937 #endif /* HAVE_HSFS_HSFS_H */
940 * Actions to take if <cdfs/cdfsmount.h> exists.
942 #ifdef HAVE_CDFS_CDFSMOUNT_H
943 # include <cdfs/cdfsmount.h>
944 #endif /* HAVE_CDFS_CDFSMOUNT_H */
947 * Actions to take if <isofs/cd9660/cd9660_mount.h> exists.
949 #ifdef HAVE_ISOFS_CD9660_CD9660_MOUNT_H
950 # include <isofs/cd9660/cd9660_mount.h>
951 #endif /* HAVE_ISOFS_CD9660_CD9660_MOUNT_H */
954 * Actions to take if <mount.h> exists.
958 #endif /* HAVE_MOUNT_H */
961 * Actions to take if <nsswitch.h> exists.
963 #ifdef HAVE_NSSWITCH_H
964 # include <nsswitch.h>
965 #endif /* HAVE_NSSWITCH_H */
968 * Actions to take if <rpc/auth_des.h> exists.
970 #ifdef HAVE_RPC_AUTH_DES_H
971 # include <rpc/auth_des.h>
972 #endif /* HAVE_RPC_AUTH_DES_H */
975 * Actions to take if <rpc/pmap_clnt.h> exists.
977 #ifdef HAVE_RPC_PMAP_CLNT_H
978 # include <rpc/pmap_clnt.h>
979 #endif /* HAVE_RPC_PMAP_CLNT_H */
982 * Actions to take if <rpc/pmap_prot.h> exists.
984 #ifdef HAVE_RPC_PMAP_PROT_H
985 # include <rpc/pmap_prot.h>
986 #endif /* HAVE_RPC_PMAP_PROT_H */
990 * Actions to take if <rpcsvc/mount.h> exists.
991 * AIX does not protect against this file doubly included,
992 * so I have to do my own protection here.
994 #ifdef HAVE_RPCSVC_MOUNT_H
995 # ifndef _RPCSVC_MOUNT_H
996 # include <rpcsvc/mount.h>
997 # endif /* not _RPCSVC_MOUNT_H */
998 #endif /* HAVE_RPCSVC_MOUNT_H */
1001 * Actions to take if <rpcsvc/nis.h> exists.
1003 #ifdef HAVE_RPCSVC_NIS_H
1005 * Solaris 10 (build 72) defines GROUP_OBJ in <sys/acl.h>, which is included
1006 * in many other header files. <rpcsvc/nis.h> uses GROUP_OBJ inside enum
1007 * zotypes. So if you're unlucky enough to include both headers, you get a
1008 * compile error because the two symbols conflict.
1009 * A similar conflict arises with Sun cc and the definition of "GROUP".
1011 * Temp hack: undefine acl.h's GROUP_OBJ and GROUP because they're not needed
1016 # endif /* GROUP_OBJ */
1020 # include <rpcsvc/nis.h>
1021 #endif /* HAVE_RPCSVC_NIS_H */
1024 * Actions to take if <setjmp.h> exists.
1026 #ifdef HAVE_SETJMP_H
1027 # include <setjmp.h>
1028 #endif /* HAVE_SETJMP_H */
1031 * Actions to take if <signal.h> exists.
1033 #ifdef HAVE_SIGNAL_H
1034 # include <signal.h>
1035 #endif /* HAVE_SIGNAL_H */
1038 * Actions to take if <string.h> exists.
1040 #ifdef HAVE_STRING_H
1041 # include <string.h>
1042 #endif /* HAVE_STRING_H */
1045 * Actions to take if <strings.h> exists.
1047 #ifdef HAVE_STRINGS_H
1048 # include <strings.h>
1049 #endif /* HAVE_STRINGS_H */
1052 * Actions to take if <sys/config.h> exists.
1054 #ifdef HAVE_SYS_CONFIG_H
1055 # include <sys/config.h>
1056 #endif /* HAVE_SYS_CONFIG_H */
1059 * Actions to take if <sys/dg_mount.h> exists.
1061 #ifdef HAVE_SYS_DG_MOUNT_H
1062 # include <sys/dg_mount.h>
1063 #endif /* HAVE_SYS_DG_MOUNT_H */
1066 * Actions to take if <sys/fs_types.h> exists.
1068 #ifdef HAVE_SYS_FS_TYPES_H
1070 * Define KERNEL here to avoid multiple definitions of gt_names[] on
1074 # include <sys/fs_types.h>
1076 #endif /* HAVE_SYS_FS_TYPES_H */
1079 * Actions to take if <sys/fstyp.h> exists.
1081 #ifdef HAVE_SYS_FSTYP_H
1082 # include <sys/fstyp.h>
1083 #endif /* HAVE_SYS_FSTYP_H */
1086 * Actions to take if <sys/lock.h> exists.
1088 #ifdef HAVE_SYS_LOCK_H
1089 # include <sys/lock.h>
1090 #endif /* HAVE_SYS_LOCK_H */
1093 * Actions to take if <sys/machine.h> exists.
1095 #ifdef HAVE_SYS_MACHINE_H
1096 # include <sys/machine.h>
1097 #endif /* HAVE_SYS_MACHINE_H */
1100 * Actions to take if <sys/mntctl.h> exists.
1102 #ifdef HAVE_SYS_MNTCTL_H
1103 # include <sys/mntctl.h>
1104 #endif /* HAVE_SYS_MNTCTL_H */
1107 * Actions to take if <sys/mnttab.h> exists.
1109 #ifdef HAVE_SYS_MNTTAB_H
1110 # include <sys/mnttab.h>
1111 #endif /* HAVE_SYS_MNTTAB_H */
1114 * Actions to take if <mnttab.h> exists.
1115 * Do not include it if MNTTAB is already defined because it probably
1116 * came from <sys/mnttab.h> and we do not want conflicting definitions.
1118 #if defined(HAVE_MNTTAB_H) && !defined(MNTTAB)
1119 # include <mnttab.h>
1120 #endif /* defined(HAVE_MNTTAB_H) && !defined(MNTTAB) */
1123 * Actions to take if <netconfig.h> exists.
1125 #ifdef HAVE_NETCONFIG_H
1126 # include <netconfig.h>
1127 /* Some systems (Solaris 2.5.1) don't declare this external */
1128 extern char *nc_sperror(void);
1129 #endif /* HAVE_NETCONFIG_H */
1132 * Actions to take if <sys/netconfig.h> exists.
1134 #ifdef HAVE_SYS_NETCONFIG_H
1135 # include <sys/netconfig.h>
1136 #endif /* HAVE_SYS_NETCONFIG_H */
1139 * Actions to take if <sys/pathconf.h> exists.
1141 #ifdef HAVE_SYS_PATHCONF_H
1142 # include <sys/pathconf.h>
1143 #endif /* HAVE_SYS_PATHCONF_H */
1146 * Actions to take if <sys/resource.h> exists.
1148 #ifdef HAVE_SYS_RESOURCE_H
1149 # include <sys/resource.h>
1150 #endif /* HAVE_SYS_RESOURCE_H */
1153 * Actions to take if <sys/sema.h> exists.
1155 #ifdef HAVE_SYS_SEMA_H
1156 # include <sys/sema.h>
1157 #endif /* HAVE_SYS_SEMA_H */
1160 * Actions to take if <sys/signal.h> exists.
1162 #ifdef HAVE_SYS_SIGNAL_H
1163 # include <sys/signal.h>
1164 #endif /* HAVE_SYS_SIGNAL_H */
1167 * Actions to take if <sys/sockio.h> exists.
1169 #ifdef HAVE_SYS_SOCKIO_H
1170 # include <sys/sockio.h>
1171 #endif /* HAVE_SYS_SOCKIO_H */
1174 * Actions to take if <sys/syscall.h> exists.
1176 #ifdef HAVE_SYS_SYSCALL_H
1177 # include <sys/syscall.h>
1178 #endif /* HAVE_SYS_SYSCALL_H */
1181 * Actions to take if <sys/syslimits.h> exists.
1183 #ifdef HAVE_SYS_SYSLIMITS_H
1184 # include <sys/syslimits.h>
1185 #endif /* HAVE_SYS_SYSLIMITS_H */
1188 * Actions to take if <tiuser.h> exists.
1190 #ifdef HAVE_TIUSER_H
1192 * Some systems like AIX have multiple definitions for T_NULL and others
1193 * that are defined first in <arpa/nameser.h>.
1195 # ifdef HAVE_ARPA_NAMESER_H
1198 # endif /* T_NULL */
1201 # endif /* T_UNSPEC */
1204 # endif /* T_IDLE */
1205 # endif /* HAVE_ARPA_NAMESER_H */
1206 # include <tiuser.h>
1207 #endif /* HAVE_TIUSER_H */
1210 * Actions to take if <sys/tiuser.h> exists.
1212 #ifdef HAVE_SYS_TIUSER_H
1213 # include <sys/tiuser.h>
1214 #endif /* HAVE_SYS_TIUSER_H */
1217 * Actions to take if <sys/statfs.h> exists.
1219 #ifdef HAVE_SYS_STATFS_H
1220 # include <sys/statfs.h>
1221 #endif /* HAVE_SYS_STATFS_H */
1224 * Actions to take if <sys/statvfs.h> exists.
1226 #ifdef HAVE_SYS_STATVFS_H
1227 # include <sys/statvfs.h>
1228 #endif /* HAVE_SYS_STATVFS_H */
1231 * Actions to take if <sys/vfs.h> exists.
1233 #ifdef HAVE_SYS_VFS_H
1234 # include <sys/vfs.h>
1235 #endif /* HAVE_SYS_VFS_H */
1238 * Actions to take if <sys/vmount.h> exists.
1240 #ifdef HAVE_SYS_VMOUNT_H
1241 # include <sys/vmount.h>
1242 #endif /* HAVE_SYS_VMOUNT_H */
1245 * Actions to take if <ufs/ufs_mount.h> exists.
1247 #ifdef HAVE_UFS_UFS_MOUNT_H
1248 # include <ufs/ufs_mount.h>
1249 #endif /* HAVE_UFS_UFS_MOUNT_H */
1252 * Are S_ISDIR, S_ISREG, et al broken? If not, include <sys/stat.h>.
1253 * Turned off the not using sys/stat.h based on if the macros are
1254 * "broken", because they incorrectly get reported as broken on
1257 #ifndef STAT_MACROS_BROKEN_notused
1259 * RedHat Linux 4.2 (alpha) has a problem in the headers that causes
1260 * duplicate definitions, and also some other nasty bugs. Upgrade to Redhat
1263 # ifdef HAVE_SYS_STAT_H
1264 /* avoid duplicates or conflicts with <linux/stat.h> (RedHat alpha linux) */
1265 # if defined(S_IFREG) && defined(HAVE_STATBUF_H)
1266 # include <statbuf.h>
1297 # endif /* defined(S_IFREG) && defined(HAVE_STATBUF_H) */
1298 # include <sys/stat.h>
1299 # endif /* HAVE_SYS_STAT_H */
1300 #endif /* not STAT_MACROS_BROKEN_notused */
1303 * Actions to take if <stdio.h> exists.
1307 #endif /* HAVE_STDIO_H */
1310 * Actions to take if <stdlib.h> exists.
1312 #ifdef HAVE_STDLIB_H
1313 # include <stdlib.h>
1314 #endif /* HAVE_STDLIB_H */
1317 * Actions to take if <regex.h> exists.
1321 #endif /* HAVE_REGEX_H */
1324 * Actions to take if <tcpd.h> exists.
1326 #if defined(HAVE_TCPD_H) && defined(HAVE_LIBWRAP)
1328 #endif /* defined(HAVE_TCPD_H) && defined(HAVE_LIBWRAP) */
1331 /****************************************************************************/
1333 * Specific macros we're looking for.
1337 # define memset(ptr, val, len) bzero((ptr), (len))
1338 # else /* not HAVE_BZERO */
1339 # error Cannot find either memset or bzero!
1340 # endif /* not HAVE_BZERO */
1341 #endif /* not HAVE_MEMSET */
1343 #ifndef HAVE_MEMMOVE
1345 # define memmove(to, from, len) bcopy((from), (to), (len))
1346 # else /* not HAVE_BCOPY */
1347 # error Cannot find either memmove or bcopy!
1348 # endif /* not HAVE_BCOPY */
1349 #endif /* not HAVE_MEMMOVE */
1352 * memcmp() is more problematic:
1353 * Systems that don't have it, but have bcmp(), will use bcmp() instead.
1354 * Those that have it, but it is bad (SunOS 4 doesn't handle
1355 * 8 bit comparisons correctly), will get to use am_memcmp().
1356 * Otherwise if you have memcmp() and it is good, use it.
1359 # ifdef HAVE_BAD_MEMCMP
1360 # define memcmp am_memcmp
1361 extern int am_memcmp(const voidp s1, const voidp s2, size_t len);
1362 # endif /* HAVE_BAD_MEMCMP */
1363 #else /* not HAVE_MEMCMP */
1365 # define memcmp(a, b, len) bcmp((a), (b), (len))
1366 # endif /* HAVE_BCMP */
1367 #endif /* not HAVE_MEMCMP */
1369 #ifndef HAVE_SETEUID
1370 # ifdef HAVE_SETRESUID
1371 # define seteuid(x) setresuid(-1,(x),-1)
1372 # else /* not HAVE_SETRESUID */
1373 # error Cannot find either seteuid or setresuid!
1374 # endif /* not HAVE_SETRESUID */
1375 #endif /* not HAVE_SETEUID */
1378 * Define type of mntent_t.
1379 * Defaults to struct mntent, else struct mnttab. If neither is found, and
1380 * the operating system does keep not mount tables in the kernel, then flag
1381 * it as an error. If neither is found and the OS keeps mount tables in the
1382 * kernel, then define our own version of mntent; it will be needed for amd
1383 * to keep its own internal version of the mount tables.
1385 #ifdef HAVE_STRUCT_MNTENT
1386 typedef struct mntent mntent_t;
1387 #else /* not HAVE_STRUCT_MNTENT */
1388 # ifdef HAVE_STRUCT_MNTTAB
1389 typedef struct mnttab mntent_t;
1390 /* map struct mnttab field names to struct mntent field names */
1391 # define mnt_fsname mnt_special
1392 # define mnt_dir mnt_mountp
1393 # define mnt_opts mnt_mntopts
1394 # define mnt_type mnt_fstype
1395 # else /* not HAVE_STRUCT_MNTTAB */
1396 # ifdef MOUNT_TABLE_ON_FILE
1397 # error Could not find definition for struct mntent or struct mnttab!
1398 # else /* not MOUNT_TABLE_ON_FILE */
1399 typedef struct _am_mntent {
1400 char *mnt_fsname; /* name of mounted file system */
1401 char *mnt_dir; /* file system path prefix */
1402 char *mnt_type; /* MNTTAB_TYPE_* */
1403 char *mnt_opts; /* MNTTAB_OPT_* */
1404 int mnt_freq; /* dump frequency, in days */
1405 int mnt_passno; /* pass number on parallel fsck */
1407 # endif /* not MOUNT_TABLE_ON_FILE */
1408 # endif /* not HAVE_STRUCT_MNTTAB */
1409 #endif /* not HAVE_STRUCT_MNTENT */
1412 * Provide FD_* macros for systems that lack them.
1415 # define FD_SET(fd, set) (*(set) |= (1 << (fd)))
1416 # define FD_ISSET(fd, set) (*(set) & (1 << (fd)))
1417 # define FD_CLR(fd, set) (*(set) &= ~(1 << (fd)))
1418 # define FD_ZERO(set) (*(set) = 0)
1419 #endif /* not FD_SET */
1423 * Complete external definitions missing from some systems.
1426 #ifndef HAVE_EXTERN_SYS_ERRLIST
1427 extern const char *const sys_errlist[];
1428 #endif /* not HAVE_EXTERN_SYS_ERRLIST */
1430 #ifndef HAVE_EXTERN_OPTARG
1431 extern char *optarg;
1433 #endif /* not HAVE_EXTERN_OPTARG */
1435 #if defined(HAVE_CLNT_SPCREATEERROR) && !defined(HAVE_EXTERN_CLNT_SPCREATEERROR)
1436 extern char *clnt_spcreateerror(const char *s);
1437 #endif /* defined(HAVE_CLNT_SPCREATEERROR) && !defined(HAVE_EXTERN_CLNT_SPCREATEERROR) */
1439 #if defined(HAVE_CLNT_SPERRNO) && !defined(HAVE_EXTERN_CLNT_SPERRNO)
1440 extern char *clnt_sperrno(const enum clnt_stat num);
1441 #endif /* defined(HAVE_CLNT_SPERRNO) && !defined(HAVE_EXTERN_CLNT_SPERRNO) */
1443 #ifndef HAVE_EXTERN_FREE
1444 extern void free(voidp);
1445 #endif /* not HAVE_EXTERN_FREE */
1447 #if defined(HAVE_GET_MYADDRESS) && !defined(HAVE_EXTERN_GET_MYADDRESS)
1448 extern void get_myaddress(struct sockaddr_in *addr);
1449 #endif /* defined(HAVE_GET_MYADDRESS) && !defined(HAVE_EXTERN_GET_MYADDRESS) */
1451 #if defined(HAVE_GETDOMAINNAME) && !defined(HAVE_EXTERN_GETDOMAINNAME)
1452 # if defined(HAVE_MAP_NIS) || defined(HAVE_MAP_NISPLUS)
1453 extern int getdomainname(char *name, int namelen);
1454 # endif /* defined(HAVE_MAP_NIS) || defined(HAVE_MAP_NISPLUS) */
1455 #endif /* defined(HAVE_GETDOMAINNAME) && !defined(HAVE_EXTERN_GETDOMAINNAME) */
1457 #if defined(HAVE_GETDTABLESIZE) && !defined(HAVE_EXTERN_GETDTABLESIZE)
1458 extern int getdtablesize(void);
1459 #endif /* defined(HAVE_GETDTABLESIZE) && !defined(HAVE_EXTERN_GETDTABLESIZE) */
1461 #if defined(HAVE_GETHOSTNAME) && !defined(HAVE_EXTERN_GETHOSTNAME)
1462 extern int gethostname(char *name, int namelen);
1463 #endif /* defined(HAVE_GETHOSTNAME) && !defined(HAVE_EXTERN_GETHOSTNAME) */
1465 #ifndef HAVE_EXTERN_GETLOGIN
1466 extern char *getlogin(void);
1467 #endif /* not HAVE_EXTERN_GETLOGIN */
1469 #if defined(HAVE_GETPAGESIZE) && !defined(HAVE_EXTERN_GETPAGESIZE)
1470 extern int getpagesize(void);
1471 #endif /* defined(HAVE_GETPAGESIZE) && !defined(HAVE_EXTERN_GETPAGESIZE) */
1473 #ifndef HAVE_EXTERN_GETWD
1474 extern char *getwd(char *s);
1475 #endif /* not HAVE_EXTERN_GETWD */
1477 #if defined(HAVE_TCPD_H) && defined(HAVE_LIBWRAP) && !defined(HAVE_EXTERN_HOSTS_CTL)
1478 extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, char *client_user);
1479 #endif /* defined(HAVE_TCPD_H) && defined(HAVE_LIBWRAP) && !defined(HAVE_EXTERN_HOSTS_CTL) */
1481 #ifndef HAVE_EXTERN_INNETGR
1482 extern int innetgr(char *, char *, char *, char *);
1483 #endif /* not HAVE_EXTERN_INNETGR */
1485 #if defined(HAVE_MKSTEMP) && !defined(HAVE_EXTERN_MKSTEMP)
1486 extern int mkstemp(char *);
1487 #endif /* defined(HAVE_MKSTEMP) && !defined(HAVE_EXTERN_MKSTEMP) */
1489 #ifndef HAVE_EXTERN_SBRK
1490 extern caddr_t sbrk(int incr);
1491 #endif /* not HAVE_EXTERN_SBRK */
1493 #if defined(HAVE_SETEUID) && !defined(HAVE_EXTERN_SETEUID)
1494 extern int seteuid(uid_t euid);
1495 #endif /* not defined(HAVE_SETEUID) && !defined(HAVE_EXTERN_SETEUID) */
1497 #if defined(HAVE_SETITIMER) && !defined(HAVE_EXTERN_SETITIMER)
1498 extern int setitimer(int, struct itimerval *, struct itimerval *);
1499 #endif /* defined(HAVE_SETITIMER) && !defined(HAVE_EXTERN_SETITIMER) */
1501 #ifndef HAVE_EXTERN_SLEEP
1502 extern unsigned int sleep(unsigned int seconds);
1503 #endif /* not HAVE_EXTERN_SETITIMER */
1505 #ifndef HAVE_EXTERN_STRCASECMP
1507 * define this extern even if function does not exist, for it will
1508 * be filled in by libamu/strcasecmp.c
1510 extern int strcasecmp(const char *s1, const char *s2);
1511 #endif /* not HAVE_EXTERN_STRCASECMP */
1513 #ifndef HAVE_EXTERN_STRDUP
1515 * define this extern even if function does not exist, for it will
1516 * be filled in by libamu/strdup.c
1518 extern char *strdup(const char *s);
1519 #endif /* not HAVE_EXTERN_STRDUP */
1521 #ifndef HAVE_EXTERN_STRLCAT
1523 * define this extern even if function does not exist, for it will
1524 * be filled in by libamu/strlcat.c
1526 extern size_t strlcat(char *dst, const char *src, size_t siz);
1527 #endif /* not HAVE_EXTERN_STRLCAT */
1529 #ifndef HAVE_EXTERN_STRLCPY
1531 * define this extern even if function does not exist, for it will
1532 * be filled in by libamu/strlcpy.c
1534 extern size_t strlcpy(char *dst, const char *src, size_t siz);
1535 #endif /* not HAVE_EXTERN_STRLCPY */
1537 #if defined(HAVE_STRSTR) && !defined(HAVE_EXTERN_STRSTR)
1538 extern char *strstr(const char *s1, const char *s2);
1539 #endif /* defined(HAVE_STRSTR) && !defined(HAVE_EXTERN_STRSTR) */
1541 #if defined(HAVE_USLEEP) && !defined(HAVE_EXTERN_USLEEP)
1542 extern int usleep(u_int useconds);
1543 #endif /* defined(HAVE_USLEEP) && !defined(HAVE_EXTERN_USLEEP) */
1545 #ifndef HAVE_EXTERN_UALARM
1546 extern u_int ualarm(u_int usecs, u_int interval);
1547 #endif /* not HAVE_EXTERN_UALARM */
1549 #if defined(HAVE_WAIT3) && !defined(HAVE_EXTERN_WAIT3)
1550 extern int wait3(int *statusp, int options, struct rusage *rusage);
1551 #endif /* defined(HAVE_WAIT3) && !defined(HAVE_EXTERN_WAIT3) */
1553 #if defined(HAVE_VSNPRINTF) && !defined(HAVE_EXTERN_VSNPRINTF)
1554 extern int vsnprintf(char *, int, const char *, ...);
1555 #endif /* defined(HAVE_VSNPRINTF) && !defined(HAVE_EXTERN_VSNPRINTF) */
1557 #ifndef HAVE_EXTERN_XDR_CALLMSG
1558 extern bool_t xdr_callmsg(XDR *xdrs, struct rpc_msg *msg);
1559 #endif /* not HAVE_EXTERN_XDR_CALLMSG */
1561 #ifndef HAVE_EXTERN_XDR_OPAQUE_AUTH
1562 extern bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *auth);
1563 #endif /* not HAVE_EXTERN_XDR_OPAQUE_AUTH */
1565 /****************************************************************************/
1567 * amd-specific header files.
1569 #ifdef THIS_HEADER_FILE_IS_INCLUDED_ABOVE
1570 # include <amu_nfs_prot.h>
1571 #endif /* THIS_HEADER_FILE_IS_INCLUDED_ABOVE */
1572 #include <am_compat.h>
1573 #include <am_xdr_func.h>
1574 #include <am_utils.h>
1575 #include <amq_defs.h>
1576 #include <aux_conf.h>
1579 /****************************************************************************/
1581 * External definitions that depend on other macros available (or not)
1582 * and those are probably declared in any of the above headers.
1585 #ifdef HAVE_HASMNTOPT
1586 # ifdef HAVE_BAD_HASMNTOPT
1587 extern char *amu_hasmntopt(mntent_t *mnt, char *opt);
1588 # else /* not HAVE_BAD_HASMNTOPT */
1589 # define amu_hasmntopt hasmntopt
1590 # endif /* not HAVE_BAD_HASMNTOPT */
1591 #else /* not HAVE_HASMNTOPT */
1592 extern char *amu_hasmntopt(mntent_t *mnt, char *opt);
1593 #endif /* not HAVE_HASMNTOPT */
1595 #endif /* not _AM_DEFS_H */