>From 0b1e174fa3acdde982a051ee0a030566ea8368cb Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 8 Jan 2017 19:19:23 -0600
Subject: [PATCH 4/4] Fix syscall wrappers on musl

musl defines p{read,write}64 to their non-suffixed equivalents to avoid
duplication in its syscall wrappers. This breaks macro expansion here,
leading to errors such as:

In function size_t sys_pread64(int, void*, size_t, off_t):
    error: '__NR_pread' was not declared in this scope

The fix here is to undefine the p{read,write}64 macros, so the syscall
expands to (e.g.) __NR_pread64 instead.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---
 .../google-breakpad/src/third_party/lss/linux_syscall_support.h    | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
--- a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
+++ b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
@@ -161,16 +161,23 @@ extern "C" {
 # undef __NR_pipe
 #endif
 
 #if defined(__ANDROID__)
 // waitpid is blocked by seccomp on all architectures on recent Android.
 # undef __NR_waitpid
 #endif
 
+#ifdef pread64
+#undef pread64
+#endif
+#ifdef pwrite64
+#undef pwrite64
+#endif
+
 /* As glibc often provides subtly incompatible data structures (and implicit
  * wrapper functions that convert them), we provide our own kernel data
  * structures for use by the system calls.
  * These structures have been developed by using Linux 2.6.23 headers for
  * reference. Note though, we do not care about exact API compatibility
  * with the kernel, and in fact the kernel often does not have a single
  * API that works across architectures. Instead, we try to mimic the glibc
  * API where reasonable, and only guarantee ABI compatibility with the
