[PATCH] D39124: Add NetBSD improvements in sanitizers

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 23 07:54:15 PDT 2017


krytarowski added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:452
+#if SANITIZER_NETBSD
+  int res = internal_syscall_ptr(SYSCALL(nanosleep), &ts, &ts);
+#else
----------------
dvyukov wrote:
> krytarowski wrote:
> > dvyukov wrote:
> > > krytarowski wrote:
> > > > dvyukov wrote:
> > > > > nanosleep declared as returning int, why is this syscall_ptr?
> > > > `_ptr` here means that input arguments are pointers.
> > > I see.
> > > Is it possible to use syscall64 (__syscall) for all syscalls?
> > Not in a portable way across architectures.
> This just looks messy code-wise and additional maintenance burden (e.g. we change the !NETBSD case, but forgot to update the NETBSD case):
> 
> ```
> #if SANITIZER_NETBSD
>   return internal_syscall_ptr(SYSCALL(execve), (uptr)filename, (uptr)argv,
>                           (uptr)envp);
> #else
>   return internal_syscall(SYSCALL(execve), (uptr)filename, (uptr)argv,
>                           (uptr)envp);
> #endif
> ```
> 
> What do you think about introducing internal_syscall/syscall64/syscall_ptr for all OSes?
Agreed. I'm still testing local patches. Once verified I will upload them!


Repository:
  rL LLVM

https://reviews.llvm.org/D39124





More information about the llvm-commits mailing list