Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(546)

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/kernel_wrap_win.cc

Issue 565763002: Plumbing though mode parameter to open, since fusefs can make use of it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // The entire file is wrapped in this #if. We do this so this .cc file can be 5 // The entire file is wrapped in this #if. We do this so this .cc file can be
6 // compiled, even on a non-Windows build. 6 // compiled, even on a non-Windows build.
7 #if defined(WIN32) 7 #if defined(WIN32)
8 8
9 #include "nacl_io/kernel_wrap.h" 9 #include "nacl_io/kernel_wrap.h"
10 #include <errno.h> 10 #include <errno.h>
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 off_t _lseek(int fd, off_t offset, int whence) { 123 off_t _lseek(int fd, off_t offset, int whence) {
124 return ki_lseek(fd, offset, whence); 124 return ki_lseek(fd, offset, whence);
125 } 125 }
126 126
127 int _mkdir(const char* path) { 127 int _mkdir(const char* path) {
128 return ki_mkdir(path, 0777); 128 return ki_mkdir(path, 0777);
129 } 129 }
130 130
131 int _open(const char* path, int oflag, ...) { 131 int _open(const char* path, int oflag, ...) {
132 #if 0
133 // TODO(binji): ki_open should use the pmode parameter. When it does, this
134 // will be necessary to add in.
135 va_list list; 132 va_list list;
136 int pmode = 0; 133 int pmode = 0;
137 if (oflag & _O_CREAT) { 134 if (oflag & _O_CREAT) {
138 va_start(list, oflag); 135 va_start(list, oflag);
139 pmode = va_arg(list, int); 136 pmode = va_arg(list, int);
140 va_end(list); 137 va_end(list);
141 } 138 }
142 #endif 139 return ki_open(path, oflag, (mode_t) pmode);
143 return ki_open(path, oflag);
144 } 140 }
145 141
146 int _sopen(const char* path, int oflag, int shflag) { 142 int _sopen(const char* path, int oflag, int shflag) {
147 return ki_open(path, oflag); 143 return ki_open(path, oflag);
148 } 144 }
149 145
150 errno_t _sopen_s(int* pfh, const char* path, int oflag, int shflag, int pmode) { 146 errno_t _sopen_s(int* pfh, const char* path, int oflag, int shflag, int pmode) {
151 *pfh = ki_open(path, oflag); 147 *pfh = ki_open(path, oflag);
152 return (*pfh < 0) ? errno : 0; 148 return (*pfh < 0) ? errno : 0;
153 } 149 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 // Do nothing for Windows, we replace the library at link time. 225 // Do nothing for Windows, we replace the library at link time.
230 void kernel_wrap_init() { 226 void kernel_wrap_init() {
231 } 227 }
232 228
233 void kernel_wrap_uninit() { 229 void kernel_wrap_uninit() {
234 } 230 }
235 231
236 EXTERN_C_END 232 EXTERN_C_END
237 233
238 #endif // defined(WIN32) 234 #endif // defined(WIN32)
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/kernel_wrap_real.h ('k') | native_client_sdk/src/libraries/nacl_io/memfs/mem_fs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698