projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Talk about write() to stdout more.
[pintos-anon]
/
grading
/
vm
/
child-mm-wrt.c
diff --git
a/grading/vm/child-mm-wrt.c
b/grading/vm/child-mm-wrt.c
index 9dbbee8e00687ea46c9c88d735483e01d795ee4b..28a52c61825a216ca3b11b0f7fa372affc7d8969 100644
(file)
--- a/
grading/vm/child-mm-wrt.c
+++ b/
grading/vm/child-mm-wrt.c
@@
-1,3
+1,12
@@
+#include <stdio.h>
+#include <string.h>
+#ifdef PINTOS
+#include <syscall.h>
+#else
+#include "posix-compat.h"
+#endif
+#include "sample.inc"
+
#define ACTUAL ((void *) 0x10000000)
int
#define ACTUAL ((void *) 0x10000000)
int
@@
-5,28
+14,31
@@
main (void)
{
int fd;
{
int fd;
- printf ("(
mmap-write
) begin\n");
+ printf ("(
child-mm-wrt
) begin\n");
/* Write file via mmap. */
if (!create ("sample.txt", strlen (sample)))
{
/* Write file via mmap. */
if (!create ("sample.txt", strlen (sample)))
{
- printf ("(
mmap-write
) create() failed\n");
+ printf ("(
child-mm-wrt
) create() failed\n");
return 1;
}
fd = open ("sample.txt");
if (fd < 0)
{
return 1;
}
fd = open ("sample.txt");
if (fd < 0)
{
- printf ("(
mmap-write
) open() failed\n");
+ printf ("(
child-mm-wrt
) open() failed\n");
return 1;
}
if (!mmap (fd, ACTUAL, strlen (sample)))
{
return 1;
}
if (!mmap (fd, ACTUAL, strlen (sample)))
{
- printf ("(
mmap-write
) mmap() failed\n");
+ printf ("(
child-mm-wrt
) mmap() failed\n");
return 1;
}
memcpy (ACTUAL, sample, strlen (sample));
return 1;
}
memcpy (ACTUAL, sample, strlen (sample));
+
+ printf ("(child-mm-wrt) end\n");
+
return 234;
}
return 234;
}