GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 }
int segment_seek(const SEGMENT *SEG, int n, int index)
Definition: segment/seek.c:37
int segment_pageout(SEGMENT *SEG, int i)
Pages segment to disk.
Definition: pageout.c:36
G_warning("category support for [%s] in mapset [%s] %s", name, mapset, type)
int errno