C Unix calling system() from multithreaded process

Discussion in 'C Programming' started by talisman, Nov 24, 2004.

  1. talisman

    talisman Guest

    hi,

    one of my friends was saying it's not a good idea to do this.

    certainly on my Solaris box man system makes a similar statement.

    could anyone elaborate in practicality how risky this is?

    i'm currently calling the system() function from within my 64 bit c
    app..

    i've had to do this because my program has to work with code for which
    there are only 32bit libraries - hence my system() call to the
    external 32 bit command.

    is there a better way of doing this?
     
    talisman, Nov 24, 2004
    #1
    1. Advertising

  2. talisman

    Jack Klein Guest

    On 23 Nov 2004 19:25:34 -0800, (talisman)
    wrote in comp.lang.c:

    > hi,
    >
    > one of my friends was saying it's not a good idea to do this.


    To do what? Some newsreaders do not display the subject line when
    displaying the message bodies. Always include your topic in the body
    as well.

    In any case, the C language does not support threads or processes, so
    there is no language issue involved here.

    > certainly on my Solaris box man system makes a similar statement.


    If your compiler documentation suggests that you should not do this,
    then you probably shouldn't. If you want to know why, contact Sun
    technical support or ask in a Solaris programming group. I seem to
    remember that there is one.

    > could anyone elaborate in practicality how risky this is?


    Not anyone here, no, it is off-topic.

    > i'm currently calling the system() function from within my 64 bit c
    > app..
    >
    > i've had to do this because my program has to work with code for which
    > there are only 32bit libraries - hence my system() call to the
    > external 32 bit command.


    There is no such thing as "64 bit C" or "32 bit libraries" in the C
    language. These are implementation details of your compiler and
    platform, not anything to do with the language.

    > is there a better way of doing this?


    Yes, consulting the sources I suggested above.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++
    http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
     
    Jack Klein, Nov 24, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    12
    Views:
    1,672
    Dave Thompson
    Jan 10, 2005
  2. Arthur Pemberton
    Replies:
    1
    Views:
    367
    Eriol
    May 29, 2006
  3. Replies:
    18
    Views:
    638
    Dave Thompson
    Jan 10, 2005
  4. Replies:
    3
    Views:
    325
    Martin Steen
    Sep 28, 2006
  5. Replies:
    14
    Views:
    253
    Martijn Lievaart
    Aug 15, 2009
Loading...

Share This Page