mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
This is not needed, neither encouraged. Configure already checks _FILE_OFFSET_BITS and appends it when needed, so that the right functions are used. Also remove the usage of loff_t and O_LARGEFILE for the same reason. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Cc: George Dunlap <george.dunlap@eu.citrix.com> Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> Cc: Olaf Hering <olaf@aepfle.de> Acked-by: Wei Liu <wei.liu2@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
19 lines
506 B
C
19 lines
506 B
C
#define MREAD_MAPS 8
|
|
#define MREAD_BUF_SHIFT 9
|
|
#define PAGE_SHIFT 12
|
|
#define MREAD_BUF_SIZE (1ULL<<(PAGE_SHIFT+MREAD_BUF_SHIFT))
|
|
#define MREAD_BUF_MASK (~(MREAD_BUF_SIZE-1))
|
|
typedef struct mread_ctrl {
|
|
int fd;
|
|
off_t file_size;
|
|
struct mread_buffer {
|
|
char * buffer;
|
|
off_t start_offset;
|
|
int accessed;
|
|
} map[MREAD_MAPS];
|
|
int clock, last;
|
|
} *mread_handle_t;
|
|
|
|
mread_handle_t mread_init(int fd);
|
|
ssize_t mread64(mread_handle_t h, void *dst, ssize_t len, off_t offset);
|