--- cvsroot/libeio/eio.h 2013/04/14 09:43:19 1.53 +++ cvsroot/libeio/eio.h 2017/06/23 03:10:19 1.58 @@ -1,7 +1,7 @@ /* * libeio API header * - * Copyright (c) 2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann + * Copyright (c) 2007,2008,2009,2010,2011,2012,2015,2016 Marc Alexander Lehmann * All rights reserved. * * Redistribution and use in source and binary forms, with or without modifica- @@ -171,8 +171,19 @@ enum { /* these MUST match the value in linux/falloc.h */ - EIO_FALLOC_FL_KEEP_SIZE = 1, - EIO_FALLOC_FL_PUNCH_HOLE = 2 + EIO_FALLOC_FL_KEEP_SIZE = 0x01, + EIO_FALLOC_FL_PUNCH_HOLE = 0x02, + EIO_FALLOC_FL_COLLAPSE_RANGE = 0x08, + EIO_FALLOC_FL_ZERO_RANGE = 0x10 +}; + +/* eio_rename flags */ +enum +{ + /* these MUST match the value in linux/fs.h */ + EIO_RENAME_NOREPLACE = 1 << 0, + EIO_RENAME_EXCHANGE = 1 << 1, + EIO_RENAME_WHITEOUT = 1 << 2 }; /* timestamps and differences - feel free to use double in your code directly */ @@ -185,7 +196,7 @@ EIO_WD_OPEN, EIO_WD_CLOSE, EIO_CLOSE, EIO_DUP2, - EIO_SEEK, EIO_READ, EIO_WRITE, + EIO_SEEK, EIO_READ, EIO_WRITE, EIO_FCNTL, EIO_IOCTL, EIO_READAHEAD, EIO_SENDFILE, EIO_FSTAT, EIO_FSTATVFS, EIO_FTRUNCATE, EIO_FUTIME, EIO_FCHMOD, EIO_FCHOWN, @@ -251,27 +262,26 @@ eio_ssize_t result; /* result of syscall, e.g. result = read (... */ off_t offs; /* read, write, truncate, readahead, sync_file_range, fallocate: file offset, mknod: dev_t */ size_t size; /* read, write, readahead, sendfile, msync, mlock, sync_file_range, fallocate: length */ - void *ptr1; /* all applicable requests: pathname, old name; readdir: optional eio_dirents */ + void *ptr1; /* all applicable requests: pathname, old name, readdir: optional eio_dirents */ void *ptr2; /* all applicable requests: new name or memory buffer; readdir: name strings */ eio_tstamp nv1; /* utime, futime: atime; busy: sleep time */ eio_tstamp nv2; /* utime, futime: mtime */ int int1; /* all applicable requests: file descriptor; sendfile: output fd; open, msync, mlockall, readdir: flags */ - long int2; /* chown, fchown: uid; sendfile: input fd; open, chmod, mkdir, mknod: file mode, seek: whence, sync_file_range, fallocate: flags */ + long int2; /* chown, fchown: uid; sendfile: input fd; open, chmod, mkdir, mknod: file mode, seek: whence, fcntl, ioctl: request, sync_file_range, fallocate, rename: flags */ long int3; /* chown, fchown: gid; rename, link: working directory of new name */ int errorno; /* errno value on syscall return */ - signed char type;/* EIO_xxx constant ETP */ + unsigned char flags; /* private */ + signed char type;/* EIO_xxx constant ETP */ + signed char pri; /* the priority ETP */ #if __i386 || __amd64 unsigned char cancelled; /* ETP */ #else sig_atomic_t cancelled; /* ETP */ #endif - unsigned char flags; /* private */ - signed char pri; /* the priority */ - void *data; eio_cb finish; void (*destroy)(eio_req *req); /* called when request no longer needed */ @@ -286,7 +296,6 @@ enum { EIO_FLAG_PTR1_FREE = 0x01, /* need to free(ptr1) */ EIO_FLAG_PTR2_FREE = 0x02, /* need to free(ptr2) */ - EIO_FLAG_GROUPADD = 0x04 /* some request was added to the group */ }; /* undocumented/unsupported/private helper */ @@ -344,6 +353,8 @@ eio_req *eio_seek (int fd, off_t offset, int whence, int pri, eio_cb cb, void *data); eio_req *eio_read (int fd, void *buf, size_t length, off_t offset, int pri, eio_cb cb, void *data); eio_req *eio_write (int fd, void *buf, size_t length, off_t offset, int pri, eio_cb cb, void *data); +eio_req *eio_fcntl (int fd, int cmd, void *arg, int pri, eio_cb cb, void *data); +eio_req *eio_ioctl (int fd, unsigned long request, void *buf, int pri, eio_cb cb, void *data); eio_req *eio_fstat (int fd, int pri, eio_cb cb, void *data); /* stat buffer=ptr2 allocated dynamically */ eio_req *eio_fstatvfs (int fd, int pri, eio_cb cb, void *data); /* stat buffer=ptr2 allocated dynamically */ eio_req *eio_futime (int fd, eio_tstamp atime, eio_tstamp mtime, int pri, eio_cb cb, void *data);