Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix build error on Windows due to syscall package.
Move the syscall use into an internal helper package, behind a non-Windows build constraint. Also switch from syscall to golang.org/x/sys/unix, since syscall documentation recommends doing so. Fixes #695.
- Loading branch information
Showing
3 changed files
with
23 additions
and
3 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,13 @@ | ||
// +build !windows | ||
|
||
// Package sysutil contains system-specific utilities. | ||
package sysutil | ||
|
||
import "golang.org/x/sys/unix" | ||
|
||
// RlimitStack reports the current stack size limit in bytes. | ||
func RlimitStack() (cur uint64, err error) { | ||
var r unix.Rlimit | ||
err = unix.Getrlimit(unix.RLIMIT_STACK, &r) | ||
return r.Cur, err | ||
} |
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,7 @@ | ||
package sysutil | ||
|
||
import "errors" | ||
|
||
func RlimitStack() (uint64, error) { | ||
return 0, errors.New("RlimitStack is not implemented on Windows") | ||
} |
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