UDBUF(2)

NAME
udbuf - fetch file name component

SYNOPSIS
#include <sys/types.h>
#include <sys/dir.h>

int udbuf(name)
char name[DIRSIZ];

DESCRIPTION
Udbuf copies the current contents of the user's u.u_dbuf array into the array name. This is the most recent filename component decoded by the kernel subroutine namei. It is usually the last component of the filename which was most recently presented by the user process to a system call. If that file name, however, refered to an entry in a `blind directory' (see bl(4)) the kernel may have randomized the name before using it.

SEE ALSO
bl(4), mkunique(3)

DIAGNOSTICS
EFAULT

BUGS
Ill named. On a VAX the u. area is in user space, and the same effect may be had by:
    #include <sys/types.h>
    #include <sys/dir.h>
    #include <sys/user.h>
    struct user *ua = (struct user *)(0x80000000 - UPAGES*NBPG);
    strncpy(name, ua->u_dbuf, DIRSIZ);