Home | History | Annotate | Download | only in other

Lines Matching defs:file

13     usage: losetup [-cdrs] [-o OFFSET] [-S SIZE] {-d DEVICE...|-j FILE|-af|{DEVICE FILE}}
15 Associate a loopback device with a file, or show current file (if any)
21 -j Iterate through all loopback devices associated with FILE
24 -c Check capacity (file size changed)
29 -o Start assocation at OFFSET into FILE
49 todo: basic /dev file association
50 associate DEV FILE
61 static void loopback_setup(char *device, char *file)
67 // Open file (ffd) and loop device (lfd)
69 if (file) ffd = xopen(file, TT.openflags);
90 if (errno != ENXIO || !file) {
100 // Check size of file or delete existing association
107 // Associate file with this device?
108 } else if (file) {
109 char *s = xabspath(file, 1);
111 if (!s) perror_exit("file"); // already opened, but if deleted since...
112 if (ioctl(lfd, LOOP_SET_FD, ffd)) perror_exit("%s=%s", device, file);
117 if (ioctl(lfd, LOOP_SET_STATUS64, loop)) perror_exit("%s=%s", device, file);
130 if (file) close(ffd);
168 // new association: S size o offset rs - need a file
171 // -f(dc FILE)
181 char *file = (toys.optflags & (FLAG_d|FLAG_c)) ? NULL : toys.optargs[1];
183 if (!toys.optc || (file && toys.optc != 2)) {
185 perror_exit("needs %d arg%s", 1+!!file, file ? "s" : "");
188 loopback_setup(*s, file);
189 if (file) break;