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

Side by Side Diff: runtime/bin/socket_macos.cc

Issue 61633003: Fix large-file support for mac os x. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « runtime/bin/file_macos.cc ('k') | runtime/platform/globals.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_MACOS) 6 #if defined(TARGET_OS_MACOS)
7 7
8 #include <errno.h> // NOLINT 8 #include <errno.h> // NOLINT
9 #include <stdio.h> // NOLINT 9 #include <stdio.h> // NOLINT
10 #include <stdlib.h> // NOLINT 10 #include <stdlib.h> // NOLINT
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 getsockopt(fd, 161 getsockopt(fd,
162 SOL_SOCKET, 162 SOL_SOCKET,
163 SO_ERROR, 163 SO_ERROR,
164 &errno, 164 &errno,
165 reinterpret_cast<socklen_t*>(&len)); 165 reinterpret_cast<socklen_t*>(&len));
166 os_error->SetCodeAndMessage(OSError::kSystem, errno); 166 os_error->SetCodeAndMessage(OSError::kSystem, errno);
167 } 167 }
168 168
169 169
170 int Socket::GetType(intptr_t fd) { 170 int Socket::GetType(intptr_t fd) {
171 struct stat64 buf; 171 struct stat buf;
172 int result = fstat64(fd, &buf); 172 int result = fstat(fd, &buf);
173 if (result == -1) return -1; 173 if (result == -1) return -1;
174 if (S_ISCHR(buf.st_mode)) return File::kTerminal; 174 if (S_ISCHR(buf.st_mode)) return File::kTerminal;
175 if (S_ISFIFO(buf.st_mode)) return File::kPipe; 175 if (S_ISFIFO(buf.st_mode)) return File::kPipe;
176 if (S_ISREG(buf.st_mode)) return File::kFile; 176 if (S_ISREG(buf.st_mode)) return File::kFile;
177 return File::kOther; 177 return File::kOther;
178 } 178 }
179 179
180 180
181 intptr_t Socket::GetStdioHandle(intptr_t num) { 181 intptr_t Socket::GetStdioHandle(intptr_t num) {
182 Socket::SetNonBlocking(num); 182 Socket::SetNonBlocking(num);
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 IPPROTO_TCP, 394 IPPROTO_TCP,
395 TCP_NODELAY, 395 TCP_NODELAY,
396 reinterpret_cast<char *>(&on), 396 reinterpret_cast<char *>(&on),
397 sizeof(on))) == 0; 397 sizeof(on))) == 0;
398 } 398 }
399 399
400 } // namespace bin 400 } // namespace bin
401 } // namespace dart 401 } // namespace dart
402 402
403 #endif // defined(TARGET_OS_MACOS) 403 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « runtime/bin/file_macos.cc ('k') | runtime/platform/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698