Use AF_INET socketpair to test sendfile on Solaris

This commit is contained in:
Nick Mathewson 2010-08-06 13:03:17 -04:00
parent 57b30cd7cc
commit 9b60209675

View File

@ -617,8 +617,15 @@ test_evbuffer_add_file(void *ptr)
TT_DIE(("Didn't recognize the implementation"));
}
#if defined(_EVENT_HAVE_SENDFILE) && defined(__sun__) && defined(__svr4__)
/* We need to use a pair of AF_INET sockets, since Solaris
doesn't support sendfile() over AF_UNIX. */
if (evutil_ersatz_socketpair(AF_INET, SOCK_STREAM, 0, pair) == -1)
tt_abort_msg("ersatz_socketpair failed");
#else
if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
tt_abort_msg("socketpair failed");
#endif
datalen = strlen(data);
fd = regress_make_tmpfile(data, datalen);