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:

Determining Whether a Device Supports Asynchronous I/O


Q: How can we determine whether a device supports asynchronous I/O?

A: The best way to determine if a SCSI device supports asynchronous I/O is to use Gestalt. Check the gestaltSCSI selector to see if the gestaltAsyncSCSI bit is set, as shown below:

#include <Gestalt.h>
Boolean CanDoAsyncSCSI(void)
{
  long response;
  OSErr err;
  err = Gestalt(gestaltSCSI, &response);
  if (err) return false;
  return (response & (1 << gestaltAsyncSCSI) );
}

There is no Gestalt test currently available for non-SCSI devices. You can assume that asynchronous calls to a driver will be handled correctly. If the driver is actually asynchronous, your completion routine is called when the I/O is finished. If the driver is not asynchronous, the driver returns and calls your completion routine when the I/O is finished.

For more information, see the SCSI Manager 4.3 chapter of Inside Macintosh:Devices and "Asynchronous routines on the Macintosh" in issue 13 of Develop.

[Jul 01 1995]


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.