From owner-freebsd-bugs Thu Aug 17 4:30: 7 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 63CFB37B507 for ; Thu, 17 Aug 2000 04:30:04 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id EAA32306; Thu, 17 Aug 2000 04:30:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from slarti.muc.de (slarti.muc.de [193.149.48.10]) by hub.freebsd.org (Postfix) with SMTP id 193F737B43C for ; Thu, 17 Aug 2000 04:27:32 -0700 (PDT) Received: (qmail 26213 invoked by uid 66); 17 Aug 2000 11:35:37 -0000 Received: from en by slarti with UUCP; Thu Aug 17 11:35:37 2000 -0000 Received: by en1.engelschall.com (Sendmail 8.11.0+) id e7HBOI056286; Thu, 17 Aug 2000 13:24:18 +0200 (CEST) Message-Id: <200008171124.e7HBOI056286@en1.engelschall.com> Date: Thu, 17 Aug 2000 13:24:18 +0200 (CEST) From: "Ralf S. Engelschall" Reply-To: rse@engelschall.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/20677: slight prototype inconsistency for poll(2) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 20677 >Category: kern >Synopsis: slight prototype inconsistency for poll(2) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Aug 17 04:30:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Ralf S. Engelschall >Release: FreeBSD 4.1-STABLE i386 >Organization: Engelschall, Germany. >Environment: FreeBSD en1.engelschall.com 4.1-STABLE FreeBSD 4.1-STABLE #0: Sun Aug 13 15:33:17 CEST 2000 rse@en1.engelschall.com:/usr/obj/usr/src/sys/EN1 i386 >Description: Under FreeBSD 4.1-STABLE (and also under 5.0-CURRENT if I had tried), the Autoconf stuff of my GNU Portable Threads reports: | : | checking for type of argument 2 for poll()... unsigned | checking for fallback nfds_t... unsigned | : And as a result my generated pth.h header then has a "typedef unsigned nfds_t;", although I would have expected (both for cleanness and by reading the poll(2) manpage) that the result is "typedef unsigned int nfds_t;" (note the explicit "int"). This is caused because the prototype for poll() in /usr/include/poll.h is not 100% syntactically equivalent to the one in the manpage poll(2): it lacks the implicit "int" keyword. Sure, I know that "unsigned" and "unsigned int" are semantically the same in ANSI C, of course. But for consistency reasons I would appreciate that our header poll.h exactly reflects the prototype from the manpage unless we provide the more standardized (SUSv2) "nfds_t" type. >How-To-Repeat: :> grep "unsigned _nfds" /usr/include/sys/poll.h int poll __P((struct pollfd *_pfd, unsigned _nfds, int _timeout)); :> gunzip Fix: Index: src/sys/sys/poll.h =================================================================== RCS file: /home/ncvs/src/sys/sys/poll.h,v retrieving revision 1.6 diff -u -d -r1.6 poll.h --- poll.h 1999/12/29 04:24:45 1.6 +++ poll.h 2000/08/17 11:08:38 @@ -100,7 +100,7 @@ * XXX poll() has "unsigned long" nfds on SVR4, not unsigned as on the * other BSDs. */ -int poll __P((struct pollfd *_pfd, unsigned _nfds, int _timeout)); +int poll __P((struct pollfd *_pfd, unsigned int _nfds, int _timeout)); __END_DECLS #endif /* !_KERNEL */ >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message