Changeset 917 for trunk/zoo-project/zoo-kernel/service_internal.h
- Timestamp:
- May 7, 2019, 2:17:08 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:mergeinfo
set to
False
/branches/prototype-v0 merged eligible
-
Property
svn:mergeinfo
set to
False
-
trunk/zoo-project/zoo-kernel/service_internal.h
r680 r917 63 63 * Number of time the ZOO-Kernel will try to acquire lock 64 64 */ 65 #define ZOO_LOCK_MAX_RETRY 1 065 #define ZOO_LOCK_MAX_RETRY 180 66 66 67 67 #include <sys/stat.h> 68 68 #include <sys/types.h> 69 #include "cgic.h"70 69 #ifndef WIN32 71 70 #include <sys/ipc.h> … … 82 81 #endif 83 82 #ifndef WIN32 84 #include < xlocale.h>83 #include <locale.h> 85 84 #endif 86 85 86 #include <fcntl.h> 87 87 88 #include "service.h" 88 89 … … 94 95 #endif 95 96 97 #ifdef WIN32 98 // fcntl flock definitions 99 #define F_SETLK 8 // Non-Blocking set or clear a lock 100 #define F_SETLKW 9 // Blocking set or clear a lock 101 #define F_GETLK 10 102 #define F_RDLCK 1 // read lock 103 #define F_WRLCK 2 // write lock 104 #define F_UNLCK 3 // remove lock 105 struct flock { 106 short l_type; // F_RDLCK, F_WRLCK, or F_UNLCK 107 short l_whence; // flag to choose starting offset, must be SEEK_SET 108 long l_start; // relative offset, in bytes, must be 0 109 long l_len; // length, in bytes; 0 means lock to EOF, must be 0 110 short l_pid; // unused (returned with the unsupported F_GETLK) 111 short l_xxx; // reserved for future use 112 }; 113 #endif 114 115 /** 116 * The lock structure used by the ZOO-Kernel to ensure atomicity of operations 117 * 118 */ 119 typedef struct zooLock{ 120 struct flock lock; //!< The lock 121 FILE* lockfile; //!< The pointer to the lock file 122 char* filename; //!< The filename to lock 123 } zooLock; 124 125 static zooLock** zoo_file_locks=NULL; 126 static int zoo_file_locks_cnt=0; 127 96 128 #ifdef __cplusplus 97 129 extern "C" { 98 130 #endif 99 131 132 100 133 ZOO_DLL_EXPORT char *readVSIFile(maps*,const char*); 101 134 ZOO_DLL_EXPORT int setOutputValue( maps*, const char*, char*, size_t); 102 135 ZOO_DLL_EXPORT char* getInputValue( maps*,const char*,size_t*); 136 137 ZOO_DLL_EXPORT struct zooLock* lockFile(maps*,const char*,const char); 138 ZOO_DLL_EXPORT int unlockFile(maps*,struct zooLock*); 103 139 104 140 ZOO_DLL_EXPORT void unhandleStatus(maps*); … … 125 161 ZOO_DLL_EXPORT int unlockShm(semid); 126 162 163 ZOO_DLL_EXPORT char* file_exists(const char* dir, const char* name); 164 127 165 #ifdef __cplusplus 128 166 }
Note: See TracChangeset
for help on using the changeset viewer.