ptrace (process trace system call) on Linux from D
mta`chrono
chrono at mta-international.net
Mon May 7 15:56:06 PDT 2012
> (2) Is it more D-ish to use something like "enum PTRequest { traceMe =
> 0, ... }" instead of the fully capitalised originals? It doesn't seem
> to affect the working of things.
Yes, that's more D-ish. In new D code I prefer the camelcased ones, but
there are cases where you'd like to use the original ones. it's up to! ;-)
> (3) wait() is declared as returning a pid_t in the manpage, and is
> declared as such in core.sys.posix.sys.wait. In std.c.process however,
> it returns an int. I can't even find a process.h in my Linux install.
> What am I supposed to use? I know it essentially doesn't matter, as
> pid_t is aliased as int.
> Are there D alternatives to wait() and fork() that I could use with
> ptrace() instead of the C posix system functions?
>
> (4) Some things are declared only in core.*, not in std.*. Will they be
> added at some point or is this how it's supposed to be?
I thing core.* (druntime) is the right place for _all_ bindings to libc.
But yeha, there are still some relicts in std.c.* of the good old days.
What do you meant by "D alternatives to wait() and fork() that could be
used with ptrace()". Maybe I don't understand your intention.
More information about the Digitalmars-d-learn
mailing list