Emmanuel Dreyfus | 22 Aug 11:59 2014
X-Face
Picon

check memory mapping

Hi

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
X-Face
Picon

Linux libaio

Hi

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
Picon
Picon

PTHREAD_STACK_MIN

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

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?

Cheers,

Patrick

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
Picon

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
Picon

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 
details.

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 
<http://mail-index.netbsd.org/tech-userlevel/2006/10/29/0020.html> 
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 
<http://mail-index.netbsd.org/tech-userlevel/2006/10/oindex.html> 
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
Picon

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??
Thanks!

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"
>
> options VGA_RASTERCONSOLE
> no options VGA_POST
(Continue reading)

Christian Koch | 4 Aug 23:13 2014
Picon

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!

    http://github.com/christiank/npflua

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.

    http://github.com/christiank/cadet

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.

-Christian

Jan Danielsson | 2 Aug 18:36 2014
Picon

Web UI for NPF

Hello,

   http://wiki.netbsd.org/projects/project/npf_web_ui/

   Is anyone working on this?

--

-- 
Kind Regards,
Jan

Darren Reed | 31 Jul 14:43 2014
Picon

New format of output from man -k

NetBSD has a new man command and now mandoc is what's used.

ok.

My problem is the output. e.g.:

netbsd-current# man -k nfsd
$<2>nfsd$<2> ($<2>8$<2>)      $<2>remote NFS server$<2>
$<2>nfsd$<2> runs on a server machine to service NFS requests from
client machines. At least one $<2>nfsd$<2> must be running for a machine
to operate as a server. Unless otherwise specified, four servers for UDP
transport are started. The following...

$<2>nfssvc$<2> ($<2>2$<2>)    $<2>NFS services$<2>
...set in flags. Calls used by $<2>nfsd$<2>(8) On the server side,
nfssvc is called with the flag NFSSVC_NFSD and a pointer to a struct
nfsd_srvargs {     struct $<2>nfsd$<2>        *nsd_nfsd;      /* Pointer
to in kernel $<2>nfsd$<2> struct */     uid_t           nsd_uid;       
/* Effective uid mapped..

Now "man -k nfsd" works nicely on every other platform I use (or have
ever used) but somehow it fails badly here. I get that some people may
see this as being better and I don't want to rain on that parade. And
I'm sure it looks better in someone else's terminal but that's not what
interests me.

My question is this.

How do I get it to look like it did before with one line per man page?

(Continue reading)

Christos Zoulas | 23 Jul 12:38 2014

is there any value in secure path?


I am asking because I intend to change it to abort() with an error message
and remove it's two uses.

    - There are only 2 uses of it in the tree
    - It suffers from TOCTOU
    - It does not do what it claims (it checks the file not the full path)
    - It can be easily circumvented
    - It is not standard

While it would be useful to have such a function, that takes a path and
returns a file descriptor if the path and the file are "trusted" (what
that means needs to be defined), this function is not it...

christos


Gmane