CS318 - Pintos
Pintos source browser for JHU CS318 course
Functions | Variables
child-sort.c File Reference
#include <debug.h>
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
Include dependency graph for child-sort.c:

Go to the source code of this file.

Functions

int main (int argc UNUSED, char *argv[])
 

Variables

const char * test_name = "child-sort"
 Reads a 128 kB file into static data and "sorts" the bytes in it, using counting sort, a single-pass algorithm. More...
 
unsigned char buf [128 *1024]
 
size_t histogram [256]
 

Function Documentation

◆ main()

int main ( int argc  UNUSED,
char *  argv[] 
)

Definition at line 16 of file child-sort.c.

References buf, CHECK, close(), histogram, arc4::i, arc4::j, open(), quiet, read(), seek(), and write().

Here is the call graph for this function:

Variable Documentation

◆ buf

unsigned char buf[128 *1024]

Definition at line 12 of file child-sort.c.

Referenced by main().

◆ histogram

size_t histogram[256]

Definition at line 13 of file child-sort.c.

Referenced by main().

◆ test_name

const char* test_name = "child-sort"

Reads a 128 kB file into static data and "sorts" the bytes in it, using counting sort, a single-pass algorithm.

Child process for syn-read test.

The sorted data is written back to the same file in-place.

Definition at line 10 of file child-sort.c.