mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
514e60480d
BitKeeper/deleted/.del-global.h~e80d28157acfdcb5: Auto merged Docs/manual.texi: Auto merged include/my_no_pthread.h: Auto merged innobase/include/univ.i: Auto merged innobase/lock/lock0lock.c: Auto merged innobase/os/os0thread.c: Auto merged innobase/srv/srv0srv.c: Auto merged innobase/trx/trx0trx.c: Auto merged innobase/ut/ut0ut.c: Auto merged mysql-test/r/bigint.result: Auto merged mysql-test/t/bigint.test: Auto merged mysys/my_init.c: Auto merged mysys/my_net.c: Auto merged mysys/mysys_priv.h: Auto merged mysys/thr_rwlock.c: Auto merged sql/ha_innodb.h: Auto merged sql/sql_insert.cc: Auto merged include/my_sys.h: merge with 3.23 libmysql/Makefile.shared: merge with 3.23 mysql-test/mysql-test-run.sh: merge with 3.23 mysql-test/r/func_if.result: merge with 3.23 mysys/Makefile.am: merge with 3.23 mysys/my_gethostbyname.c: merge with 3.23 sql/ha_innodb.cc: merge with 3.23 sql/item_cmpfunc.cc: merge with 3.23 sql/mysqld.cc: merge with 3.23 sql/sql_show.cc: merge with 3.23
43 lines
1.3 KiB
C
43 lines
1.3 KiB
C
/* Copyright (C) 2000 MySQL AB
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
/* thread safe version of some common functions */
|
|
|
|
#include "mysys_priv.h"
|
|
#include <m_string.h>
|
|
|
|
/* for thread safe my_inet_ntoa */
|
|
#if !defined(MSDOS) && !defined(__WIN__)
|
|
#include <netdb.h>
|
|
#ifdef HAVE_SYS_SOCKET_H
|
|
#include <sys/socket.h>
|
|
#endif
|
|
#ifdef HAVE_NETINET_IN_H
|
|
#include <netinet/in.h>
|
|
#endif
|
|
#ifdef HAVE_ARPA_INET_H
|
|
#include <arpa/inet.h>
|
|
#endif
|
|
#endif /* !defined(MSDOS) && !defined(__WIN__) */
|
|
|
|
void my_inet_ntoa(struct in_addr in, char *buf)
|
|
{
|
|
char *ptr;
|
|
pthread_mutex_lock(&THR_LOCK_net);
|
|
ptr=inet_ntoa(in);
|
|
strmov(buf,ptr);
|
|
pthread_mutex_unlock(&THR_LOCK_net);
|
|
}
|