1 /* @(#)libport.h	1.9 03/06/15 Copyright 1995 J. Schilling */
2 /*
3  *	Copyright (c) 1995 J. Schilling
4  */
5 /*
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * this program; see the file COPYING.  If not, write to the Free Software
18  * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  */
20 
21 
22 #ifndef _LIBPORT_H
23 #define	_LIBPORT_H
24 
25 #ifndef	_MCONFIG_H
26 #include <mconfig.h>
27 #endif
28 #ifndef	_PROTOTYP_H
29 #include <prototyp.h>
30 #endif
31 #ifndef _STANDARD_H
32 #include <standard.h>
33 #endif
34 
35 /*
36  * Try to get HOST_NAME_MAX for gethostname()
37  */
38 #ifndef _UNIXSTD_H
39 #include <unixstd.h>
40 #endif
41 
42 #ifndef HOST_NAME_MAX
43 #if	defined(HAVE_NETDB_H) && !defined(HOST_NOT_FOUND) && \
44 				!defined(_INCL_NETDB_H)
45 #include <netdb.h>
46 #define	_INCL_NETDB_H
47 #endif
48 #ifdef	MAXHOSTNAMELEN
49 #define	HOST_NAME_MAX	MAXHOSTNAMELEN
50 #endif
51 #endif
52 
53 #ifndef HOST_NAME_MAX
54 #ifdef	HAVE_SYS_PARAM_H
55 #include <sys/param.h>	/* Include various defs needed with some OS */
56 			/* Linux MAXHOSTNAMELEN */
57 #endif
58 #ifdef	MAXHOSTNAMELEN
59 #define	HOST_NAME_MAX	MAXHOSTNAMELEN
60 #endif
61 #endif
62 
63 #ifndef HOST_NAME_MAX
64 #define	HOST_NAME_MAX	255
65 #endif
66 
67 #ifdef	__cplusplus
68 extern "C" {
69 #endif
70 
71 #ifdef	OPENSERVER
72 /*
73  * Don't use the usleep() from libc on SCO's OPENSERVER.
74  * It will kill our processes with SIGALRM.
75  */
76 /*
77  * Don't #undef HAVE_USLEEP in this file, SCO has a
78  * usleep() prototype in unistd.h
79  */
80 /*#undef	HAVE_USLEEP*/
81 #endif
82 
83 #ifndef	HAVE_GETHOSTID
84 extern	long		gethostid	__PR((void));
85 #endif
86 #ifndef	HAVE_GETHOSTNAME
87 extern	int		gethostname	__PR((char *name, int namelen));
88 #endif
89 #ifndef	HAVE_GETDOMAINNAME
90 extern	int		getdomainname	__PR((char *name, int namelen));
91 #endif
92 #ifndef	HAVE_GETPAGESIZE
93 EXPORT	int		getpagesize	__PR((void));
94 #endif
95 #ifndef	HAVE_USLEEP
96 extern	int		usleep		__PR((int usec));
97 #endif
98 
99 #if	!defined(HAVE_STRDUP) || defined(__SVR4)
100 extern	char		*strdup		__PR((const char *s));
101 #endif
102 
103 #ifndef	HAVE_RENAME
104 extern	int		rename		__PR((const char *old, const char *new));
105 #endif
106 
107 #ifdef	__cplusplus
108 }
109 #endif
110 
111 #endif	/* _LIBPORT_H */
112