golanggohlsrtmpwebrtcmedia-serverobs-studiortcprtmp-proxyrtmp-serverrtprtsprtsp-proxyrtsp-relayrtsp-serversrtstreamingwebrtc-proxy
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.
31 lines
548 B
31 lines
548 B
//go:build !windows |
|
// +build !windows |
|
|
|
// Package rlimit contains a function to raise rlimit. |
|
package rlimit |
|
|
|
import ( |
|
"syscall" |
|
) |
|
|
|
// Raise raises the number of file descriptors that can be opened. |
|
func Raise() error { |
|
var rlim syscall.Rlimit |
|
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rlim) |
|
if err != nil { |
|
return err |
|
} |
|
|
|
rlim.Cur = 999999 |
|
err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) |
|
if err != nil { |
|
return err |
|
} |
|
|
|
err = syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rlim) |
|
if err != nil { |
|
return err |
|
} |
|
|
|
return nil |
|
}
|
|
|