LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-07-2004, 09:20 AM   #1
eshwar_ind
Member
 
Registered: Feb 2004
Location: Bangalore
Distribution: Redhat
Posts: 144

Rep: Reputation: 15
Kill sys call


Hi!
I want to write a function whose behaviour should be similar to kill system call i.e=> I have to send the signal to the given process. Is it possible to do it by over writting pending signals field in the stat file for the corresponding process in the proc directory? I got this thought, i dont think its possible because Its( /proc/pid/stat ) permissions are set to 0444, even as a super user i cant change permissions.

Is there any other way of implementing the kill system call functionality in user space. Or any other way to change the stat file ?
Please give me some idea to solve this problem. I will be very thankfull to you.
Bye,
Eshwar.
 
Old 05-07-2004, 09:41 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Quote:
Is there any other way of implementing the kill system call functionality in user space.
No. And frankly I cannot imagine why somone would want to do that...
 
Old 05-07-2004, 10:41 AM   #3
hylke
Member
 
Registered: Apr 2004
Location: the Netherlands
Distribution: Ubuntu 7.04
Posts: 329

Rep: Reputation: 30
I gues it is possible.
Try to dissamble shutdown or halt.That shutsdown your system(changes the level).
Good luck.
 
Old 05-07-2004, 11:05 AM   #4
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Quote:
Originally posted by hylke
I gues it is possible.
It would require a kernel bug for this to be possible.
Quote:
Try to dissamble shutdown or halt.
I would check the sources instead: much easier reading. It's open source after all...
But don't bother, "shutdown" uses the kill() system call.
 
Old 05-07-2004, 11:41 AM   #5
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
I don't understand why you would want to do this. If kill() does what you want, then why reinvent the wheel? If you want to do something that kill() doesn't do, what would you want to do differently?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can one know the exact file type using a sys call? mohit_garg Linux - Software 1 11-15-2005 10:01 PM
question about select sys call xatzipol Programming 1 10-30-2005 09:22 AM
Write sys call failing ppy Programming 1 11-05-2004 08:57 AM
Any sys call to list all users ? dileepkk Linux - General 5 07-06-2004 06:04 PM
any sys call to get ip address of NIC jmdey Linux - General 2 05-30-2002 03:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration