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

  • SEARCH
  • Home
  • 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 6057267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:28:10+00:00 2026-05-23T08:28:10+00:00

I have my code running on the Mac and I am getting a 255

  • 0

I have my code running on the Mac and I am getting a 255 return code from exec.
The following is the code:

    ret = execvp(pArgs[0], pArgs);  

    if (ret < 0) 
{
        ret = errno;
        exit(ret);
        return false;
    }
else if (processId < 0) 
{
    // fork() failed    
    return false;
    } 
else if(Wait)
{
    // forked successfuly so wait for exit
    if(waitpid(processId, &childstatus, 0) == processId)
    {
        // codesign command terminted, get return code
        if(WIFEXITED(childstatus))
        {
            if(pCmdRetStatus != NULL)
                *pCmdRetStatus = WEXITSTATUS(childstatus);
        }

    }   
}

Any thoughts on why the 255? Essentially an hdiutil call, a lot of times, I get 255.

  • 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-23T08:28:10+00:00Added an answer on May 23, 2026 at 8:28 am

    UNIX (and therefore Mac OS X) exit statuses are forced into the range 0-255 unsigned.

    So a return value of -1 from your call to execvp would be processed as -1 in your C code but would become 255 at the operating-system level due to the rules of the exit() function specification. Consider the following example:

    bash> bash
    bash2> exit -1
    bash> echo $? # The exit status of the last command (bash2)
    255
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following the directions at this question , I have some code running to extract
I have the following code running on my Android device. It works great and
I am getting pretty frustrated, i have an tcp server running on my mac
I'm running some code on Mac OSX 10.6.6 and XCode 3.2.4 and I have
I have code similar to the following running in a script: try: s =
I have code running in an iPhone application I am developing. Basically, the code
Sorry I cannot post any source code... I have a code running a master/slave
I have two pieces of C++ code running on 2 different cores. Both of
So I'm running through a list of things and have code that creates an
I have some code which is been running by a backgroundworker I'd like some

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.