Re: calling open() on an older cd device returns EBUSY??
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com David, Sam On 05/05/2005, at 9:39 PM, darwin-dev-request@lists.apple.com wrote: so, opendev() gives you the char device, while open() gives you the block device? I was unsuccessful doing open("disk2"), I *was* successful doing open("rdisk2"). Are you saying it's better to call opendev("rdisk2")? what exactly does prepending "r" in front of the "disk2" do? _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... I see you've already had a few replies, but I thought I'd point out where you can look if you want to read about how the devices in /dev get there and what they do. If you download the IOStorageFamily code from the Darwin section of developer.apple.com, you'll find a file inside called IOMediaBSDClient.cpp. This file is responsible for making IOKit devices such as disks available to BSD, which it does by adding them to the devfs file system mounted on /dev. (run "mount" to see all your currently mounted file systems) If you run /Developer/Applications/Utilities/IORegistryExplorer.app, open the Find window and search for "IOMediaBSDClient", you can inspect these IOKit objects and their parents. You'll see the BSD Name entries for each of your /dev/diskN and /dev/rdiskN devices in there, along with a lot of other interesting properties. So as you can see from the calls to devfs in IOMediaBSDClient.cpp, the names given to these devices are completely arbitrary. The devfs entries, along with their BSD Major and BSD Minor numbers visible with `ls -l /dev/*disk*`, are really just a bridge to allow you to communicate with the relevant IOKit driver for a particular device. This email sent to site_archiver@lists.apple.com
participants (1)
-
Sam Vaughan