SEM_CLOSE(2) BSD System Calls Manual SEM_CLOSE(2)NAME
sem_close -- close a named semaphore
The system resources associated with the named semaphore referenced by sem are deallocated and the descriptor is invalidated.
If successful, sem_close() will return 0. Otherwise, -1 is returned and errno is set.
sem_close() succeeds unless:
[EINVAL] sem is not a valid semaphore descriptor.
SEE ALSO sem_init(2), sem_open(2), sem_unlink(2), semctl(2), semget(2), semop(2)HISTORY
sem_close() 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_close(3) Library Functions Manual sem_close(3)NAME
sem_close - Deallocates the specified named semaphore (P1003.1b)
Realtime Library (librt.so, librt.a)
int sem_close (
sem_t *sem) ;
sem References the semaphore to be closed. Use the sem argument returned by the previous call to sem_open.
The sem_close function makes a semaphore available for reuse by deallocating any system resources allocated for use by the current process
for the named semaphore indicated by sem.
If the semaphore has not been removed with a call to sem_unlink, sem_close does not change the current state of the semaphore.
If the semaphore has been removed with a call to sem_unlink after the most recent call to sem_open with O_CREAT, the semaphore is no longer
available after all processes that opened the semaphore close it.
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
The sem_close function fails under the following condition:
[EINVAL] The sem argument is not a valid semaphore descriptor.
Functions: sem_init(3), sem_open(3), sem_unlink(3)
Guide to Realtime Programming delim off
I can't compile these codes with g++.
my system is linux (kernel is 2.4.0 ).
When I try to compile this program with g++ -o semw semw.cpp
It always tells me that sem_open sem_close,sem_post do not exist.But I have checked semaphore.h,I can not find any problems.
Anyone can compile these codes... (2 Replies)
I am trying to write stuff to a shared memory using a writer, and reading the corresponding stuff using a reader. I am facing problems while releasing the lock, as a result of which I am having segmentation faults. The code is as follows...
/********** writer.c ***********/
... (1 Reply)
I am on HP-UX delta B.11.11
I am using sem_open() and compiling/linking the library by specifying -lrt.
Then, I am creating library like below:
ar cr $libdir/liboscfe.a `cat fe.libs.$$ com.libs.$$`
Now, I am compiling another utility sch2db which requires this... (1 Reply)
I want to build a little website on a Sun Blade 100 running Solaris 10.
I just went out to apache.org and downloaded Unix Source: httpd-2.2.8.tar.gz
After unpacking the tarball, I CD'd into the subdirectory and ran the configure utility. Of course, it crapped out. I see that it is... (17 Replies)
We meet errors while running configuration scripts to prepare compiling source code on AIX 7.2. This error does not happen on AIX5.3 and AIX6.1
With the “/usr/bin/sh” from AIX7.2, sometimes , the script runs sucessfully, sometimes not. It’s unstable, and I don’t know why.
When... (10 Replies)