PKUOS - Pintos
Pintos source browser for PKU Operating System course
|
#include <random.h>
#include <stdlib.h>
#include <syscall.h>
#include "tests/filesys/extended/syn-rw.h"
#include "tests/lib.h"
Go to the source code of this file.
Functions | |
int | main (int argc, const char *argv[]) |
Variables | |
const char * | test_name = "child-syn-rw" |
Child process for syn-rw. More... | |
static char | buf1 [BUF_SIZE] |
static char | buf2 [BUF_SIZE] |
int main | ( | int argc | , |
const char * | argv[] | ||
) |
Definition at line 22 of file child-syn-rw.c.
References atoi(), buf1, buf2, CHECK, close(), compare_bytes(), file_name, open(), quiet, random_bytes(), random_init(), and read().
|
static |
Definition at line 18 of file child-syn-rw.c.
Referenced by main().
|
static |
Definition at line 19 of file child-syn-rw.c.
Referenced by main().
const char* test_name = "child-syn-rw" |
Child process for syn-rw.
Child process for syn-read test.
Reads from a file created by our parent process, which is growing it. We loop until we've read the whole file successfully. Many iterations through the loop will return 0 bytes, because the file has not grown in the meantime. That is, we are "busy waiting" for the file to grow. (This test could be improved by adding a "yield" system call and calling yield whenever we receive a 0-byte read.)
Definition at line 16 of file child-syn-rw.c.