| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |