long status = sem->sem_status; if (status & 1) *sval = (int)((unsigned long) status >> 1); else *sval = 0;
*sval = sem->sem_value;
int sem_getvalue(sem_t * sem, int * sval){  long status = sem->sem_status;  if (status & 1)    *sval = (int)((unsigned long) status >> 1);  else    *sval = 0;  return 0;}