00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00046 #ifndef SYNSOFT_UNIXEM_INCL_H_UNISTD
00047 #define SYNSOFT_UNIXEM_INCL_H_UNISTD
00048
00049 #ifndef UNIXEM_DOCUMENTATION_SKIP_SECTION
00050 # define SYNSOFT_UNIXEM_VER_H_UNISTD_MAJOR 2
00051 # define SYNSOFT_UNIXEM_VER_H_UNISTD_MINOR 4
00052 # define SYNSOFT_UNIXEM_VER_H_UNISTD_REVISION 1
00053 # define SYNSOFT_UNIXEM_VER_H_UNISTD_EDIT 29
00054 #endif
00055
00056
00057
00058
00059
00060 #include <stddef.h>
00061 #include <sys/types.h>
00062
00063
00064
00065
00066
00067
00068 #if defined(__BORLANDC__)
00069 # include <dir.h>
00070 # define UNIXEM_chdir_PROVIDED_BY_COMPILER
00071 # define UNIXEM_getcwd_PROVIDED_BY_COMPILER
00072 # define UNIXEM_mkdir_PROVIDED_BY_COMPILER
00073 # define UNIXEM_rmdir_PROVIDED_BY_COMPILER
00074 #elif defined(__DMC__)
00075 # include <direct.h>
00076 # define UNIXEM_chdir_PROVIDED_BY_COMPILER
00077 # define UNIXEM_close_PROVIDED_BY_COMPILER
00078 # define UNIXEM_getcwd_PROVIDED_BY_COMPILER
00079 #elif defined(__GNUC__)
00080 # include <io.h>
00081 # define UNIXEM_chdir_PROVIDED_BY_COMPILER
00082 # define UNIXEM_chmod_PROVIDED_BY_COMPILER
00083 # define UNIXEM_getcwd_PROVIDED_BY_COMPILER
00084 # define UNIXEM_mkdir_PROVIDED_BY_COMPILER
00085 # define UNIXEM_rmdir_PROVIDED_BY_COMPILER
00086 #elif defined(__INTEL_COMPILER)
00087 # if defined(_WIN32) && \
00088 !defined(__STDC__)
00089 # include <direct.h>
00090 # define UNIXEM_chdir_PROVIDED_BY_COMPILER
00091 # define UNIXEM_getcwd_PROVIDED_BY_COMPILER
00092 # define UNIXEM_mkdir_PROVIDED_BY_COMPILER
00093 # define UNIXEM_rmdir_PROVIDED_BY_COMPILER
00094 # endif
00095 #elif defined(__MWERKS__)
00096 # define UNIXEM_mkdir_PROVIDED_BY_COMPILER
00097 #elif defined(__WATCOMC__)
00098 # define UNIXEM_chdir_PROVIDED_BY_COMPILER
00099 # define UNIXEM_getcwd_PROVIDED_BY_COMPILER
00100 # define UNIXEM_mkdir_PROVIDED_BY_COMPILER
00101 # define UNIXEM_rmdir_PROVIDED_BY_COMPILER
00102 #elif defined(_MSC_VER)
00103 # if !defined(__STDC__)
00104 # include <direct.h>
00105 # define UNIXEM_chdir_PROVIDED_BY_COMPILER
00106 # define UNIXEM_getcwd_PROVIDED_BY_COMPILER
00107 # define UNIXEM_mkdir_PROVIDED_BY_COMPILER
00108 # define UNIXEM_rmdir_PROVIDED_BY_COMPILER
00109 # endif
00110 #else
00111 # error Compiler not discriminated
00112 #endif
00113
00114
00115 #if defined(_MSC_VER) && \
00116 !defined(__STDC__)
00117 # define UNIXEM_UNISTD_INCLUDING_MS_DIRECT_H
00118 #endif
00119
00120
00121
00132
00133
00134 #ifndef _WIN32
00135 # error This file is only currently defined for compilation on Win32 systems
00136 #endif
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146 enum
00147 {
00148 _PC_LINK_MAX
00149 #define _PC_LINK_MAX _PC_LINK_MAX
00150 , _PC_MAX_CANON
00151 #define _PC_MAX_CANON _PC_MAX_CANON
00152 , _PC_MAX_INPUT
00153 #define _PC_MAX_INPUT _PC_MAX_INPUT
00154 , _PC_NAME_MAX
00155 #define _PC_NAME_MAX _PC_NAME_MAX
00156 , _PC_PATH_MAX
00157 #define _PC_PATH_MAX _PC_PATH_MAX
00158
00159 , _PC_PIPE_BUF
00160 #define _PC_PIPE_BUF _PC_PIPE_BUF
00161 , _PC_CHOWN_RESTRICTED
00162 #define _PC_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED
00163 , _PC_NO_TRUNC
00164 #define _PC_NO_TRUNC _PC_NO_TRUNC
00165 , _PC_VDISABLE
00166 #define _PC_VDISABLE _PC_VDISABLE
00167 , _PC_AIX_DISK_PARTITION
00170 #define _PC_AIX_DISK_PARTITION _PC_AIX_DISK_PARTITION
00171 , _PC_AIX_DISK_SIZE
00176 #define _PC_AIX_DISK_SIZE _PC_AIX_DISK_SIZE
00177 , _PC_FILESIZEBITS
00178 #define _PC_FILESIZEBITS _PC_FILESIZEBITS
00179 , _PC_SYNC_IO
00180 #define _PC_SYNC_IO _PC_SYNC_IO
00181 };
00182
00183
00184
00185
00186
00187 #ifdef __cplusplus
00188 extern "C" {
00189 #endif
00190
00203 int link(const char *originalFile, const char *linkName);
00204
00211 int unlink(const char *path);
00212
00213
00222 #ifndef UNIXEM_chdir_PROVIDED_BY_COMPILER
00223 int chdir(const char *dirName);
00224 #endif
00225
00226
00236 #ifndef UNIXEM_getcwd_PROVIDED_BY_COMPILER
00237 char *getcwd(char *buffer, size_t max_len);
00238 #endif
00239
00240
00250 #ifndef UNIXEM_mkdir_PROVIDED_BY_COMPILER
00251 int mkdir(const char *dirName, unsigned mode);
00252 #endif
00253
00254
00262 #ifndef UNIXEM_rmdir_PROVIDED_BY_COMPILER
00263 int rmdir(const char *dirName);
00264 #endif
00265
00271 #ifndef UNIXEM_close_PROVIDED_BY_COMPILER
00272 int close(int handle);
00273 #endif
00274
00281
00282
00285 int getpagesize(void);
00286
00289 long pathconf(char const *path, int name);
00290
00291
00299 char *realpath(char const *path, char resolvedPath[]);
00300
00305 int usleep(unsigned long microSeconds);
00306
00307 #ifdef __cplusplus
00308 }
00309 #endif
00310
00311
00312
00315
00316
00317 #endif
00318
00319