SEM_UNLINK(2) BSD System Calls Manual SEM_UNLINK(2)NAME
sem_unlink -- remove a named semaphore
SYNOPSIS
#include <semaphore.h>
int
sem_unlink(const char *name);
DESCRIPTION
The named semaphore named name is removed. If the semaphore is in use by other processes, then name is immediately disassociated with the
semaphore, but the semaphore itself will not be removed until all references to it have been closed. Subsequent calls to sem_open() using
name will refer to or create a new semaphore named name.
If successful, sem_unlink() will return 0. Otherwise, -1 is returned and errno is set, and the state of the semaphore is unchanged.
ERRORS
sem_unlink() succeeds unless:
[EACCES] Permission is denied to be remove the semaphore.
[ENAMETOOLONG] name exceeded PSEMNAMLEN characters.
[ENOENT] The named semaphore does not exist.
SEE ALSO sem_close(2), sem_open(2), semctl(2), semget(2), semop(2)HISTORY
sem_unlink() is specified in the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995).
Darwin June 8, 2000 Darwin
Check Out this Related Man Page
sem_unlink(3) Library Functions Manual sem_unlink(3)NAME
sem_unlink - Removes the specified named semaphore (P1003.1b)
LIBRARY
Realtime Library (librt.so, librt.a)
SYNOPSIS
#include <semaphore.h>
int sem_unlink (
const char *name) ;
PARAMETERS
*name Specifies the name of the semaphore to remove.
DESCRIPTION
The sem_unlink function removes a semaphore named by the string name. If the semaphore is referenced by other processes, sem_unlink does
not change the state of the semaphore.
If other processes have the semaphore open when sem_unlink is called, the semaphore is not destroyed until all references to the semaphore
have been destroyed by calls to sem_close. The sem_unlink function returns immediately; it does not wait until all references have been
destroyed.
Calls to sem_open to recreate or reconnect to the semaphore refer to a new semaphore after sem_unlink is called.
RETURN VALUES
On a successful call, a value of 0 (zero) is returned. Otherwise, a value of -1 is returned and errno is set to indicate that an error
occurred.
ERRORS
The sem_unlink function fails under the following conditions:
[EACCES] Permission is denied to unlink the named semaphore.
[ENAMETOOLONG] The length of the name string exceeds {NAME_MAX} while {_POSIX_NO_TRUNC} is in effect.
[ENOENT] The named semaphore does not exist.
RELATED INFORMATION
Functions: sem_close(3), sem_open(3)
Guide to Realtime Programming delim off
sem_unlink(3)
Hi Everyone
I am having trouble using fbackup under SAM in HP-UX 10.20. I'm trying to perform a full backup of the entire system and keep bombing out and I am not sure why. Below is the result from the SAM window showing that fbackup has failed
Starting interactive backup...
br_backup:... (2 Replies)
Hello evry body,
I search to do a extend from semaphore on a SunOS 5.5.1 . I know the /etc/system file but I don't know the code line to put in this file . Help me a find a solution for my computer .
Merci d'avance . (1 Reply)
Hi friends I'm doing a project and in that I need to use kernel semaphore but I'm not very clear about how to use it. I've used system V semaphore.
What I find difficult to understand is that in system V semaphore, a semaphore set is registered to the system (the semid returned from semget call... (3 Replies)
Hi,
I've a problem with this simple code about of semaphore:
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<semaphore.h>
#include<sys/types.h>
#include<sys/mman.h>
#include<sys/fcntl.h>
#define SemName "/SEM_1"
int main (int argc, char **argv)
{
char name;... (5 Replies)
Hi,
does anybody know, if it is possible to replace mutex with POSIX semaphore?
I'm gonna to rewrite old thread's program with processes and I don't want rewrite most of the code...So if I replace the threads with processes and mutexes with semaphores WILL IT WORK?
Before, the critical... (1 Reply)
Hi All,
I am going through the semaphore concept and have a doubt regarding the same and hope to get a resolution here.
I have a file which has a number of records.
I want to write an application (in C) which will be able to do concurrent read/write on these records.
Of what I have... (8 Replies)
I have a situation where I have created a semaphore and set it's value to 10. I am using this semaphore to control access to a shared memory location. I can have 10 processes simultaneously read from the shared memory location, process 11 would get locked out. My question is, is there a way I... (6 Replies)
If say a process creates a semaphore/mutex etc then will this semaphore get created in its address space?
If yes then how an another process which wants to acquire this semaphore(created by the first process) will access the other
process address space to acquire the semaphore?
Where I mean in... (2 Replies)