Create a gist now

Instantly share code, notes, and snippets.

Embed
Finding out user limits in Go
package main
import (
"fmt"
"syscall"
)
func main() {
r := syscall.Rlimit{}
syscall.Getrlimit(syscall.RLIMIT_NOFILE, &r)
fmt.Println("Open file current:", r.Cur)
fmt.Println("Open file maximum:", r.Max)
}
@ohookins

This comment has been minimized.

Show comment
Hide comment
@ohookins

ohookins Feb 25, 2013

$ ulimit -n
2560

$ ./limit_test
Open file current: 2560
Open file maximum: 9223372036854775807

Owner

ohookins commented Feb 25, 2013

$ ulimit -n
2560

$ ./limit_test
Open file current: 2560
Open file maximum: 9223372036854775807

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