[Android] Add pipe2 replacement function
Rafaël Carré
git at videolan.org
Tue Sep 11 00:27:46 CEST 2012
vlc-ports/android | branch: master | Rafaël Carré <funman at videolan.org> | Tue Sep 11 00:26:34 2012 +0200| [2785e458e7687c6a8ba54926f0acead6ba7c610e] | committer: Rafaël Carré
Add pipe2 replacement function
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=2785e458e7687c6a8ba54926f0acead6ba7c610e
---
vlc-android/jni/Android.mk | 1 +
vlc-android/jni/pipe2.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk
index 6d55952..0e59fe8 100644
--- a/vlc-android/jni/Android.mk
+++ b/vlc-android/jni/Android.mk
@@ -4,6 +4,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE := libvlcjni
LOCAL_SRC_FILES := libvlcjni.c aout.c thumbnailer.c pthread-condattr.c pthread-rwlocks.c pthread-once.c eventfd.c sem.c
+LOCAL_SRC_FILES += pipe2.c
LOCAL_SRC_FILES += wchar/wcpcpy.c
LOCAL_SRC_FILES += wchar/wcpncpy.c
LOCAL_SRC_FILES += wchar/wcscasecmp.c
diff --git a/vlc-android/jni/pipe2.c b/vlc-android/jni/pipe2.c
new file mode 100644
index 0000000..fc0c2b3
--- /dev/null
+++ b/vlc-android/jni/pipe2.c
@@ -0,0 +1,30 @@
+/*****************************************************************************
+ * misc.c
+ *****************************************************************************
+ * Copyright © 2012 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU 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.
+ *****************************************************************************/
+
+#include <sys/linux-syscalls.h>
+
+//#include <sys/syscall.h>
+int syscall(int number, ...);
+
+/* Needed for android < 2.3 */
+int pipe2(int fds[2], int flags)
+{
+ return syscall(__NR_pipe2, fds, flags);
+}
More information about the Android
mailing list