Commit 7de0f5f4 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Don't declare memset, memcpy, setsockopt, atoi, recvfrom or sendto.

Don't try to set SO_DONTLINGER if SO_DONTLINGER is undefined.
Use O_NONBLOCK instead of FNDELAY if FNDELAY is undefined.
parent 216cc6f1
......@@ -27,18 +27,18 @@
extern void *memset(void *, int, int);
extern void *memcpy(void *, const void *, int);
/*extern void *memset(void *, int, int);*/
/*extern void *memcpy(void *, const void *, int);*/
extern int socket(int, int, int);
extern int setsockopt(int, int, int, char *, int);
/*extern int setsockopt(int, int, int, char *, int);*/
extern int connect(int, struct sockaddr *, int);
extern int bind(int, struct sockaddr *, int);
extern int close(int);
extern int atoi(const char *str);
extern int recvfrom(int fd, char *buf, int len, int flags,
struct sockaddr *from, int *flen);
extern int sendto(int fd, char *buf, int len, int flags,
struct sockaddr *from, int flen);
/*extern int atoi(const char *str);*/
/*extern int recvfrom(int fd, char *buf, int len, int flags,
struct sockaddr *from, int *flen);*/
/*extern int sendto(int fd, char *buf, int len, int flags,
struct sockaddr *from, int flen);*/
extern int sprintf(char *, const char *, ...);
......@@ -208,13 +208,19 @@ isc_createudp(IscSessionConfig *cfg)
return NULL;
}
#ifdef FNDELAY
if (fcntl(fd, F_SETFL, res | FNDELAY) == -1)
#else
if (fcntl(fd, F_SETFL, res | O_NONBLOCK) == -1)
#endif
{
close(fd);
return NULL;
}
#ifdef SO_DONTLINGER
setsockopt(fd, SOL_SOCKET, SO_DONTLINGER, 0, 0);
#endif
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, 0, 0);
scb = isc_create(cfg, &isc_udp_funs);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment