Sponsored Content
Top Forums UNIX for Advanced & Expert Users How to find process holding a semaphore? Post 302935805 by achenle on Thursday 19th of February 2015 09:06:57 AM
Old 02-19-2015
No process "holds" a semaphore. It's not a lock.

Processes block and wait (or not) for another process to post to the semaphore. There's no way to write a program to figure out which process "should" post to the semaphore.
This User Gave Thanks to achenle For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to find the chid process id from given parent process id

how to find the chid process id from given parent process id.... (the chid process doesnot have sub processes inturn) (3 Replies)
Discussion started by: guhas
3 Replies

2. Shell Programming and Scripting

global variable not holding its value?

dear there, this kept me awake last night, the variable ${TO} in the following script doesn't seem to hold its value. I have a file ./filelist, which lists all files of interests. I group them by keywords in the filename, and would like to count total number of lines in each group. ... (7 Replies)
Discussion started by: patiobarbecue
7 Replies

3. Shell Programming and Scripting

[BASH] Holding a variable unto other scripts.

Ex: Script 1 has pID=333. I want to take pID to Script 2 so I can retrive 333. How can I do this? (3 Replies)
Discussion started by: Yakuzan
3 Replies

4. Shell Programming and Scripting

Holding Expect

I seem to remember seeing a way to hold an expect script or make expect wait for a specific key stroke before continuing. I ask because I want to automate logging into a device using a key fob. Cant find it in my notes and been through my orielly book twice .. going for a third. (0 Replies)
Discussion started by: popeye
0 Replies

5. Solaris

How to check which process is holding up the ilde port

HI All Am on Sun OS.While trying to start a process , we could see that the port is idle and we are not able to find the process holding that port. Below is the result we get after using netstat command. lsof command is not yet installed in our machine. netstat -a | grep "port no"... (5 Replies)
Discussion started by: Whiteboard
5 Replies

6. AIX

Wait process holding CPU

Hi all, Have this performance Issue, srvbd1]root]/]>ps vg | head -1 ; ps vg | grep -w wait PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND 8196 - A 4448:23 0 384 384 xx 0 0 12.8 0.0 wait 53274 - A 4179:28 0 384 ... (9 Replies)
Discussion started by: gopeezere
9 Replies

7. Solaris

Process holding /tmp space, need to know the process details

Hi , In a server /tmp has almost reached 75% and i can see the File system utilization is 48Mb only , so i believe some process is using the /tmp space. I would like to know which process is using /tmp space. # df -h /tmp Filesystem size used avail capacity Mounted on swap ... (9 Replies)
Discussion started by: chidori
9 Replies

8. Programming

Find parent process (not process ID)

Hi: I have a program written in FORTRAN running on AIX platform. It is because missing of documentation and without root password, therefore we want to modify the program so that we can find out which script/program that call this FORTRAN program. I have google for few days, all of them are... (3 Replies)
Discussion started by: cstsang
3 Replies

9. Shell Programming and Scripting

Holding cursor position on one line

Hi there. It's easier to explain this with a pseudo code, I hope this makes sense: var1=hello echo $var1 some kind of loop echo loop counter done How do I hold the cursor position immediately behind the last output so I'd get something like: hello123456789 DOS used to use ","... (5 Replies)
Discussion started by: MuntyScrunt
5 Replies
sem_unlink(2)							System Calls Manual						     sem_unlink(2)

NAME
sem_unlink - unlink a named POSIX semaphore SYNOPSIS
DESCRIPTION
is used to unlink named semaphores. A successful call to marks the semaphore, specified by name, for removal. Calling does not affect processes, including the calling process, which currently have a descriptor, obtained from a call to Named semaphores are uniquely identi- fied by character strings. All character string names will be pre-processed to ensure variations of a pathname resolve to the same sema- phore name. If the semaphore is successfully marked for removal by a call to the semaphore will be removed when all processes remove their descriptors to the specified semaphore by calling Subsequent calls to using the string name will refer to a new semaphore. To use this function, link in the realtime library by specifying on the compiler or linker command line. EXAMPLES
The following call to will remove the named semaphore named by the string name. If the semaphore is currently referenced by one or more processes, the semaphore will be marked for removal and removed when there are no more processes referencing it. RETURN VALUE
If the semaphore was unlinked successfully, returns 0. If the semaphore could not be unlinked, the call returns -1 and sets to indicate the error. ERRORS
fails and does not perform the requested operation if any of the following conditions are encountered: [EACCES] The named semaphore exists and the process does not have the permissions to unlink the semaphore. [ENAMETOOLONG] The name string is longer than [ENOENT] The flag is not set in oflag (see sem_open(2)) and the named semaphore does not exist. SEE ALSO
sem_close(2), sem_open(2), privileges(5), <semaphore.h>. STANDARDS CONFORMANCE
sem_unlink(2)
All times are GMT -4. The time now is 02:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy