… | |
… | |
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 | |
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 | } |
|
|
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 |
141 | eio__rename (const char *old, const char *neu) |
176 | eio__rename (const char *old, const char *neu) |
… | |
… | |
1883 | #ifdef DT_FIFO |
1918 | #ifdef DT_FIFO |
1884 | case DT_FIFO: ent->type = EIO_DT_FIFO; break; |
1919 | case DT_FIFO: ent->type = EIO_DT_FIFO; break; |
1885 | #endif |
1920 | #endif |
1886 | #ifdef DT_CHR |
1921 | #ifdef DT_CHR |
1887 | case DT_CHR: ent->type = EIO_DT_CHR; break; |
1922 | case DT_CHR: ent->type = EIO_DT_CHR; break; |
1888 | #endif |
1923 | #endif |
1889 | #ifdef DT_MPC |
1924 | #ifdef DT_MPC |
1890 | case DT_MPC: ent->type = EIO_DT_MPC; break; |
1925 | case DT_MPC: ent->type = EIO_DT_MPC; break; |
1891 | #endif |
1926 | #endif |
1892 | #ifdef DT_DIR |
1927 | #ifdef DT_DIR |
1893 | case DT_DIR: ent->type = EIO_DT_DIR; break; |
1928 | case DT_DIR: ent->type = EIO_DT_DIR; break; |
1894 | #endif |
1929 | #endif |
1895 | #ifdef DT_NAM |
1930 | #ifdef DT_NAM |
1896 | case DT_NAM: ent->type = EIO_DT_NAM; break; |
1931 | case DT_NAM: ent->type = EIO_DT_NAM; break; |
1897 | #endif |
1932 | #endif |
1898 | #ifdef DT_BLK |
1933 | #ifdef DT_BLK |
1899 | case DT_BLK: ent->type = EIO_DT_BLK; break; |
1934 | case DT_BLK: ent->type = EIO_DT_BLK; break; |
1900 | #endif |
1935 | #endif |
1901 | #ifdef DT_MPB |
1936 | #ifdef DT_MPB |
1902 | case DT_MPB: ent->type = EIO_DT_MPB; break; |
1937 | case DT_MPB: ent->type = EIO_DT_MPB; break; |
1903 | #endif |
1938 | #endif |
1904 | #ifdef DT_REG |
1939 | #ifdef DT_REG |
1905 | case DT_REG: ent->type = EIO_DT_REG; break; |
1940 | case DT_REG: ent->type = EIO_DT_REG; break; |
1906 | #endif |
1941 | #endif |
1907 | #ifdef DT_NWK |
1942 | #ifdef DT_NWK |
1908 | case DT_NWK: ent->type = EIO_DT_NWK; break; |
1943 | case DT_NWK: ent->type = EIO_DT_NWK; break; |
1909 | #endif |
1944 | #endif |
1910 | #ifdef DT_CMP |
1945 | #ifdef DT_CMP |
1911 | case DT_CMP: ent->type = EIO_DT_CMP; break; |
1946 | case DT_CMP: ent->type = EIO_DT_CMP; break; |
1912 | #endif |
1947 | #endif |
1913 | #ifdef DT_LNK |
1948 | #ifdef DT_LNK |
1914 | case DT_LNK: ent->type = EIO_DT_LNK; break; |
1949 | case DT_LNK: ent->type = EIO_DT_LNK; break; |
1915 | #endif |
1950 | #endif |
1916 | #ifdef DT_SOCK |
1951 | #ifdef DT_SOCK |
1917 | case DT_SOCK: ent->type = EIO_DT_SOCK; break; |
1952 | case DT_SOCK: ent->type = EIO_DT_SOCK; break; |
… | |
… | |
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 | |
2201 | int ecb_cold |
2238 | int ecb_cold |