sem_destroy(3) Library Functions Manual sem_destroy(3)NAME
sem_destroy - Destroys an unnamed semaphore (P1003.1b)
LIBRARY
Realtime Library (librt.so, librt.a)
SYNOPSIS
#include <semaphore.h>
int sem_destroy (
sem_t *sem);
PARAMETERS
sem References the unnamed semaphore to be destroyed. Use the sem argument that was supplied to, and filled in by, the previous call
to sem_init.
DESCRIPTION
The sem_destroy function destroys an unnamed semaphore indicated by sem. Only a semaphore created using sem_init may be destroyed using
sem_destroy.
The potential for deadlock exists if a process calls sem_destroy for a semaphore while there is a pending sem_wait, because a process may
be waiting for a poster that has not yet opened the semaphore.
RETURN VALUES
On successful completion, the function returns the value 0 (zero); otherwise, the function returns the value -1 and sets errno to indicate
the error, without destroying the semaphore indicated by the sem argument.
ERRORS
The sem_destroy function fails under the following condition:
[EINVAL] The sem argument is not a valid semaphore.
RELATED INFORMATION
Functions: sem_init(3), sem_open(3)
Guide to Realtime Programming delim off
sem_destroy(3)
Check Out this Related Man Page
SEM_DESTROY(3) BSD Library Functions Manual SEM_DESTROY(3)NAME
sem_destroy -- destroy an unnamed semaphore
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <semaphore.h>
int
sem_destroy(sem_t *sem);
DESCRIPTION
The sem_destroy() function destroys the unnamed semaphore pointed to by sem. After a successful call to sem_destroy(), sem is unusable until
re-initialized by another call to sem_init(3).
RETURN VALUES
The sem_destroy() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to
indicate the error.
ERRORS
The sem_destroy() function will fail if:
[EINVAL] The sem argument points to an invalid semaphore.
[EBUSY] There are currently threads blocked on the semaphore that sem points to.
SEE ALSO sem_init(3)STANDARDS
The sem_destroy() function conforms to ISO/IEC 9945-1:1996 (``POSIX.1'').
POSIX does not define the behavior of sem_destroy() if called while there are threads blocked on sem, but this implementation is guaranteed
to return -1 and set errno to EBUSY if there are threads blocked on sem.
BSD February 15, 2000 BSD
Hi,
I'm running a COBOL process (with subroutines in standard C accessing an oracle database using OCI calls, using shared memories and sem etc....) on an AIX 5.1 machine.
Under unusually heavy conditions (millions of loops in the process) I've got the following error:
Execution error : file... (0 Replies)
Discussion started by: Isax50
0 Replies
2. Post Here to Contact Site Administrators and Moderators
Moderator's Note:
This post was originally an explanation of why the poster did not feel our rules applied to him. In addition, the poster indicated that he objected to finding his questions posted to this site on various search engines and threatened legal action should it happen again. I have... (1 Reply)
Hi,
I have created a posix semaphore.
Is it possible to have a functionality, wherein I can reset the semaphore.
ie All the tasks waiting for the semaphore will be signalled and will return with error values and the semaphore value will be set to its initial value.
Is there a way to get a... (1 Reply)
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)
Hi All,
I am searching for some files (*.sem and *.chk and *.temp) in morethan one directories.
if i found .sem and .chk files(base name should be same) i am deleting these 2 files because i need to delete .chk files if i found respective .sem file
i am also deleting other .sem files only... (6 Replies)
Hello All,
I have some files like file, file.chk, file.sem and file.temp in huge. I would like to delete some files based on following criteria.
1. Unconditionally delete .sem and .temp files
2. If we found the actual file, don't remove .chk file, otherwise remove .chk file as well
for... (5 Replies)