Lines Matching refs:fd
60 int fd; in prereq() local
62 fd = open("/proc/sys/vm/compact_unevictable_allowed", in prereq()
64 if (fd < 0) { in prereq()
70 if (read(fd, &allowed, sizeof(char)) != sizeof(char)) { in prereq()
73 close(fd); in prereq()
77 close(fd); in prereq()
86 int fd; in check_compaction() local
95 fd = open("/proc/sys/vm/nr_hugepages", O_RDWR | O_NONBLOCK); in check_compaction()
96 if (fd < 0) { in check_compaction()
101 if (read(fd, initial_nr_hugepages, sizeof(initial_nr_hugepages)) <= 0) { in check_compaction()
107 if (write(fd, "0", sizeof(char)) != sizeof(char)) { in check_compaction()
112 lseek(fd, 0, SEEK_SET); in check_compaction()
116 if (write(fd, "100000", (6*sizeof(char))) != (6*sizeof(char))) { in check_compaction()
121 lseek(fd, 0, SEEK_SET); in check_compaction()
123 if (read(fd, nr_hugepages, sizeof(nr_hugepages)) <= 0) { in check_compaction()
143 lseek(fd, 0, SEEK_SET); in check_compaction()
145 if (write(fd, initial_nr_hugepages, strlen(initial_nr_hugepages)) in check_compaction()
151 close(fd); in check_compaction()
155 close(fd); in check_compaction()