Annotate memfd_create with __THROW

This change annotates memfd_create with __THROW, fixing a compilation
error when building crashpad in C++17 mode. This used to be a
consistency error with glibc >= 2.27, that always annotates memfd_create
with __THROW:
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/bits/mman-shared.h#l51

Fixed: crashpad:339
Change-Id: Iab99e864f49dcfd9e0b445fd59a22c16bbe2a60b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2643284
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Jan Wilken Dörrie 2021-01-22 12:33:14 +01:00 committed by Commit Bot
parent b858473d9c
commit 9e96201002
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@
extern "C" {
#endif
int memfd_create(const char* name, unsigned int flags);
int memfd_create(const char* name, unsigned int flags) __THROW;
#ifdef __cplusplus
} // extern "C"

View File

@ -24,7 +24,7 @@
extern "C" {
int memfd_create(const char* name, unsigned int flags) {
int memfd_create(const char* name, unsigned int flags) __THROW {
static const crashpad::NoCfiIcall<decltype(memfd_create)*> next_memfd_create(
dlsym(RTLD_NEXT, "memfd_create"));
return next_memfd_create ? next_memfd_create(name, flags)