All of lore.kernel.org
 help / color / mirror / Atom feed
* get_unused_fd and get_unused_fd_flags
@ 2012-06-22  9:33 Ozan Çağlayan
  2012-06-22  9:47 ` Al Viro
  0 siblings, 1 reply; 4+ messages in thread
From: Ozan Çağlayan @ 2012-06-22  9:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: viro, mcgrof

Hi,

With,

commit 1027abe8827b47f7e9c4ed6514fde3d44f79963c
Author: Al Viro <viro@zeniv.linux.org.uk>
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@zeniv.linux.org.uk>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-22 10:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-22  9:33 get_unused_fd and get_unused_fd_flags Ozan Çağlayan
2012-06-22  9:47 ` Al Viro
2012-06-22  9:59   ` Ozan Çağlayan
2012-06-22 10:34     ` Ozan Çağlayan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.