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

syscall: Rlimit constant -1 overflows uint64 #22731

Closed
cuisj opened this issue Nov 15, 2017 · 1 comment
Closed

syscall: Rlimit constant -1 overflows uint64 #22731

cuisj opened this issue Nov 15, 2017 · 1 comment

Comments

@cuisj
Copy link

@cuisj cuisj commented Nov 15, 2017

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

go version go1.9.2

Does this issue reproduce with the latest release?

yes

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

linux/amd64

What did you do?

package main

import (
"log"
"syscall"
)

func main() {
rlim := syscall.Rlimit{Cur: syscall.RLIM_INFINITY, Max: syscall.RLIM_INFINITY}
log.Println(rlim)
}

build: go build k.go
output: constant -1 overflows uint64

What did you expect to see?

syscall.RLIM_INFINITY can direcly set to syscall.Rlimit.Cur or syscall.Rlimit.Max

@gbbr gbbr changed the title syscall.Rlimit constant -1 overflows uint64 syscall: Rlimit constant -1 overflows uint64 Nov 15, 2017
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Nov 15, 2017

I think that changing this in the syscall package will break the Go 1 compatibility guarantee, in that people who are already working around this problem in their code will have their workaround broken.

Use the golang.org/x/sys/unix package instead. There the value is the more reasonable 0xfffffffffffffffff.

Closing as unfortunate.

@golang golang locked and limited conversation to collaborators Nov 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.