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

Function kern_futimens

freebsd/kern/vfs_syscalls.c:3295–3320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3293}
3294
3295int
3296kern_futimens(struct thread *td, int fd, struct timespec *tptr,
3297 enum uio_seg tptrseg)
3298{
3299 struct timespec ts[2];
3300 struct file *fp;
3301 int error, flags;
3302
3303 AUDIT_ARG_FD(fd);
3304 error = getutimens(tptr, tptrseg, ts, &flags);
3305 if (error != 0)
3306 return (error);
3307 if (flags & UTIMENS_EXIT)
3308 return (0);
3309 error = getvnode(td, fd, &cap_futimes_rights, &fp);
3310 if (error != 0)
3311 return (error);
3312#ifdef AUDIT
3313 vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY);
3314 AUDIT_ARG_VNODE1(fp->f_vnode);
3315 VOP_UNLOCK(fp->f_vnode);
3316#endif
3317 error = setutimes(td, fp->f_vnode, ts, 2, flags & UTIMENS_NULL);
3318 fdrop(fp, td);
3319 return (error);
3320}
3321
3322int
3323sys_utimensat(struct thread *td, struct utimensat_args *uap)

Callers 1

sys_futimensFunction · 0.85

Calls 4

getutimensFunction · 0.85
getvnodeFunction · 0.85
vn_lockFunction · 0.85
setutimesFunction · 0.85

Tested by

no test coverage detected