Visible to Intel only — GUID: yuf1653012147152
Ixiasoft
Visible to Intel only — GUID: yuf1653012147152
Ixiasoft
13.1.1.71. open()
Prototype
int open (const char* pathname, int flags, mode_t mode)Commonly Called By
C/C++ programsThread-safe
See description.Available from ISR
No.Include
<unistd.h> <fcntl.h>Description
The open() function opens a file or device and returns a file descriptor (a small, nonnegative integer for use in read, write, etc.)flags is one of: O_RDONLY, O_WRONLY, or O_RDWR, which request opening the file in read-only, write-only, or read/write mode, respectively.
You can also bitwise-OR flags with O_NONBLOCK, which causes the file to be opened in nonblocking mode. Neither open() nor any subsequent operation on the returned file descriptor causes the calling function to wait.
Not all file systems/devices recognize this option.
mode specifies the permissions to use, if a new file is created. It is unused by current file systems, but is maintained for compatibility.
Calls to open() are thread-safe only if the implementation of open() provided by the driver that is manipulated is thread-safe.