| CS318 - Pintos
    Pintos source browser for JHU CS318 course | 
 
 
 
Go to the documentation of this file.
   22 main (
int argc, 
const char *argv[]) 
 
   30   CHECK (argc == 2, 
"argc must be 2, actually %d", argc);
 
   31   child_idx = 
atoi (argv[1]);
 
   38   while (ofs < 
sizeof buf2)
 
   40       int bytes_read = 
read (fd, 
buf2 + ofs, 
sizeof buf2 - ofs);
 
   41       CHECK (bytes_read >= -1 && bytes_read <= (
int) (
sizeof buf2 - ofs),
 
   42              "%zu-byte read on \"%s\" returned invalid value of %d",
 
  
#define CHECK(SUCCESS,...)
Takes an expression to test for SUCCESS and a message, which may include printf-style arguments.
int atoi(const char *s)
Converts a string representation of a signed decimal integer in S into an ‘int’, which is returned.
void random_bytes(void *buf_, size_t size)
Writes SIZE random bytes into BUF.
void compare_bytes(const void *read_data_, const void *expected_data_, size_t size, size_t ofs, const char *file_name)
test/lib.h
void random_init(unsigned seed)
Initializes or reinitializes the PRNG with the given SEED.
int open(const char *file)
static char buf2[BUF_SIZE]
static const char file_name[]
tests/filesys/base/syn-read.h
static char buf1[BUF_SIZE]
const char * test_name
Child process for syn-rw.
int read(int fd, void *buffer, unsigned size)
int main(int argc, const char *argv[])