[vlc-devel] [PATCH v3 12/19] compat: Add pathconf.c

Dennis Hamester dhamester at jusst.de
Mon Mar 20 17:57:29 CET 2017


From: Dennis Hamester <dennis.hamester at startmail.com>

---
 compat/pathconf.c    | 36 ++++++++++++++++++++++++++++++++++++
 configure.ac         |  2 +-
 include/vlc_fixups.h |  4 ++++
 3 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 compat/pathconf.c

diff --git a/compat/pathconf.c b/compat/pathconf.c
new file mode 100644
index 0000000000..0acd90f092
--- /dev/null
+++ b/compat/pathconf.c
@@ -0,0 +1,36 @@
+/*****************************************************************************
+ * pathconf.c: POSIX pathconf() replacement
+ *****************************************************************************
+ * Copyright (C) 2017 VLC authors and VideoLAN
+ *
+ * Authors: Dennis Hamester <dhamester at 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;
+}
+#endif
diff --git a/configure.ac b/configure.ac
index 6c4dad5e08..ad3a9eff37 100644
--- a/configure.ac
+++ b/configure.ac
@@ -595,7 +595,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 pthread_cond_timedwait_monotonic_np pthread_condattr_setclock])
-AC_REPLACE_FUNCS([atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lldiv memrchr nrand48 poll posix_memalign recvmsg rewind sendmsg setenv sigwait 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 sigwait 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.])
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 2a8cbbbc16..7b2ba90d92 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -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 *);
-- 
2.12.0



More information about the vlc-devel mailing list