It is currently Wed, 16 Apr 2014 05:27:06 GMT



 
Author Message
 AIX version of NT's _fsopen() ?
Hi, is there an AIX api that I can use to open a file with exclusive
access? I can do this on NT using _fsopen(). _fsopen() is the same as
open(), but with an additional parameter for specifying sharing options.

Thanks,
Kevin.

Sent via Deja.com http://www.**-**.com/
Before you buy.



 Sun, 02 Feb 2003 03:00:00 GMT   
 AIX version of NT's _fsopen() ?
In article <8ndp1k$94...@nnrp1.deja.com>, kosulli...@elandtech.com
wrote:

If you're trying to handle file access among cooperating processes, ie
processes that are designed to work together, you can build logic into
your code to lock file regions with the fcntl() system calls.

But file exclusivity among disparate processes on Unix is best handled
at the filesystem level, through permissions and ownership.  Try to
structure your directories so that only certain UIDs or GIDs have access
to the files you want to control.  This doesn't affect root's access by
any means, but root is supposed to Know What He is Doing(TM) anyway.

AIX does support SVR4 mandatory record locking, which is activated by
setting the SGID mode bit and clearing the group-execute bit.  This
effectively shifts exclusivity operations from the filesystem into the
kernel, but it's not bullet proof by any means.  Mandatory record
locking only applies to operations that affect the file pointer, like
read(), write(), or open().  However unlink() can still delete the file.

RR



 Sun, 02 Feb 2003 03:00:00 GMT   
 AIX version of NT's _fsopen() ?

Check the man pages.  AIX open(2) allows O_NSHARE and O_RSHARE flags
for exclusive access to local files.  (Doesn't work over NFS, though.
You have to use regular file locking there.)

--
James Carlson, Internet Engineering       <james.d.carl...@east.sun.com>
SUN Microsystems / 1 Network Drive         71.234W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.497N   Fax +1 781 442 1677
"PPP Design and Debugging" --- http://people.ne.mediaone.net/carlson/ppp



 Sun, 02 Feb 2003 03:00:00 GMT   
 
   [ 3 post ] 

Similar Threads

1. IBM techexplorer Hypermedia Browser Version 2.5: Windows 95/98/NT, Linux, AIX, Sun, IRIX

2. IBM techexplorer Hypermedia Browser Version 2.5: Windows 95/98/NT, Linux, AIX, Sun, IRIX

3. Introductory Edition IBM techexplorer Version 2.5 PR2 : Windows 95/98/NT, Linux, AIX, Solaris and SGI

4. IBM techexplorer Hypermedia Browser Version 2.5: Windows 95/98/NT, Linux, AIX, Sun, IRIX

5. IBM techexplorer Version 3.0 Preview Release 1: Windows 95/98/NT, Macintosh, Linux, AIX, Solaris, SGI

6. IBM techexplorer Hypermedia Browser Version 2.5: Windows 95/98/NT, Linux, AIX, Sun, IRIX

7. Introductory Edition IBM techexplorer Version 2.5 PR2 : Windows 95/98/NT, Linux, AIX, Solaris and SGI

8. AIX version of 'proctool'

9. What's my Version of AIX?

10. NT NT NT NT NT NT NT MT


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software