Hi All,
The following code snippet is a part of s/w which is downloaded from
net. While compiling this code I got the following error.
...\..\snmplib\ snmpTCPDomain.c (6) : fatal error C1083: Cannot open
include file: 'sys/socket.h': No such file or directory
NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'C:\PROGRA~1\MI CROS~3\VC98\BIN \NMAKE.EXE' :
return code '0x2'
Stop.
I just looked into the code and I found out that the problem is raised
because of sys/socket.h file. So please help me as how to use the
sys/socket.h file in windows OS . I am working on Windows OS. Hence I
am facing the problem.
Please help me as How to resolev this issue . Your thoughts will be
highly appreciated.
Thanks in Advance.
Thanks
Ravikumar
static int
netsnmp_tcp_acc ept(netsnmp_tra nsport *t)
struct sockaddr *farend = NULL;
int newsock = -1, sockflags = 0;
socklen_t farendlen = sizeof(struct sockaddr_in);
char *str = NULL;
farend = (struct sockaddr *) malloc(sizeof(s truct sockaddr_in));
if (t != NULL && t->sock >= 0) {
newsock = accept(t->sock, farend, &farendlen);
if (newsock < 0) {
DEBUGMSGTL(("ne tsnmp_tcp", "accept failed rc %d errno %d
\"%s\"\n",
newsock, errno, strerror(errno) ));
free(farend);
return newsock;
if (t->data != NULL) {
free(t->data);
t->data = farend;
t->data_length = farendlen;
str = netsnmp_tcp_fmt addr(NULL, farend, farendlen);
DEBUGMSGTL(("ne tsnmp_tcp", "accept succeeded (from %s)\n",
str));
free(str);
* Try to make the new socket blocking.
#ifdef WIN32
ioctlsocket(new sock, FIONBIO, &sockflags);
#else
if ((sockflags = fcntl(newsock, F_GETFL, 0)) >= 0) {
fcntl(newsock, F_SETFL, (sockflags & ~O_NONBLOCK));
} else {
DEBUGMSGTL(("ne tsnmp_tcp", "couldn't f_getfl of fd
%d\n",newsock)) ;
#endif
return newsock;
} else {
free(farend);
return -1;
Dec 4 '06
#
1