<?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 Re: Problems with SIGTERM and libBSD (HP-UX B.11.00 U 9000/800) in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/problems-with-sigterm-and-libbsd-hp-ux-b-11-00-u-9000-800/m-p/3993368#M95979</link>
    <description>&lt;BR /&gt;What is useful for the libBSD library? What is does change the standard behavior of sleep?&lt;BR /&gt;&lt;BR /&gt;If I don't use libcl the program runs fine. I don't understand why.&lt;BR /&gt;&lt;BR /&gt;Thanks for your replies.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Jose Luis</description>
    <pubDate>Fri, 04 May 2007 02:04:18 GMT</pubDate>
    <dc:creator>jose_lius_fdez_diaz_new</dc:creator>
    <dc:date>2007-05-04T02:04:18Z</dc:date>
    <item>
      <title>Problems with SIGTERM and libBSD (HP-UX B.11.00 U 9000/800)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problems-with-sigterm-and-libbsd-hp-ux-b-11-00-u-9000-800/m-p/3993365#M95976</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Given then program below (foo.C):&lt;BR /&gt;&lt;BR /&gt;#include &lt;SIGNAL.H&gt;&lt;BR /&gt;#include &lt;UNISTD.H&gt;&lt;BR /&gt;#include &lt;IOSTREAM.H&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;void sigterm_proc(int s) &lt;BR /&gt;{&lt;BR /&gt;        cout &amp;lt;&amp;lt; "sigterm_proc " &amp;lt;&amp;lt; s &amp;lt;&amp;lt; endl;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;        signal(SIGTERM, sigterm_proc);&lt;BR /&gt;&lt;BR /&gt;        sleep(60);&lt;BR /&gt;        cout &amp;lt;&amp;lt; "wake up" &amp;lt;&amp;lt; endl;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;When I compile it with "aCC -lcl  k2.c" and send a SIGTERM signal (kill pid) the output is:&lt;BR /&gt;&lt;BR /&gt;sigterm_proc 15&lt;BR /&gt;wake up&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But if I compile it with  "aCC -lcl -lBSD foo.C" the output is:&lt;BR /&gt;&lt;BR /&gt;sigterm_proc 15&lt;BR /&gt;&lt;BR /&gt;and the process doesn't wake up. Is there any bug is libBSD library?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;Jose Luis.&lt;/IOSTREAM.H&gt;&lt;/UNISTD.H&gt;&lt;/SIGNAL.H&gt;</description>
      <pubDate>Thu, 03 May 2007 12:00:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problems-with-sigterm-and-libbsd-hp-ux-b-11-00-u-9000-800/m-p/3993365#M95976</guid>
      <dc:creator>jose_lius_fdez_diaz_new</dc:creator>
      <dc:date>2007-05-03T12:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with SIGTERM and libBSD (HP-UX B.11.00 U 9000/800)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problems-with-sigterm-and-libbsd-hp-ux-b-11-00-u-9000-800/m-p/3993366#M95977</link>
      <description>I am going to assume that your two source files "k2.c" and "foo.C" are identical; if not, your question is meaningless.&lt;BR /&gt;&lt;BR /&gt;I suspect that your seconds example is not quite complete in that the program will terminate and print "wake up" after the sleep terminates.&lt;BR /&gt;&lt;BR /&gt;Without testing, I am assumming that the sleep() function behaves as documented in that any caught signal terminates the sleep as well as its normal SIGALRM behavior. When libBSD is linked in, the sleep function there does not terminate upon the receipt of a caught signal.&lt;BR /&gt;&lt;BR /&gt;You can verify this by using tusc to attach to the two versions but I am all but sure that it is the behavior of the sleep function that changes.</description>
      <pubDate>Thu, 03 May 2007 12:47:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problems-with-sigterm-and-libbsd-hp-ux-b-11-00-u-9000-800/m-p/3993366#M95977</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-05-03T12:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with SIGTERM and libBSD (HP-UX B.11.00 U 9000/800)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problems-with-sigterm-and-libbsd-hp-ux-b-11-00-u-9000-800/m-p/3993367#M95978</link>
      <description>Any reason you are adding -lcl to your link line?  This is added by default.</description>
      <pubDate>Thu, 03 May 2007 23:11:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problems-with-sigterm-and-libbsd-hp-ux-b-11-00-u-9000-800/m-p/3993367#M95978</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-05-03T23:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with SIGTERM and libBSD (HP-UX B.11.00 U 9000/800)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problems-with-sigterm-and-libbsd-hp-ux-b-11-00-u-9000-800/m-p/3993368#M95979</link>
      <description>&lt;BR /&gt;What is useful for the libBSD library? What is does change the standard behavior of sleep?&lt;BR /&gt;&lt;BR /&gt;If I don't use libcl the program runs fine. I don't understand why.&lt;BR /&gt;&lt;BR /&gt;Thanks for your replies.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Jose Luis</description>
      <pubDate>Fri, 04 May 2007 02:04:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problems-with-sigterm-and-libbsd-hp-ux-b-11-00-u-9000-800/m-p/3993368#M95979</guid>
      <dc:creator>jose_lius_fdez_diaz_new</dc:creator>
      <dc:date>2007-05-04T02:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with SIGTERM and libBSD (HP-UX B.11.00 U 9000/800)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problems-with-sigterm-and-libbsd-hp-ux-b-11-00-u-9000-800/m-p/3993369#M95980</link>
      <description>&amp;gt;What is useful for the libBSD library?&lt;BR /&gt;&lt;BR /&gt;I would assume you knew that since you must have some good reason for using it??  If not, junk it ASAP.  Looking at some man pages may mention using libBSD.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;If I don't use libcl the program runs fine. I don't understand why.&lt;BR /&gt;&lt;BR /&gt;I don't know either except you have libcl before AND after libBSD and that may cause libcl to use the foreign devil versions in libBSD instead of libc.</description>
      <pubDate>Sat, 05 May 2007 01:39:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problems-with-sigterm-and-libbsd-hp-ux-b-11-00-u-9000-800/m-p/3993369#M95980</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-05-05T01:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with SIGTERM and libBSD (HP-UX B.11.00 U 9000/800)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problems-with-sigterm-and-libbsd-hp-ux-b-11-00-u-9000-800/m-p/3993370#M95981</link>
      <description>Adding -lcl makes no difference, it is already there.&lt;BR /&gt;&lt;BR /&gt;tusc shows:&lt;BR /&gt;libBSD:&lt;BR /&gt;[5134] sigaction(SIGTERM, 0x7f7f0f08, 0x7f7f0f30) ........ = 0&lt;BR /&gt;[5134] sigprocmask(SIG_BLOCK, 0x7f7f0ed8, 0x7f7f0ef8) .... = 0&lt;BR /&gt;[5134] getitimer(ITIMER_REAL, 0x7f7f0f18) ................ = 0&lt;BR /&gt;[5134] time(NULL) ........................................ = 1178618346&lt;BR /&gt;[5134] sigtimedwait(0x7f7f0f28, NULL, 0x7f7f0f48) ........ [sleeping]&lt;BR /&gt;[5134]   Received signal 15, SIGTERM, in sigtimedwait(), [caught], no siginfo&lt;BR /&gt;[5134] sigtimedwait(0x7f7f0f28, NULL, 0x7f7f0f48) ........ ERR#4 EINTR&lt;BR /&gt;[5134]   Received signal 26, SIGCONT, in sigenable(), [SIG_DFL], no siginfo&lt;BR /&gt;[5134] write(1, "s i g t e r m _ p r o c   1 5 \n", 16) .. = 16&lt;BR /&gt;[5134] sigtimedwait(0x7f7f0f28, NULL, 0x7f7f0f48) ........ [sleeping]&lt;BR /&gt;&lt;BR /&gt;No libBSD:&lt;BR /&gt;[5253] sigprocmask(SIG_SETMASK, 0x7f7f0f60, 0x7f7f0f80) .. = 0&lt;BR /&gt;[5253] sigprocmask(SIG_SETMASK, 0x7f7f0f80, 0x7f7f0f60) .. = 0&lt;BR /&gt;[5253] sigsetreturn(0x7b036fbe, 0x6211988, 1392) ......... = 0&lt;BR /&gt;[5253] sigprocmask(SIG_SETMASK, 0x7f7f0f60, 0x7f7f0f80) .. = 0&lt;BR /&gt;[5253] sigprocmask(SIG_SETMASK, 0x7f7f0f80, 0x7f7f0f60) .. = 0&lt;BR /&gt;[5253] sigvec(SIGTERM, 0x7f7f0ec0, 0x7f7f0ed0) ........... = 0&lt;BR /&gt;[5253] sigprocmask(SIG_BLOCK, 0x7f7f0ed8, 0x7f7f0ef8) .... = 0&lt;BR /&gt;[5253] getitimer(ITIMER_REAL, 0x7f7f0f18) ................ = 0&lt;BR /&gt;[5253] time(NULL) ........................................ = 1178618480&lt;BR /&gt;[5253] sigtimedwait(0x7f7f0f28, NULL, 0x7f7f0f48) ........ [sleeping]&lt;BR /&gt;[5253]   Received signal 15, SIGTERM, in sigtimedwait(), [caught], no siginfo&lt;BR /&gt;[5253] sigtimedwait(0x7f7f0f28, NULL, 0x7f7f0f48) ........ ERR#4 EINTR&lt;BR /&gt;[5253]   Received signal 26, SIGCONT, in sigenable(), [SIG_DFL], no siginfo&lt;BR /&gt;[5253] write(1, "s i g t e r m _ p r o c   1 5 \n", 16) .. = 16&lt;BR /&gt;[5253] time(NULL) ........................................ = 1178618491&lt;BR /&gt;[5253] sigprocmask(SIG_SETMASK, 0x7f7f0ef8, NULL) ........ = 0&lt;BR /&gt;[5253] write(1, "w a k e   u p \n", 8) ................... = 8&lt;BR /&gt;[5253] exit(0) ........................................... WIFEXITED(0)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So libBSD probably changes signal(2) to sigaction(2) and sets SA_RESTART?</description>
      <pubDate>Tue, 08 May 2007 05:17:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problems-with-sigterm-and-libbsd-hp-ux-b-11-00-u-9000-800/m-p/3993370#M95981</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-05-08T05:17:39Z</dc:date>
    </item>
  </channel>
</rss>

