| 2920 | } |
| 2921 | |
| 2922 | static int |
| 2923 | kern___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 | |
| 2945 | int |
| 2946 | sys___realpathat(struct thread *td, struct __realpathat_args *uap) |
no test coverage detected