Questions about attach (9E), open (2) and deferred attach

Questions about attach (9E), open (2) and deferred attach

Post by Sunny Sue » Wed, 16 Mar 2005 00:50:00

Seems there's a potential catch-22 situation between the open (2)
system call & the attach (9E) entry point when a driver is loaded for
the very first time and its device special file doesn't exist yet.
*  open (2) requires attach (9E) to create a device file as its valid
*  attach (9E) needs open (2) to initiate the process of loading the

WDD (Writing Device Driver) has a very brief mention of the "Deferred
Attach" mechanism, where the open (9E) entry point returns ENXIO to
allow attach (9E) to attempt at an unready device.
But what if we have no device number to pass to open (7E) in the first

Also wonder how the user commands devfsadm (1M), drvconfig (1M) and
friends manage to resolve the issue.

For example, putting everything together, curious to see if the
followings are what happen when a new external SCSI hard disk is
attached to a Solaris box. Assume the target minor node, say c1t1d0s0,
is absent from the device tree at the time of running the drvconfig
(1M) command.
1. open (2) system call is invoked to test a range of device candidates
like c0t2d0s0, ..., c0t3d0s0, ..., c1t1d0s0, ...
2. open (7E) entry point returns ENXIO for these candidates and
attempts deferred attachment to them.
3. attach (7E) succeeds with the c1t1d0s0 instance, creates the node
and device files accordingly.

Any idea?

One more thing, can any one please post a sample truss list of the
devfsadm (1M) or drvconfig (1M) command, irrespective of the device
being added.
Pity that there's no R & D machine available to me :-(



1. opening attached word documents in Navigator

I recently loaded red hat 6.0, and am currently using it as my mail
server, and using the netscape pop mail.  The only proplem is that i am
not able to open word documents.  I recently installed Applixware to be
able to open the word documents, but the only way i can do this is my
saving the document off, manually opening applixware and importing the
document.  I saw in Netscape where u can go to
Edit>Preference>Applications and in there u could set up what u want to
use to open word documents with.  I set it up to open Applixware when i
click on the word document, But i still have to import it.  How do i
set it up to just open the word document when I click on it.  Without
the pain of saving it off and importing it?



Sent via
Before you buy.

2. 3c509b combo in Linux driver?

3. Applixware, Mail Attached MS Word, Automatic Open Help Needed

4. Help...Please! (SPARCstation IPX)

5. How to tell which open ports are attached to which processes?

6. sig{set|long}jmp

7. opening tty devices with getty attached

8. fvwm95-2

9. Can not open '/dev/sg0' - attach failed.

10. Too Many Files Open Error During Shared Memory Attach

11. failed to attach question

12. Question about Attaching to Shared Memory Segs--shmat

13. What Network Am I Attached To? (Socket Question)