mirror of
https://github.com/GnoConsortium/gno.git
synced 2024-12-21 07:30:05 +00:00
Added tests for wait(2) [currently failing] and getpid(2) [currently passing].
This commit is contained in:
parent
6b10135a2c
commit
bc4d7f5de5
11
lib/libc/tests/sys/getpid.c
Normal file
11
lib/libc/tests/sys/getpid.c
Normal 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
21
lib/libc/tests/sys/wait.c
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user