> + struct sem sems[0];I can't contribute much to the code itself, but [0] is an oldGCC extension, for modern code sems[] should do the same thingsbut is standard C.