Missing PtraceSyscall

143 views
Skip to first unread message

salviati

unread,
Apr 8, 2012, 3:32:38 PM4/8/12
to golan...@googlegroups.com
Are there any reasons as to why there is no syscall.PtraceSyscall(pid int)? PTRACE_SYSCALL, PTRACE_SINGLESTEP and PTRACE_CONT are all defined but unfortunately there is no "raw" Ptrace such that we can easily make our PtraceSyscall.

Albert Strasheim

unread,
Apr 9, 2012, 3:32:59 PM4/9/12
to golan...@googlegroups.com
Hello


On Sunday, April 8, 2012 9:32:38 PM UTC+2, salviati wrote:
Are there any reasons as to why there is no syscall.PtraceSyscall(pid int)? PTRACE_SYSCALL, PTRACE_SINGLESTEP and PTRACE_CONT are all defined but unfortunately there is no "raw" Ptrace such that we can easily make our PtraceSyscall.

The syscall package doesn't aim to wrap each and every system call out there.

Typically wrapping these on your own is quite easy, especially if you follow the ideas in mk*.sh scripts in src/pkg/syscall to generate the bits you need.

Enjoy.

Cheers

Albert

salvia...@gmail.com

unread,
Apr 11, 2012, 11:01:06 AM4/11/12
to golan...@googlegroups.com
Thanks, however I wasn't implicitly querying the difficulty of the task, or asking for a how-to.
Rather, I was asking whether there is a reason for this inconsistency.

Christopher Nielsen

unread,
Apr 11, 2012, 12:21:51 PM4/11/12
to golan...@googlegroups.com
On Wed, Apr 11, 2012 at 08:01, <salvia...@gmail.com> wrote:
> Thanks, however I wasn't implicitly querying the difficulty of the task, or
> asking for a how-to.
> Rather, I was asking whether there is a reason for this inconsistency.

I think you might have skipped over this part:

>> The syscall package doesn't aim to wrap each and every system call out
>> there.

I don't see an inconsistency.

--
Christopher Nielsen
"They who can give up essential liberty for temporary safety, deserve
neither liberty nor safety." --Benjamin Franklin
"The tree of liberty must be refreshed from time to time with the
blood of patriots & tyrants." --Thomas Jefferson

salviati

unread,
Apr 11, 2012, 8:01:15 PM4/11/12
to golan...@googlegroups.com, m4dh...@gmail.com
Whereas I do.

 PTRACE_SINGLESTEP and PTRACE_CONT are defined and they have their corresponding functions PtraceSingleStep and PtraceCont.
PTRACE_SYSCALL is also defined but the corresponding function PtraceSyscall is lacking. This is not consistent.

And because there is no "raw" Ptrace call, one cannot implement PtraceSyscall using syscall package alone either. If the answer is "user can manually implement it", then PtraceSingleStep, PtraceCont, etc. should be removed from the syscall package altogether. This is assuming PtraceSyscall doesn't have any special side to it, that makes it different from other. Which brings us back to the question "is there a special reason for this?"

Russ Cox

unread,
Apr 13, 2012, 5:28:50 PM4/13/12
to salviati, golan...@googlegroups.com, m4dh...@gmail.com
Package syscall is incomplete and inconsistent.
I created golang.org/issue/3525.

Russ

Reply all
Reply to author
Forward
0 new messages