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
c3363f83
Commit
c3363f83
authored
23 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
Albert Chin's improved gethostbyname_r() tests
parent
47def809
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
acinclude.m4
+18
-47
18 additions, 47 deletions
acinclude.m4
configure.in
+0
-3
0 additions, 3 deletions
configure.in
with
18 additions
and
50 deletions
acinclude.m4
+
18
−
47
View file @
c3363f83
...
...
@@ -246,7 +246,6 @@ AC_DEFUN(CURL_CHECK_INET_NTOA_R,
AC_DEFINE(NEED_REENTRANT)
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))])])
])
AC_DEFUN(CURL_CHECK_GETHOSTBYADDR_R,
...
...
@@ -324,8 +323,6 @@ rc = gethostbyaddr_r(address, length, type, &h,
ac_cv_gethostbyaddr_args=8],[
AC_MSG_RESULT(no)
have_missing_r_funcs="$have_missing_r_funcs gethostbyaddr_r"])])])])])
])
AC_DEFUN(CURL_CHECK_GETHOSTBYNAME_R,
...
...
@@ -333,28 +330,21 @@ AC_DEFUN(CURL_CHECK_GETHOSTBYNAME_R,
dnl check for number of arguments to gethostbyname_r. it might take
dnl either 3, 5, or 6 arguments.
AC_CHECK_FUNCS(gethostbyname_r,[
AC_MSG_CHECKING(if gethostbyname_r takes 3 arguments)
AC_TRY_
RUN
([
AC_MSG_CHECKING(
[
if gethostbyname_r takes 3 arguments
]
)
AC_TRY_
COMPILE
([
#include <string.h>
#include <sys/types.h>
#include <netdb.h>
int
main () {
struct hostent h;
struct hostent_data hdata;
char *name = "localhost";
int rc;
memset(&h, 0, sizeof(struct hostent));
memset(&hdata, 0, sizeof(struct hostent_data));
rc = gethostbyname_r(name, &h, &hdata);
exit (rc != 0 ? 1 : 0); }],[
gethostbyname_r(const char *, struct hostent *, struct hostent_data *);],[
gethostbyname_r(NULL, NULL, NULL);],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_GETHOSTBYNAME_R_3)
ac_cv_gethostbyname_args=3],[
AC_MSG_RESULT(no)
AC_MSG_CHECKING(if gethostbyname_r with -D_REENTRANT takes 3 arguments)
AC_TRY_
RUN
([
AC_MSG_CHECKING(
[
if gethostbyname_r with -D_REENTRANT takes 3 arguments
]
)
AC_TRY_
COMPILE
([
#define _REENTRANT
#include <string.h>
...
...
@@ -362,53 +352,34 @@ exit (rc != 0 ? 1 : 0); }],[
#include <netdb.h>
int
main () {
struct hostent h;
struct hostent_data hdata;
char *name = "localhost";
int rc;
memset(&h, 0, sizeof(struct hostent));
memset(&hdata, 0, sizeof(struct hostent_data));
rc = gethostbyname_r(name, &h, &hdata);
exit (rc != 0 ? 1 : 0); }],[
gethostbyname_r(const char *,struct hostent *, struct hostent_data *);],[
gethostbyname_r(NULL, NULL, NULL);],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_GETHOSTBYNAME_R_3)
AC_DEFINE(NEED_REENTRANT)
ac_cv_gethostbyname_args=3],[
AC_MSG_RESULT(no)
AC_MSG_CHECKING(if gethostbyname_r takes 5 arguments)
AC_TRY_
RUN
([
AC_MSG_CHECKING(
[
if gethostbyname_r takes 5 arguments
]
)
AC_TRY_
COMPILE
([
#include <sys/types.h>
#include <netdb.h>
int
main () {
struct hostent *hp;
struct hostent h;
char *name = "localhost";
char buffer[8192];
int h_errno;
hp = gethostbyname_r(name, &h, buffer, 8192, &h_errno);
exit (hp == NULL ? 1 : 0); }],[
struct hostent *
gethostbyname_r(const char *, struct hostent *, char *, int, int *);],[
gethostbyname_r(NULL, NULL, NULL, 0, NULL);],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_GETHOSTBYNAME_R_5)
ac_cv_gethostbyname_args=5],[
AC_MSG_RESULT(no)
AC_MSG_CHECKING(if gethostbyname_r takes 6 arguments)
AC_TRY_
RUN
([
AC_MSG_CHECKING(
[
if gethostbyname_r takes 6 arguments
]
)
AC_TRY_
COMPILE
([
#include <sys/types.h>
#include <netdb.h>
int
main () {
struct hostent h;
struct hostent *hp;
char *name = "localhost";
char buf[8192];
int rc;
int h_errno;
rc = gethostbyname_r(name, &h, buf, 8192, &hp, &h_errno);
exit (rc != 0 ? 1 : 0); }],[
gethostbyname_r(const char *, struct hostent *, char *, size_t,
struct hostent **, int *);],[
gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL);],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_GETHOSTBYNAME_R_6)
ac_cv_gethostbyname_args=6],[
...
...
This diff is collapsed.
Click to expand it.
configure.in
+
0
−
3
View file @
c3363f83
...
...
@@ -446,9 +446,6 @@ then
Set to explicitly specify we don't want to use thread-safe functions)
else
dnl check that 'localhost' resolves first
CURL_CHECK_WORKING_RESOLVER
dnl dig around for gethostbyname_r()
CURL_CHECK_GETHOSTBYNAME_R()
...
...
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