A semaphore is declared and created like this --
static struct semaphore *done;
done = sem_create("done",0); // semaphore value initialized to zero
Now what happens when,
if(done==NULL)
{
//Something done here...
}
the if condition is executed above ? since done was set to 0 do the statements inside the if block get executed ?