head	1.2;
access;
symbols
	pkgsrc-2026Q1:1.1.0.20
	pkgsrc-2026Q1-base:1.1
	pkgsrc-2025Q4:1.1.0.18
	pkgsrc-2025Q4-base:1.1
	pkgsrc-2025Q3:1.1.0.16
	pkgsrc-2025Q3-base:1.1
	pkgsrc-2025Q2:1.1.0.14
	pkgsrc-2025Q2-base:1.1
	pkgsrc-2025Q1:1.1.0.12
	pkgsrc-2025Q1-base:1.1
	pkgsrc-2024Q4:1.1.0.10
	pkgsrc-2024Q4-base:1.1
	pkgsrc-2024Q3:1.1.0.8
	pkgsrc-2024Q3-base:1.1
	pkgsrc-2024Q2:1.1.0.6
	pkgsrc-2024Q2-base:1.1
	pkgsrc-2024Q1:1.1.0.4
	pkgsrc-2024Q1-base:1.1
	pkgsrc-2023Q4:1.1.0.2
	pkgsrc-2023Q4-base:1.1;
locks; strict;
comment	@// @;


1.2
date	2026.05.18.10.18.55;	author adam;	state dead;
branches;
next	1.1;
commitid	JPBfOYOlO34wyhGG;

1.1
date	2023.11.02.13.16.54;	author adam;	state Exp;
branches;
next	;
commitid	7iQVZRYIk52Fm2LE;


desc
@@


1.2
log
@nodejs20: removed; end-of-life
@
text
@$NetBSD: patch-deps_v8_src_base_platform_platform-posix.cc,v 1.1 2023/11/02 13:16:54 adam Exp $

Use sysconf(_SC_THREAD_STACK_MIN) instead of PTHREAD_STACK_MIN.
Cast explicitly.
Remove legacy madvise(2) prototypes, prefer posix_madvise(2) if available.

Avoid using a random hint, some low numbers cause spurious ENOMEM on netbsd
(PR port-arm/55533)

--- deps/v8/src/base/platform/platform-posix.cc.orig	2023-04-17 23:15:54.000000000 +0200
+++ deps/v8/src/base/platform/platform-posix.cc	2023-05-03 14:19:05.405513040 +0200
@@@@ -75,14 +75,6 @@@@
 #define MAP_ANONYMOUS MAP_ANON
 #endif
 
-#if defined(V8_OS_SOLARIS)
-#if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__)
-extern "C" int madvise(caddr_t, size_t, int);
-#else
-extern int madvise(caddr_t, size_t, int);
-#endif
-#endif
-
 #ifndef MADV_FREE
 #define MADV_FREE MADV_DONTNEED
 #endif
@@@@ -391,6 +383,10 @@@@
 #endif
 #endif
 #endif
+
+#if V8_OS_NETBSD
+  raw_addr = 0;
+#endif
   return reinterpret_cast<void*>(raw_addr);
 }
 
@@@@ -553,14 +549,11 @@@@
     // MADV_FREE_REUSABLE sometimes fails, so fall back to MADV_DONTNEED.
     ret = madvise(address, size, MADV_DONTNEED);
   }
-#elif defined(_AIX) || defined(V8_OS_SOLARIS)
-  int ret = madvise(reinterpret_cast<caddr_t>(address), size, MADV_FREE);
+#elif defined(POSIX_MADV_DONTNEED)
+  int ret = posix_madvise(address, size, POSIX_MADV_DONTNEED);
   if (ret != 0 && errno == ENOSYS) {
     return true;  // madvise is not available on all systems.
   }
-  if (ret != 0 && errno == EINVAL) {
-    ret = madvise(reinterpret_cast<caddr_t>(address), size, MADV_DONTNEED);
-  }
 #else
   int ret = madvise(address, size, MADV_DONTNEED);
 #endif
@@@@ -802,6 +795,8 @@@@
   return static_cast<int>(syscall(__NR_gettid));
 #elif V8_OS_ANDROID
   return static_cast<int>(gettid());
+#elif V8_OS_NETBSD || V8_OS_FREEBSD
+  return static_cast<int>(reinterpret_cast<intptr_t>(pthread_self()));
 #elif V8_OS_AIX
   return static_cast<int>(thread_self());
 #elif V8_OS_FUCHSIA
@@@@ -1075,7 +1070,11 @@@@
     : data_(new PlatformData),
       stack_size_(options.stack_size()),
       start_semaphore_(nullptr) {
+#if V8_OS_NETBSD
+  const int min_stack_size = sysconf(_SC_THREAD_STACK_MIN);
+#else
   const int min_stack_size = static_cast<int>(PTHREAD_STACK_MIN);
+#endif
   if (stack_size_ > 0) stack_size_ = std::max(stack_size_, min_stack_size);
   set_name(options.name());
 }
@@@@ -1091,7 +1090,7 @@@@
   pthread_set_name_np(pthread_self(), name);
 #elif V8_OS_NETBSD
   static_assert(Thread::kMaxThreadNameLength <= PTHREAD_MAX_NAMELEN_NP);
-  pthread_setname_np(pthread_self(), "%s", name);
+  pthread_setname_np(pthread_self(), "%s", (void *)name);
 #elif V8_OS_DARWIN
   // pthread_setname_np is only available in 10.6 or later, so test
   // for it at runtime.
@


1.1
log
@nodejs20: added version 20.9.0 (from lang/nodejs)

Version 20.9.0 'Iron' (LTS)

Notable Changes

This release marks the transition of Node.js 20.x into Long Term Support (LTS) with the codename 'Iron'. The 20.x release line now moves into "Active LTS" and will remain so until October 2024. After that time, it will move into "Maintenance" until end of life in April 2026.

Known issue

Collecting code coverage via the NODE_V8_COVERAGE environment variable may lead to a hang. This is not thought to be a regression in Node.js 20 (some reports are on Node.js 18). For more information, including some potential workarounds.
@
text
@d1 1
a1 1
$NetBSD: patch-deps_v8_src_base_platform_platform-posix.cc,v 1.12 2023/05/03 14:03:09 nikita Exp $
@

