| 3188 | } |
| 3189 | |
| 3190 | int |
| 3191 | kern_utimesat(struct thread *td, int fd, const char *path, |
| 3192 | enum uio_seg pathseg, struct timeval *tptr, enum uio_seg tptrseg) |
| 3193 | { |
| 3194 | struct nameidata nd; |
| 3195 | struct timespec ts[2]; |
| 3196 | int error; |
| 3197 | |
| 3198 | if ((error = getutimes(tptr, tptrseg, ts)) != 0) |
| 3199 | return (error); |
| 3200 | NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, path, fd, |
| 3201 | &cap_futimes_rights, td); |
| 3202 | |
| 3203 | if ((error = namei(&nd)) != 0) |
| 3204 | return (error); |
| 3205 | NDFREE_NOTHING(&nd); |
| 3206 | error = setutimes(td, nd.ni_vp, ts, 2, tptr == NULL); |
| 3207 | vrele(nd.ni_vp); |
| 3208 | return (error); |
| 3209 | } |
| 3210 | |
| 3211 | /* |
| 3212 | * Set the access and modification times of a file. |
no test coverage detected