GRASS Programmer's Manual  6.4.2(2012)
pageout.c
Go to the documentation of this file.
00001 
00015 #include <stdio.h>
00016 #include <unistd.h>
00017 #include <string.h>
00018 #include <errno.h>
00019 #include <grass/segment.h>
00020 
00021 
00036 int segment_pageout(SEGMENT * SEG, int i)
00037 {
00038     segment_seek(SEG, SEG->scb[i].n, 0);
00039     if (write(SEG->fd, SEG->scb[i].buf, SEG->size) != SEG->size) {
00040         G_warning("segment_pageout: %s", strerror(errno));
00041         return -1;
00042     }
00043     SEG->scb[i].dirty = 0;
00044 
00045     return 1;
00046 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines