ADC Home > Reference Library > Technical Q&As > Legacy Documents > Hardware & Drivers >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Serial Flow Control Bug


Q: I'm calling the serial driver to clear XON/XOFF flow control but flow control is not being lifted. What's going on?

A: You have stumbled across a bug in Apple system software (ID 1635221). The File System Manager patches _Control in such a way that the serdClrXOff (csCode = 22) is mistaken for a block device "Return Media Icon" (csCode = 22) call. This causes the serdClrXOff to never make it to the serial driver.

The simplest workaround is to clear ioVRefNum before making the serdClrXOff call. The following code snippet demonstrates this technique.

OSErr DoClearXOff(short serialOutDrvrRefNum)
{
  CntrlParam pb;
  pb.ioCRefNum = serialOutDrvrRefNum;
  pb.csCode = serdClrXOff;
  pb.ioVRefNum = 0;
  // This above line is required because of a bug
  // in system software. The workaround, clearing
  // ioVRefNum, should be benign when the bug is fixed
  // in future systems.
  return ( PBControlSync( (ParmBlkPtr) &pb ) );
}

This bug was fixed in Mac OS 8.0.

[Jul 11 1997]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.