File: buffer_mmapread.c

package info (click to toggle)
libowfat 0.27-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,412 kB
  • ctags: 1,147
  • sloc: ansic: 12,294; makefile: 42
file content (15 lines) | stat: -rw-r--r-- 259 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <buffer.h>
#include <mmap.h>

static ssize_t op() {
  return 0;
}

int buffer_mmapread(buffer* b,const char* filename) {
  if (!(b->x=mmap_read(filename,&b->n))) return -1;
  b->p=0; b->a=b->n;
  b->fd=-1;
  b->op=op;
  b->todo=MUNMAP;
  return 0;
}