From nobody  Wed Dec  9 08:31:57 1998
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id IAA00246;
          Wed, 9 Dec 1998 08:31:57 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199812091631.IAA00246@hub.freebsd.org>
Date: Wed, 9 Dec 1998 08:31:57 -0800 (PST)
From: Ruslan@Shevchenko.Kiev.UA
To: freebsd-gnats-submit@freebsd.org
Subject: <sys/uio.h> refer to <sys/types.h>  but not include one
X-Send-Pr-Version: www-1.0

>Number:         9033
>Category:       misc
>Synopsis:       <sys/uio.h> refer to <sys/types.h>  but not include one
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec  9 08:40:00 PST 1998
>Closed-Date:    Sat Dec 12 18:51:05 PST 1998
>Last-Modified:  Sat Dec 12 18:53:58 PST 1998
>Originator:     Ruslan Shevchenko
>Release:        3.0-current
>Organization:
Local paradise
>Environment:
FreeBSD kulshedra.internal.grad.kiev.ua 3.0-CURRENT FreeBSD 3.0-CURRENT #0: Sun 
Nov 22 14:20:41 GMT 1998     rssh@kulshedra.internal.grad.kiev.ua:/usr/src/sys/compile/KULSHEDRA  i386

>Description:

A.h refer to something, including in B.h, but A.h not include B.h .

I think, this is design bug.

In FreeBSD such situation, at least with <sys/uio.h> and <sys/types.h>,
which breaks clear compiling of erlang.

<begin quote from erlang mail list:>

> -DHAVE_FINITE=3D1 -DHAVE_DIRENT_H=3D1 -DSTDC_HEADERS=3D1 
-DHAVE_SYS_WAIT_=
...
> known-freebsd3.0/gzio.o -c 
-I/usr/home/rssh/erlang/erlang-47.4.0/erts/sys=
> tem/emulator/zlib 
/usr/home/rssh/erlang/erlang-47.4.0/erts/system/emulato=
> r/drv/gzio.c
> In file included from 
/usr/home/rssh/erlang/erlang-47.4.0/erts/system/emu=
> lator/sys.unix/driver_int.h:30,
>                  from 
/usr/home/rssh/erlang/erlang-47.4.0/erts/system/emu=
> lator/runtime/driver.h:30,
>                  from 
/usr/home/rssh/erlang/erlang-47.4.0/erts/system/emu=
> lator/drv/gzio.c:29:
> /usr/include/sys/uio.h:88: parse error before `readv'
> /usr/include/sys/uio.h:88: warning: data definition has no type or 
storag=

Wow, long output... :-)

Which seems to be the real cause of the error. The fix is to edit the
file erts/system/emulator/sys.unix/driver_int.h and add 

#include <sys/types.h>

just before the inclusion of sys/uio.h. Thanks for trying it out!

<end quote>




>How-To-Repeat:
cat > t.c <<!
#include <uio.h>
!
cc -c t.c
>Fix:
add #include <sys/types.h> in <sys/uio.h>
>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: freebsd-gnats-submit@FreeBSD.ORG, Ruslan@Shevchenko.Kiev.UA
Cc:  Subject: Re: misc/9033: <sys/uio.h> refer to <sys/types.h>  but not include one
Date: Fri, 11 Dec 1998 00:35:40 +1100

 >>Description:
 >
 >A.h refer to something, including in B.h, but A.h not include B.h .
 >
 >I think, this is design bug.
 >
 >In FreeBSD such situation, at least with <sys/uio.h> and <sys/types.h>,
 >which breaks clear compiling of erlang.
 
 This is a (not very good, but...) design feature.  See `man 2 readv',
 `man 2 writev' and `man 9 uio'.
 
 Bruce

From: Ruslan Shevchenko <Ruslan@Shevchenko.Kiev.UA>
To: Bruce Evans <bde@zeta.org.au>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: misc/9033: <sys/uio.h> refer to <sys/types.h>  but not include one
Date: Fri, 11 Dec 1998 08:16:03 +0000

 Bruce Evans wrote:
 
 > >>Description:
 > >
 > >A.h refer to something, including in B.h, but A.h not include B.h .
 > >
 > >I think, this is design bug.
 > >
 > >In FreeBSD such situation, at least with <sys/uio.h> and <sys/types.h>,
 > >which breaks clear compiling of erlang.
 >
 > This is a (not very good, but...) design feature.  See `man 2 readv',
 > `man 2 writev' and `man 9 uio'.
 
  i. e. format of struct_iov in uio.uio_uov and readv is different ?
 
  format of uio_uov can be in general absolute any ?
 
   why this is not void * or union ?
 
 
 >
 >
 > Bruce
 

From: Bruce Evans <bde@zeta.org.au>
To: bde@zeta.org.au, rssh@grad.kiev.ua
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: misc/9033: <sys/uio.h> refer to <sys/types.h>  but not include one
Date: Fri, 11 Dec 1998 17:59:00 +1100

 >> This is a (not very good, but...) design feature.  See `man 2 readv',
 >> `man 2 writev' and `man 9 uio'.
 >
 > i. e. format of struct_iov in uio.uio_uov and readv is different ?
 
 No.  The prerequisite <sys/types.h> is specified.
 >
 > format of uio_uov can be in general absolute any ?
 
 No.
 
 >  why this is not void * or union ?
 
 It is a 20 year old interface.
 
 Bruce
State-Changed-From-To: open->closed 
State-Changed-By: dillon 
State-Changed-When: Sat Dec 12 18:51:05 PST 1998 
State-Changed-Why:  
I am going to close this PR.  While it does contain an excellent point, it 
isn't really a bug in UNIX.  Most UNIX's have include file dependancies and 
this happens to be a documented one for FreeBSD.  Also, there are probably 
dozens of sys/ header files that need sys/types.h.  Programmers tend to 
write programs that compile under their own systems that virtually never 
compile clean on other systems.  Most of the time (and with this case), it 
is a relatively simple porting issue but it is one that must be fixed in 
the program, not in the operating system. 

-Matt 
>Unformatted:
