How do I go about finding out what an errno code *means*. I know how
to get the name of the status code (e.g. S_objLib_OBJ_UNAVAILABLE),
but I don't know where to look for a description of what this means
and which system calls can generate it.
I have two specific instances:
1) When I dump the task info in the shell (using 'i'), I see a task
with its errno set to non-zero.
2) I make a system call and get an errno whose meaning isn't
immediately obvious to me (e.g. S_objLib_OBJ_UNAVAILABLE or
S_errno_EPERM).
Thanks,
Tad
Speaking only for myself,
Joe Durusau
I'm on an NT host, so there are no man pages (AFIK). There are online
documents (html), but they are identical to the printed documents.
The documentation I have looks like this:
------------------------------------------------------------
msgQSend( )
(snip)
ERRNO
S_distLib_NOT_INITIALIZED, S_objLib_OBJ_ID_ERROR,
S_objLib_OBJ_DELETED, S_objLib_OBJ_UNAVAILABLE,
S_objLib_OBJ_TIMEOUT, S_msgQLib_INVALID_MSG_LENGTH,
S_msgQLib_NON_ZERO_TIMEOUT_AT_INT_LEVEL
------------------------------------------------------------
Most of the names in the ERRNO section are reasonable obvious, but
how do I find out what S_objLib_OBJ_UNAVAILABLE means?
I understand your statement about checking the return value before
looking at errno, but I think that you've missed my point. I have a
task that is running with an errno of 0. After awhile, the errno
changes to S_errno_EPERM. I'd like to know what this errno means and
what caused it. I understand that it *may* be something that I don't
care about, but how do I go about convincing myself that this
situation is acceptable?
Thanks,
Tad
This value of errno may have been set by some call made internally by a
vxWorks library that knows how to deal with the error itself and thus be
of no consequence to you. Unless you have been given an error return by a
function called by your software then the errno value is irrelevent. Our
systems have many tasks running, and a fair proportion of them report a
non-zero errno even when nothing's wrong.
To convince yourself that there's nothing wrong, perhaps you could write a
little test macro that checks errno, prints a message whenever it's
non-zero and resets it to zero, and then call this after a representative
sample of *successful* vxWorks function calls inside your application -
that way you'll see when it changes.
- Andrew
--
Sharks kill 10 people each year. People kill 60,000,000 sharks each year.
Andrew Johnson <a...@aps.anl.gov> wrote in message
news:396F59F5...@aps.anl.gov...
Speaking only for myself,
Joe Durusau
taa...@sandia.gov wrote:
>
> Joe Durusau <dur...@delphi.com> writes:
> > You would have to look at the man pages for the lib in question,
> > or at the printed docs. Be advised that errno is without meaning unless a
> > function has returned an error to its caller. In other words, don't write
> > code that checks errno after a unctoin call unless the function has returned
> > in such a way as to make you believe that the function has failed.
> >
> > Speaking only for myself,
> >
> > Joe Durusau
>
> I'm on an NT host, so there are no man pages (AFIK). There are online
> documents (html), but they are identical to the printed documents.
> The documentation I have looks like this:
>
> ------------------------------------------------------------
> msgQSend( )
>
> (snip)
>
> ERRNO
> S_distLib_NOT_INITIALIZED, S_objLib_OBJ_ID_ERROR,
> S_objLib_OBJ_DELETED, S_objLib_OBJ_UNAVAILABLE,
> S_objLib_OBJ_TIMEOUT, S_msgQLib_INVALID_MSG_LENGTH,
> S_msgQLib_NON_ZERO_TIMEOUT_AT_INT_LEVEL
> ------------------------------------------------------------
>
> Most of the names in the ERRNO section are reasonable obvious, but
> how do I find out what S_objLib_OBJ_UNAVAILABLE means?
>
> I understand your statement about checking the return value before
> looking at errno, but I think that you've missed my point. I have a
> task that is running with an errno of 0. After awhile, the errno
> changes to S_errno_EPERM. I'd like to know what this errno means and
> what caused it. I understand that it *may* be something that I don't
> care about, but how do I go about convincing myself that this
> situation is acceptable?
>
> Thanks,
> Tad
This is not entirely accurate... other system functions including
semTake() & taskDelete() when a timeout of NO_WAIT is specified and the
operation cannot succeed immediately.
Hope that helps,
John...
Sent via Deja.com http://www.deja.com/
Before you buy.
If you say this, you _haven't_ understood his statement. It isn't that
>it *may* be something that I don't care about
it is that it is something which you are explicitly _forbidden_ by the
design of the OS and environment from caring about. The OS calls many
of its own routines itself internally that may set errno to various values;
it handles error returns from its own function calls. Since errno never gets
reset to zero, what you are seeing is _meaningless_; the most it could ever
represent is an error that happened an unknown and arbitrary amount of time
ago and that was _already_handled_ by the OS. Functions in the OS are at
liberty to set errno to any value they like at any time whether there's an
error or not; they could for instance use it as a way of returning an
extra result from a function, or they could speculatively set it to an
error that might happen, and then return OK if the error didn't happen. It
is almost always a mistake to try and second guess the internals of your
implementation.
In this particular case, what you are seeing is the leftover traces of
something internal to the OS. My guess would be that message queues are
used internally somewhere in the I/O library to pass chunks of data to and
from the device drivers, and that either your task recently called a read()
function that checked the 'received data' queue, found it empty (setting
errno) and returned to your function with NO ERROR and zero bytes read,
or that your task called a write() function which tried to put data onto an
'outgoing data' queue, found it full, tried again and completed
successfully, leaving errno set from the first try, but correctly returning
NO ERROR to your application.
IOW, worrying about the value of errno when the OS function has returned
OK to your code is worth spending about the same amount of time on as
worrying what values are in auto (function local) variables when their
function isn't running. None.
DaveK
--
"Reality is whatever doesn't go away after you stop believing in it."
-- Philip K. Dick
Hope this helps,
Patrick
<taa...@sandia.gov> wrote in message news:uvgy8r...@sandia.gov...