NetBSD Problem Report #19027

Received: (qmail 11517 invoked by uid 605); 12 Nov 2002 18:36:27 -0000
Message-Id: <200211121113.gACBD7o00824@percbsd>
Date: Tue, 12 Nov 2002 04:13:07 -0700 (MST)
From: joff@percbsd.netbsd.org
Sender: gnats-bugs-owner@netbsd.org
Reply-To: joff@percbsd.netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: linux times() syscall incorrectly handles times(NULL)
X-Send-Pr-Version: 3.95

>Number:         19027
>Category:       kern
>Synopsis:       linux times() syscall incorrectly handles times(NULL)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 12 18:37:00 +0000 2002
>Closed-Date:    Wed Nov 13 08:30:05 +0000 2002
>Last-Modified:  Thu Dec 12 21:30:01 +0000 2002
>Originator:     
>Release:        NetBSD 1.6_STABLE
>Organization:
	NewMonics, Inc.
>Environment:
System: NetBSD percbsd 1.6_STABLE NetBSD 1.6_STABLE (GENERIC) #0: Fri Nov 8 15:01:24 MST 2002 joff@susie:/u0/obj-1.6/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
	linux emulation of times() syscall should just return the uptime of
	the system rather than fail when it is given NULL as its argument.  
	This is consistent with how linux actually behaves.  
>How-To-Repeat:
	compile a program "int main(void) { printf("%d\n", times(NULL)); }"
	and compare the output between native linux and emulated linux.
>Fix:
	simple mod to sys/compat/linux/common/linux_misc.c linux_sys_times()

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jdolecek 
State-Changed-When: Wed Nov 13 00:28:46 PST 2002 
State-Changed-Why:  
Fix has been committed to -current and pullup requested for 1.6 
branch. 
Thank you for your report. 

From: Havard Eidnes <he@netbsd.org>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: pr/19027 CVS commit: [netbsd-1-6] syssrc/sys/compat/linux/common
Date: Thu, 12 Dec 2002 23:29:16 +0200 (EET)

 Module Name:	syssrc
 Committed By:	he
 Date:		Thu Dec 12 21:29:15 UTC 2002

 Modified Files:
 	syssrc/sys/compat/linux/common [netbsd-1-6]: linux_misc.c

 Log Message:
 Pull up revision 1.112 (requested by jdolecek in ticket #987):
   Correct linux_sys_times(): if tms is NULL, just return the
   number of ticks since boot instead of returning error; this
   matches what Linux does.  Fixes PR#19027.


 To generate a diff of this commit:
 cvs rdiff -r1.109.4.1 -r1.109.4.2 syssrc/sys/compat/linux/common/linux_misc.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.