trapslab initialized

This commit is contained in:
2025-06-12 10:45:04 +08:00
parent 2a8fad821b
commit 028cf61d61
40 changed files with 366 additions and 3188 deletions

View File

@@ -244,7 +244,7 @@ copyinstr3(char *s)
// See if the kernel refuses to read/write user memory that the
// application doesn't have anymore, because it returned it.
void
rwsbrk(char* arg)
rwsbrk(char* argv)
{
int fd, n;
@@ -967,8 +967,6 @@ forkfork(char *s)
enum { N=2 };
for(int i = 0; i < N; i++){
sleep(4);
exit(0);
int pid = fork();
if(pid < 0){
printf("%s: fork failed", s);
@@ -1037,8 +1035,6 @@ forkforkfork(char *s)
void
reparent2(char *s)
{
sleep(3);
exit(0);
for(int i = 0; i < 800; i++){
int pid1 = fork();
if(pid1 < 0){
@@ -2008,7 +2004,6 @@ sbrkbasic(char *s)
char *c, *a, *b;
// does sbrk() return the expected failure value?
exit(0);
pid = fork();
if(pid < 0){
printf("fork failed in sbrkbasic\n");
@@ -2071,7 +2066,6 @@ sbrkmuch(char *s)
enum { BIG=100*1024*1024 };
char *c, *oldbrk, *a, *lastaddr, *p;
uint64 amt;
exit(0);
oldbrk = sbrk(0);
@@ -2186,7 +2180,6 @@ sbrkfail(char *s)
char *c, *a;
int pids[10];
int pid;
exit(0);
if(pipe(fds) != 0){
printf("%s: pipe() failed\n", s);