|
إنضمامك إلي منتديات استراحات زايد يحقق لك معرفة كل ماهو جديد في عالم الانترنت ...
انضم الينا
#1
| ||
| ||
Your objective is to write a C program sig.c that, when invoked, waits for input from the user and echoes it back line-by-line While echoing inputs, your program should also listen for several signals. Receipt of each signal should cause a different response from the program. First, your program should schedule a SIGALRM (alarm) every ten seconds, and react to this signal by counting up seconds, by printing something like the following: tick 0... tick 10... tick 20... as a running count. This will serve as a "heartbeat" to let you know that your program has not crashed. Second, the following signals should evoke behaviors as indicated: 1. SIGINT should print a summary of all time spent by the program (system and user) and then continue running the program. 2. SIGTERM should print a summary of all time spent in the program, and additionally exit the program 3. SI 4. GTSTP should print the last 10 lines of user input. Hints Some documentation pointers • man signal - how to set up a signal handler. • man sigvec - another way to set up a signal handler. • man sleep - how to use SIGALRM to sleep for a given number of seconds. ............................................ implement the above using only one signal handler routine to catch all kinds of signals. __DEFINE_LIKE_SHARE__ |
مواقع النشر (المفضلة) |
| |
المواضيع المتشابهه | ||||
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
[ استفسار ] : عندي سؤال بليز الي يعرف الجواب يرد علي | محروم.كوم | منتدى أخبار المواقع والمنتديات العربية والأجنبية | 0 | 08-21-2011 03:20 AM |
بليز فزعتكم اي احد يعرف لضبط الوسائط لفيفا | محروم.كوم | منتدى أخبار المواقع والمنتديات العربية والأجنبية | 0 | 06-19-2010 03:50 PM |
اللي يعرف ورشه حلوووووووووووووه بليز ,,,,,, | محروم.كوم | منتدى أخبار المواقع والمنتديات العربية والأجنبية | 0 | 01-05-2010 05:10 PM |
بليز ممكن الي يعرف في بلاك بيري يفيدني | القلب المحب | هواتف , مسجات , وسائط , برامج , ثيمات , نغمات , بلوتوث | 4 | 12-13-2009 02:57 AM |
بليز اللي يعرف | محروم.كوم | منتدى أخبار المواقع والمنتديات العربية والأجنبية | 0 | 05-25-2009 08:50 AM |