~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to ace/os_include/os_unistd.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// -*- C++ -*-
2
 
 
3
 
//=============================================================================
4
 
/**
5
 
 *  @file    os_unistd.h
6
 
 *
7
 
 *  standard symbolic constants and types
8
 
 *
9
 
 *  os_unistd.h,v 1.5 2003/12/09 15:25:41 elliott_c Exp
10
 
 *
11
 
 *  @author Don Hinton <dhinton@dresystems.com>
12
 
 *  @author This code was originally in various places including ace/OS.h.
13
 
 */
14
 
//=============================================================================
15
 
 
16
 
#ifndef ACE_OS_INCLUDE_OS_UNISTD_H
17
 
#define ACE_OS_INCLUDE_OS_UNISTD_H
18
 
 
19
 
#include /**/ "ace/pre.h"
20
 
 
21
 
#include "ace/config-all.h"
22
 
 
23
 
#if !defined (ACE_LACKS_PRAGMA_ONCE)
24
 
# pragma once
25
 
#endif /* ACE_LACKS_PRAGMA_ONCE */
26
 
 
27
 
#include "ace/os_include/sys/os_types.h"
28
 
#include "ace/os_include/os_inttypes.h"
29
 
 
30
 
#if defined (__BORLANDC__)
31
 
#  include "ace/os_include/os_fcntl.h"
32
 
#endif /* __BORLANDC */
33
 
 
34
 
#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)
35
 
#  include /**/ <process.h>
36
 
#  include /**/ <io.h>
37
 
#endif /* ACE_WIN32 && !ACE_HAS_WINCE */
38
 
 
39
 
#if defined (ACE_HAS_SYSINFO)
40
 
#  include /**/ <sys/systeminfo.h>
41
 
#endif /* ACE_HAS_SYS_INFO */
42
 
 
43
 
#if !defined (ACE_LACKS_UNISTD_H)
44
 
#  include /**/ <unistd.h>
45
 
#endif /* !ACE_LACKS_UNISTD_H */
46
 
 
47
 
#if defined (VXWORKS)
48
 
// for unlink(), close(), read(), write(), lseek(), chdir(), getcwd(), getwd(), 
49
 
// and isatty()
50
 
#  include /**/ <ioLib.h>
51
 
// for gethostname()
52
 
#  include /**/ <hostLib.h>
53
 
#endif /* VXWORKS */
54
 
 
55
 
// Place all additions (especially function declarations) within extern "C" {}
56
 
#ifdef __cplusplus
57
 
extern "C"
58
 
{
59
 
#endif /* __cplusplus */
60
 
 
61
 
#if (!defined (_BSD_SOURCE) && \
62
 
    !defined (_XOPEN_SOURCE) && !defined (_XOPEN_SOURCE_EXTENDED)) \
63
 
    || (defined (_XOPEN_SOURCE) && defined (__GNUC__))
64
 
 
65
 
# if defined (ACE_LACKS_SETREUID_PROTOTYPE)
66
 
  extern int setreuid (uid_t ruid, uid_t euid);
67
 
# endif /* ACE_LACKS_SETREUID_PROTOTYPE */
68
 
 
69
 
# if defined (ACE_LACKS_SETREGID_PROTOTYPE)
70
 
  extern int setregid (gid_t rgid, gid_t egid);
71
 
# endif /* ACE_LACKS_SETREGID_PROTOTYPE */
72
 
#endif  /* !_BSD_SOURCE && !_XOPEN_SOURCE && !_XOPEN_SOURCE_EXTENDED
73
 
           || _XOPEN_SOURCE && __GNUC__ */
74
 
 
75
 
# if !defined (_SC_TIMER_MAX)
76
 
#   define _SC_TIMER_MAX 44
77
 
# endif /* _SC_TIMER_MAX */
78
 
 
79
 
// Default number of <ACE_Event_Handler>s supported by
80
 
// <ACE_Timer_Heap>.
81
 
# if !defined (ACE_DEFAULT_TIMERS)
82
 
#   define ACE_DEFAULT_TIMERS _SC_TIMER_MAX
83
 
# endif /* ACE_DEFAULT_TIMERS */
84
 
 
85
 
  // for use by access()
86
 
# if !defined (R_OK)
87
 
#   define R_OK    04      /* Test for Read permission. */
88
 
# endif /* R_OK */
89
 
 
90
 
# if !defined (W_OK)
91
 
#   define W_OK    02      /* Test for Write permission. */
92
 
# endif /* W_OK */
93
 
 
94
 
# if !defined (X_OK)
95
 
#   define X_OK    01      /* Test for eXecute permission. */
96
 
# endif /* X_OK */
97
 
 
98
 
# if !defined (F_OK)
99
 
#   define F_OK    0       /* Test for existence of File. */
100
 
# endif /* F_OK */
101
 
 
102
 
#if defined (CHORUS)
103
 
  int      getgid          __((void));
104
 
  int      getuid          __((void));
105
 
  char*    getcwd          __((char* buf, size_t size));
106
 
  int      pipe            __((int* fildes));
107
 
  int      gethostname     __((char*, size_t));
108
 
#endif /* CHORUS */
109
 
 
110
 
#if defined (ACE_LACKS_UALARM_PROTOTYPE)
111
 
   u_int ualarm (u_int usecs, u_int interval);
112
 
#endif /* ACE_LACKS_UALARM_PROTOTYPE */
113
 
 
114
 
#if defined (ACE_LACKS_PREAD_PROTOTYPE) && (_XOPEN_SOURCE - 0) < 500
115
 
   // _XOPEN_SOURCE == 500    Single Unix conformance
116
 
   // It seems that _XOPEN_SOURCE == 500 means that the prototypes are
117
 
   // already defined in the system headers.
118
 
   ssize_t pread (int fd,
119
 
                             void *buf,
120
 
                             size_t nbytes,
121
 
                             off_t offset);
122
 
 
123
 
   ssize_t pwrite (int fd,
124
 
                              const void *buf,
125
 
                              size_t n,
126
 
                              off_t offset);
127
 
#endif  /* ACE_LACKS_PREAD_PROTOTYPE && (_XOPEN_SOURCE - 0) < 500 */
128
 
 
129
 
#if defined (ACE_LACKS_GETPGID_PROTOTYPE) && \
130
 
    !defined (_XOPEN_SOURCE) && !defined (_XOPEN_SOURCE_EXTENDED)
131
 
   pid_t getpgid (pid_t pid);
132
 
#endif  /* ACE_LACKS_GETPGID_PROTOTYPE &&
133
 
           !_XOPEN_SOURCE && !_XOPEN_SOURCE_EXTENDED */
134
 
 
135
 
#if !defined (_LARGEFILE64_SOURCE)
136
 
#  if defined (ACE_LACKS_LSEEK64_PROTOTYPE) && \
137
 
      defined (ACE_LACKS_LLSEEK_PROTOTYPE)
138
 
#    error Define either ACE_LACKS_LSEEK64_PROTOTYPE or ACE_LACKS_LLSEEK_PROTOTYPE, not both!
139
 
#  elif defined (ACE_LACKS_LSEEK64_PROTOTYPE)
140
 
     ACE_LOFF_T lseek64 (int fd, ACE_LOFF_T offset, int whence);
141
 
#  elif defined (ACE_LACKS_LLSEEK_PROTOTYPE)
142
 
     ACE_LOFF_T llseek (int fd, ACE_LOFF_T offset, int whence);
143
 
#  endif
144
 
#endif  /* _LARGEFILE64_SOURCE */
145
 
 
146
 
#if !defined (_SC_AIO_MAX)
147
 
#  define _SC_AIO_MAX 1
148
 
#endif /* _SC_AIO_MAX */
149
 
 
150
 
#if defined (__BORLANDC__)
151
 
#  define _chdir chdir
152
 
#  undef _access
153
 
#  define _access access
154
 
#  if (__BORLANDC__ <= 0x540)
155
 
#    define _getcwd getcwd
156
 
#  endif
157
 
#  define _isatty isatty
158
 
#endif /* __BORLANDC__ */
159
 
 
160
 
#if defined (ACE_PSOS_SNARFS_HEADER_INFO)
161
 
   // Header information snarfed from compiler provided header files
162
 
   // that are not included because there is already an identically
163
 
   // named file provided with pSOS, which does not have this info
164
 
   // from compiler supplied header
165
 
   int getopt(int, char *const *, const char *);
166
 
   int isatty (int h);
167
 
#endif /* ACE_PSOS_SNARFS_HEADER_INFO */
168
 
 
169
 
# if defined (ACE_LACKS_TIMEDWAIT_PROTOTYPES)
170
 
 
171
 
  ssize_t read_timedwait (ACE_HANDLE handle,
172
 
                          char *buf,
173
 
                          size_t n,
174
 
                          struct timespec *timeout);
175
 
 
176
 
  ssize_t write_timedwait (ACE_HANDLE handle,
177
 
                           const void *buf,
178
 
                           size_t n,
179
 
                           struct timespec *timeout);
180
 
 
181
 
# endif /* ACE_LACKS_TIMEDWAIT_PROTOTYPES */
182
 
 
183
 
#ifdef __cplusplus
184
 
}
185
 
#endif /* __cplusplus */
186
 
 
187
 
#include /**/ "ace/post.h"
188
 
#endif /* ACE_OS_INCLUDE_OS_UNISTD_H */