RE: Send information from kernel to user

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

 



If you are trying to just write some specific data to log file at each fork() and exit() system call, it would be better that you register some type of signal to the kernel first (using sigaction() system call) and then do fork () and exit().  Now you make change in fork() and exit() system calls. In these system calls you set the signal bit (for the signal you register earlier) in task_struct of current process, so that while returning from fork() or exit() system call, kernel can execute your registered signal handler. While returning from system call kernel will call your registered signal handler, which will write the things to your log file, you need not to complicate things in kernel for this.

Regards,
Gaurav


_____________________________

Thanks & Regards,

Gaurav Dhiman
Computer Associates - ITC,
eTrust IAM, eTrust Security Solutions
Mobile: +91-040-32384853
Direct Tel: +91-40-55670911
Fax: +91-40-55670001
Website: www.ca.com
E-Mail: Gaurav.Dhiman@xxxxxx
_____________________________

 


-----Original Message-----
From: kernelnewbies-bounce@xxxxxxxxxxxx [mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of aki ra
Sent: Tuesday, September 07, 2004 11:34 AM
To: kernelnewbies@xxxxxxxxxxxx
Subject: Send information from kernel to user

Hello,

  I'd like to write a program to that log information
when a process is forked and when it is terminated.
It's just for learning, it's not very useful. To
achieve this, I want to pass the information from the
kernel to my user application when a fork() and an
exit() occur. I think to add some code in the
copy_process() that will put information in a buffer
that can be access from user space. 

  My question is the following: is a buffer a good
solution to do this? I've heard about things like
kevent or relayfs. Are they a good solution if we want
to communicate information from the kernel space to an
application on specifics events like do_fork() or
do_exit()?

  Thank you in advance for showing me the light :)

Best regards,
Patrick.


	

	
		
Vous manquez d'espace pour stocker vos mails ? 
Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis. A télécharger gratuitement sur http://fr.messenger.yahoo.com

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



--
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