• Stanislav Kinsburskiy's avatar
    files: new "used" files list introduced · 7e12d2dd
    Stanislav Kinsburskiy authored
    This list contains all per-process used file fdinfo's, sorted by fd number.
    Will be used to safely create new artificial file descriptors and also allow
    to recreate temporary descriptors with original number, if possible, like
    AutoFS tries to preserve original pipe write end descriptor, when it was
    closed.
    This patch also adds a couple of simple helpers to find unused file
    descriptor:
    1) fd_is_used() does exactly what it is named
    2) find_unused_fd() returns "hint_fd" if unused or last used descriptor plus
    one.
    Signed-off-by: 's avatarStanislav Kinsburskiy <skinsbursky@virtuozzo.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    7e12d2dd
rst_info.h 1.3 KB