blob: aac20a5f2d69f4252b73293d72d2178e1f76780f [file] [log] [blame]
Peter Collingbourne9578a3e2013-05-08 14:43:49 +00001//===-- sanitizer_syscall_generic.inc ---------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// Generic implementations of internal_syscall and internal_iserror.
11//
12//===----------------------------------------------------------------------===//
13
14#define internal_syscall syscall
15
16bool internal_iserror(uptr retval, int *rverrno) {
17 if (retval == (uptr)-1) {
18 if (rverrno)
19 *rverrno = errno;
20 return true;
21 } else {
22 return false;
23 }
24}