#include #include #include #include void handler (int sig) {} int main () { int fds[2]; char buf[100000]; int size = 0, ret; struct sigaction act; act.sa_handler = handler; act.sa_flags = 0; sigemptyset (&act.sa_mask); if (sigaction (SIGALRM, &act, NULL) < 0) { perror ("sigaction"); return 0; } if (pipe (fds) < 0) { perror ("pipe"); return 1; } while (1) { alarm (10); ret = write (fds[1], buf, 100000); alarm (0); if (ret < 0) break; size += ret; } printf ("Groesse: %d\n", size); return 0; }