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

Comparing libeio/eio.h (file contents):
Revision 1.49 by root, Tue Sep 27 12:36:19 2011 UTC vs.
Revision 1.51 by root, Wed Jul 25 16:12:28 2012 UTC

1/* 1/*
2 * libeio API header 2 * libeio API header
3 * 3 *
4 * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libeio@schmorp.de> 4 * Copyright (c) 2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann <libeio@schmorp.de>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without modifica- 7 * Redistribution and use in source and binary forms, with or without modifica-
8 * tion, are permitted provided that the following conditions are met: 8 * tion, are permitted provided that the following conditions are met:
9 * 9 *
168}; 168};
169 169
170/* eio_fallocate flags */ 170/* eio_fallocate flags */
171enum 171enum
172{ 172{
173 EIO_FALLOC_FL_KEEP_SIZE = 1 /* MUST match the value in linux/falloc.h */ 173 /* these MUST match the value in linux/falloc.h */
174 EIO_FALLOC_FL_KEEP_SIZE = 1,
175 EIO_FALLOC_FL_PUNCH_HOLE = 2
174}; 176};
175 177
176/* timestamps and differences - feel free to use double in your code directly */ 178/* timestamps and differences - feel free to use double in your code directly */
177typedef double eio_tstamp; 179typedef double eio_tstamp;
178 180
181{ 183{
182 EIO_CUSTOM, 184 EIO_CUSTOM,
183 EIO_WD_OPEN, EIO_WD_CLOSE, 185 EIO_WD_OPEN, EIO_WD_CLOSE,
184 186
185 EIO_CLOSE, EIO_DUP2, 187 EIO_CLOSE, EIO_DUP2,
186 EIO_READ, EIO_WRITE, 188 EIO_SEEK, EIO_READ, EIO_WRITE,
187 EIO_READAHEAD, EIO_SENDFILE, 189 EIO_READAHEAD, EIO_SENDFILE,
188 EIO_FSTAT, EIO_FSTATVFS, 190 EIO_FSTAT, EIO_FSTATVFS,
189 EIO_FTRUNCATE, EIO_FUTIME, EIO_FCHMOD, EIO_FCHOWN, 191 EIO_FTRUNCATE, EIO_FUTIME, EIO_FCHMOD, EIO_FCHOWN,
190 EIO_SYNC, EIO_FSYNC, EIO_FDATASYNC, EIO_SYNCFS, 192 EIO_SYNC, EIO_FSYNC, EIO_FDATASYNC, EIO_SYNCFS,
191 EIO_MSYNC, EIO_MTOUCH, EIO_SYNC_FILE_RANGE, EIO_FALLOCATE, 193 EIO_MSYNC, EIO_MTOUCH, EIO_SYNC_FILE_RANGE, EIO_FALLOCATE,
210 EIO_LINK, EIO_SYMLINK, EIO_READLINK, 212 EIO_LINK, EIO_SYMLINK, EIO_READLINK,
211 213
212 EIO_REQ_TYPE_NUM 214 EIO_REQ_TYPE_NUM
213}; 215};
214 216
217/* seek whence modes */
218/* these are guaranteed to hasve the traditional 0, 1, 2 values, */
219/* so you might as wlel use those */
220enum
221{
222 EIO_SEEK_SET = 0,
223 EIO_SEEK_CUR = 1,
224 EIO_SEEK_END = 2
225};
226
227
215/* mlockall constants */ 228/* mlockall constants */
216enum 229enum
217{ 230{
218 EIO_MCL_CURRENT = 1, 231 EIO_MCL_CURRENT = 1,
219 EIO_MCL_FUTURE = 2, 232 EIO_MCL_FUTURE = 2
220}; 233};
221 234
222/* request priorities */ 235/* request priorities */
223 236
224enum { 237enum {
225 EIO_PRI_MIN = -4, 238 EIO_PRI_MIN = -4,
226 EIO_PRI_MAX = 4, 239 EIO_PRI_MAX = 4,
227 EIO_PRI_DEFAULT = 0, 240 EIO_PRI_DEFAULT = 0
228}; 241};
229 242
230/* eio request structure */ 243/* eio request structure */
231/* this structure is mostly read-only */ 244/* this structure is mostly read-only */
232/* when initialising it, all members must be zero-initialised */ 245/* when initialising it, all members must be zero-initialised */
244 eio_tstamp nv1; /* utime, futime: atime; busy: sleep time */ 257 eio_tstamp nv1; /* utime, futime: atime; busy: sleep time */
245 eio_tstamp nv2; /* utime, futime: mtime */ 258 eio_tstamp nv2; /* utime, futime: mtime */
246 259
247 int type; /* EIO_xxx constant ETP */ 260 int type; /* EIO_xxx constant ETP */
248 int int1; /* all applicable requests: file descriptor; sendfile: output fd; open, msync, mlockall, readdir: flags */ 261 int int1; /* all applicable requests: file descriptor; sendfile: output fd; open, msync, mlockall, readdir: flags */
249 long int2; /* chown, fchown: uid; sendfile: input fd; open, chmod, mkdir, mknod: file mode, sync_file_range, fallocate: flags */ 262 long int2; /* chown, fchown: uid; sendfile: input fd; open, chmod, mkdir, mknod: file mode, seek: whence, sync_file_range, fallocate: flags */
250 long int3; /* chown, fchown: gid; rename, link: working directory of new name */ 263 long int3; /* chown, fchown: gid; rename, link: working directory of new name */
251 int errorno; /* errno value on syscall return */ 264 int errorno; /* errno value on syscall return */
252 265
253#if __i386 || __amd64 266#if __i386 || __amd64
254 unsigned char cancelled; 267 unsigned char cancelled;
326eio_req *eio_mlockall (int flags, int pri, eio_cb cb, void *data); 339eio_req *eio_mlockall (int flags, int pri, eio_cb cb, void *data);
327eio_req *eio_sync_file_range (int fd, off_t offset, size_t nbytes, unsigned int flags, int pri, eio_cb cb, void *data); 340eio_req *eio_sync_file_range (int fd, off_t offset, size_t nbytes, unsigned int flags, int pri, eio_cb cb, void *data);
328eio_req *eio_fallocate (int fd, int mode, off_t offset, size_t len, int pri, eio_cb cb, void *data); 341eio_req *eio_fallocate (int fd, int mode, off_t offset, size_t len, int pri, eio_cb cb, void *data);
329eio_req *eio_close (int fd, int pri, eio_cb cb, void *data); 342eio_req *eio_close (int fd, int pri, eio_cb cb, void *data);
330eio_req *eio_readahead (int fd, off_t offset, size_t length, int pri, eio_cb cb, void *data); 343eio_req *eio_readahead (int fd, off_t offset, size_t length, int pri, eio_cb cb, void *data);
344eio_req *eio_seek (int fd, off_t offset, int whence, int pri, eio_cb cb, void *data);
331eio_req *eio_read (int fd, void *buf, size_t length, off_t offset, int pri, eio_cb cb, void *data); 345eio_req *eio_read (int fd, void *buf, size_t length, off_t offset, int pri, eio_cb cb, void *data);
332eio_req *eio_write (int fd, void *buf, size_t length, off_t offset, int pri, eio_cb cb, void *data); 346eio_req *eio_write (int fd, void *buf, size_t length, off_t offset, int pri, eio_cb cb, void *data);
333eio_req *eio_fstat (int fd, int pri, eio_cb cb, void *data); /* stat buffer=ptr2 allocated dynamically */ 347eio_req *eio_fstat (int fd, int pri, eio_cb cb, void *data); /* stat buffer=ptr2 allocated dynamically */
334eio_req *eio_fstatvfs (int fd, int pri, eio_cb cb, void *data); /* stat buffer=ptr2 allocated dynamically */ 348eio_req *eio_fstatvfs (int fd, int pri, eio_cb cb, void *data); /* stat buffer=ptr2 allocated dynamically */
335eio_req *eio_futime (int fd, eio_tstamp atime, eio_tstamp mtime, int pri, eio_cb cb, void *data); 349eio_req *eio_futime (int fd, eio_tstamp atime, eio_tstamp mtime, int pri, eio_cb cb, void *data);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines