summaryrefslogtreecommitdiff
path: root/include/my_net.h
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-05-16 16:32:51 +0300
committerunknown <monty@hundin.mysql.fi>2002-05-16 16:32:51 +0300
commitd2b95cd7ab5b3ed450af572e9c77cd11d3c420ba (patch)
tree145820cb9685468167f09ba07a59a1f61ca640cf /include/my_net.h
parenteba5ec8b4bceabab302462db850882f715a7b040 (diff)
downloadmariadb-git-d2b95cd7ab5b3ed450af572e9c77cd11d3c420ba.tar.gz
New my_gethostbyname_r() handling
Changed some status variable names Fix bug in GRANT ... PASSWORD string Docs/manual.texi: Update of variable names include/my_net.h: New my_gethostbyname_r() handling include/my_pthread.h: New my_gethostbyname_r() handling libmysql/Makefile.shared: New my_gethostbyname_r() handling libmysql/libmysql.c: New my_gethostbyname_r() handling mysys/Makefile.am: New my_gethostbyname_r() handling mysys/my_pthread.c: New my_gethostbyname_r() handling mysys/my_thr_init.c: New my_gethostbyname_r() handling sql/hostname.cc: New my_gethostbyname_r() handling sql/mini_client.cc: New my_gethostbyname_r() handling sql/mysqld.cc: change some status variable names sql/sql_acl.cc: Fix bug in GRANT ... PASSWORD string
Diffstat (limited to 'include/my_net.h')
-rw-r--r--include/my_net.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/my_net.h b/include/my_net.h
index 6a8e98d685c..e3db765cff7 100644
--- a/include/my_net.h
+++ b/include/my_net.h
@@ -36,6 +36,42 @@ extern "C" {
void my_inet_ntoa(struct in_addr in, char *buf);
+/*
+ Handling of gethostbyname_r()
+*/
+
+#if defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
+#if !defined(HPUX)
+struct hostent;
+#endif /* HPUX */
+struct hostent *my_gethostbyname_r(const char *name,
+ struct hostent *result, char *buffer,
+ int buflen, int *h_errnop);
+#define my_gethostbyname_r_free()
+#if defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
+#define GETHOSTBYNAME_BUFF_SIZE 2048
+#else
+#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data)
+#endif /* defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */
+
+#elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT)
+#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data)
+struct hostent *my_gethostbyname_r(const char *name,
+ struct hostent *result, char *buffer,
+ int buflen, int *h_errnop);
+#define my_gethostbyname_r_free()
+#elif !defined(HAVE_GETHOSTBYNAME_R)
+#define GETHOSTBYNAME_BUFF_SIZE 2048
+struct hostent *my_gethostbyname_r(const char *name,
+ struct hostent *result, char *buffer,
+ int buflen, int *h_errnop);
+void my_gethostbyname_r_free();
+#else
+#define GETHOSTBYNAME_BUFF_SIZE 2048
+#define my_gethostbyname_r(A,B,C,D,E) gethostbyname_r((A),(B),(C),(D),(E))
+#define my_gethostbyname_r_free()
+#endif /* defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */
+
#ifdef __cplusplus
}
#endif