Lines Matching refs:fd
16 int fd; in set_immutable() local
20 fd = open(path, O_RDONLY); in set_immutable()
21 if (fd < 0) in set_immutable()
22 return fd; in set_immutable()
24 rc = ioctl(fd, FS_IOC_GETFLAGS, &flags); in set_immutable()
27 close(fd); in set_immutable()
37 rc = ioctl(fd, FS_IOC_SETFLAGS, &flags); in set_immutable()
39 close(fd); in set_immutable()
47 int fd; in get_immutable() local
51 fd = open(path, O_RDONLY); in get_immutable()
52 if (fd < 0) in get_immutable()
53 return fd; in get_immutable()
55 rc = ioctl(fd, FS_IOC_GETFLAGS, &flags); in get_immutable()
58 close(fd); in get_immutable()
62 close(fd); in get_immutable()
72 int fd, rc; in main() local
89 fd = open(path, O_WRONLY | O_CREAT, 0600); in main()
90 if (fd < 0) { in main()
95 rc = write(fd, buf, sizeof(buf)); in main()
101 close(fd); in main()
115 fd = open(path, O_RDONLY); in main()
116 if (fd < 0) { in main()
126 rc = read(fd, buf, sizeof(buf)); in main()