Lines Matching refs:fd
15 int fd; in set_immutable() local
19 fd = open(path, O_RDONLY); in set_immutable()
20 if (fd < 0) in set_immutable()
21 return fd; in set_immutable()
23 rc = ioctl(fd, FS_IOC_GETFLAGS, &flags); in set_immutable()
26 close(fd); in set_immutable()
36 rc = ioctl(fd, FS_IOC_SETFLAGS, &flags); in set_immutable()
38 close(fd); in set_immutable()
46 int fd; in get_immutable() local
50 fd = open(path, O_RDONLY); in get_immutable()
51 if (fd < 0) in get_immutable()
52 return fd; in get_immutable()
54 rc = ioctl(fd, FS_IOC_GETFLAGS, &flags); in get_immutable()
57 close(fd); in get_immutable()
61 close(fd); in get_immutable()
71 int fd, rc; in main() local
88 fd = open(path, O_WRONLY | O_CREAT, 0600); in main()
89 if (fd < 0) { in main()
94 rc = write(fd, buf, sizeof(buf)); in main()
100 close(fd); in main()
114 fd = open(path, O_RDONLY); in main()
115 if (fd < 0) { in main()
125 rc = read(fd, buf, sizeof(buf)); in main()