Who is Participating?

I guess your implementation doesn't support slashes other than the first. Try :

sem_t *sem = sem_open("/semname", O_CREAT, 0644, 0);

The leading slash is to make sure that other processes will refer to the same named semaphore when using "/semname".
Although your implementation might not need the leading slash either. For that you'll have to check the man pages on your system.

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

>> *What is the proper way to actually clean up the semaphore in the code?
Use sem_close to close the semaphore in each process, and sem_unlink in the process that actually created it (to remove it from the file system).