Split resource limit checks into platform-specific files to handle syscall API differences across operating systems. Changes: - Created resources_unix.go (Linux, macOS, FreeBSD, OpenBSD) - Created resources_windows.go (Windows stub implementation) - Created disk_check_netbsd.go (NetBSD stub - syscall.Statfs unavailable) - Modified resources.go to delegate to checkPlatformLimits() - Fixed BSD syscall.Rlimit int64/uint64 type conversions - Made RLIMIT_AS check Linux-only (unavailable on OpenBSD) Build Status: ✅ Linux (amd64, arm64, armv7) ✅ macOS (Intel, Apple Silicon) ✅ Windows (Intel, ARM) ✅ FreeBSD amd64 ✅ OpenBSD amd64 ✅ NetBSD amd64 (disk check returns safe defaults) All 10/10 platforms building successfully.
10 lines
218 B
Go
10 lines
218 B
Go
// go:build !linux
|
|
// +build !linux
|
|
|
|
package security
|
|
|
|
// checkVirtualMemoryLimit is a no-op on non-Linux systems (RLIMIT_AS not available)
|
|
func checkVirtualMemoryLimit(minVirtualMemoryMB uint64) error {
|
|
return nil
|
|
}
|