Merge from -current

This commit is contained in:
Poul-Henning Kamp committed 1996-11-05 20:18:00 +00:00
1 parent a1ec9373e1
commit 5bc589fc3f
9 files changed
+101 -61
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/2.2/; revision=19435

No files matched your search

+32 -11
View File
@@ -1,7 +1,6 @@
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
@@ -31,6 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)nice.1 8.1 (Berkeley) 6/6/93
.\" $Id: nice.1,v 1.2 1996/11/02 22:02:32 wosch Exp $
.\"
.Dd June 6, 1993
.Dt NICE 1
@@ -51,25 +51,46 @@ at a low priority.
(Think of low and slow).
If
.Fl Ns Ar number
is specified, and if it is greater than or equal
to 10 (the default),
.Nm nice
is not given
.Nm
assumed the value 10.
The priority is a value in the range -20 to 20. The default priority
is 0, priority 20 is the lowest possible.
.Nm Nice
will execute
.Ar command
at that priority.
The upper bound, or lowest priority that
.Nm nice
will run a command is 20.
The lower bounds or
higher priorities (integers less than 10)
can only be requested by the super-user.
at priority
.Ar number
relative to the priority
of
.Nm nice .
Higher priorities than the
current process priority can only requested by the
super-user.
Negative numbers are expressed as
.Fl - Ns Ar number .
.Pp
The returned exit status is the exit value from the
command executed by
.Nm nice .
.Sh EXAMPLES
.Pp
$ nice -5 date
.Pp
Execute command
.Sq date
at priority 5 assuming the priority of the
shell is 0.
.Pp
# nice -16 nice --35 date
.Pp
Execute command
.Sq date
at priority -19 assuming the priority of the
shell is 0 and you are the super-user.
.Sh SEE ALSO
.Xr getpriority 2 ,
.Xr setpriority 2 ,
.Xr csh 1 ,
.Xr renice 8
.Sh HISTORY
+3 -3
View File
@@ -65,7 +65,8 @@ main(argc, argv)
int niceness = DEFNICE;
if (argc < 2)
errx(1, "usage: nice [-number] command [arguments]");
usage();
if (argv[1][0] == '-')
if (argv[1][1] == '-' || isdigit(argv[1][1])) {
niceness = atoi(argv[1] + 1);
@@ -89,7 +90,6 @@ main(argc, argv)
void
usage()
{
(void)fprintf(stderr,
"nice [ -# ] command [ options ] [ operands ]\n");
(void)fprintf(stderr, "usage: nice [-number] command [arguments]\n");
exit(1);
}
+2 -2
View File
@@ -1,5 +1,5 @@
# From: @(#)Makefile 8.3 (Berkeley) 4/2/94
# $Id: Makefile,v 1.18 1995/09/14 21:02:16 gibbs Exp $
# $Id: Makefile,v 1.20 1996/11/03 03:11:54 jkh Exp $
PROG= passwd
SRCS= local_passwd.c yppasswd_private_xdr.c yppasswd_comm.c yp_passwd.c \
@@ -13,7 +13,7 @@ LDADD= -lcrypt -lrpcsvc
CFLAGS+= -DCRYPT -DYP -I. -I${.CURDIR} -I${.CURDIR}/../../usr.sbin/vipw \
-I${.CURDIR}/../../usr.bin/chpass -I${.CURDIR}/../../libexec/ypxfr \
-I${.CURDIR}/../../usr.sbin/rpc.yppasswdd -Dyp_error=warnx
-I${.CURDIR}/../../usr.sbin/rpc.yppasswdd -Dyp_error=warnx -DLOGGING
SRCS+= ypxfr_misc.c yp_clnt.c yppasswd_clnt.c
+8 -1
View File
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: local_passwd.c,v 1.8 1995/12/16 09:45:12 markm Exp $
* $Id: local_passwd.c,v 1.10 1996/11/03 03:11:57 jkh Exp $
*/
#ifndef lint
@@ -56,6 +56,10 @@ static const char sccsid[] = "@(#)local_passwd.c 8.3 (Berkeley) 4/2/94";
#include <pw_yp.h>
#endif
#ifdef LOGGING
#include <syslog.h>
#endif
#include "extern.h"
static uid_t uid;
@@ -178,5 +182,8 @@ local_passwd(uname)
if (!pw_mkdb(uname))
pw_error((char *)NULL, 0, 1);
#ifdef LOGGING
syslog(LOG_DEBUG, "user %s changed their local password\n", uname);
#endif
return (0);
}
+12 -1
View File
@@ -1,5 +1,11 @@
# $Id: awkedit,v 1.1.1.1 1996/08/29 19:42:59 peter Exp $
# $Id: ndcedit.awk,v 1.2 1996/11/04 23:57:40 wosch Exp $
NR == 3 {
print "#"
print "# This file is generated automatically, do not edit it here!"
print "# Please change src/usr.sbin/ndc/ndcedit.awk instead"
print "#"
print ""
print "# If there is a global system configuration file, suck it in."
print "if [ -f /etc/sysconfig ]; then"
print "\t. /etc/sysconfig"
@@ -18,7 +24,12 @@ NR == 3 {
printf "\t%s\n", $0
printf "\t\tfi\n"
} else {
if (/PATH=/) {
gsub(":/usr/ucb:", ":", $0);
if (!/export/) {
$0=$0"\nexport PATH";
}
}
print;
}
}
+6 -5
View File
@@ -8,9 +8,10 @@
#
# Comment out the LOG=yes line to disable logging.
#
# $Id: yppwupdate,v 1.4 1996/06/03 16:17:21 wpaul Exp $
# $Id: yppwupdate,v 1.4 1996/11/04 23:54:01 wosch Exp $
#
PATH=/bin:/usr/bin; export PATH
LOG=yes
LOGFILE=/var/yp/ypupdate.log
@@ -18,16 +19,16 @@ umask 077
if [ ! -f $LOGFILE ];
then
/usr/bin/touch $LOGFILE
touch $LOGFILE
echo "# Edit /usr/libexec/yppwupdate to disable" >> $LOGFILE
echo "# logging to this file from yppasswdd." >> $LOGFILE
echo -n "# Log started on: " >> $LOGFILE
/bin/date >> $LOGFILE
date >> $LOGFILE
fi
if [ ! $LOG ];
then
cd /var/yp; /usr/bin/make MASTER_PASSWD=$1 UPDATE_DOMAIN=$2 $3 2>&1
cd /var/yp && make MASTER_PASSWD=$1 UPDATE_DOMAIN=$2 $3 2>&1
else
cd /var/yp; /usr/bin/make MASTER_PASSWD=$1 UPDATE_DOMAIN=$2 $3 >> $LOGFILE 2>&1
cd /var/yp && make MASTER_PASSWD=$1 UPDATE_DOMAIN=$2 $3 >> $LOGFILE 2>&1
fi
+5 -3
View File
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" From: @(#)slstat.8 6.8 (Berkeley) 6/20/91
.\" $Id$
.\" $Id: slstat.8,v 1.7 1996/11/04 17:13:46 bde Exp $
.\"
.Dd October 11, 1996
.Dt SLSTAT 8
@@ -64,9 +64,11 @@ Verbose display of extra fields of information.
.It Fl r
Display all values in rate per second that amount per interval.
.It Ar unit
Is a single digit specifying the
Is number specifying the
.Tn SLIP
interface, or an interface name. The default unit is
interface, or a
.Tn SLIP
interface name. The default unit is
.Sy 0
for interface
.Sy sl0 .
+32 -34
View File
@@ -22,19 +22,23 @@
*/
#ifndef lint
static char rcsid[] = "$Id: slstat.c,v 1.5 1996/05/30 02:19:55 pst Exp $";
static const char rcsid[] =
"$Id: slstat.c,v 1.7 1996/11/04 17:14:43 bde Exp $";
#endif
#include <sys/param.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <sys/sysctl.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define INET
@@ -44,7 +48,6 @@ static char rcsid[] = "$Id: slstat.c,v 1.5 1996/05/30 02:19:55 pst Exp $";
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <net/slcompress.h>
#include <net/if_slvar.h>
@@ -69,7 +72,7 @@ main(argc, argv)
int c, i;
size_t len;
int maxifno;
int index;
int indx;
struct ifmibdata ifmd;
while ((c = getopt(argc, argv, "vri:")) != -1) {
@@ -89,6 +92,19 @@ main(argc, argv)
usage(argv[0]);
}
}
if (optind >= argc)
sprintf(interface, INTERFACE_PREFIX, unit);
else if (isdigit(argv[optind][0])) {
unit = atoi(argv[optind]);
if (unit < 0)
usage(argv[0]);
sprintf(interface, INTERFACE_PREFIX, unit);
} else if (strncmp(argv[optind], "sl", 2) == 0
&& isdigit(argv[optind][2])
&& sscanf(argv[optind], "sl%d", &unit) == 1) {
strncpy(interface, argv[optind], IFNAMSIZ);
} else
usage(argv[0]);
name[0] = CTL_NET;
name[1] = PF_LINK;
@@ -99,40 +115,24 @@ main(argc, argv)
if (sysctl(name, 5, &maxifno, &len, 0, 0) < 0)
err(1, "sysctl net.link.generic.system.ifcount");
if (isdigit(argv[optind][0])) {
int s;
struct ifmibdata ifmd;
unit = atoi(argv[optind]);
if (unit < 0)
usage(argv[0]);
sprintf(interface, INTERFACE_PREFIX, unit);
} else if(strncmp(argv[optind], "sl", 2) == 0
&& isdigit(argv[optind][2])
&& sscanf(argv[optind], "sl%d", &unit) == 1) {
strncpy(interface, argv[optind], IFNAMSIZ);
} else {
usage(argv[0]);
}
name[3] = IFMIB_IFDATA;
name[5] = IFDATA_GENERAL;
len = sizeof ifmd;
for (i = 1; i <= maxifno; i++) {
for (i = 1; ; i++) {
name[4] = i;
if (sysctl(name, 6, &ifmd, &len, 0, 0) < 0)
err(1, "sysctl");
if (strncmp(interface, ifmd.ifmd_name, IFNAMSIZ) == 0
&& ifmd.ifmd_data.ifi_type == IFT_SLIP) {
index = i;
indx = i;
break;
}
}
if (i > maxifno)
if (i >= maxifno)
errx(1, "interface %s does not exist", interface);
}
name[4] = index;
name[4] = indx;
name[5] = IFDATA_LINKSPECIFIC;
intpr();
exit(0);
@@ -146,8 +146,7 @@ static void
usage(argv0)
const char *argv0;
{
fprintf(stderr, "%s: usage:\n\t%s [-i interval] [-rv] [unit]\n",
argv0, argv0);
fprintf(stderr, "usage: %s [-i interval] [-vr] [unit]\n", argv0);
exit(1);
}
@@ -165,7 +164,6 @@ intpr()
register int line = 0;
int oldmask;
struct sl_softc *sc, *osc;
off_t addr;
size_t len;
sc = (struct sl_softc *)malloc(AMT);
@@ -174,7 +172,8 @@ intpr()
len = AMT;
while (1) {
if (sysctl(name, 6, sc, &len, 0, 0) < 0)
if (sysctl(name, 6, sc, &len, 0, 0) < 0 &&
(errno != ENOMEM || len != AMT))
err(1, "sysctl linkspecific");
(void)signal(SIGALRM, catchalarm);
@@ -194,28 +193,28 @@ intpr()
"search", "miss", "err", "coll");
putchar('\n');
}
printf("%8u %6d %6u %6u %6u",
printf("%8lu %6ld %6u %6u %6u",
V(sc_if.if_ibytes),
V(sc_if.if_ipackets),
V(sc_comp.sls_compressedin),
V(sc_comp.sls_uncompressedin),
V(sc_comp.sls_errorin));
if (vflag)
printf(" %6u %6u %6u",
printf(" %6u %6lu %6lu",
V(sc_comp.sls_tossed),
V(sc_if.if_ipackets) -
V(sc_comp.sls_compressedin) -
V(sc_comp.sls_uncompressedin) -
V(sc_comp.sls_errorin),
V(sc_if.if_ierrors));
printf(" | %8u %6d %6u %6u %6u",
printf(" | %8lu %6ld %6u %6u %6lu",
V(sc_if.if_obytes) / (rflag ? interval : 1),
V(sc_if.if_opackets),
V(sc_comp.sls_compressed),
V(sc_comp.sls_packets) - V(sc_comp.sls_compressed),
V(sc_if.if_opackets) - V(sc_comp.sls_packets));
if (vflag)
printf(" %6u %6u %6u %6u",
printf(" %6u %6u %6lu %6lu",
V(sc_comp.sls_searches),
V(sc_comp.sls_misses),
V(sc_if.if_oerrors),
@@ -244,4 +243,3 @@ catchalarm(sig)
{
signalled = 1;
}
+1 -1
View File
@@ -120,7 +120,7 @@ programs.
The daemon can operate in any of several modes, including symmetric
active/passive, client/server and broadcast/multicast. A
broadcast/multicast client can automatically discover remote servers,
compute one-way delay correction factors and comfigure itself
compute one-way delay correction factors and configure itself
automatically. This makes it possible to deploy a fleet of workstations
without specifying a configuration file or configuration details
specific to its environment.