… | |
… | |
56 | #ifndef EIO_REQ_MEMBERS |
56 | #ifndef EIO_REQ_MEMBERS |
57 | # define EIO_REQ_MEMBERS |
57 | # define EIO_REQ_MEMBERS |
58 | #endif |
58 | #endif |
59 | |
59 | |
60 | #ifndef EIO_STRUCT_STAT |
60 | #ifndef EIO_STRUCT_STAT |
|
|
61 | # ifdef _WIN32 |
|
|
62 | # define EIO_STRUCT_STAT struct _stati64 |
|
|
63 | # define EIO_STRUCT_STATI64 |
|
|
64 | # else |
61 | # define EIO_STRUCT_STAT struct stat |
65 | # define EIO_STRUCT_STAT struct stat |
|
|
66 | # endif |
|
|
67 | #endif |
|
|
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; |
62 | #endif |
83 | #endif |
63 | |
84 | |
64 | #ifndef EIO_STRUCT_STATVFS |
85 | #ifndef EIO_STRUCT_STATVFS |
65 | # define EIO_STRUCT_STATVFS struct statvfs |
86 | # define EIO_STRUCT_STATVFS struct statvfs |
66 | #endif |
87 | #endif |
… | |
… | |
105 | { |
126 | { |
106 | 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 */ |
107 | unsigned short namelen; /* size of filename without trailing 0 */ |
128 | unsigned short namelen; /* size of filename without trailing 0 */ |
108 | unsigned char type; /* one of EIO_DT_* */ |
129 | unsigned char type; /* one of EIO_DT_* */ |
109 | signed char score; /* internal use */ |
130 | signed char score; /* internal use */ |
110 | ino_t inode; /* the inode number, if available, otherwise unspecified */ |
131 | eio_ino_t inode; /* the inode number, if available, otherwise unspecified */ |
111 | }; |
132 | }; |
112 | |
133 | |
113 | /* eio_msync flags */ |
134 | /* eio_msync flags */ |
114 | enum |
135 | enum |
115 | { |
136 | { |
… | |
… | |
184 | /* when initialising it, all members must be zero-initialised */ |
205 | /* when initialising it, all members must be zero-initialised */ |
185 | struct eio_req |
206 | struct eio_req |
186 | { |
207 | { |
187 | eio_req volatile *next; /* private ETP */ |
208 | eio_req volatile *next; /* private ETP */ |
188 | |
209 | |
189 | ssize_t result; /* result of syscall, e.g. result = read (... */ |
210 | eio_ssize_t result; /* result of syscall, e.g. result = read (... */ |
190 | 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 */ |
191 | 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 */ |
192 | 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 */ |
193 | 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 */ |
194 | eio_tstamp nv1; /* utime, futime: atime; busy: sleep time */ |
215 | eio_tstamp nv1; /* utime, futime: atime; busy: sleep time */ |
… | |
… | |
334 | void eio_cancel (eio_req *req); |
355 | void eio_cancel (eio_req *req); |
335 | |
356 | |
336 | /*****************************************************************************/ |
357 | /*****************************************************************************/ |
337 | /* convenience functions */ |
358 | /* convenience functions */ |
338 | |
359 | |
339 | 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); |
340 | |
361 | |
341 | #ifdef __cplusplus |
362 | #ifdef __cplusplus |
342 | } |
363 | } |
343 | #endif |
364 | #endif |
344 | |
365 | |