Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
98f7771d
Commit
98f7771d
authored
15 years ago
by
Yang Tse
Browse files
Options
Downloads
Patches
Plain Diff
check for socket() and closesocket() as it is done for other functions
parent
37eba370
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ares/configure.ac
+3
-0
3 additions, 0 deletions
ares/configure.ac
ares/m4/cares-functions.m4
+214
-1
214 additions, 1 deletion
ares/m4/cares-functions.m4
with
217 additions
and
1 deletion
ares/configure.ac
+
3
−
0
View file @
98f7771d
...
...
@@ -438,6 +438,7 @@ AC_CHECK_HEADERS(
netinet/tcp.h \
net/if.h \
errno.h \
socket.h \
strings.h \
stdbool.h \
time.h \
...
...
@@ -534,6 +535,7 @@ CURL_CHECK_FUNC_RECVFROM
CURL_CHECK_FUNC_SEND
CURL_CHECK_MSG_NOSIGNAL
CARES_CHECK_FUNC_CLOSESOCKET
CARES_CHECK_FUNC_FCNTL
CARES_CHECK_FUNC_FREEADDRINFO
CARES_CHECK_FUNC_GETADDRINFO
...
...
@@ -547,6 +549,7 @@ CARES_CHECK_FUNC_IOCTL
CARES_CHECK_FUNC_IOCTLSOCKET
CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL
CARES_CHECK_FUNC_SETSOCKOPT
CARES_CHECK_FUNC_SOCKET
CARES_CHECK_FUNC_STRCASECMP
CARES_CHECK_FUNC_STRCMPI
CARES_CHECK_FUNC_STRDUP
...
...
This diff is collapsed.
Click to expand it.
ares/m4/cares-functions.m4
+
214
−
1
View file @
98f7771d
...
...
@@ -16,7 +16,7 @@
#***************************************************************************
# File version for 'aclocal' use. Keep it a single number.
# serial
29
# serial
30
dnl CARES_INCLUDES_ARPA_INET
...
...
@@ -91,6 +91,27 @@ cares_includes_netdb="\
])
dnl CARES_INCLUDES_SOCKET
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when socket.h is to be included.
AC_DEFUN([CARES_INCLUDES_SOCKET], [
cares_includes_socket="\
/* includes start */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SOCKET_H
# include <socket.h>
#endif
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h socket.h,
[], [], [$cares_includes_socket])
])
dnl CARES_INCLUDES_STDLIB
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
...
...
@@ -319,6 +340,100 @@ cares_preprocess_callconv="\
])
dnl CARES_CHECK_FUNC_CLOSESOCKET
dnl -------------------------------------------------
dnl Verify if closesocket is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable cares_disallow_closesocket, then
dnl HAVE_CLOSESOCKET will be defined.
AC_DEFUN([CARES_CHECK_FUNC_CLOSESOCKET], [
AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl
AC_REQUIRE([CARES_INCLUDES_SOCKET])dnl
#
tst_links_closesocket="unknown"
tst_proto_closesocket="unknown"
tst_compi_closesocket="unknown"
tst_allow_closesocket="unknown"
#
AC_MSG_CHECKING([if closesocket can be linked])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$cares_includes_winsock2
$cares_includes_socket
]],[[
if(0 != closesocket(0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_links_closesocket="yes"
],[
AC_MSG_RESULT([no])
tst_links_closesocket="no"
])
#
if test "$tst_links_closesocket" = "yes"; then
AC_MSG_CHECKING([if closesocket is prototyped])
AC_EGREP_CPP([closesocket],[
$cares_includes_winsock2
$cares_includes_socket
],[
AC_MSG_RESULT([yes])
tst_proto_closesocket="yes"
],[
AC_MSG_RESULT([no])
tst_proto_closesocket="no"
])
fi
#
if test "$tst_proto_closesocket" = "yes"; then
AC_MSG_CHECKING([if closesocket is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$cares_includes_winsock2
$cares_includes_socket
]],[[
if(0 != closesocket(0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_closesocket="yes"
],[
AC_MSG_RESULT([no])
tst_compi_closesocket="no"
])
fi
#
if test "$tst_compi_closesocket" = "yes"; then
AC_MSG_CHECKING([if closesocket usage allowed])
if test "x$cares_disallow_closesocket" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_closesocket="yes"
else
AC_MSG_RESULT([no])
tst_allow_closesocket="no"
fi
fi
#
AC_MSG_CHECKING([if closesocket might be used])
if test "$tst_links_closesocket" = "yes" &&
test "$tst_proto_closesocket" = "yes" &&
test "$tst_compi_closesocket" = "yes" &&
test "$tst_allow_closesocket" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET, 1,
[Define to 1 if you have the closesocket function.])
ac_cv_func_closesocket="yes"
else
AC_MSG_RESULT([no])
ac_cv_func_closesocket="no"
fi
])
dnl CARES_CHECK_FUNC_FCNTL
dnl -------------------------------------------------
dnl Verify if fcntl is available, prototyped, and
...
...
@@ -2074,6 +2189,104 @@ AC_DEFUN([CARES_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK], [
])
dnl CARES_CHECK_FUNC_SOCKET
dnl -------------------------------------------------
dnl Verify if socket is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable cares_disallow_socket, then
dnl HAVE_SOCKET will be defined.
AC_DEFUN([CARES_CHECK_FUNC_SOCKET], [
AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl
AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl
AC_REQUIRE([CARES_INCLUDES_SOCKET])dnl
#
tst_links_socket="unknown"
tst_proto_socket="unknown"
tst_compi_socket="unknown"
tst_allow_socket="unknown"
#
AC_MSG_CHECKING([if socket can be linked])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$cares_includes_winsock2
$cares_includes_sys_socket
$cares_includes_socket
]],[[
if(0 != socket(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_links_socket="yes"
],[
AC_MSG_RESULT([no])
tst_links_socket="no"
])
#
if test "$tst_links_socket" = "yes"; then
AC_MSG_CHECKING([if socket is prototyped])
AC_EGREP_CPP([socket],[
$cares_includes_winsock2
$cares_includes_sys_socket
$cares_includes_socket
],[
AC_MSG_RESULT([yes])
tst_proto_socket="yes"
],[
AC_MSG_RESULT([no])
tst_proto_socket="no"
])
fi
#
if test "$tst_proto_socket" = "yes"; then
AC_MSG_CHECKING([if socket is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$cares_includes_winsock2
$cares_includes_sys_socket
$cares_includes_socket
]],[[
if(0 != socket(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_socket="yes"
],[
AC_MSG_RESULT([no])
tst_compi_socket="no"
])
fi
#
if test "$tst_compi_socket" = "yes"; then
AC_MSG_CHECKING([if socket usage allowed])
if test "x$cares_disallow_socket" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_socket="yes"
else
AC_MSG_RESULT([no])
tst_allow_socket="no"
fi
fi
#
AC_MSG_CHECKING([if socket might be used])
if test "$tst_links_socket" = "yes" &&
test "$tst_proto_socket" = "yes" &&
test "$tst_compi_socket" = "yes" &&
test "$tst_allow_socket" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_SOCKET, 1,
[Define to 1 if you have the socket function.])
ac_cv_func_socket="yes"
else
AC_MSG_RESULT([no])
ac_cv_func_socket="no"
fi
])
dnl CARES_CHECK_FUNC_STRCASECMP
dnl -------------------------------------------------
dnl Verify if strcasecmp is available, prototyped, and
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment