LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   O_EXCL on device special files (https://www.linuxquestions.org/questions/linux-newbie-8/o_excl-on-device-special-files-66744/)

devershetty 06-19-2003 08:23 PM

O_EXCL on device special files
 
Hi..

what does open on device special file for.eg. /dev/hdax with O_EXCL flag mean ??
a. Does it mean an exclusive access of device file until it is closed??
b. Does it mean the device file is locked so that other programs for .eg mount can't access this device file.
or mount is blocked until lock on device file is released.

eg.
int fd;
chat * devfile = " /dev/hda9" ;

fd = open(devfile, O_RDWR | O_EXCL );

Mean while,
How to lock a device special file???
I mean i need for a daemon to lock a device file and mount command should not be able to acces this file?

TIA.
-Kotresh.


All times are GMT -5. The time now is 11:58 PM.