-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
/* Runs 4 child-linear processes at once. */
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
#define CHILD_CNT 4
void
test_main (void)
{
pid_t children[CHILD_CNT];
int i;
for (i = 0; i < CHILD_CNT; i++) {
children[i] = fork ("child-linear");
if (children[i] == 0) {
if (exec ("child-linear") == -1)
fail ("failed to exec child-linear");
}
}
for (i = 0; i < CHILD_CNT; i++) {
CHECK (wait (children[i]) == 0x42, "wait for child %d", i);
}
}
- fork()가 정상적으로 새로운 프로세스를 생성하는지
- fork 후 자식이 exec()로 새로운 프로그램을 실행하는지
- 부모가 여러 자식을 동시에 wait()할 수 있는지
- 각 자식 프로세스가 exit(0x42) 값을 정상적으로 전달하는지
- 프로세스 테이블, 자식 관리, 메모리 복사, 파일 디스크립터 복제 등이 모두 올바른지
즉, 멀티-process 환경에서 Pintos의 userprog 구현이 제대로 동작하는지 확인하는 테스트
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Test