Lines Matching refs:fd
41 int fd;
50 if ((fd = open(filename, O_RDWR)) < 0) {
59 rc = ioctl(fd, LOOP_GET_STATUS64, &li);
60 close(fd);
83 int fd;
94 if ((fd = open(filename, O_RDWR)) < 0) {
103 rc = ioctl(fd, LOOP_GET_STATUS64, &li);
104 close(fd);
129 int fd;
151 if ((fd = open(filename, O_RDWR)) < 0) {
156 rc = ioctl(fd, LOOP_GET_STATUS64, &li);
160 close(fd);
181 close(fd);
185 if (ioctl(fd, LOOP_SET_FD, file_fd) < 0) {
188 close(fd);
198 if (ioctl(fd, LOOP_SET_STATUS64, &li) < 0) {
201 close(fd);
205 close(fd);
236 int fd;
238 if ((fd = creat(file, 0600)) < 0) {
243 if (ftruncate(fd, numSectors * 512) < 0) {
245 close(fd);
248 close(fd);
253 int fd;
256 if ((fd = open(loopDevice, O_RDONLY)) < 0) {
262 if (ioctl(fd, BLKGETSIZE, nr_sec)) {
265 close(fd);
273 if (lseek(fd, ((*nr_sec - 1) * 512), SEEK_SET) < 0) {
275 close(fd);
279 if (read(fd, &buffer, sizeof(struct asec_superblock)) != sizeof(struct asec_superblock)) {
281 close(fd);
285 close(fd);