From 2bea9c5040319c3fb9d928e7a84659742b2b46c7 Mon Sep 17 00:00:00 2001 From: kirill Date: Sun, 29 Mar 2026 09:37:33 +0000 Subject: [PATCH] sys/tmpfs: use getnanotime() like FFS and MFS Editing files on tmpfs uses nanotime() to update mtime, and touch uses utimensat(UTIME_NOW) which uses getnanotime() which is cached and which can be smaller. So, sed ... A && touch B leads to mtime(A) > mtime(B) which isn't excted. "Yep" deraadt@ --- sys/tmpfs/tmpfs_subr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/tmpfs/tmpfs_subr.c b/sys/tmpfs/tmpfs_subr.c index 70ea9baa9dc..6b5322e1fb6 100644 --- a/sys/tmpfs/tmpfs_subr.c +++ b/sys/tmpfs/tmpfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tmpfs_subr.c,v 1.27 2024/09/12 09:04:51 claudio Exp $ */ +/* $OpenBSD: tmpfs_subr.c,v 1.28 2026/03/29 09:37:33 kirill Exp $ */ /* $NetBSD: tmpfs_subr.c,v 1.79 2012/03/13 18:40:50 elad Exp $ */ /* @@ -1140,7 +1140,7 @@ tmpfs_update(tmpfs_node_t *node, int flags) { struct timespec nowtm; - nanotime(&nowtm); + getnanotime(&nowtm); if (flags & TMPFS_NODE_ACCESSED) { node->tn_atime = nowtm;