openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/util-linux/2.33.2-r0/util-linux-2.33.2/lib/path.c
ssize_t ul_path_readlink(struct path_cxt* pc, char* buf, size_t bufsiz,
                         const char* path)
{
    int dirfd;

    if (!path)
    {
        const char* p = get_absdir(pc);
        if (!p)
            return -errno;
        return readlink(p, buf, bufsiz);
    }

    dirfd = ul_path_get_dirfd(pc);
    if (dirfd < 0)
        return dirfd;

    return readlinkat(dirfd, path, buf, bufsiz);
}
/*
 * If @path is NULL then readlink is called on @pc directory.
 */
If @path is NULL then readlink is called on @pc directory.
If @path is NULL then readlink is called on @pc directory .
ssize_t ul_path_readlink(struct path_cxt* pc, char* buf, size_t bufsiz,
                         const char* path)
{
    int dirfd;
    if (!path)
    {
        const char* p = get_absdir(pc);
        if (!p)
            return -errno;
        return readlink(p, buf, bufsiz);
    }
    dirfd = ul_path_get_dirfd(pc);
    if (dirfd < 0)
        return dirfd;
    return readlinkat(dirfd, path, buf, bufsiz);
}
ssize_t ul_path_readlink ( struct path_cxt * pc , char * buf , size_t bufsiz , const char * path ) { int dirfd ; if ( ! path ) { const char * p = get_absdir ( pc ) ; if ( ! p ) return - errno ; return readlink ( p , buf , bufsiz ) ; } dirfd = ul_path_get_dirfd ( pc ) ; if ( dirfd < 0 ) return dirfd ; return readlinkat ( dirfd , path , buf , bufsiz ) ; }
If @path is NULL then readlink is called on @pc directory.
If @path is NULL then readlink is called on @pc directory .