You mention parameter 2 and 3, but semInit() function has "void" arguments. Maybe I'm missing something? :)