Merge "Disable integer_overflow sanitizer in libm."
diff --git a/libc/include/sys/procfs.h b/libc/include/sys/procfs.h
index 7ef5023..eff39e2 100644
--- a/libc/include/sys/procfs.h
+++ b/libc/include/sys/procfs.h
@@ -49,6 +49,14 @@
 typedef pid_t lwpid_t;
 typedef void* psaddr_t;
 
+struct elf_siginfo {
+  int si_signo;
+  int si_code;
+  int si_errno;
+};
+
+#define ELF_PRARGSZ 80
+
 __END_DECLS
 
 #endif /* _SYS_PROCFS_H_ */
diff --git a/libc/include/sys/ttydefaults.h b/libc/include/sys/ttydefaults.h
index 62af84b..4dcc649 100644
--- a/libc/include/sys/ttydefaults.h
+++ b/libc/include/sys/ttydefaults.h
@@ -48,7 +48,7 @@
  * Defaults on "first" open.
  */
 #define	TTYDEF_IFLAG	(BRKINT | ICRNL | IMAXBEL | IXON | IXANY)
-#define TTYDEF_OFLAG	(OPOST | ONLCR | OXTABS)
+#define TTYDEF_OFLAG	(OPOST | ONLCR | XTABS)
 #define TTYDEF_LFLAG	(ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
 #define TTYDEF_CFLAG	(CREAD | CS8 | HUPCL)
 #define TTYDEF_SPEED	(B9600)
@@ -58,7 +58,7 @@
  */
 #define CTRL(x)	(x&037)
 #define	CEOF		CTRL('d')
-#define	CEOL		((unsigned char)'\377')	/* XXX avoid _POSIX_VDISABLE */
+#define	CEOL		'\0'	/* XXX avoid _POSIX_VDISABLE */
 #define	CERASE		0177
 #define	CINTR		CTRL('c')
 #define	CSTATUS		CTRL('t')
@@ -80,34 +80,4 @@
 #define CRPRNT		CREPRINT
 #define	CFLUSH		CDISCARD
 
-/* PROTECTED INCLUSION ENDS HERE */
 #endif /* !_SYS_TTYDEFAULTS_H_ */
-
-/*
- * #define TTYDEFCHARS to include an array of default control characters.
- */
-#ifdef TTYDEFCHARS
-const cc_t ttydefchars[NCCS] = {
-	[VEOF] = CEOF,
-	[VEOL] = CEOL,
-	[VEOL2] = CEOL,
-	[VERASE] = CERASE,
-	[VWERASE] = CWERASE,
-	[VKILL] = CKILL,
-	[VREPRINT] = CREPRINT,
-	[7] = _POSIX_VDISABLE,	/* spare */
-	[VINTR] = CINTR,
-	[VQUIT] = CQUIT,
-	[VSUSP] = CSUSP,
-	[VDSUSP] = CDSUSP,
-	[VSTART] = CSTART,
-	[VSTOP] = CSTOP,
-	[VLNEXT] = CLNEXT,
-	[VDISCARD] = CDISCARD,
-	[VMIN] = CMIN,
-	[VTIME] = CTIME,
-	[VSTATUS] = CSTATUS,
-	[19] = _POSIX_VDISABLE,	/* spare */
-};
-#undef TTYDEFCHARS
-#endif
diff --git a/libc/include/sys/user.h b/libc/include/sys/user.h
index f9ad956..ed3e10a 100644
--- a/libc/include/sys/user.h
+++ b/libc/include/sys/user.h
@@ -102,6 +102,10 @@
   int u_debugreg[8];
 };
 
+#define UPAGES 1
+#define HOST_TEXT_START_ADDR (u.start_code)
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * PAGE_SIZE)
+
 #elif defined(__x86_64__)
 
 struct user_fpregs_struct {
diff --git a/tests/Android.bp b/tests/Android.bp
index efb86b8..d4027b3 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -134,6 +134,7 @@
         "sys_sysmacros_test.cpp",
         "sys_time_test.cpp",
         "sys_timex_test.cpp",
+        "sys_ttydefaults_test.cpp",
         "sys_types_test.cpp",
         "sys_uio_test.cpp",
         "sys_vfs_test.cpp",
diff --git a/tests/sys_ttydefaults_test.cpp b/tests/sys_ttydefaults_test.cpp
new file mode 100644
index 0000000..fa4f7c7
--- /dev/null
+++ b/tests/sys_ttydefaults_test.cpp
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <gtest/gtest.h>
+
+#include <sys/ttydefaults.h>
+#include <termios.h>
+
+TEST(sys_ttydefaults, flags) {
+  int i;
+  i = TTYDEF_IFLAG;
+  i = TTYDEF_OFLAG;
+  i = TTYDEF_LFLAG;
+  i = TTYDEF_CFLAG;
+  i = TTYDEF_SPEED;
+}
+
+TEST(sys_ttydefaults, correct_CEOL) {
+  ASSERT_EQ(_POSIX_VDISABLE, CEOL);
+}