1 /* Copyright © Coraid, Inc. 2006. All rights reserved. */
13 char buf[128], ctl[13];
16 snprint(buf, sizeof buf, "%s/clone", e);
17 if((efd = open(buf, ORDWR)) == -1)
19 memset(ctl, 0, sizeof ctl);
20 if(read(efd, ctl, sizeof ctl) < 0)
23 snprint(buf, sizeof buf, "connect %d", Etype);
24 if(write(efd, buf, strlen(buf)) != strlen(buf))
26 snprint(buf, sizeof buf, "%s/%d/ctl", e, n);
27 if((cfd = open(buf, ORDWR)) < 0)
29 snprint(buf, sizeof buf, "nonblocking");
30 if(write(cfd, buf, strlen(buf)) != strlen(buf))
32 snprint(buf, sizeof buf, "%s/%d/data", e, n);
33 fd = open(buf, ORDWR);
53 if((r = netopen0(e)) >= 0)
60 /* what if len < netlen? */
62 netget(void *v, int len)
68 fprint(2, "read %d bytes\n", l);
77 netsend(void *v, int len)
83 fprint(2, "sending %d bytes\n", len);
88 return write(fd, p, len);