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

Side by Side Diff: pkg/os/lib/src/system_posix.dart

Issue 2203023002: Make arch-specific constants dependent on sys.info().machine (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: Minor modifications. Created 4 years, 4 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 | « pkg/os/lib/src/system_linux.dart ('k') | no next file » | 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) 2014, the Dartino project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dartino 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 part of os; 5 part of os;
6 6
7 const int F_GETFD = 1; 7 const int F_GETFD = 1;
8 const int F_SETFD = 2; 8 const int F_SETFD = 2;
9 const int F_GETFL = 3; 9 const int F_GETFL = 3;
10 const int F_SETFL = 4; 10 const int F_SETFL = 4;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 ForeignLibrary.main.lookup("unlink"); 52 ForeignLibrary.main.lookup("unlink");
53 static final ForeignFunction _write = 53 static final ForeignFunction _write =
54 ForeignLibrary.main.lookup("write"); 54 ForeignLibrary.main.lookup("write");
55 static final ForeignFunction _sendto = 55 static final ForeignFunction _sendto =
56 ForeignLibrary.main.lookup("sendto"); 56 ForeignLibrary.main.lookup("sendto");
57 static final ForeignFunction _recvfrom = 57 static final ForeignFunction _recvfrom =
58 ForeignLibrary.main.lookup("recvfrom"); 58 ForeignLibrary.main.lookup("recvfrom");
59 static final ForeignFunction _uname = 59 static final ForeignFunction _uname =
60 ForeignLibrary.main.lookup("uname"); 60 ForeignLibrary.main.lookup("uname");
61 61
62 static final bool isMips = sys.info().machine == 'mips';
63
62 int get AF_INET => 2; 64 int get AF_INET => 2;
63 int get AF_INET6; 65 int get AF_INET6;
64 66
65 int get SOCK_STREAM => 1; 67 int get SOCK_STREAM => isMips ? 2 : 1;
66 int get SOCK_DGRAM => 2; 68 int get SOCK_DGRAM => isMips ? 1 : 2;
67 69
68 int get O_RDONLY => 0; 70 int get O_RDONLY => 0;
69 int get O_WRONLY => 1; 71 int get O_WRONLY => 1;
70 int get O_RDWR => 2; 72 int get O_RDWR => 2;
71 int get O_CREAT; 73 int get O_CREAT;
72 int get O_TRUNC; 74 int get O_TRUNC;
73 int get O_APPEND; 75 int get O_APPEND;
74 int get O_CLOEXEC; 76 int get O_CLOEXEC;
75 int get O_NONBLOCK; 77 int get O_NONBLOCK;
76 78
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 address += UTSNAME_LENGTH; 393 address += UTSNAME_LENGTH;
392 fp = new ForeignPointer(address); 394 fp = new ForeignPointer(address);
393 var machine = cStringToString(fp); 395 var machine = cStringToString(fp);
394 return new SystemInformation(operatingSystemName, nodeName, release, 396 return new SystemInformation(operatingSystemName, nodeName, release,
395 version, machine); 397 version, machine);
396 } finally { 398 } finally {
397 utsname.free(); 399 utsname.free();
398 } 400 }
399 } 401 }
400 } 402 }
OLDNEW
« no previous file with comments | « pkg/os/lib/src/system_linux.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698