Skip to content

std.os.linux: add ptrace and associated constants - #14839

Closed
mllken wants to merge 4 commits into
ziglang:masterfrom
mllken:linuxptrace
Closed

std.os.linux: add ptrace and associated constants#14839
mllken wants to merge 4 commits into
ziglang:masterfrom
mllken:linuxptrace

Conversation

@mllken

@mllkenmllken commented Mar 8, 2023

Copy link
Copy Markdown
Contributor

Add support for the ptrace syscall on Linux.

  • The data argument can sometimes be used as an address, and sometimes as a bit mask, so the type is set to usize.
  • According to man ptrace(2), SPARC architecture reverses the data and addr arguments for some operations, so set addr's type to usize
  • A higher level API could later be added in os/ptrace.zig.

@mllken

Copy link
Copy Markdown
ContributorAuthor

I reverted the high level API change, since the new function signature of the high level API didn't match the existing signature in os/ptrace.zig. I'll limit my changes to std.os.linux for now. PTAL

@ifreund

Copy link
Copy Markdown
Member

This is actually included in #14647 in 9fabd40. I'd rather just wait for that to be merged in order to avoid conflicts.

@mllken

Copy link
Copy Markdown
ContributorAuthor

Ok! Makes sense, closing.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mllken@ifreund