2009-11-06 06:21:12     error using "kill_proc" function in 2009 vesion

Document created by Aaronwu Employee on Aug 19, 2013
Version 1Show Document
  • View in full screen mode

2009-11-06 06:21:12     error using "kill_proc" function in 2009 vesion

Miquel Soler i Mir (SPAIN)

Message: 82123   

 

Hello.

 

I had a driver 100 % working in 2008 kernel version that use the "kill_proc" function to send signals to user space process.

 

When I try to compile in 2008 kernel version, the compiles answer me this:

 

./CompilaTimer

Compiling the timer

make: Entering directory `/media/TFTproject/TFTproject/Kernel/2009R1-RC6/src/linux-2.6.x'

  CC [M]  /media/GROS/uClinux/src/Programs/Timer/timer.o

/media/GROS/uClinux/src/Programs/Timer/timer.c: In function ‘timer_fun’:

/media/GROS/uClinux/src/Programs/Timer/timer.c:42: error: implicit declaration of function ‘kill_proc’

/media/GROS/uClinux/src/Programs/Timer/timer.c: In function ‘timer_test_init’:

/media/GROS/uClinux/src/Programs/Timer/timer.c:53: warning: passing argument 2 of ‘setup_timer’ from incompatible pointer type

make[1]: *** [/media/GROS/uClinux/src/Programs/Timer/timer.o] Error 1

make: *** [_module_/media/GROS/uClinux/src/Programs/Timer] Error 2

make: Leaving directory `/media/TFTproject/TFTproject/Kernel/2009R1-RC6/src/linux-2.6.x'

 

 

I don't know where is the error. The source code compile 100 % in 2008 version and it's the same...

 

the "kill_proc" is still to be in signal.h library...

 

Can somebody help me

 

Miquel Soler i Mir

TranslateQuoteReplyEditDelete

 

 

2009-11-06 06:28:59     Re: error using "kill_proc" function in 2009 vesion

Mike Frysinger (UNITED STATES)

Message: 82124   

 

there is no "kill_proc" function in 2009R1 linux-2.6.x/include/linux/

 

perhaps you're checking the wrong source tree

QuoteReplyEditDelete

 

 

2009-11-06 07:37:47     Re: error using "kill_proc" function in 2009 vesion

Miquel Soler i Mir (SPAIN)

Message: 82126   

 

Thanks Mike.

 

I was using the "kill_proc" function to send signals to user space process.

 

I read that this function is removed from embedded systems. It's true?

 

Is this one of the diference from 2008 to 2009?

 

 

There are another functions to send this signals from kernel space to user space process ?

 

Which?

 

In uclinux?

 

 

 

Thanks.

 

Miquel Soler i Mir

TranslateQuoteReplyEditDelete

 

 

2009-11-06 07:44:35     Re: error using "kill_proc" function in 2009 vesion

Mike Frysinger (UNITED STATES)

Message: 82127   

 

you're talking about completely common Linux code.  we had nothing to do with its removal.  read the ChangeLog/git history of the main tree to see why it was removed and if there's a replacement.

QuoteReplyEditDelete

 

 

2009-11-06 10:16:19     Re: error using "kill_proc" function in 2009 vesion

Miquel Soler i Mir (SPAIN)

Message: 82130   

 

Thanks Mike, this function it's not longer suported.

 

Some people change this for "send_sig()" but this needs the "trask_struct" of the destination process.

 

The function used for this, was "find_task_by_pid", but this function it's not suported.

 

I'm trying to send signals from userspace to kernespace.

 

Can you help me with this ?

 

Thanks.

 

Miquel Soler i Mir

TranslateQuoteReplyEditDelete

 

 

2009-11-06 10:59:12     Re: error using "kill_proc" function in 2009 vesion

Wolfgang Muees (GERMANY)

Message: 82132   

 

Why don't you use kill_pid()?

TranslateQuoteReplyEditDelete

 

 

2009-11-06 11:05:12     Re: error using "kill_proc" function in 2009 vesion

Mike Frysinger (UNITED STATES)

Message: 82133   

 

there is no such thing as sending signals from user space to kernel space

QuoteReplyEditDelete

 

 

2009-11-06 11:46:24     Re: error using "kill_proc" function in 2009 vesion

Miquel Soler i Mir (SPAIN)

Message: 82135   

 

Thanks Wolfgang.

 

using kill_pid I need struct pid *pid,

 

which function I can use to find this from PID process?

 

Thanks

 

Miquel

TranslateQuoteReplyEditDelete

 

 

2009-11-06 11:47:47     Re: error using "kill_proc" function in 2009 vesion

Miquel Soler i Mir (SPAIN)

Message: 82136   

 

Mike I'm sorry

 

was signals from kernel space (software timer) to user space.

TranslateQuoteReplyEditDelete

 

 

2009-11-07 15:14:19     Re: error using "kill_proc" function in 2009 vesion

Miquel Soler i Mir (SPAIN)

Message: 82184   

 

Problem solved.

 

Now the timer kernel module  is sending singals from kernel space to user space.

 

The problem was this function:     kill_proc(pid,SIGUSR1,1); 

 

I replace for this:  send_sig_info(SIGUSR1, &info, t)  with this addicional code:

 

    memset(&info,0,sizeof(struct siginfo)); // Generate the struct for signals

    info.si_signo = SIGUSR1;                // Config the signals

    info.si_code = SI_QUEUE;                // Config SI_QUERE std or SI_KERNEL for RTC

    //info.si_int = 1234;                    // not needed

 

    t = find_task_by_vpid(pid);                // Find the task from pid      

    if(t == NULL)

    {    PRINTK("Error finding the pid task\n");    }

 

 

 

Now is working fine.

 

Miquel Soler i Mir

Attachments

    Outcomes