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 8514639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:55:31+00:00 2026-06-11T04:55:31+00:00

The following code calls an except script which copies an file via ftp to

  • 0

The following code calls an except script which copies an file via ftp to a server.

int status;
int child_pnr;  

if((child_pnr = fork())==0)
{
    printf("Childnr %i\n",child_pnr);
    execv("/home/..../ftptest.exp",NULL);

}
else if (child_pnr > 0)
{
    printf("Parent... childnr %i generated\n",child_pnr);
    sleep(7);
}
else
    perror("fork() error");

As execv() will terminate after execution I spawned a childprocess for this function. Why is the ftptest.exp interupted from parent if I don’t have the sleep(7)….

  • 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-06-11T04:55:33+00:00Added an answer on June 11, 2026 at 4:55 am

    By “interrupted”, I presume you mean that the parent does not wait for the child to complete the operation before doing whatever it does next?

    The parent and the child will run in parallel after the fork. If you want the parent to “hang” until the child is done then you need to wait for it.

    See man wait and search for fork examples on the internet.

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

Sidebar

Related Questions

For some reason, the following code never calls Event::Event(Event&& e) Event a; Event b;
I'd like to condence the following code into fewer calls to .replace() . It
I have the following code for writing draw calls to a back buffer canvas,
I'm using he following code the call a CFC which returns auto-suggest results through
I am using the following code to call a batch file: dim shell set
I have come up with the following code to call a webservice using client/server
The Messagebox code in c# i've used is the following code,which is call conditionally
I understand everything that is happening in the following code except for the while
Following script runs great: $ python myscript.py When I try to profile my code
I have the following code: $(document).ajaxComplete(function () { tips(); }); Which runs the tips

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.