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

Function kern_utimesat

freebsd/kern/vfs_syscalls.c:3190–3209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3188}
3189
3190int
3191kern_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.

Callers 2

sys_utimesFunction · 0.85
sys_futimesatFunction · 0.85

Calls 5

getutimesFunction · 0.85
nameiFunction · 0.85
NDFREE_NOTHINGFunction · 0.85
setutimesFunction · 0.85
vreleFunction · 0.70

Tested by

no test coverage detected