Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > the return value of a process

Reply
Thread Tools

the return value of a process

 
 
rakesh uv
Guest
Posts: n/a
 
      12-21-2007
hi,
is there any way to find the exact meaning of message given
by a Unix command
for example
mv: cannot access hello.c

similarly is there any way to find the meaning of the
error number or message displayed
by compilers

Rakesh UV
 
Reply With Quote
 
 
 
 
santosh
Guest
Posts: n/a
 
      12-21-2007
rakesh uv wrote:

> hi,
> is there any way to find the exact meaning of message given
> by a Unix command
> for example
> mv: cannot access hello.c


Ask in comp.unix.programmer.

>
> similarly is there any way to find the meaning of the
> error number or message displayed
> by compilers


See your compiler documentation.

 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      12-21-2007
In article <9216a305-2e5b-4457-a969->,
rakesh uv <> wrote:

> is there any way to find the exact meaning of message given
>by a Unix command


Not in general, no. Unix commands are just programs (or built-in
commands to a program), and programs are written by humans; there is only
as much documentation of the messages as they bother to write. Any
particular message is issued when some combination of conditions is
encountered, but *why* that combination of conditions was encountered
may be due to factors not expected by the programmer, possibly
because the programmer did not think things through, and possibly
because the *exact* cause of that combination of conditions might
not have been possible on any system that existed at the time the
program was written.

For example, the *exact* meaning of the message
"mv: cannot access hello.c" at a particular time might happen to
be, "Your three year old daughter decided to hide the broccoli she
didn't like inside your computer and that shorted the marginally
sub-standard accounting program dongle, which lead to stray bus
signals that interfered with the normal operation of the hard-drive
making the file temporarily inaccessible. Clean out the broccoli,
-and- the spider she put in your computer the week before, and everything
should be fine."
--
"I will speculate that [...] applications [...] could actually see a
performance boost for most users by going dual-core [...] because it
is running the adware and spyware that [...] are otherwise slowing
down the single CPU that user has today" -- Herb Sutter
 
Reply With Quote
 
SM Ryan
Guest
Posts: n/a
 
      12-21-2007
rakesh uv <> wrote:
# hi,
# is there any way to find the exact meaning of message given
# by a Unix command
# for example
# mv: cannot access hello.c
#
# similarly is there any way to find the meaning of the
# error number or message displayed
# by compilers

The operating system error messages are somewhat explained with the
command
man 2 intro

Compiler error messages have to looked up in the compiler documentation.

--
SM Ryan http://www.rawbw.com/~wyrmwif/
I have no respect for people with no shopping agenda.
 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      12-21-2007
SM Ryan wrote:

> rakesh uv <> wrote:
> # hi,
> # is there any way to find the exact meaning of message
> # given
> # by a Unix command
> # for example
> # mv: cannot access hello.c
> #
> # similarly is there any way to find the meaning of the
> # error number or message displayed
> # by compilers
>
> The operating system error messages are somewhat explained with the
> command
> man 2 intro


Hmm. On my machine it is man 3 errno.

 
Reply With Quote
 
Chris Dollin
Guest
Posts: n/a
 
      12-21-2007
rakesh uv wrote:

> hi,
> is there any way to find the exact meaning of message given
> by a Unix command
> for example
> mv: cannot access hello.c


Reading the code should do the trick.

> similarly is there any way to find the meaning of the error number
> or message displayed by compilers


A combination of common sense [1] and reading the documentation
works for me.

[1] Modern C compilers do better at useful error messages than
earlier ones [that I used], although gcc is surprisingly
reluctant to give supporting evidence for type mismatches:
telling me there's an argument type mismatch would be more
helpful if it would sogging /tell/ me what the desired and
actual types /were/.

--
Typed Hedgehog
"It took a very long time, much longer than the most generous estimates."
- James White, /Sector General/

 
Reply With Quote
 
Gordon Burditt
Guest
Posts: n/a
 
      12-22-2007
None of the following discussion has anything to do with "the return
value of a process".

> is there any way to find the exact meaning of message given
>by a Unix command
>for example
> mv: cannot access hello.c


If it's written in a human language, no. And some would dispute
that "exact meaning" can exist at all (and discussion of this
probably belongs in a philosophy newsgroup).

If you can re-write the program to give more information (the
attempted operation, the object it was attempted on, and the output
of perror() if it's relevant) you won't get exact meaning, but you
can get more details. Sometimes you don't have permission to *GET*
an exact answer.

Many functions are documented in manual pages including a list of
possible codes left in 'errno' and what they mean. Some of them
refer to other non-standard-C function (e.g. fopen() can fail for
any of the reasons that malloc() or open() can fail). Based on
what the command is supposed to do, you can sometimes guess what
function failed.

"cannot access" sounds like a permission problem or nonexistent file,
so check the permissions on "hello.c" and its parent directories,
and whether it exists. Then consider what kind of operation was
attempted on it.

> similarly is there any way to find the meaning of the
>error number or message displayed
>by compilers


Read the compiler manual? Read the compiler source? If it's not there,
it's probably not documented.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
the return value of a process rakesh uv C++ 1 12-21-2007 08:14 AM
what value does lack of return or empty "return;" return Greenhorn C Programming 15 03-06-2005 08:19 PM
How to get return value from a spawned process? Peter C++ 1 03-03-2004 01:27 AM
controlling external process' stdin/stdout AND getting its return value Ferenc Engard Ruby 2 02-17-2004 12:14 AM
webservice return value but continue some process raj ASP .Net Web Services 3 07-24-2003 06:21 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57