Subject: Re: Replacement for grep(1) (part 2)
To: None <tech-userlevel@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-userlevel
Date: 07/07/1999 19:24:57
In article <xzp7locthir.fsf@flood.ping.uio.no>,
Dag-Erling Smorgrav <des@flood.ping.uio.no> wrote:
>
>Don't use err() indiscriminately after a malloc() failure; malloc()
>doesn't set errno.

Oh, please check better; malloc does not set errno directly, but
the system calls that it uses do. mmap() in particular can return
other errors than ENOMEM. Finally, I believe that malloc is required
to set errno by the Single Unix Specification

christos