This repository has been archived by the owner on Aug 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: sysctl freebsd * compiles with free bsd * Update helpers/limit/sysctl_freebsd.go Co-authored-by: Kemal <[email protected]> * Update sysctl_windows.go Co-authored-by: Kemal <[email protected]>
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//go:build freebsd | ||
|
||
package limit | ||
|
||
import "errors" | ||
|
||
func calculateFileLimit() (uint64, error) { | ||
return 0, errors.New("file descriptors limiter not supported on this platform") | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//go:build freebsd | ||
|
||
package limit | ||
|
||
import ( | ||
"syscall" | ||
) | ||
|
||
func GetUlimit() (Rlimit, error) { | ||
var rLimit syscall.Rlimit | ||
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit) | ||
return Rlimit{uint64(rLimit.Cur), uint64(rLimit.Max)}, err | ||
} |