mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Preliminary changes for Minix3.
This commit is contained in:
parent
42aaf4dcf7
commit
0dda56a48e
@ -679,6 +679,14 @@ AC_CHECK_MEMBERS([struct in6_addr.s6_addr32, struct in6_addr.s6_addr16, struct s
|
|||||||
#endif
|
#endif
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AC_CHECK_TYPES([struct so_linger],
|
||||||
|
[#define HAVE_SO_LINGER], ,
|
||||||
|
[
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
])
|
||||||
|
|
||||||
AC_MSG_CHECKING([for socklen_t])
|
AC_MSG_CHECKING([for socklen_t])
|
||||||
AC_TRY_COMPILE([
|
AC_TRY_COMPILE([
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -125,7 +125,7 @@ run_once(void)
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
#ifdef HAVE_SETRLIMIT
|
||||||
struct rlimit rl;
|
struct rlimit rl;
|
||||||
#endif
|
#endif
|
||||||
int i, c;
|
int i, c;
|
||||||
@ -156,7 +156,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifdef HAVE_SETRLIMIT
|
||||||
rl.rlim_cur = rl.rlim_max = num_pipes * 2 + 50;
|
rl.rlim_cur = rl.rlim_max = num_pipes * 2 + 50;
|
||||||
if (setrlimit(RLIMIT_NOFILE, &rl) == -1) {
|
if (setrlimit(RLIMIT_NOFILE, &rl) == -1) {
|
||||||
perror("setrlimit");
|
perror("setrlimit");
|
||||||
|
@ -139,7 +139,7 @@ run_once(int num_pipes)
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
#ifdef HAVE_SETRLIMIT
|
||||||
struct rlimit rl;
|
struct rlimit rl;
|
||||||
#endif
|
#endif
|
||||||
int i, c;
|
int i, c;
|
||||||
@ -157,7 +157,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifdef HAVE_SETRLIMIT
|
||||||
rl.rlim_cur = rl.rlim_max = num_pipes * 2 + 50;
|
rl.rlim_cur = rl.rlim_max = num_pipes * 2 + 50;
|
||||||
if (setrlimit(RLIMIT_NOFILE, &rl) == -1) {
|
if (setrlimit(RLIMIT_NOFILE, &rl) == -1) {
|
||||||
perror("setrlimit");
|
perror("setrlimit");
|
||||||
|
@ -113,14 +113,18 @@ errorcb(struct bufferevent *b, short what, void *arg)
|
|||||||
static void
|
static void
|
||||||
frob_socket(evutil_socket_t sock)
|
frob_socket(evutil_socket_t sock)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_SO_LINGER
|
||||||
struct linger l;
|
struct linger l;
|
||||||
|
#endif
|
||||||
int one = 1;
|
int one = 1;
|
||||||
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one))<0)
|
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one))<0)
|
||||||
perror("setsockopt(SO_REUSEADDR)");
|
perror("setsockopt(SO_REUSEADDR)");
|
||||||
|
#ifdef HAVE_SO_LINGER
|
||||||
l.l_onoff = 1;
|
l.l_onoff = 1;
|
||||||
l.l_linger = 0;
|
l.l_linger = 0;
|
||||||
if (setsockopt(sock, SOL_SOCKET, SO_LINGER, (void*)&l, sizeof(l))<0)
|
if (setsockopt(sock, SOL_SOCKET, SO_LINGER, (void*)&l, sizeof(l))<0)
|
||||||
perror("setsockopt(SO_LINGER)");
|
perror("setsockopt(SO_LINGER)");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user