Changeset 4c53333 in mainline for uspace/lib/posix/source/fcntl.c
- Timestamp:
- 2013-07-11T08:21:10Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 64e63ce1
- Parents:
- 80445cf (diff), c8bb1633 (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
r80445cf r4c53333 34 34 35 35 #define LIBPOSIX_INTERNAL 36 #define __POSIX_DEF__(x) posix_##x 36 37 37 38 #include "internal/common.h" 38 #include " fcntl.h"39 #include "posix/fcntl.h" 39 40 40 41 #include "libc/unistd.h" 41 42 #include "libc/vfs/vfs.h" 42 #include " errno.h"43 #include "posix/errno.h" 43 44 44 45 /** … … 95 96 } 96 97 98 /** 99 * Open, possibly create, a file. 100 * 101 * @param pathname Path to the file. 102 * @param flags Access mode flags. 103 */ 104 int posix_open(const char *pathname, int flags, ...) 105 { 106 mode_t mode = 0; 107 if ((flags & O_CREAT) > 0) { 108 va_list args; 109 va_start(args, flags); 110 mode = va_arg(args, mode_t); 111 va_end(args); 112 } 113 114 int rc = open(pathname, flags, mode); 115 if (rc < 0) { 116 errno = -rc; 117 rc = -1; 118 } 119 120 return rc; 121 } 122 97 123 /** @} 98 124 */
Note:
See TracChangeset
for help on using the changeset viewer.