Problems detecting aio_suspend on FreeBSD

Volker Lendecke Volker.Lendecke at SerNet.DE
Mon Jan 7 05:26:41 MST 2013


Hi!

Does the attached patch also help?

With best regards,

Volker Lendecke

On Thu, Jan 03, 2013 at 01:35:15PM -0800, Richard Sharpe wrote:
> Hi folks,
> 
> I found some problems detecting aio_suspend in our builds, so I went
> looking in the ports collection and found a potential fix, but the fix
> was not quite correct.
> 
> We are using autoconf 2.62.
> 
> Here we the initial fix:
> 
> @@ -5859,9 +5900,17 @@
>  [AC_MSG_RESULT(no)])
> 
>                         AC_MSG_CHECKING(for aio_suspend)
> -                       AC_LINK_IFELSE([#include <aio.h>
> -int main() { struct aiocb a; return aio_suspend(&a, 1, NULL); }],
> -[AC_DEFINE(HAVE_AIO_SUSPEND, 1, [Have aio_suspend]) AC_MSG_RESULT(yes)],
> +                       AC_LINK_IFELSE([
> +                               #include <aio.h>
> +                               #if STDC_HEADERS
> +                               #include <stdlib.h>
> +                               #include <stddef.h>
> +                               #endif
> +                               int main() {
> +                                       struct aiocb *a[1];
> +                                       return aio_suspend((const
> struct aiocb**)&a, 1, NULL);
> +                               }
> +                       ], [AC_DEFINE(HAVE_AIO_SUSPEND, 1, [Have
> aio_suspend]) AC_MSG_RESULT(yes)],
>  [AC_MSG_RESULT(no)])
>                 fi
> 
> However, the problem seems to be that AC_LINK_IFELSE does not include
> confdefs.h by default, and I found I had to use the following (note
> the addition of AC_LANGUAGE_SOURCE():
> 
> @@ -5833,10 +5833,19 @@
>  [AC_MSG_RESULT(no)])
> 
>                         AC_MSG_CHECKING(for aio_suspend)
> -                       AC_LINK_IFELSE([#include <aio.h>
> -int main() { struct aiocb a; return aio_suspend(&a, 1, NULL); }],
> -[AC_DEFINE(HAVE_AIO_SUSPEND, 1, [Have aio_suspend]) AC_MSG_RESULT(yes)],
> -[AC_MSG_RESULT(no)])
> +                       AC_LINK_IFELSE([
> +                               AC_LANG_SOURCE()
> +                               #include <aio.h>
> +                               #if STDC_HEADERS
> +                               #include <stdlib.h>
> +                               #include <stddef.h>
> +                               #endif
> +                               int main() {
> +                                       struct aiocb a;
> +                                       return aio_suspend((const
> struct aiocb**)&a, 1, NULL);
> +                               }
> +                       ], [AC_DEFINE(HAVE_AIO_SUSPEND, 1, [Have
> aio_suspend]) AC_MSG_RESULT(yes)],
> +                       [AC_MSG_RESULT(no)])
>                 fi
> 
>                 if test x"$samba_cv_HAVE_AIO64" = x"yes"; then
> 
> Does anyone have any comments?
> 
> -- 
> Regards,
> Richard Sharpe
> (何以解憂?唯有杜康。--曹操)

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 57c6874ad1a742c5d50bb133f16b7b8a8b9f6faf Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Mon, 7 Jan 2013 11:06:15 +0100
Subject: [PATCH] configure: Fix aio_suspend detection on FreeBSD

NULL is not defined without some includes
---
 source3/configure.in |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/configure.in b/source3/configure.in
index d8d3a1f..7266000 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -5826,7 +5826,7 @@ int main() { struct aiocb a; return aio_cancel(1, &a); }],
 
 			AC_MSG_CHECKING(for aio_suspend)
 			AC_LINK_IFELSE([#include <aio.h>
-int main() { struct aiocb a; return aio_suspend(&a, 1, NULL); }],
+int main() { struct aiocb a; struct timespec t; return aio_suspend(&a, 1, &t); }],
 [AC_DEFINE(HAVE_AIO_SUSPEND, 1, [Have aio_suspend]) AC_MSG_RESULT(yes)],
 [AC_MSG_RESULT(no)])
 		fi
-- 
1.7.9.5



More information about the samba-technical mailing list