From owner-svn-src-all@freebsd.org Wed Dec 5 17:28:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7249F1321E3D; Wed, 5 Dec 2018 17:28:41 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 183957F37A; Wed, 5 Dec 2018 17:28:41 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E913317858; Wed, 5 Dec 2018 17:28:40 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB5HSe30099328; Wed, 5 Dec 2018 17:28:40 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB5HSes8099327; Wed, 5 Dec 2018 17:28:40 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201812051728.wB5HSes8099327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 5 Dec 2018 17:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341598 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 341598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 183957F37A X-Spamd-Result: default: False [-0.86 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.54)[-0.543,0]; NEURAL_HAM_LONG(-0.07)[-0.072,0]; NEURAL_HAM_SHORT(-0.25)[-0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Dec 2018 17:28:41 -0000 Author: asomers Date: Wed Dec 5 17:28:40 2018 New Revision: 341598 URL: https://svnweb.freebsd.org/changeset/base/341598 Log: stat(2): clarify which syscalls modify file timestamps The list of syscalls that modify st_atim, st_mtim, and st_ctim was quite out of date and probably not accurate to begin with. Update it, and make it clear that the list is open-ended. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18410 Modified: head/lib/libc/sys/stat.2 Modified: head/lib/libc/sys/stat.2 ============================================================================== --- head/lib/libc/sys/stat.2 Wed Dec 5 17:13:33 2018 (r341597) +++ head/lib/libc/sys/stat.2 Wed Dec 5 17:28:40 2018 (r341598) @@ -28,7 +28,7 @@ .\" @(#)stat.2 8.4 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd November 11, 2018 +.Dd December 5, 2018 .Dt STAT 2 .Os .Sh NAME @@ -193,45 +193,53 @@ are: .Bl -tag -width ".Va st_birthtim" .It Va st_atim Time when file data was last accessed. -Changed by the -.Xr mknod 2 , -.Xr utimes 2 , +Changed implicitly by syscalls such as .Xr read 2 and -.Xr readv 2 -system calls. +.Xr readv 2 , +and explicitly by +.Xr utimes 2 . .It Va st_mtim Time when file data was last modified. -Changed by the +Changed implicitly by syscalls such as +.Xr truncate 2 , +.Xr write 2 , +and +.Xr writev 2 , +and explicitly by +.Xr utimes 2 . +Also, any syscall which modifies directory content changes the +.Va st_mtim +for the affected directory. +For instance, +.Xr creat 2 , .Xr mkdir 2 , -.Xr mkfifo 2 , -.Xr mknod 2 , -.Xr utimes 2 , -.Xr write 2 +.Xr rename 2 , +.Xr link 2 , and -.Xr writev 2 -system calls. +.Xr unlink 2 . .It Va st_ctim Time when file status was last changed (inode data modification). -Changed by the +Changed implicitly by any syscall that affects file metadata, including +.Va st_mtim , +such as .Xr chflags 2 , .Xr chmod 2 , .Xr chown 2 , +.Xr truncate 2 , +.Xr utimes 2 , +and +.Xr write 2 . +Also, any syscall which modifies directory content changes the +.Va st_ctim +for the affected directory. +For instance, .Xr creat 2 , -.Xr link 2 , .Xr mkdir 2 , -.Xr mkfifo 2 , -.Xr mknod 2 , .Xr rename 2 , -.Xr rmdir 2 , -.Xr symlink 2 , -.Xr truncate 2 , -.Xr unlink 2 , -.Xr utimes 2 , -.Xr write 2 +.Xr link 2 , and -.Xr writev 2 -system calls. +.Xr unlink 2 . .It Va st_birthtim Time when the inode was created. .El