|
From: Daniel G. <dan...@ta...> - 2014-04-10 18:49:04
|
On Thu, Apr 10, 2014 at 3:30 PM, John Reiser <jr...@bi...> wrote: >> 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. What if I re-write my code using uname syscall? > > 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. We are already doing that, but this could be easily fixed with uname. Otherwise, people like me may end up creating their own wrappers rather than using an off-the-shelf valgrind. > > > ------------------------------------------------------------------------------ > Put Bad Developers to Shame > Dominate Development with Jenkins Continuous Integration > Continuously Automate Build, Test & Deployment > Start a new project now. Try Jenkins in the cloud. > http://p.sf.net/sfu/13600_Cloudbees > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers -- Daniel F. Gutson Chief Engineering Officer, SPD San Lorenzo 47, 3rd Floor, Office 5 Córdoba, Argentina Phone: +54 351 4217888 / +54 351 4218211 Skype: dgutson |