Lines Matching +full:- +full:sv

35 #include <atf-c.h>
55 #define DTFS_DUMP "-o","dump"
69 if (ssz == -1) { in xread()
72 left -= ssz; in xread()
88 if (ssz == -1) { in xwrite()
91 left -= ssz; in xwrite()
111 comfd = args->pta_servfd; in readshovel()
112 puffsfd = args->pta_rumpfd; in readshovel()
126 assert(phdr->pth_framelen < BUFSIZE); in readshovel()
128 phdr->pth_framelen - sizeof(*phdr)); in readshovel()
135 if (PUFFSOP_OPCLASS(preq->preq_opclass) == PUFFSOP_VFS) { in readshovel()
136 assert(preq->preq_optype < PUFFS_VFS_MAX); in readshovel()
137 args->pta_vfs_toserv_ops[preq->preq_optype]++; in readshovel()
138 } else if (PUFFSOP_OPCLASS(preq->preq_opclass) == PUFFSOP_VN) { in readshovel()
139 assert(preq->preq_optype < PUFFS_VN_MAX); in readshovel()
140 args->pta_vn_toserv_ops[preq->preq_optype]++; in readshovel()
143 n = phdr->pth_framelen; in readshovel()
168 comfd = args->pta_servfd; in writeshovel()
169 puffsfd = args->pta_rumpfd; in writeshovel()
193 toread = phdr->pth_framelen - off; in writeshovel()
195 toread = off - sizeof(struct putter_hdr); in writeshovel()
199 PUFFSOP_OPCLASS(preq->preq_opclass) == PUFFSOP_VFS in writeshovel()
200 && preq->preq_optype == PUFFS_VFS_UNMOUNT)) { in writeshovel()
201 if (preq->preq_rv == 0) in writeshovel()
205 n = rump_sys_write(puffsfd, buf, phdr->pth_framelen); in writeshovel()
206 if ((size_t)n != phdr->pth_framelen) { in writeshovel()
224 if ((rv = rump_init()) == -1) in rumpshovels()
227 if (pthread_create(&pt, NULL, readshovel, args) == -1) in rumpshovels()
231 if (pthread_create(&pt, NULL, writeshovel, args) == -1) in rumpshovels()
240 atf_tc_fail("child died"); /* almost signal-safe */ in childfail()
254 int sv[2]; in donewfs() local
266 pflags = &args->pta_pflags; in donewfs()
269 if (socketpair(PF_LOCAL, SOCK_STREAM, 0, sv) == -1) in donewfs()
276 close(sv[1]); in donewfs()
277 snprintf(comfd, sizeof(sv[0]), "%d", sv[0]); in donewfs()
278 if (setenv("PUFFS_COMFD", comfd, 1) == -1) in donewfs()
283 case -1: in donewfs()
286 close(sv[0]); in donewfs()
291 if ((n = xread(sv[1], &len, sizeof(len))) != sizeof(len)) in donewfs()
295 if ((size_t)xread(sv[1], args->pta_dir, len) != len) in donewfs()
297 if (xread(sv[1], &len, sizeof(len)) != sizeof(len)) in donewfs()
301 if ((size_t)xread(sv[1], args->pta_dev, len) != len) in donewfs()
303 if (xread(sv[1], &mntflags, sizeof(mntflags)) != sizeof(mntflags)) in donewfs()
305 if (xread(sv[1], &args->pta_pargslen, sizeof(args->pta_pargslen)) in donewfs()
306 != sizeof(args->pta_pargslen)) in donewfs()
308 args->pta_pargs = malloc(args->pta_pargslen); in donewfs()
309 if (args->pta_pargs == NULL) in donewfs()
311 if (xread(sv[1], args->pta_pargs, args->pta_pargslen) in donewfs()
312 != (ssize_t)args->pta_pargslen) in donewfs()
314 if (xread(sv[1], pflags, sizeof(*pflags)) != sizeof(*pflags)) in donewfs()
317 args->pta_childpid = childpid; in donewfs()
318 args->pta_servfd = sv[1]; in donewfs()
319 strlcpy(args->pta_dev, image, sizeof(args->pta_dev)); in donewfs()
343 dtfsargv[1] = __UNCONST("-i"); in puffs_fstest_newfs()
344 dtfsargv[2] = __UNCONST("-s"); in puffs_fstest_newfs()
365 if (mkdir("p2kffsfake", 0777) == -1 && errno != EEXIST) in p2k_ffs_fstest_newfs()
387 if (fd == -1) in puffs_fstest_mount()
390 if (rump_sys_mkdir(path, 0777) == -1) in puffs_fstest_mount()
391 return -1; in puffs_fstest_mount()
394 pargs->pta_pargs, pargs->pta_pargslen) == -1) { in puffs_fstest_mount()
396 kill(pargs->pta_childpid, SIGKILL); in puffs_fstest_mount()
397 return -1; in puffs_fstest_mount()
400 pargs->pta_rumpfd = fd; in puffs_fstest_mount()
439 if (waitpid(pargs->pta_childpid, &status, WNOHANG) > 0) in puffs_fstest_unmount()
441 kill(pargs->pta_childpid, SIGTERM); in puffs_fstest_unmount()
443 if (waitpid(pargs->pta_childpid, &status, WNOHANG) > 0) in puffs_fstest_unmount()
445 kill(pargs->pta_childpid, SIGKILL); in puffs_fstest_unmount()