… | |
… | |
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 | #else |
|
|
74 | typedef uid_t eio_uid_t; |
|
|
75 | typedef gid_t eio_gid_t; |
|
|
76 | typedef ssize_t eio_ssize_t; |
|
|
77 | #endif |
|
|
78 | |
69 | #ifndef EIO_STRUCT_STATVFS |
79 | #ifndef EIO_STRUCT_STATVFS |
70 | # define EIO_STRUCT_STATVFS struct statvfs |
80 | # define EIO_STRUCT_STATVFS struct statvfs |
71 | #endif |
81 | #endif |
72 | |
82 | |
73 | /* for readdir */ |
83 | /* for readdir */ |
… | |
… | |
189 | /* when initialising it, all members must be zero-initialised */ |
199 | /* when initialising it, all members must be zero-initialised */ |
190 | struct eio_req |
200 | struct eio_req |
191 | { |
201 | { |
192 | eio_req volatile *next; /* private ETP */ |
202 | eio_req volatile *next; /* private ETP */ |
193 | |
203 | |
194 | ssize_t result; /* result of syscall, e.g. result = read (... */ |
204 | 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 */ |
205 | 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 */ |
206 | 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 */ |
207 | 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 */ |
208 | void *ptr2; /* all applicable requests: new name or memory buffer; readdir: name strings */ |
199 | eio_tstamp nv1; /* utime, futime: atime; busy: sleep time */ |
209 | eio_tstamp nv1; /* utime, futime: atime; busy: sleep time */ |
… | |
… | |
339 | void eio_cancel (eio_req *req); |
349 | void eio_cancel (eio_req *req); |
340 | |
350 | |
341 | /*****************************************************************************/ |
351 | /*****************************************************************************/ |
342 | /* convenience functions */ |
352 | /* convenience functions */ |
343 | |
353 | |
344 | ssize_t eio_sendfile_sync (int ofd, int ifd, off_t offset, size_t count); |
354 | eio_ssize_t eio_sendfile_sync (int ofd, int ifd, off_t offset, size_t count); |
345 | |
355 | |
346 | #ifdef __cplusplus |
356 | #ifdef __cplusplus |
347 | } |
357 | } |
348 | #endif |
358 | #endif |
349 | |
359 | |