Previously we've returned the error from native ptrace(2), ENOMEM.
This confused Linux strace(2).
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Btw, the ENOMEM return is not documented in the ptrace(2) man page. I wonder what's the better way: updating the man page, or changing the return?
I'm not sure. At some point PT_READ_I could return either EFAULT or ENOMEM depending on how the fault failed, but I squashed that to just ENOMEM in some refactoring years ago. EFAULT would have made more sense in retrospect.
I would be inclined to leave native ptrace alone and just do the translation here. Perhaps proactively squash EFAULT to EIO as well.
I agree with Mark. I think EFAULT is perhaps the better error code for the native case.
Either way, it's not EIO, so perhaps let's get this one committed, and then I'll follow up with the native stuff.
Fine with me, but I agree with @markj that making it error == ENOMEM || error == EFAULT already seems like a decent idea.
TBH I'm not a fan of adding code "just in case", except for assertions; to me, it makes reasoning about the code harder.