On Thu, 14 Mar 2019 17:01:16 +0100
Bernd Petrovitsch <[email protected]> wrote:

> >  Thoughts?  
> 
> https://stackoverflow.com/questions/1315382/closing-all-open-files-in-a-process
> has something:
> - Use https://man.openbsd.org/closefrom.2 - which doesn't exist on
>   Linux.
> - use getdtablesize()
> - use sysconf(_SC_OPEN_MAX)


As Denys notes another common magic value seen in the wild is 1024.

RLIMIT_NOFILE, SC_OPEN_MAX, POSIX_OPEN_MAX, FOPEN_MAX come to mind, too.

Maybe someone should file a defect against SUS/POSIX to mandate
something sensible throughout, at least mid- or longterm?

thanks, 
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to