8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 10:00:38 +01:00

Another autoconf cleanup:

o check for the existence of the function sigaction
 o replaced SIGACTION_SUPPORTED with HAVE_SIGACTION
This commit is contained in:
eku 2002-08-22 10:48:26 +00:00
parent 6a86ea96f8
commit 56b9633d5b
9 changed files with 70 additions and 53 deletions

View File

@ -1,4 +1,4 @@
# $Id: configure.in,v 1.33 2002-08-22 09:07:55 eku Exp $
# $Id: configure.in,v 1.34 2002-08-22 10:48:22 eku Exp $
################################# INITIALISATION ###############################
@ -148,7 +148,7 @@ if test "$ac_cv_func_dirname" = "no"; then
unset ac_cv_func_dirname
AC_CHECK_FUNCS(dirname)],, $LIBS)
fi
AC_CHECK_FUNCS(sigaction)
# Check for other things
AC_C_BIGENDIAN

View File

@ -58,6 +58,7 @@
#undef HAVE_TIME
#undef HAVE_TIMES
#define HAVE_DIRNAME
#undef HAVE_SIGACTION
/* Types */
#undef socklen_t
@ -74,6 +75,9 @@
/* Is the platform big endian? */
#define WORDS_BIGENDIAN 0
/* Return type of signal handler */
#define RETSIGTYPE void
/* Are paths case sensitive? */
#define CASE_SENSITIVITY false

View File

@ -35,7 +35,7 @@
* 2002.04.16 Paul Beach - HP10 and unistd.h
*/
/*
$Id: common.h,v 1.20 2002-08-22 08:20:26 dimitr Exp $
$Id: common.h,v 1.21 2002-08-22 10:48:23 eku Exp $
*/
#ifndef JRD_COMMON_H
@ -92,7 +92,6 @@ $Id: common.h,v 1.20 2002-08-22 08:20:26 dimitr Exp $
#endif
#define KILLER_SIGNALS
#define SIGACTION_SUPPORTED
#define VA_START(list,parmN) va_start (list, parmN)
#define UNIX 1
@ -116,22 +115,36 @@ $Id: common.h,v 1.20 2002-08-22 08:20:26 dimitr Exp $
/* SINIX-Z 5.42 */
#ifdef SINIXZ
#include <sys/types.h>
#include <sys/time.h>
#include <sys/mman.h>
#ifdef __cplusplus
extern "C" {
#endif
#undef GETTIMEOFDAY_RETURNS_TIMEZONE
int gettimeofday (struct timeval *tp);
int munmap(void * addr, size_t len);
int gethostname(char *name, size_t len);
#ifdef __cplusplus
}
#endif
#define QUADFORMAT "ll"
#define QUADCONST(n) (n##LL)
#define MMAP_SUPPORTED
#if 0 /* for I386 these are defined later */
#define FB_ALIGN(n,b) ((n+1) & ~1)
#define ALIGNMENT 4
#define DOUBLE_ALIGN 4
#endif
#define DOUBLE_ALIGN 8
#define FB_ALIGN(n,b) ((n + b - 1) & ~(b - 1))
#ifdef SUPERSERVER
#define SET_TCP_NO_DELAY
#endif
#define KILLER_SIGNALS
#define SIGACTION_SUPPORTED
#define VA_START(list,parmN) va_start (list, parmN)
#define UNIX 1
@ -183,7 +196,6 @@ $Id: common.h,v 1.20 2002-08-22 08:20:26 dimitr Exp $
#define MAP_ANNON
#define LSEEK_OFFSET_CAST (off_t)
#define INTL
#define SIGACTION_SUPPORTED
#define MEMMOVE(from,to,length) memmove ((void *)to, (void *)from, (size_t)length)
#define MOVE_FAST(from,to,length) memcpy (to, from, (int) (length))
@ -221,7 +233,6 @@ $Id: common.h,v 1.20 2002-08-22 08:20:26 dimitr Exp $
#define QUADCONST(n) (n##LL)
#define KILLER_SIGNALS
#define MMAP_SUPPORTED
#define SIGACTION_SUPPORTED
#define NO_NFS /* no MTAB_OPEN or MTAB_CLOSE in isc_file.c */
#define MEMMOVE(from,to,length) memmove ((void *)to, (void *)from, (size_t) length)
@ -258,7 +269,6 @@ $Id: common.h,v 1.20 2002-08-22 08:20:26 dimitr Exp $
#define KILLER_SIGNALS
#define MMAP_SUPPORTED
#define SIGACTION_SUPPORTED
#define NO_NFS /* no MTAB_OPEN or MTAB_CLOSE in isc_file.c */
#define MEMMOVE(from,to,length) memmove ((void *)to, (void *)from, (size_t) length)
@ -312,7 +322,6 @@ $Id: common.h,v 1.20 2002-08-22 08:20:26 dimitr Exp $
#define ATEXIT(c) atexit (c)
#define SETPGRP setpgrp ()
#define SIGACTION_SUPPORTED
#define NO_FLOCK
#define MEMMOVE(from,to,length) memmove ((void *)to, (void *)from, (size_t) length)
/********* Reason for introducing MEMMOVE macro.
@ -556,7 +565,6 @@ typedef unsigned int64 UATOM;
#ifndef _POWER /* IBM RS/6000 */
#define AIX
#define KILLER_SIGNALS
#define SIGACTION_SUPPORTED
#define MMAP_SUPPORTED
#define NO_FLOCK
#define SETPGRP setpgid (0, 0)
@ -578,7 +586,6 @@ typedef unsigned int64 UATOM;
#else /* AIX PowerPC */
#define AIX_PPC
#define KILLER_SIGNALS
#define SIGACTION_SUPPORTED
#define MMAP_SUPPORTED
#define NO_FLOCK
#define SETPGRP setpgid (0, 0)
@ -731,7 +738,6 @@ typedef unsigned __int64 UINT64;
#define SCO_UNIX 1
#define IEEE
#define SETPGRP setpgrp()
#define SIGACTION_SUPPORTED
#define MMAP_SUPPORTED
#define NO_FLOCK
#define ATEXIT(c) atexit (c)
@ -761,7 +767,6 @@ typedef unsigned __int64 UINT64;
#ifdef DGUX
#define UNIX 1
#define KILLER_SIGNALS
#define SIGACTION_SUPPORTED
#define MMAP_SUPPORTED
#define NO_FLOCK
#define SETPGRP setpgid (0, 0)
@ -795,7 +800,6 @@ typedef unsigned __int64 UINT64;
#define INTL
#define NO_PYXIS
#define KILLER_SIGNALS
#define SIGACTION_SUPPORTED
#define MMAP_SUPPORTED
#define HAS_64BIT_POINTERS /* if a machine has 64 bit pointers you need this */
#define SETPGRP setpgrp (0, 0)
@ -838,7 +842,6 @@ typedef unsigned long UATOM;
#define IMPLEMENTATION isc_info_db_impl_isc_sgi /* 41 */
#define DOUBLE_ALIGN 8
#define IEEE
#define SIGACTION_SUPPORTED
#define MMAP_SUPPORTED
#define NO_FLOCK
#define INTL
@ -908,7 +911,6 @@ typedef unsigned long DWORD;
#define INTL
#define SETPGRP setpgrp()
#define KILLER_SIGNALS
#define SIGACTION_SUPPORTED
#define MMAP_SUPPORTED
#define NO_FLOCK
#define NO_PYXIS

View File

@ -26,7 +26,7 @@
*
*/
/* $Id: isc_ipc.cpp,v 1.14 2002-07-06 05:31:56 skywalker Exp $ */
/* $Id: isc_ipc.cpp,v 1.15 2002-08-22 10:48:23 eku Exp $ */
#ifdef SHLIB_DEFS
#define LOCAL_SHLIB_DEFS
@ -81,15 +81,15 @@ typedef struct sig {
// with the same code in isc_sync.cpp
#ifdef SUN3_3
typedef int (*CLIB_ROUTINE SIG_FPTR) ();
typedef RETSIGTYPE (*CLIB_ROUTINE SIG_FPTR) ();
#else
#if ((defined(WIN32) || defined(_WIN32)) && defined(_MSC_VER))
typedef void (CLIB_ROUTINE * SIG_FPTR) ();
typedef RETSIGTYPE (CLIB_ROUTINE * SIG_FPTR) ();
#else
#if (defined(DARWIN))
typedef void (*CLIB_ROUTINE SIG_FPTR) (int);
typedef RETSIGTYPE (*CLIB_ROUTINE SIG_FPTR) (int);
#else
typedef void (*CLIB_ROUTINE SIG_FPTR) ();
typedef RETSIGTYPE (*CLIB_ROUTINE SIG_FPTR) ();
#endif
#endif
#endif
@ -154,7 +154,9 @@ static int process_id = 0;
#endif
#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifndef O_RDWR
#include <fcntl.h>
@ -170,7 +172,7 @@ static int process_id = 0;
#define SIGVEC FPTR_INT
#endif
#ifdef SIGACTION_SUPPORTED
#ifdef HAVE_SIGACTION
#define SIGVEC struct sigaction
#endif
@ -769,7 +771,7 @@ static void isc_signal2(
SIGVEC vec, old_vec;
#ifndef SIGACTION_SUPPORTED
#ifndef HAVE_SIGACTION
#ifdef OLD_POSIX_THREADS
if (signal_number != SIGALRM)
vec.sv_handler = SIG_DFL;
@ -787,8 +789,8 @@ static void isc_signal2(
else
#endif
#pragma FB_COMPILER_MESSAGE("Fix! Ugly function pointer casts!")
vec.sa_handler = (void(*)(int)) signal_handler;
// vec.sa_handler = (SIG_FPTR) signal_handler;
// vec.sa_handler = (void(*)(int)) signal_handler;
vec.sa_handler = (SIG_FPTR) signal_handler;
memset(&vec.sa_mask, 0, sizeof(vec.sa_mask));
vec.sa_flags = SA_RESTART;
sigaction(signal_number, &vec, &old_vec);

View File

@ -76,15 +76,15 @@
// with the same code in isc_ipc.cpp
#ifdef SUN3_3
typedef int (*CLIB_ROUTINE SIG_FPTR) ();
typedef RETSIGTYPE (*CLIB_ROUTINE SIG_FPTR) ();
#else
#if ((defined(WIN32) || defined(_WIN32)) && defined(_MSC_VER))
typedef void (CLIB_ROUTINE * SIG_FPTR) ();
typedef RETSIGTYPE (CLIB_ROUTINE * SIG_FPTR) ();
#else
#if (defined(DARWIN))
typedef void (*CLIB_ROUTINE SIG_FPTR) (int);
typedef RETSIGTYPE (*CLIB_ROUTINE SIG_FPTR) (int);
#else
typedef void (*CLIB_ROUTINE SIG_FPTR) ();
typedef RETSIGTYPE (*CLIB_ROUTINE SIG_FPTR) ();
#endif
#endif
#endif
@ -128,7 +128,9 @@ static UCHAR *next_shared_memory;
#endif
#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/sem.h>
@ -153,7 +155,7 @@ static UCHAR *next_shared_memory;
#define SIGVEC FPTR_INT
#endif
#ifdef SIGACTION_SUPPORTED
#ifdef HAVE_SIGACTION
#define SIGVEC struct sigaction
#endif
@ -1110,7 +1112,7 @@ int ISC_event_wait(
void *user_handler;
#else
struct itimerval user_timer;
#ifndef SIGACTION_SUPPORTED
#ifndef HAVE_SIGACTION
struct sigvec user_handler;
#else
struct sigaction user_handler;
@ -4308,7 +4310,7 @@ void ISC_reset_timer(
timerclear(&internal_timer.it_interval);
timerclear(&internal_timer.it_value);
setitimer(ITIMER_REAL, &internal_timer, NULL);
#ifndef SIGACTION_SUPPORTED
#ifndef HAVE_SIGACTION
sigvector(SIGALRM, client_handler, NULL);
#else
sigaction(SIGALRM, (struct sigaction*)client_handler, NULL);
@ -4338,7 +4340,7 @@ void ISC_set_timer(
**************************************/
#ifndef SYSV_SIGNALS
struct itimerval internal_timer;
#ifndef SIGACTION_SUPPORTED
#ifndef HAVE_SIGACTION
struct sigvec internal_handler;
#else
struct sigaction internal_handler;
@ -4367,14 +4369,14 @@ void ISC_set_timer(
client_handler = &d2;
*client_handler = (void *) sigset(SIGALRM, SIG_DFL);
#else
#ifndef SIGACTION_SUPPORTED
#ifndef HAVE_SIGACTION
internal_handler.sv_handler = SIG_DFL;
internal_handler.sv_mask = 0;
internal_handler.sv_flags = SV_INTERRUPT;
sigvector(SIGALRM, &internal_handler, (struct sigvec *) client_handler);
#else
// internal_handler.sa_handler = (SIG_FPTR) SIG_DFL;
internal_handler.sa_handler = (void(*)(int)) SIG_DFL;
internal_handler.sa_handler = (SIG_FPTR) SIG_DFL;
// internal_handler.sa_handler = (void(*)(int)) SIG_DFL;
memset(&internal_handler.sa_mask, 0, sizeof(internal_handler.sa_mask));
internal_handler.sa_flags = SA_RESTART;
sigaction(SIGALRM, &internal_handler,

View File

@ -3249,7 +3249,7 @@ static void service_get(
void *sv_hndlr;
#else
struct itimerval sv_timr;
#ifndef SIGACTION_SUPPORTED
#ifndef HAVE_SIGACTION
struct sigvec sv_hndlr;
#else
struct sigaction sv_hndlr;

View File

@ -48,6 +48,7 @@
#undef HAVE_TIME
#undef HAVE_TIMES
#undef HAVE_DIRNAME
#undef HAVE_SIGACTION
/* Types */
#undef socklen_t
@ -61,6 +62,9 @@
/* Is the platform big endian? */
#define WORDS_BIGENDIAN 0
/* Return type of signal handler */
#define RETSIGTYPE void
/* Are paths case sensitive? */
#define CASE_SENSITIVITY false

View File

@ -31,7 +31,7 @@
*
*/
/*
$Id: inet.cpp,v 1.15 2002-08-20 11:49:10 eku Exp $
$Id: inet.cpp,v 1.16 2002-08-22 10:48:24 eku Exp $
*/
#include "firebird.h"
#include "../jrd/ib_stdio.h"
@ -311,20 +311,21 @@ static ULONG inet_debug_timer(void)
*
**************************************/
#ifdef HAVE_GETTIMEOFDAY
struct timeval tv;
struct timeval tv;
#ifdef GETTIMEOFDAY_RETURNS_TIMEZONE
(void)gettimeofday(&tv, (struct timezone *)0);
(void)gettimeofday(&tv, (struct timezone *)0);
#else
(void)gettimeofday(&tv);
(void)gettimeofday(&tv);
#endif
return (tv.tv_sec*1000 + tv.tv_usec - INET_start_time);
return (tv.tv_sec*1000 + tv.tv_usec - INET_start_time);
#else
struct timeb now;
(void) ftime(&now);
return (now.time * 1000 + now.millitm - INET_start_time);
#endif /* HAVE_GETTIMEOFDAY */
}
#endif
#endif
#endif /* DEBUG */
#endif /* !REQUESTER */
@ -3990,7 +3991,7 @@ static bool_t packet_send( PORT port, SCHAR * buffer, SSHORT buffer_length)
#ifndef NO_ITIMER
struct itimerval internal_timer, client_timer;
#ifdef SIGACTION_SUPPORTED
#ifdef HAVE_SIGACTION
struct sigaction internal_handler, client_handler;
#else
struct sigvec internal_handler, client_handler;
@ -4062,7 +4063,7 @@ static bool_t packet_send( PORT port, SCHAR * buffer, SSHORT buffer_length)
internal_timer.it_value.tv_sec = 0;
internal_timer.it_value.tv_usec = 0;
setitimer(ITIMER_REAL, &internal_timer, &client_timer);
#ifndef SIGACTION_SUPPORTED
#ifndef HAVE_SIGACTION
internal_handler.sv_handler = alarm_handler;
internal_handler.sv_mask = 0;
internal_handler.sv_flags = SV_INTERRUPT;
@ -4089,7 +4090,7 @@ static bool_t packet_send( PORT port, SCHAR * buffer, SSHORT buffer_length)
internal_timer.it_value.tv_sec = 0;
internal_timer.it_value.tv_usec = 0;
setitimer(ITIMER_REAL, &internal_timer, NULL);
#ifdef SIGACTION_SUPPORTED
#ifdef HAVE_SIGACTION
sigaction(SIGALRM, &client_handler, NULL);
#else
sigvector(SIGALRM, &client_handler, NULL);

View File

@ -23,7 +23,7 @@
* FSG 16.03.2001
*/
/*
$Id: inet_server.cpp,v 1.6 2002-07-29 15:37:55 skywalker Exp $
$Id: inet_server.cpp,v 1.7 2002-08-22 10:48:24 eku Exp $
*/
#include "firebird.h"
#include "../jrd/ib_stdio.h"
@ -65,7 +65,9 @@ $Id: inet_server.cpp,v 1.6 2002-07-29 15:37:55 skywalker Exp $
#endif
#ifdef SUPERSERVER
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <errno.h>
#include "../jrd/gds.h"
#include "../jrd/pwd.h"
@ -571,7 +573,7 @@ static void set_signal( int signal_number, void (*handler) (void))
sigset(signal_number, handler);
#else
#ifndef SIGACTION_SUPPORTED
#ifndef HAVE_SIGACTION
struct sigvec vec;
struct sigvec old_vec;