|
From: John R.
|
> POSIX does not require that shells pass the HOST or HOSTNAME to subshells. > Generally, calling to gethostname() instead is suggested. POSIX specifies minimum functionality that is required exist everywhere. In some cases the usual practice requires something better than the POSIX minimum. HOST is one such case. gethostname() is ugly because it requires LOTS of machinery, and the answer need not be unique. In most cases there are several hostnames, especially including such names as "localdomain.localhost". You probably want something better than that. If your shell doesn't do what you want automatically, then write a wrapper shell script which sets and exports HOST before exec'ing the real valgrind. > Could somebody please tell me why I can't just use a function provided > in unistd.h, > and how I could overcome this? Building valgrind does not link with any library that provides gethostname, nor does valgrind want to do that. Overcome this by setting and exporting HOST or HOSTNAME yourself. |