A strange result of strerror() function.

bridged with qdn.public.qnxrtp.x86
Post Reply
Hichun Chen

A strange result of strerror() function.

Post by Hichun Chen » Mon Apr 07, 2003 2:24 pm

Recently I run my program which contain strerror() function on localhost and
remote machine,but the printed information is different:
#./test /* strerror(1); it printed "No error" */
#on -f node_3 ./test /* strerror(1); it printed "Function not
implemented"

Why got this difference?
Thanks for any comment.

--
http://hichun.nease.net
hcchen@ipp.ac.cn
Hichun Chen

David Gibbs

Re: A strange result of strerror() function.

Post by David Gibbs » Mon Apr 07, 2003 7:43 pm

Hichun Chen <hcchen@mail.ipp.ac.cn> wrote:
Recently I run my program which contain strerror() function on localhost and
remote machine,but the printed information is different:
#./test /* strerror(1); it printed "No error" */
#on -f node_3 ./test /* strerror(1); it printed "Function not
implemented"

Why got this difference?
Where did you get the value you passed to strerror()? I assume you'd
just passed errno -- what operation had just failed before you called
strerror? Had an operation even failed?

-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Hichun Chen

Re: A strange result of strerror() function.

Post by Hichun Chen » Tue Apr 08, 2003 1:37 pm

"David Gibbs" <dagibbs@qnx.com> wrote in message
news:b6skc5$aml$1@nntp.qnx.com...
Hichun Chen <hcchen@mail.ipp.ac.cn> wrote:
Recently I run my program which contain strerror() function on localhost
and
remote machine,but the printed information is different:
#./test /* strerror(1); it printed "No error" */
#on -f node_3 ./test /* strerror(1); it printed "Function not
implemented"

Why got this difference?

Where did you get the value you passed to strerror()? I assume you'd
just passed errno -- what operation had just failed before you called
strerror? Had an operation even failed?
yes,I used strerror(errno),but it indicated current function no
error,doesn't this function print last function's error message? let me
check other functions in the before.

David Gibbs

Re: A strange result of strerror() function.

Post by David Gibbs » Tue Apr 08, 2003 2:52 pm

Hichun Chen <hcchen@mail.ipp.ac.cn> wrote:
"David Gibbs" <dagibbs@qnx.com> wrote in message
news:b6skc5$aml$1@nntp.qnx.com...
Hichun Chen <hcchen@mail.ipp.ac.cn> wrote:
Recently I run my program which contain strerror() function on localhost
and
remote machine,but the printed information is different:
#./test /* strerror(1); it printed "No error" */
#on -f node_3 ./test /* strerror(1); it printed "Function not
implemented"

Why got this difference?

Where did you get the value you passed to strerror()? I assume you'd
just passed errno -- what operation had just failed before you called
strerror? Had an operation even failed?


yes,I used strerror(errno),but it indicated current function no
error,doesn't this function print last function's error message? let me
check other functions in the before.
Yes, it tells you why the last function called failed (if it failed).
But, I don't know what the last function you called was, since I can't
see your code -- so without having any idea what function might have
failed (or even if it failed), I can't tell you anything about what
might have gone wrong.

-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Post Reply

Return to “qdn.public.qnxrtp.x86”