summaryrefslogtreecommitdiff
path: root/defines.h
diff options
context:
space:
mode:
Diffstat (limited to 'defines.h')
-rw-r--r--defines.h94
1 files changed, 13 insertions, 81 deletions
diff --git a/defines.h b/defines.h
index d6a6a1470..65a03bd17 100644
--- a/defines.h
+++ b/defines.h
@@ -1,62 +1,7 @@
1#ifndef _DEFINES_H 1#ifndef _DEFINES_H
2#define _DEFINES_H 2#define _DEFINES_H
3 3
4/* $Id: defines.h,v 1.85 2002/04/06 23:52:05 mouring Exp $ */ 4/* $Id: defines.h,v 1.86 2002/04/12 03:35:40 tim Exp $ */
5
6/* Necessary headers */
7
8#include <sys/types.h> /* For [u]intxx_t */
9#include <sys/socket.h> /* For SHUT_XXXX */
10#include <sys/param.h> /* For MAXPATHLEN and roundup() */
11#include <netinet/in_systm.h> /* For typedefs */
12#include <netinet/in.h> /* For IPv6 macros */
13#include <netinet/ip.h> /* For IPTOS macros */
14#ifdef HAVE_RPC_TYPES_H
15# include <rpc/types.h> /* For INADDR_LOOPBACK */
16#endif
17#ifdef HAVE_SYS_UN_H
18# include <sys/un.h> /* For sockaddr_un */
19#endif
20#ifdef HAVE_SYS_BITYPES_H
21# include <sys/bitypes.h> /* For u_intXX_t */
22#endif
23#ifdef HAVE_PATHS_H
24# include <paths.h> /* For _PATH_XXX */
25#endif
26#ifdef HAVE_LIMITS_H
27# include <limits.h> /* For PATH_MAX */
28#endif
29#ifdef HAVE_SYS_TIME_H
30# include <sys/time.h> /* For timersub */
31#endif
32#ifdef HAVE_MAILLOCK_H
33# include <maillock.h> /* For _PATH_MAILDIR */
34#endif
35#ifdef HAVE_SYS_CDEFS_H
36# include <sys/cdefs.h> /* For __P() */
37#endif
38#ifdef HAVE_SYS_SYSMACROS_H
39# include <sys/sysmacros.h> /* For MIN, MAX, etc */
40#endif
41#ifdef HAVE_SYS_STAT_H
42# include <sys/stat.h> /* For S_* constants and macros */
43#endif
44#ifdef HAVE_NEXT
45# include <libc.h>
46#endif
47
48#include <unistd.h> /* For STDIN_FILENO, etc */
49#include <termios.h> /* Struct winsize */
50#include <fcntl.h> /* For O_NONBLOCK */
51#include <openssl/opensslv.h> /* For OPENSSL_VERSION_NUMBER */
52
53/* *-*-nto-qnx needs these headers for strcasecmp and LASTLOG_FILE respectively */
54#ifdef HAVE_STRINGS_H
55# include <strings.h>
56#endif
57#ifdef HAVE_LOGIN_H
58# include <login.h>
59#endif
60 5
61 6
62/* Constants */ 7/* Constants */
@@ -139,6 +84,14 @@ enum
139# define S_IRWXO 0000007 /* read, write, execute */ 84# define S_IRWXO 0000007 /* read, write, execute */
140#endif /* S_IXUSR */ 85#endif /* S_IXUSR */
141 86
87#if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
88#define MAP_ANON MAP_ANONYMOUS
89#endif
90
91#ifndef MAP_FAILED
92# define MAP_FAILED ((void *)-1)
93#endif
94
142/* *-*-nto-qnx doesn't define this constant in the system headers */ 95/* *-*-nto-qnx doesn't define this constant in the system headers */
143#ifdef MISSING_NFDBITS 96#ifdef MISSING_NFDBITS
144# define NFDBITS (8 * sizeof(unsigned long)) 97# define NFDBITS (8 * sizeof(unsigned long))
@@ -440,10 +393,6 @@ struct winsize {
440# define howmany(x,y) (((x)+((y)-1))/(y)) 393# define howmany(x,y) (((x)+((y)-1))/(y))
441#endif 394#endif
442 395
443#ifdef __hpux
444#define MAP_ANON MAP_ANONYMOUS
445#endif
446
447#ifndef ALIGNBYTES 396#ifndef ALIGNBYTES
448#define ALIGNBYTES (sizeof(int) - 1) 397#define ALIGNBYTES (sizeof(int) - 1)
449#endif 398#endif
@@ -466,6 +415,10 @@ struct winsize {
466 415
467/* Function replacement / compatibility hacks */ 416/* Function replacement / compatibility hacks */
468 417
418#ifndef HAVE_GETOPT_OPTRESET
419#define getopt(ac, av, o) BSDgetopt(ac, av, o)
420#endif
421
469/* In older versions of libpam, pam_strerror takes a single argument */ 422/* In older versions of libpam, pam_strerror takes a single argument */
470#ifdef HAVE_OLD_PAM 423#ifdef HAVE_OLD_PAM
471# define PAM_STRERROR(a,b) pam_strerror((b)) 424# define PAM_STRERROR(a,b) pam_strerror((b))
@@ -525,27 +478,6 @@ struct winsize {
525 ** login recorder definitions 478 ** login recorder definitions
526 **/ 479 **/
527 480
528/* preprocess */
529
530#ifdef HAVE_UTMP_H
531# ifdef HAVE_TIME_IN_UTMP
532# include <time.h>
533# endif
534# include <utmp.h>
535#endif
536#ifdef HAVE_UTMPX_H
537# ifdef HAVE_TV_IN_UTMPX
538# include <sys/time.h>
539# endif
540# include <utmpx.h>
541#endif
542#ifdef HAVE_LASTLOG_H
543# include <lastlog.h>
544#endif
545#ifdef HAVE_PATHS_H
546# include <paths.h>
547#endif
548
549/* FIXME: put default paths back in */ 481/* FIXME: put default paths back in */
550#ifndef UTMP_FILE 482#ifndef UTMP_FILE
551# ifdef _PATH_UTMP 483# ifdef _PATH_UTMP