… | |
… | |
64 | # else |
64 | # else |
65 | # define EIO_STRUCT_STAT struct stat |
65 | # define EIO_STRUCT_STAT struct stat |
66 | # endif |
66 | # endif |
67 | #endif |
67 | #endif |
68 | |
68 | |
|
|
69 | #ifdef _WIN32 |
|
|
70 | typedef int eio_uid_t; |
|
|
71 | typedef int eio_gid_t; |
|
|
72 | typedef intptr_t eio_ssize_t; /* or SSIZE_T */ |
|
|
73 | #if __GNUC__ |
|
|
74 | typedef long long eio_ino_t; |
|
|
75 | #else |
|
|
76 | typedef __int64 eio_ino_t; /* unsigned not supported by msvc */ |
|
|
77 | #endif |
|
|
78 | #else |
|
|
79 | typedef uid_t eio_uid_t; |
|
|
80 | typedef gid_t eio_gid_t; |
|
|
81 | typedef ssize_t eio_ssize_t; |
|
|
82 | typedef ino_t eio_ino_t; |
|
|
83 | #endif |
|
|
84 | |
69 | #ifndef EIO_STRUCT_STATVFS |
85 | #ifndef EIO_STRUCT_STATVFS |
70 | # define EIO_STRUCT_STATVFS struct statvfs |
86 | # define EIO_STRUCT_STATVFS struct statvfs |
71 | #endif |
87 | #endif |
72 | |
88 | |
73 | /* for readdir */ |
89 | /* for readdir */ |
… | |
… | |
110 | { |
126 | { |
111 | int nameofs; /* offset of null-terminated name string in (char *)req->ptr2 */ |
127 | int nameofs; /* offset of null-terminated name string in (char *)req->ptr2 */ |
112 | unsigned short namelen; /* size of filename without trailing 0 */ |
128 | unsigned short namelen; /* size of filename without trailing 0 */ |
113 | unsigned char type; /* one of EIO_DT_* */ |
129 | unsigned char type; /* one of EIO_DT_* */ |
114 | signed char score; /* internal use */ |
130 | signed char score; /* internal use */ |
115 | ino_t inode; /* the inode number, if available, otherwise unspecified */ |
131 | eio_ino_t inode; /* the inode number, if available, otherwise unspecified */ |
116 | }; |
132 | }; |
117 | |
133 | |
118 | /* eio_msync flags */ |
134 | /* eio_msync flags */ |
119 | enum |
135 | enum |
120 | { |
136 | { |
… | |
… | |
189 | /* when initialising it, all members must be zero-initialised */ |
205 | /* when initialising it, all members must be zero-initialised */ |
190 | struct eio_req |
206 | struct eio_req |
191 | { |
207 | { |
192 | eio_req volatile *next; /* private ETP */ |
208 | eio_req volatile *next; /* private ETP */ |
193 | |
209 | |
194 | ssize_t result; /* result of syscall, e.g. result = read (... */ |
210 | eio_ssize_t result; /* result of syscall, e.g. result = read (... */ |
195 | off_t offs; /* read, write, truncate, readahead, sync_file_range, fallocate: file offset, mknod: dev_t */ |
211 | off_t offs; /* read, write, truncate, readahead, sync_file_range, fallocate: file offset, mknod: dev_t */ |
196 | size_t size; /* read, write, readahead, sendfile, msync, mlock, sync_file_range, fallocate: length */ |
212 | size_t size; /* read, write, readahead, sendfile, msync, mlock, sync_file_range, fallocate: length */ |
197 | void *ptr1; /* all applicable requests: pathname, old name; readdir: optional eio_dirents */ |
213 | void *ptr1; /* all applicable requests: pathname, old name; readdir: optional eio_dirents */ |
198 | void *ptr2; /* all applicable requests: new name or memory buffer; readdir: name strings */ |
214 | void *ptr2; /* all applicable requests: new name or memory buffer; readdir: name strings */ |
199 | eio_tstamp nv1; /* utime, futime: atime; busy: sleep time */ |
215 | eio_tstamp nv1; /* utime, futime: atime; busy: sleep time */ |
… | |
… | |
339 | void eio_cancel (eio_req *req); |
355 | void eio_cancel (eio_req *req); |
340 | |
356 | |
341 | /*****************************************************************************/ |
357 | /*****************************************************************************/ |
342 | /* convenience functions */ |
358 | /* convenience functions */ |
343 | |
359 | |
344 | ssize_t eio_sendfile_sync (int ofd, int ifd, off_t offset, size_t count); |
360 | eio_ssize_t eio_sendfile_sync (int ofd, int ifd, off_t offset, size_t count); |
345 | |
361 | |
346 | #ifdef __cplusplus |
362 | #ifdef __cplusplus |
347 | } |
363 | } |
348 | #endif |
364 | #endif |
349 | |
365 | |