1: #ifndef lint
   2: static char sccsid[] = "@(#)freeze.c	4.2 8/11/83";
   3: #endif
   4: 
   5: #include "stdio.h"
   6: freeze(s) char *s;
   7: {   int fd;
   8:     unsigned int *len;
   9:     len = (unsigned int *)sbrk(0);
  10:     if((fd = creat(s, 0666)) < 0) {
  11:         perror(s);
  12:         return(1);
  13:     }
  14:     write(fd, &len, sizeof(len));
  15:     write(fd, (char *)0, len);
  16:     close(fd);
  17:     return(0);
  18: }
  19: 
  20: thaw(s) char *s;
  21: {   int fd;
  22:     unsigned int *len;
  23:     if(*s == 0) {
  24:         fprintf(stderr, "empty restore file\n");
  25:         return(1);
  26:     }
  27:     if((fd = open(s, 0)) < 0) {
  28:         perror(s);
  29:         return(1);
  30:     }
  31:     read(fd, &len, sizeof(len));
  32:     (void) brk(len);
  33:     read(fd, (char *)0, len);
  34:     close(fd);
  35:     return(0);
  36: }

Defined functions

freeze defined in line 6; used 1 times
thaw defined in line 20; used 1 times

Defined variables

sccsid defined in line 2; never used
Last modified: 1983-08-12
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 827
Valid CSS Valid XHTML 1.0 Strict