PKUOS - Pintos
Pintos source browser for PKU Operating System course
Functions
pt-write-code-2.c File Reference
#include "tests/lib.h"
#include "tests/main.h"
Include dependency graph for pt-write-code-2.c:

Go to the source code of this file.

Functions

void test_main (void)
 Try to write to the code segment using a system call. More...
 

Function Documentation

◆ test_main()

void test_main ( void  )

Try to write to the code segment using a system call.

tests/main.h

The process must be terminated with -1 exit code.

< Save a copy of the stack pointer.

< Move stack pointer to bottom of page.

< Push 32 bytes on stack at once.

< Restore copied stack pointer.

< Tell GCC we destroyed eax.

Definition at line 8 of file pt-write-code-2.c.

References CHECK, fail(), open(), read(), and test_main().

Referenced by test_main().

Here is the call graph for this function:
Here is the caller graph for this function: