From: suresh@lama.lmo.dec.com (Suresh Subramanian)
Subject: Re: cxx include files for bsd-socket stuff
Date: Thu, 17 Feb 1994 21:09:51 GMT [thread overview]
Message-ID: <CLE04G.E9C@ryn.mro.dec.com> (raw)
In-Reply-To: 2jue09$4us@spool.cs.wisc.edu
All prototypes for all the socket calls were added in OSF/1 V2.0
As an work around (All the usual disclaimers - this info is from Digital
internal infobase and not an official Digital recommendation; yata yata ...)
Use this code with your socket functions (extended appropriately for
any other socket functions you use):
extern "C"
{
bzero(void *, int);
gethostname(char *, int);
struct servent *getservbyname(char *, char *);
struct hostent *gethostbyname(char *);
unsigned short htons(unsigned short);
unsigned int htonl(unsigned int);
/*
* socket routines
*/
accept(int, void *, int *);
bind(int, void *, int);
connect(int, void *, int);
listen(int, int);
recv(int, char *, int, int);
select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
send(int, char *, int, int);
setsockopt(int, int, int, char *, int);
shutdown(int, int);
socket(int, int, int);
}
Note that these function defs are not in socket.h, or any other
system header file, to my knowledge. I'm no language expert, but I
think that K+R C will not complain about undefined functions, and
defaults them to returning int, and the args don't matter. The
linker finds them and everything works. C++ (and strict ansi C)
will complain about undefined functions so you get compile errors.
Good Luck!
prev parent reply other threads:[~1994-02-17 21:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-02-17 0:33 cxx include files for bsd-socket stuff Emmanuel Ackaouy
1994-02-17 21:09 ` Suresh Subramanian [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox