Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ptrace vs procfs - controlling processes
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
borucix
n00b
n00b


Joined: 23 Aug 2007
Posts: 4

PostPosted: Sat Dec 26, 2009 11:05 am    Post subject: ptrace vs procfs - controlling processes Reply with quote

Hi guys,

the ptrace function allows one process to control the actions of another (like single-stepping, writing to its memory, etc.). However, I have recently read that it is generally better to use procfs for such purposes, it is supposed to be more universal. Is such functionality available in linux's procfs? I am looking for something like the one offered by DragonFly BSD:
http://leaf.dragonflybsd.org/cgi/web-man?command=procfs&section=5
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 474
Location: San Diego, California USA

PostPosted: Sat Dec 26, 2009 6:34 pm    Post subject: Reply with quote

Yes, Linux contains a /proc filesystem. But it offers different functionality. gdb, the debugger, offers the ability to attach to a remote process and control it if you need to using the 'attach' command in gdb. The /proc filesystem does not offer this functionality.
Back to top
View user's profile Send private message
borucix
n00b
n00b


Joined: 23 Aug 2007
Posts: 4

PostPosted: Sat Dec 26, 2009 10:29 pm    Post subject: Reply with quote

Thanks. So I'm guessing that ptrace is the only way given by the API to controll processes? Gdb is a debugger, what I need is to write such a "debugger" of my own.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum