-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest4.c
More file actions
30 lines (26 loc) · 696 Bytes
/
test4.c
File metadata and controls
30 lines (26 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <comp421/yalnix.h>
#include <comp421/hardware.h>
char line[TERMINAL_MAX_LINE];
int
main()
{
int len;
fprintf(stderr, "1. Doing TtyRead for process %i...\n", GetPid());
len = TtyRead(0, line, sizeof(line));
fprintf(stderr, "Done with TtyRead: len %d\n", len);
fprintf(stderr, "line '");
fwrite(line, len, 1, stderr);
fprintf(stderr, "'\n");
int status;
TracePrintf(0, "About to wait!!!\n");
int pid = Wait(&status);
if (pid < 0) {
fprintf(stderr, "Pid is bad\n");
}
// fprintf(stderr, "About to exit (pid=%i)!!\n", GetPid());
Exit(0);
}