HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Open file with O_EXCL parameter on NFS
Operating System - HP-UX
1827279
Members
2593
Online
109717
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2009 05:41 AM
09-21-2009 05:41 AM
Open file with O_EXCL parameter on NFS
Hi
While trying to figure out while Oracle 10g fails to create a data file on a NFS share, I used tusc and found that creates a file by calling:
open("nfsFile.dat", O_RDWR|O_CREAT|O_EXCL|0x800|O_SYNC, 0660);
Next, it closed the file and the second call to open the file: open(nfsFile.dat, O_RDONLY|0x800, 011655) - failed.
I wrote a small program, and found that the source of the problem is the O_EXCL flag.
When used, the file is created with the wrong Group ID - and as a result, the second attempt to open the file fails.
The NFS client is HP-UX 11.23 - IA 64 and the NFS Server is Solaris 10.
Has anyone any idea how to overcome this issue?
Thanks!
Shay
While trying to figure out while Oracle 10g fails to create a data file on a NFS share, I used tusc and found that creates a file by calling:
open("nfsFile.dat", O_RDWR|O_CREAT|O_EXCL|0x800|O_SYNC, 0660);
Next, it closed the file and the second call to open the file: open(nfsFile.dat, O_RDONLY|0x800, 011655) - failed.
I wrote a small program, and found that the source of the problem is the O_EXCL flag.
When used, the file is created with the wrong Group ID - and as a result, the second attempt to open the file fails.
The NFS client is HP-UX 11.23 - IA 64 and the NFS Server is Solaris 10.
Has anyone any idea how to overcome this issue?
Thanks!
Shay
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2009 01:13 AM
09-24-2009 01:13 AM
Re: Open file with O_EXCL parameter on NFS
Hello Shay!
The flag O_EXCL is normally used together with O_CREAT to check for exclusiveness during file creation (see man open).
As for the problem with the wrong group id the answer could lie in the way the NFS share was mounted on the client. Take a look at the two possible semantics for group ids when files are created (your case):
man mount_nfs (grpid option)
If grpid is set on mount (BSD-semantics), you need to change the GID of the parent directory because this will be the GID of the new file created.
If grpid is NOT set (SYSV-semantics), check for the parent directory not being set-GID, and if so, change it to the GID you need since that will be the GID of the new file created.
Kind regards,
Kobylka
The flag O_EXCL is normally used together with O_CREAT to check for exclusiveness during file creation (see man open).
As for the problem with the wrong group id the answer could lie in the way the NFS share was mounted on the client. Take a look at the two possible semantics for group ids when files are created (your case):
man mount_nfs (grpid option)
If grpid is set on mount (BSD-semantics), you need to change the GID of the parent directory because this will be the GID of the new file created.
If grpid is NOT set (SYSV-semantics), check for the parent directory not being set-GID, and if so, change it to the GID you need since that will be the GID of the new file created.
Kind regards,
Kobylka
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP