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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/jsfs/js_fs_node.cc

Issue 1269623004: [NaCl SDK] Remove support for bionic toolchain (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "nacl_io/jsfs/js_fs_node.h" 5 #include "nacl_io/jsfs/js_fs_node.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <limits.h> 10 #include <limits.h>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 Error JsFsNode::GetStat(struct stat* stat) { 64 Error JsFsNode::GetStat(struct stat* stat) {
65 AUTO_LOCK(node_lock_); 65 AUTO_LOCK(node_lock_);
66 66
67 ScopedVar response(ppapi_); 67 ScopedVar response(ppapi_);
68 if (!SendRequestAndWait(&response, "%s%d", "cmd", "fstat", "fildes", fd_)) { 68 if (!SendRequestAndWait(&response, "%s%d", "cmd", "fstat", "fildes", fd_)) {
69 LOG_ERROR("Failed to send request."); 69 LOG_ERROR("Failed to send request.");
70 return EINVAL; 70 return EINVAL;
71 } 71 }
72 72
73 // TODO(binji): find out the size of bionic stat fields. 73 #if defined(__native_client__)
74 #if defined(__native_client__) && !defined(__BIONIC__)
75 #if defined(__GLIBC__) 74 #if defined(__GLIBC__)
76 const char* format = "%d%lld%d%d%d%d%lld%lld%lld%lld%lld%lld%lld"; 75 const char* format = "%d%lld%d%d%d%d%lld%lld%lld%lld%lld%lld%lld";
77 #else 76 #else
78 const char* format = "%d%lld%d%d%d%d%lld%lld%d%d%lld%lld%lld"; 77 const char* format = "%d%lld%d%d%d%d%lld%lld%d%d%lld%lld%lld";
79 #endif 78 #endif
80 #else 79 #else
81 #define FIELD(x) \ 80 #define FIELD(x) \
82 if (sizeof(stat->x) == sizeof(int64_t)) \ 81 if (sizeof(stat->x) == sizeof(int64_t)) \
83 strcat(format, "%lld"); \ 82 strcat(format, "%lld"); \
84 else if (sizeof(stat->x) == sizeof(int16_t)) \ 83 else if (sizeof(stat->x) == sizeof(int16_t)) \
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 count = dirents_byte_len - dirents_offs; 364 count = dirents_byte_len - dirents_offs;
366 365
367 memcpy(pdir, reinterpret_cast<const char*>(dirents) + dirents_offs, count); 366 memcpy(pdir, reinterpret_cast<const char*>(dirents) + dirents_offs, count);
368 *out_bytes = count; 367 *out_bytes = count;
369 368
370 free(dirents); 369 free(dirents);
371 return 0; 370 return 0;
372 } 371 }
373 372
374 } // namespace nacl_io 373 } // namespace nacl_io
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698