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 7
00052 # define SYNSOFT_UNIXEM_VER_H_UNISTD_REVISION 1
00053 # define SYNSOFT_UNIXEM_VER_H_UNISTD_EDIT 40
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 # define UNIXEM_close_PROVIDED_BY_COMPILER
00117 # endif
00118 #else
00119 # error Compiler not discriminated
00120 #endif
00121
00122
00123 #if defined(_MSC_VER) && \
00124 !defined(__STDC__)
00125 # define UNIXEM_UNISTD_INCLUDING_MS_DIRECT_H
00126 #endif
00127
00128
00129
00140
00141
00142 #ifndef _WIN32
00143 # error This file is only currently defined for compilation on Win32 systems
00144 #endif
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154 enum
00155 {
00156 _PC_LINK_MAX
00157 , _PC_MAX_CANON
00158 , _PC_MAX_INPUT
00159 , _PC_NAME_MAX
00160 , _PC_PATH_MAX
00162 , _PC_PIPE_BUF
00163 , _PC_CHOWN_RESTRICTED
00164 , _PC_NO_TRUNC
00165 , _PC_VDISABLE
00166 , _PC_AIX_DISK_PARTITION
00169 , _PC_AIX_DISK_SIZE
00174 , _PC_FILESIZEBITS
00175 , _PC_SYNC_IO
00177 #ifndef UNIXEM_DOCUMENTATION_SKIP_SECTION
00178 # define _PC_LINK_MAX _PC_LINK_MAX
00179 # define _PC_MAX_CANON _PC_MAX_CANON
00180 # define _PC_MAX_INPUT _PC_MAX_INPUT
00181 # define _PC_NAME_MAX _PC_NAME_MAX
00182 # define _PC_PATH_MAX _PC_PATH_MAX
00183 # define _PC_PIPE_BUF _PC_PIPE_BUF
00184 # define _PC_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED
00185 # define _PC_NO_TRUNC _PC_NO_TRUNC
00186 # define _PC_VDISABLE _PC_VDISABLE
00187 # define _PC_AIX_DISK_PARTITION _PC_AIX_DISK_PARTITION
00188 # define _PC_AIX_DISK_SIZE _PC_AIX_DISK_SIZE
00189 # define _PC_FILESIZEBITS _PC_FILESIZEBITS
00190 # define _PC_SYNC_IO _PC_SYNC_IO
00191 #endif
00192 };
00193
00194
00195
00196
00197
00198 #if !defined(UNIXEM_pid_t_PROVIDED_BY_COMPILER) && \
00199 !defined(pid_t) && \
00200 !( defined(_SCHED_H) && \
00201 defined(PTW32_DLLPORT))
00202 # define UNIXEM_pid_t_DEFINED
00203
00204 typedef int pid_t;
00205 #endif
00206
00207
00208
00209
00210
00211 #ifdef __cplusplus
00212 extern "C" {
00213 #endif
00214
00227 int link(char const* originalFile, char const* linkName);
00228
00235 #ifndef UNIXEM_unlink_PROVIDED_BY_COMPILER
00236 int unlink(char const* path);
00237 #endif
00238
00239
00248 #ifndef UNIXEM_chdir_PROVIDED_BY_COMPILER
00249 int chdir(char const* dirName);
00250 #endif
00251
00252
00262 #ifndef UNIXEM_getcwd_PROVIDED_BY_COMPILER
00263 char *getcwd(char *buffer, size_t max_len);
00264 #endif
00265
00266
00276 #ifndef UNIXEM_mkdir_PROVIDED_BY_COMPILER
00277 int mkdir(char const* dirName, unsigned mode);
00278 #endif
00279
00280
00288 #ifndef UNIXEM_rmdir_PROVIDED_BY_COMPILER
00289 int rmdir(char const* dirName);
00290 #endif
00291
00297 #ifndef UNIXEM_close_PROVIDED_BY_COMPILER
00298 int close(int handle);
00299 #endif
00300
00301
00302
00303
00304
00305
00306
00307
00308
00311 int getpagesize(void);
00312
00315 long pathconf(char const *path, int name);
00316
00317
00325 char *realpath(char const *path, char resolvedPath[]);
00326
00331 int usleep(unsigned long microSeconds);
00332
00333
00336 pid_t getpid(void);
00337
00338
00350 #ifdef UNIXEM_DOCUMENTATION_SKIP_SECTION
00351 int gethostname(char* name, size_t cchName);
00352 #else
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364 int __stdcall unixem_gethostname(char* name, size_t cchName);
00365 # ifdef __cplusplus
00366 extern "C++"
00367 {
00368 inline int gethostname(char* name, size_t cchName)
00369 {
00370 return unixem_gethostname(name, cchName);
00371 }
00372 }
00373 # else
00374 # include <unixem/internal/winsock.h>
00375 # define gethostname(name, cchName) unixem_gethostname(name, cchName)
00376 # endif
00377 #endif
00378
00379 #ifdef __cplusplus
00380 }
00381 #endif
00382
00383
00384
00387
00388
00389 #endif
00390
00391