Changeset d948095 in mainline for uspace/lib/posix/source/fcntl.c
- Timestamp:
- 2012-10-05T08:04:52Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b60faf7
- Parents:
- be1dcc26 (diff), 32b3a12 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/source/fcntl.c
rbe1dcc26 rd948095 36 36 37 37 #include "internal/common.h" 38 #include " fcntl.h"38 #include "posix/fcntl.h" 39 39 40 40 #include "libc/unistd.h" 41 41 #include "libc/vfs/vfs.h" 42 #include " errno.h"42 #include "posix/errno.h" 43 43 44 44 /** … … 95 95 } 96 96 97 /** 98 * Open, possibly create, a file. 99 * 100 * @param pathname Path to the file. 101 * @param flags Access mode flags. 102 */ 103 int posix_open(const char *pathname, int flags, ...) 104 { 105 mode_t mode = 0; 106 if ((flags & O_CREAT) > 0) { 107 va_list args; 108 va_start(args, flags); 109 mode = va_arg(args, mode_t); 110 va_end(args); 111 } 112 113 int rc = open(pathname, flags, mode); 114 if (rc < 0) { 115 errno = -rc; 116 rc = -1; 117 } 118 119 return rc; 120 } 121 97 122 /** @} 98 123 */
Note:
See TracChangeset
for help on using the changeset viewer.