Logo ROOT   6.07/09
Reference Guide
XrdProofdPlatform.h
Go to the documentation of this file.
1 // @(#)root/proofd:$Id$
2 // Author: G. Ganis June 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_XrdProofdPlatform
13 #define ROOT_XrdProofdPlatform
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // XrdProofdPlatform //
18 // //
19 // Authors: G. Ganis, CERN, 2007 //
20 // //
21 // System settings used in XrdProofd classes, possibly platform //
22 // dependent //
23 // //
24 //////////////////////////////////////////////////////////////////////////
25 
26 #ifndef ROOT_RConfig
27 #include "RConfig.h"
28 #endif
29 
30 // 32 or 64 bits
31 #if ((defined(__hpux) && defined(__LP64__)) || \
32  (defined(linux) && (defined(__ia64__) || defined(__x86_64__))) || \
33  (defined(linux) && defined(__powerpc__) && defined(R__ppc64)) || \
34  (defined(__APPLE__) && (defined(__ppc64__) || defined(__x86_64__))))
35 # define XPD__B64
36 #endif
37 
38 #ifdef __APPLE__
39 # ifndef __macos__
40 # define __macos__
41 # endif
42 #endif
43 #ifdef __sun
44 # ifndef __solaris__
45 # define __solaris__
46 # endif
47 #endif
48 
49 #include <errno.h>
50 #include <stdio.h>
51 #include <stdlib.h>
52 #include <string.h>
53 #include <unistd.h>
54 #include <sys/types.h>
55 #ifndef ROOT_XrdFour
56 # include <sys/socket.h>
57 # include <netinet/in.h>
58 #endif
59 #include <sys/stat.h>
60 #include <sys/un.h>
61 #include <pwd.h>
62 #include <sys/resource.h>
63 #include <sys/file.h>
64 #include <dirent.h>
65 #include <libgen.h>
66 
67 // Bypass Solaris ELF madness
68 //
69 #if (defined(SUNCC) || defined(__sun))
70 #include <sys/isa_defs.h>
71 #if defined(_ILP32) && (_FILE_OFFSET_BITS != 32)
72 #undef _FILE_OFFSET_BITS
73 #define _FILE_OFFSET_BITS 32
74 #undef _LARGEFILE_SOURCE
75 #endif
76 #endif
77 
78 // System info on Solaris
79 #if (defined(SUNCC) || defined(__sun)) && !defined(__KCC)
80 # define XPD__SUNCC
81 # include <sys/systeminfo.h>
82 # include <sys/filio.h>
83 # include <sys/sockio.h>
84 # include <fcntl.h>
85 # define HASNOT_INETATON
86 # ifndef INADDR_NONE
87 # define INADDR_NONE (UInt_t)-1
88 # endif
89 #endif
90 
91 #include <dlfcn.h>
92 #if !defined(__APPLE__)
93 #include <link.h>
94 #endif
95 
96 #if defined(linux) || defined(__sun) || defined(__sgi) || \
97  defined(_AIX) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
98  defined(__APPLE__) || defined(__MACH__) || defined(cygwingcc)
99 #include <grp.h>
100 #endif
101 
102 // For process info
103 #if defined(__sun)
104 #include <procfs.h>
105 #elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
106 #include <sys/sysctl.h>
107 #endif
108 
109 // Poll
110 #include <sys/poll.h>
111 
112 // Name of the env variable used to define the library path
113 #if defined(__hpux) || defined(_HIUX_SOURCE)
114 #define XPD_LIBPATH "SHLIB_PATH"
115 #elif defined(_AIX)
116 #define XPD_LIBPATH "LIBPATH"
117 #elif defined(__APPLE__)
118 #define XPD_LIBPATH "DYLD_LIBRARY_PATH"
119 #else
120 #define XPD_LIBPATH "LD_LIBRARY_PATH"
121 #endif
122 
123 // Time related
124 #include <sys/time.h>
125 #include <utime.h>
126 
127 // Macros to check ranges
128 #ifdef XPD__B64
129 # define XPD_LONGOK(x) (1)
130 #else
131 # define XPD_LONGOK(x) (x > LONG_MIN && x < LONG_MAX)
132 #endif
133 
134 // Wait related
135 #include <sys/wait.h>
136 
137 #endif