[Lldb-commits] [lldb] r261631 - [linux] Remove all traces of signalfd(2)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 23 04:26:08 PST 2016


Author: labath
Date: Tue Feb 23 06:26:08 2016
New Revision: 261631

URL: http://llvm.org/viewvc/llvm-project?rev=261631&view=rev
Log:
[linux] Remove all traces of signalfd(2)

Summary:
Signalfd is not used in the code anymore, and given that the same functionality can be achieved
with the new MainLoop class, it's unlikely we will need it in the future. Remove all traces of
it.

Reviewers: tberghammer, ovyalov

Subscribers: tberghammer, danalbert, srhines, lldb-commits

Differential Revision: http://reviews.llvm.org/D17510

Removed:
    lldb/trunk/include/lldb/Host/linux/Signalfd.h
Modified:
    lldb/trunk/source/Host/android/LibcGlue.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
    lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp

Removed: lldb/trunk/include/lldb/Host/linux/Signalfd.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/linux/Signalfd.h?rev=261630&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Host/linux/Signalfd.h (original)
+++ lldb/trunk/include/lldb/Host/linux/Signalfd.h (removed)
@@ -1,54 +0,0 @@
-//===-- Signalfd.h ----------------------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// This file defines signalfd functions & structures
-
-#ifndef liblldb_Host_linux_Signalfd_h_
-#define liblldb_Host_linux_Signalfd_h_
-
-#ifdef __ANDROID_NDK__
-#include <android/api-level.h>
-#endif
-
-#if defined(__ANDROID_API__) && __ANDROID_API__ < 21
-
-#include <linux/types.h>
-#include <linux/fcntl.h>
-
-#define SFD_CLOEXEC O_CLOEXEC
-#define SFD_NONBLOCK O_NONBLOCK
-
-struct signalfd_siginfo {
-    __u32 ssi_signo;
-    __s32 ssi_errno;
-    __s32 ssi_code;
-    __u32 ssi_pid;
-    __u32 ssi_uid;
-    __s32 ssi_fd;
-    __u32 ssi_tid;
-    __u32 ssi_band;
-    __u32 ssi_overrun;
-    __u32 ssi_trapno;
-    __s32 ssi_status;
-    __s32 ssi_int;
-    __u64 ssi_ptr;
-    __u64 ssi_utime;
-    __u64 ssi_stime;
-    __u64 ssi_addr;
-    __u16 ssi_addr_lsb;
-    __u8 __pad[46];
-};
-
-int signalfd (int fd, const sigset_t *mask, int flags);
-
-#else
-#include <sys/signalfd.h>
-#endif
-
-#endif // liblldb_Host_linux_Signalfd_h_

Modified: lldb/trunk/source/Host/android/LibcGlue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/android/LibcGlue.cpp?rev=261631&r1=261630&r2=261631&view=diff
==============================================================================
--- lldb/trunk/source/Host/android/LibcGlue.cpp (original)
+++ lldb/trunk/source/Host/android/LibcGlue.cpp Tue Feb 23 06:26:08 2016
@@ -27,11 +27,6 @@ time_t timegm(struct tm* t)
     return (time_t) timegm64(t);
 }
 
-int signalfd (int fd, const sigset_t *mask, int flags)
-{
-    return syscall(__NR_signalfd4, fd, mask, _NSIG / 8, flags);
-}
-
 int posix_openpt(int flags)
 {
     return open("/dev/ptmx", flags);

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=261631&r1=261630&r2=261631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Tue Feb 23 06:26:08 2016
@@ -58,7 +58,6 @@
 
 #include "lldb/Host/linux/Personality.h"
 #include "lldb/Host/linux/Ptrace.h"
-#include "lldb/Host/linux/Signalfd.h"
 #include "lldb/Host/linux/Uio.h"
 #include "lldb/Host/android/Android.h"
 

Modified: lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp?rev=261631&r1=261630&r2=261631&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp (original)
+++ lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp Tue Feb 23 06:26:08 2016
@@ -414,13 +414,6 @@ main_gdbserver (int argc, char *argv[])
     signal (SIGPIPE, signal_handler);
     MainLoop::SignalHandleUP sighup_handle = mainloop.RegisterSignal(SIGHUP, sighup_handler, error);
 #endif
-#ifdef __linux__
-    // Block delivery of SIGCHLD on linux. NativeProcessLinux will read it using signalfd.
-    sigset_t set;
-    sigemptyset(&set);
-    sigaddset(&set, SIGCHLD);
-    pthread_sigmask(SIG_BLOCK, &set, NULL);
-#endif
 
     const char *progname = argv[0];
     const char *subcommand = argv[1];




More information about the lldb-commits mailing list