Import of pkgsrc-2016Q3

This commit is contained in:
2016-10-14 07:49:11 +02:00
committed by Lionel Sambuc
parent 9d819b6d54
commit 1242aa1e36
35952 changed files with 949749 additions and 377083 deletions

View File

@@ -1,8 +1,10 @@
$NetBSD: patch-src_libutil_sysutil.cpp,v 1.2 2014/07/09 20:00:01 ryoon Exp $
$NetBSD: patch-src_libutil_sysutil.cpp,v 1.3 2016/02/17 21:54:09 richard Exp $
--- src/libutil/sysutil.cpp.orig 2014-06-21 06:21:09.000000000 +0000
updated for initial SunOS support
--- src/libutil/sysutil.cpp.orig 2015-06-11 17:25:58.000000000 +0000
+++ src/libutil/sysutil.cpp
@@ -70,6 +70,12 @@
@@ -70,6 +70,17 @@
# include <sys/ioctl.h>
#endif
@@ -11,11 +13,16 @@ $NetBSD: patch-src_libutil_sysutil.cpp,v 1.2 2014/07/09 20:00:01 ryoon Exp $
+# include <sys/ioctl.h>
+# include <sys/sysctl.h>
+#endif
+
+#ifdef __sun
+# include <unistd.h>
+# include <sys/ioctl.h>
+#endif
+
#include "OpenImageIO/dassert.h"
#include "OpenImageIO/sysutil.h"
@@ -108,6 +114,12 @@ Sysutil::memory_used (bool resident)
@@ -108,6 +119,12 @@ Sysutil::memory_used (bool resident)
return size;
#endif
@@ -28,7 +35,7 @@ $NetBSD: patch-src_libutil_sysutil.cpp,v 1.2 2014/07/09 20:00:01 ryoon Exp $
#elif defined(__APPLE__)
// Inspired by:
// http://miknight.blogspot.com/2005/11/resident-set-size-in-mac-os-x.html
@@ -192,7 +204,12 @@ Sysutil::physical_memory ()
@@ -192,7 +209,12 @@ Sysutil::physical_memory ()
size_t length = sizeof(physical_memory);
sysctl (mib, 2, &physical_memory, &length, NULL, 0);
return physical_memory;
@@ -42,7 +49,7 @@ $NetBSD: patch-src_libutil_sysutil.cpp,v 1.2 2014/07/09 20:00:01 ryoon Exp $
#else
// No idea what platform this is
ASSERT (0 && "Need to implement Sysutil::physical_memory on this platform");
@@ -244,6 +261,10 @@ Sysutil::this_program_path ()
@@ -244,6 +266,16 @@ Sysutil::this_program_path ()
size_t cb = sizeof(filename);
int r=1;
sysctl(mib, 4, filename, &cb, NULL, 0);
@@ -50,10 +57,16 @@ $NetBSD: patch-src_libutil_sysutil.cpp,v 1.2 2014/07/09 20:00:01 ryoon Exp $
+ unsigned int size = sizeof(filename);
+ int r = readlink ("/proc/curproc/exe", filename, size);
+ ASSERT(r < int(size)); // user won't get the right answer if the filename is too long to store
+#elif defined(__sun)
+ int r = 0;
+ if (realpath(getexecname(), filename) == NULL)
+ filename[0] = '\0';
+ else
+ r = strlen(filename);
#elif defined(__GNU__) || defined(__OpenBSD__)
int r = 0;
#else
@@ -275,7 +296,7 @@ Sysutil::terminal_columns ()
@@ -275,7 +307,7 @@ Sysutil::terminal_columns ()
{
int columns = 80; // a decent guess, if we have nothing more to go on