void signal(semaphore s) { if (write(s[1], "x", 1) <= 0) { printf("ERROR: write() failed, check semaphore creation.\n"); exit(1); } }