Commit Graph

5307 Commits

Author SHA1 Message Date
tjr
8daf14c02a Write "FROM" heading above the hostname column, like NetBSD and GNU do. 2002-05-28 06:36:46 +00:00
marcel
58435e6cb7 Add uuidgen(2) and uuidgen(1).
The uuidgen command, by means of the uuidgen syscall, generates one
or more Universally Unique Identifiers compatible with OSF/DCE 1.1
version 1 UUIDs.

From the Perforce logs (change 11995):

Round of cleanups:
o  Give uuidgen() the correct prototype in syscalls.master
o  Define struct uuid according to DCE 1.1 in sys/uuid.h
o  Use struct uuid instead of uuid_t. The latter is defined
   in sys/uuid.h but should not be used in kernel land.
o  Add snprintf_uuid(), printf_uuid() and sbuf_printf_uuid()
   to kern_uuid.c for use in the kernel (currently geom_gpt.c).
o  Rename the non-standard struct uuid in kern/kern_uuid.c
   to struct uuid_private and give it a slightly better definition
   for better byte-order handling. See below.
o  In sys/gpt.h, fix the broken uuid definitions to match the now
   compliant struct uuid definition. See below.
o  In usr.bin/uuidgen/uuidgen.c catch up with struct uuid change.

A note about byte-order:
        The standard failed to provide a non-conflicting and
unambiguous definition for the binary representation. My initial
implementation always wrote the timestamp as a 64-bit little-endian
(2s-complement) integral. The clock sequence was always written
as a 16-bit big-endian (2s-complement) integral. After a good
nights sleep and couple of Pan Galactic Gargle Blasters (not
necessarily in that order :-) I reread the spec and came to the
conclusion that the time fields are always written in the native
by order, provided the the low, mid and hi chopping still occurs.
The spec mentions that you "might need to swap bytes if you talk
to a machine that has a different byte-order". The clock sequence
is always written in big-endian order (as is the IEEE 802 address)
because its division is resulting in bytes, making the ordering
unambiguous.
2002-05-28 06:16:08 +00:00
tjr
c749049ff8 Hook newgrp(1) up to the build.
PR:		36190
2002-05-28 05:07:42 +00:00
tjr
16f4712bc4 Add the newgrp(1) utility, which changes groups. This is required by
the POSIX.2 UPE.

PR:		36190
Reviewed by:	-standards, silence on -audit
2002-05-28 05:05:28 +00:00
tjr
857b1f2ee6 The XCU issue 5 requirement of accepting the file operand intermingled
with options has been withdrawn in issue 6, to which nl(1) now conforms.
2002-05-27 06:53:54 +00:00
tjr
b50c5edd06 style(9): use errx() where appropriate instead of fprintf() + exit(). 2002-05-27 06:46:29 +00:00
tjr
dab00ca877 style(9): use err() instead of perror() + exit(). 2002-05-27 06:37:34 +00:00
tjr
c73112a6c7 Claim conformance to IEEE Std 1003.1-2001.
See also csplit(1).
2002-05-27 06:08:14 +00:00
tjr
fd517aac90 Allow "-" to be specified as an operand as well as an option.
SUSV3 requires something like "split -- -" to work. Document the "-" operand.
2002-05-27 05:27:10 +00:00
tjr
89c62e14bd Avoid overflowing `fname' if the file name prefix given on the command
line is too long.

Obtained from:	OpenBSD
2002-05-27 04:59:46 +00:00
tjr
3a59030266 Exit non-zero if the tags file cannot be opened. 2002-05-27 03:54:45 +00:00
tjr
ec252a0e8b From NetBSD:
Revision 1.10 Sat Oct 14 17:41:55 2000 UTC by bjh21
    Don't core dump with an empty format string.  Fixes PR#11218.
    Patch supplied by Launey Thomas.

Obtained from:	NetBSD
2002-05-27 03:17:28 +00:00
tjr
fb067c8f63 Initialise the `positions' array correctly before use. 2002-05-27 02:01:25 +00:00
tjr
ec9860cfd0 Add Standards, Diagnostics and History sections. 2002-05-26 07:07:14 +00:00
tjr
dc6576dc1f If a file operand cannot be processed, go on to process any remaining files
but exit non-zero.
2002-05-26 06:15:15 +00:00
ru
d98e09267b Make it work for a different endianness binary.
(This version is still limited to ELF64.)

Reviewed by:	jake
2002-05-25 13:43:16 +00:00
ru
6e02fb8404 Move elf2aout to usr.sbin/.
Approved by:	jake
2002-05-25 13:29:47 +00:00
tjr
8f932f078d Sync usage message with manual page synopsis. 2002-05-25 11:37:10 +00:00
tjr
8ad547bb95 Bad numeric arguments or usernames should cause non-zero exit status. 2002-05-25 10:37:24 +00:00
tjr
cb22bdeaa9 Determine exit status to use before writing diagnostic message; warn()
may change errno.
2002-05-25 03:32:23 +00:00
tjr
bfb5f8c97e Typo: use plural now that we have more than one option. 2002-05-25 03:08:21 +00:00
tjr
8007b11dcd If a file cannot be processed, try to process any remaining files
then exit non-zero.
2002-05-25 03:04:28 +00:00
trhodes
2cd0ea3f3a Add the word ``fields'' to the description, and change an instance from
fields to num in the SYNOPSIS

Noticed by:	keramida
2002-05-24 19:12:02 +00:00
ru
b4b6d4dfb9 Back out the ``run shell from $PATH'' change; this was an overkill
and is insecure.

Requested by:	bde
2002-05-24 15:51:27 +00:00
tjr
74ff5f42c5 If a file argument cannot be processed, process the remaining ones
and exit non-zero (SUSv3)
2002-05-24 10:58:21 +00:00
tjr
2292a0fbef When a file name of "-" is given, read from standard input (SUSv3) 2002-05-24 09:56:18 +00:00
tjr
425cb2e9e1 Allow byte/character positions >_POSIX2_LINE_MAX to be specified by
dynamically growing the `positions' array.
2002-05-24 09:11:18 +00:00
tjr
4b1ea82b13 Use fgetln(3) to handle lines of unlimited length instead of a
getc/putc loop.

Suggested by: dd
2002-05-24 08:56:49 +00:00
tjr
c2f2a6104f P1003.2 forbids imposing any limit on line lengths; read character by
character instead of manually buffering each line.
2002-05-24 07:05:10 +00:00
tjr
e1f16de894 Exit with non-zero status if any files specified could not be opened
when -s option is given (SUSv3).
2002-05-24 06:17:29 +00:00
tjr
631d66bee1 If processing of one file fails, try to process the remaining files and
exit non-zero instead of immediately exiting. The traditional BSD
behaviour is explicitly forbidden by P1003.2.
2002-05-24 06:03:12 +00:00
tjr
fcdda3c7ed If processing of one file fails, try to process the remaining files and
exit non-zero instead of immediately exiting (SUSv3).
2002-05-24 06:00:47 +00:00
fanf
977ef0bf3c Sync with upstream version:
* Ensure we work within the array bounds when parsing command-line options;
  * Replace h0h0getopt with getopt(3);
  * Use consistent whitespace style in the function declarations.

Revieweded by:	dwmalone (mentor)
2002-05-23 16:50:41 +00:00
jmallett
408260d79e Handle numeric keys by checking a "default" file. Handle number-less keys
by failing, since comparing up to the length of the key (0) against the
begin line for a key in the help file will always succeed, and print what
is wholly bogus output.
2002-05-23 14:58:22 +00:00
jmallett
64477eb2ea Set the MAKEFILE variable to the value passed to ReadMakefile(), not the full
path to it.  Use the full path only for parsing it.
2002-05-23 12:01:54 +00:00
jmallett
28296cf1d3 Make my style consistent.
Remove two includes.

Fix a typo (semicolon instead of period at EOL).
2002-05-23 03:03:44 +00:00
jmallett
981165838b Taking a leap of faith, tie the help command in to the build. 2002-05-22 23:15:58 +00:00
jmallett
df0fe27516 Add my PD implementation of the SCCS help command, which prints help from
files in the format used by SCCS, given a key.  It behaves exactly like the
``proper'' SCCS help command, from what testing I can do.
2002-05-22 23:14:17 +00:00
jmallett
050fe17638 Tie sccs(1) in to the build, as it now does one thing right: sccs what 2002-05-22 16:19:31 +00:00
jmallett
51cd687bb8 Remove mention of the GNU version of ptx, it is dead. 2002-05-22 16:18:14 +00:00
jmallett
618595e7c7 Add a usage().
Print usage() if right before executing the specified command, it comes to be
that *argv is NULL (i.e. a flag was specified without a command being given).
2002-05-22 16:09:52 +00:00
jmallett
a00707167b Remove #ifndef's on V6. 2002-05-22 16:01:50 +00:00
jmallett
844f8bb282 Put braces around the command table properly. 2002-05-22 15:59:27 +00:00
jmallett
26ab0525a8 Use what(1) here, in /usr/bin/what. It doesn't print error 26 correctly, but
neither does the pd sccs(1) implementation I have around, so there's no loss
for now.
2002-05-22 15:44:29 +00:00
jmallett
a743481874 str_concat() doesn't really take const arguments.
Submitted by:	bde
Pointy hat to:	jmallett
2002-05-22 15:34:00 +00:00
ru
7d529109a8 Do not run shell from /bin, run it from $PATH.
Bump MAKE_VERSION to 5200205221.
2002-05-22 14:53:18 +00:00
ru
367d0965de Added the MAKE_VERSION global that could be useful in determining
if a given make(1) is feature-compatible with a set of makefiles.

When merged, this will be used to replace the ugly upgrade_checks
hacks in src/Makefile.

Version has the RYYYYMMDDX format, where R is from RELENG_<R> and
X allows for 10 distinguishable changes per day.

Discussed with:	bde
2002-05-22 14:35:47 +00:00
jmallett
a9a1aecd79 Format internal commands properly.
Kill a bit of trailing whitespace.

Fix a path format.

Submitted by:	mdoc(7) police (ru)
2002-05-22 14:17:16 +00:00
jmallett
68ea1628ef Clean up the manual page by leaps and bounds in terms of formatting.
Ruslan's version took away the '.Nm' for some commands, but not others, so
I chose to go with leaving '.Nm'.

Submitted by:	ru
2002-05-22 13:59:52 +00:00
jmallett
199da7245a Make the guarded string functions take a const "from" addr, and make the
function that prints when a botched guarded string operation occurs take
two const arguments.

XXX Should we use strlcat/strlcpy instead and hope for the best?
2002-05-22 13:41:08 +00:00