projects
/
pintos-anon
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Add problem 1-1 solution.
[pintos-anon]
/
grading
/
userprog
/
write-bad-ptr.c
1
#include <stdio.h>
2
#include <syscall.h>
3
4
int
5
main (void)
6
{
7
int handle;
8
printf ("(write-bad-ptr) begin\n");
9
10
handle = open ("sample.txt");
11
if (handle < 2)
12
printf ("(write-bad-ptr) fail: open() returned %d\n", handle);
13
14
write (handle, (char *) 0x20101234, 123);
15
16
printf ("(write-bad-ptr) end\n");
17
return 0;
18
}