8 displaypic(Picture *pic)
16 fprint(2, "pipe failed: %r\n");
19 switch(rfork(RFPROC|RFFDG)){
21 fprint(2, "fork failed: %r\n");
28 /* execl("/bin/page", "page", "-w", 0); */
29 execlp("img", "img", 0);
30 fprint(2, "exec failed: %r\n");
35 fprint(p[1], "%11s %11d %11d %11d %11d ",
36 "k8", pic->minx, pic->miny, pic->maxx, pic->maxy);
37 n = (pic->maxx-pic->minx)*(pic->maxy-pic->miny);
38 /* release the memory as we hand it off; this could be a big piece of data */
41 i = 8192 - (((int)a)&8191);
44 if(write(p[1], a, i)!=i)
45 fprint(2, "write error: %r\n");
46 /* if(i == 8192) /* page aligned */ */
59 displayimage(Image *im)
64 fprint(2, "pipe failed: %r\n");
67 switch(rfork(RFPROC|RFFDG)){
69 fprint(2, "fork failed: %r\n");
76 execlp("img", "img", 0);
77 /* execl("/bin/page", "page", "-w", 0); */
78 fprint(2, "exec failed: %r\n");
83 writeimage(p[1], im, 0);