Function passwd

Synopsis

#include <src/uvw/util.h>

static Passwd passwd() noexcept

Description

Gets a subset of the password file entry.

This function can be used to get the subset of the password file entry for the current effective uid (not the real uid).

See the official documentation for further details.

Returns
The accessible subset of the password file entry.

Source

Lines 115-124 in src/uvw/util.cpp. Line 586 in src/uvw/util.h.

UVW_INLINE Passwd Utilities::OS::passwd() noexcept {
    auto deleter = [](uv_passwd_t *passwd){
        uv_os_free_passwd(passwd);
        delete passwd;
    };

    std::shared_ptr<uv_passwd_t> ptr{new uv_passwd_t, std::move(deleter)};
    uv_os_get_passwd(ptr.get());
    return ptr;
}





Add Discussion as Guest

Log in