tar: use utime() to restore timestamps
[minix.git] / include / minix / bdev.h
blobdce412a4ca0c5f9a7b79fc3b487b387f0e739d4a
1 #ifndef _MINIX_BDEV_H
2 #define _MINIX_BDEV_H
4 /* Common API. */
5 extern void bdev_driver(dev_t dev, char *label);
7 /* Synchronous API. */
8 extern int bdev_open(dev_t dev, int access);
9 extern int bdev_close(dev_t dev);
11 extern ssize_t bdev_read(dev_t dev, u64_t pos, char *buf, size_t count,
12 int flags);
13 extern ssize_t bdev_write(dev_t dev, u64_t pos, char *buf, size_t count,
14 int flags);
15 extern ssize_t bdev_gather(dev_t dev, u64_t pos, iovec_t *vec, int count,
16 int flags);
17 extern ssize_t bdev_scatter(dev_t dev, u64_t pos, iovec_t *vec, int count,
18 int flags);
19 extern int bdev_ioctl(dev_t dev, int request, void *buf);
21 /* Asynchronous API. */
22 typedef int bdev_id_t;
23 typedef void *bdev_param_t;
25 typedef void (*bdev_callback_t)(dev_t dev, bdev_id_t id, bdev_param_t param,
26 int result);
28 extern void bdev_flush_asyn(dev_t dev);
30 extern bdev_id_t bdev_read_asyn(dev_t dev, u64_t pos, char *buf, size_t count,
31 int flags, bdev_callback_t callback, bdev_param_t param);
32 extern bdev_id_t bdev_write_asyn(dev_t dev, u64_t pos, char *buf, size_t count,
33 int flags, bdev_callback_t callback, bdev_param_t param);
34 extern bdev_id_t bdev_gather_asyn(dev_t dev, u64_t pos, iovec_t *vec,
35 int count, int flags, bdev_callback_t callback, bdev_param_t param);
36 extern bdev_id_t bdev_scatter_asyn(dev_t dev, u64_t pos, iovec_t *vec,
37 int count, int flags, bdev_callback_t callback, bdev_param_t param);
38 extern bdev_id_t bdev_ioctl_asyn(dev_t dev, int request, void *buf,
39 bdev_callback_t callback, bdev_param_t param);
41 extern int bdev_wait_asyn(bdev_id_t id);
43 extern void bdev_reply_asyn(message *m);
45 #endif /* _MINIX_BDEV_H */