Re: linux-kernel-digest V1 #3762

David Luyer (luyer@ucs.uwa.edu.au)
Fri, 07 May 1999 12:49:36 +0800


> Explain how the assignment can fail.

Assignments can fail. Fortunately we have SIGSEGV et al to report it to us,
rather than letting assignments have a return code.

#define left *((char*)0)

if(left = right) {
/* ... */
}

now you need a SIGSEGV handler to realise that address zero is not mapped,
play around with address mappings, and return when it's safe to write to
address zero. That's how assignment failures are handled. Not with any
kind of return code.

David.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/