Home | History | Annotate | Download | only in tests

Lines Matching full:pagesize

99   size_t pagesize = sysconf(_SC_PAGESIZE);
103 ASSERT_NE(-1, lseek(tf.fd, pagesize, SEEK_SET));
105 ASSERT_NE(-1, lseek(tf.fd, 2 * pagesize, SEEK_SET));
107 ASSERT_NE(-1, lseek(tf.fd, 3 * pagesize - sizeof(END_MSG), SEEK_SET));
112 void* map = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, tf.fd, pagesize);
118 ASSERT_EQ(0, munmap(map, pagesize));
120 map = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, tf.fd, 2 * pagesize);
125 ASSERT_STREQ(END_MSG, data+pagesize-sizeof(END_MSG));
127 ASSERT_EQ(0, munmap(map, pagesize));
135 size_t pagesize = sysconf(_SC_PAGESIZE);
139 ASSERT_NE(-1, lseek(tf.fd, pagesize, SEEK_SET));
141 ASSERT_NE(-1, lseek(tf.fd, 2 * pagesize, SEEK_SET));
143 ASSERT_NE(-1, lseek(tf.fd, 3 * pagesize - sizeof(END_MSG), SEEK_SET));
148 void* map = mmap(NULL, pagesize, PROT_WRITE, MAP_SHARED, tf.fd, pagesize);
153 ASSERT_EQ(0, munmap(map, pagesize));
156 map = mmap(NULL, pagesize, PROT_WRITE, MAP_SHARED, tf.fd, 2 * pagesize);
161 ASSERT_EQ(0, munmap(map, pagesize));
164 char buf[pagesize];
165 ASSERT_EQ(static_cast<ssize_t>(pagesize), read(tf.fd, buf, pagesize));
167 ASSERT_NE(-1, lseek(tf.fd, pagesize, SEEK_SET));
168 ASSERT_EQ(static_cast<ssize_t>(pagesize), read(tf.fd, buf, pagesize));
170 ASSERT_NE(-1, lseek(tf.fd, 2 * pagesize, SEEK_SET));
171 ASSERT_EQ(static_cast<ssize_t>(pagesize), read(tf.fd, buf, pagesize));
173 ASSERT_STREQ(END_MSG, buf+pagesize-sizeof(END_MSG));
178 size_t pagesize = sysconf(_SC_PAGESIZE);
179 char buf[pagesize];
182 ASSERT_EQ(static_cast<ssize_t>(pagesize), write(tempfile.fd, buf, pagesize));
183 void* map = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, tempfile.fd, 0);
187 ASSERT_EQ(0, posix_madvise(map, pagesize, POSIX_MADV_NORMAL));
188 ASSERT_EQ(0, posix_madvise(map, pagesize, POSIX_MADV_SEQUENTIAL));
189 ASSERT_EQ(0, posix_madvise(map, pagesize, POSIX_MADV_RANDOM));
190 ASSERT_EQ(0, posix_madvise(map, pagesize, POSIX_MADV_WILLNEED));
192 ASSERT_EQ(0, munmap(map, pagesize));
199 size_t pagesize = sysconf(_SC_PAGESIZE);
201 void* map = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
205 for (int i = 0; i < static_cast<int>(pagesize / sizeof(int)); ++i) {
209 ASSERT_EQ(0, posix_madvise(map, pagesize, POSIX_MADV_DONTNEED));
212 for (int i = 0; i < static_cast<int>(pagesize / sizeof(int)); ++i) {
216 ASSERT_EQ(0, munmap(map, pagesize));