Commit Graph

14 Commits

Author SHA1 Message Date
Juli Mallett
e7b883c427 Make the sysctlbyname stuff look like the 2-level MIB stuff. This
means actually setting 'len', for example.  Which will make uname -i
work on some systems where it did not.  Anywhere where it did work,
it was a matter of coincidence.

Submitted by:	redpixel on EFnet.
2003-07-01 20:15:28 +00:00
Juli Mallett
8ec0090099 Add sysctlbyname(3) support, and use that for uname -i, in preparation for
replacing the committed static OID version with a string-based OID_AUTO
version.
2003-06-09 10:23:43 +00:00
Juli Mallett
c4119c76f8 Make kernel identification (`ident' in the config(8) driver) available to
userland, and the kernel.  In the kernel by way of the 'ident[]' variable
akin to all the other stuff generated by newvers.sh.  In userland it is
available to sysctl consumers via KERN_IDENT or 'kern.ident'.  It is exported
by uname(1) by the -i flag.

Reviewed by:	hackers@
2003-06-09 09:38:20 +00:00
Juli Mallett
5a4ba400c1 Use some macro evil to create the functions for using sysctl(3) to get each
variable natively.  It should allow you to use any sysctl mib set, but due
to limitations of what I can do with macros, right now it's limited to two,
which is all this program used anyway.

Sponsored by:	Bright Path Solutions
2002-09-23 06:47:39 +00:00
Juli Mallett
2ee166b2bd Check to see if we should print a space, rather than using the annoying
prefix methodology.  Adjust nearby style.

Sponsored by:	Bright Path Solutions
2002-09-23 06:14:13 +00:00
Juli Mallett
bed4636e02 Mostly rewrite the flag handling of uname(1) to be overridable, such as:
freefall% uname -s
  FreeBSD
  freefall% env UNAME_s=Linnex ./uname -s
  Linnex

MFC after:	1 month
2002-09-18 04:33:10 +00:00
David Malone
f4ac32def2 ANSIify function definitions.
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.

Reviewed by:	md5
2002-09-04 23:29:10 +00:00
Warner Losh
3f330d7d1a remove __P 2002-03-22 01:42:45 +00:00
Yoshihiro Takahashi
1c6d3890d6 'uname -p' prints the value of hw.machine_arch instead of hw.machine.
Reviewed by:		imp
No response from:	-arch
MFC after:		3 weeks
2002-01-14 12:49:46 +00:00
Mark Murray
043c9b9b34 WARNS=2 fixes, use __FBSDID(). 2001-12-11 23:16:25 +00:00
Bruce Evans
22694ebad5 Fixed printf format errors. 1998-07-06 21:01:54 +00:00
Steve Price
7db98de957 Add a -p option which is the same as the -m option but provided
for SVR4 compatibility.

PR:		5826
1998-02-24 16:57:49 +00:00
Warner Losh
1c8af87873 compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 04:34:07 +00:00
Peter Wemm
0da30e9aa7 Import some parts of CSRG 4.4BSD-Lite2 usr.bin sources to fix tree build. 1997-03-11 13:08:12 +00:00