Commit 3e2accc8 authored by Dennis Hamester's avatar Dennis Hamester Committed by Jean-Baptiste Kempf

compat: Add pathconf dummy replacement for nacl

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent aabafd66
/*****************************************************************************
* pathconf.c: POSIX pathconf() replacement
*****************************************************************************
* Copyright (C) 2017 VLC authors and VideoLAN
*
* Authors: Dennis Hamester <dhamester@jusst.de>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <vlc_common.h>
#ifdef __native_client__
long pathconf (const char *path, int name)
{
VLC_UNUSED(path);
VLC_UNUSED(name);
return -1;
}
#elif defined(_WIN32)
/* Windows does not have pathconf, but that is OK */
#else
# error pathconf not implemented on your platform!
#endif
......@@ -596,7 +596,7 @@ need_libc=false
dnl Check for usual libc functions
AC_CHECK_FUNCS([daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty lstat memalign mkostemp mmap open_memstream openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime tdestroy uselocale])
AC_REPLACE_FUNCS([atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lldiv memrchr nrand48 poll posix_memalign recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tfind timegm timespec_get strverscmp])
AC_REPLACE_FUNCS([atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lldiv memrchr nrand48 poll posix_memalign recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tfind timegm timespec_get strverscmp pathconf])
AC_REPLACE_FUNCS([gettimeofday])
AC_CHECK_FUNC(fdatasync,,
[AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
......
......@@ -259,6 +259,10 @@ pid_t getpid (void) VLC_NOTHROW;
int fsync (int fd);
#endif
#ifndef HAVE_PATHCONF
long pathconf (const char *path, int name);
#endif
/* dirent.h */
#ifndef HAVE_DIRFD
int (dirfd) (DIR *);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment