1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
$NetBSD: patch-src_lib_libast_features_syscall,v 1.1 2022/07/03 20:57:38 pin Exp $
On NetBSD, use `SYS___getcwd' to get the getcwd(2) syscall.
--- src/lib/libast/features/syscall.orig 2021-12-17 03:20:04.000000000 +0000
+++ src/lib/libast/features/syscall
@@ -1,9 +1,13 @@
-lib sysgetcwd note{ syscall(SYS_getcwd,buf,len) implemented }end link{
+lib sysgetcwd note{ syscall(SYS_getcwd/SYS___getcwd,buf,len) implemented }end link{
#include <sys/syscall.h>
int main()
{
char buf[256];
+ #ifdef __NetBSD__
+ return syscall(SYS___getcwd, buf, sizeof(buf)) < 0;
+ #else
return syscall(SYS_getcwd, buf, sizeof(buf)) < 0;
+ #endif
}
}end
@@ -13,6 +17,10 @@ if ( _lib_sysgetcwd ) {
endif
if ( _lib_sysgetcwd ) {
+ #ifdef __NetBSD__
+ #define SYSGETCWD(a,b) syscall(SYS___getcwd,a,b)
+ #else
#define SYSGETCWD(a,b) syscall(SYS_getcwd,a,b)
+ #endif
}
endif
|