00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _UT_NTUtil_h_
00021 #define _UT_NTUtil_h_
00022
00023 #include "UT_API.h"
00024 #include <SYS/SYS_Time.h>
00025 #include "UT_Defines.h"
00026
00027 #ifdef WIN32
00028
00029
00030
00031
00032
00033 #include <process.h>
00034 #include <io.h>
00035
00036 typedef int mode_t;
00037 typedef void * key_t;
00038
00039 struct timezone {
00040 long tzd;
00041 };
00042
00043 #define IPC_CREAT 0001000
00044 #define IPC_EXCL 0002000
00045 #define IPC_PRIVATE (key_t)0
00046 #define IPC_RMID 10
00047
00048 #define PR_SADDR 1
00049 #define PR_SALL 2
00050 #define PR_SFDS 3
00051
00052 #define F_OK 0
00053 #define X_OK 1
00054 #define W_OK 2
00055 #define R_OK 4
00056
00057 #define MP_NPROCS 0
00058
00059 #define CONF_INITUSERS 1
00060
00061 UT_API void UTnap(int millisec);
00062
00063
00064 static inline void sginap(int centiseconds)
00065 {
00066 return UTnap(centiseconds * 10);
00067 }
00068
00069 static inline void sleep(int seconds)
00070 {
00071 return UTnap(seconds * 1000);
00072 }
00073
00074
00075 UT_API int mkdir( const char *, int );
00076
00077
00078
00079 #ifndef S_ISDIR
00080 #define S_ISDIR(mode) ((mode&S_IFMT) == S_IFDIR)
00081 #endif
00082 #ifndef S_ISREG
00083 #define S_ISREG(mode) ((mode&S_IFMT) == S_IFREG)
00084 #endif
00085
00086 UT_API int sysmp( int val, ... );
00087 UT_API void *shmat( key_t h, void *addr, int flag );
00088 UT_API int shmdt( void *mem );
00089 UT_API key_t shmget( key_t key, int size, int flag );
00090 UT_API int shmctl( key_t h, int cmd, int parm );
00091 UT_API int shmctl( key_t h, int cmd );
00092 UT_API key_t ftok( const char *path, int id );
00093
00094 UT_API int umask( char c );
00095 UT_API int UTaccess(const char *path, int mode);
00096 UT_API void UTclearHostnameCache();
00097 UT_API int UTgethostname(char *host, int len);
00098
00099
00100
00101
00102 #ifndef getpid
00103 #define getpid() _getpid()
00104 #endif
00105
00106 UT_API int usconfig( int flag, int data );
00107 UT_API char *dlerror( void );
00108
00109 UT_API void cftime( char *dest, char *fmt, time_t *now );
00110
00111 UT_API void closePerformanceKey(void *data);
00112
00113 #define snprintf _snprintf
00114 #endif
00115
00116 #endif // _UT_NTUtil_h_