Re: system command returning unknown error.
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com The man page on 10.4.6 reads as follows: NAME system -- pass a command to the shell LIBRARY Standard C Library (libc, -lc) SYNOPSIS #include <stdlib.h> int system(const char *string); SEE ALSO sh(1), execve(2), fork(2), waitpid(2), popen(3) John Francini On 14 Jun 2006, at 14:12, Matthew Jaffa wrote: Matt From: "Justin C. Walker" <justin@mac.com> To: "darwin-dev@lists.apple.com list" <darwin-dev@lists.apple.com> Subject: Re: system command returning unknown error. Date: Wed, 14 Jun 2006 10:38:46 -0700 On Jun 14, 2006, at 10:30 , matt jaffa wrote: Hi, Did you read the man page for the 'system()' call? Regards, Justin -- Justin C. Walker, Curmudgeon at Large Director Institute for the Enhancement of the Director's Income ----------- Nobody knows the trouble I've been ----------- _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/mtjaffa%40msn.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/francini%40mac.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Rather than having people say "Yes, I did, No, I didn't", let's cut the Gordian knot. SYSTEM(3) BSD Library Functions Manual SYSTEM(3) DESCRIPTION The system() function hands the argument string to the command inter- preter sh(1). The calling process waits for the shell to finish execut- ing the command, ignoring SIGINT and SIGQUIT, and blocking SIGCHLD. If string is a NULL pointer, system() will return non-zero if the command interpreter sh(1) is available, and zero if it is not. The system() function returns the exit status of the shell as returned by waitpid(2), or -1 if an error occurred when invoking fork(2) or waitpid(2). A return value of 127 means the execution of the shell failed. STANDARDS The system() function conforms to ISO/IEC 9899:1990 (``ISO C90'') and is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible. BSD June 4, 1993 BSD Given this, your error of 32256 is being generated by the shell -- meaning the command you ran exited with that status. It might be more helpful if you can give a concise example of the specific code that is failing. Yes I read the man page, and it says -1 if not successful, 0 if successful, and returns non-zero if the command you pass in is NULL, but I know I didn't pass in null cause I log it right before I execute the command. I am calling system(char* command) in my .cpp file. But this is returning error 32256. This error no. is not documented so I don't know why it is not working. Anyone seen this error number before and know what it means. This email sent to mtjaffa@msn.com This email sent to francini@mac.com This email sent to site_archiver@lists.apple.com
participants (1)
-
John Francini