Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1a 12/4/83; site rlgvax.UUCP
Path: utzoo!watmath!clyde!floyd!harpo!seismo!rlgvax!guy
From: guy@rlgvax.UUCP (Guy Harris)
Newsgroups: net.unix
Subject: Re: help needed to download ascii null from unix
Message-ID: <1648@rlgvax.UUCP>
Date: Wed, 1-Feb-84 22:18:47 EST
Article-I.D.: rlgvax.1648
Posted: Wed Feb  1 22:18:47 1984
Date-Received: Tue, 7-Feb-84 14:23:47 EST
References: <16215@sri-arpa.UUCP>
Organization: CCI Office Systems Group, Reston, VA
Lines: 22

> Uh, write(2,"",1) writes the first byte of your address space, which may
> be zero if you are lucky.  I remember a long discussion a while ago on
> the subject of *0 and what is found there.  I don't remember the outcome
> or positions, but I don't think it is a particularly swift idea in general.

False.  You are probably confusing a null string in C, which is allocated
(like all strings) in a program's data space, with the null string that
lives, purely by coincidence, at location 0 in some systems' address spaces.
Several programs - a lot of them from Berkeley - *depend* on location 0
being a null string; a lot of those programs have been fixed in 4.2 because
on the Sun a large and nasty bear trap lives at location 0 and programs which
try to dereference null pointers get properly punished.

	write(2, "", 1);

writes one byte from wherever the compiler and linker happened to put the
"" mentioned in the call to "write"; that byte would be the first byte of
"" which is a zero byte.  Why would write(2, "", 1) be any different from
write(2, "False statement!\n", 17)?

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy