[comp.sys.mips] /bsd43/usr/include omission?

bruce@cs.su.oz (Bruce Janson) (06/26/91)

Under RISC/os 4.52:

$ cd /bsd43/usr/include
$ find . -print | xargs egrep 'bsd43_\(sockaddr_in\)|bsd43_sockaddr_in'
../saio/ei.h:    struct bsd43_(sockaddr_in) ei_srcaddr;  /* source address of last packet */
../saio/ei.h:    struct bsd43_(sockaddr_in) ei_dstaddr;  /* destination address for transmits */
../sys/mount.h:  struct bsd43_(sockaddr_in)      *addr;  /* file server address */
$ 

All of which are uses of the declared structure but there appears to be
no definition.  Under some circumstances it would be nice if the bsd43
include files could stand alone as definitions of structures with names
of the form "bsd43_..." and this is mostly true -- the above example
is the first exception that I have found.  Any chance that this could
be fixed in time for RISC/os 5.0?

Cheers,
bruce.

Bruce Janson					Email:	bruce@cs.su.oz.au
Basser Department of Computer Science		Phone:	+61-2-692-3272
University of Sydney, N.S.W., 2006, AUSTRALIA	Fax:	+61-2-692-3838

zdenko@katzo.rice.edu (zdenko tomasic) (06/27/91)

In article <2543@cluster.cs.su.oz.au> bruce@cs.su.oz (Bruce Janson) writes:
>Under RISC/os 4.52:
>
>$ cd /bsd43/usr/include
>$ find . -print | xargs egrep 'bsd43_\(sockaddr_in\)|bsd43_sockaddr_in'
>../saio/ei.h:    struct bsd43_(sockaddr_in) ei_srcaddr;  /* source address of last packet */
>../saio/ei.h:    struct bsd43_(sockaddr_in) ei_dstaddr;  /* destination address for transmits */
>../sys/mount.h:  struct bsd43_(sockaddr_in)      *addr;  /* file server address */
>$ 
>
>All of which are uses of the declared structure but there appears to be
>no definition.  Under some circumstances it would be nice if the bsd43
>include files could stand alone as definitions of structures with names
>of the form "bsd43_..." and this is mostly true -- the above example
>is the first exception that I have found.  Any chance that this could
>be fixed in time for RISC/os 5.0?
>
>Cheers,
>bruce.
>
>Bruce Janson					Email:	bruce@cs.su.oz.au
>Basser Department of Computer Science		Phone:	+61-2-692-3272
>University of Sydney, N.S.W., 2006, AUSTRALIA	Fax:	+61-2-692-3838

Well, there is really no need to fix anything.  

bsd43_ is actually an empty macro and sockaddr_in structure is
really on its own in /bsd43/usr/include/netinet/in.h. Sockets are
BSD invention anyway.  Perhaps, the reason for bsd43_ being empty
is to serve as a reminder that you are now in the BSD style .h file
as symbolic links may confuse you unless you are very much on your
toes. It can also guard against wrong or inconsistent inclusion
(mixing sysv and bsd carelessly), since if bsd43_ is not defined
the bsd43_structures do not exist and you've got compiler error.
--
___________________________________________________________________
Zdenko Tomasic, Rice U., Chem. Dept., P.O. Box 1892, Houston, Tx 77251
INTERNET: zdenko@katzo.rice.edu
___________________________________________________________________

wje@redwood.mips.com (William J. Earl) (06/28/91)

In article <2543@cluster.cs.su.oz.au>, bruce@cs (Bruce Janson) writes:
> Under RISC/os 4.52:
> 
> $ cd /bsd43/usr/include
> $ find . -print | xargs egrep 'bsd43_\(sockaddr_in\)|bsd43_sockaddr_in'
> ../saio/ei.h:    struct bsd43_(sockaddr_in) ei_srcaddr;  /* source address of last packet */
> ../saio/ei.h:    struct bsd43_(sockaddr_in) ei_dstaddr;  /* destination address for transmits */
> ../sys/mount.h:  struct bsd43_(sockaddr_in)      *addr;  /* file server address */
> $ 
> 
> All of which are uses of the declared structure but there appears to be
> no definition.  Under some circumstances it would be nice if the bsd43
> include files could stand alone as definitions of structures with names
> of the form "bsd43_..." and this is mostly true -- the above example
> is the first exception that I have found.  Any chance that this could
> be fixed in time for RISC/os 5.0?

     This is not really broken.  "bsd43_(sockaddr_in)" compiles to
"sockaddr_in" in -systype bsd43.  sockaddr_in is declared in
/bsd43/usr/include/netinet/in.h.  Also, saio/ei.h is not really used
in user mode as far as I know.  We just left it in for backward
compatibility with UMIPS-BSD 2.1.  

     We mechanically inserted all the bsd43_(*) and bsd43_* prefixes
in implementing RISC/os 4.0, as a development expedient.  As time has
permitted, we have gradually pruned them, mainly by switching to common
header files among systypes.  For example, the net and netinet directories,
which once had separate versions in <sysv/bsd> and <bsd43>, now have
identical files (actually symbolic links).

-- 
	William J. Earl			wje@mips.com
	MIPS Computer Systems		408-524-8172
	930 Arques Avenue, M/S 1-03	FAX 408-524-8401
	Sunnyvale, CA 94088-3650