diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7387c5d7e..47fefc0a2 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2011-04-04 Yaakov Selkowitz + + * Makefile.in (fhandler_proc_CFLAGS): Define USERNAME, HOSTNAME, + and GCC_VERSION. + * fhandler_proc.cc (format_proc_version): Add build machine and GCC + version information as on Linux. + 2011-04-04 Yaakov Selkowitz Corinna Vinschen diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in index f80fa3ad6..59abd356f 100644 --- a/winsup/cygwin/Makefile.in +++ b/winsup/cygwin/Makefile.in @@ -287,6 +287,9 @@ sysconf_CFLAGS:=-fomit-frame-pointer uinfo_CFLAGS:=-fomit-frame-pointer endif +fhandler_proc_CFLAGS+=-DUSERNAME="\"$(USER)\"" -DHOSTNAME="\"$(HOSTNAME)\"" +fhandler_proc_CFLAGS+=-DGCC_VERSION="\"`$(CC) -v 2>&1 | tail -n 1`\"" + _cygwin_crt0_common_STDINCFLAGS:=yes libstdcxx_wrapper_STDINCFLAGS:=yes cxx_STDINCFLAGS:=yes diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc index c0821e92c..7ca669c84 100644 --- a/winsup/cygwin/fhandler_proc.cc +++ b/winsup/cygwin/fhandler_proc.cc @@ -361,15 +361,19 @@ fhandler_proc::fill_filebuf () static _off64_t format_proc_version (void *, char *&destbuf) { + tmp_pathbuf tp; + char *buf = tp.c_get (); + char *bufptr = buf; struct utsname uts_name; uname (&uts_name); - destbuf = (char *) crealloc_abort (destbuf, strlen (uts_name.sysname) - + strlen (uts_name.release) - + strlen (uts_name.version) - + 4); - return __small_sprintf (destbuf, "%s %s %s\n", - uts_name.sysname, uts_name.release, uts_name.version); + bufptr += __small_sprintf (bufptr, "%s version %s (%s@%s) (%s) %s\n", + uts_name.sysname, uts_name.release, USERNAME, HOSTNAME, + GCC_VERSION, uts_name.version); + + destbuf = (char *) crealloc_abort (destbuf, bufptr - buf); + memcpy (destbuf, buf, bufptr - buf); + return bufptr - buf; } static _off64_t