Commit Graph

1387 Commits

Author SHA1 Message Date
tjr
d3a1f7d912 Implement $PPID, the parent process ID of the shell. 2002-06-01 02:14:48 +00:00
tjr
fff7a36566 Support the remaining job ID formats required by SUSv3:
%+ (current job, same as %%),
%- (previous job),
%?str (job with "str" in its command name).
2002-06-01 01:51:42 +00:00
tjr
1f8bb8d729 Add -s (output PID's only) and -l (show PID's) options to the jobs(1)
builtin. Modify the output format to match what SUSv3 requires.
2002-05-31 14:04:23 +00:00
tjr
c828fbddc6 #if JOBS around a job control-related statement to allow compilation with
job control disabled.
2002-05-31 13:10:38 +00:00
tjr
5250eaebac Break the code to display status info for one job out from showjobs() into
showjob(), use it inside dowait() to display status info for consistency,
and in a format closer to what the standard requires.
2002-05-31 13:07:05 +00:00
tjr
952d847c40 Move job to front of most recently used job list when bg'd or fg'd. 2002-05-31 12:35:34 +00:00
tjr
7e9561b97a Instead of keeping just the jobid of the most recently bg'd or fg'd job,
keep a linked list of the jobs, most recently used first. This is required
to support the idea of `previous job', and to allow the jobs fg and bg
default to be correct according to POSIX.
2002-05-31 12:31:23 +00:00
ru
e57f94d9c9 mdoc(7) police: kill hard sentence breaks. 2002-05-30 14:10:44 +00:00
tjr
09ec516834 Reject options, handle "--" correctly in unlink(1). 2002-05-30 01:05:15 +00:00
tjr
a9256c24d5 Reject options, handle "--" end-of-options marker in link(1). 2002-05-30 00:57:38 +00:00
ru
7ff3239b45 mdoc(7) police: punctuation. 2002-05-29 18:52:02 +00:00
ru
76631b8618 mdoc(7) police: tidy up the markup a bit. 2002-05-29 15:38:59 +00:00
ru
9f5e5c2002 mdoc(7) police: markup nits. 2002-05-29 15:18:35 +00:00
ru
8604f56312 mdoc(7) police: markup nits. 2002-05-29 15:09:49 +00:00
ru
d8884723c1 mdoc(7) police: punctuation. 2002-05-29 15:06:24 +00:00
ru
c17d65090d mdoc(7) police: replace the XXX with the correct width. 2002-05-29 14:01:27 +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
77288420b0 Note that the lutimes(2) and lchflags(2) syscalls also do not follow symlinks.
Remove incorrect examples.

PR:		25016
Submitted by:	Martin Kammerhofer, Joshua Goodall
2002-05-26 12:51:38 +00:00
tjr
4cc401e5ef Add lchmod(2) to the list of syscalls that do not follow symbolic links. 2002-05-26 12:12:36 +00:00
tjr
9ce8567e45 sh appeared in Version 1, not System V.1. 2002-05-25 12:18:27 +00:00
tjr
290ce9e466 Implement `set +o', which displays the currently set options in a format
suitable for re-input into the shell.
2002-05-25 12:11:58 +00:00
tjr
e6fbc84685 Bring back the cd -L and -P options from revision 1.24, but try harder not
to fail when the logical current directory no longer exists. Allow changes
to absolute paths when logical cwd is invalid, fall back to physical cd
if logical cd fails.
2002-05-22 05:15:53 +00:00
tjr
fff7331065 Temporarily back out revision 1.24; it seems to handle the case where the
current directory no longer exists incorrectly and breaks `make cleandir'.
2002-05-22 03:29:20 +00:00
tjr
bc86a28ef9 Add the SUSv3 -L and -P options to the cd and pwd builtin utilities. `Logical'
handling of .. is now the default.
2002-05-20 07:54:39 +00:00
jmallett
4205c9f55a Remove a small, annoying, nit I ran in to editing this file, a lone tab
on a line by itself.
2002-05-19 17:50:23 +00:00
tjr
b19972e699 Implement the -u (-o nounset) option, which gives an error message if
an unset variable is expanded.

Obtained from:	NetBSD (bjh21, christos)
2002-05-19 08:30:16 +00:00
tjr
b72e0fae17 Make the fg and bg commands give the output required by SUSv3.
fg outputs the name of the command, bg outputs the name of the command
and the job id.
2002-05-19 07:27:26 +00:00
tjr
ada2f900a3 Implement the -C (-o noclobber) option, which prevents existing regular
files from being overwritten by shell redirection.
2002-05-19 06:03:05 +00:00
tjr
18037eb7ab Add missing options required by SUSv3:
-m	List files across the page, separated by commas.
-p	Print a slash after directory names
-x	Same as -C but sort across the columns rather than down

Submitted by:	Kyle Martin <mkm@ieee.org>
2002-05-19 02:51:36 +00:00
iedowse
75e563ada2 Unconditionally update the maximum field width statistics when we
refetch the filesystem information in MNT_WAIT mode. This avoids
incorrect column alignment that sometimes occurs with NFS filesystems.

Submitted by:	Ian <freebsd@damnhippie.dyndns.org>
2002-05-18 21:10:40 +00:00
tjr
35d66bbcdb Back out part of previous commit: make -P the default again until I'm
convinced it's a good idea.
2002-05-18 13:52:07 +00:00
tjr
f0c2951e6b Make -L the default, allow both -L and -P to be specified (last one used
matters), fall back to -P mode if we can't get the logical directory.
2002-05-18 02:47:25 +00:00
ache
fbce3fb517 Optimize prev. commit code a bit 2002-05-17 12:24:19 +00:00
ache
c711b20bf2 Trailing slash fixes.
Fix the case:
        cp file nonexistent/
which create nonextstent as file while trailing slash clearly indicates
that nonexistent must be a directory.
Also fix the case:
	cp file1 file2/
which should produce error.
2002-05-17 11:52:48 +00:00
jmallett
3f70efa473 Remove local definition of _PATH_CP, and use <paths.h>, _PATH_CP is in the
CURRENT <paths.h>.
2002-05-17 11:38:48 +00:00
joe
40c0cc2b5f The sysctl has changed from 'kern.ps_showallprocs' to
'security.bsd.see_other_uids'.
2002-05-16 11:51:05 +00:00
trhodes
0c40c9d08e more file system > filesystem 2002-05-16 03:51:38 +00:00
trhodes
56036d2623 Consistancy check s/file system/filesystem/
Reviewed by:	brian
2002-05-16 01:57:20 +00:00
billf
8ce7d93d62 restore missing default case removed in ls.c:r1.57
add break statements to default cases where missing.

Submitted by:	bde
2002-05-15 18:53:56 +00:00
jmallett
3de05bf289 Make 'user' and 'group' const as to not discard the qualifier from the
functions we use to assign them.  Doesn't seem to be anything else that
relies on these being non-const.
2002-05-15 09:49:59 +00:00
jmallett
c0b64a6d1b Remove an empty default case to make this syntactically correct. Not there
is as good as blaknk.
2002-05-15 09:43:52 +00:00
phk
5e1cf3ad98 Remove the private code for reading UFS superblocks, this does not belong
in df(1) when we have multiple filesystem types, and the complications of
handling UFS2 pushes this over the edge.

Use the .../mount/extern.h to get prototypes of the functions we
borrow from there.  Constify things to match.  (why aren't these
functions in a lib anyway ?)

Make everything static and set WARNS?=5.

The way the "df diskdevice" thing works for unmounted diskdevices
is not very general.

Sponsored by: DARPA & NAI Labs.
2002-05-12 19:24:09 +00:00
jedgar
47acb76e7c Add semicolon to empty default case to silence warning. 2002-05-11 03:12:02 +00:00
wollman
a04093f9b6 EXPR_COMPAT should imply -e, since there is no way to specify it otherwise,
and -e reflects the historic behavior of FreeBSD's expr.
2002-05-11 03:08:12 +00:00
alfred
2864dba864 while i'm breaking stuff, use __dead2 instead of GCC specific __attribute__. 2002-05-11 01:25:54 +00:00
alfred
2f75a283e0 backout additional include of cdefs.h, it's not helping any. 2002-05-11 01:24:39 +00:00
alfred
83d76dffe1 include cdefs.h for __printf0like to silence warning. 2002-05-11 00:54:33 +00:00
jedgar
818f9c0a64 Add semicolon to empty default case to silence warning. 2002-05-11 00:45:01 +00:00
alfred
c4d4a5fa12 Add semicolon to empty default case to silence warning. 2002-05-11 00:21:00 +00:00
wollman
e11cb46ee8 The response to my POSIX interpretation request says that `expr'
is required to be oblivious to overflow and to use the data type `long'.
(Division by zero is undefined in ISO C so it's still OK to check for it
here.)  Add a new `-e' flag to get the old, more useful behavior.
2002-05-10 22:59:29 +00:00