Fixed typos
[ACE_TAO.git] / ACE / ace / OS_NS_sys_stat.h
blobcf6e99f36993ec55174dca3446152c1703448980
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file OS_NS_sys_stat.h
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
8 * @author Jesper S. M|ller<stophph@diku.dk>
9 * @author and a cast of thousands...
11 * Originally in OS.h.
13 //=============================================================================
15 #ifndef ACE_OS_NS_SYS_STAT_H
16 # define ACE_OS_NS_SYS_STAT_H
18 # include /**/ "ace/pre.h"
20 # include "ace/config-all.h"
22 # if !defined (ACE_LACKS_PRAGMA_ONCE)
23 # pragma once
24 # endif /* ACE_LACKS_PRAGMA_ONCE */
26 #include "ace/os_include/sys/os_stat.h"
27 #include "ace/Default_Constants.h" // for ACE_DEFAULT_DIR_PERMS
28 #include /**/ "ace/ACE_export.h"
30 #if defined (ACE_EXPORT_MACRO)
31 # undef ACE_EXPORT_MACRO
32 #endif
33 #define ACE_EXPORT_MACRO ACE_Export
35 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
37 # if defined (_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64 \
38 && defined (ACE_WIN32)
39 # if defined (__BORLANDC__)
40 typedef struct stati64 ACE_stat;
41 # define ACE_STAT_FUNC_NAME ::_stati64
42 # define ACE_WSTAT_FUNC_NAME ::_wstati64
43 # elif !defined (ACE_HAS_WINCE) && defined (_MSC_VER)
44 # if _MSC_VER >= 1400
45 // For vc8 which has time_t as 64bit
46 // 64-bit file offsets, 64-bit time_t
47 # if defined (ACE_MSVC_USES_DOUBLE_UNDERSCORE_STAT64)
48 typedef struct __stat64 ACE_stat;
49 # else
50 typedef struct _stat64 ACE_stat;
51 # endif
52 # define ACE_STAT_FUNC_NAME ::_stat64
53 # define ACE_WSTAT_FUNC_NAME ::_wstat64
54 # else
55 // For vc71 which has time_t as 32bit
56 typedef struct _stati64 ACE_stat;
57 # define ACE_STAT_FUNC_NAME ::_stati64
58 # define ACE_WSTAT_FUNC_NAME ::_wstati64
59 # endif /* _MSC_VER >= 1400 */
60 # elif defined (__MINGW32__)
61 typedef struct _stati64 ACE_stat;
62 # define ACE_STAT_FUNC_NAME ::_stati64
63 # define ACE_WSTAT_FUNC_NAME ::_wstati64
64 # else
65 typedef struct stat ACE_stat;
66 # define ACE_STAT_FUNC_NAME ::stat
67 # define ACE_WSTAT_FUNC_NAME ACE_STAT_FUNC_NAME
68 # endif /**/
69 # else
70 // Default file offset case.
71 # if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)
72 typedef struct _stat ACE_stat;
73 # define ACE_STAT_FUNC_NAME ::_stat
74 # define ACE_WSTAT_FUNC_NAME ::_wstat
75 # else
76 typedef struct stat ACE_stat;
77 # define ACE_STAT_FUNC_NAME ::stat
78 # define ACE_WSTAT_FUNC_NAME ACE_STAT_FUNC_NAME
79 # endif /* ACE_WIN32 */
80 # endif /* _FILE_OFFSET_BITS == 64 && ACE_WIN32 */
82 namespace ACE_OS
85 ACE_NAMESPACE_INLINE_FUNCTION
86 ACE_HANDLE creat (const ACE_TCHAR *filename,
87 mode_t mode);
89 //@{ @name A set of wrappers for low-level file operations.
91 // non-standard
92 ACE_NAMESPACE_INLINE_FUNCTION
93 ACE_OFF_T filesize (ACE_HANDLE handle);
95 ACE_NAMESPACE_INLINE_FUNCTION
96 ACE_OFF_T filesize (const ACE_TCHAR *handle);
97 //@}
99 ACE_NAMESPACE_INLINE_FUNCTION
100 int fstat (ACE_HANDLE,
101 ACE_stat *);
103 ACE_NAMESPACE_INLINE_FUNCTION
104 int lstat (const char *,
105 ACE_stat *);
107 #if defined (ACE_HAS_WCHAR)
108 ACE_NAMESPACE_INLINE_FUNCTION
109 int lstat (const wchar_t *,
110 ACE_stat *);
111 #endif /* ACE_HAS_WCHAR */
113 ACE_NAMESPACE_INLINE_FUNCTION
114 int mkdir (const char *path,
115 mode_t mode = ACE_DEFAULT_DIR_PERMS);
117 #if defined (ACE_HAS_WCHAR)
118 ACE_NAMESPACE_INLINE_FUNCTION
119 int mkdir (const wchar_t *path,
120 mode_t mode = ACE_DEFAULT_DIR_PERMS);
121 #endif /* ACE_HAS_WCHAR */
123 ACE_NAMESPACE_INLINE_FUNCTION
124 int mkfifo (const ACE_TCHAR *file,
125 mode_t mode = ACE_DEFAULT_FILE_PERMS);
127 ACE_NAMESPACE_INLINE_FUNCTION
128 int stat (const char *file, ACE_stat *);
130 #if defined (ACE_HAS_WCHAR)
131 ACE_NAMESPACE_INLINE_FUNCTION
132 int stat (const wchar_t *file, ACE_stat *);
133 #endif /* ACE_HAS_WCHAR */
135 ACE_NAMESPACE_INLINE_FUNCTION
136 mode_t umask (mode_t cmask);
138 } /* namespace ACE_OS */
140 ACE_END_VERSIONED_NAMESPACE_DECL
142 # if defined (ACE_HAS_INLINED_OSCALLS)
143 # if defined (ACE_INLINE)
144 # undef ACE_INLINE
145 # endif /* ACE_INLINE */
146 # define ACE_INLINE inline
147 # include "ace/OS_NS_sys_stat.inl"
148 # endif /* ACE_HAS_INLINED_OSCALLS */
150 # include /**/ "ace/post.h"
151 #endif /* ACE_OS_NS_SYS_STAT_H */