Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2005
    Location
    Maryland, USA
    Posts
    32

    sending Linux OS signals from c++ code


    Hi all!
    I'm an intermediate linux user (been using Debian Sarge since last year), but a programming novice in linux when it comes to interacting with the OS (the most I have ever done is sleep(x)!).
    I am writing a single threaded app that, upon completion, should signal the OS to shutdown. It will run with root permission so there should be no issue with accessing signals.
    Any advice on what to use to do this behavior?

    Thanks!

  2. #2
    How about system(shutdown) ?

  3. #3
    Linux User eugrus's Avatar
    Join Date
    Dec 2004
    Location
    Russia
    Posts
    391
    Code:
    #include <stdio.h>
    void main&#40;&#41; &#123; system&#40;"kill -s signal"&#41;; &#125;

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •