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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:07:16+00:00 2026-06-09T17:07:16+00:00

I have received a Unix tool that I want to run / compile under

  • 0

I have received a Unix tool that I want to run / compile under Windows. After looking at it, I see it uses fork and execv among others. I now want to understand what it does and how I can realize this in Windows.

The code does more than asked here so please don’t comment on whether this code makes sense.

pid = fork();
if(pid==0){
    execv("/usr/bin/java",args);
}

If I interpret this correctly, this one only does something like calling java with the arguments provided in the args array. So in Windows this could easily be realized by something like system() or CreateProcess (I did not read on how to do it, just know it can be done).

But here is my question: If I understand it correctly this code forks and calls execv because execv does not return and my program would not finish without forking it first. Is this correct?

  • 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-09T17:07:18+00:00Added an answer on June 9, 2026 at 5:07 pm

    execv does not return and my program would not
    finish without forking it first. Is this correct?

    Actually your program would turn itself into the exec’d program. I.e. after the exec the new program would start executing, but the process would be the same: same PID, same few inherited properties etc.

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

Sidebar

Related Questions

I have received this error after updating to Windows 7 64-bit and then running
I have to write simple client-server application that uses Unix datagram socket. Client may
I have received a CSV that has been converted/compressed/compacted into a SAV file from
We have received some JavaScript from an agency that looks wrong, but works. For
I have received requirements that ask to normalize text box content when the user
Update: Based on a couple of the answers I have received, I just want
I have an app that received JSON data from the server. Currently when I
I am looking for a Java tool/package/library that will allow me to force-kill a
I have received comments from blind users that some of my sound and music
Unix/C question here. I have multiple sockets that I am trying to poll for

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.