Re: ptrace errors are misleading

From: Mike Coleman (mcoleman2@kc.rr.com)
Date: Tue May 23 2000 - 16:51:18 EST


Victor Zandy <zandy@cs.wisc.edu> writes:
> I have only seen it documented in your (invaluable) revision of
> the ptrace man page. Does your revision appear in major Linux
> distributions yet?

Thanks very much for the compliment. I know Debian has it. It's in the
manpages collection, so the rest should pick it up eventually.

> In ptrace-land the line separating the forbidden from nonsense is
> blurry. Is it really nonsense (or impossible) to detach from a
> running process?

Well, it's not a permissions issue, anyway. And currently, I believe it is
impossible to detach from a running process.

> Your EPERM/ESRCH
> distinction is coarse and subjective. Why not flag all errors,
> bonkers or forbidden, with EPERM, and save ESRCH for when the process
> really doesn't exist?

If I had written the code, I might have splayed the error conditions out into
a larger set of codes. Given the new documentation, though, it is pretty
straightforward to interpret the current error codes. Many of the error
conditions only occur because of misuse of the system call (because of a lack
of documentation or examples).

I don't disagree with your sentiment, but probably changing the codes would be
cause more problems than not at this point.

--Mike

-- 
Any sufficiently adverse technology is indistinguishable from Microsoft.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue May 23 2000 - 21:00:24 EST