You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
439 B
21 lines
439 B
//go:build mage && !windows
|
|
// +build mage,!windows
|
|
|
|
package main
|
|
|
|
import (
|
|
"github.com/openimsdk/gomake/mageutil"
|
|
"syscall"
|
|
)
|
|
|
|
func setMaxOpenFiles() error {
|
|
var rLimit syscall.Rlimit
|
|
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
rLimit.Max = uint64(mageutil.MaxFileDescriptors)
|
|
rLimit.Cur = uint64(mageutil.MaxFileDescriptors)
|
|
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
|
|
}
|