ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libeio/eio.c
(Generate patch)

Comparing libeio/eio.c (file contents):
Revision 1.121 by root, Sat Jun 2 20:13:26 2012 UTC vs.
Revision 1.122 by root, Tue Aug 14 04:15:35 2012 UTC

131 #define mknod(path,mode,dev) EIO_ENOSYS () 131 #define mknod(path,mode,dev) EIO_ENOSYS ()
132 #define sync() EIO_ENOSYS () 132 #define sync() EIO_ENOSYS ()
133 #define readlink(path,buf,s) EIO_ENOSYS () 133 #define readlink(path,buf,s) EIO_ENOSYS ()
134 #define statvfs(path,buf) EIO_ENOSYS () 134 #define statvfs(path,buf) EIO_ENOSYS ()
135 #define fstatvfs(fd,buf) EIO_ENOSYS () 135 #define fstatvfs(fd,buf) EIO_ENOSYS ()
136
137 #define pread(fd,buf,count,offset) eio__pread (fd, buf, count, offset)
138 #define pwrite(fd,buf,count,offset) eio__pwrite (fd, buf, count, offset)
139
140 #if __GNUC__
141 typedef long long eio_off_t; /* signed for compatibility to msvc */
142 #else
143 typedef __int64 eio_off_t; /* unsigned not supported by msvc */
144 #endif
145
146 static eio_ssize_t
147 eio__pread (int fd, void *buf, eio_ssize_t count, eio_off_t offset)
148 {
149 OVERLAPPED o = { 0 };
150 DWORD got;
151
152 o.Offset = offset;
153 o.OffsetHigh = offset >> 32;
154
155 return ReadFile ((HANDLE)EIO_FD_TO_WIN32_HANDLE (fd), buf, count, &got, &o)
156 ? got : -1;
157 }
158
159 static eio_ssize_t
160 eio__pwrite (int fd, void *buf, eio_ssize_t count, eio_off_t offset)
161 {
162 OVERLAPPED o = { 0 };
163 DWORD got;
164
165 o.Offset = offset;
166 o.OffsetHigh = offset >> 32;
167
168 return WriteFile ((HANDLE)EIO_FD_TO_WIN32_HANDLE (fd), buf, count, &got, &o)
169 ? got : -1;
170 }
136 171
137 /* rename() uses MoveFile, which fails to overwrite */ 172 /* rename() uses MoveFile, which fails to overwrite */
138 #define rename(old,neu) eio__rename (old, neu) 173 #define rename(old,neu) eio__rename (old, neu)
139 174
140 static int 175 static int
2192 free (req); 2227 free (req);
2193 2228
2194 X_LOCK (wrklock); 2229 X_LOCK (wrklock);
2195 etp_worker_free (self); 2230 etp_worker_free (self);
2196 X_UNLOCK (wrklock); 2231 X_UNLOCK (wrklock);
2232
2233 return 0;
2197} 2234}
2198 2235
2199/*****************************************************************************/ 2236/*****************************************************************************/
2200 2237
2201int ecb_cold 2238int ecb_cold

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines