2

Does Android support signal handling i.e Signal.handle( ... ) type? Can you suggest some link which explains how to do so?

frogatto
  • 28,539
  • 11
  • 83
  • 129
Shikhar Shrivastav
  • 725
  • 2
  • 11
  • 21
  • What do you mean by Signal? Can you be a little more specific? – Benito Bertoli Mar 17 '14 at 15:19
  • Signals like SIGSEGV, SIGQUIT etc – Shikhar Shrivastav Mar 17 '14 at 15:22
  • possible duplicate of [Handling unix signals in Android](http://stackoverflow.com/questions/10224088/handling-unix-signals-in-android) – Benito Bertoli Mar 17 '14 at 15:33
  • I am new to signal handling. That question talks about a Java application talking to C++ application, however my requirement is to listen for signals related to my app 's process. Like in JVM you can listen to signals related to process, I want to do something on that lines on Android for my app. – Shikhar Shrivastav Mar 17 '14 at 15:46
  • apparently it isn't possible. – Benito Bertoli Mar 17 '14 at 15:53
  • @BenitoBertoli - the answer you cite is one provided by the poster of that question, who mistakes something they found about JVM based runtimes as something that would apply to Android, apparently ignoring the fact that Android does not actually run a JVM, and even then mistaking what is possible in Java generically for what is possible from Java when the target platform details are known. It almost certainly **is possible**, at least with use of the NDK, as the process only needs to use operating system APIs to change *itself*. – Chris Stratton Mar 17 '14 at 16:28
  • See for example http://stackoverflow.com/questions/1083154/how-can-i-catch-sigsegv-segmentation-fault-and-get-a-stack-trace-under-jni-on – Chris Stratton Mar 17 '14 at 16:33
  • @ChrisStratton Good point. In my defence, I did say "apparently". So I guess we should still close the question as a duplicate of [How can I catch SIGSEGV (segmentation fault) and get a stack trace under JNI on Android](http://stackoverflow.com/questions/1083154/how-can-i-catch-sigsegv-segmentation-fault-and-get-a-stack-trace-under-jni-on) – Benito Bertoli Mar 17 '14 at 17:25
  • @BenitoBertoli - no, because that has a substantially different and fairly specific goal. But it illustrative of the mechanism which could be developed in a different direction to meet this goal. – Chris Stratton Mar 17 '14 at 17:45
  • [GNU libsigsegv](https://www.gnu.org/software/libsigsegv/) - a library for handling page faults in user mode. – RonTLV Aug 26 '17 at 06:07

0 Answers0