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

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

Issue 19263003: Add FileSystemWatcher class to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix android socket. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/bin/socket_android.cc ('k') | runtime/bin/socket_macos.cc » ('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_LINUX) 6 #if defined(TARGET_OS_LINUX)
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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 struct stat buf; 185 struct stat buf;
186 int result = fstat(fd, &buf); 186 int result = fstat(fd, &buf);
187 if (result == -1) return -1; 187 if (result == -1) return -1;
188 if (S_ISCHR(buf.st_mode)) return File::kTerminal; 188 if (S_ISCHR(buf.st_mode)) return File::kTerminal;
189 if (S_ISFIFO(buf.st_mode)) return File::kPipe; 189 if (S_ISFIFO(buf.st_mode)) return File::kPipe;
190 if (S_ISREG(buf.st_mode)) return File::kFile; 190 if (S_ISREG(buf.st_mode)) return File::kFile;
191 return File::kOther; 191 return File::kOther;
192 } 192 }
193 193
194 194
195 intptr_t Socket::GetStdioHandle(int num) { 195 intptr_t Socket::GetStdioHandle(intptr_t num) {
196 return static_cast<intptr_t>(num); 196 return num;
197 } 197 }
198 198
199 199
200 AddressList<SocketAddress>* Socket::LookupAddress(const char* host, 200 AddressList<SocketAddress>* Socket::LookupAddress(const char* host,
201 int type, 201 int type,
202 OSError** os_error) { 202 OSError** os_error) {
203 // Perform a name lookup for a host name. 203 // Perform a name lookup for a host name.
204 struct addrinfo hints; 204 struct addrinfo hints;
205 memset(&hints, 0, sizeof(hints)); 205 memset(&hints, 0, sizeof(hints));
206 hints.ai_family = SocketAddress::FromType(type); 206 hints.ai_family = SocketAddress::FromType(type);
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 IPPROTO_TCP, 416 IPPROTO_TCP,
417 TCP_NODELAY, 417 TCP_NODELAY,
418 reinterpret_cast<char *>(&on), 418 reinterpret_cast<char *>(&on),
419 sizeof(on))) == 0; 419 sizeof(on))) == 0;
420 } 420 }
421 421
422 } // namespace bin 422 } // namespace bin
423 } // namespace dart 423 } // namespace dart
424 424
425 #endif // defined(TARGET_OS_LINUX) 425 #endif // defined(TARGET_OS_LINUX)
OLDNEW
« no previous file with comments | « runtime/bin/socket_android.cc ('k') | runtime/bin/socket_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698