Subject: kern/19027: linux times() syscall incorrectly handles times(NULL)
To: None <gnats-bugs@gnats.netbsd.org>
From: None <joff@percbsd.netbsd.org>
List: netbsd-bugs
Date: 11/12/2002 04:13:07
>Number:         19027
>Category:       kern
>Synopsis:       linux times() syscall incorrectly handles times(NULL)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 12 10:37:00 PST 2002
>Closed-Date:
>Last-Modified:
>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:
>Unformatted: