|
|
HP-UX Reference > Zzero(7)HP-UX 11i Version 2: December 2007 Update |
|
NAMEzero — zero file DESCRIPTION/dev/zero is a zero special file. Reads from a zero special file always return characters whose value is "0" (\0 characters). Data written on a zero special file is discarded or ignored. Seeks on a zero special file always succeed. Private mmap() of a zero special file is allowed (see mmap(2)). Shared mmap() is allowed but the memory region can be shared only with descendants of the current process. The mmap() of /dev/zero is special in that it behaves as a MAP_ANONYMOUS object. Mapping /dev/zero gives the calling program a block of zero-filled virtual memory of the size specified in the call to mmap(). EXAMPLESIn the following example, the buffer "buf" is filled with "len" \0 characters.
In the following example, the process now has a range of "len" \0 characters at memory location "address":
|
|