Lines Matching refs:pagesize

100   size_t pagesize = sysconf(_SC_PAGESIZE);  in TEST()  local
104 ASSERT_NE(-1, lseek(tf.fd, pagesize, SEEK_SET)); in TEST()
106 ASSERT_NE(-1, lseek(tf.fd, 2 * pagesize, SEEK_SET)); in TEST()
108 ASSERT_NE(-1, lseek(tf.fd, 3 * pagesize - sizeof(END_MSG), SEEK_SET)); in TEST()
113 void* map = mmap(nullptr, pagesize, PROT_READ, MAP_SHARED, tf.fd, pagesize); in TEST()
119 ASSERT_EQ(0, munmap(map, pagesize)); in TEST()
121 map = mmap(nullptr, pagesize, PROT_READ, MAP_SHARED, tf.fd, 2 * pagesize); in TEST()
126 ASSERT_STREQ(END_MSG, data+pagesize-sizeof(END_MSG)); in TEST()
128 ASSERT_EQ(0, munmap(map, pagesize)); in TEST()
136 size_t pagesize = sysconf(_SC_PAGESIZE); in TEST() local
140 ASSERT_NE(-1, lseek(tf.fd, pagesize, SEEK_SET)); in TEST()
142 ASSERT_NE(-1, lseek(tf.fd, 2 * pagesize, SEEK_SET)); in TEST()
144 ASSERT_NE(-1, lseek(tf.fd, 3 * pagesize - sizeof(END_MSG), SEEK_SET)); in TEST()
149 void* map = mmap(nullptr, pagesize, PROT_WRITE, MAP_SHARED, tf.fd, pagesize); in TEST()
154 ASSERT_EQ(0, munmap(map, pagesize)); in TEST()
157 map = mmap(nullptr, pagesize, PROT_WRITE, MAP_SHARED, tf.fd, 2 * pagesize); in TEST()
162 ASSERT_EQ(0, munmap(map, pagesize)); in TEST()
165 char buf[pagesize]; in TEST()
166 ASSERT_EQ(static_cast<ssize_t>(pagesize), read(tf.fd, buf, pagesize)); in TEST()
168 ASSERT_NE(-1, lseek(tf.fd, pagesize, SEEK_SET)); in TEST()
169 ASSERT_EQ(static_cast<ssize_t>(pagesize), read(tf.fd, buf, pagesize)); in TEST()
171 ASSERT_NE(-1, lseek(tf.fd, 2 * pagesize, SEEK_SET)); in TEST()
172 ASSERT_EQ(static_cast<ssize_t>(pagesize), read(tf.fd, buf, pagesize)); in TEST()
174 ASSERT_STREQ(END_MSG, buf+pagesize-sizeof(END_MSG)); in TEST()
179 size_t pagesize = sysconf(_SC_PAGESIZE); in TEST() local
180 char buf[pagesize]; in TEST()
183 ASSERT_EQ(static_cast<ssize_t>(pagesize), write(tempfile.fd, buf, pagesize)); in TEST()
184 void* map = mmap(nullptr, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, tempfile.fd, 0); in TEST()
188 ASSERT_EQ(0, posix_madvise(map, pagesize, POSIX_MADV_NORMAL)); in TEST()
189 ASSERT_EQ(0, posix_madvise(map, pagesize, POSIX_MADV_SEQUENTIAL)); in TEST()
190 ASSERT_EQ(0, posix_madvise(map, pagesize, POSIX_MADV_RANDOM)); in TEST()
191 ASSERT_EQ(0, posix_madvise(map, pagesize, POSIX_MADV_WILLNEED)); in TEST()
193 ASSERT_EQ(0, munmap(map, pagesize)); in TEST()
200 size_t pagesize = sysconf(_SC_PAGESIZE); in TEST() local
202 void* map = mmap(nullptr, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in TEST()
206 for (int i = 0; i < static_cast<int>(pagesize / sizeof(int)); ++i) { in TEST()
210 ASSERT_EQ(0, posix_madvise(map, pagesize, POSIX_MADV_DONTNEED)); in TEST()
213 for (int i = 0; i < static_cast<int>(pagesize / sizeof(int)); ++i) { in TEST()
217 ASSERT_EQ(0, munmap(map, pagesize)); in TEST()