call system() in linux return code = 2560 
Author Message
 call system() in linux return code = 2560

Dear experters,

I want to write the C program in Linux (glibc 2.2.4).  But when I call
system() function, the return code is "2560", what is the meaning of this
code?
Where can I find the meaning of the return error code in website?

Looking forward to your reply and suggestion.
Emerson Wu

cmdstr="/tmp/abc";
rc = system(cmdstr);

/* rc = 2560 */



Fri, 09 Sep 2005 21:59:22 GMT  
 call system() in linux return code = 2560

Quote:

> I want to write the C program in Linux (glibc 2.2.4).  But when I call
> system() function, the return code is "2560", what is the meaning of this
> code?

Read the glibc manual.
--
"When I have to rely on inadequacy, I prefer it to be my own."
--Richard Heathfield


Sat, 10 Sep 2005 01:57:07 GMT  
 call system() in linux return code = 2560

Quote:

> I want to write the C program in Linux (glibc 2.2.4).  But when I call
> system() function, the return code is "2560", what is the meaning of this
> code?
> Where can I find the meaning of the return error code in website?
> cmdstr="/tmp/abc";
> rc = system(cmdstr);
> /* rc = 2560 */

AFAIK in standard C the return value of system() is implementation-
depended unless you passed it a NULL pointer, thus you're wrong here
when you look for more system specific informations. But the people
over in comp.os.linux.development.apps will help you with these kinds
of questions for sure.
                                      Regards, Jens
<OT>
Under Linux system() returns the return value of the program you
invoked via system(). Have a look at the man page for wait() what
macros there are to pick the return value apart, WIFEXITED() and
WEXITSTATUS() might be what you're looking for (when I don't got
it wrong the return code means the program terminated normally,
returning with an exit status of 10, but what this means is
completely up to the program "tmp/abc" you invoked).
</OT>
--
      _  _____  _____

  _  | |  | |    | |
 | |_| |  | |    | |          http://www.physik.fu-berlin.de/~toerring
  \___/ens|_|homs|_|oerring


Sat, 10 Sep 2005 03:35:27 GMT  
 call system() in linux return code = 2560

Quote:

> Dear experters,

> I want to write the C program in Linux (glibc 2.2.4).  But when I call
> system() function, the return code is "2560", what is the meaning of this
> code?

System-defined. Check your documentation. comp.os.linux.development.apps
may be of help in this matter.

--
Freenet distribution (temporary): http://24.25.175.161:8891/5sd2n-2Kt6Y/
Beware of bugs in the above code; I have only proved it correct, not tried it.
                -- Donald Knuth



Sat, 10 Sep 2005 08:42:39 GMT  
 call system() in linux return code = 2560

Quote:
>I want to write the C program in Linux (glibc 2.2.4).  But when I call
>system() function, the return code is "2560", what is the meaning of this
>code?

On Unix systems, this means an exit code of 2560 / 256 = 10 of the
application that was executed via the system() call.

Quote:
>Where can I find the meaning of the return error code in website?

The meaning of 10 as an exit code of the program executed by system() can
be found (hopefully) in that program's documentation.

For more questions on this topic, please use comp.unix.programmer.
Your issue has nothing to do with comp.lang.c (with a trivial exception,
the C language doesn't specify what system() returns) and it is not
Linux-specific, either: all modern Unix systems behave the same WRT
system's return value.

Dan
--
Dan Pop
DESY Zeuthen, RZ group



Sat, 10 Sep 2005 20:28:20 GMT  
 call system() in linux return code = 2560
# Dear experters,
#
# I want to write the C program in Linux (glibc 2.2.4).  But when I call
# system() function, the return code is "2560", what is the meaning of this
# code?

Possibly exitted on uncaught signal 10, bus error.

--
Derk Gwen http://derkgwen.250free.com/html/index.html
No pleasure, no rapture, no exquiste sin greater than central air.



Sun, 11 Sep 2005 04:11:37 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. linux - mkdir() system call

2. system call in linux

3. Linux / Unix system call

4. Q: Return-values of system("...") calls

5. system call to return current line number

6. system call to return current line number

7. system call to return current line number

8. Help: C system call that returns list of all processes in Unix

9. API call to return a specific machines system clock

10. return codes from system()

11. Return Code on ExecuteSQL call

12. System calls from within C code

 

 
Powered by phpBB® Forum Software