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

cuisj opened this issue Nov 15, 2017 · 1 comment

syscall: Rlimit constant -1 overflows uint64 #22731

cuisj opened this issue Nov 15, 2017 · 1 comment


Copy link

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?


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


What did you do?

package main

import (

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

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
Copy link

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 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.
None yet

No branches or pull requests

3 participants