void wait(semaphore s) { int junk; if (read(s[0], &junk, 1) <= 0) { printf("ERROR: wait() failed, check semaphore creation.\n"); exit(1); } }