01-19-2009
Could you please go through the function 'sigqueue'. Is it that you are looking for ?
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Is there any way I can get UNIX to return the Process ID of a process when I actually issue the command to invoke the process?
For example, if I was to launch an emacs process in batch mode, by issuing the UNIX command :
% emacs file.txt&
then UNIX would return the Process ID (PID).... (7 Replies)
Discussion started by: 1cuervo
7 Replies
2. Shell Programming and Scripting
Hi Friends :p
I have a little problem please help me out. I have a Unix based OS Sun Server having oracle 8i as database on it. The server has one client with windows OS. The client uses developer 2000 (GUI) to run query and run processes. I want to know how can I know the PID of a process run... (3 Replies)
Discussion started by: vanand420
3 Replies
3. Programming
Hi,
I want to read the task_struct structure in Linux in order to get the names & pids of all processes.
How can this be done??
Thanks in adv,
molu (4 Replies)
Discussion started by: molu
4 Replies
4. Solaris
hi all,
Is there a simple script anyone could through out to me, to find the pid of a process given the name. I actually need to bind this pid to a processor set. I would probably put these comamns in a shell script which would have.
a) kick start the executable
b) get the pid
c) bind it to a... (10 Replies)
Discussion started by: Naanu
10 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this.
Thanks in advance,
Amudha (7 Replies)
Discussion started by: samudha
7 Replies
6. Shell Programming and Scripting
Hi
I have written a shell script to find and kill the particular process. Here in shell script i have written the code like
cnt = $(ps -ef | grep Shree)
echo $cnt
I am getting the output
root 2326 2317 0 14:39:46 pts/1 0:28 Shree -f fdc.fbconf FDCapp.fbapp
Here I want to... (2 Replies)
Discussion started by: Shreedhar Naik
2 Replies
7. Shell Programming and Scripting
Hi all,
i was able to redirect pid of process to a file in the following way
ps aux|awk '$11 == "/Applications/ProjectX/DServer" >> /Applications/ProjectX/DServer.pid
it works fine but if one folder name caontains space its not working like below
ps aux|awk '$11 == "/Applications/Project\... (1 Reply)
Discussion started by: kirankumars
1 Replies
8. Programming
Hi
I use linux OS.
I've already written a function that allow me to get the process name by pid. (searching in /proc). Now I'd like to perform the inverse task.I mean get the process pid by its name.
I could write a function that search in every folder in /proc for the process name, but i... (2 Replies)
Discussion started by: Dedalus
2 Replies
9. HP-UX
Hi all.
I need to get detailed information about a PID.
I have an app called Reflection X and it shows many things like Total CPU percent, User CPU (Nice) percent, FS Reads, etc.
My question is how can I get all that information on console?
Is there an archive with the detailed... (9 Replies)
Discussion started by: the0m3n
9 Replies
10. AIX
HI,
i used
ps -ef | grep 3539052 | grep -v grep
and i got a output like ths
root 3539052 3407918 0 May 07 - 709:31 /usr/sbin/syslogd
but what i need is instead of full path /usr/sbin/syslogd i want only the process name that is 'syslogd' here. (3 Replies)
Discussion started by: sumanthupar
3 Replies
SIGQUEUE(3) Linux Programmer's Manual SIGQUEUE(3)
NAME
sigqueue - queue a signal and data to a process
SYNOPSIS
#include <signal.h>
int sigqueue(pid_t pid, int sig, const union sigval value);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
sigqueue(): _POSIX_C_SOURCE >= 199309L
DESCRIPTION
sigqueue() sends the signal specified in sig to the process whose PID is given in pid. The permissions required to send a signal are the
same as for kill(2). As with kill(2), the null signal (0) can be used to check if a process with a given PID exists.
The value argument is used to specify an accompanying item of data (either an integer or a pointer value) to be sent with the signal, and
has the following type:
union sigval {
int sival_int;
void *sival_ptr;
};
If the receiving process has installed a handler for this signal using the SA_SIGINFO flag to sigaction(2), then it can obtain this data
via the si_value field of the siginfo_t structure passed as the second argument to the handler. Furthermore, the si_code field of that
structure will be set to SI_QUEUE.
RETURN VALUE
On success, sigqueue() returns 0, indicating that the signal was successfully queued to the receiving process. Otherwise, -1 is returned
and errno is set to indicate the error.
ERRORS
EAGAIN The limit of signals which may be queued has been reached. (See signal(7) for further information.)
EINVAL sig was invalid.
EPERM The process does not have permission to send the signal to the receiving process. For the required permissions, see kill(2).
ESRCH No process has a PID matching pid.
VERSIONS
sigqueue() and the underlying rt_sigqueueinfo() system call first appeared in Linux 2.2.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
+-----------+---------------+---------+
|Interface | Attribute | Value |
+-----------+---------------+---------+
|sigqueue() | Thread safety | MT-Safe |
+-----------+---------------+---------+
CONFORMING TO
POSIX.1-2001, POSIX.1-2008.
NOTES
If this function results in the sending of a signal to the process that invoked it, and that signal was not blocked by the calling thread,
and no other threads were willing to handle this signal (either by having it unblocked, or by waiting for it using sigwait(3)), then at
least some signal must be delivered to this thread before this function returns.
C library/kernel differences
On Linux, sigqueue() is implemented using the rt_sigqueueinfo(2) system call. The system call differs in its third argument, which is the
siginfo_t structure that will be supplied to the receiving process's signal handler or returned by the receiving process's sigtimedwait(2)
call. Inside the glibc sigqueue() wrapper, this argument, uinfo, is initialized as follows:
uinfo.si_signo = sig; /* Argument supplied to sigqueue() */
uinfo.si_code = SI_QUEUE;
uinfo.si_pid = getpid(); /* Process ID of sender */
uinfo.si_uid = getuid(); /* Real UID of sender */
uinfo.si_value = val; /* Argument supplied to sigqueue() */
SEE ALSO
kill(2), rt_sigqueueinfo(2), sigaction(2), signal(2), pthread_sigqueue(3), sigwait(3), signal(7)
COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
Linux 2017-09-15 SIGQUEUE(3)