kubo/cmd/ipfs/ulimit.go
Jeromy 1cd7e58c80 ulimit: handle freebsd ulimit code separately from the rest of the unixes
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-11-30 10:27:22 -08:00

20 lines
293 B
Go

package main
import (
"os"
"strconv"
)
var ipfsFileDescNum = uint64(1024)
func init() {
if val := os.Getenv("IPFS_FD_MAX"); val != "" {
n, err := strconv.Atoi(val)
if err != nil {
log.Errorf("bad value for IPFS_FD_MAX: %s", err)
} else {
ipfsFileDescNum = uint64(n)
}
}
}