Added tests for wait(2) [currently failing] and getpid(2) [currently passing].

This commit is contained in:
gdr 1997-07-27 23:36:25 +00:00
parent 6b10135a2c
commit bc4d7f5de5
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,11 @@
#include <stdio.h>
#include <unistd.h>
int
main(int argc, char **argv) {
pid_t pid;
pid = getpid();
printf("pid is %d\n", pid);
return 0;
}

21
lib/libc/tests/sys/wait.c Normal file
View File

@ -0,0 +1,21 @@
/*
* This program exhibits a problem with the wait(2) system call;
* If you do a wait and have no children, you will hang in the wait.
* The man page says that -1 should be returned and errno set to
* ECHILD.
*
* $Id: wait.c,v 1.1 1997/07/27 23:36:25 gdr Exp $
*/
#include <stdio.h>
#include <sys/wait.h>
int main (int argc, char **argv) {
union wait wstat;
int retval;
printf("starting wait\n");
retval = wait(&wstat);
printf("wait returned %d\n", retval);
return 0;
}