b51ce62454
These funcs use things like wait/write/read/strcmp but sometimes don't include the right header for them. * test/Makefile: Add -Wall to CFLAGS. * test/clone.c: Include unistd.h. * test/fork.c: Include sys/wait.h. * test/sig.c: Include unistd.h. * test/sigkill_rain.c: Include sys/wait.h. * test/vfork.c: Include sys/wait.h. * test/wait_must_be_interruptible.c: Include string.h
20 lines
250 B
C
20 lines
250 B
C
#include <stdlib.h>
|
|
#include <signal.h>
|
|
#include <unistd.h>
|
|
|
|
void interrupt()
|
|
{
|
|
write(2, "xyzzy\n", 6);
|
|
}
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
char buf[1024];
|
|
|
|
signal(SIGINT, interrupt);
|
|
read(0, buf, 1024);
|
|
write(2, "qwerty\n", 7);
|
|
|
|
return 0;
|
|
}
|