Lines Matching refs:fd
56 int fd; in prereq() local
58 fd = open("/proc/sys/vm/compact_unevictable_allowed", in prereq()
60 if (fd < 0) { in prereq()
66 if (read(fd, &allowed, sizeof(char)) != sizeof(char)) { in prereq()
69 close(fd); in prereq()
73 close(fd); in prereq()
82 int fd; in check_compaction() local
91 fd = open("/proc/sys/vm/nr_hugepages", O_RDWR | O_NONBLOCK); in check_compaction()
92 if (fd < 0) { in check_compaction()
97 if (read(fd, initial_nr_hugepages, sizeof(initial_nr_hugepages)) <= 0) { in check_compaction()
103 if (write(fd, "0", sizeof(char)) != sizeof(char)) { in check_compaction()
108 lseek(fd, 0, SEEK_SET); in check_compaction()
112 if (write(fd, "100000", (6*sizeof(char))) != (6*sizeof(char))) { in check_compaction()
117 lseek(fd, 0, SEEK_SET); in check_compaction()
119 if (read(fd, nr_hugepages, sizeof(nr_hugepages)) <= 0) { in check_compaction()
139 if (write(fd, initial_nr_hugepages, sizeof(initial_nr_hugepages)) in check_compaction()
145 close(fd); in check_compaction()
149 close(fd); in check_compaction()