get_unused_fd and get_unused_fd_flags

From: Ozan ÃaÄlayan
Date: Fri Jun 22 2012 - 05:33:46 EST


Hi,

With,

commit 1027abe8827b47f7e9c4ed6514fde3d44f79963c
Author: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Date: Wed Jul 30 04:13:04 2008 -0400

[PATCH] merge locate_fd() and get_unused_fd()

New primitive: alloc_fd(start, flags). get_unused_fd() and
get_unused_fd_flags() become wrappers on top of it.

Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>

Two wrappers get_unused_fd() and get_unused_fd_flags() are introduced.
get_unused_fd() is an exported one-liner:

int get_unused_fd(void)
{
return alloc_fd(0, 0);
}
EXPORT_SYMBOL(get_unused_fd);

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.

(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.)

Thanks :)

--
Ozan ÃaÄlayan
--
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/