MCPcopy Create free account
hub / github.com/F-Stack/f-stack / kern___realpathat

Function kern___realpathat

freebsd/kern/vfs_cache.c:2922–2943  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2920}
2921
2922static int
2923kern___realpathat(struct thread *td, int fd, const char *path, char *buf,
2924 size_t size, int flags, enum uio_seg pathseg)
2925{
2926 struct nameidata nd;
2927 char *retbuf, *freebuf;
2928 int error;
2929
2930 if (flags != 0)
2931 return (EINVAL);
2932 NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | SAVENAME | WANTPARENT | AUDITVNODE1,
2933 pathseg, path, fd, &cap_fstat_rights, td);
2934 if ((error = namei(&nd)) != 0)
2935 return (error);
2936 error = vn_fullpath_hardlink(&nd, &retbuf, &freebuf, &size);
2937 if (error == 0) {
2938 error = copyout(retbuf, buf, size);
2939 free(freebuf, M_TEMP);
2940 }
2941 NDFREE(&nd, 0);
2942 return (error);
2943}
2944
2945int
2946sys___realpathat(struct thread *td, struct __realpathat_args *uap)

Callers 1

sys___realpathatFunction · 0.85

Calls 5

nameiFunction · 0.85
vn_fullpath_hardlinkFunction · 0.85
NDFREEFunction · 0.85
freeFunction · 0.70
copyoutFunction · 0.50

Tested by

no test coverage detected