*** glibc-2.2/sysdeps/unix/sysv/linux/Makefile Sun May 16 09:52:11 1999 --- glibc/sysdeps/unix/sysv/linux/Makefile Tue Oct 19 14:56:09 1999 *************** ifeq ($(subdir),db2) *** 8,13 **** --- 8,17 ---- CPPFLAGS += -DHAVE_LLSEEK=1 endif + ifeq ($(subdir),posix) + sysdep_routines += uname uname_ + endif + ifeq ($(subdir),misc) sysdep_routines += sysctl clone llseek getresuid getresgid umount umount2 *** glibc-2.2/sysdeps/unix/sysv/linux/uname.c Thu Jan 1 01:00:00 1970 --- glibc/sysdeps/unix/sysv/linux/uname.c Tue Oct 19 14:55:55 1999 *************** *** 0 **** --- 1,46 ---- + /* glibc-2.2/sysdeps/unix/sysv/linux/uname.c */ + + #include + #include + #include + #include + #include + + int __uname (struct utsname *buf) + { + int fd, status; + + /* In glibc for linux, uname is directly implemented by a syscall. + We initially do the syscall to get the relevent information + and then hand patch for the hostname of the virtual server. */ + status = ___uname (buf); + if (status) + return status; + + TEMP_FAILURE_RETRY (fd = open ("/etc/FQDN", O_RDONLY)); + if (fd != -1) + { + char fqdn[_UTSNAME_NODENAME_LENGTH + 128]; + int bytes; + + TEMP_FAILURE_RETRY (bytes = read (fd, fqdn, sizeof (fqdn))); + TEMP_FAILURE_RETRY (close (fd)); + if (bytes >= 0) + { + char *ptr; + fqdn[bytes - 1] = '\0'; + for (ptr = fqdn; + *ptr != ' ' && *ptr != '\t' && *ptr != '\0'; + ptr++) + ; + *ptr = '\0'; + bytes = ptr - fqdn; + memcpy (buf->nodename, fqdn, _UTSNAME_NODENAME_LENGTH); + return 0; + } + } + + return 0; + } + weak_alias (__uname, uname) + *** glibc-2.2/sysdeps/unix/sysv/linux/uname_.S Thu Jan 1 01:00:00 1970 --- glibc/sysdeps/unix/sysv/linux/uname_.S Tue Oct 19 14:55:51 1999 *************** *** 0 **** --- 1,6 ---- + /* glibc-2.2/sysdeps/unix/sysv/linux/uname_.S. */ + #include + PSEUDO (___uname, uname, 1) + ret + PSEUDO_END (___uname) +