Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/sys/unix: Prctl should return (int, error) #35978

Closed
robertlacroix opened this issue Dec 5, 2019 · 2 comments
Closed

x/sys/unix: Prctl should return (int, error) #35978

robertlacroix opened this issue Dec 5, 2019 · 2 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@robertlacroix
Copy link

What version of Go are you using (go version)?

go1.13.4

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

Linux on amd64

According to http://man7.org/linux/man-pages/man2/prctl.2.html the signature of prctl is

int prctl(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5);

unix.Prctl on the other hand is not returning the int. For some options that return value is relevant, for example PR_GET_NO_NEW_PRIVS and others (search for as the function result in the man page).

Could unix.Prctl be changed to return (int, error)?

@gopherbot gopherbot added this to the Unreleased milestone Dec 5, 2019
@ianlancetaylor ianlancetaylor changed the title x/sys: unix.Prctl should return (int, error) x/sys/unix: Prctl should return (int, error) Dec 5, 2019
@ianlancetaylor ianlancetaylor added help wanted NeedsFix The path to resolution is known, but the work has not been done. labels Dec 5, 2019
@ianlancetaylor
Copy link
Contributor

I'm not sure we should touch the existing Prctl, as that would break existing programs. But we should probably add a variant that returns (int, error).

@gopherbot
Copy link

Change https://golang.org/cl/209969 mentions this issue: unix: Add Prctl variant that returns (int, error)

@golang golang locked and limited conversation to collaborators Dec 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants