Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detect the availability of MSG_NOSIGNAL/MSG_DONTWAIT
- Loading branch information
Showing
3 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
dnl Copyright (C) 2011 Trond Norbye | ||
dnl This file is free software; Trond Norbye | ||
dnl gives unlimited permission to copy and/or distribute it, | ||
dnl with or without modifications, as long as this notice is preserved. | ||
dnl --------------------------------------------------------------------------- | ||
dnl Macro: SOCKET_SEND_FLAGS | ||
dnl --------------------------------------------------------------------------- | ||
|
||
AC_DEFUN([SOCKET_SEND_FLAGS], | ||
[ | ||
AC_CACHE_CHECK([for MSG_NOSIGNAL], [ac_cv_msg_nosignal], [ | ||
AC_LANG_PUSH([C]) | ||
save_CFLAGS="$CFLAGS" | ||
CFLAGS="$CFLAGS -I${srcdir}" | ||
AC_TRY_LINK([ | ||
#include <sys/socket.h> | ||
], [ | ||
int flags= MSG_NOSIGNAL; | ||
], | ||
[ ac_cv_msg_nosignal=yes ], | ||
[ ac_cv_msg_nosignal=no ]) | ||
CFLAGS="$save_CFLAGS" | ||
AC_LANG_POP | ||
]) | ||
AC_CACHE_CHECK([for MSG_DONTWAIT], [ac_cv_msg_dontwait], [ | ||
AC_LANG_PUSH([C]) | ||
save_CFLAGS="$CFLAGS" | ||
CFLAGS="$CFLAGS -I${srcdir}" | ||
AC_TRY_LINK([ | ||
#include <sys/socket.h> | ||
], [ | ||
int flags= MSG_DONTWAIT; | ||
], | ||
[ ac_cv_msg_dontwait=yes ], | ||
[ ac_cv_msg_dontwait=no ]) | ||
CFLAGS="$save_CFLAGS" | ||
AC_LANG_POP | ||
]) | ||
AS_IF([test "x$ac_cv_msg_nosignal" = "xyes"],[ | ||
AC_DEFINE(HAVE_MSG_NOSIGNAL, 1, [Define to 1 if you have a MSG_NOSIGNAL])]) | ||
AS_IF([test "x$ac_cv_msg_dontwait" = "xyes"],[ | ||
AC_DEFINE(HAVE_MSG_DONTWAIT, 1, [Define to 1 if you have a MSG_DONTWAIT])]) | ||
]) | ||
|
||
dnl --------------------------------------------------------------------------- | ||
dnl End Macro: SOCKET_SEND_FLAGS | ||
dnl --------------------------------------------------------------------------- |