<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic catch alarm in the java native method in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/catch-alarm-in-the-java-native-method/m-p/2779151#M720983</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have one java interface, the interface uses java native method to call C code. I try to use "alarm()" in the C program. The code is like :&lt;BR /&gt;     signal(SIGALRM,sig_alarm);&lt;BR /&gt;     alarm(3);&lt;BR /&gt;     call network connection;&lt;BR /&gt;     alarm(0);&lt;BR /&gt;But The program (java interface and C program) terminates after there is alarm signal.The operating system is 10.20 in my workstation.&lt;BR /&gt;&lt;BR /&gt;Would someone please tell me how to catch the alarm signal ?&lt;BR /&gt;&lt;BR /&gt;Thanks a lot!&lt;BR /&gt;&lt;BR /&gt;zhiyong&lt;BR /&gt;</description>
    <pubDate>Sat, 03 Aug 2002 18:35:22 GMT</pubDate>
    <dc:creator>szhiyong</dc:creator>
    <dc:date>2002-08-03T18:35:22Z</dc:date>
    <item>
      <title>catch alarm in the java native method</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/catch-alarm-in-the-java-native-method/m-p/2779151#M720983</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have one java interface, the interface uses java native method to call C code. I try to use "alarm()" in the C program. The code is like :&lt;BR /&gt;     signal(SIGALRM,sig_alarm);&lt;BR /&gt;     alarm(3);&lt;BR /&gt;     call network connection;&lt;BR /&gt;     alarm(0);&lt;BR /&gt;But The program (java interface and C program) terminates after there is alarm signal.The operating system is 10.20 in my workstation.&lt;BR /&gt;&lt;BR /&gt;Would someone please tell me how to catch the alarm signal ?&lt;BR /&gt;&lt;BR /&gt;Thanks a lot!&lt;BR /&gt;&lt;BR /&gt;zhiyong&lt;BR /&gt;</description>
      <pubDate>Sat, 03 Aug 2002 18:35:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/catch-alarm-in-the-java-native-method/m-p/2779151#M720983</guid>
      <dc:creator>szhiyong</dc:creator>
      <dc:date>2002-08-03T18:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: catch alarm in the java native method</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/catch-alarm-in-the-java-native-method/m-p/2779152#M720984</link>
      <description>Hi zhiyong &lt;BR /&gt;&lt;BR /&gt;It's not possible, java supports no signal model in the virtual machine. The JVM uses signals internally for its operation and so native methods should&lt;BR /&gt;generally avoid attempting to send signals or install handlers for signals.&lt;BR /&gt;&lt;BR /&gt;In a simple case such as catching a CNTL C and doing a cleanup, it is possible to launch Java from within a Perl script. The Perl script can catch the CNTL C and then signal the JVM by writing to a socket. The application needs to be written so that it is listening on that socket for the signal.&lt;BR /&gt;&lt;BR /&gt;If you have error when you use system handler &lt;BR /&gt;You can avoid this error and proceed with process use the following XX HotSpot runtime option:&lt;BR /&gt;&lt;BR /&gt;  -XX:+AllowUserSignalHandlers&lt;BR /&gt;&lt;BR /&gt;This JVM option instructs the JVM not to complain if the native code libraries&lt;BR /&gt;install signal handlers.&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Tue, 15 Oct 2002 13:33:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/catch-alarm-in-the-java-native-method/m-p/2779152#M720984</guid>
      <dc:creator>lassehab</dc:creator>
      <dc:date>2002-10-15T13:33:05Z</dc:date>
    </item>
  </channel>
</rss>

