Re: get_unused_fd and get_unused_fd_flags

From: Al Viro
Date: Fri Jun 22 2012 - 05:47:15 EST


On Fri, Jun 22, 2012 at 12:33:35PM +0300, Ozan ??a??layan wrote:
> But get_unused_fd_flags() is implemented through a macro:
>
> #define get_unused_fd_flags(flags) alloc_fd(0, (flags))
>
> Both are wrappers around alloc_fd(). I'm quite new to this stuff but
> why there's an asymmetry in here? One is exposed, the other is not.

Because get_unused_fd_flags() never had been exported. And
default policy for exports is "Don't, unless somebody can
demonstrate a clear need that can't be handled in other
ways".

> (BTW: I'm doing compat-drm stuff for GSoC and I have to call
> get_unused_fd_flags() but since alloc_fd() is not exported, this
> doesn't work.)

Details of that "have to", please. Note that existing modular uses of
get_unused_fd() tend to be rather fishy; if anything, I'd expect
get_unused_fd() eventually becoming internal-only, if we manage to
pull that off.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/