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 6
00052 # define SYNSOFT_UNIXEM_VER_H_UNISTD_REVISION 3
00053 # define SYNSOFT_UNIXEM_VER_H_UNISTD_EDIT 36
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 # define UNIXEM_pid_t_PROVIDED_BY_COMPILER
00080 #elif defined(__GNUC__)
00081 # include <io.h>
00082 # define UNIXEM_chdir_PROVIDED_BY_COMPILER
00083 # define UNIXEM_chmod_PROVIDED_BY_COMPILER
00084 # define UNIXEM_getcwd_PROVIDED_BY_COMPILER
00085 # define UNIXEM_mkdir_PROVIDED_BY_COMPILER
00086 # ifndef _NO_OLDNAMES
00087 # define UNIXEM_pid_t_PROVIDED_BY_COMPILER
00088 # endif
00089 # define UNIXEM_rmdir_PROVIDED_BY_COMPILER
00090 #elif defined(__INTEL_COMPILER)
00091 # if defined(_WIN32) && \
00092 !defined(__STDC__)
00093 # include <direct.h>
00094 # define UNIXEM_chdir_PROVIDED_BY_COMPILER
00095 # define UNIXEM_getcwd_PROVIDED_BY_COMPILER
00096 # define UNIXEM_mkdir_PROVIDED_BY_COMPILER
00097 # define UNIXEM_rmdir_PROVIDED_BY_COMPILER
00098 # endif
00099 #elif defined(__MWERKS__)
00100 # define UNIXEM_mkdir_PROVIDED_BY_COMPILER
00101 #elif defined(__WATCOMC__)
00102 # define UNIXEM_chdir_PROVIDED_BY_COMPILER
00103 # define UNIXEM_getcwd_PROVIDED_BY_COMPILER
00104 # define UNIXEM_mkdir_PROVIDED_BY_COMPILER
00105 # define UNIXEM_pid_t_PROVIDED_BY_COMPILER
00106 # define UNIXEM_rmdir_PROVIDED_BY_COMPILER
00107 #elif defined(_MSC_VER)
00108 # if !defined(__STDC__)
00109 # include <direct.h>
00110 # define UNIXEM_chdir_PROVIDED_BY_COMPILER
00111 # define UNIXEM_getcwd_PROVIDED_BY_COMPILER
00112 # define UNIXEM_mkdir_PROVIDED_BY_COMPILER
00113 # define UNIXEM_rmdir_PROVIDED_BY_COMPILER
00114 # include <stdio.h>
00115 # define UNIXEM_unlink_PROVIDED_BY_COMPILER
00116 # endif
00117 #else
00118 # error Compiler not discriminated
00119 #endif
00120
00121
00122 #if defined(_MSC_VER) && \
00123 !defined(__STDC__)
00124 # define UNIXEM_UNISTD_INCLUDING_MS_DIRECT_H
00125 #endif
00126
00127
00128
00139
00140
00141 #ifndef _WIN32
00142 # error This file is only currently defined for compilation on Win32 systems
00143 #endif
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153 enum
00154 {
00155 _PC_LINK_MAX
00156 , _PC_MAX_CANON
00157 , _PC_MAX_INPUT
00158 , _PC_NAME_MAX
00159 , _PC_PATH_MAX
00161 , _PC_PIPE_BUF
00162 , _PC_CHOWN_RESTRICTED
00163 , _PC_NO_TRUNC
00164 , _PC_VDISABLE
00165 , _PC_AIX_DISK_PARTITION
00168 , _PC_AIX_DISK_SIZE
00173 , _PC_FILESIZEBITS
00174 , _PC_SYNC_IO
00176 #ifndef UNIXEM_DOCUMENTATION_SKIP_SECTION
00177 # define _PC_LINK_MAX _PC_LINK_MAX
00178 # define _PC_MAX_CANON _PC_MAX_CANON
00179 # define _PC_MAX_INPUT _PC_MAX_INPUT
00180 # define _PC_NAME_MAX _PC_NAME_MAX
00181 # define _PC_PATH_MAX _PC_PATH_MAX
00182 # define _PC_PIPE_BUF _PC_PIPE_BUF
00183 # define _PC_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED
00184 # define _PC_NO_TRUNC _PC_NO_TRUNC
00185 # define _PC_VDISABLE _PC_VDISABLE
00186 # define _PC_AIX_DISK_PARTITION _PC_AIX_DISK_PARTITION
00187 # define _PC_AIX_DISK_SIZE _PC_AIX_DISK_SIZE
00188 # define _PC_FILESIZEBITS _PC_FILESIZEBITS
00189 # define _PC_SYNC_IO _PC_SYNC_IO
00190 #endif
00191 };
00192
00193
00194
00195
00196
00197 #if !defined(UNIXEM_pid_t_PROVIDED_BY_COMPILER) && \
00198 !defined(pid_t) && \
00199 !( defined(_SCHED_H) && \
00200 defined(PTW32_DLLPORT))
00201 # define UNIXEM_pid_t_DEFINED
00202 typedef int pid_t;
00203 #endif
00204
00205
00206
00207
00208
00209 #ifdef __cplusplus
00210 extern "C" {
00211 #endif
00212
00225 int link(char const* originalFile, char const* linkName);
00226
00233 #ifndef UNIXEM_unlink_PROVIDED_BY_COMPILER
00234 int unlink(char const* path);
00235 #endif
00236
00237
00246 #ifndef UNIXEM_chdir_PROVIDED_BY_COMPILER
00247 int chdir(char const* dirName);
00248 #endif
00249
00250
00260 #ifndef UNIXEM_getcwd_PROVIDED_BY_COMPILER
00261 char *getcwd(char *buffer, size_t max_len);
00262 #endif
00263
00264
00274 #ifndef UNIXEM_mkdir_PROVIDED_BY_COMPILER
00275 int mkdir(char const* dirName, unsigned mode);
00276 #endif
00277
00278
00286 #ifndef UNIXEM_rmdir_PROVIDED_BY_COMPILER
00287 int rmdir(char const* dirName);
00288 #endif
00289
00295 #ifndef UNIXEM_close_PROVIDED_BY_COMPILER
00296 int close(int handle);
00297 #endif
00298
00299
00300
00301
00302
00303
00304
00305
00306
00309 int getpagesize(void);
00310
00313 long pathconf(char const *path, int name);
00314
00315
00323 char *realpath(char const *path, char resolvedPath[]);
00324
00329 int usleep(unsigned long microSeconds);
00330
00331
00334 pid_t getpid(void);
00335
00336
00345 #ifdef UNIXEM_DOCUMENTATION_SKIP_SECTION
00346 int gethostname(char* name, size_t cchName);
00347 #else
00348 int unixem_gethostname(char* name, size_t cchName);
00349 # ifdef _WINSOCKAPI_
00350
00351 # else
00352 # define _WINSOCKAPI_ .
00353 # endif
00354 # ifdef _WINSOCK2API_
00355 # else
00356 # define _WINSOCK2API_
00357 # endif
00358
00359
00360 # ifdef __cplusplus
00361 inline int gethostname(char* name, size_t cchName)
00362 {
00363 return unixem_gethostname(name, cchName);
00364 }
00365 # endif
00366
00367 # define gethostname(name, cchName) unixem_gethostname(name, cchName)
00368 #endif
00369
00370 #ifdef __cplusplus
00371 }
00372 #endif
00373
00374
00375
00378
00379
00380 #endif
00381
00382