Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Jun 2002 18:24:50 +0300
From:      Peter Pentchev <roam@ringlet.net>
To:        Christopher Nehren <apeiron@prophecy.dyndns.org>
Cc:        freebsd-bugs@freebsd.org
Subject:   Re: Syntax errors in netinet6/in6.h and sys/socket.h
Message-ID:  <20020628152450.GA93540@straylight.oblivion.bg>
In-Reply-To: <1025262407.272.78.camel@prophecy.dyndns.org>
References:  <1025262407.272.78.camel@prophecy.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--6c2NcOVqGQ03X4Wi
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Jun 28, 2002 at 11:06:47AM +0000, Christopher Nehren wrote:
> >Synopsis:       4.6R has errors in net header files
> >Confidential:   no
> >Severity:       serious
> >Priority:       I'm guessing high, lots of stuff uses socket.h, no?
> >Responsible:    freebsd-bugs
> >State:          open
> >Class:          sw-bug
> >Submitter-Id:   current-users
> >Arrival-Date:   Mon Jun 2 14:00:05 PDT 2002
> >Last-Modified:
> >Originator:     Chris Nehren

This is not exactly a properly filed problem report; did you use
the send-pr(1) utility and then change the mail recipient address
(it should have been freebsd-gnats-submit@FreeBSD.org), or did you just
mail out the template to freebsd-bugs@FreeBSD.org? :)

The proper way to file a FreeBSD problem report would be to either use
the send-pr(1) utility on your FreeBSD system, or use the GNATS web
interface at http://www.FreeBSD.org/cgi/send-pr.cgi

> >Environment:
> FreeBSD prophecy.dyndns.org 4.6-RELEASE FreeBSD 4.6-RELEASE #0: Tue Jun
> 25 11:28:04 GMT 2002   =20
> root@prophecy.dyndns.org:/usr/obj/usr/src/sys/PROPHECY  i386
>=20
>=20
> >Description:
> Including <sys/socket.h> and <netinet/in.h> produces syntax errors even
> with an empty program
>=20
> >How-To-Repeat:
>=20
> Compile the C program that follows:
> #include <sys/socket.h>
> #include <netinet/in.h>=20
> /* can't include <netinet6/in6.h> directly */
> int main()
> {
> return 0;
> }

Such an 'empty program' has no need for including <sys/socket.h>; what
exactly are you trying to make your program do? :)  If you need to use
the socket(2), bind(2), listen(2), etc, system calls, you might want to
take a look at either their manual pages, where the <sys/types.h> header
file is listed as a prerequisite, or at some sample code; if you want to
write TCP/IP networking applications using those system calls and some
constants defined in the <netinet/in.h> file, you would do best to look
at some sample apps to see what other header files you need to include.
Generally, you would need <sys/types.h>, <netinet/in.h>, <arpa/inet.h>,
quite possibly also <netdb.h> and <sys/time.h>; however, <sys/socket.h>
is indeed listed as a prerequisite in the manual page of each and every
system call used in TCP/IP networking (and, for that matter, any kind of
socket networking).

G'luck,
Peter

--=20
Peter Pentchev	roam@ringlet.net	roam@FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
What would this sentence be like if pi were 3?

--6c2NcOVqGQ03X4Wi
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE9HH/C7Ri2jRYZRVMRAm4tAKCr8sI+6vsdRYF28oG7elwg1zNMfgCdGLcH
k7EJEJOMSFp+ZBBf65Jdkm8=
=mSry
-----END PGP SIGNATURE-----

--6c2NcOVqGQ03X4Wi--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020628152450.GA93540>