Last active
December 14, 2015 04:49
-
-
Save ohookins/5030871 to your computer and use it in GitHub Desktop.
Finding out user limits in Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ ulimit -n
2560
$ ./limit_test
Open file current: 2560
Open file maximum: 9223372036854775807