Help us shape the future of Go! Take the 2026 Go Developer Survey

fdmax

package module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 6 Imported by: 6

README

fdmax

Small Helper library that increases automatically the maximum number of file descriptors for the current go program. It can be simply imported as follows:

package main

import (
	"fmt"

	_ "github.com/projectdiscovery/fdmax/autofdmax"
)

func main() {
	fmt.Println("test")
}

Documentation

Index

Constants

View Source
const (
	// UnixMax on unix systems
	UnixMax uint64 = 999999
	// OSXMax on darwin
	OSXMax uint64 = 24576
)

Variables

View Source
var (
	// ErrUnsupportedPlatform error if the platform doesn't support file descriptor increase via system api
	ErrUnsupportedPlatform = errors.New("unsupported platform")
)

Functions

func Set

func Set(maxLimit uint64) error

func SetWithUlimit added in v0.0.4

func SetWithUlimit(maxLimit uint64) error

Types

type Limits

type Limits struct {
	Current uint64
	Max     uint64
}

Limits contains the file system descriptor limits

func Get

func Get() (*Limits, error)

Get the current limits

func GetWithUlimit added in v0.0.4

func GetWithUlimit() (*Limits, error)

Directories

Path Synopsis
example
cmd command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL