Emmanuel Dreyfus | 15 Sep 06:35 2014

strtoll question


Consider the program below and its output. Am I using strtoll() wrongly,
or is this a bug? (this is netbsd-7 branch)

$ cat /tmp/x.c
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>

        const char *ptr = "999999999999999";
        char *endp;
        long long int res;

        errno = 0;
        res = strtoll(ptr, &endp, 0);
        printf("errno = %d\n", errno);
        printf("*endp = 0x%02x\n", *endp);
        printf("str %s\n", ptr);
        printf("num %lld\n", res);

        return 0;

$ cc -o /tmp/x /tmp/x.c 
$ /tmp/x
errno = 0
(Continue reading)

Thomas Klausner | 23 Aug 22:22 2014

FreeBSD got a new automounter

Something to borrow?


Emmanuel Dreyfus | 22 Aug 11:59 2014

check memory mapping


Is there a way for a process to check whether a given address in mmeory 
is accessible, without triggering a signal?

There is mincore(), but it jus says wether it is already in resident
memory, not if accessing the address will swap it in or cause a SIGSEGV.


Emmanuel Dreyfus
manu <at> netbsd.org

Emmanuel Dreyfus | 20 Aug 17:02 2014

Linux libaio


What can be done for porting software that depends on Linux libaio? 
It seems NetBSD has a POSIX aio feature in librt, was there some
middlewae library developped for porting libaio on NetBSD?


Emmanuel Dreyfus
manu <at> netbsd.org

Patrick Welche | 15 Aug 01:30 2014


I just tried to compile xen, and the first problem I hit is that it makes

Tantalizingly, our /usr/include/limits.h says:

/* Not yet: PTHREAD_STACK_MIN */

http://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html suggests
that any positive value is possible:

  Minimum size in bytes of thread stack storage. Minimum Acceptable Value: 0

According to pthread_attr_getstack(3):

     The pthread_attr_setstacksize() function may additionally fail if:

     [EINVAL]           The specified stacksize is less than PTHREAD_STACK_MIN
                        or exceeds some system-imposed limit.

and pthread_attr_setstacksize returns EINVAL if
stacksize > _SC_THREAD_STACK_MIN (=59) as per /usr/include/sys/unistd.h.

Should PTHREAD_STACK_MIN be defined to 59?



James K. Lowden | 12 Aug 02:29 2014

poison mmap cache

I'm testing different algorithms for performance against a single
memory-mapped file.  How can I best ensure that for each run the
page cache is cold, that the prior run left nothing for the current run
to take advantage of?  

I tried calling mmap(2) on an unrelated file larger than RAM, and
iterating over it.  Not only would I prefer something more
deterministic, but the following output suggests to me that technique
wasn't effective:

begin= 0x7f7f9de1e000, n= 10000000
sorted 1 of 100000000 in 2 seconds
begin= 0x7f7fa2a69408, n= 10000000
sorted 2 of 100000000 in 4 seconds
begin= 0x7f7fa76b4810, n= 10000000
sorted 3 of 100000000 in 6 seconds
begin= 0x7f7fac2ffc18, n= 10000000
sorted 4 of 100000000 in 8 seconds
begin= 0x7f7fb0f4b020, n= 10000000
sorted 5 of 100000000 in 9 seconds
begin= 0x7f7fb5b96428, n= 10000000
sorted 6 of 100000000 in 11 seconds
begin= 0x7f7fba7e1830, n= 10000000
sorted 7 of 100000000 in 13 seconds
begin= 0x7f7fbf42cc38, n= 10000000
sorted 8 of 100000000 in 14 seconds
begin= 0x7f7fc4078040, n= 10000000
sorted 9 of 100000000 in 16 seconds
begin= 0x7f7fc8cc3448, n= 10000000
sorted 10 of 100000000 in 19 seconds
(Continue reading)

Marc Balmer | 10 Aug 17:45 2014

A problem running LaTeX from a daemon

I have a daemon that provides a webservice (using FastCGI behind a lighttpd server) on NetBSD 5.0.  It
produces PDF documents by creating a .tex file, then running LaTeX, dvips, and ps2pdf on it.

The  exact sequence of command is:

latex <filename> >/dev/null
latex <filename> >/dev/null
dvips  -Ppdf -G0 <filename>.dvi >/dev/null 2>&1
ps2pdf  <filename>.ps >/dev/null

The daemon is started with a script in /etc/rc.d.

Now my problem is, when this sequence of commands is run from the daemon which was started a system boot time,
it does not work.  It creates a PDF (so ps2pdf does run), but it is empty.  So 'latex' did not run or did not
produce any dvi file.

If I, however, log in to the machine as root and restart the daemon (/etc/rc.d/≤name> restart), it works as
expected, creates and delivers the PDF.

Right now, I am a bit clueless as which could cause this.  Lack of a controlling tty when started during boot?

Any hints would be appreciated...

- Marc

Alan Barrett | 7 Aug 09:14 2014

Replacing gkermit with ekermit

I would like to remove gkermit (GPLv2) and add a BSD-licenced 
kermit implementation such as E-Kermit (very small, see 
<http://www.kermitproject.org/ek.html>) or C-Kermit (much larger, 
see <http://www.kermitproject.org/ck90.html>).  Read on for 

In 2006, we imported the "gkermit" program, which is a lightweight 
implementation of the Kermit file transfer protocol, with a 
GPLv2 licence.  This was intended to be useful for transferring 
files over a console port to aid in system recovery.  It was 
even added to /rescue because of its usefulness in system 
recovery, but was then removed due to licencing concrns.  See 
for an example of a use case for a small Kermit 
implementation in the base system and in /rescue, 
and search for "gkermit" in the index page at 
to find other other messages in the discussion from 2006.

At that time (2006), most Kermit implementations had a licence 
that prohibited copying for commercial use, but C-Kermit had a 
licence exemption that allowed inclusion in a "Free UNIX" or 
other Open Source operating-system distribution, and gkermit had 
a GPL licence.  The C-Kermit licence would not not have allowed 
inclusion in products shipped by vendors who use NetBSD, so (back 
in 1999 when Columbia University added the licence exemption) 
NetBSD chose not to include C-Kermit.

In 2011, Columbia University re-licenced most Kermit 
implementations under a revised 3-clause BSD licence, 
(Continue reading)

Andrés Martinelli | 5 Aug 21:57 2014

Re: new igmafb driver

Thanks for the information. About the later suggestion (DRMKMS), anyone
know if is there a guide explaining how to compile the kernel and setup the
framebuffer in different resolutions??

2014-08-05 14:39 GMT-03:00 Jeff Rizzo <riz <at> tastylime.net>:

> On 8/5/14 8:23 AM, Andrés Martinelli wrote:
>> Hello!
>> I have noticed a new IGMAFB driver is provided since this January in
>> current branch.
>> Anyone know where I can get documentation to set it up (if its exists),
>> or how I can setup the framebuffer for my intel HD 4000 card?
>> It is neccesary to recompile the kernel?
>> NOTE: I have yesterday's current installed in my laptop.
>> Thanks!
> I believe there is an igma(4) man page you can refer to.
> In any case, I created an IGMA kernel config, which looks like:
> cassava:riz  ~/src> more sys/arch/amd64/conf/IGMA
> include         "arch/amd64/conf/GENERIC"
> no options VGA_POST
(Continue reading)

Christian Koch | 4 Aug 23:13 2014

Initial attempt at a Lua interface to npf(3)

Hey everybody,

I announced this a little earlier in #netbsd on Freenode, but I've just
published an initial attempt at Lua bindings for npf(3). Fork me!


Actually, I wrote this code a while ago, then I forgot about it, then I
published it today.

Somewhat related: I've also set up a dedicated repo for Cadet, my minimal
bozohttpd/Lua library.


These two things together could provide a base for a web interface to NPF. Of
course, There's More Than One Way To Do It, but it's a start, anyway.


Jan Danielsson | 2 Aug 18:36 2014

Web UI for NPF



   Is anyone working on this?


Kind Regards,