History log of /freebsd-9.3-release/lib/libc/gen/__xuname.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 184185 22-Oct-2008 kib

Fix a typo. q is already a pointer.

Reported by: ache
Pointy hat to: kib


# 184177 22-Oct-2008 kib

Remove doubtful structure definition with variable array members.
I believe this is not a valid C99 construct. Use directly calculated
offsets into the supplied buffer, using specified members length,
to fill appropriate structure.

Either use sysctl, or copy the value of the UNAME_x environment
variable, instead of unconditionally doing sysctl, and then
overriding a returned value with user-specified one.

Noted and tested by: rdivacky


# 165903 08-Jan-2007 imp

Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.


# 153041 03-Dec-2005 ambrisko

Switch BUILD_ARCH in Makefile to use uname -p suggested by ru.
Switch strncpy to strlcpy suggested by gad and issue found by pjd.
Add to uname(3) man page describing:
UNAME_s
UNAME_r
UNAME_v
UNAME_m
Add to getosreldate(3) man page describing:
OSVERSION

Submitted by: ru, pjd/gad
Reviewed by: ru (man pages)


# 153009 02-Dec-2005 ambrisko

Unbreak build when I fluff the clean-up of __FBSDID diff reduction
before commit.

pointyhat++


# 153002 01-Dec-2005 ambrisko

Add support to easily build FreeBSD unpacked in a chroot of another
FreeBSD machine. To do this add the man 1 uname changes to __xuname.c
so we can override the settings it reports. Add OSVERSION override
to getosreldate. Finally which Makefile.inc1 to use uname -m instead
of sysctl -n hw.machine_arch to get the arch. type.

With these change you can put a complete FreeBSD OS image into a
chroot set:
UNAME_s=FreeBSD
UNAME_r=4.7-RELEASE
UNAME_v="FreeBSD $UNAME_r #1: Fri Jul 22 20:32:52 PDT 2005 fake@fake:/usr/obj/usr/src/sys/FAKE"
UNAME_m=i386
UNAME_p=i386
OSVERSION=470000
on an amd64 or i386 and it just work including building ports and using
pkg_add -r etc. The caveat for this example is that these patches
have to be applied to FreeBSD 4.7 and the uname(1) changes need to
be merged. This also addresses issue with libtool.

This is usefull for when a build machine has been trashed for an
old release and we want to do a build on a new machine that FreeBSD
4.7 won't run on ...


# 90039 31-Jan-2002 obrien

Fix SCM ID's.


# 74729 24-Mar-2001 peter

This is kind of a hack, but it should work. Currently, world is broken
because libc/rpc/key_call.c references uname(), and ps/print.c also
defines uname(), and ps is linked statically. This leads to a symbol
clash. The userland uname(3) kinda sucked anyway as the hostname
etc was too short. And since the libc rpc interface now uses
the utsname.nodename which gets truncated, I was tempted into doing
something about it. Create a new userland uname function, called
__xuname() which takes an extra argument that allows you to change
the size of the fields. uname() becomes a static inline function
in sys/utsname.h that passes the extra argument in. struct utsname
has its field members expanded by default now in userland.
We still provide a 'uname' externally linkable function for things
that either think that they ``know'' the utsname format and assume
32 character strings and bypass the include file, or objects that
are linked against old libcs. ie: just about every plausible
case that I can think of is covered. Should we ever change the
default lengths again, a libc major bump should not be required
as the size is now passed to the function.

XXX the uname(2) in the kernel is for FreeBSD 1.1 binary compatability!
All the uname(3) functions that are exported to userland are actually
implemented in libc with sysctl. uname(1) uses sysctl directly and
does not call uname(3).

PR: bin/4688


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 22993 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 9817 31-Jul-1995 mpp

Null terminate all strings returned by the dummy uname() routine,
and make sure that the version string is somewhat sane. This
closes out PR#462.

Reviewed by: Bruce Evans


# 8870 30-May-1995 rgrimes

Remove trailing whitespace.


# 3565 13-Oct-1994 wollman

sysctl(3) can return an error (setting errno to ENOMEM) when the
fields in the utsname structure are too small to hold their
corresponding MIB variables. Don't return an error in this case.


# 1573 27-May-1994 rgrimes

BSD 4.4 Lite Lib Sources