问题标签 [netbsd]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
2121 浏览

c - sem_wait not unblocking with EINTR

I'm new with semaphores and want to add multithreading to my program, but I cannot get around the following problem: sem_wait() should be able to receive a EINTR and unblock, as long as I didn't set the SA_RESTART flag. I am sending a SIGUSR1 to the worker thread that is blocking in sem_wait(), it does receive the signal and get interrupted, but it will then continue to block and so it will never give me a -1 return code together with errno = EINTR. However, if I do a sem_post from the main thread, it will unblock, give me an errno of EINTR but a RC of 0. I am totally puzzled with this behavior. Is it some weird NetBSD implementation or am I doing something wrong here? According to the man page, sem_wait is conform POSIX.1 (ISO/IEC 9945-1:1996). A simple code:

I know the printf is not aloud in the signal handler, but just for the heck of it, if I remove it I get the same results.

These are the results without sem_post:

And with the sem_post:

I know I don't really need to unblock and can simply do an exit from main, but I want to see it working anyway. The reason I'm using sem_wait is because I want to keep the worker threads alive and wake the one up waiting the longest from the main thread with sem_post, as soon as there is a new client connection from Postfix. I don't want to do pthread_create all the time, since I will receive calls multiple times per second and I don't want to lose speed and make Postfix unresponsive to new smtpd clients. It is a policydaemon for Postfix and the server is quite busy.

Am I missing something here? Is NetBSD just messed up with this?

0 投票
1 回答
896 浏览

c - 如何使用 NetBSD 构建交叉编译 NetBSD 工具链

我有一个使用 qemu 创建的 NetBSD VM,我正在尝试使用我使用NetBSD 源代码附带Hello World.c的脚本构建的交叉编译工具链来编译一个简单的程序。build.sh但是,我无法编译程序。

我使用以下命令构建了工具链,

./build.sh -m evbarm tools

./build.sh -m evbarm -U distribution

上述命令的输出产生,

但是,当我尝试helloARM.c使用nbmake-evbarm包装器进行编译时,我得到以下输出,

0 投票
2 回答
3593 浏览

java - Apache POI 缺少动态库 libfreetype.so

我使用 Apache POI 编写电子表格。有问题的行是我调用Sheet#autoSizeColumn(int column). 如果我在没有图形环境的 unix shell 上运行它,则会出现以下异常:

根据apache 的快速指南,应该设置一个属性来表示无头环境,所以我尝试以下调用:

但是我得到了同一行的另一个例外:

上面的 apache 指南还说“我应该确保我在你的工作簿中使用的字体可用于 Java”。我真的不使用任何特定的字体,我对字体做的唯一一件事就是

unix shell 运行

有可能解决这个问题吗?

0 投票
1 回答
157 浏览

arm - ARM NetBSD5.1 Pthread 支持

我有 NetBSD5.1 源代码。我已经用源代码编译了内核和用户空间。当我在 ARM NetBSD5.1 中使用 pthread_create() 本地编译示例 C 程序时,它崩溃了。相同的程序在我的 Linux PC 中成功运行。想知道运行 NetBSD5.1 操作系统的 ARM 机器是否支持 Pthread?

注意:其他在 ARM 机器上本地编译的示例 C 程序运行成功。

0 投票
2 回答
169 浏览

c - NetBSD长双麻烦

我有简单的代码:

在我的 Ubuntu x64 上,它按预期打印 3.362100e-4932。在我的 NetBSD 上打印 1.681050e-4932

为什么会发生,我该如何解决?我尝试 clang 和 gcc 得到相同的结果。

我的系统(VirtualBox 5.0 中的虚拟机):

供参考

/usr/include/x86/float.h定义为LDBL_MINas 3.3621031431120935063E-4932L并且这个值大于 printf 结果。

0 投票
0 回答
168 浏览

arm - Pthread 在 ARMv7 NetBSD5.1 目标中不起作用

我已经编译了一个简单的 pthread_create 程序,并在 ARMv7 目标(cortex a9 CPU)上的 NetBSD5.1 中执行了相同的程序。

程序信号错误。相同的 pthread 程序正在另一台 PC 上运行,没有任何问题。

下面是示例程序

对此的任何指示都会非常有帮助。我看到在执行程序时引发了 data_abort_handler 异常。

0 投票
1 回答
216 浏览

netbsd - 如何使用完整的调试符号编译 NetBSD 内核和用户空间

我正在 NetBSD5.1 中为 ARM 编译 NetBSD 内核和用户空间

生成的库没有调试符号。是否有任何内核可用于启用用户态调试?

例如 libc.so.12 被剥离。我想要完整的调试符号

0 投票
1 回答
296 浏览

core-data - 用于 ARM 的交叉编译的 NetBSD 实用程序 /bin/ls,核心文件给出错误没有核心文件处理程序识别格式

我已经为 ARM 平台交叉编译了 /bin/ls NetBSD 实用程序。在执行相同的操作时,我看到该应用程序崩溃了。尝试使用 gdb 解码相同的内容。我看到以下错误。

GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5_5.2) 版权所有 (C) 2009 Free Software Foundation, Inc. 许可证 GPLv3+:GNU GPL 版本 3 或更高版本http://gnu.org/licenses/ gpl.html 这是免费软件:您可以自由更改和重新分发它。在法律允许的范围内,不提供任何保证。键入“显示复制”和“显示保修”以获取详细信息。这个 GDB 被配置为“i386-redhat-linux-gnu”。有关错误报告说明,请参阅: http ://www.gnu.org/software/gdb/bugs/ ...从 /home/subrahmanyam/crash/ls...读取符号...(未找到调试符号)...完毕。

没有核心文件处理程序识别格式,使用默认值 Can't fetch registers from this type core file Can't fetch registers from this type of core file Core是由`sh'生成的。程序以信号 4 终止,非法指令。无法从此类核心文件中获取寄存器 无法从此类核心文件中获取寄存器

disassemble 没有函数包含所选帧的程序计数器。(gdb)

你能帮忙解码核心文件吗?

0 投票
1 回答
281 浏览

bsd - pkgin: /usr/pkg 没有足够的空间来安装(需要276M只有274M可用)

我尝试gnome-2.26.2nb5在 NetBSD-7.0 上安装,但收到以下消息:

computer#pkgin install gnome-2.26.2nb5 pkgin: /usr/pkg does not have enough space for installation (276M required only 274M available)

这是 NetBSD-7.0 的全新安装,我已将其安装在大小约为 23GB 的分区上。

/usr/pkg我想知道在 NetBSD 上增加大小的最佳方法是什么。

的输出df -lh如下:

du -sh /usr/pkgsrc显示 15GB 被/usr/pkgsrc. 我最近安装了 NetBSD-7.0,起初我尝试编译/构建 gnome 桌面环境,但由于xulrunner192. 因此,我决定安装 gnome 桌面二进制文件,pkgin install但文件系统的大小还不够。我认为可能编译 gnome 这是一个巨大的元包在文件系统上占用了太多空间。我不确定。

0 投票
4 回答
95 浏览

unix - 替换 IP 地址和空格

我正在尝试转换ifconfig -a以提供特定的输出,但我不确定 sed 是否表现良好。特定版本的 sed 可能无法正常运行(由于不同的 sed 对应物)。

我的ifconfig -a输出(我只想看到网络掩码):

需要的输出(转换后的输出):

我失败的尝试:

它给了我输出:

我希望它能够提供我需要的输出。

帮助将有很大帮助。我正在使用 NetBSD 6.1.5 (Amazon EC2),但是,我相信任何通用装置都应该工作。