the return value of a process

R

rakesh uv

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
 
S

santosh

rakesh said:
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.
 
W

Walter Roberson

rakesh uv said:
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."
 
S

SM Ryan

# 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.
 
S

santosh

SM said:
# 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.
 
C

Chris Dollin

rakesh said:
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/.
 
G

Gordon Burditt

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,610
Members
45,255
Latest member
TopCryptoTwitterChannels

Latest Threads

Top