Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Commit

Permalink
fix: Sysctl freebsd (#370)
Browse files Browse the repository at this point in the history
* fix: sysctl freebsd

* compiles with free bsd

* Update helpers/limit/sysctl_freebsd.go

Co-authored-by: Kemal <223029+disq@users.noreply.github.com>

* Update sysctl_windows.go

Co-authored-by: Kemal <223029+disq@users.noreply.github.com>
  • Loading branch information
roneli and disq committed Jun 26, 2022
1 parent dcfab30 commit f52efe9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions helpers/limit/sysctl_freebsd.go
@@ -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")
}
13 changes: 13 additions & 0 deletions helpers/limit/ulimit_freebsd.go
@@ -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
}

0 comments on commit f52efe9

Please sign in to comment.