summaryrefslogtreecommitdiff
path: root/lib/replace/closefrom.c
Commit message (Collapse)AuthorAgeFilesLines
* libreplace: Add a closefrom() implementationVolker Lendecke2016-06-131-0/+138
There is closefrom in some BSDs, but Linux ships this only as part of libbsd. Add a new implementation of it in libreplace. The one in libbsd of jessie and upstream differ and it has for example optimizations for FreeBSD, but it gets some of the array calculations slightly wrong from my point of view. If you want those, use libbsd. This replacement is optimized on Linux only looking at /proc/self/fd/, everything else would do the OPEN_MAX brute force fallback. Signed-off-by: Volker Lendecke <vl@samba.org>