- To: Jeff Waugh <jdub@xxxxxxxxxxx>
- Subject: Re: [SLUG] Quick Unixy Q.
- From: James Morris <jmorris@xxxxxxxxxxxxxxxx>
- Date: Thu Nov 23 13:09:19 2000
- Cc: Penguinillas <slug@xxxxxxxxxxx>
On Thu, 23 Nov 2000, Jeff Waugh wrote:
> 'tag,
>
> Here's a quick one... What is /dev/zero used for, and what are a few good
> examples?
>
> I was just crashing Mozilla the other day (file:///dev/zero), and thought I
> could do with this gap in my knowledge filled.
>
man 4 zero
As mentioned, it's a source of null bytes.
One example of usage is to allocate page-aligned memory by mmap()ing
/dev/zero (see http://www.intercode.com.au/jmorris/rawutil/), instead of
using the deprecated valloc() function.
- James
--
James Morris
<jmorris@xxxxxxxxxxxxxxxx>