]> git.sesse.net Git - vlc/commitdiff
Some OSes don't have posix_fadvise
authorChristophe Mutricy <xtophe@videolan.org>
Thu, 21 Feb 2008 21:57:16 +0000 (21:57 +0000)
committerChristophe Mutricy <xtophe@videolan.org>
Thu, 21 Feb 2008 21:57:16 +0000 (21:57 +0000)
configure.ac
modules/access/mmap.c

index 7e86b560cbeeb7ada3bcfd5dd3f7a8973d84dcff..c314cf313264d6a4d750daf26d9e1a20be422f11 100644 (file)
@@ -469,7 +469,7 @@ dnl Check for system libs needed
 need_libc=false
 
 dnl Check for usual libc functions
-AC_CHECK_FUNCS([gettimeofday strtod strtol strtof strtoll strtoull strsep isatty vasprintf asprintf swab sigrelse getpwuid memalign posix_memalign if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r localtime_r lrintf daemon scandir fork bsearch lstat strlcpy strdup strndup strnlen atof lldiv])
+AC_CHECK_FUNCS([gettimeofday strtod strtol strtof strtoll strtoull strsep isatty vasprintf asprintf swab sigrelse getpwuid memalign posix_memalign if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r localtime_r lrintf daemon scandir fork bsearch lstat strlcpy strdup strndup strnlen atof lldiv posix_fadvise posix_madvise])
 AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp)])
 AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp)])
 AC_CHECK_FUNCS(strcasestr,,[AC_CHECK_FUNCS(stristr)])
index 3acbc3c64445cdd2f90a77ed0254719e124e96f3..57ed8bf78f705eaf9e2b2d310084d24ecf891b89 100644 (file)
@@ -131,7 +131,9 @@ static int Open (vlc_object_t *p_this)
     p_sys->fd = fd;
 
     p_access->info.i_size = st.st_size;
+#ifdef HAVE_POSIX_FADVISE    
     posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
+#endif 
 
     return VLC_SUCCESS;
 
@@ -212,7 +214,9 @@ static block_t *Block (access_t *p_access)
         msleep (INPUT_ERROR_SLEEP);
         return NULL;
     }
+#ifdef HAVE_POSIX_MADVISE    
     posix_madvise (addr, length, POSIX_MADV_SEQUENTIAL);
+#endif
 
     block_t *block = block_mmap_Alloc (addr, length);
     if (block == NULL)