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
41 * $Id: am_defs.h,v 1.15.2.16 2004/05/12 15:54:31 ezk Exp $
47 * Definitions that are not specific to the am-utils package, but
48 * are rather generic, and can be used elsewhere.
55 * Actions to take if ANSI C.
59 /* for function prototypes */
62 #else /* not STDC_HEADERS */
63 /* empty function prototypes */
68 # define strrchr rindex
69 # endif /* not HAVE_STRCHR */
70 char *strchr(), *strrchr(), *strdup();
71 #endif /* not STDC_HEADERS */
74 * Handle gcc __attribute__ if available.
77 /* This feature is available in gcc versions 2.5 and later. */
78 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
79 # define __attribute__(Spec) /* empty */
80 # endif /* __GNUC__ < 2 ... */
82 * The __-protected variants of `format' and `printf' attributes
83 * are accepted by gcc versions 2.6.4 (effectively 2.7) and later.
85 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
86 # define __format__ format
87 # define __printf__ printf
88 # endif /* __GNUC__ < 2 ... */
89 #endif /* not __attribute__ */
92 * How to handle signals of any type
94 #ifdef HAVE_SYS_WAIT_H
95 # include <sys/wait.h>
96 #endif /* HAVE_SYS_WAIT_H */
98 # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
99 #endif /* not WEXITSTATUS */
101 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
102 #endif /* not WIFEXITED */
105 * Actions to take regarding <time.h> and <sys/time.h>.
107 #if TIME_WITH_SYS_TIME
108 # include <sys/time.h>
111 * AIX 5.2 needs struct sigevent from signal.h to be defined, but I
112 * don't want to move the inclusion of signal.h this early into this
113 * file. Luckily, amd doesn't need the size of this structure in any
114 * other structure that it uses. So we sidestep it for now.
117 # endif /* _ALL_SOURCE */
119 #else /* not TIME_WITH_SYS_TIME */
121 # include <sys/time.h>
122 # else /* not HAVE_SYS_TIME_H */
124 # endif /* not HAVE_SYS_TIME_H */
125 #endif /* not TIME_WITH_SYS_TIME */
128 * Actions to take if <machine/endian.h> exists.
130 #ifdef HAVE_MACHINE_ENDIAN_H
131 # include <machine/endian.h>
132 #endif /* HAVE_MACHINE_ENDIAN_H */
135 * Big-endian or little-endian?
137 #ifdef WORDS_BIGENDIAN
138 # define ARCH_ENDIAN "big"
139 #else /* not WORDS_BIGENDIAN */
140 # define ARCH_ENDIAN "little"
141 #endif /* not WORDS_BIGENDIAN */
144 * Actions to take if HAVE_SYS_TYPES_H is defined.
147 # include <sys/types.h>
148 #endif /* HAVE_SYS_TYPES_H */
151 * Actions to take if HAVE_LIMITS_H is defined.
155 #endif /* HAVE_LIMITS_H */
158 * Actions to take if HAVE_UNISTD_H is defined.
162 #endif /* HAVE_UNISTD_H */
164 /* after <unistd.h>, check if this is a POSIX.1 system */
165 #ifdef _POSIX_VERSION
166 /* Code for POSIX.1 systems. */
167 #endif /* _POSIX_VERSION */
170 * Variable length argument lists.
171 * Must use only one of the two!
176 * On Solaris 2.6, <sys/varargs.h> is included in <sys/fs/autofs.h>
177 * So this ensures that only one is included.
179 # ifndef _SYS_VARARGS_H
180 # define _SYS_VARARGS_H
181 # endif /* not _SYS_VARARGS_H */
182 #else /* not HAVE_STDARG_H */
183 # ifdef HAVE_VARARGS_H
184 # include <varargs.h>
185 # endif /* HAVE_VARARGS_H */
186 #endif /* not HAVE_STDARG_H */
189 * Pick the right header file and macros for directory processing functions.
193 # define NAMLEN(dirent) strlen((dirent)->d_name)
194 #else /* not HAVE_DIRENT_H */
195 # define dirent direct
196 # define NAMLEN(dirent) (dirent)->d_namlen
198 # include <sys/ndir.h>
199 # endif /* HAVE_SYS_NDIR_H */
201 # include <sys/dir.h>
202 # endif /* HAVE_SYS_DIR_H */
205 # endif /* HAVE_NDIR_H */
206 #endif /* not HAVE_DIRENT_H */
209 * Actions to take if HAVE_FCNTL_H is defined.
212 # ifdef HAVE_LINUX_LOOP_H
213 /* so I can mount large files as loop devices */
214 /* XXX: need to move these two LARGEFILE defines to a better place */
215 # define _LARGEFILE64_SOURCE
216 # define __USE_LARGEFILE64
217 # endif /* HAVE_LINUX_LOOP_H */
219 #endif /* HAVE_FCNTL_H */
222 * Actions to take if HAVE_MEMORY_H is defined.
226 #endif /* HAVE_MEMORY_H */
229 * Actions to take if HAVE_SYS_FILE_H is defined.
232 # include <sys/file.h>
233 #endif /* HAVE_SYS_FILE_H */
236 * Actions to take if HAVE_SYS_IOCTL_H is defined.
239 # include <sys/ioctl.h>
240 #endif /* HAVE_SYS_IOCTL_H */
243 * Actions to take if HAVE_SYSLOG_H or HAVE_SYS_SYSLOG_H is defined.
247 #else /* not HAVE_SYSLOG_H */
248 # if HAVE_SYS_SYSLOG_H
249 # include <sys/syslog.h>
250 # endif /* HAVE_SYS_SYSLOG_H */
251 #endif /* HAVE_SYSLOG_H */
254 * Actions to take if <sys/param.h> exists.
256 #ifdef HAVE_SYS_PARAM_H
257 # include <sys/param.h>
258 #endif /* HAVE_SYS_PARAM_H */
261 * Actions to take if <sys/socket.h> exists.
263 #ifdef HAVE_SYS_SOCKET_H
264 # include <sys/socket.h>
265 #endif /* HAVE_SYS_SOCKET_H */
268 * Actions to take if <rpc/rpc.h> exists.
270 #ifdef HAVE_RPC_RPC_H
272 * Turn on PORTMAP, so that additional header files would get included
273 * and the important definition for UDPMSGSIZE is included too.
277 # endif /* not PORTMAP */
278 # include <rpc/rpc.h>
279 # ifndef XDRPROC_T_TYPE
280 typedef bool_t (*xdrproc_t) __P ((XDR *, __ptr_t, ...));
281 # endif /* not XDRPROC_T_TYPE */
282 #endif /* HAVE_RPC_RPC_H */
285 * Actions to take if <rpc/types.h> exists.
287 #ifdef HAVE_RPC_TYPES_H
288 # include <rpc/types.h>
289 #endif /* HAVE_RPC_TYPES_H */
292 * Actions to take if <rpc/xdr.h> exists.
294 /* Prevent multiple inclusion on Ultrix 4 */
295 #if defined(HAVE_RPC_XDR_H) && !defined(__XDR_HEADER__)
296 # include <rpc/xdr.h>
297 #endif /* defined(HAVE_RPC_XDR_H) && !defined(__XDR_HEADER__) */
300 * Actions to take if <malloc.h> exists.
301 * Don't include malloc.h if stdlib.h exists, because modern
302 * systems complain if you use malloc.h instead of stdlib.h.
303 * XXX: let's hope there are no systems out there that need both.
305 #if defined(HAVE_MALLOC_H) && !defined(HAVE_STDLIB_H)
307 #endif /* defined(HAVE_MALLOC_H) && !defined(HAVE_STDLIB_H) */
310 * Actions to take if <mntent.h> exists.
313 /* some systems need <stdio.h> before <mntent.h> is included */
316 # endif /* HAVE_STDIO_H */
318 #endif /* HAVE_MNTENT_H */
321 * Actions to take if <sys/errno.h> exists.
323 #ifdef HAVE_SYS_ERRNO_H
324 # include <sys/errno.h>
326 #endif /* HAVE_SYS_ERRNO_H */
329 * Actions to take if <sys/fsid.h> exists.
331 #ifdef HAVE_SYS_FSID_H
332 # include <sys/fsid.h>
333 #endif /* HAVE_SYS_FSID_H */
336 * Actions to take if <sys/utsname.h> exists.
338 #ifdef HAVE_SYS_UTSNAME_H
339 # include <sys/utsname.h>
340 #endif /* HAVE_SYS_UTSNAME_H */
343 * Actions to take if <sys/mntent.h> exists.
345 #ifdef HAVE_SYS_MNTENT_H
346 # include <sys/mntent.h>
347 #endif /* HAVE_SYS_MNTENT_H */
350 * Actions to take if <ndbm.h> or <db1/ndbm.h> exist.
351 * Should be included before <rpcsvc/yp_prot.h> because on some systems
352 * like Linux, it also defines "struct datum".
357 /* ensure that struct datum is not included again from <rpcsvc/yp_prot.h> */
359 # endif /* not DATUM */
360 #endif /* HAVE_MAP_NDBM */
363 * Actions to take if <net/errno.h> exists.
365 #ifdef HAVE_NET_ERRNO_H
366 # include <net/errno.h>
367 #endif /* HAVE_NET_ERRNO_H */
370 * Actions to take if <net/if.h> exists.
374 #endif /* HAVE_NET_IF_H */
377 * Actions to take if <net/route.h> exists.
379 #ifdef HAVE_NET_ROUTE_H
380 # include <net/route.h>
381 #endif /* HAVE_NET_ROUTE_H */
384 * Actions to take if <sys/mbuf.h> exists.
386 #ifdef HAVE_SYS_MBUF_H
387 # include <sys/mbuf.h>
389 * OSF4 (DU-4.0) defines m_next and m_data also in <sys/mount.h> so I must
390 # undefine them here to avoid conflicts.
399 * AIX 3 defines MFREE and m_flags also in <sys/mount.h>.
403 # endif /* m_flags */
407 #endif /* HAVE_SYS_MBUF_H */
410 * Actions to take if <sys/mman.h> exists.
412 #ifdef HAVE_SYS_MMAN_H
413 # include <sys/mman.h>
414 #endif /* HAVE_SYS_MMAN_H */
417 * Actions to take if <netdb.h> exists.
421 #endif /* HAVE_NETDB_H */
424 * Actions to take if <netdir.h> exists.
428 #endif /* HAVE_NETDIR_H */
431 * Actions to take if <net/if_var.h> exists.
433 #ifdef HAVE_NET_IF_VAR_H
434 # include <net/if_var.h>
435 #endif /* HAVE_NET_IF_VAR_H */
438 * Actions to take if <netinet/if_ether.h> exists.
440 #ifdef HAVE_NETINET_IF_ETHER_H
441 # include <netinet/if_ether.h>
442 #endif /* HAVE_NETINET_IF_ETHER_H */
445 * Actions to take if <netinet/in.h> exists.
447 #ifdef HAVE_NETINET_IN_H
448 # include <netinet/in.h>
449 #endif /* HAVE_NETINET_IN_H */
452 * Actions to take if <rpcsvc/yp_prot.h> exists.
454 #ifdef HAVE_RPCSVC_YP_PROT_H
455 # ifdef HAVE_BAD_HEADERS
456 /* avoid circular dependency in aix 4.3 with <rpcsvc/ypclnt.h> */
457 struct ypall_callback;
458 # endif /* HAVE_BAD_HEADERS */
459 # include <rpcsvc/yp_prot.h>
460 #endif /* HAVE_RPCSVC_YP_PROT_H */
463 * Actions to take if <rpcsvc/ypclnt.h> exists.
465 #ifdef HAVE_RPCSVC_YPCLNT_H
466 # include <rpcsvc/ypclnt.h>
467 #endif /* HAVE_RPCSVC_YPCLNT_H */
470 * Actions to take if <sys/ucred.h> exists.
472 #ifdef HAVE_SYS_UCRED_H
473 # include <sys/ucred.h>
474 #endif /* HAVE_SYS_UCRED_H */
478 * Actions to take if <sys/mount.h> exists.
480 #ifdef HAVE_SYS_MOUNT_H
482 * Some operating systems must define these variables to get
483 * NFS and other definitions included.
487 # endif /* not NFSCLIENT */
490 # endif /* not NFS */
493 # endif /* not PCFS */
496 # endif /* not LOFS */
499 # endif /* not RFS */
502 # endif /* not MSDOSFS */
505 # endif /* not MFS */
508 # endif /* not CD9660 */
509 # include <sys/mount.h>
510 #endif /* HAVE_SYS_MOUNT_H */
512 #ifdef HAVE_SYS_VMOUNT_H
513 # include <sys/vmount.h>
514 #endif /* HAVE_SYS_VMOUNT_H */
517 * Actions to take if <linux/fs.h> exists.
518 * There is no point in including this on a glibc2 system,
519 * we're only asking for trouble
521 #if defined HAVE_LINUX_FS_H && (!defined __GLIBC__ || __GLIBC__ < 2)
523 * There are various conflicts in definitions between RedHat Linux, newer
524 * 2.2 kernels, and <netinet/in.h> and <linux/fs.h>.
526 # ifdef HAVE_SOCKETBITS_H
527 /* conflicts with <socketbits.h> */
528 # define _LINUX_SOCKET_H
538 # if defined(__GLIBC__) && __GLIBC__ >= 2
539 /* conflicts with <waitflags.h> */
542 # endif /* defined(__GLIBC__) && __GLIBC__ >= 2 */
543 /* conflicts with <statfsbuf.h> */
544 # define _SYS_STATFS_H
545 # endif /* HAVE_SOCKETBITS_H */
548 # if defined(__GLIBC__) && __GLIBC__ >= 2
549 /* conflicts with <bits/waitflags.h> (RedHat/Linux 6.0 and kernels 2.2 */
552 # endif /* defined(__GLIBC__) && __GLIBC__ >= 2 */
553 # endif /* _SYS_WAIT_H */
555 # ifdef HAVE_LINUX_POSIX_TYPES_H
556 # include <linux/posix_types.h>
557 # endif /* HAVE_LINUX_POSIX_TYPES_H */
558 # ifndef _LINUX_BYTEORDER_GENERIC_H
559 # define _LINUX_BYTEORDER_GENERIC_H
560 # endif /* _LINUX_BYTEORDER_GENERIC_H */
561 /* conflicts with <sys/mount.h> in 2.[12] kernels */
575 # undef MS_NODIRATIME
581 # undef MS_SYNCHRONOUS
584 /* conflicts with <statfsbuf.h> */
585 # define _SYS_STATFS_H
586 # endif /* _SYS_MOUNT_H */
587 # ifndef _LINUX_STRING_H_
588 # define _LINUX_STRING_H_
589 # endif /* not _LINUX_STRING_H_ */
590 # ifdef HAVE_LINUX_KDEV_T_H
592 # include <linux/kdev_t.h>
594 # endif /* HAVE_LINUX_KDEV_T_H */
595 # ifdef HAVE_LINUX_LIST_H
597 # include <linux/list.h>
599 # endif /* HAVE_LINUX_LIST_H */
600 # include <linux/fs.h>
601 #endif /* HAVE_LINUX_FS_H && (!__GLIBC__ || __GLIBC__ < 2) */
603 #ifdef HAVE_CDFS_CDFS_MOUNT_H
604 # include <cdfs/cdfs_mount.h>
605 #endif /* HAVE_CDFS_CDFS_MOUNT_H */
607 #ifdef HAVE_CDFS_CDFSMOUNT_H
608 # include <cdfs/cdfsmount.h>
609 #endif /* HAVE_CDFS_CDFSMOUNT_H */
612 * Actions to take if <linux/loop.h> exists.
614 #ifdef HAVE_LINUX_LOOP_H
615 # ifdef HAVE_LINUX_POSIX_TYPES_H
616 # include <linux/posix_types.h>
617 # endif /* HAVE_LINUX_POSIX_TYPES_H */
618 /* next dev_t lines needed due to changes in kernel code */
620 # define dev_t unsigned short /* compatible with Red Hat and SuSE */
621 # include <linux/loop.h>
622 #endif /* HAVE_LINUX_LOOP_H */
625 * AUTOFS PROTOCOL HEADER FILES:
629 * Actions to take if <linux/auto_fs[4].h> exists.
630 * We really don't want <linux/fs.h> pulled in here
634 #endif /* _LINUX_FS_H */
635 #ifdef HAVE_LINUX_AUTO_FS4_H
636 # include <linux/auto_fs4.h>
637 #else /* not HAVE_LINUX_AUTO_FS4_H */
638 # ifdef HAVE_LINUX_AUTO_FS_H
639 # include <linux/auto_fs.h>
640 # endif /* HAVE_LINUX_AUTO_FS_H */
641 #endif /* not HAVE_LINUX_AUTO_FS4_H */
644 * Actions to take if <sys/fs/autofs.h> exists.
646 #ifdef HAVE_SYS_FS_AUTOFS_H
647 # include <sys/fs/autofs.h>
648 #endif /* HAVE_SYS_FS_AUTOFS_H */
651 * Actions to take if <rpcsvc/autofs_prot.h> or <sys/fs/autofs_prot.h> exist.
653 #ifdef HAVE_RPCSVC_AUTOFS_PROT_H
654 # include <rpcsvc/autofs_prot.h>
655 #else /* not HAVE_RPCSVC_AUTOFS_PROT_H */
656 # ifdef HAVE_SYS_FS_AUTOFS_PROT_H
657 # include <sys/fs/autofs_prot.h>
658 # endif /* HAVE_SYS_FS_AUTOFS_PROT_H */
659 #endif /* not HAVE_RPCSVC_AUTOFS_PROT_H */
662 * Actions to take if <lber.h> exists.
663 * This header file is required before <ldap.h> can be included.
667 #endif /* HAVE_LBER_H */
670 * Actions to take if <ldap.h> exists.
674 #endif /* HAVE_LDAP_H */
676 /****************************************************************************
678 ** We always include am-utils' amu_autofs_prot.h. **
679 ** That is actually defined in "conf/autofs/autofs_${autofs_style}.h" **
680 ****************************************************************************/
681 #include <amu_autofs_prot.h>
685 * NFS PROTOCOL HEADER FILES:
689 * Actions to take if <nfs/export.h> exists.
691 #ifdef HAVE_NFS_EXPORT_H
692 # include <nfs/export.h>
693 #endif /* HAVE_NFS_EXPORT_H */
695 /****************************************************************************
697 ** We always include am-utils' amu_nfs_prot.h. **
698 ** That is actually defined in "conf/nfs_prot/nfs_prot_${host_os_name}.h" **
699 ****************************************************************************/
700 #include <amu_nfs_prot.h>
703 * DO NOT INCLUDE THESE FILES:
704 * They conflicts with other NFS headers and are generally not needed.
706 #ifdef DO_NOT_INCLUDE
707 # ifdef HAVE_NFS_NFS_CLNT_H
708 # include <nfs/nfs_clnt.h>
709 # endif /* HAVE_NFS_NFS_CLNT_H */
710 # ifdef HAVE_LINUX_NFS_H
711 # include <linux/nfs.h>
712 # endif /* HAVE_LINUX_NFS_H */
713 #endif /* DO NOT INCLUDE */
716 * Actions to take if one of the nfs headers exists.
718 #ifdef HAVE_NFS_NFS_GFS_H
719 # include <nfs/nfs_gfs.h>
720 #endif /* HAVE_NFS_NFS_GFS_H */
721 #ifdef HAVE_NFS_MOUNT_H
722 # include <nfs/mount.h>
723 #endif /* HAVE_NFS_MOUNT_H */
724 #ifdef HAVE_NFS_NFS_MOUNT_H_off
725 /* broken on nextstep3 (includes non-existing headers) */
726 # include <nfs/nfs_mount.h>
727 #endif /* HAVE_NFS_NFS_MOUNT_H */
728 #ifdef HAVE_NFS_PATHCONF_H
729 # include <nfs/pathconf.h>
730 #endif /* HAVE_NFS_PATHCONF_H */
731 #ifdef HAVE_SYS_FS_NFS_MOUNT_H
732 # include <sys/fs/nfs/mount.h>
733 #endif /* HAVE_SYS_FS_NFS_MOUNT_H */
734 #ifdef HAVE_SYS_FS_NFS_NFS_CLNT_H
735 # include <sys/fs/nfs/nfs_clnt.h>
736 #endif /* HAVE_SYS_FS_NFS_NFS_CLNT_H */
737 #ifdef HAVE_SYS_FS_NFS_CLNT_H
738 # include <sys/fs/nfs_clnt.h>
739 #endif /* HAVE_SYS_FS_NFS_CLNT_H */
741 /* complex rules for linux/nfs_mount.h: broken on so many systems */
742 #ifdef HAVE_LINUX_NFS_MOUNT_H
743 # ifndef _LINUX_NFS_H
744 # define _LINUX_NFS_H
745 # endif /* not _LINUX_NFS_H */
746 # ifndef _LINUX_NFS2_H
747 # define _LINUX_NFS2_H
748 # endif /* not _LINUX_NFS2_H */
749 # ifndef _LINUX_NFS3_H
750 # define _LINUX_NFS3_H
751 # endif /* not _LINUX_NFS3_H */
752 # ifndef _LINUX_NFS_FS_H
753 # define _LINUX_NFS_FS_H
754 # endif /* not _LINUX_NFS_FS_H */
757 # endif /* not _LINUX_IN_H */
760 # endif /* __KERNEL__ */
761 # include <linux/nfs_mount.h>
763 #endif /* HAVE_LINUX_NFS_MOUNT_H */
766 * Actions to take if <pwd.h> exists.
770 #endif /* HAVE_PWD_H */
773 * Actions to take if <hesiod.h> exists.
777 #endif /* HAVE_HESIOD_H */
780 * Actions to take if <arpa/nameser.h> exists.
781 * Should be included before <resolv.h>.
783 #ifdef HAVE_ARPA_NAMESER_H
786 # endif /* NOERROR */
788 * Conflicts with <sys/tpicommon.h> which is included from <sys/tiuser.h>
789 * on Solaris 2.6 systems. So undefine it first.
793 # endif /* T_UNSPEC */
794 # include <arpa/nameser.h>
795 #endif /* HAVE_ARPA_NAMESER_H */
798 * Actions to take if <arpa/inet.h> exists.
800 #ifdef HAVE_ARPA_INET_H
801 # ifdef HAVE_BAD_HEADERS
802 /* aix 4.3: avoid including <net/if_dl.h> */
804 # endif /* HAVE_BAD_HEADERS */
805 # include <arpa/inet.h>
806 #endif /* HAVE_ARPA_INET_H */
809 * Actions to take if <resolv.h> exists.
813 * On AIX 5.2, both <resolv.h> and <arpa/nameser_compat.h> define MAXDNAME,
814 * if compiling with gcc -D_USE_IRS (so that we get extern definitions for
815 * hstrerror() and others).
817 # if defined(_AIX) && defined(MAXDNAME) && defined(_USE_IRS)
819 # endif /* defined(_AIX) && defined(MAXDNAME) && defined(_USE_IRS) */
821 #endif /* HAVE_RESOLV_H */
824 * Actions to take if <sys/uio.h> exists.
826 #ifdef HAVE_SYS_UIO_H
827 # include <sys/uio.h>
828 #endif /* HAVE_SYS_UIO_H */
831 * Actions to take if <sys/fs/cachefs_fs.h> exists.
833 #ifdef HAVE_SYS_FS_CACHEFS_FS_H
834 # include <sys/fs/cachefs_fs.h>
835 #endif /* HAVE_SYS_FS_CACHEFS_FS_H */
838 * Actions to take if <sys/fs/pc_fs.h> exists.
840 #ifdef HAVE_SYS_FS_PC_FS_H
841 # include <sys/fs/pc_fs.h>
842 #endif /* HAVE_SYS_FS_PC_FS_H */
845 * Actions to take if <msdosfs/msdosfsmount.h> exists.
847 #ifdef HAVE_MSDOSFS_MSDOSFSMOUNT_H
848 # include <msdosfs/msdosfsmount.h>
849 #endif /* HAVE_MSDOSFS_MSDOSFSMOUNT_H */
850 #ifdef HAVE_FS_MSDOSFS_MSDOSFSMOUNT_H
851 # include <fs/msdosfs/msdosfsmount.h>
852 #endif /* HAVE_FS_MSDOSFS_MSDOSFSMOUNT_H */
855 * Actions to take if <fs/msdosfs/msdosfsmount.h> exists.
857 #ifdef HAVE_FS_MSDOSFS_MSDOSFSMOUNT_H
858 # include <fs/msdosfs/msdosfsmount.h>
859 #endif /* HAVE_FS_MSDOSFS_MSDOSFSMOUNT_H */
862 * Actions to take if <sys/fs/tmp.h> exists.
864 #ifdef HAVE_SYS_FS_TMP_H
865 # include <sys/fs/tmp.h>
866 #endif /* HAVE_SYS_FS_TMP_H */
869 * Actions to take if <sys/fs/ufs_mount.h> exists.
871 #ifdef HAVE_SYS_FS_UFS_MOUNT_H
872 # include <sys/fs/ufs_mount.h>
873 #endif /* HAVE_SYS_FS_UFS_MOUNT_H */
875 * HAVE_UFS_UFS_UFSMOUNT_H should NOT be defined on netbsd/openbsd because it
876 * causes errors with other header files. Instead, add it to the specific
877 * conf/nfs_prot_*.h file.
879 #ifdef HAVE_UFS_UFS_UFSMOUNT_H
880 # include <ufs/ufs/ufsmount.h>
881 #endif /* HAVE_UFS_UFS_UFSMOUNT_H */
884 * Actions to take if <sys/fs/efs_clnt.h> exists.
886 #ifdef HAVE_SYS_FS_EFS_CLNT_H
887 # include <sys/fs/efs_clnt.h>
888 #endif /* HAVE_SYS_FS_EFS_CLNT_H */
891 * Actions to take if <sys/fs/xfs_clnt.h> exists.
893 #ifdef HAVE_SYS_FS_XFS_CLNT_H
894 # include <sys/fs/xfs_clnt.h>
895 #endif /* HAVE_SYS_FS_XFS_CLNT_H */
898 * Actions to take if <assert.h> exists.
902 #endif /* HAVE_ASSERT_H */
905 * Actions to take if <cfs.h> exists.
909 #endif /* HAVE_CFS_H */
912 * Actions to take if <cluster.h> exists.
914 #ifdef HAVE_CLUSTER_H
915 # include <cluster.h>
916 #endif /* HAVE_CLUSTER_H */
919 * Actions to take if <ctype.h> exists.
923 #endif /* HAVE_CTYPE_H */
926 * Actions to take if <errno.h> exists.
930 #endif /* HAVE_ERRNO_H */
933 * Actions to take if <grp.h> exists.
937 #endif /* HAVE_GRP_H */
940 * Actions to take if <hsfs/hsfs.h> exists.
942 #ifdef HAVE_HSFS_HSFS_H
943 # include <hsfs/hsfs.h>
944 #endif /* HAVE_HSFS_HSFS_H */
947 * Actions to take if <cdfs/cdfsmount.h> exists.
949 #ifdef HAVE_CDFS_CDFSMOUNT_H
950 # include <cdfs/cdfsmount.h>
951 #endif /* HAVE_CDFS_CDFSMOUNT_H */
954 * Actions to take if <isofs/cd9660/cd9660_mount.h> exists.
956 #ifdef HAVE_ISOFS_CD9660_CD9660_MOUNT_H
957 # include <isofs/cd9660/cd9660_mount.h>
958 #endif /* HAVE_ISOFS_CD9660_CD9660_MOUNT_H */
961 * Actions to take if <mount.h> exists.
965 #endif /* HAVE_MOUNT_H */
968 * Actions to take if <nsswitch.h> exists.
970 #ifdef HAVE_NSSWITCH_H
971 # include <nsswitch.h>
972 #endif /* HAVE_NSSWITCH_H */
975 * Actions to take if <rpc/auth_des.h> exists.
977 #ifdef HAVE_RPC_AUTH_DES_H
978 # include <rpc/auth_des.h>
979 #endif /* HAVE_RPC_AUTH_DES_H */
982 * Actions to take if <rpc/pmap_clnt.h> exists.
984 #ifdef HAVE_RPC_PMAP_CLNT_H
985 # include <rpc/pmap_clnt.h>
986 #endif /* HAVE_RPC_PMAP_CLNT_H */
989 * Actions to take if <rpc/pmap_prot.h> exists.
991 #ifdef HAVE_RPC_PMAP_PROT_H
992 # include <rpc/pmap_prot.h>
993 #endif /* HAVE_RPC_PMAP_PROT_H */
997 * Actions to take if <rpcsvc/mount.h> exists.
998 * AIX does not protect against this file doubly included,
999 * so I have to do my own protection here.
1001 #ifdef HAVE_RPCSVC_MOUNT_H
1002 # ifndef _RPCSVC_MOUNT_H
1003 # include <rpcsvc/mount.h>
1004 # endif /* not _RPCSVC_MOUNT_H */
1005 #endif /* HAVE_RPCSVC_MOUNT_H */
1008 * Actions to take if <rpcsvc/nis.h> exists.
1010 #ifdef HAVE_RPCSVC_NIS_H
1012 * Solaris 10 (build 72) defines GROUP_OBJ in <sys/acl.h>, which is included
1013 * in many other header files. <rpcsvc/nis.h> uses GROUP_OBJ inside enum
1014 * zotypes. So if you're unlucky enough to include both headers, you get a
1015 * compile error because the two symbols conflict.
1016 * A similar conflict arises with Sun cc and the definition of "GROUP".
1018 * Temp hack: undefine acl.h's GROUP_OBJ and GROUP because they're not needed
1023 # endif /* GROUP_OBJ */
1027 # include <rpcsvc/nis.h>
1028 #endif /* HAVE_RPCSVC_NIS_H */
1031 * Actions to take if <setjmp.h> exists.
1033 #ifdef HAVE_SETJMP_H
1034 # include <setjmp.h>
1035 #endif /* HAVE_SETJMP_H */
1038 * Actions to take if <signal.h> exists.
1040 #ifdef HAVE_SIGNAL_H
1041 # include <signal.h>
1042 #endif /* HAVE_SIGNAL_H */
1045 * Actions to take if <string.h> exists.
1047 #ifdef HAVE_STRING_H
1048 # include <string.h>
1049 #endif /* HAVE_STRING_H */
1052 * Actions to take if <strings.h> exists.
1054 #ifdef HAVE_STRINGS_H
1055 # include <strings.h>
1056 #endif /* HAVE_STRINGS_H */
1059 * Actions to take if <sys/config.h> exists.
1061 #ifdef HAVE_SYS_CONFIG_H
1062 # include <sys/config.h>
1063 #endif /* HAVE_SYS_CONFIG_H */
1066 * Actions to take if <sys/dg_mount.h> exists.
1068 #ifdef HAVE_SYS_DG_MOUNT_H
1069 # include <sys/dg_mount.h>
1070 #endif /* HAVE_SYS_DG_MOUNT_H */
1073 * Actions to take if <sys/fs_types.h> exists.
1075 #ifdef HAVE_SYS_FS_TYPES_H
1077 * Define KERNEL here to avoid multiple definitions of gt_names[] on
1081 # include <sys/fs_types.h>
1083 #endif /* HAVE_SYS_FS_TYPES_H */
1086 * Actions to take if <sys/fstyp.h> exists.
1088 #ifdef HAVE_SYS_FSTYP_H
1089 # include <sys/fstyp.h>
1090 #endif /* HAVE_SYS_FSTYP_H */
1093 * Actions to take if <sys/lock.h> exists.
1095 #ifdef HAVE_SYS_LOCK_H
1096 # include <sys/lock.h>
1097 #endif /* HAVE_SYS_LOCK_H */
1100 * Actions to take if <sys/machine.h> exists.
1102 #ifdef HAVE_SYS_MACHINE_H
1103 # include <sys/machine.h>
1104 #endif /* HAVE_SYS_MACHINE_H */
1107 * Actions to take if <sys/mntctl.h> exists.
1109 #ifdef HAVE_SYS_MNTCTL_H
1110 # include <sys/mntctl.h>
1111 #endif /* HAVE_SYS_MNTCTL_H */
1114 * Actions to take if <sys/mnttab.h> exists.
1116 #ifdef HAVE_SYS_MNTTAB_H
1117 # include <sys/mnttab.h>
1118 #endif /* HAVE_SYS_MNTTAB_H */
1121 * Actions to take if <mnttab.h> exists.
1122 * Do not include it if MNTTAB is already defined because it probably
1123 * came from <sys/mnttab.h> and we do not want conflicting definitions.
1125 #if defined(HAVE_MNTTAB_H) && !defined(MNTTAB)
1126 # include <mnttab.h>
1127 #endif /* defined(HAVE_MNTTAB_H) && !defined(MNTTAB) */
1130 * Actions to take if <netconfig.h> exists.
1132 #ifdef HAVE_NETCONFIG_H
1133 # include <netconfig.h>
1134 /* Some systems (Solaris 2.5.1) don't declare this external */
1135 extern char *nc_sperror(void);
1136 #endif /* HAVE_NETCONFIG_H */
1139 * Actions to take if <sys/netconfig.h> exists.
1141 #ifdef HAVE_SYS_NETCONFIG_H
1142 # include <sys/netconfig.h>
1143 #endif /* HAVE_SYS_NETCONFIG_H */
1146 * Actions to take if <sys/pathconf.h> exists.
1148 #ifdef HAVE_SYS_PATHCONF_H
1149 # include <sys/pathconf.h>
1150 #endif /* HAVE_SYS_PATHCONF_H */
1153 * Actions to take if <sys/resource.h> exists.
1155 #ifdef HAVE_SYS_RESOURCE_H
1156 # include <sys/resource.h>
1157 #endif /* HAVE_SYS_RESOURCE_H */
1160 * Actions to take if <sys/sema.h> exists.
1162 #ifdef HAVE_SYS_SEMA_H
1163 # include <sys/sema.h>
1164 #endif /* HAVE_SYS_SEMA_H */
1167 * Actions to take if <sys/signal.h> exists.
1169 #ifdef HAVE_SYS_SIGNAL_H
1170 # include <sys/signal.h>
1171 #endif /* HAVE_SYS_SIGNAL_H */
1174 * Actions to take if <sys/sockio.h> exists.
1176 #ifdef HAVE_SYS_SOCKIO_H
1177 # include <sys/sockio.h>
1178 #endif /* HAVE_SYS_SOCKIO_H */
1181 * Actions to take if <sys/syscall.h> exists.
1183 #ifdef HAVE_SYS_SYSCALL_H
1184 # include <sys/syscall.h>
1185 #endif /* HAVE_SYS_SYSCALL_H */
1188 * Actions to take if <sys/syslimits.h> exists.
1190 #ifdef HAVE_SYS_SYSLIMITS_H
1191 # include <sys/syslimits.h>
1192 #endif /* HAVE_SYS_SYSLIMITS_H */
1195 * Actions to take if <tiuser.h> exists.
1197 #ifdef HAVE_TIUSER_H
1199 * Some systems like AIX have multiple definitions for T_NULL and others
1200 * that are defined first in <arpa/nameser.h>.
1202 # ifdef HAVE_ARPA_NAMESER_H
1205 # endif /* T_NULL */
1208 # endif /* T_UNSPEC */
1211 # endif /* T_IDLE */
1212 # endif /* HAVE_ARPA_NAMESER_H */
1213 # include <tiuser.h>
1214 #endif /* HAVE_TIUSER_H */
1217 * Actions to take if <sys/tiuser.h> exists.
1219 #ifdef HAVE_SYS_TIUSER_H
1220 # include <sys/tiuser.h>
1221 #endif /* HAVE_SYS_TIUSER_H */
1224 * Actions to take if <sys/statfs.h> exists.
1226 #ifdef HAVE_SYS_STATFS_H
1227 # include <sys/statfs.h>
1228 #endif /* HAVE_SYS_STATFS_H */
1231 * Actions to take if <sys/statvfs.h> exists.
1233 #ifdef HAVE_SYS_STATVFS_H
1234 # include <sys/statvfs.h>
1235 #endif /* HAVE_SYS_STATVFS_H */
1238 * Actions to take if <sys/vfs.h> exists.
1240 #ifdef HAVE_SYS_VFS_H
1241 # include <sys/vfs.h>
1242 #endif /* HAVE_SYS_VFS_H */
1245 * Actions to take if <sys/vmount.h> exists.
1247 #ifdef HAVE_SYS_VMOUNT_H
1248 # include <sys/vmount.h>
1249 #endif /* HAVE_SYS_VMOUNT_H */
1252 * Actions to take if <ufs/ufs_mount.h> exists.
1254 #ifdef HAVE_UFS_UFS_MOUNT_H
1255 # include <ufs/ufs_mount.h>
1256 #endif /* HAVE_UFS_UFS_MOUNT_H */
1259 * Are S_ISDIR, S_ISREG, et al broken? If not, include <sys/stat.h>.
1260 * Turned off the not using sys/stat.h based on if the macros are
1261 * "broken", because they incorrectly get reported as broken on
1264 #ifndef STAT_MACROS_BROKEN_notused
1266 * RedHat Linux 4.2 (alpha) has a problem in the headers that causes
1267 * duplicate definitions, and also some other nasty bugs. Upgrade to Redhat
1270 # ifdef HAVE_SYS_STAT_H
1271 /* avoid duplicates or conflicts with <linux/stat.h> (RedHat alpha linux) */
1272 # if defined(S_IFREG) && defined(HAVE_STATBUF_H)
1273 # include <statbuf.h>
1304 # endif /* defined(S_IFREG) && defined(HAVE_STATBUF_H) */
1305 # include <sys/stat.h>
1306 # endif /* HAVE_SYS_STAT_H */
1307 #endif /* not STAT_MACROS_BROKEN_notused */
1310 * Actions to take if <stdio.h> exists.
1314 #endif /* HAVE_STDIO_H */
1317 * Actions to take if <stdlib.h> exists.
1319 #ifdef HAVE_STDLIB_H
1320 # include <stdlib.h>
1321 #endif /* HAVE_STDLIB_H */
1324 * Actions to take if <regex.h> exists.
1328 #endif /* HAVE_REGEX_H */
1331 * Actions to take if <tcpd.h> exists.
1333 #if defined(HAVE_TCPD_H) && defined(HAVE_LIBWRAP)
1335 #endif /* defined(HAVE_TCPD_H) && defined(HAVE_LIBWRAP) */
1338 /****************************************************************************/
1340 * Specific macros we're looking for.
1344 # define memset(ptr, val, len) bzero((ptr), (len))
1345 # else /* not HAVE_BZERO */
1346 # error Cannot find either memset or bzero!
1347 # endif /* not HAVE_BZERO */
1348 #endif /* not HAVE_MEMSET */
1350 #ifndef HAVE_MEMMOVE
1352 # define memmove(to, from, len) bcopy((from), (to), (len))
1353 # else /* not HAVE_BCOPY */
1354 # error Cannot find either memmove or bcopy!
1355 # endif /* not HAVE_BCOPY */
1356 #endif /* not HAVE_MEMMOVE */
1359 * memcmp() is more problematic:
1360 * Systems that don't have it, but have bcmp(), will use bcmp() instead.
1361 * Those that have it, but it is bad (SunOS 4 doesn't handle
1362 * 8 bit comparisons correctly), will get to use am_memcmp().
1363 * Otherwise if you have memcmp() and it is good, use it.
1366 # ifdef HAVE_BAD_MEMCMP
1367 # define memcmp am_memcmp
1368 extern int am_memcmp(const voidp s1, const voidp s2, size_t len);
1369 # endif /* HAVE_BAD_MEMCMP */
1370 #else /* not HAVE_MEMCMP */
1372 # define memcmp(a, b, len) bcmp((a), (b), (len))
1373 # endif /* HAVE_BCMP */
1374 #endif /* not HAVE_MEMCMP */
1376 #ifndef HAVE_SETEUID
1377 # ifdef HAVE_SETRESUID
1378 # define seteuid(x) setresuid(-1,(x),-1)
1379 # else /* not HAVE_SETRESUID */
1380 # error Cannot find either seteuid or setresuid!
1381 # endif /* not HAVE_SETRESUID */
1382 #endif /* not HAVE_SETEUID */
1385 * Define type of mntent_t.
1386 * Defaults to struct mntent, else struct mnttab. If neither is found, and
1387 * the operating system does keep not mount tables in the kernel, then flag
1388 * it as an error. If neither is found and the OS keeps mount tables in the
1389 * kernel, then define our own version of mntent; it will be needed for amd
1390 * to keep its own internal version of the mount tables.
1392 #ifdef HAVE_STRUCT_MNTENT
1393 typedef struct mntent mntent_t;
1394 #else /* not HAVE_STRUCT_MNTENT */
1395 # ifdef HAVE_STRUCT_MNTTAB
1396 typedef struct mnttab mntent_t;
1397 /* map struct mnttab field names to struct mntent field names */
1398 # define mnt_fsname mnt_special
1399 # define mnt_dir mnt_mountp
1400 # define mnt_opts mnt_mntopts
1401 # define mnt_type mnt_fstype
1402 # else /* not HAVE_STRUCT_MNTTAB */
1403 # ifdef MOUNT_TABLE_ON_FILE
1404 # error Could not find definition for struct mntent or struct mnttab!
1405 # else /* not MOUNT_TABLE_ON_FILE */
1406 typedef struct _am_mntent {
1407 char *mnt_fsname; /* name of mounted file system */
1408 char *mnt_dir; /* file system path prefix */
1409 char *mnt_type; /* MNTTAB_TYPE_* */
1410 char *mnt_opts; /* MNTTAB_OPT_* */
1411 int mnt_freq; /* dump frequency, in days */
1412 int mnt_passno; /* pass number on parallel fsck */
1414 # endif /* not MOUNT_TABLE_ON_FILE */
1415 # endif /* not HAVE_STRUCT_MNTTAB */
1416 #endif /* not HAVE_STRUCT_MNTENT */
1419 * Provide FD_* macros for systems that lack them.
1422 # define FD_SET(fd, set) (*(set) |= (1 << (fd)))
1423 # define FD_ISSET(fd, set) (*(set) & (1 << (fd)))
1424 # define FD_CLR(fd, set) (*(set) &= ~(1 << (fd)))
1425 # define FD_ZERO(set) (*(set) = 0)
1426 #endif /* not FD_SET */
1430 * Complete external definitions missing from some systems.
1433 #ifndef HAVE_EXTERN_SYS_ERRLIST
1434 extern const char *const sys_errlist[];
1435 #endif /* not HAVE_EXTERN_SYS_ERRLIST */
1437 #ifndef HAVE_EXTERN_OPTARG
1438 extern char *optarg;
1440 #endif /* not HAVE_EXTERN_OPTARG */
1442 #if defined(HAVE_CLNT_SPCREATEERROR) && !defined(HAVE_EXTERN_CLNT_SPCREATEERROR)
1443 extern char *clnt_spcreateerror(const char *s);
1444 #endif /* defined(HAVE_CLNT_SPCREATEERROR) && !defined(HAVE_EXTERN_CLNT_SPCREATEERROR) */
1446 #if defined(HAVE_CLNT_SPERRNO) && !defined(HAVE_EXTERN_CLNT_SPERRNO)
1447 extern char *clnt_sperrno(const enum clnt_stat num);
1448 #endif /* defined(HAVE_CLNT_SPERRNO) && !defined(HAVE_EXTERN_CLNT_SPERRNO) */
1450 #ifndef HAVE_EXTERN_FREE
1451 extern void free(voidp);
1452 #endif /* not HAVE_EXTERN_FREE */
1454 #if defined(HAVE_GET_MYADDRESS) && !defined(HAVE_EXTERN_GET_MYADDRESS)
1455 extern void get_myaddress(struct sockaddr_in *addr);
1456 #endif /* defined(HAVE_GET_MYADDRESS) && !defined(HAVE_EXTERN_GET_MYADDRESS) */
1458 #if defined(HAVE_GETDOMAINNAME) && !defined(HAVE_EXTERN_GETDOMAINNAME)
1459 # if defined(HAVE_MAP_NIS) || defined(HAVE_MAP_NISPLUS)
1460 extern int getdomainname(char *name, int namelen);
1461 # endif /* defined(HAVE_MAP_NIS) || defined(HAVE_MAP_NISPLUS) */
1462 #endif /* defined(HAVE_GETDOMAINNAME) && !defined(HAVE_EXTERN_GETDOMAINNAME) */
1464 #if defined(HAVE_GETDTABLESIZE) && !defined(HAVE_EXTERN_GETDTABLESIZE)
1465 extern int getdtablesize(void);
1466 #endif /* defined(HAVE_GETDTABLESIZE) && !defined(HAVE_EXTERN_GETDTABLESIZE) */
1468 #if defined(HAVE_GETHOSTNAME) && !defined(HAVE_EXTERN_GETHOSTNAME)
1469 extern int gethostname(char *name, int namelen);
1470 #endif /* defined(HAVE_GETHOSTNAME) && !defined(HAVE_EXTERN_GETHOSTNAME) */
1472 #ifndef HAVE_EXTERN_GETLOGIN
1473 extern char *getlogin(void);
1474 #endif /* not HAVE_EXTERN_GETLOGIN */
1476 #if defined(HAVE_GETPAGESIZE) && !defined(HAVE_EXTERN_GETPAGESIZE)
1477 extern int getpagesize(void);
1478 #endif /* defined(HAVE_GETPAGESIZE) && !defined(HAVE_EXTERN_GETPAGESIZE) */
1480 #ifndef HAVE_EXTERN_GETWD
1481 extern char *getwd(char *s);
1482 #endif /* not HAVE_EXTERN_GETWD */
1484 #if defined(HAVE_TCPD_H) && defined(HAVE_LIBWRAP) && !defined(HAVE_EXTERN_HOSTS_CTL)
1485 extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, char *client_user);
1486 #endif /* defined(HAVE_TCPD_H) && defined(HAVE_LIBWRAP) && !defined(HAVE_EXTERN_HOSTS_CTL) */
1488 #ifndef HAVE_EXTERN_INNETGR
1489 extern int innetgr(char *, char *, char *, char *);
1490 #endif /* not HAVE_EXTERN_INNETGR */
1492 #if defined(HAVE_MKSTEMP) && !defined(HAVE_EXTERN_MKSTEMP)
1493 extern int mkstemp(char *);
1494 #endif /* defined(HAVE_MKSTEMP) && !defined(HAVE_EXTERN_MKSTEMP) */
1496 #ifndef HAVE_EXTERN_SBRK
1497 extern caddr_t sbrk(int incr);
1498 #endif /* not HAVE_EXTERN_SBRK */
1500 #if defined(HAVE_SETEUID) && !defined(HAVE_EXTERN_SETEUID)
1501 extern int seteuid(uid_t euid);
1502 #endif /* not defined(HAVE_SETEUID) && !defined(HAVE_EXTERN_SETEUID) */
1504 #if defined(HAVE_SETITIMER) && !defined(HAVE_EXTERN_SETITIMER)
1505 extern int setitimer(int, struct itimerval *, struct itimerval *);
1506 #endif /* defined(HAVE_SETITIMER) && !defined(HAVE_EXTERN_SETITIMER) */
1508 #ifndef HAVE_EXTERN_SLEEP
1509 extern unsigned int sleep(unsigned int seconds);
1510 #endif /* not HAVE_EXTERN_SETITIMER */
1512 #ifndef HAVE_EXTERN_STRCASECMP
1514 * define this extern even if function does not exist, for it will
1515 * be filled in by libamu/strcasecmp.c
1517 extern int strcasecmp(const char *s1, const char *s2);
1518 #endif /* not HAVE_EXTERN_STRCASECMP */
1520 #ifndef HAVE_EXTERN_STRDUP
1522 * define this extern even if function does not exist, for it will
1523 * be filled in by libamu/strdup.c
1525 extern char *strdup(const char *s);
1526 #endif /* not HAVE_EXTERN_STRDUP */
1528 #ifndef HAVE_EXTERN_STRLCAT
1530 * define this extern even if function does not exist, for it will
1531 * be filled in by libamu/strlcat.c
1533 extern size_t strlcat(char *dst, const char *src, size_t siz);
1534 #endif /* not HAVE_EXTERN_STRLCAT */
1536 #ifndef HAVE_EXTERN_STRLCPY
1538 * define this extern even if function does not exist, for it will
1539 * be filled in by libamu/strlcpy.c
1541 extern size_t strlcpy(char *dst, const char *src, size_t siz);
1542 #endif /* not HAVE_EXTERN_STRLCPY */
1544 #if defined(HAVE_STRSTR) && !defined(HAVE_EXTERN_STRSTR)
1545 extern char *strstr(const char *s1, const char *s2);
1546 #endif /* defined(HAVE_STRSTR) && !defined(HAVE_EXTERN_STRSTR) */
1548 #if defined(HAVE_USLEEP) && !defined(HAVE_EXTERN_USLEEP)
1549 extern int usleep(u_int useconds);
1550 #endif /* defined(HAVE_USLEEP) && !defined(HAVE_EXTERN_USLEEP) */
1552 #ifndef HAVE_EXTERN_UALARM
1553 extern u_int ualarm(u_int usecs, u_int interval);
1554 #endif /* not HAVE_EXTERN_UALARM */
1556 #if defined(HAVE_WAIT3) && !defined(HAVE_EXTERN_WAIT3)
1557 extern int wait3(int *statusp, int options, struct rusage *rusage);
1558 #endif /* defined(HAVE_WAIT3) && !defined(HAVE_EXTERN_WAIT3) */
1560 #if defined(HAVE_VSNPRINTF) && !defined(HAVE_EXTERN_VSNPRINTF)
1561 extern int vsnprintf(char *, int, const char *, ...);
1562 #endif /* defined(HAVE_VSNPRINTF) && !defined(HAVE_EXTERN_VSNPRINTF) */
1564 #ifndef HAVE_EXTERN_XDR_CALLMSG
1565 extern bool_t xdr_callmsg(XDR *xdrs, struct rpc_msg *msg);
1566 #endif /* not HAVE_EXTERN_XDR_CALLMSG */
1568 #ifndef HAVE_EXTERN_XDR_OPAQUE_AUTH
1569 extern bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *auth);
1570 #endif /* not HAVE_EXTERN_XDR_OPAQUE_AUTH */
1572 /****************************************************************************/
1574 * amd-specific header files.
1576 #ifdef THIS_HEADER_FILE_IS_INCLUDED_ABOVE
1577 # include <amu_nfs_prot.h>
1578 #endif /* THIS_HEADER_FILE_IS_INCLUDED_ABOVE */
1579 #include <am_compat.h>
1580 #include <am_xdr_func.h>
1581 #include <am_utils.h>
1582 #include <amq_defs.h>
1583 #include <aux_conf.h>
1586 /****************************************************************************/
1588 * External definitions that depend on other macros available (or not)
1589 * and those are probably declared in any of the above headers.
1592 #ifdef HAVE_HASMNTOPT
1593 # ifdef HAVE_BAD_HASMNTOPT
1594 extern char *amu_hasmntopt(mntent_t *mnt, char *opt);
1595 # else /* not HAVE_BAD_HASMNTOPT */
1596 # define amu_hasmntopt hasmntopt
1597 # endif /* not HAVE_BAD_HASMNTOPT */
1598 #else /* not HAVE_HASMNTOPT */
1599 extern char *amu_hasmntopt(mntent_t *mnt, char *opt);
1600 #endif /* not HAVE_HASMNTOPT */
1602 #endif /* not _AM_DEFS_H */