NetBSD Problem Report #50230

From www@NetBSD.org  Fri Sep 11 07:57:17 2015
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 5AAEDA65D4
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 11 Sep 2015 07:57:17 +0000 (UTC)
Message-Id: <20150911075716.1ABD2A65D5@mollari.NetBSD.org>
Date: Fri, 11 Sep 2015 07:57:16 +0000 (UTC)
From: Heiko@hexco.de
Reply-To: Heiko@hexco.de
To: gnats-bugs@NetBSD.org
Subject: conflict in type declaration of 'idtype_t' from sys/types.h with POSIX sys/wait.h
X-Send-Pr-Version: www-1.0

>Number:         50230
>Category:       kern
>Synopsis:       conflict in type declaration of 'idtype_t' from sys/types.h with POSIX sys/wait.h
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 11 08:00:00 +0000 2015
>Last-Modified:  Mon Oct 12 16:00:00 +0000 2015
>Originator:     Heiko Eißfeldt
>Release:        NetBSD7.0 RC3 amd64
>Organization:
>Environment:
VirtualBox 5.0 on Ubuntu 14.04 LTS amd64 running stock NetBSD7.0-RC3 amd64 install
>Description:
Hello dear NetBSD people,

during compilation of schilytools I found an incompatibility/conflict in the type declaration of 'idtype_t'.

The declaration of type 'idtype_t' in NetBSD in sys/types.h is:

typedef int idtype_t;

while the declaration according to POSIX is in sys/wait.h and has a different meaning.

Quote from POSIX documentation (see http://pubs.opengroup.org/onlinepubs/007904975/basedefs/sys/wait.h.html):
The type idtype_t shall be defined as an enumeration type whose possible values shall include at least the following: P_ALL P_PID P_PGID

End quote

Please note that sys/wait.h unfortunately also includes sys/types.h.
>How-To-Repeat:
I tried to compile the program suite schilytools
(http://sourceforge.net/projects/schilytools/files/schily-2015-09-03.tar.bz2/download)
with NetBSD_7.0RC3 amd64. The compilation of 'osh' failed with undeclared identifiers 'P_ALL', 'P_PID', and 'P_PGID'.
(I used the script psmake/MAKE-all to compile the whole suite).

Schilytools has an autoconf test for type idtype_t, but certainly did not expect a conflicting declaration.

>Fix:
suggestion: rename NetBSD's type 'idtype_t' to something more special.

>Audit-Trail:
From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: kern/50230: conflict in type declaration of 'idtype_t' from sys/types.h with POSIX sys/wait.h
Date: Fri, 11 Sep 2015 07:15:07 -0400

 On Sep 11,  8:00am, Heiko@hexco.de (Heiko@hexco.de) wrote:
 -- Subject: kern/50230: conflict in type declaration of 'idtype_t' from sys/t

 | during compilation of schilytools I found an incompatibility/conflict in the type declaration of 'idtype_t'.
 | 
 | The declaration of type 'idtype_t' in NetBSD in sys/types.h is:
 | 
 | typedef int idtype_t;
 | 
 | while the declaration according to POSIX is in sys/wait.h and has a different meaning.
 | 
 | Quote from POSIX documentation (see http://pubs.opengroup.org/onlinepubs/007904975/basedefs/sys/wait.h.html):
 | The type idtype_t shall be defined as an enumeration type whose possible values shall include at least the following: P_ALL P_PID P_PGID
 | 
 | End quote
 | 
 | Please note that sys/wait.h unfortunately also includes sys/types.h.
 | >How-To-Repeat:
 | I tried to compile the program suite schilytools
 | (http://sourceforge.net/projects/schilytools/files/schily-2015-09-03.tar.bz2/download)
 | with NetBSD_7.0RC3 amd64. The compilation of 'osh' failed with undeclared identifiers 'P_ALL', 'P_PID', and 'P_PGID'.
 | (I used the script psmake/MAKE-all to compile the whole suite).
 | 
 | Schilytools has an autoconf test for type idtype_t, but certainly did not expect a conflicting declaration.

 Well, even if we add these constants the program will fail because we'll be
 missing the waitid() call which is probably trying to use. It should autoconf
 for the existance of the call directly.

 christos

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/50230: conflict in type declaration of 'idtype_t' from sys/types.h with POSIX sys/wait.h
Date: Fri, 11 Sep 2015 13:26:41 +0200

 On Fri, Sep 11, 2015 at 11:20:01AM +0000, Christos Zoulas wrote:
 >  Well, even if we add these constants the program will fail because we'll be
 >  missing the waitid() call which is probably trying to use. It should autoconf
 >  for the existance of the call directly.

 It seems the typedef is unused in our tree - maybe we should just remove the
 definition?

 Martin

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, Heiko@hexco.de
Cc: 
Subject: Re: kern/50230: conflict in type declaration of 'idtype_t' from sys/types.h with POSIX sys/wait.h
Date: Fri, 11 Sep 2015 08:06:51 -0400

 On Sep 11, 11:30am, martin@duskware.de (Martin Husemann) wrote:
 -- Subject: Re: kern/50230: conflict in type declaration of 'idtype_t' from s

 | The following reply was made to PR kern/50230; it has been noted by GNATS.
 | 
 | From: Martin Husemann <martin@duskware.de>
 | To: gnats-bugs@NetBSD.org
 | Cc: 
 | Subject: Re: kern/50230: conflict in type declaration of 'idtype_t' from sys/types.h with POSIX sys/wait.h
 | Date: Fri, 11 Sep 2015 13:26:41 +0200
 | 
 |  On Fri, Sep 11, 2015 at 11:20:01AM +0000, Christos Zoulas wrote:
 |  >  Well, even if we add these constants the program will fail because we'll be
 |  >  missing the waitid() call which is probably trying to use. It should autoconf
 |  >  for the existance of the call directly.
 |  
 |  It seems the typedef is unused in our tree - maybe we should just remove the
 |  definition?

 It is used in pset..

 christos

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/50230: conflict in type declaration of 'idtype_t' from
 sys/types.h with POSIX sys/wait.h
Date: Sun, 11 Oct 2015 00:14:09 +0000

 On Fri, Sep 11, 2015 at 08:00:01AM +0000, Heiko@hexco.de wrote:
  > while the declaration according to POSIX is in sys/wait.h and has a
  > different meaning.

 Apparently POSIX or somebody went and invented a "waitid" call that
 uses this type. We don't have any such call.

 Is this something we need to have, or is it a posix_mistake?

 -- 
 David A. Holland
 dholland@netbsd.org

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, Heiko@hexco.de
Cc: 
Subject: Re: kern/50230: conflict in type declaration of 'idtype_t' from sys/types.h with POSIX sys/wait.h
Date: Sat, 10 Oct 2015 21:04:36 -0400

 On Oct 11, 12:15am, dholland-bugs@netbsd.org (David Holland) wrote:
 -- Subject: Re: kern/50230: conflict in type declaration of 'idtype_t' from s

 | The following reply was made to PR kern/50230; it has been noted by GNATS.
 | 
 | From: David Holland <dholland-bugs@netbsd.org>
 | To: gnats-bugs@NetBSD.org
 | Cc: 
 | Subject: Re: kern/50230: conflict in type declaration of 'idtype_t' from
 |  sys/types.h with POSIX sys/wait.h
 | Date: Sun, 11 Oct 2015 00:14:09 +0000
 | 
 |  On Fri, Sep 11, 2015 at 08:00:01AM +0000, Heiko@hexco.de wrote:
 |   > while the declaration according to POSIX is in sys/wait.h and has a
 |   > different meaning.
 |  
 |  Apparently POSIX or somebody went and invented a "waitid" call that
 |  uses this type. We don't have any such call.
 |  
 |  Is this something we need to have, or is it a posix_mistake?

 We need to have it... I started on it, but got interrupted.

 christos

From: Joerg Schilling <Joerg.Schilling@fokus.fraunhofer.de>
To: <martin@duskware.de>, <netbsd-bugs@netbsd.org>, <gnats-admin@netbsd.org>,
        <kern-bug-people@netbsd.org>, <gnats-bugs@netbsd.org>,
        <christos@zoulas.com>, <schily@schily.net>, <heiko.eissfeldt@hexco.de>
Cc: 
Subject: Re: Fwd: Re: kern/50230: conflict in type declaration of 'idtype_t'
 from sys/types.h with POSIX sys/wait.h
Date: Mon, 12 Oct 2015 16:51:53 +0200

 "heiko.eissfeldt@hexco.de" <heiko.eissfeldt@hexco.de> wrote:

 > > | From: David Holland <dholland-bugs@netbsd.org>
 > > | To: gnats-bugs@NetBSD.org
 > > | Cc:
 > > | Subject: Re: kern/50230: conflict in type declaration of 'idtype_t' from
 > > | sys/types.h with POSIX sys/wait.h
 > > | Date: Sun, 11 Oct 2015 00:14:09 +0000
 > > |
 > > | On Fri, Sep 11, 2015 at 08:00:01AM +0000, Heiko@hexco.de wrote:
 > > | > while the declaration according to POSIX is in sys/wait.h and has a
 > > | > different meaning.
 > > |
 > > | Apparently POSIX or somebody went and invented a "waitid" call that
 > > | uses this type. We don't have any such call.
 > > |
 > > | Is this something we need to have, or is it a posix_mistake?
 > >
 > > We need to have it... I started on it, but got interrupted.

 Please note that the waitid() call was added in 1989 for SVr4, so it is *really* 
 old.

 Be careful not to use the current POSIX text to implement it as the POSIX text 
 is wrong.

 One of the main intends is to avoid to mask the exit() code to 8 bits only.
 The other is to return timing and other information at the same time. This 
 interfact is also used for SIGCHLD handlers, so a SIGCHLD handler already knows 
 the exit code and exit reason without a need to call waitid().

 Jörg

 -- 
  EMail:joerg@schily.net                    (home) Jörg Schilling D-13353 Berlin
        joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
  URL:  http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/'

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.