Re: SIGUSR1 function call?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

It's the most asked question in this mail-list =)
Here is solution

--
/* Find a task by name
 * @param in_name[] executable name excluding path
 * @return pointer to corresponding task or null
 */
struct task_struct *find_task_by_name( char in_name[ PROCNAMELEN ] ) {
    struct task_struct *task;
    for_each_process(task) {
        if ( strncmp( task->comm, in_name, PROCNAMELEN ) == 0 )
            return task;
        next_task( task );
    }

    return NULL;
}

struct task_struct *process_ptr;                                      
              //process pointer
process_ptr = find_task_by_pid(process_pid);                        
//find by pid
or
process_ptr = find_task_by_name("you_process_name");    //find by name

send_sig(SIGUSR1, process_ptr, 0); //Sending signal
--

On 1/10/06, Medeiros Edward M NPRI <MedeirosEM@xxxxxxxxxxxxxxxxx> wrote:
> What is the function call to send a signal (SIGUSR1) from a device driver to
> a user-space process?


With best regards,
Sergey Semionov

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux