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

Side by Side Diff: base/files/file_posix.cc

Issue 2807463004: GN: aix port along with linux_s390x, linux_ppc64 and linux_ppc64le support. (Closed)
Patch Set: removed the changes from //base/BUILD.gn Created 3 years, 8 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
« no previous file with comments | « base/files/file_path_watcher.cc ('k') | base/files/file_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "base/files/file.h" 5 #include "base/files/file.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 #else 38 #else
39 int CallFstat(int fd, stat_wrapper_t *sb) { 39 int CallFstat(int fd, stat_wrapper_t *sb) {
40 ThreadRestrictions::AssertIOAllowed(); 40 ThreadRestrictions::AssertIOAllowed();
41 return fstat64(fd, sb); 41 return fstat64(fd, sb);
42 } 42 }
43 #endif 43 #endif
44 44
45 // NaCl doesn't provide the following system calls, so either simulate them or 45 // NaCl doesn't provide the following system calls, so either simulate them or
46 // wrap them in order to minimize the number of #ifdef's in this file. 46 // wrap them in order to minimize the number of #ifdef's in this file.
47 #if !defined(OS_NACL) 47 #if !defined(OS_NACL) && !defined(OS_AIX)
48 bool IsOpenAppend(PlatformFile file) { 48 bool IsOpenAppend(PlatformFile file) {
49 return (fcntl(file, F_GETFL) & O_APPEND) != 0; 49 return (fcntl(file, F_GETFL) & O_APPEND) != 0;
50 } 50 }
51 51
52 int CallFtruncate(PlatformFile file, int64_t length) { 52 int CallFtruncate(PlatformFile file, int64_t length) {
53 return HANDLE_EINTR(ftruncate(file, length)); 53 return HANDLE_EINTR(ftruncate(file, length));
54 } 54 }
55 55
56 int CallFutimes(PlatformFile file, const struct timeval times[2]) { 56 int CallFutimes(PlatformFile file, const struct timeval times[2]) {
57 #ifdef __USE_XOPEN2K8 57 #ifdef __USE_XOPEN2K8
(...skipping 15 matching lines...) Expand all
73 File::Error CallFcntlFlock(PlatformFile file, bool do_lock) { 73 File::Error CallFcntlFlock(PlatformFile file, bool do_lock) {
74 struct flock lock; 74 struct flock lock;
75 lock.l_type = do_lock ? F_WRLCK : F_UNLCK; 75 lock.l_type = do_lock ? F_WRLCK : F_UNLCK;
76 lock.l_whence = SEEK_SET; 76 lock.l_whence = SEEK_SET;
77 lock.l_start = 0; 77 lock.l_start = 0;
78 lock.l_len = 0; // Lock entire file. 78 lock.l_len = 0; // Lock entire file.
79 if (HANDLE_EINTR(fcntl(file, F_SETLK, &lock)) == -1) 79 if (HANDLE_EINTR(fcntl(file, F_SETLK, &lock)) == -1)
80 return File::OSErrorToFileError(errno); 80 return File::OSErrorToFileError(errno);
81 return File::FILE_OK; 81 return File::FILE_OK;
82 } 82 }
83 #else // defined(OS_NACL) 83 #else // defined(OS_NACL) && !defined(OS_AIX)
84 84
85 bool IsOpenAppend(PlatformFile file) { 85 bool IsOpenAppend(PlatformFile file) {
86 // NaCl doesn't implement fcntl. Since NaCl's write conforms to the POSIX 86 // NaCl doesn't implement fcntl. Since NaCl's write conforms to the POSIX
87 // standard and always appends if the file is opened with O_APPEND, just 87 // standard and always appends if the file is opened with O_APPEND, just
88 // return false here. 88 // return false here.
89 return false; 89 return false;
90 } 90 }
91 91
92 int CallFtruncate(PlatformFile file, int64_t length) { 92 int CallFtruncate(PlatformFile file, int64_t length) {
93 NOTIMPLEMENTED(); // NaCl doesn't implement ftruncate. 93 NOTIMPLEMENTED(); // NaCl doesn't implement ftruncate.
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 return !HANDLE_EINTR(fsync(file_.get())); 525 return !HANDLE_EINTR(fsync(file_.get()));
526 #endif 526 #endif
527 } 527 }
528 528
529 void File::SetPlatformFile(PlatformFile file) { 529 void File::SetPlatformFile(PlatformFile file) {
530 DCHECK(!file_.is_valid()); 530 DCHECK(!file_.is_valid());
531 file_.reset(file); 531 file_.reset(file);
532 } 532 }
533 533
534 } // namespace base 534 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file_path_watcher.cc ('k') | base/files/file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698