Currently there is no easy cross-platform way to detect the out of file descriptors error.
I propose adding a new error to the os package (os.ErrOutOfFileDescriptors) and adding support for it in syscall.Errno via the Is method (as already done with other errors like NoSuchFIle). So matching syscall.EMFILE, syscall.ENFILE on unix, syscall.EMFILE on other platforms.
I am still unsure about the name os.ErrOutOfFileDescriptors or os.ErrTooManyOpenFiles.
Currently there is no easy cross-platform way to detect the out of file descriptors error.
I propose adding a new error to the os package (
os.ErrOutOfFileDescriptors) and adding support for it insyscall.Errnovia theIsmethod (as already done with other errors like NoSuchFIle). So matchingsyscall.EMFILE,syscall.ENFILEon unix,syscall.EMFILEon other platforms.I am still unsure about the name
os.ErrOutOfFileDescriptorsoros.ErrTooManyOpenFiles.