#include #include int pipe_ret, pipes[2]; int main(int ac, char **av) { int i, numb_fds; numb_fds = getdtablesize(); for (i = 0; i < numb_fds; i++) { pipe_ret = pipe(pipes); if (pipe_ret < 0) { if (errno != EMFILE) printf ("got unexpected error - %d", errno); else printf ("got expected error - %d", errno); break; } } return 0; }