NetBSD Problem Report #44847

From jruohone@gmail.com  Sun Apr 10 07:46:56 2011
Return-Path: <jruohone@gmail.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 0D05563BEAA
	for <gnats-bugs@gnats.netbsd.org>; Sun, 10 Apr 2011 07:46:56 +0000 (UTC)
Message-Id: <20110410074637.6657756C5@marx.bitnet>
Date: Sun, 10 Apr 2011 10:46:37 +0300 (EEST)
From: Jukka Ruohonen <jruohonen@iki.fi>
Sender: a b <jruohone@gmail.com>
Reply-To: jruohonen@iki.fi
To: gnats-bugs@gnats.NetBSD.org
Subject: blksize_t is not a signed integer
X-Send-Pr-Version: 3.95

>Number:         44847
>Category:       standards
>Synopsis:       blksize_t is not a signed integer
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    standards-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 10 07:50:00 +0000 2011
>Closed-Date:    Sun Mar 18 07:15:08 +0000 2012
>Last-Modified:  Sun Mar 18 20:55:01 +0000 2012
>Originator:     Jukka Ruohonen
>Release:        5.99.48
>Organization:
-
>Environment:

>Description:

As noted in types(3), the blksize_t -type should be a signed integer.

>How-To-Repeat:

"blksize_t, pid_t, and ssize_t shall be signed integer types."

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html

>Fix:

Change it? Possible consequences?

>Release-Note:

>Audit-Trail:
From: "Jukka Ruohonen" <jruoho@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44847 CVS commit: src
Date: Sun, 10 Apr 2011 08:07:42 +0000

 Module Name:	src
 Committed By:	jruoho
 Date:		Sun Apr 10 08:07:42 UTC 2011

 Modified Files:
 	src/distrib/sets/lists/tests: mi
 	src/tests/include: Makefile
 Added Files:
 	src/tests/include: t_types.c

 Log Message:
 Add tests for PR standards/44847 and PR standards/18067.


 To generate a diff of this commit:
 cvs rdiff -u -r1.303 -r1.304 src/distrib/sets/lists/tests/mi
 cvs rdiff -u -r1.2 -r1.3 src/tests/include/Makefile
 cvs rdiff -u -r0 -r1.1 src/tests/include/t_types.c

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

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44847 CVS commit: src/sys/sys
Date: Sat, 17 Mar 2012 17:30:31 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Sat Mar 17 21:30:30 UTC 2012

 Modified Files:
 	src/sys/sys: types.h

 Log Message:
 PR/44847: Jukka Ruohonen: blksize_t should be signed.
 http://pubs.opengroup.org/onlinepubs/000095399/basedefs/sys/types.h.html


 To generate a diff of this commit:
 cvs rdiff -u -r1.88 -r1.89 src/sys/sys/types.h

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

State-Changed-From-To: open->closed
State-Changed-By: jruoho@NetBSD.org
State-Changed-When: Sun, 18 Mar 2012 07:15:08 +0000
State-Changed-Why:
Fixed, thanks.


From: Martin Husemann <martin@homeworld.netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: christos@NetBSD.org, jruohonen@iki.fi
Subject: Re: PR/44847 CVS commit: src/sys/sys
Date: Sun, 18 Mar 2012 11:57:03 +0000

 On Sat, Mar 17, 2012 at 09:35:02PM +0000, Christos Zoulas wrote:
 >  Log Message:
 >  PR/44847: Jukka Ruohonen: blksize_t should be signed.
 >  http://pubs.opengroup.org/onlinepubs/000095399/basedefs/sys/types.h.html

 I object to this change, that part of the standard is obviously bogus
 and should not be blindly followed.

 What use would a negative blocksize have?

 Martin

From: Jukka Ruohonen <jruohonen@iki.fi>
To: gnats-bugs@NetBSD.org
Cc: standards-manager@NetBSD.org, gnats-admin@NetBSD.org,
	netbsd-bugs@NetBSD.org, jruohonen@iki.fi
Subject: Re: PR/44847 CVS commit: src/sys/sys
Date: Sun, 18 Mar 2012 14:06:06 +0200

 On Sun, Mar 18, 2012 at 12:00:07PM +0000, Martin Husemann wrote:
 > The following reply was made to PR standards/44847; it has been noted by GNATS.
 > 
 > From: Martin Husemann <martin@homeworld.netbsd.org>
 > To: gnats-bugs@NetBSD.org
 > Cc: christos@NetBSD.org, jruohonen@iki.fi
 > Subject: Re: PR/44847 CVS commit: src/sys/sys
 > Date: Sun, 18 Mar 2012 11:57:03 +0000
 > 
 >  On Sat, Mar 17, 2012 at 09:35:02PM +0000, Christos Zoulas wrote:
 >  >  Log Message:
 >  >  PR/44847: Jukka Ruohonen: blksize_t should be signed.
 >  >  http://pubs.opengroup.org/onlinepubs/000095399/basedefs/sys/types.h.html
 >  
 >  I object to this change, that part of the standard is obviously bogus
 >  and should not be blindly followed.

 I agree; it seems to me that this was inherited from whatever system was
 used as a base at the time of standardization (Solaris, AIX, or something).

 >  What use would a negative blocksize have?

 Not any I can think of. But maybe some error returns, etc., no idea.

 - Jukka.

From: christos@zoulas.com (Christos Zoulas)
To: Martin Husemann <martin@homeworld.netbsd.org>, gnats-bugs@NetBSD.org
Cc: jruohonen@iki.fi
Subject: Re: PR/44847 CVS commit: src/sys/sys
Date: Sun, 18 Mar 2012 10:25:02 -0400

 On Mar 18, 11:57am, martin@homeworld.netbsd.org (Martin Husemann) wrote:
 -- Subject: Re: PR/44847 CVS commit: src/sys/sys

 | On Sat, Mar 17, 2012 at 09:35:02PM +0000, Christos Zoulas wrote:
 | >  Log Message:
 | >  PR/44847: Jukka Ruohonen: blksize_t should be signed.
 | >  http://pubs.opengroup.org/onlinepubs/000095399/basedefs/sys/types.h.html
 | 
 | I object to this change, that part of the standard is obviously bogus
 | and should not be blindly followed.

 You realize that the internal kernel blocksize bookkeeping was already
 signed (va_blocksize)?

 | What use would a negative blocksize have?

 Don't know, but if you grep all 360+ usages of st_blksize in userland,
 they all assumed signed (except 1, in bin/cat).

 christos

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: PR/44847 CVS commit: src/sys/sys
Date: Sun, 18 Mar 2012 15:28:08 +0100

 On Sun, Mar 18, 2012 at 02:25:02PM +0000, Christos Zoulas wrote:
 >  You realize that the internal kernel blocksize bookkeeping was already
 >  signed (va_blocksize)?

 No, can we fix that instead? ;-)

 >  Don't know, but if you grep all 360+ usages of st_blksize in userland,
 >  they all assumed signed (except 1, in bin/cat).

 Gross - for what value of "assumed" is that?

 Martin

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, standards-manager@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, jruohonen@iki.fi
Cc: 
Subject: Re: PR/44847 CVS commit: src/sys/sys
Date: Sun, 18 Mar 2012 10:56:32 -0400

 On Mar 18,  2:30pm, martin@duskware.de (Martin Husemann) wrote:
 -- Subject: Re: PR/44847 CVS commit: src/sys/sys

 | The following reply was made to PR standards/44847; it has been noted by GNATS.
 | 
 | From: Martin Husemann <martin@duskware.de>
 | To: gnats-bugs@NetBSD.org
 | Cc: 
 | Subject: Re: PR/44847 CVS commit: src/sys/sys
 | Date: Sun, 18 Mar 2012 15:28:08 +0100
 | 
 |  On Sun, Mar 18, 2012 at 02:25:02PM +0000, Christos Zoulas wrote:
 |  >  You realize that the internal kernel blocksize bookkeeping was already
 |  >  signed (va_blocksize)?
 |  
 |  No, can we fix that instead? ;-)

 That's a larger undertaking :-)

 |  >  Don't know, but if you grep all 360+ usages of st_blksize in userland,
 |  >  they all assumed signed (except 1, in bin/cat).
 |  
 |  Gross - for what value of "assumed" is that?

 Checking if negative or 0, casting to signed etc.

 christos

From: Klaus Klein <kleink@kleink.org>
To: gnats-bugs@NetBSD.org, standards-manager@NetBSD.org,
	netbsd-bugs@NetBSD.org, jruohonen@iki.fi
Cc: christos@NetBSD.org
Subject: Re: PR/44847 CVS commit: src/sys/sys
Date: Sun, 18 Mar 2012 21:53:09 +0100

 On Sun, Mar 18, 2012 at 02:06:06PM +0200, Jukka Ruohonen wrote:
 > On Sun, Mar 18, 2012 at 12:00:07PM +0000, Martin Husemann wrote:
 > > The following reply was made to PR standards/44847; it has been noted by GNATS.
 > > 
 > > From: Martin Husemann <martin@homeworld.netbsd.org>
 > > To: gnats-bugs@NetBSD.org
 > > Cc: christos@NetBSD.org, jruohonen@iki.fi
 > > Subject: Re: PR/44847 CVS commit: src/sys/sys
 > > Date: Sun, 18 Mar 2012 11:57:03 +0000
 > > 
 > >  On Sat, Mar 17, 2012 at 09:35:02PM +0000, Christos Zoulas wrote:
 > >  >  Log Message:
 > >  >  PR/44847: Jukka Ruohonen: blksize_t should be signed.
 > >  >  http://pubs.opengroup.org/onlinepubs/000095399/basedefs/sys/types.h.html
 > >  
 > >  I object to this change, that part of the standard is obviously bogus
 > >  and should not be blindly followed.
 > 
 > I agree; it seems to me that this was inherited from whatever system was
 > used as a base at the time of standardization (Solaris, AIX, or something).

 And in the spirit of standadizing existing practice, so did 4.3BSD for
 that matter.  It wasn't until 4.4 that stat.st_blksize got changed from
 signed long to unsigned long.  (I should have looked up that detail
 earlier, sorry.)


 - Klaus

>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-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.