Subject: Re: What is WR()
To: Olwe Bottorff <galanolwe@yahoo.com>
From: Dave Huang <khym@azeotrope.org>
List: netbsd-help
Date: 02/21/2006 13:47:06
On Tue, Feb 21, 2006 at 11:28:23AM -0800, Olwe Bottorff wrote:
> I came across the function WR() in some netbsd source
> (reverse.c, part of usr.bin/tail/). I guessing it has
> something to do with reversing the contents of a
> memory map, which is what reverse is about. What does
> it do and where is it defined?

It's a macro defined in usr.bin/tail/extern.h:

#define WR(p, size) \
        if (write(STDOUT_FILENO, p, size) != size) \
                oerr();

So, all it does is write the buffer to stdout, or call oerr() if the write
fails.