A strange result of strerror() function.

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

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.

“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.

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.