I was hoping to change the value of a named semaphore in one instruction, like the inverse of sem_getvalue.

I have tried this and it worked:
Code:
(*Sem).__align=x;
(tough i have to do one sem_post() after that instruction so that the processes waiting on the semaphore realize it has been changed)
my question is: is this safe? Does that __align field has the same name in other systems?

the alternative is to do multiple sem_post(), but i want to avoid that...

Thank You