Penguin

Differences between current version and previous revision of open(2).

Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History

Newer page: version 3 Last edited on Sunday, March 16, 2003 6:15:34 pm by PerryLorier
Older page: version 2 Last edited on Sunday, March 16, 2003 6:11:25 pm by PerryLorier Revert
@@ -15,10 +15,9 @@
 fcntl(2)). The file offset is set to the beginning of the file. 
  
 The parameter ''flags'' is one of __O_RDONLY__, __O_WRONLY__ or __O_RDWR__ which request opening the file read-only, write-only or read/write, respectively, bitwise-''or'''d with zero or more of the following: 
  
-;__O_CREAT__: If the file does not exist it will be created. The owner (user ID) of the file is set to the effective user ID of the process. The group ownership (group ID) is set either to the effective group ID of the process or to the group ID of the parent directory (depending on filesystem type and mount options, and the mode of the parent directory, see, e.g., the mount options ''bsdgroups'' and ''sysvgroups'' of the ext2 filesystem, as described in  
- mount(8)). 
+;__O_CREAT__: If the file does not exist it will be created. The owner (user ID) of the file is set to the effective user ID of the process. The group ownership (group ID) is set either to the effective group ID of the process or to the group ID of the parent directory (depending on filesystem type and mount options, and the mode of the parent directory, see, e.g., the mount options ''bsdgroups'' and ''sysvgroups'' of the ext2 filesystem, as described in mount(8)). 
  
 ;__O_EXCL__: When used with __O_CREAT__, if the file already exists it is an error and the __open__ will fail. In this context, a symbolic link exists, regardless of where its points to. __O_EXCL__ is broken on NFS file systems, programs which rely on it for performing locking tasks will contain a race condition. The solution for performing atomic file locking using a lockfile is to create a unique file on the same fs (e.g., incorporating hostname and pid), use link(2) to make a link to the lockfile. If __link()__ returns 0, the lock is successful. Otherwise, use stat(2) on the unique file to check if its link count has increased to 2, in which case the lock is also successful. 
  
 ;__O_NOCTTY__: If ''pathname'' refers to a terminal device -- see tty(4) -- it will not become the process's controlling terminal even if the process does not have one. 
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.