lkml.org 
[lkml]   [1996]   [May]   [5]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
From(Bernd Eckenfels)
SubjectRe: Exclusive access to block devices
Date4 May 1996 04:18:16 GMT
Grant R. Guenther <grant@gear.torque.net> wrote:
>          There doesn't appear to be any general way to specify that an
> ioctl should only be executed if the access count is == 1, or to
> test that a block device is not mounted or otherwise open ...  (While
> an absolute race-free lock would be nice, a simple busy test would be
> adequate for the application.)

You can use O_EXCL in conjunction with fstat(). The generic SCSI driver
seems to support that. Problem may be root access, not sure if it works, but
thats what the flag is for :)

Greetings
Bernd
-- 
  (OO)      -- Bernd_Eckenfels@Wittumstrasse13.76646Bruchsal.de --
 ( .. )  ecki@lina.{inka.de,ka.sub.org}  http://home.pages.de/~eckes/
  o--o     *plush*  2048/93600EFD  eckes@irc  +4972573817  *plush*
(O____O)       If privacy is outlawed only Outlaws have privacy

\
 
 \ /
  Last update: 2005-03-22 13:37    [from the cache]
©2003-2008