Re: [PATCH] man: add instruction on clearing file descriptors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mo, 07.12.20 19:42, Mantas Mikulėnas (grawity@xxxxxxxxx) wrote:

> I'm not sure if it's more portable. I recall FreeBSD only exposing 0–2 in
> its /dev/fd by default unless you mounted a separate virtual filesystem
> there. NetBSD seems to always have 64 devnodes no matter how many fds.
>
> I don't think there's a *good* portable method (which is why closerange()
> is being added) and besides that I'm not sure if that is even in scope for
> this systemd-centric manpage...the whole idea is that under systemd, a
> daemon shouldn't need that.

Yes, I fully agree. This is messy and generally not portable. If you
care about portability maybe go the RLIMIT_NOFILE way, which is of
course terrible inefficient, but that's the price you have to pay for
portability I guess.

Anyway, I don't think mentioning /dev/fd/ is generally helpful, it's
misleading at best I think.

Lennart

--
Lennart Poettering, Berlin
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux