diff options
author | Yaakov Selkowitz <yselkowi@redhat.com> | 2011-04-04 11:12:48 +0000 |
---|---|---|
committer | Yaakov Selkowitz <yselkowi@redhat.com> | 2011-04-04 11:12:48 +0000 |
commit | a2ef34bfd8811ae483849e0a01b2ceefb6f27286 (patch) | |
tree | 0d0c5d849d78a44f3c9fb0bc6a2face10ef8c02a /winsup/cygwin | |
parent | 26968b5c0590cf2fd8ff916bc63e0936300160f6 (diff) | |
download | newlib-a2ef34bfd8811ae483849e0a01b2ceefb6f27286.zip newlib-a2ef34bfd8811ae483849e0a01b2ceefb6f27286.tar.gz newlib-a2ef34bfd8811ae483849e0a01b2ceefb6f27286.tar.bz2 |
* 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.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/Makefile.in | 3 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_proc.cc | 16 |
3 files changed, 20 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7387c5d..47fefc0 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,4 +1,11 @@ 2011-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * 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 <yselkowitz@users.sourceforge.net> Corinna Vinschen <corinna@vinschen.de> * devices.h (fh_devices): Define FH_PROC_MIN_MINOR. diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in index f80fa3a..59abd35 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 c0821e9..7ca669c 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 |