From documentation
SETALL
Set semval for all semaphores of the set using arg.array,
For SETALL
you need array of values
unsigned short int sem_array[1] ;
sem_array[0] = max_ass;
arg_assistant.array = sem_array;
if (semctl(sem_a, 0, SETALL, arg_assistant) == -1) {
perror("semctl");
exit(EXIT_FAILURE);
}
sem_array[1]
becaues you create only one semaphore.