00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file OS_NS_sys_stat.h 00006 * 00007 * $Id: OS_NS_sys_stat.h 80826 2008-03-04 14:51:23Z wotte $ 00008 * 00009 * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> 00010 * @author Jesper S. M|ller<stophph@diku.dk> 00011 * @author and a cast of thousands... 00012 * 00013 * Originally in OS.h. 00014 */ 00015 //============================================================================= 00016 00017 #ifndef ACE_OS_NS_SYS_STAT_H 00018 # define ACE_OS_NS_SYS_STAT_H 00019 00020 # include /**/ "ace/pre.h" 00021 00022 # include "ace/config-all.h" 00023 00024 # if !defined (ACE_LACKS_PRAGMA_ONCE) 00025 # pragma once 00026 # endif /* ACE_LACKS_PRAGMA_ONCE */ 00027 00028 #include "ace/os_include/sys/os_stat.h" 00029 #include "ace/Default_Constants.h" // for ACE_DEFAULT_DIR_PERMS 00030 #include /**/ "ace/ACE_export.h" 00031 00032 #if defined (ACE_EXPORT_MACRO) 00033 # undef ACE_EXPORT_MACRO 00034 #endif 00035 #define ACE_EXPORT_MACRO ACE_Export 00036 00037 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00038 00039 # if defined (_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64 \ 00040 && defined (ACE_WIN32) 00041 # if defined (__BORLANDC__) 00042 typedef struct stati64 ACE_stat; 00043 # define ACE_STAT_FUNC_NAME ::_stati64 00044 # define ACE_WSTAT_FUNC_NAME ::_wstati64 00045 # elif !defined (ACE_HAS_WINCE) && defined (_MSC_VER) 00046 # if _MSC_VER >= 1400 00047 // For vc8 which has time_t as 64bit 00048 // 64-bit file offsets, 64-bit time_t 00049 # if defined (ACE_MSVC_USES_DOUBLE_UNDERSCORE_STAT64) 00050 typedef struct __stat64 ACE_stat; 00051 # else 00052 typedef struct _stat64 ACE_stat; 00053 # endif 00054 # define ACE_STAT_FUNC_NAME ::_stat64 00055 # define ACE_WSTAT_FUNC_NAME ::_wstat64 00056 # else 00057 // For vc71 which has time_t as 32bit 00058 typedef struct _stati64 ACE_stat; 00059 # define ACE_STAT_FUNC_NAME ::_stati64 00060 # define ACE_WSTAT_FUNC_NAME ::_wstati64 00061 # endif /* _MSC_VER >= 1400 */ 00062 # else 00063 typedef struct stat ACE_stat; 00064 # define ACE_STAT_FUNC_NAME ::stat 00065 # define ACE_WSTAT_FUNC_NAME ACE_STAT_FUNC_NAME 00066 # endif /**/ 00067 # else 00068 // Default file offset case. 00069 # if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) 00070 typedef struct _stat ACE_stat; 00071 # define ACE_STAT_FUNC_NAME ::_stat 00072 # define ACE_WSTAT_FUNC_NAME ::_wstat 00073 # else 00074 typedef struct stat ACE_stat; 00075 # define ACE_STAT_FUNC_NAME ::stat 00076 # define ACE_WSTAT_FUNC_NAME ACE_STAT_FUNC_NAME 00077 # endif /* ACE_WIN32 */ 00078 # endif /* _FILE_OFFSET_BITS == 64 && ACE_WIN32 */ 00079 00080 namespace ACE_OS 00081 { 00082 00083 ACE_NAMESPACE_INLINE_FUNCTION 00084 ACE_HANDLE creat (const ACE_TCHAR *filename, 00085 mode_t mode); 00086 00087 //@{ @name A set of wrappers for low-level file operations. 00088 00089 // non-standard 00090 ACE_NAMESPACE_INLINE_FUNCTION 00091 ACE_OFF_T filesize (ACE_HANDLE handle); 00092 00093 ACE_NAMESPACE_INLINE_FUNCTION 00094 ACE_OFF_T filesize (const ACE_TCHAR *handle); 00095 //@} 00096 00097 ACE_NAMESPACE_INLINE_FUNCTION 00098 int fstat (ACE_HANDLE, 00099 ACE_stat *); 00100 00101 ACE_NAMESPACE_INLINE_FUNCTION 00102 int lstat (const char *, 00103 ACE_stat *); 00104 00105 #if defined (ACE_HAS_WCHAR) 00106 ACE_NAMESPACE_INLINE_FUNCTION 00107 int lstat (const wchar_t *, 00108 ACE_stat *); 00109 #endif /* ACE_HAS_WCHAR */ 00110 00111 ACE_NAMESPACE_INLINE_FUNCTION 00112 int mkdir (const char *path, 00113 mode_t mode = ACE_DEFAULT_DIR_PERMS); 00114 00115 #if defined (ACE_HAS_WCHAR) 00116 ACE_NAMESPACE_INLINE_FUNCTION 00117 int mkdir (const wchar_t *path, 00118 mode_t mode = ACE_DEFAULT_DIR_PERMS); 00119 #endif /* ACE_HAS_WCHAR */ 00120 00121 ACE_NAMESPACE_INLINE_FUNCTION 00122 int mkfifo (const ACE_TCHAR *file, 00123 mode_t mode = ACE_DEFAULT_FILE_PERMS); 00124 00125 ACE_NAMESPACE_INLINE_FUNCTION 00126 int stat (const char *file, ACE_stat *); 00127 00128 #if defined (ACE_HAS_WCHAR) 00129 ACE_NAMESPACE_INLINE_FUNCTION 00130 int stat (const wchar_t *file, ACE_stat *); 00131 #endif /* ACE_HAS_WCHAR */ 00132 00133 ACE_NAMESPACE_INLINE_FUNCTION 00134 mode_t umask (mode_t cmask); 00135 00136 } /* namespace ACE_OS */ 00137 00138 ACE_END_VERSIONED_NAMESPACE_DECL 00139 00140 # if defined (ACE_HAS_INLINED_OSCALLS) 00141 # if defined (ACE_INLINE) 00142 # undef ACE_INLINE 00143 # endif /* ACE_INLINE */ 00144 # define ACE_INLINE inline 00145 # include "ace/OS_NS_sys_stat.inl" 00146 # endif /* ACE_HAS_INLINED_OSCALLS */ 00147 00148 # include /**/ "ace/post.h" 00149 #endif /* ACE_OS_NS_SYS_STAT_H */