GRASS GIS 7 Programmer's Manual  7.0.4(2016)-r00000
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/gis.h>
20 #include "local_proto.h"
21 
22 
37 int seg_pageout(SEGMENT * SEG, int i)
38 {
39  SEG->seek(SEG, SEG->scb[i].n, 0);
40  errno = 0;
41  if (write(SEG->fd, SEG->scb[i].buf, SEG->size) != SEG->size) {
42  int err = errno;
43 
44  if (err)
45  G_warning("Segment pageout: %s", strerror(err));
46  else
47  G_warning("Segment pageout: insufficient disk space?");
48  return -1;
49  }
50  SEG->scb[i].dirty = 0;
51 
52  return 1;
53 }
SYMBOL * err(FILE *fp, SYMBOL *s, char *msg)
Definition: symbol/read.c:220
int seg_pageout(SEGMENT *SEG, int i)
Internal use only.
Definition: pageout.c:37
void G_warning(const char *msg,...)
Print a warning message to stderr.
Definition: gis/error.c:203