zero-byte write to a socket fails

zero-byte write to a socket fails

Post by Gary Mil » Wed, 19 Apr 1995 04:00:00

I compiled the Dartmouth College adjusting rdate under Solaris 2.4, and
discovered that this code:

         * The protocol [RFC 868] calls for a null packet
         * to be sent to the server first. Then it sends the
         * time of day value.
        if (write(sock, (char *)&rtime, 0) < 0) {
                perror("\nrdate: write");

fails because the write() returns ERANGE.  Is this perchance a bug?

-Gary Mills-          -Unix Support-           -U of M Computer Services-


1. Floppy reports size as zero sectors, zero tracks, zero bytes

My 3-1/2" floppy drive has stopped responding properly to requests for
its geometry.  The low-level "fdformat" utility will query the hardware,
find out that the disk has zero sectors and zero tracks, and exit (it
seems to think its work is done).  The drive doesn't show any other
problems: I can put filesystems on the floppies and mount them, and I can
splat kernels directly onto the media with "dd".  I can even do a
low-level format with "superformat" (which doesn't seem to ask for the
geometry).  The sector/track error is only an issue with "fdformat" and
with Mach---Mach always wants to check the geometry before mounting the
floppy disk.

I'm trying to figure out what is causing the problem.  In the past, the
floppy drive worked fine.  Unfortunately, I can't tell when the problem
occurred; I don't do low-level formats that often.  I can think of three

 1. My 1992 floppy drive has had a hardware failure, or is simply
    incompatible with modern hardware.  (It moved from B: to A: a while
    back, but I doubt that's the problem).
 2. My PCI motherboard's built-in floppy controller is buggy.  It's an
    Intel Zappa ED, with the Triton 82430FX chipset.  It's fairly recent.
 3. The Linux floppy driver (which Mach is using) is incompatible with
    one of the two pieces of hardware.

Does anyone have suggestions on how to proceed?  Thanks.


Derek Upham

"Ha!  Your Leaping Tiger Kung Fu is no match for my Frightened Piglet style!"

2. Linux and Posix AIO

3. Question: select() & zero-byte strings

4. Metro-X and ET4000 SVGA-card?

5. Linux 2.2.14 and SMC2632W v. 3 WLAN card

6. 6 byte socket write problem?

7. What cause CRC error ?

8. number of bytes written by write(2)

9. Socket write failed...

10. socket write to server failed

11. recv zero bytes

12. Zero the reserved bytes of sadb_prob in af_key.c