mirror of
https://github.com/samba-team/samba.git
synced 2024-12-27 03:21:53 +03:00
r10466: work around missing pread/pwrite declaration on openbsd
This commit is contained in:
parent
294ccfd46a
commit
e615f36733
12
source/lib/tdb/aclocal.m4
vendored
Normal file
12
source/lib/tdb/aclocal.m4
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
dnl see if a declaration exists for a function or variable
|
||||
dnl defines HAVE_function_DECL if it exists
|
||||
dnl AC_HAVE_DECL(var, includes)
|
||||
AC_DEFUN(AC_HAVE_DECL,
|
||||
[
|
||||
AC_CACHE_CHECK([for $1 declaration],ac_cv_have_$1_decl,[
|
||||
AC_TRY_COMPILE([$2],[int i = (int)$1],
|
||||
ac_cv_have_$1_decl=yes,ac_cv_have_$1_decl=no)])
|
||||
if test x"$ac_cv_have_$1_decl" = x"yes"; then
|
||||
AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z])[_DECL],1,[Whether $1() is available])
|
||||
fi
|
||||
])
|
@ -45,6 +45,14 @@
|
||||
#include <sys/stat.h>
|
||||
#include "config.h"
|
||||
#include "tdb.h"
|
||||
|
||||
#ifndef HAVE_PREAD_DECL
|
||||
ssize_t pread(int fd, void *buf, size_t count, off_t offset);
|
||||
#endif
|
||||
#ifndef HAVE_PWRITE_DECL
|
||||
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
|
||||
#endif
|
||||
|
||||
#else
|
||||
#include "includes.h"
|
||||
#include "lib/tdb/include/tdb.h"
|
||||
|
@ -1,6 +1,9 @@
|
||||
AC_CHECK_FUNCS(mmap pread pwrite)
|
||||
AC_CHECK_HEADERS(getopt.h)
|
||||
|
||||
AC_HAVE_DECL(pread, [#include <unistd.h>])
|
||||
AC_HAVE_DECL(pwrite, [#include <unistd.h>])
|
||||
|
||||
if test x"$experimental" = x"yes"; then
|
||||
SMB_LIBRARY_ENABLE(libtdb,YES)
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user