Opens a file or stream for shared access.
#include <fcntl.h> int sopen ( const char *path, int oflag, int shflag, ...);
(IN) Points to the path and name of the file to open.
(IN) Specifies the open access mode. See File Control Open Modes.
(IN) Specifies the share mode for the file and uses one of the following:
(IN) Specifies an optional mode argument when the O_CREAT flag is specified in oflag. See File Access Modes and NetWare Attributes.
If successful, returns a file descriptor, which is a non-negative integer. If an error occurs, returns -1 and sets errno to one of the following values:
The sopen function returns a file descriptor that refers to the file. The path parameter supplies the name of the file to open. The file is accessed according to the access mode specified by the oflag parameter.
If the O_CREAT flag is set in the oflag parameter, the shflag parameter is ignored and the fourth parameter is a mode parameter of type mode_t. For the flags to use with this parameter, see File Access Modes and NetWare Attributes.
You pass the returned file descriptor to other POSIX functions to perform operations on the file, such as reading and writing.