Lines Matching defs: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));