Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jan 2003 15:53:46 -0500 (EST)
From:      Hal Burch <hburch@lumeta.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/47168: st_*timespec tv_nsec zero on file creation
Message-ID:  <20030117205346.6118B5E3@hburch.corp.lumeta.com>

next in thread | raw e-mail | index | archive | help

>Number:         47168
>Category:       kern
>Synopsis:       st_*timespec tv_nsec zero on file creation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 17 13:00:22 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Hal Burch
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
>Environment:
System: FreeBSD hburch.corp.lumeta.com 4.7-STABLE FreeBSD 4.7-STABLE #1: Thu Oct 17 10:07:42 EDT 2002 root@hburch.corp.lumeta.com:/usr/obj/usr/src/sys/LOCAL i386
>Description:
tv_nsec in st_atimespec, st_mtimespec, and st_ctimespec are all zero
after most system calls.
>How-To-Repeat:
stat-ing code:
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>

int main(int argc, char **argv) {
	struct stat sb;
	if (argc < 2) { fprintf (stderr, "No args\n"); exit(1); }
	if (stat(argv[1], &sb) < 0) { perror("stat"); exit(1); }
	fprintf (stdout, "%i.%09i\n", 
		sb.st_atimespec.tv_sec, sb.st_atimespec.tv_nsec);
}

$ rm -f a; touch a; ./dostat a
1042836075.000000000
$ rm -f a; touch a; ./dostat a
1042836079.000000000
$ cat a; ./dostat a
1042836123.000000000
$ rm a; >a; ./dostat a
1042836191.000000000
>Fix:
I'm not familiar enough with the kernel tree to figure out where this
system times are being set.  This may also be expected behavior.
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030117205346.6118B5E3>