mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-14 07:40:07 +02:00
142 lines
4.3 KiB
Plaintext
142 lines
4.3 KiB
Plaintext
From 9dfdbc6a361c50b363ab544781eb88a59d9ad817 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
|
|
Date: Sat, 29 Oct 2016 18:18:22 +0200
|
|
Subject: [PATCH] Haiku supporting code
|
|
|
|
---
|
|
configure.ac | 7 +++++++
|
|
include/uv-unix.h | 4 ++++
|
|
src/unix/core.c | 25 ++++++++++++++++++++++++-
|
|
3 files changed, 35 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/configure.ac b/configure.ac
|
|
index d3787c0..63376c4 100644
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -41,14 +41,17 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
LT_INIT
|
|
# TODO(bnoordhuis) Check for -pthread vs. -pthreads
|
|
AC_CHECK_LIB([dl], [dlopen])
|
|
+AC_CHECK_LIB([root], [dlopen])
|
|
AC_CHECK_LIB([kstat], [kstat_lookup])
|
|
AC_CHECK_LIB([kvm], [kvm_open])
|
|
AC_CHECK_LIB([nsl], [gethostbyname])
|
|
+AC_CHECK_LIB([network], [gethostbyname])
|
|
AC_CHECK_LIB([perfstat], [perfstat_cpu])
|
|
AC_CHECK_LIB([pthread], [pthread_mutex_init])
|
|
AC_CHECK_LIB([rt], [clock_gettime])
|
|
AC_CHECK_LIB([sendfile], [sendfile])
|
|
AC_CHECK_LIB([socket], [socket])
|
|
+AC_CHECK_LIB([network], [socket])
|
|
AC_SYS_LARGEFILE
|
|
AM_CONDITIONAL([AIX], [AS_CASE([$host_os],[aix*], [true], [false])])
|
|
AM_CONDITIONAL([ANDROID], [AS_CASE([$host_os],[linux-android*],[true], [false])])
|
|
@@ -61,9 +64,13 @@ AM_CONDITIONAL([OPENBSD], [AS_CASE([$host_os],[openbsd*], [true], [false])
|
|
AM_CONDITIONAL([OS390], [AS_CASE([$host_os],[openedition*], [true], [false])])
|
|
AM_CONDITIONAL([SUNOS], [AS_CASE([$host_os],[solaris*], [true], [false])])
|
|
AM_CONDITIONAL([WINNT], [AS_CASE([$host_os],[mingw*], [true], [false])])
|
|
+AM_CONDITIONAL([HAIKU], [AS_CASE([$host_os],[haiku*], [true], [false])])
|
|
AS_CASE([$host_os],[mingw*], [
|
|
LIBS="$LIBS -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv -luser32"
|
|
])
|
|
+AS_CASE([$host_os],[haiku*], [
|
|
+ LIBS="$LIBS -lroot -lnetwork -lbsd"
|
|
+])
|
|
AC_CHECK_HEADERS([sys/ahafs_evProds.h])
|
|
AC_CHECK_PROG(PKG_CONFIG, pkg-config, yes)
|
|
AM_CONDITIONAL([HAVE_PKG_CONFIG], [test "x$PKG_CONFIG" != "x"])
|
|
diff --git a/include/uv-unix.h b/include/uv-unix.h
|
|
index bca2714..cae33fe 100644
|
|
--- a/include/uv-unix.h
|
|
+++ b/include/uv-unix.h
|
|
@@ -58,6 +58,10 @@
|
|
# include "uv-bsd.h"
|
|
#endif
|
|
|
|
+#ifdef __HAIKU__
|
|
+# include "pthread-barrier.h"
|
|
+#endif
|
|
+
|
|
#ifndef PTHREAD_BARRIER_SERIAL_THREAD
|
|
# include "pthread-barrier.h"
|
|
#endif
|
|
diff --git a/src/unix/core.c b/src/unix/core.c
|
|
index 6283ed3..580eceb 100644
|
|
--- a/src/unix/core.c
|
|
+++ b/src/unix/core.c
|
|
@@ -55,6 +55,12 @@
|
|
# endif
|
|
#endif
|
|
|
|
+#ifdef __HAIKU__
|
|
+#include <sys/times.h>
|
|
+#define FIONCLEX 0x5450
|
|
+#define FIOCLEX 0x5451
|
|
+#endif
|
|
+
|
|
#if defined(__DragonFly__) || \
|
|
defined(__FreeBSD__) || \
|
|
defined(__FreeBSD_kernel__)
|
|
@@ -921,7 +927,7 @@ int uv_getrusage(uv_rusage_t* rusage) {
|
|
rusage->ru_stime.tv_sec = usage.ru_stime.tv_sec;
|
|
rusage->ru_stime.tv_usec = usage.ru_stime.tv_usec;
|
|
|
|
-#if !defined(__MVS__)
|
|
+#if !defined(__MVS__) && !defined(__HAIKU__)
|
|
rusage->ru_maxrss = usage.ru_maxrss;
|
|
rusage->ru_ixrss = usage.ru_ixrss;
|
|
rusage->ru_idrss = usage.ru_idrss;
|
|
@@ -938,6 +944,23 @@ int uv_getrusage(uv_rusage_t* rusage) {
|
|
rusage->ru_nivcsw = usage.ru_nivcsw;
|
|
#endif
|
|
|
|
+#if defined(__HAIKU__)
|
|
+ rusage->ru_maxrss = 0;
|
|
+ rusage->ru_ixrss = 0;
|
|
+ rusage->ru_idrss = 0;
|
|
+ rusage->ru_isrss = 0;
|
|
+ rusage->ru_minflt = 0;
|
|
+ rusage->ru_majflt = 0;
|
|
+ rusage->ru_nswap = 0;
|
|
+ rusage->ru_inblock = 0;
|
|
+ rusage->ru_oublock = 0;
|
|
+ rusage->ru_msgsnd = 0;
|
|
+ rusage->ru_msgrcv = 0;
|
|
+ rusage->ru_nsignals = 0;
|
|
+ rusage->ru_nvcsw = 0;
|
|
+ rusage->ru_nivcsw = 0;
|
|
+#endif
|
|
+
|
|
return 0;
|
|
}
|
|
|
|
--
|
|
2.10.0
|
|
|
|
From a3834352441da2845c4219af67ea2b610f765a50 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
|
|
Date: Sat, 29 Oct 2016 18:43:04 +0200
|
|
Subject: [PATCH] Test fix
|
|
|
|
---
|
|
test/test-fs.c | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/test/test-fs.c b/test/test-fs.c
|
|
index 06718f2..b28ad03 100644
|
|
--- a/test/test-fs.c
|
|
+++ b/test/test-fs.c
|
|
@@ -29,7 +29,8 @@
|
|
|
|
/* FIXME we shouldn't need to branch in this file */
|
|
#if defined(__unix__) || defined(__POSIX__) || \
|
|
- defined(__APPLE__) || defined(_AIX) || defined(__MVS__)
|
|
+ defined(__APPLE__) || defined(_AIX) || defined(__MVS__) || \
|
|
+ defined(__HAIKU__)
|
|
#include <unistd.h> /* unlink, rmdir, etc. */
|
|
#else
|
|
# include <direct.h>
|
|
--
|
|
2.10.0
|
|
|