8 displaypic(Picture *pic)
16 fprint(2, "pipe failed: %r\n");
19 switch(rfork(RFPROC|RFFDG|RFNOTEG|RFNOWAIT)){
21 fprint(2, "fork failed: %r\n");
28 execl("/bin/page", "page", "-w", nil);
29 fprint(2, "exec failed: %r\n");
34 fprint(p[1], "%11s %11d %11d %11d %11d ",
35 "k8", pic->minx, pic->miny, pic->maxx, pic->maxy);
36 n = (pic->maxx-pic->minx)*(pic->maxy-pic->miny);
37 /* release the memory as we hand it off; this could be a big piece of data */
40 i = 8192 - (((uintptr)a)&8191);
43 if(write(p[1], a, i)!=i)
44 fprint(2, "write error: %r\n");
45 if(i == 8192) /* page aligned */
58 displayimage(Image *im)
63 fprint(2, "pipe failed: %r\n");
66 switch(rfork(RFPROC|RFFDG|RFNOTEG|RFNOWAIT)){
68 fprint(2, "fork failed: %r\n");
75 execl("/bin/page", "page", "-w", nil);
76 fprint(2, "exec failed: %r\n");
81 writeimage(p[1], im, 0);