Unit 'EXEC' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#amunits]

OpenDevice

Open a device for use

Declaration

Source position: exec.pas line 1257

function OpenDevice(

  const devName: pCHAR;

  unite: LongWord;

  ioRequest: pIORequest;

  flags: LongWord

):ShortInt;

function OpenDevice(

  const devName: string;

  unite: LongWord;

  ioRequest: pIORequest;

  flags: LongWord

):ShortInt;

Arguments

devName

  

Requested device name

unite

  

The unit number to open on that device. The format of the unit number is device specific. If the device does not have separate units, send a zero.

ioRequest

  

The I/O request block to be returned with appropriate fields initialized.

flags

  

An additional driver specific information. This is sometimes used to request opening a device with exclusive access.

Function result

Returns a sign-extended copy of the io_Error field of the IORequest. Zero if successful, else an error code is returned.

Arguments

devName

  

Requested device name

unite

  

The unit number to open on that device. The format of the unit number is device specific. If the device does not have separate units, send a zero.

ioRequest

  

The I/O request block to be returned with appropriate fields initialized.

flags

  

An additional driver specific information. This is sometimes used to request opening a device with exclusive access.

Description

This function opens the named device/unit and initializes the given I/O request block. Specific documentation on opening procedures may come with certain devices.

The device may exist in memory, or on disk; this is transparent to the OpenDevice caller.

A full path name for the device name is legitimate. For example "test:devs/fred.device". This allows the use of custom devices without requiring the user to copy the device into the system's DEVS: directory.

See also

CloseDevice

  

Close access to a device.

DoIO

  

Perform an I/O request and wait for its finish

SendIO

  

Initiate an I/O command

CheckIO

  

Check status on an I/O request

AbortIO

  

Attempt to abort an in-progress I/O request

WaitIO

  

Wait for completion of an I/O request


Documentation generated on: 2021-07-30