Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Open BSD raw disk with O_RDWR issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Open BSD raw disk with O_RDWR issue



Hi Everyone,

 

The suggestion that if application needs to perform block-level reads or writes, consider the BSD raw disk device instead.

And yes, now I could use BSD pread()/pwrite() APIs to read/write specified one sector in /dev/rdiskx.

But I have a problem is when I want to open the raw disk with O_RDWR (O_RDONLY is fine), the system report that “Resource Busy” and I need to unmount or eject this disk’s partitions first, than I could use O_RDWR for pwrite().

So here are my questions:

1.      Do I really need to unmount the all the partitions of the /dev/rdiskx, then I can successfully open disk with O_RDWR without “Resource Busy”?

2.      Is there any kind of methods or parameters that I could open the disk using O_RDWR flags but without “Resource Busy”?

3.      If the disk is busy reading or writing, could I force to unmount the partitions?

 

Any comments will be appreciated.

 

Thanks!

 

Mark

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Ata-scsi-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.