GRASS Programmer's Manual  6.4.3(2013)-r
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
pageout.c
Go to the documentation of this file.
1 
15 #include <stdio.h>
16 #include <unistd.h>
17 #include <string.h>
18 #include <errno.h>
19 #include <grass/segment.h>
20 
21 
36 int segment_pageout(SEGMENT * SEG, int i)
37 {
38  segment_seek(SEG, SEG->scb[i].n, 0);
39  if (write(SEG->fd, SEG->scb[i].buf, SEG->size) != SEG->size) {
40  G_warning("segment_pageout: %s", strerror(errno));
41  return -1;
42  }
43  SEG->scb[i].dirty = 0;
44 
45  return 1;
46 }