Subject: Re: kern/2428: socketpair() fails if fd0 open
To: None <netbsd-bugs@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: netbsd-bugs
Date: 05/18/1996 07:49:37
> to work around these problems, i almost always use

> if (systemcall(...) < 0) {

> in my code

Me too - almost everything returns -1 to indicate errors and assorted
non-negative values on success...which is why I hadn't noticed that
socketpair() was broken earlier. :-)

> -- except for one rare case i can't recall right now, this has worked
> everywhere for me.

The one case where it has failed for me is lseek() on /dev/kmem, on
systems with off_t being the same size as a hardware address and kernel
VM in the high half of the address space (example: 4.3 on the VAX).
Then when lseeking in kmem, you have to check against -1 because the
previous-offset value usually comes out negative.

					der Mouse

			    mouse@collatz.mcrcim.mcgill.edu