[PATCH] [nolibc] Change internal syscall API to remove reliance on libc's errno.

Peter Collingbourne peter at pcc.me.uk
Wed May 8 03:52:23 PDT 2013



================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:68
@@ -67,1 +67,3 @@
 
+#ifdef __x86_64__
+
----------------
Kostya Serebryany wrote:
> I would prefer to have platform-specific syscall implementation in separate header files. 
> For now, let's have sanitizer_syscall_x86_64.h and sanitizer_syscall_generic.h
> 
> Then, the .cc file will have
> 
> #ifdef ARHC1
> #include sanitizer_syscall_ARHC1.h
> #elif defined ARHC2
> #include sanitizer_syscall_ARHC2.h
> #else 
> #include sanitizer_syscall_generic.h
> #endif
Done.

================
Comment at: lib/sanitizer_common/sanitizer_internal_defs.h:276
@@ -275,5 +275,3 @@
 
-#define HANDLE_EINTR(res, f) {                               \
-  do {                                                                  \
-    res = (f);                                                         \
-  } while (res == -1 && errno == EINTR); \
+#define HANDLE_EINTR(res, f) { \
+  int rverrno; \
----------------
Evgeniy Stepanov wrote:
> Please run this through clang-format, it knows where to put \ symbols better than any human.
Done.

================
Comment at: lib/sanitizer_common/sanitizer_posix.cc:83
@@ +82,3 @@
+  uptr res = internal_munmap(addr, size);
+  int reserrno;
+  if (internal_iserror(res, &reserrno)) {
----------------
Evgeniy Stepanov wrote:
> Unused variable.
Fixed.


http://llvm-reviews.chandlerc.com/D756



More information about the llvm-commits mailing list