libowfat/buffer/buffer_mmapread.c

16 lines
275 B
C
Raw Normal View History

2016-03-17 11:13:23 +00:00
#include "buffer.h"
2005-01-04 22:38:00 +00:00
#include <mmap.h>
2006-11-07 17:56:05 +00:00
static ssize_t op() {
2005-01-04 22:38:00 +00:00
return 0;
}
int buffer_mmapread(buffer* b,const char* filename) {
if (!(b->x=(char*)mmap_read(filename,&b->n))) return -1;
2005-01-04 22:38:00 +00:00
b->p=0; b->a=b->n;
b->fd=-1;
b->op=op;
2014-03-14 19:42:54 +00:00
b->deinit=buffer_munmap;
2005-01-04 22:38:00 +00:00
return 0;
}