Initial revision

This commit is contained in:
em
1985-02-06 21:25:27 +00:00
parent d7abe0e8b6
commit 0ff3a17f5e
78 changed files with 6131 additions and 0 deletions

1
lang/cem/ctest/ctsys/run Normal file
View File

@@ -0,0 +1 @@
make "P=tfork" -fsk ../makefile ${1-gen}

View File

@@ -0,0 +1,11 @@
#include <signal.h>
foo()
{
printf("signal received\n");
}
main()
{
signal(SIGINT,foo);
while(1);
}

View File

@@ -0,0 +1,31 @@
main(argc,argv) char **argv ; {
int child, waitchild ;
int status ;
child=fork() ;
if ( child== -1 ) {
printf("fork returned -1\n") ;
return 1 ;
}
if ( child ) {
/* The parent */
printf("childno %d\n",child ) ;
do {
waitchild= wait(&status ) ;
printf("Child %d, status 0x%x\n",waitchild,status) ;
if ( waitchild== -1 ) {
printf("No children\n") ;
return 1 ;
}
} while ( waitchild!=child ) ;
if ( argc<=1 && status != (8<<8) ) {
printf("incorrect status return\n") ;
return 2 ;
}
} else {
/* The child */
if ( argc>1 ) pause() ;
return 8 ;
}
printf("fork/wait ok\n") ;
return 0 ;
}

View File

@@ -0,0 +1,3 @@
childno N
Child N, status 0x800
fork/wait ok