7#include "tests/userprog/sample.inc"
20 CHECK ((handle =
open (
"sample.txt")) > 1,
"open \"sample.txt\"");
24 fail (
"write() returned %d instead of %zu",
byte_cnt,
sizeof sample - 1);
static size_t byte_cnt(size_t bit_cnt)
Returns the number of bytes required for BIT_CNT bits.
char * copy_string_across_boundary(const char *src)
Returns a copy of SRC split across the boundary between two pages.
int open(const char *file)
int write(int fd, const void *buffer, unsigned size)
void fail(const char *format,...)
#define CHECK(SUCCESS,...)
Takes an expression to test for SUCCESS and a message, which may include printf-style arguments.
void test_main(void)
Writes data spanning two pages in virtual address space, which must succeed.