Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    System call does not seem to work

    I am working on arm-linux targetting strongarm processor. I am using multithreading programming. Whenever I use any system call ( for eg. system("ls -l /pos/bin"); ) in any of the threads I create the entire program hangs without the system call being executed. Any idea why this might be happening.

    Appreciate any input with regards to this.



  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    St. Petersburg, FL
    Well for one, doing system(ls anything) is very inefficient. I'd just use file descriptors instead, but htat's just my two cents.

  3. #3
    I don't think system(3) makes use of the PATH variable (but I could be wrong) so you need to full-path the program you want to run:
        system("/bin/ls /pos/bin");
    I agree with lakerdonald, however, that system(3) isn't very efficient.

  4. $spacer_open
  5. #4
    According to the manual system(string) is like calling /bin/sh -c string
    and that does use PATH so it must be something else.

  6. #5
    Oh yes, so it does. Sorry for the misinformation.

Posting Permissions

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