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

Unified Diff: pkg/os/lib/src/system_linux.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/os/lib/src/errno.dart ('k') | pkg/os/lib/src/system_posix.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/os/lib/src/system_linux.dart
diff --git a/pkg/os/lib/src/system_linux.dart b/pkg/os/lib/src/system_linux.dart
index ebd816a8080a6308f792e6d27c0f2f30059f8649..41bad0be8408c35298b3146e2d605eab78114e3c 100644
--- a/pkg/os/lib/src/system_linux.dart
+++ b/pkg/os/lib/src/system_linux.dart
@@ -10,19 +10,21 @@ class LinuxSystem extends PosixSystem {
static final ForeignFunction _openLinux =
ForeignLibrary.main.lookup("open64");
+ static final bool isMips = sys.info().machine == 'mips';
+
int get AF_INET6 => 10;
- int get O_CREAT => 64;
+ int get O_CREAT => isMips ? 256 : 64;
int get O_TRUNC => 512;
- int get O_APPEND => 1024;
- int get O_NONBLOCK => 2048;
+ int get O_APPEND => isMips ? 8 : 1024;
+ int get O_NONBLOCK => isMips ? 128 : 2048;
int get O_CLOEXEC => 524288;
- int get FIONREAD => 0x541B;
+ int get FIONREAD => isMips ? 0x467f : 0x541b;
- int get SOL_SOCKET => 1;
+ int get SOL_SOCKET => isMips ? 65535 : 1;
- int get SO_REUSEADDR => 2;
+ int get SO_REUSEADDR => isMips ? 4 : 2;
// The size of fields and the struct used by uname.
// From /usr/include/sys/utsname.h
« no previous file with comments | « pkg/os/lib/src/errno.dart ('k') | pkg/os/lib/src/system_posix.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698