Commit 059ad7f0 authored by monty@donna.mysql.com's avatar monty@donna.mysql.com

Force sockets to be blocking on HPUX 11.0

Changed BITMAP to MY_BITMAP to avoid type conflict on windows
parent d487e5a9
......@@ -709,8 +709,8 @@ case $SYSTEM_TYPE in
;;
*hpux11.*)
echo "Enabling pread/pwrite workaround for hpux 11"
CFLAGS="$CFLAGS -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS"
CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG"
CFLAGS="$CFLAGS -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK"
CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK"
if test "$with_named_thread" = "no"
then
echo "Using --with-named-thread=-lpthread"
......
......@@ -29,16 +29,16 @@ typedef struct st_bitmap
#ifdef THREAD
pthread_mutex_t mutex;
#endif
} BITMAP;
} MY_BITMAP;
#ifdef __cplusplus
extern "C" {
#endif
extern my_bool bitmap_init(BITMAP *bitmap, uint bitmap_size);
extern void bitmap_free(BITMAP *bitmap);
extern void bitmap_set_bit(BITMAP *bitmap, uint bitmap_bit);
extern uint bitmap_set_next(BITMAP *bitmap);
extern void bitmap_clear_bit(BITMAP *bitmap, uint bitmap_bit);
extern my_bool bitmap_init(MY_BITMAP *bitmap, uint bitmap_size);
extern void bitmap_free(MY_BITMAP *bitmap);
extern void bitmap_set_bit(MY_BITMAP *bitmap, uint bitmap_bit);
extern uint bitmap_set_next(MY_BITMAP *bitmap);
extern void bitmap_clear_bit(MY_BITMAP *bitmap, uint bitmap_bit);
#ifdef __cplusplus
}
#endif
......
......@@ -27,9 +27,7 @@
#include <my_bitmap.h>
#include <assert.h>
pthread_mutex_t LOCK_bitmap;
my_bool bitmap_init(BITMAP *map, uint bitmap_size)
my_bool bitmap_init(MY_BITMAP *map, uint bitmap_size)
{
if (!(map->bitmap=(uchar*) my_malloc((bitmap_size+7)/8,MYF(MY_WME))))
return 1;
......@@ -41,7 +39,7 @@ my_bool bitmap_init(BITMAP *map, uint bitmap_size)
return 0;
}
void bitmap_free(BITMAP *map)
void bitmap_free(MY_BITMAP *map)
{
if (map->bitmap)
{
......@@ -53,7 +51,7 @@ void bitmap_free(BITMAP *map)
}
}
void bitmap_set_bit(BITMAP *map, uint bitmap_bit)
void bitmap_set_bit(MY_BITMAP *map, uint bitmap_bit)
{
if (bitmap_bit < map->bitmap_size)
{
......@@ -64,7 +62,7 @@ void bitmap_set_bit(BITMAP *map, uint bitmap_bit)
}
uint bitmap_set_next(BITMAP *map)
uint bitmap_set_next(MY_BITMAP *map)
{
uchar *bitmap=map->bitmap;
uint bit_found = MY_BIT_NONE;
......@@ -94,7 +92,7 @@ uint bitmap_set_next(BITMAP *map)
}
void bitmap_clear_bit(BITMAP *map, uint bitmap_bit)
void bitmap_clear_bit(MY_BITMAP *map, uint bitmap_bit)
{
if (bitmap_bit < map->bitmap_size)
{
......
......@@ -168,7 +168,6 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
pthread_mutex_destroy(&THR_LOCK_keycache);
pthread_mutex_destroy(&THR_LOCK_malloc);
pthread_mutex_destroy(&THR_LOCK_open);
pthread_mutex_destroy(&LOCK_bitmap);
DBUG_POP(); /* Must be done before my_thread_end */
my_thread_end();
my_thread_global_end();
......
......@@ -509,7 +509,7 @@ extern ulong ha_read_count, ha_write_count, ha_delete_count, ha_update_count,
ha_read_key_count, ha_read_next_count, ha_read_prev_count,
ha_read_first_count, ha_read_last_count,
ha_read_rnd_count, ha_read_rnd_next_count;
extern BITMAP temp_pool;
extern MY_BITMAP temp_pool;
extern bool use_temp_pool;
extern char f_fyllchar;
extern uchar *days_in_month;
......
......@@ -284,7 +284,7 @@ I_List<THD> threads,thread_cache;
time_t start_time;
BITMAP temp_pool;
MY_BITMAP temp_pool;
bool use_temp_pool=0;
pthread_key(MEM_ROOT*,THR_MALLOC);
......
......@@ -35,11 +35,13 @@
#ifdef HAVE_POLL
#include <sys/poll.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#if defined(__EMX__)
#include <sys/ioctl.h>
#define ioctlsocket ioctl
#endif /* defined(__EMX__) */
#endif /* defined(__EMX__) */
#if defined(MSDOS) || defined(__WIN__)
#ifdef __WIN__
......@@ -106,6 +108,9 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost)
#if !defined(___WIN__) && !defined(__EMX__)
#if !defined(NO_FCNTL_NONBLOCK)
vio->fcntl_mode = fcntl(sd, F_GETFL);
#elif defined(HAVE_SYS_IOCTL_H) /* hpux */
/* Non blocking sockets doesn't work good on HPUX 11.0 */
(void) ioctl(net->fd,FIOSNBIO,0);
#endif
#else /* !defined(__WIN__) && !defined(__EMX__) */
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment