[vlc-devel] [csw-devel] [PATCH 1/4] Test for O_DIRECTORY

Joerg Schilling Joerg.Schilling at fokus.fraunhofer.de
Wed Feb 29 15:50:42 CET 2012


Maciej Blizinski <maciej at opencsw.org> wrote:

> O_DIRECTORY is not declared on Solaris 10. Test for it and only use it when
> available.
> ---
>  configure.ac          |    1 +
>  modules/misc/gnutls.c |    6 +++++-
>  2 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index efb2e99..6ce41f5 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -492,6 +492,7 @@ dnl Check for usual libc functions
>  AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
>  AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r if_nameindex if_nametoindex isatty lstat memalign mmap openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
>  AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r inet_pton lldiv localtime_r nrand48 poll rewind setenv strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab tdestroy strverscmp])
> +AC_CHECK_DECLS([O_DIRECTORY])
>  AC_CHECK_FUNCS(fdatasync,,
>    [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
>  ])

Why?

POSIX grants this to be a #define, so you may safely use:

#ifdef	O_DIRECTORY

Jörg

-- 
 EMail:joerg at schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js at cs.tu-berlin.de                (uni)  
       joerg.schilling at fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily



More information about the vlc-devel mailing list