NetBSD Problem Report #26155

Received: (qmail 20516 invoked by uid 605); 3 Jul 2004 21:16:54 -0000
Message-Id: <200407032116.i63LGfE6016688@chassiron.antioche.eu.org>
Date: Sat, 3 Jul 2004 23:16:44 +0200 (MEST)
From: bouyer@antioche.eu.org (Manuel Bouyer)
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: bouyer@antioche.eu.org (Manuel Bouyer)
To: gnats-bugs@gnats.NetBSD.org
Subject: stat(2) always returns 0 for atime
X-Send-Pr-Version: 3.95

>Number:         26155
>Category:       kern
>Synopsis:       stat(2) always returns 0 for atime
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 03 21:17:00 +0000 2004
>Closed-Date:    Sat Jul 03 21:23:20 +0000 2004
>Last-Modified:  Sat Jul 03 21:27:00 +0000 2004
>Originator:     Manuel Bouyer
>Release:        NetBSD 2.0_BETA, sources of Jul, 3
>Organization:
>Environment:
System: NetBSD chassiron.antioche.eu.org 2.0_BETA NetBSD 2.0_BETA (CHASSIRON) #0: Sat Jul 3 19:31:18 CEST 2004 bouyer@pop.lip6.fr:/local/pop1/bouyer/tmp/sparc/obj/local/pop1/bouyer/netbsd-2-0/src/sys/arch/sparc/compile/CHASSIRON sparc
Architecture: sparc
Machine: sparc
>Description:
	This program:

#include <sys/stat.h>

main()
{
        struct stat st;

        while (1) {
                stat("/etc/passwd", &st);
                printf("size %ld atime %ld mtime %ld\n", st.st_size, st.st_atime, st.st_mtime);
                sleep(10);
        }
}

	always return 0 for atime. Tested with file FFS and NFS.
>How-To-Repeat:
	see above
>Fix:
	unknown
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: bouyer 
State-Changed-When: Sat Jul 3 21:22:57 UTC 2004 
State-Changed-Why:  
Sorry, my test program was wrong. 

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: netbsd-bugs@netbsd.org
Subject: Re: kern/26155: stat(2) always returns 0 for atime
Date: Sat, 3 Jul 2004 23:26:08 +0200

 On Sat, Jul 03, 2004 at 11:16:44PM +0200, Manuel Bouyer wrote:
 > >Description:
 > 	This program:
 > 
 > #include <sys/stat.h>
 > 
 > main()
 > {
 >         struct stat st;
 > 
 >         while (1) {
 >                 stat("/etc/passwd", &st);
 >                 printf("size %ld atime %ld mtime %ld\n", st.st_size, st.st_atime, st.st_mtime);
 >                 sleep(10);
 >         }
 > }
 > 
 > 	always return 0 for atime. Tested with file FFS and NFS.

 Err, I should have compiled it with -Wall :(
 The printf here doesn't to what it's intended for. I closed the PR.

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.