a1200   NEWS   APPS   DOCS   ABOUT
a1200
----
a1200
----
Autodocs
 Libraries:
 exec.library
  AVL_AddNode
  AVL_FindFirstNode
  AVL_FindLastNode
  AVL_FindNextNodeByAddress
  AVL_FindNextNodeByKey
  AVL_FindNode
  AVL_FindPrevNodeByAddress
  AVL_FindPrevNodeByKey
  AVL_RemNodeByAddress
  AVL_RemNodeByKey
  AbortIO
  AddDevice
  AddHead
  AddIntServer
  AddLibrary
  AddMemHandler
  AddMemList
  AddPort
  AddResource
  AddSemaphore
  AddTail
  AddTask
  Alert
  AllocAbs
  AllocEntry
  AllocMem
  AllocPooled
  AllocSignal
  AllocTrap
  AllocVec
  Allocate
  AttemptSemaphore
  AttemptSemaphoreShared
  AvailMem
  CacheClearE
  CacheClearU
  CacheControl
  CachePostDMA
  CachePreDMA
  Cause
  CheckIO
  CloseDevice
  CloseLibrary
  ColdReboot
  CopyMem
  CopyMemQuick
  CreateIORequest
  CreateMsgPort
  CreatePool
  Deallocate
  Debug
  DeleteIORequest
  DeleteMsgPort
  DeletePool
  Disable
  DoIO
  Enable
  Enqueue
  FindName
  FindPort
  FindResident
  FindSemaphore
  FindTask
  Forbid
  FreeEntry
  FreeMem
  FreePooled
  FreeSignal
  FreeTrap
  FreeVec
  GetCC
  GetMsg
  InitCode
  InitResident
  InitSemaphore
  InitStruct
  Insert
  MakeFunctions
  MakeLibrary
  ObtainQuickVector
  ObtainSemaphore
  ObtainSemaphoreList
  ObtainSemaphoreShared
  OldOpenLibrary
  OpenDevice
  OpenLibrary
  OpenResource
  Permit
  Procure
  PutMsg
  RawDoFmt
  ReleaseSemaphore
  ReleaseSemaphoreList
  RemDevice
  RemHead
  RemIntServer
  RemLibrary
  RemMemHandler
  RemPort
  RemResource
  RemSemaphore
  RemTail
  RemTask
  Remove
  ReplyMsg
  SendIO
  SetExcept
  SetFunction
  SetIntVector
  SetSR
  SetSignal
  SetTaskPri
  Signal
  StackSwap
  SumKickData
  SumLibrary
  SuperState
  Supervisor
  TypeOfMem
  UserState
  Vacate
  Wait
  WaitIO
  WaitPort
Include
GuruMeditation
Docs » Autodocs » exec.library » OpenDevice

NAME

	OpenDevice -- gain access to a device

SYNOPSIS

	error = OpenDevice(devName, unitNumber, iORequest, flags)
D0 A0 D0 A1 D1
BYTE OpenDevice(STRPTR,ULONG,struct IORequest *,ULONG);

FUNCTION

	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.

NOTES

	All calls to OpenDevice should have matching calls to CloseDevice!
Devices on disk cannot be opened until after DOS has been
started.
As of V36 tasks can safely call OpenDevice, though DOS may open
system requesters (e.g., asking the user to insert the Workbench
disk if DEVS: is not online). You must call this function from a
DOS Process if you want to turn off DOS requesters.

INPUTS

	devName - requested device name
unitNumber - 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 - additional driver specific information. This is sometimes
used to request opening a device with exclusive access.

RESULT

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

BUGS

	AmigaDOS file names are not case sensitive, but Exec lists are.  If
the library name is specified in a different case than it exists on
disk, unexpected results may occur.
Prior to V36, tasks could not make OpenDevice calls requiring disk
access (since tasks are not allowed to make dos.library calls).
Now OpenDevice is protected from tasks.

SEE ALSO

CloseDevice(), DoIO(), SendIO(), CheckIO(), AbortIO(), WaitIO()

Comments

Name:
E-mail: Use this if you want a message if you get a response, will not be shown.
Comment:
Select correct short for:

Crystal

AYS
CSL
RSI
ATX

Comments:

$VER: d0.se 1.14 Copyright © 2011-2024 Tobias Geijersson support at d0 dot se