Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4332676
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:17:23+00:00 2026-05-21T10:17:23+00:00

We are using C in Linux. Is there any possibility that system() function can

  • 0

We are using C in Linux. Is there any possibility that system() function can behave in an unexpected manner, especially when we handle signals?

We found that sometimes, the system() function blocks the execution or it throws SIGSEGV.

e.g:

system ( "/bin/mv a b" );

Are there any known flaws in using system() that would explain this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:17:23+00:00Added an answer on May 21, 2026 at 10:17 am

    The system() function does what it is supposed to do perfectly well. The behaviour is pretty reliable as long as it is invoked correctly. It has two modes of operation:

    1. Check whether there is a command interpreter available – when the argument is a null pointer.
    2. Run the command given, waiting for the command to complete before returning.

    So, the system() statement blocks until the shell that runs the command completes. On Unix-like systems, the command invoked is effectively:

    "sh", "-c", "...argument to system...", NULL
    

    This means that the string passed is interpreted by the shell. How long that takes depends on the command that is executed. You can consider using the shell notations to run the command in background if you need to:

    system("( /bin/mv a b & )");
    

    There are few circumstances where system() will itself generate SIGSEGV. You would have to pass it an invalid pointer, a pointer to somewhere invalid in the program.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The title says all I want to know. Is there any function or I
Are there any options available to do offline surveys and questionnaires. Something in the
I am using C language and Linux OS as my programming platform. And I
I'm using J9 VM to run my application on a Linux machine (BusyBox). When
I'm using xming 6.9.0.31 on Windows XP computer to connect to Linux server and
At present we are using Fedora Core 3 for a system we are working
I've got an application which was written in C# and is running on Windows
I'm working on a Firefox NPAPI plugin + XPCOM component. I've run into a
I am currently working on my own little project, but I have a little
I have this Python based service daemon which is doing a lot of multiplexed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.