8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:43:03 +01:00

Autoconf: check for aio.h, pread and pwrite

This commit is contained in:
eku 2002-11-12 13:46:11 +00:00
parent 29e90114c8
commit 7fe24dd9a8
4 changed files with 27 additions and 23 deletions

View File

@ -1,4 +1,4 @@
dnl $Id: configure.in,v 1.80 2002-11-12 13:15:10 eku Exp $
dnl $Id: configure.in,v 1.81 2002-11-12 13:46:06 eku Exp $
dnl ############################# INITIALISATION ###############################
@ -178,6 +178,7 @@ AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(varargs.h)
AC_CHECK_HEADERS(crypt.h)
AC_CHECK_HEADERS(netinet/in.h rpc/rpc.h netconfig.h rpc/xdr.h)
AC_CHECK_HEADERS(aio.h)
dnl Check for libraries
AC_CHECK_LIB(dl, main)
@ -250,6 +251,7 @@ AC_CHECK_FUNCS(flock)
AC_CHECK_FUNCS(initgroups)
AC_CHECK_FUNCS(getpagesize)
AC_CHECK_FUNCS(xdr_hyper)
AC_CHECK_FUNCS(pread pwrite)
dnl Check for other things

View File

@ -73,6 +73,7 @@
#undef HAVE_NETINET_IN_H
#undef HAVE_RPC_RPC_H
#undef HAVE_RPC_XDR_H
#undef HAVE_AIO_H
/* Functions */
@ -98,6 +99,8 @@
#undef HAVE_INITGROUPS
#undef HAVE_GETPAGESIZE
#undef HAVE_XDR_HYPER
#undef HAVE_PREAD
#undef HAVE_PWRITE
/* Types */
#undef socklen_t

View File

@ -41,10 +41,14 @@
#include <sys/file.h>
#include <sys/stat.h>
#include <string.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_AIO_H
#include <aio.h>
#endif
#include "../jrd/jrd.h"
#include "../jrd/pio.h"
@ -68,19 +72,12 @@
/* SUPERSERVER uses a mutex to allow atomic seek/read(write) sequences.
SUPERSERVER_V2 uses "positioned" read (write) calls to avoid a seek
and allow multiple threads to overlap database I/O.
17-Oct-1996 Enabled positioned I/O calls on SOLARIS Superserver. */
#if (defined SUPERSERVER && (defined SOLARIS_MT || defined LINUX))
and allow multiple threads to overlap database I/O. */
#if defined SUPERSERVER
#if (defined PREAD && defined PWRITE) || defined HAVE_AIO_H
#define PREAD_PWRITE
#if !(defined SOLARIS_MT || defined LINUX)
/* pread() and pwrite() function calls are provided on SOLARIS.
The aio_read(), aio_*() etc. calls are not implemented on
the HP-UX systems. Once it is implemented, this #include could
be enabled only for HP-UX systems (POSIX). */
#include <aio.h>
#endif /* SOLARIS_MT */
#endif /* SUPERSERVER && (SOLARIS_MT || LINUX) */
#endif
#endif
extern "C" {
@ -123,22 +120,20 @@ extern "C" {
#define O_BINARY 0
#endif
#ifndef EINTR
#define EINTR 0
#endif
#ifdef SUPERSERVER
#define MASK 0600
#else
#define MASK 0666
#endif
extern int errno;
static void close_marker_file(TEXT *);
static FIL seek_file(FIL, BDB, UINT64 *, STATUS *);
static FIL setup_file(DBB, TEXT *, USHORT, int);
static BOOLEAN unix_error(TEXT *, FIL, STATUS, STATUS *);
#if defined PREAD_PWRITE && !(defined HAVE_PREAD && defined HAVE_PWRITE)
static SLONG pread(int, SCHAR *, SLONG, SLONG);
static SLONG pwrite(int, SCHAR *, SLONG, SLONG);
#endif
#ifdef SUPPORT_RAW_DEVICES
static BOOLEAN raw_devices_check_file (TEXT *);
static BOOLEAN raw_devices_validate_database (int, TEXT *, USHORT);
@ -1113,7 +1108,7 @@ static BOOLEAN unix_error(
return FALSE;
}
#if ((defined PREAD_PWRITE) && !(defined SOLARIS_MT || defined LINUX))
#if defined PREAD_PWRITE && !(defined HAVE_PREAD && defined HAVE_PWRITE)
/* pread() and pwrite() behave like read() and write() except that they
take an additional 'offset' argument. The I/O takes place at the specified
@ -1126,7 +1121,7 @@ static BOOLEAN unix_error(
using the POSIX asynchronous I/O calls.
NOTE: pread() and pwrite() are defined in UNIX International system
interface and are a part of Solaris 2.
interface and are a part of POSIX systems.
*/
static SLONG pread(int fd, SCHAR * buf, SLONG nbytes, SLONG offset)
@ -1195,7 +1190,8 @@ static SLONG pwrite(int fd, SCHAR * buf, SLONG nbytes, SLONG offset)
return (aio_return(&io)); /* return I/O status */
}
#endif /* defined PREAD_PWRITE && ! (defined SOLARIS_MT || LINUX) */
#endif /* PREAD_PWRITE && !(HAVE_PREAD && HAVE_PWRITE)*/
int PIO_unlink (
TEXT *file_name)

View File

@ -1,4 +1,4 @@
#ident "$Id: config.h.in,v 1.54 2002-11-12 13:15:13 eku Exp $"
#ident "$Id: config.h.in,v 1.55 2002-11-12 13:46:11 eku Exp $"
/*
* 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete ports:
@ -54,6 +54,7 @@
#undef HAVE_NETINET_IN_H
#undef HAVE_RPC_RPC_H
#undef HAVE_RPC_XDR_H
#undef HAVE_AIO_H
/* Functions */
@ -79,6 +80,8 @@
#undef HAVE_INITGROUPS
#undef HAVE_GETPAGESIZE
#undef HAVE_XDR_HYPER
#undef HAVE_PREAD
#undef HAVE_PWRITE
/* Types */