|
From: John R.
|
> What if I re-write my code using uname syscall?
The result is what some previous user-mode code said that nodename should be.
Quoting from the manual page "man 2 uname":
On the other hand, the field node‐
name is meaningless: it gives the name of the present machine in some unde‐
fined network, but typically machines are in more than one network and have
several names. Moreover, the kernel has no way of knowing about such things,
so it has to be told what to answer here.
Note that this is _logically_ equivalent to setting HOSTNAME. No one knows
what the answer should be until some user-mode code decides and propagates its decision.
In the case of uname syscall, there are THREE different ones:
Over time, increases in the size of the utsname structure have led to three
successive versions of uname()
So you need to pick which one, and write that. The libc uname() is unavailable
because valgrind does not link with libc.
>> Overcome this by setting and exporting HOST or HOSTNAME yourself.
>
> We are already doing that, but this could be easily fixed with uname.
Sometimes uname gives the wrong answer, and using uname is not "easy", either.
That is a significant part of the reason why HOSTNAME is used instead.
> Otherwise, people like me may end up creating their own wrappers
> rather than using an off-the-shelf valgrind.
You: "Dr, it hurts when I use a shell that I picked up off the street."
Dr: "Get yourself a better shell. There are several to choose from,
and most are both free and libre."
|