Remove 'register' keyword.
This commit is contained in:
parent
c4bc47ba6a
commit
be04b6d190
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=92913
@ -73,7 +73,7 @@ ip_checksum(addr, count)
|
|||||||
/* Compute Internet Checksum for "count" bytes
|
/* Compute Internet Checksum for "count" bytes
|
||||||
* beginning at location "addr".
|
* beginning at location "addr".
|
||||||
*/
|
*/
|
||||||
register long sum = 0;
|
long sum = 0;
|
||||||
|
|
||||||
while( count > 1 ) {
|
while( count > 1 ) {
|
||||||
/* This is the inner loop */
|
/* This is the inner loop */
|
||||||
|
@ -34,6 +34,8 @@
|
|||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)insque.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)insque.c 8.1 (Berkeley) 6/4/93";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* insque -- vax insque instruction
|
* insque -- vax insque instruction
|
||||||
@ -48,7 +50,7 @@ struct vaxque { /* queue format expected by VAX queue instructions */
|
|||||||
|
|
||||||
void
|
void
|
||||||
insque(e, prev)
|
insque(e, prev)
|
||||||
register struct vaxque *e, *prev;
|
struct vaxque *e, *prev;
|
||||||
{
|
{
|
||||||
e->vq_prev = prev;
|
e->vq_prev = prev;
|
||||||
e->vq_next = prev->vq_next;
|
e->vq_next = prev->vq_next;
|
||||||
|
@ -37,6 +37,8 @@
|
|||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)lsearch.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)lsearch.c 8.1 (Berkeley) 6/4/93";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -68,7 +70,7 @@ linear_base(key, base, nelp, width, compar, add_flag)
|
|||||||
u_int *nelp, width;
|
u_int *nelp, width;
|
||||||
int (*compar)(), add_flag;
|
int (*compar)(), add_flag;
|
||||||
{
|
{
|
||||||
register char *element, *end;
|
char *element, *end;
|
||||||
|
|
||||||
end = base + *nelp * width;
|
end = base + *nelp * width;
|
||||||
for (element = base; element < end; element += width)
|
for (element = base; element < end; element += width)
|
||||||
|
@ -34,6 +34,8 @@
|
|||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)remque.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)remque.c 8.1 (Berkeley) 6/4/93";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* remque -- vax remque instruction
|
* remque -- vax remque instruction
|
||||||
@ -48,7 +50,7 @@ struct vaxque { /* queue format expected by VAX queue instructions */
|
|||||||
|
|
||||||
void
|
void
|
||||||
remque(e)
|
remque(e)
|
||||||
register struct vaxque *e;
|
struct vaxque *e;
|
||||||
{
|
{
|
||||||
e->vq_prev->vq_next = e->vq_next;
|
e->vq_prev->vq_next = e->vq_next;
|
||||||
e->vq_next->vq_prev = e->vq_prev;
|
e->vq_next->vq_prev = e->vq_prev;
|
||||||
|
@ -34,6 +34,8 @@
|
|||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)cuserid.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)cuserid.c 8.1 (Berkeley) 6/4/93";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -44,7 +46,7 @@ char *
|
|||||||
cuserid(s)
|
cuserid(s)
|
||||||
char *s;
|
char *s;
|
||||||
{
|
{
|
||||||
register struct passwd *pwd;
|
struct passwd *pwd;
|
||||||
|
|
||||||
if ((pwd = getpwuid(geteuid())) == NULL) {
|
if ((pwd = getpwuid(geteuid())) == NULL) {
|
||||||
if (s)
|
if (s)
|
||||||
|
@ -32,6 +32,10 @@
|
|||||||
* precedence is structured in regular expressions. Serious changes in
|
* precedence is structured in regular expressions. Serious changes in
|
||||||
* regular-expression syntax might require a total rethink.
|
* regular-expression syntax might require a total rethink.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <regexp.h>
|
#include <regexp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -205,10 +209,10 @@ regexp *
|
|||||||
regcomp(exp)
|
regcomp(exp)
|
||||||
const char *exp;
|
const char *exp;
|
||||||
{
|
{
|
||||||
register regexp *r;
|
regexp *r;
|
||||||
register char *scan;
|
char *scan;
|
||||||
register char *longest;
|
char *longest;
|
||||||
register int len;
|
int len;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
if (exp == NULL)
|
if (exp == NULL)
|
||||||
@ -296,10 +300,10 @@ reg(paren, flagp)
|
|||||||
int paren; /* Parenthesized? */
|
int paren; /* Parenthesized? */
|
||||||
int *flagp;
|
int *flagp;
|
||||||
{
|
{
|
||||||
register char *ret;
|
char *ret;
|
||||||
register char *br;
|
char *br;
|
||||||
register char *ender;
|
char *ender;
|
||||||
register int parno;
|
int parno;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
*flagp = HASWIDTH; /* Tentatively. */
|
*flagp = HASWIDTH; /* Tentatively. */
|
||||||
@ -367,9 +371,9 @@ static char *
|
|||||||
regbranch(flagp)
|
regbranch(flagp)
|
||||||
int *flagp;
|
int *flagp;
|
||||||
{
|
{
|
||||||
register char *ret;
|
char *ret;
|
||||||
register char *chain;
|
char *chain;
|
||||||
register char *latest;
|
char *latest;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
*flagp = WORST; /* Tentatively. */
|
*flagp = WORST; /* Tentatively. */
|
||||||
@ -407,9 +411,9 @@ static char *
|
|||||||
regpiece(flagp)
|
regpiece(flagp)
|
||||||
int *flagp;
|
int *flagp;
|
||||||
{
|
{
|
||||||
register char *ret;
|
char *ret;
|
||||||
register char op;
|
char op;
|
||||||
register char *next;
|
char *next;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
ret = regatom(&flags);
|
ret = regatom(&flags);
|
||||||
@ -471,7 +475,7 @@ static char *
|
|||||||
regatom(flagp)
|
regatom(flagp)
|
||||||
int *flagp;
|
int *flagp;
|
||||||
{
|
{
|
||||||
register char *ret;
|
char *ret;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
*flagp = WORST; /* Tentatively. */
|
*flagp = WORST; /* Tentatively. */
|
||||||
@ -489,8 +493,8 @@ int *flagp;
|
|||||||
*flagp |= HASWIDTH|SIMPLE;
|
*flagp |= HASWIDTH|SIMPLE;
|
||||||
break;
|
break;
|
||||||
case '[': {
|
case '[': {
|
||||||
register int class;
|
int class;
|
||||||
register int classend;
|
int classend;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (*regparse == '^') { /* Complement of range. */
|
if (*regparse == '^') { /* Complement of range. */
|
||||||
@ -597,7 +601,7 @@ int *flagp;
|
|||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
char *regprev;
|
char *regprev;
|
||||||
register char ch;
|
char ch;
|
||||||
|
|
||||||
regparse--; /* Look at cur char */
|
regparse--; /* Look at cur char */
|
||||||
ret = regnode(EXACTLY);
|
ret = regnode(EXACTLY);
|
||||||
@ -661,8 +665,8 @@ static char * /* Location. */
|
|||||||
regnode(op)
|
regnode(op)
|
||||||
char op;
|
char op;
|
||||||
{
|
{
|
||||||
register char *ret;
|
char *ret;
|
||||||
register char *ptr;
|
char *ptr;
|
||||||
|
|
||||||
ret = regcode;
|
ret = regcode;
|
||||||
if (ret == ®dummy) {
|
if (ret == ®dummy) {
|
||||||
@ -702,9 +706,9 @@ reginsert(op, opnd)
|
|||||||
char op;
|
char op;
|
||||||
char *opnd;
|
char *opnd;
|
||||||
{
|
{
|
||||||
register char *src;
|
char *src;
|
||||||
register char *dst;
|
char *dst;
|
||||||
register char *place;
|
char *place;
|
||||||
|
|
||||||
if (regcode == ®dummy) {
|
if (regcode == ®dummy) {
|
||||||
regsize += 3;
|
regsize += 3;
|
||||||
@ -731,9 +735,9 @@ regtail(p, val)
|
|||||||
char *p;
|
char *p;
|
||||||
char *val;
|
char *val;
|
||||||
{
|
{
|
||||||
register char *scan;
|
char *scan;
|
||||||
register char *temp;
|
char *temp;
|
||||||
register int offset;
|
int offset;
|
||||||
|
|
||||||
if (p == ®dummy)
|
if (p == ®dummy)
|
||||||
return;
|
return;
|
||||||
@ -799,10 +803,10 @@ STATIC char *regprop();
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
regexec(prog, string)
|
regexec(prog, string)
|
||||||
register const regexp *prog;
|
const regexp *prog;
|
||||||
register const char *string;
|
const char *string;
|
||||||
{
|
{
|
||||||
register char *s;
|
char *s;
|
||||||
extern char *strchr();
|
extern char *strchr();
|
||||||
|
|
||||||
/* Be paranoid... */
|
/* Be paranoid... */
|
||||||
@ -864,9 +868,9 @@ regtry(prog, string)
|
|||||||
regexp *prog;
|
regexp *prog;
|
||||||
char *string;
|
char *string;
|
||||||
{
|
{
|
||||||
register int i;
|
int i;
|
||||||
register char **sp;
|
char **sp;
|
||||||
register char **ep;
|
char **ep;
|
||||||
|
|
||||||
reginput = string;
|
reginput = string;
|
||||||
regstartp = prog->startp;
|
regstartp = prog->startp;
|
||||||
@ -900,7 +904,7 @@ static int /* 0 failure, 1 success */
|
|||||||
regmatch(prog)
|
regmatch(prog)
|
||||||
char *prog;
|
char *prog;
|
||||||
{
|
{
|
||||||
register char *scan; /* Current node. */
|
char *scan; /* Current node. */
|
||||||
char *next; /* Next node. */
|
char *next; /* Next node. */
|
||||||
|
|
||||||
scan = prog;
|
scan = prog;
|
||||||
@ -945,8 +949,8 @@ char *prog;
|
|||||||
reginput++;
|
reginput++;
|
||||||
break;
|
break;
|
||||||
case EXACTLY: {
|
case EXACTLY: {
|
||||||
register int len;
|
int len;
|
||||||
register char *opnd;
|
char *opnd;
|
||||||
|
|
||||||
opnd = OPERAND(scan);
|
opnd = OPERAND(scan);
|
||||||
/* Inline the first character, for speed. */
|
/* Inline the first character, for speed. */
|
||||||
@ -981,8 +985,8 @@ char *prog;
|
|||||||
case OPEN+7:
|
case OPEN+7:
|
||||||
case OPEN+8:
|
case OPEN+8:
|
||||||
case OPEN+9: {
|
case OPEN+9: {
|
||||||
register int no;
|
int no;
|
||||||
register char *save;
|
char *save;
|
||||||
|
|
||||||
no = OP(scan) - OPEN;
|
no = OP(scan) - OPEN;
|
||||||
save = reginput;
|
save = reginput;
|
||||||
@ -1009,8 +1013,8 @@ char *prog;
|
|||||||
case CLOSE+7:
|
case CLOSE+7:
|
||||||
case CLOSE+8:
|
case CLOSE+8:
|
||||||
case CLOSE+9: {
|
case CLOSE+9: {
|
||||||
register int no;
|
int no;
|
||||||
register char *save;
|
char *save;
|
||||||
|
|
||||||
no = OP(scan) - CLOSE;
|
no = OP(scan) - CLOSE;
|
||||||
save = reginput;
|
save = reginput;
|
||||||
@ -1029,7 +1033,7 @@ char *prog;
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BRANCH: {
|
case BRANCH: {
|
||||||
register char *save;
|
char *save;
|
||||||
|
|
||||||
if (OP(next) != BRANCH) /* No choice. */
|
if (OP(next) != BRANCH) /* No choice. */
|
||||||
next = OPERAND(scan); /* Avoid recursion. */
|
next = OPERAND(scan); /* Avoid recursion. */
|
||||||
@ -1048,10 +1052,10 @@ char *prog;
|
|||||||
break;
|
break;
|
||||||
case STAR:
|
case STAR:
|
||||||
case PLUS: {
|
case PLUS: {
|
||||||
register char nextch;
|
char nextch;
|
||||||
register int no;
|
int no;
|
||||||
register char *save;
|
char *save;
|
||||||
register int min;
|
int min;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lookahead to avoid useless match attempts
|
* Lookahead to avoid useless match attempts
|
||||||
@ -1102,9 +1106,9 @@ static int
|
|||||||
regrepeat(p)
|
regrepeat(p)
|
||||||
char *p;
|
char *p;
|
||||||
{
|
{
|
||||||
register int count = 0;
|
int count = 0;
|
||||||
register char *scan;
|
char *scan;
|
||||||
register char *opnd;
|
char *opnd;
|
||||||
|
|
||||||
scan = reginput;
|
scan = reginput;
|
||||||
opnd = OPERAND(p);
|
opnd = OPERAND(p);
|
||||||
@ -1146,9 +1150,9 @@ char *p;
|
|||||||
*/
|
*/
|
||||||
static char *
|
static char *
|
||||||
regnext(p)
|
regnext(p)
|
||||||
register char *p;
|
char *p;
|
||||||
{
|
{
|
||||||
register int offset;
|
int offset;
|
||||||
|
|
||||||
if (p == ®dummy)
|
if (p == ®dummy)
|
||||||
return(NULL);
|
return(NULL);
|
||||||
@ -1174,9 +1178,9 @@ void
|
|||||||
regdump(r)
|
regdump(r)
|
||||||
regexp *r;
|
regexp *r;
|
||||||
{
|
{
|
||||||
register char *s;
|
char *s;
|
||||||
register char op = EXACTLY; /* Arbitrary non-END op. */
|
char op = EXACTLY; /* Arbitrary non-END op. */
|
||||||
register char *next;
|
char *next;
|
||||||
extern char *strchr();
|
extern char *strchr();
|
||||||
|
|
||||||
|
|
||||||
@ -1218,7 +1222,7 @@ static char *
|
|||||||
regprop(op)
|
regprop(op)
|
||||||
char *op;
|
char *op;
|
||||||
{
|
{
|
||||||
register char *p;
|
char *p;
|
||||||
static char buf[50];
|
static char buf[50];
|
||||||
|
|
||||||
(void) strcpy(buf, ":");
|
(void) strcpy(buf, ":");
|
||||||
@ -1317,9 +1321,9 @@ strcspn(s1, s2)
|
|||||||
char *s1;
|
char *s1;
|
||||||
char *s2;
|
char *s2;
|
||||||
{
|
{
|
||||||
register char *scan1;
|
char *scan1;
|
||||||
register char *scan2;
|
char *scan2;
|
||||||
register int count;
|
int count;
|
||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
for (scan1 = s1; *scan1 != '\0'; scan1++) {
|
for (scan1 = s1; *scan1 != '\0'; scan1++) {
|
||||||
|
@ -18,6 +18,10 @@
|
|||||||
* 3. Altered versions must be plainly marked as such, and must not
|
* 3. Altered versions must be plainly marked as such, and must not
|
||||||
* be misrepresented as being the original software.
|
* be misrepresented as being the original software.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <regexp.h>
|
#include <regexp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -38,11 +42,11 @@ const regexp *prog;
|
|||||||
const char *source;
|
const char *source;
|
||||||
char *dest;
|
char *dest;
|
||||||
{
|
{
|
||||||
register char *src;
|
char *src;
|
||||||
register char *dst;
|
char *dst;
|
||||||
register char c;
|
char c;
|
||||||
register int no;
|
int no;
|
||||||
register int len;
|
int len;
|
||||||
extern char *strncpy();
|
extern char *strncpy();
|
||||||
|
|
||||||
if (prog == NULL || source == NULL || dest == NULL) {
|
if (prog == NULL || source == NULL || dest == NULL) {
|
||||||
|
@ -516,7 +516,7 @@ devstat_selectdevs(struct device_selection **dev_select, int *num_selected,
|
|||||||
devstat_select_mode select_mode, int maxshowdevs,
|
devstat_select_mode select_mode, int maxshowdevs,
|
||||||
int perf_select)
|
int perf_select)
|
||||||
{
|
{
|
||||||
register int i, j, k;
|
int i, j, k;
|
||||||
int init_selections = 0, init_selected_var = 0;
|
int init_selections = 0, init_selected_var = 0;
|
||||||
struct device_selection *old_dev_select = NULL;
|
struct device_selection *old_dev_select = NULL;
|
||||||
int old_num_selections = 0, old_num_selected;
|
int old_num_selections = 0, old_num_selected;
|
||||||
@ -979,7 +979,7 @@ devstat_buildmatch(char *match_str, struct devstat_match **matches,
|
|||||||
char *tstr[5];
|
char *tstr[5];
|
||||||
char **tempstr;
|
char **tempstr;
|
||||||
int num_args;
|
int num_args;
|
||||||
register int i, j;
|
int i, j;
|
||||||
const char *func_name = "devstat_buildmatch";
|
const char *func_name = "devstat_buildmatch";
|
||||||
|
|
||||||
/* We can't do much without a string to parse */
|
/* We can't do much without a string to parse */
|
||||||
|
@ -104,7 +104,7 @@ Field(buf, out, len)
|
|||||||
u_char *out;
|
u_char *out;
|
||||||
int len;
|
int len;
|
||||||
{
|
{
|
||||||
register char *bp = buf;
|
char *bp = buf;
|
||||||
int i, ibase, base16 = 0, base10 = 0, clen = 0;
|
int i, ibase, base16 = 0, base10 = 0, clen = 0;
|
||||||
int hb[6], *hp;
|
int hb[6], *hp;
|
||||||
char *fmt;
|
char *fmt;
|
||||||
|
@ -50,9 +50,9 @@ ipx_ntoa(addr)
|
|||||||
static char obuf[40];
|
static char obuf[40];
|
||||||
union { union ipx_net net_e; u_long long_e; } net;
|
union { union ipx_net net_e; u_long long_e; } net;
|
||||||
u_short port = htons(addr.x_port);
|
u_short port = htons(addr.x_port);
|
||||||
register char *cp;
|
char *cp;
|
||||||
char *cp2;
|
char *cp2;
|
||||||
register u_char *up = addr.x_host.c_host;
|
u_char *up = addr.x_host.c_host;
|
||||||
u_char *uplim = up + 6;
|
u_char *uplim = up + 6;
|
||||||
static char *spectHex();
|
static char *spectHex();
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ spectHex(p0)
|
|||||||
{
|
{
|
||||||
int ok = 0;
|
int ok = 0;
|
||||||
int nonzero = 0;
|
int nonzero = 0;
|
||||||
register char *p = p0;
|
char *p = p0;
|
||||||
for (; *p; p++) switch (*p) {
|
for (; *p; p++) switch (*p) {
|
||||||
|
|
||||||
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
|
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
|
||||||
|
@ -132,7 +132,7 @@ _kvm_syserr(kd, program, fmt, va_alist)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
register int n;
|
int n;
|
||||||
|
|
||||||
#if __STDC__
|
#if __STDC__
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
@ -144,7 +144,7 @@ _kvm_syserr(kd, program, fmt, va_alist)
|
|||||||
(void)vfprintf(stderr, fmt, ap);
|
(void)vfprintf(stderr, fmt, ap);
|
||||||
(void)fprintf(stderr, ": %s\n", strerror(errno));
|
(void)fprintf(stderr, ": %s\n", strerror(errno));
|
||||||
} else {
|
} else {
|
||||||
register char *cp = kd->errbuf;
|
char *cp = kd->errbuf;
|
||||||
|
|
||||||
(void)vsnprintf(cp, sizeof(kd->errbuf), (char *)fmt, ap);
|
(void)vsnprintf(cp, sizeof(kd->errbuf), (char *)fmt, ap);
|
||||||
n = strlen(cp);
|
n = strlen(cp);
|
||||||
@ -156,8 +156,8 @@ _kvm_syserr(kd, program, fmt, va_alist)
|
|||||||
|
|
||||||
void *
|
void *
|
||||||
_kvm_malloc(kd, n)
|
_kvm_malloc(kd, n)
|
||||||
register kvm_t *kd;
|
kvm_t *kd;
|
||||||
register size_t n;
|
size_t n;
|
||||||
{
|
{
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ _kvm_malloc(kd, n)
|
|||||||
|
|
||||||
static kvm_t *
|
static kvm_t *
|
||||||
_kvm_open(kd, uf, mf, flag, errout)
|
_kvm_open(kd, uf, mf, flag, errout)
|
||||||
register kvm_t *kd;
|
kvm_t *kd;
|
||||||
const char *uf;
|
const char *uf;
|
||||||
const char *mf;
|
const char *mf;
|
||||||
int flag;
|
int flag;
|
||||||
@ -257,7 +257,7 @@ kvm_openfiles(uf, mf, sf, flag, errout)
|
|||||||
int flag;
|
int flag;
|
||||||
char *errout;
|
char *errout;
|
||||||
{
|
{
|
||||||
register kvm_t *kd;
|
kvm_t *kd;
|
||||||
|
|
||||||
if ((kd = malloc(sizeof(*kd))) == NULL) {
|
if ((kd = malloc(sizeof(*kd))) == NULL) {
|
||||||
(void)strlcpy(errout, strerror(errno), _POSIX2_LINE_MAX);
|
(void)strlcpy(errout, strerror(errno), _POSIX2_LINE_MAX);
|
||||||
@ -276,7 +276,7 @@ kvm_open(uf, mf, sf, flag, errstr)
|
|||||||
int flag;
|
int flag;
|
||||||
const char *errstr;
|
const char *errstr;
|
||||||
{
|
{
|
||||||
register kvm_t *kd;
|
kvm_t *kd;
|
||||||
|
|
||||||
if ((kd = malloc(sizeof(*kd))) == NULL) {
|
if ((kd = malloc(sizeof(*kd))) == NULL) {
|
||||||
if (errstr != NULL)
|
if (errstr != NULL)
|
||||||
@ -293,7 +293,7 @@ int
|
|||||||
kvm_close(kd)
|
kvm_close(kd)
|
||||||
kvm_t *kd;
|
kvm_t *kd;
|
||||||
{
|
{
|
||||||
register int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
if (kd->pmfd >= 0)
|
if (kd->pmfd >= 0)
|
||||||
error |= close(kd->pmfd);
|
error |= close(kd->pmfd);
|
||||||
@ -317,8 +317,8 @@ kvm_nlist(kd, nl)
|
|||||||
kvm_t *kd;
|
kvm_t *kd;
|
||||||
struct nlist *nl;
|
struct nlist *nl;
|
||||||
{
|
{
|
||||||
register struct nlist *p;
|
struct nlist *p;
|
||||||
register int nvalid;
|
int nvalid;
|
||||||
struct kld_sym_lookup lookup;
|
struct kld_sym_lookup lookup;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -360,12 +360,12 @@ kvm_nlist(kd, nl)
|
|||||||
ssize_t
|
ssize_t
|
||||||
kvm_read(kd, kva, buf, len)
|
kvm_read(kd, kva, buf, len)
|
||||||
kvm_t *kd;
|
kvm_t *kd;
|
||||||
register u_long kva;
|
u_long kva;
|
||||||
register void *buf;
|
void *buf;
|
||||||
register size_t len;
|
size_t len;
|
||||||
{
|
{
|
||||||
register int cc;
|
int cc;
|
||||||
register void *cp;
|
void *cp;
|
||||||
|
|
||||||
if (ISALIVE(kd)) {
|
if (ISALIVE(kd)) {
|
||||||
/*
|
/*
|
||||||
@ -424,11 +424,11 @@ kvm_read(kd, kva, buf, len)
|
|||||||
ssize_t
|
ssize_t
|
||||||
kvm_write(kd, kva, buf, len)
|
kvm_write(kd, kva, buf, len)
|
||||||
kvm_t *kd;
|
kvm_t *kd;
|
||||||
register u_long kva;
|
u_long kva;
|
||||||
register const void *buf;
|
const void *buf;
|
||||||
register size_t len;
|
size_t len;
|
||||||
{
|
{
|
||||||
register int cc;
|
int cc;
|
||||||
|
|
||||||
if (ISALIVE(kd)) {
|
if (ISALIVE(kd)) {
|
||||||
/*
|
/*
|
||||||
|
@ -84,7 +84,7 @@ kvm_deadfiles(kd, op, arg, filehead_o, nfiles)
|
|||||||
{
|
{
|
||||||
int buflen = kd->arglen, n = 0;
|
int buflen = kd->arglen, n = 0;
|
||||||
struct file *fp;
|
struct file *fp;
|
||||||
register char *where = kd->argspc;
|
char *where = kd->argspc;
|
||||||
struct filelist filehead;
|
struct filelist filehead;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -108,7 +108,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
|
|||||||
struct kinfo_proc *bp;
|
struct kinfo_proc *bp;
|
||||||
int maxcnt;
|
int maxcnt;
|
||||||
{
|
{
|
||||||
register int cnt = 0;
|
int cnt = 0;
|
||||||
struct kinfo_proc kinfo_proc, *kp;
|
struct kinfo_proc kinfo_proc, *kp;
|
||||||
struct pgrp pgrp;
|
struct pgrp pgrp;
|
||||||
struct session sess;
|
struct session sess;
|
||||||
@ -358,8 +358,8 @@ kvm_deadprocs(kd, what, arg, a_allproc, a_zombproc, maxcnt)
|
|||||||
u_long a_zombproc;
|
u_long a_zombproc;
|
||||||
int maxcnt;
|
int maxcnt;
|
||||||
{
|
{
|
||||||
register struct kinfo_proc *bp = kd->procbase;
|
struct kinfo_proc *bp = kd->procbase;
|
||||||
register int acnt, zcnt;
|
int acnt, zcnt;
|
||||||
struct proc *p;
|
struct proc *p;
|
||||||
|
|
||||||
if (KREAD(kd, a_allproc, &p)) {
|
if (KREAD(kd, a_allproc, &p)) {
|
||||||
@ -505,14 +505,14 @@ static char **
|
|||||||
kvm_argv(kd, kp, addr, narg, maxcnt)
|
kvm_argv(kd, kp, addr, narg, maxcnt)
|
||||||
kvm_t *kd;
|
kvm_t *kd;
|
||||||
struct kinfo_proc *kp;
|
struct kinfo_proc *kp;
|
||||||
register u_long addr;
|
u_long addr;
|
||||||
register int narg;
|
int narg;
|
||||||
register int maxcnt;
|
int maxcnt;
|
||||||
{
|
{
|
||||||
register char *np, *cp, *ep, *ap;
|
char *np, *cp, *ep, *ap;
|
||||||
register u_long oaddr = -1;
|
u_long oaddr = -1;
|
||||||
register int len, cc;
|
int len, cc;
|
||||||
register char **argv;
|
char **argv;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check that there aren't an unreasonable number of agruments,
|
* Check that there aren't an unreasonable number of agruments,
|
||||||
@ -620,9 +620,9 @@ kvm_argv(kd, kp, addr, narg, maxcnt)
|
|||||||
|
|
||||||
/* will we exceed the malloc/realloced buffer? */
|
/* will we exceed the malloc/realloced buffer? */
|
||||||
if (len + cc > kd->arglen) {
|
if (len + cc > kd->arglen) {
|
||||||
register int off;
|
int off;
|
||||||
register char **pp;
|
char **pp;
|
||||||
register char *op = kd->argspc;
|
char *op = kd->argspc;
|
||||||
|
|
||||||
kd->arglen *= 2;
|
kd->arglen *= 2;
|
||||||
kd->argspc = (char *)_kvm_realloc(kd, kd->argspc,
|
kd->argspc = (char *)_kvm_realloc(kd, kd->argspc,
|
||||||
@ -843,11 +843,11 @@ ssize_t
|
|||||||
kvm_uread(kd, kp, uva, buf, len)
|
kvm_uread(kd, kp, uva, buf, len)
|
||||||
kvm_t *kd;
|
kvm_t *kd;
|
||||||
struct kinfo_proc *kp;
|
struct kinfo_proc *kp;
|
||||||
register u_long uva;
|
u_long uva;
|
||||||
register char *buf;
|
char *buf;
|
||||||
register size_t len;
|
size_t len;
|
||||||
{
|
{
|
||||||
register char *cp;
|
char *cp;
|
||||||
char procfile[MAXPATHLEN];
|
char procfile[MAXPATHLEN];
|
||||||
ssize_t amount;
|
ssize_t amount;
|
||||||
int fd;
|
int fd;
|
||||||
|
@ -92,9 +92,9 @@ int
|
|||||||
_kvm_initvtop(kd)
|
_kvm_initvtop(kd)
|
||||||
kvm_t *kd;
|
kvm_t *kd;
|
||||||
{
|
{
|
||||||
register int i;
|
int i;
|
||||||
register int off;
|
int off;
|
||||||
register struct vmstate *vm;
|
struct vmstate *vm;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
struct nlist nlist[2];
|
struct nlist nlist[2];
|
||||||
|
|
||||||
@ -168,8 +168,8 @@ _kvm_uvatop(kd, p, va, pa)
|
|||||||
u_long *pa;
|
u_long *pa;
|
||||||
{
|
{
|
||||||
int kva, pte;
|
int kva, pte;
|
||||||
register int off, frame;
|
int off, frame;
|
||||||
register struct vmspace *vms = p->p_vmspace;
|
struct vmspace *vms = p->p_vmspace;
|
||||||
|
|
||||||
if ((u_long)vms < KERNBASE) {
|
if ((u_long)vms < KERNBASE) {
|
||||||
_kvm_err(kd, kd->program, "_kvm_uvatop: corrupt proc");
|
_kvm_err(kd, kd->program, "_kvm_uvatop: corrupt proc");
|
||||||
@ -218,10 +218,10 @@ _kvm_kvatop(kd, va, pa)
|
|||||||
u_long va;
|
u_long va;
|
||||||
u_long *pa;
|
u_long *pa;
|
||||||
{
|
{
|
||||||
register struct vmstate *vm;
|
struct vmstate *vm;
|
||||||
register int s;
|
int s;
|
||||||
register int pte;
|
int pte;
|
||||||
register int off;
|
int off;
|
||||||
|
|
||||||
if (va >= KERNBASE) {
|
if (va >= KERNBASE) {
|
||||||
vm = kd->vmst;
|
vm = kd->vmst;
|
||||||
|
@ -106,7 +106,7 @@ RIPEMD160_CTX *c;
|
|||||||
const unsigned char *data;
|
const unsigned char *data;
|
||||||
size_t len;
|
size_t len;
|
||||||
{
|
{
|
||||||
register u_int32_t *p;
|
u_int32_t *p;
|
||||||
int sw,sc;
|
int sw,sc;
|
||||||
u_int32_t l;
|
u_int32_t l;
|
||||||
|
|
||||||
@ -276,7 +276,7 @@ RIPEMD160_CTX *ctx;
|
|||||||
const u_int32_t *X;
|
const u_int32_t *X;
|
||||||
int num;
|
int num;
|
||||||
{
|
{
|
||||||
register u_int32_t A,B,C,D,E;
|
u_int32_t A,B,C,D,E;
|
||||||
u_int32_t a,b,c,d,e;
|
u_int32_t a,b,c,d,e;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
@ -475,9 +475,9 @@ void RIPEMD160_Final(md, c)
|
|||||||
unsigned char *md;
|
unsigned char *md;
|
||||||
RIPEMD160_CTX *c;
|
RIPEMD160_CTX *c;
|
||||||
{
|
{
|
||||||
register int i,j;
|
int i,j;
|
||||||
register u_int32_t l;
|
u_int32_t l;
|
||||||
register u_int32_t *p;
|
u_int32_t *p;
|
||||||
static unsigned char end[4]={0x80,0x00,0x00,0x00};
|
static unsigned char end[4]={0x80,0x00,0x00,0x00};
|
||||||
unsigned char *cp=end;
|
unsigned char *cp=end;
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ SHA_CTX *c;
|
|||||||
const unsigned char *data;
|
const unsigned char *data;
|
||||||
size_t len;
|
size_t len;
|
||||||
{
|
{
|
||||||
register u_int32_t *p;
|
u_int32_t *p;
|
||||||
int ew,ec,sw,sc;
|
int ew,ec,sw,sc;
|
||||||
u_int32_t l;
|
u_int32_t l;
|
||||||
|
|
||||||
@ -290,7 +290,7 @@ SHA_CTX *c;
|
|||||||
const u_int32_t *W;
|
const u_int32_t *W;
|
||||||
int num;
|
int num;
|
||||||
{
|
{
|
||||||
register u_int32_t A,B,C,D,E,T;
|
u_int32_t A,B,C,D,E,T;
|
||||||
u_int32_t X[16];
|
u_int32_t X[16];
|
||||||
|
|
||||||
A=c->h0;
|
A=c->h0;
|
||||||
@ -408,9 +408,9 @@ void SHA_Final(md, c)
|
|||||||
unsigned char *md;
|
unsigned char *md;
|
||||||
SHA_CTX *c;
|
SHA_CTX *c;
|
||||||
{
|
{
|
||||||
register int i,j;
|
int i,j;
|
||||||
register u_int32_t l;
|
u_int32_t l;
|
||||||
register u_int32_t *p;
|
u_int32_t *p;
|
||||||
static unsigned char end[4]={0x80,0x00,0x00,0x00};
|
static unsigned char end[4]={0x80,0x00,0x00,0x00};
|
||||||
unsigned char *cp=end;
|
unsigned char *cp=end;
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ SHA1_Update(c, data, len)
|
|||||||
const unsigned char *data;
|
const unsigned char *data;
|
||||||
size_t len;
|
size_t len;
|
||||||
{
|
{
|
||||||
register u_int32_t *p;
|
u_int32_t *p;
|
||||||
int ew,ec,sw,sc;
|
int ew,ec,sw,sc;
|
||||||
u_int32_t l;
|
u_int32_t l;
|
||||||
|
|
||||||
@ -321,7 +321,7 @@ sha1_block(c, W, num)
|
|||||||
const u_int32_t *W;
|
const u_int32_t *W;
|
||||||
int num;
|
int num;
|
||||||
{
|
{
|
||||||
register u_int32_t A,B,C,D,E,T;
|
u_int32_t A,B,C,D,E,T;
|
||||||
u_int32_t X[16];
|
u_int32_t X[16];
|
||||||
|
|
||||||
A=c->h0;
|
A=c->h0;
|
||||||
@ -440,9 +440,9 @@ void SHA1_Final(md, c)
|
|||||||
unsigned char *md;
|
unsigned char *md;
|
||||||
SHA_CTX *c;
|
SHA_CTX *c;
|
||||||
{
|
{
|
||||||
register int i,j;
|
int i,j;
|
||||||
register u_int32_t l;
|
u_int32_t l;
|
||||||
register u_int32_t *p;
|
u_int32_t *p;
|
||||||
static unsigned char end[4]={0x80,0x00,0x00,0x00};
|
static unsigned char end[4]={0x80,0x00,0x00,0x00};
|
||||||
unsigned char *cp=end;
|
unsigned char *cp=end;
|
||||||
|
|
||||||
|
@ -103,8 +103,8 @@ int
|
|||||||
_nc_read_termcap_entry(const char *const name, TERMTYPE *const tp)
|
_nc_read_termcap_entry(const char *const name, TERMTYPE *const tp)
|
||||||
{
|
{
|
||||||
ENTRY *ep;
|
ENTRY *ep;
|
||||||
register char *p;
|
char *p;
|
||||||
register char *cp;
|
char *cp;
|
||||||
char *dummy;
|
char *dummy;
|
||||||
char **fname;
|
char **fname;
|
||||||
char *home;
|
char *home;
|
||||||
|
@ -74,12 +74,12 @@ static ssize_t arprecv(struct iodesc *, void *, size_t, time_t);
|
|||||||
/* Broadcast an ARP packet, asking who has addr on interface d */
|
/* Broadcast an ARP packet, asking who has addr on interface d */
|
||||||
u_char *
|
u_char *
|
||||||
arpwhohas(d, addr)
|
arpwhohas(d, addr)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
struct in_addr addr;
|
struct in_addr addr;
|
||||||
{
|
{
|
||||||
register int i;
|
int i;
|
||||||
register struct ether_arp *ah;
|
struct ether_arp *ah;
|
||||||
register struct arp_list *al;
|
struct arp_list *al;
|
||||||
struct {
|
struct {
|
||||||
struct ether_header eh;
|
struct ether_header eh;
|
||||||
struct {
|
struct {
|
||||||
@ -152,9 +152,9 @@ arpwhohas(d, addr)
|
|||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
arpsend(d, pkt, len)
|
arpsend(d, pkt, len)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
register void *pkt;
|
void *pkt;
|
||||||
register size_t len;
|
size_t len;
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef ARP_DEBUG
|
#ifdef ARP_DEBUG
|
||||||
@ -171,13 +171,13 @@ arpsend(d, pkt, len)
|
|||||||
*/
|
*/
|
||||||
static ssize_t
|
static ssize_t
|
||||||
arprecv(d, pkt, len, tleft)
|
arprecv(d, pkt, len, tleft)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
register void *pkt;
|
void *pkt;
|
||||||
register size_t len;
|
size_t len;
|
||||||
time_t tleft;
|
time_t tleft;
|
||||||
{
|
{
|
||||||
register ssize_t n;
|
ssize_t n;
|
||||||
register struct ether_arp *ah;
|
struct ether_arp *ah;
|
||||||
u_int16_t etype; /* host order */
|
u_int16_t etype; /* host order */
|
||||||
|
|
||||||
#ifdef ARP_DEBUG
|
#ifdef ARP_DEBUG
|
||||||
@ -261,8 +261,8 @@ arprecv(d, pkt, len, tleft)
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
arp_reply(d, pkt)
|
arp_reply(d, pkt)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
register void *pkt; /* the request */
|
void *pkt; /* the request */
|
||||||
{
|
{
|
||||||
struct ether_arp *arp = pkt;
|
struct ether_arp *arp = pkt;
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ bootp(sock, flag)
|
|||||||
int flag;
|
int flag;
|
||||||
{
|
{
|
||||||
struct iodesc *d;
|
struct iodesc *d;
|
||||||
register struct bootp *bp;
|
struct bootp *bp;
|
||||||
struct {
|
struct {
|
||||||
u_char header[HEADER_SIZE];
|
u_char header[HEADER_SIZE];
|
||||||
struct bootp wbootp;
|
struct bootp wbootp;
|
||||||
@ -256,11 +256,11 @@ bootp(sock, flag)
|
|||||||
/* Transmit a bootp request */
|
/* Transmit a bootp request */
|
||||||
static ssize_t
|
static ssize_t
|
||||||
bootpsend(d, pkt, len)
|
bootpsend(d, pkt, len)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
register void *pkt;
|
void *pkt;
|
||||||
register size_t len;
|
size_t len;
|
||||||
{
|
{
|
||||||
register struct bootp *bp;
|
struct bootp *bp;
|
||||||
|
|
||||||
#ifdef BOOTP_DEBUG
|
#ifdef BOOTP_DEBUG
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -280,13 +280,13 @@ bootpsend(d, pkt, len)
|
|||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
bootprecv(d, pkt, len, tleft)
|
bootprecv(d, pkt, len, tleft)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
register void *pkt;
|
void *pkt;
|
||||||
register size_t len;
|
size_t len;
|
||||||
time_t tleft;
|
time_t tleft;
|
||||||
{
|
{
|
||||||
register ssize_t n;
|
ssize_t n;
|
||||||
register struct bootp *bp;
|
struct bootp *bp;
|
||||||
|
|
||||||
#ifdef BOOTP_DEBUGx
|
#ifdef BOOTP_DEBUGx
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -339,12 +339,12 @@ time_t tleft;
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
vend_rfc1048(cp, len)
|
vend_rfc1048(cp, len)
|
||||||
register u_char *cp;
|
u_char *cp;
|
||||||
u_int len;
|
u_int len;
|
||||||
{
|
{
|
||||||
register u_char *ep;
|
u_char *ep;
|
||||||
register int size;
|
int size;
|
||||||
register u_char tag;
|
u_char tag;
|
||||||
|
|
||||||
#ifdef BOOTP_DEBUG
|
#ifdef BOOTP_DEBUG
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -400,7 +400,7 @@ static void
|
|||||||
vend_cmu(cp)
|
vend_cmu(cp)
|
||||||
u_char *cp;
|
u_char *cp;
|
||||||
{
|
{
|
||||||
register struct cmu_vend *vp;
|
struct cmu_vend *vp;
|
||||||
|
|
||||||
#ifdef BOOTP_DEBUG
|
#ifdef BOOTP_DEBUG
|
||||||
if (debug)
|
if (debug)
|
||||||
|
@ -65,8 +65,8 @@ sendether(d, pkt, len, dea, etype)
|
|||||||
u_char *dea;
|
u_char *dea;
|
||||||
int etype;
|
int etype;
|
||||||
{
|
{
|
||||||
register ssize_t n;
|
ssize_t n;
|
||||||
register struct ether_header *eh;
|
struct ether_header *eh;
|
||||||
|
|
||||||
#ifdef ETHER_DEBUG
|
#ifdef ETHER_DEBUG
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -95,14 +95,14 @@ sendether(d, pkt, len, dea, etype)
|
|||||||
*/
|
*/
|
||||||
ssize_t
|
ssize_t
|
||||||
readether(d, pkt, len, tleft, etype)
|
readether(d, pkt, len, tleft, etype)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
register void *pkt;
|
void *pkt;
|
||||||
register size_t len;
|
size_t len;
|
||||||
time_t tleft;
|
time_t tleft;
|
||||||
register u_int16_t *etype;
|
u_int16_t *etype;
|
||||||
{
|
{
|
||||||
register ssize_t n;
|
ssize_t n;
|
||||||
register struct ether_header *eh;
|
struct ether_header *eh;
|
||||||
|
|
||||||
#ifdef ETHER_DEBUG
|
#ifdef ETHER_DEBUG
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -138,11 +138,11 @@ readether(d, pkt, len, tleft, etype)
|
|||||||
static char digits[] = "0123456789abcdef";
|
static char digits[] = "0123456789abcdef";
|
||||||
char *
|
char *
|
||||||
ether_sprintf(ap)
|
ether_sprintf(ap)
|
||||||
register u_char *ap;
|
u_char *ap;
|
||||||
{
|
{
|
||||||
register int i;
|
int i;
|
||||||
static char etherbuf[18];
|
static char etherbuf[18];
|
||||||
register char *cp = etherbuf;
|
char *cp = etherbuf;
|
||||||
|
|
||||||
for (i = 0; i < 6; i++) {
|
for (i = 0; i < 6; i++) {
|
||||||
*cp++ = digits[*ap >> 4];
|
*cp++ = digits[*ap >> 4];
|
||||||
|
@ -45,7 +45,7 @@ fstat(fd, sb)
|
|||||||
int fd;
|
int fd;
|
||||||
struct stat *sb;
|
struct stat *sb;
|
||||||
{
|
{
|
||||||
register struct open_file *f = &files[fd];
|
struct open_file *f = &files[fd];
|
||||||
|
|
||||||
if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) {
|
if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) {
|
||||||
errno = EBADF;
|
errno = EBADF;
|
||||||
|
@ -45,8 +45,8 @@ __FBSDID("$FreeBSD$");
|
|||||||
void
|
void
|
||||||
ngets(char *buf, int n)
|
ngets(char *buf, int n)
|
||||||
{
|
{
|
||||||
register int c;
|
int c;
|
||||||
register char *lp;
|
char *lp;
|
||||||
|
|
||||||
for (lp = buf;;)
|
for (lp = buf;;)
|
||||||
switch (c = getchar() & 0177) {
|
switch (c = getchar() & 0177) {
|
||||||
@ -65,7 +65,7 @@ ngets(char *buf, int n)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'r'&037: {
|
case 'r'&037: {
|
||||||
register char *p;
|
char *p;
|
||||||
|
|
||||||
putchar('\n');
|
putchar('\n');
|
||||||
for (p = buf; p < lp; ++p)
|
for (p = buf; p < lp; ++p)
|
||||||
|
@ -52,11 +52,11 @@ __FBSDID("$FreeBSD$");
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
in_cksum(p, len)
|
in_cksum(p, len)
|
||||||
register void *p;
|
void *p;
|
||||||
register int len;
|
int len;
|
||||||
{
|
{
|
||||||
register int sum = 0, oddbyte = 0, v = 0;
|
int sum = 0, oddbyte = 0, v = 0;
|
||||||
register u_char *cp = p;
|
u_char *cp = p;
|
||||||
|
|
||||||
/* we assume < 2^16 bytes being summed */
|
/* we assume < 2^16 bytes being summed */
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
|
@ -75,7 +75,7 @@ ioctl(fd, cmd, arg)
|
|||||||
u_long cmd;
|
u_long cmd;
|
||||||
char *arg;
|
char *arg;
|
||||||
{
|
{
|
||||||
register struct open_file *f = &files[fd];
|
struct open_file *f = &files[fd];
|
||||||
|
|
||||||
if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) {
|
if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) {
|
||||||
errno = EBADF;
|
errno = EBADF;
|
||||||
|
@ -73,16 +73,16 @@ __FBSDID("$FreeBSD$");
|
|||||||
*/
|
*/
|
||||||
ssize_t
|
ssize_t
|
||||||
sendrecv(d, sproc, sbuf, ssize, rproc, rbuf, rsize)
|
sendrecv(d, sproc, sbuf, ssize, rproc, rbuf, rsize)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
register ssize_t (*sproc)(struct iodesc *, void *, size_t);
|
ssize_t (*sproc)(struct iodesc *, void *, size_t);
|
||||||
register void *sbuf;
|
void *sbuf;
|
||||||
register size_t ssize;
|
size_t ssize;
|
||||||
register ssize_t (*rproc)(struct iodesc *, void *, size_t, time_t);
|
ssize_t (*rproc)(struct iodesc *, void *, size_t, time_t);
|
||||||
register void *rbuf;
|
void *rbuf;
|
||||||
register size_t rsize;
|
size_t rsize;
|
||||||
{
|
{
|
||||||
register ssize_t cc;
|
ssize_t cc;
|
||||||
register time_t t, tmo, tlast;
|
time_t t, tmo, tlast;
|
||||||
long tleft;
|
long tleft;
|
||||||
|
|
||||||
#ifdef NET_DEBUG
|
#ifdef NET_DEBUG
|
||||||
@ -140,11 +140,11 @@ n_long
|
|||||||
inet_addr(cp)
|
inet_addr(cp)
|
||||||
char *cp;
|
char *cp;
|
||||||
{
|
{
|
||||||
register u_long val;
|
u_long val;
|
||||||
register int n;
|
int n;
|
||||||
register char c;
|
char c;
|
||||||
u_int parts[4];
|
u_int parts[4];
|
||||||
register u_int *pp = parts;
|
u_int *pp = parts;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
/*
|
/*
|
||||||
@ -224,11 +224,11 @@ inet_ntoa(ia)
|
|||||||
/* Similar to inet_ntoa() */
|
/* Similar to inet_ntoa() */
|
||||||
char *
|
char *
|
||||||
intoa(addr)
|
intoa(addr)
|
||||||
register n_long addr;
|
n_long addr;
|
||||||
{
|
{
|
||||||
register char *cp;
|
char *cp;
|
||||||
register u_int byte;
|
u_int byte;
|
||||||
register int n;
|
int n;
|
||||||
static char buf[17]; /* strlen(".255.255.255.255") + 1 */
|
static char buf[17]; /* strlen(".255.255.255.255") + 1 */
|
||||||
|
|
||||||
addr = ntohl(addr);
|
addr = ntohl(addr);
|
||||||
|
@ -293,7 +293,7 @@ netif_open(machdep_hint)
|
|||||||
void *machdep_hint;
|
void *machdep_hint;
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
register struct iodesc *s;
|
struct iodesc *s;
|
||||||
struct netif *nif;
|
struct netif *nif;
|
||||||
|
|
||||||
/* find a free socket */
|
/* find a free socket */
|
||||||
|
@ -148,11 +148,11 @@ struct fs_ops nfs_fsops = {
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
nfs_getrootfh(d, path, fhp)
|
nfs_getrootfh(d, path, fhp)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
char *path;
|
char *path;
|
||||||
u_char *fhp;
|
u_char *fhp;
|
||||||
{
|
{
|
||||||
register int len;
|
int len;
|
||||||
struct args {
|
struct args {
|
||||||
n_long len;
|
n_long len;
|
||||||
char path[FNAME_SIZE];
|
char path[FNAME_SIZE];
|
||||||
@ -211,7 +211,7 @@ nfs_lookupfh(d, name, newfd)
|
|||||||
const char *name;
|
const char *name;
|
||||||
struct nfs_iodesc *newfd;
|
struct nfs_iodesc *newfd;
|
||||||
{
|
{
|
||||||
register int len, rlen;
|
int len, rlen;
|
||||||
struct args {
|
struct args {
|
||||||
u_char fh[NFS_FHSIZE];
|
u_char fh[NFS_FHSIZE];
|
||||||
n_long len;
|
n_long len;
|
||||||
@ -390,8 +390,8 @@ nfs_open(upath, f)
|
|||||||
#ifndef NFS_NOSYMLINK
|
#ifndef NFS_NOSYMLINK
|
||||||
struct nfs_iodesc *newfd;
|
struct nfs_iodesc *newfd;
|
||||||
struct nfsv2_fattrs *fa;
|
struct nfsv2_fattrs *fa;
|
||||||
register char *cp, *ncp;
|
char *cp, *ncp;
|
||||||
register int c;
|
int c;
|
||||||
char namebuf[NFS_MAXPATHLEN + 1];
|
char namebuf[NFS_MAXPATHLEN + 1];
|
||||||
char linkbuf[NFS_MAXPATHLEN + 1];
|
char linkbuf[NFS_MAXPATHLEN + 1];
|
||||||
int nlinks = 0;
|
int nlinks = 0;
|
||||||
@ -459,7 +459,7 @@ nfs_open(upath, f)
|
|||||||
* Get next component of path name.
|
* Get next component of path name.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
register int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
ncp = cp;
|
ncp = cp;
|
||||||
while ((c = *cp) != '\0' && c != '/') {
|
while ((c = *cp) != '\0' && c != '/') {
|
||||||
@ -560,7 +560,7 @@ int
|
|||||||
nfs_close(f)
|
nfs_close(f)
|
||||||
struct open_file *f;
|
struct open_file *f;
|
||||||
{
|
{
|
||||||
register struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;
|
struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;
|
||||||
|
|
||||||
#ifdef NFS_DEBUG
|
#ifdef NFS_DEBUG
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -584,9 +584,9 @@ nfs_read(f, buf, size, resid)
|
|||||||
size_t size;
|
size_t size;
|
||||||
size_t *resid; /* out */
|
size_t *resid; /* out */
|
||||||
{
|
{
|
||||||
register struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;
|
struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;
|
||||||
register ssize_t cc;
|
ssize_t cc;
|
||||||
register char *addr = buf;
|
char *addr = buf;
|
||||||
|
|
||||||
#ifdef NFS_DEBUG
|
#ifdef NFS_DEBUG
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -641,7 +641,7 @@ nfs_seek(f, offset, where)
|
|||||||
off_t offset;
|
off_t offset;
|
||||||
int where;
|
int where;
|
||||||
{
|
{
|
||||||
register struct nfs_iodesc *d = (struct nfs_iodesc *)f->f_fsdata;
|
struct nfs_iodesc *d = (struct nfs_iodesc *)f->f_fsdata;
|
||||||
n_long size = ntohl(d->fa.fa_size);
|
n_long size = ntohl(d->fa.fa_size);
|
||||||
|
|
||||||
switch (where) {
|
switch (where) {
|
||||||
@ -671,7 +671,7 @@ nfs_stat(f, sb)
|
|||||||
struct stat *sb;
|
struct stat *sb;
|
||||||
{
|
{
|
||||||
struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;
|
struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;
|
||||||
register n_long ftype, mode;
|
n_long ftype, mode;
|
||||||
|
|
||||||
ftype = ntohl(fp->fa.fa_type);
|
ftype = ntohl(fp->fa.fa_type);
|
||||||
mode = ntohl(fp->fa.fa_mode);
|
mode = ntohl(fp->fa.fa_mode);
|
||||||
@ -689,7 +689,7 @@ nfs_stat(f, sb)
|
|||||||
static int
|
static int
|
||||||
nfs_readdir(struct open_file *f, struct dirent *d)
|
nfs_readdir(struct open_file *f, struct dirent *d)
|
||||||
{
|
{
|
||||||
register struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;
|
struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;
|
||||||
struct nfs_readdir_args *args;
|
struct nfs_readdir_args *args;
|
||||||
struct nfs_readdir_data *rd;
|
struct nfs_readdir_data *rd;
|
||||||
struct nfs_readdir_off *roff = NULL;
|
struct nfs_readdir_off *roff = NULL;
|
||||||
|
@ -106,11 +106,11 @@ vsprintf(char *buf, const char *cfmt, va_list ap)
|
|||||||
*/
|
*/
|
||||||
static char *
|
static char *
|
||||||
ksprintn(ul, base, lenp)
|
ksprintn(ul, base, lenp)
|
||||||
register u_long ul;
|
u_long ul;
|
||||||
register int base, *lenp;
|
int base, *lenp;
|
||||||
{ /* A long in base 8, plus NULL. */
|
{ /* A long in base 8, plus NULL. */
|
||||||
static char buf[sizeof(long) * NBBY / 3 + 2];
|
static char buf[sizeof(long) * NBBY / 3 + 2];
|
||||||
register char *p;
|
char *p;
|
||||||
|
|
||||||
p = buf;
|
p = buf;
|
||||||
do {
|
do {
|
||||||
|
@ -65,9 +65,9 @@ typedef u_long digit;
|
|||||||
* We may assume len >= 0. NOTE THAT THIS WRITES len+1 DIGITS.
|
* We may assume len >= 0. NOTE THAT THIS WRITES len+1 DIGITS.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
shl(register digit *p, register int len, register int sh)
|
shl(digit *p, int len, int sh)
|
||||||
{
|
{
|
||||||
register int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
p[i] = LHALF(p[i] << sh) | (p[i + 1] >> (HALF_BITS - sh));
|
p[i] = LHALF(p[i] << sh) | (p[i + 1] >> (HALF_BITS - sh));
|
||||||
@ -88,7 +88,7 @@ __qdivrem(uq, vq, arq)
|
|||||||
{
|
{
|
||||||
union uu tmp;
|
union uu tmp;
|
||||||
digit *u, *v, *q;
|
digit *u, *v, *q;
|
||||||
register digit v1, v2;
|
digit v1, v2;
|
||||||
u_long qhat, rhat, t;
|
u_long qhat, rhat, t;
|
||||||
int m, n, d, j, i;
|
int m, n, d, j, i;
|
||||||
digit uspace[5], vspace[5], qspace[5];
|
digit uspace[5], vspace[5], qspace[5];
|
||||||
@ -198,7 +198,7 @@ __qdivrem(uq, vq, arq)
|
|||||||
v1 = v[1]; /* for D3 -- note that v[1..n] are constant */
|
v1 = v[1]; /* for D3 -- note that v[1..n] are constant */
|
||||||
v2 = v[2]; /* for D3 */
|
v2 = v[2]; /* for D3 */
|
||||||
do {
|
do {
|
||||||
register digit uj0, uj1, uj2;
|
digit uj0, uj1, uj2;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* D3: Calculate qhat (\^q, in TeX notation).
|
* D3: Calculate qhat (\^q, in TeX notation).
|
||||||
|
@ -55,7 +55,7 @@ srandom(seed)
|
|||||||
u_long
|
u_long
|
||||||
random()
|
random()
|
||||||
{
|
{
|
||||||
register long x, hi, lo, t;
|
long x, hi, lo, t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Compute x[n + 1] = (7^5 * x[n]) mod (2^31 - 1).
|
* Compute x[n + 1] = (7^5 * x[n]) mod (2^31 - 1).
|
||||||
|
@ -68,7 +68,7 @@ rarp_getipaddress(sock)
|
|||||||
int sock;
|
int sock;
|
||||||
{
|
{
|
||||||
struct iodesc *d;
|
struct iodesc *d;
|
||||||
register struct ether_arp *ap;
|
struct ether_arp *ap;
|
||||||
struct {
|
struct {
|
||||||
u_char header[ETHER_SIZE];
|
u_char header[ETHER_SIZE];
|
||||||
struct {
|
struct {
|
||||||
@ -139,9 +139,9 @@ rarp_getipaddress(sock)
|
|||||||
*/
|
*/
|
||||||
static ssize_t
|
static ssize_t
|
||||||
rarpsend(d, pkt, len)
|
rarpsend(d, pkt, len)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
register void *pkt;
|
void *pkt;
|
||||||
register size_t len;
|
size_t len;
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef RARP_DEBUG
|
#ifdef RARP_DEBUG
|
||||||
@ -158,13 +158,13 @@ rarpsend(d, pkt, len)
|
|||||||
*/
|
*/
|
||||||
static ssize_t
|
static ssize_t
|
||||||
rarprecv(d, pkt, len, tleft)
|
rarprecv(d, pkt, len, tleft)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
register void *pkt;
|
void *pkt;
|
||||||
register size_t len;
|
size_t len;
|
||||||
time_t tleft;
|
time_t tleft;
|
||||||
{
|
{
|
||||||
register ssize_t n;
|
ssize_t n;
|
||||||
register struct ether_arp *ap;
|
struct ether_arp *ap;
|
||||||
u_int16_t etype; /* host order */
|
u_int16_t etype; /* host order */
|
||||||
|
|
||||||
#ifdef RARP_DEBUG
|
#ifdef RARP_DEBUG
|
||||||
|
@ -113,14 +113,14 @@ int rpc_port = 0x400; /* predecrement */
|
|||||||
*/
|
*/
|
||||||
ssize_t
|
ssize_t
|
||||||
rpc_call(d, prog, vers, proc, sdata, slen, rdata, rlen)
|
rpc_call(d, prog, vers, proc, sdata, slen, rdata, rlen)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
register n_long prog, vers, proc;
|
n_long prog, vers, proc;
|
||||||
register void *sdata;
|
void *sdata;
|
||||||
register size_t slen;
|
size_t slen;
|
||||||
register void *rdata;
|
void *rdata;
|
||||||
register size_t rlen;
|
size_t rlen;
|
||||||
{
|
{
|
||||||
register ssize_t cc;
|
ssize_t cc;
|
||||||
struct auth_info *auth;
|
struct auth_info *auth;
|
||||||
struct rpc_call *call;
|
struct rpc_call *call;
|
||||||
struct rpc_reply *reply;
|
struct rpc_reply *reply;
|
||||||
@ -237,12 +237,12 @@ rpc_call(d, prog, vers, proc, sdata, slen, rdata, rlen)
|
|||||||
*/
|
*/
|
||||||
static ssize_t
|
static ssize_t
|
||||||
recvrpc(d, pkt, len, tleft)
|
recvrpc(d, pkt, len, tleft)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
register void *pkt;
|
void *pkt;
|
||||||
register size_t len;
|
size_t len;
|
||||||
time_t tleft;
|
time_t tleft;
|
||||||
{
|
{
|
||||||
register struct rpc_reply *reply;
|
struct rpc_reply *reply;
|
||||||
ssize_t n;
|
ssize_t n;
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
@ -382,7 +382,7 @@ rpc_pmap_putcache(addr, prog, vers, port)
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
rpc_getport(d, prog, vers)
|
rpc_getport(d, prog, vers)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
n_long prog; /* host order */
|
n_long prog; /* host order */
|
||||||
n_long vers; /* host order */
|
n_long vers; /* host order */
|
||||||
{
|
{
|
||||||
|
@ -46,7 +46,7 @@ int
|
|||||||
strcasecmp(s1, s2)
|
strcasecmp(s1, s2)
|
||||||
const char *s1, *s2;
|
const char *s1, *s2;
|
||||||
{
|
{
|
||||||
register const u_char
|
const u_char
|
||||||
*us1 = (const u_char *)s1,
|
*us1 = (const u_char *)s1,
|
||||||
*us2 = (const u_char *)s2;
|
*us2 = (const u_char *)s2;
|
||||||
|
|
||||||
@ -59,10 +59,10 @@ strcasecmp(s1, s2)
|
|||||||
int
|
int
|
||||||
strncasecmp(s1, s2, n)
|
strncasecmp(s1, s2, n)
|
||||||
const char *s1, *s2;
|
const char *s1, *s2;
|
||||||
register size_t n;
|
size_t n;
|
||||||
{
|
{
|
||||||
if (n != 0) {
|
if (n != 0) {
|
||||||
register const u_char
|
const u_char
|
||||||
*us1 = (const u_char *)s1,
|
*us1 = (const u_char *)s1,
|
||||||
*us2 = (const u_char *)s2;
|
*us2 = (const u_char *)s2;
|
||||||
|
|
||||||
|
@ -51,13 +51,13 @@ long
|
|||||||
strtol(nptr, endptr, base)
|
strtol(nptr, endptr, base)
|
||||||
const char *nptr;
|
const char *nptr;
|
||||||
char **endptr;
|
char **endptr;
|
||||||
register int base;
|
int base;
|
||||||
{
|
{
|
||||||
register const char *s;
|
const char *s;
|
||||||
register unsigned long acc;
|
unsigned long acc;
|
||||||
register unsigned char c;
|
unsigned char c;
|
||||||
register unsigned long cutoff;
|
unsigned long cutoff;
|
||||||
register int neg = 0, any, cutlim;
|
int neg = 0, any, cutlim;
|
||||||
|
|
||||||
/* Be sensible about NULL strings */
|
/* Be sensible about NULL strings */
|
||||||
if (nptr == NULL)
|
if (nptr == NULL)
|
||||||
|
@ -111,9 +111,9 @@ static int tftperrors[8] = {
|
|||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
recvtftp(d, pkt, len, tleft)
|
recvtftp(d, pkt, len, tleft)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
register void *pkt;
|
void *pkt;
|
||||||
register ssize_t len;
|
ssize_t len;
|
||||||
time_t tleft;
|
time_t tleft;
|
||||||
{
|
{
|
||||||
struct tftphdr *t;
|
struct tftphdr *t;
|
||||||
@ -140,7 +140,7 @@ recvtftp(d, pkt, len, tleft)
|
|||||||
/*
|
/*
|
||||||
* First data packet from new port.
|
* First data packet from new port.
|
||||||
*/
|
*/
|
||||||
register struct udphdr *uh;
|
struct udphdr *uh;
|
||||||
uh = (struct udphdr *) pkt - 1;
|
uh = (struct udphdr *) pkt - 1;
|
||||||
d->destport = uh->uh_sport;
|
d->destport = uh->uh_sport;
|
||||||
} /* else check uh_sport has not changed??? */
|
} /* else check uh_sport has not changed??? */
|
||||||
|
@ -63,14 +63,14 @@ __FBSDID("$FreeBSD$");
|
|||||||
/* Caller must leave room for ethernet, ip and udp headers in front!! */
|
/* Caller must leave room for ethernet, ip and udp headers in front!! */
|
||||||
ssize_t
|
ssize_t
|
||||||
sendudp(d, pkt, len)
|
sendudp(d, pkt, len)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
register void *pkt;
|
void *pkt;
|
||||||
register size_t len;
|
size_t len;
|
||||||
{
|
{
|
||||||
register ssize_t cc;
|
ssize_t cc;
|
||||||
register struct ip *ip;
|
struct ip *ip;
|
||||||
register struct udphdr *uh;
|
struct udphdr *uh;
|
||||||
register u_char *ea;
|
u_char *ea;
|
||||||
|
|
||||||
#ifdef NET_DEBUG
|
#ifdef NET_DEBUG
|
||||||
if (debug) {
|
if (debug) {
|
||||||
@ -105,7 +105,7 @@ sendudp(d, pkt, len)
|
|||||||
|
|
||||||
#ifndef UDP_NO_CKSUM
|
#ifndef UDP_NO_CKSUM
|
||||||
{
|
{
|
||||||
register struct udpiphdr *ui;
|
struct udpiphdr *ui;
|
||||||
struct ip tip;
|
struct ip tip;
|
||||||
|
|
||||||
/* Calculate checksum (must save and restore ip header) */
|
/* Calculate checksum (must save and restore ip header) */
|
||||||
@ -138,15 +138,15 @@ sendudp(d, pkt, len)
|
|||||||
*/
|
*/
|
||||||
ssize_t
|
ssize_t
|
||||||
readudp(d, pkt, len, tleft)
|
readudp(d, pkt, len, tleft)
|
||||||
register struct iodesc *d;
|
struct iodesc *d;
|
||||||
register void *pkt;
|
void *pkt;
|
||||||
register size_t len;
|
size_t len;
|
||||||
time_t tleft;
|
time_t tleft;
|
||||||
{
|
{
|
||||||
register ssize_t n;
|
ssize_t n;
|
||||||
register size_t hlen;
|
size_t hlen;
|
||||||
register struct ip *ip;
|
struct ip *ip;
|
||||||
register struct udphdr *uh;
|
struct udphdr *uh;
|
||||||
u_int16_t etype; /* host order */
|
u_int16_t etype; /* host order */
|
||||||
|
|
||||||
#ifdef NET_DEBUG
|
#ifdef NET_DEBUG
|
||||||
@ -235,7 +235,7 @@ readudp(d, pkt, len, tleft)
|
|||||||
|
|
||||||
#ifndef UDP_NO_CKSUM
|
#ifndef UDP_NO_CKSUM
|
||||||
if (uh->uh_sum) {
|
if (uh->uh_sum) {
|
||||||
register struct udpiphdr *ui;
|
struct udpiphdr *ui;
|
||||||
struct ip tip;
|
struct ip tip;
|
||||||
|
|
||||||
n = ntohs(uh->uh_ulen) + sizeof(*ip);
|
n = ntohs(uh->uh_ulen) + sizeof(*ip);
|
||||||
|
@ -137,8 +137,8 @@ read_inode(inumber, f)
|
|||||||
ino_t inumber;
|
ino_t inumber;
|
||||||
struct open_file *f;
|
struct open_file *f;
|
||||||
{
|
{
|
||||||
register struct file *fp = (struct file *)f->f_fsdata;
|
struct file *fp = (struct file *)f->f_fsdata;
|
||||||
register struct fs *fs = fp->f_fs;
|
struct fs *fs = fp->f_fs;
|
||||||
char *buf;
|
char *buf;
|
||||||
size_t rsize;
|
size_t rsize;
|
||||||
int rc;
|
int rc;
|
||||||
@ -162,7 +162,7 @@ read_inode(inumber, f)
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
register struct dinode *dp;
|
struct dinode *dp;
|
||||||
|
|
||||||
dp = (struct dinode *)buf;
|
dp = (struct dinode *)buf;
|
||||||
fp->f_di = dp[ino_to_fsbo(fs, inumber)];
|
fp->f_di = dp[ino_to_fsbo(fs, inumber)];
|
||||||
@ -172,7 +172,7 @@ read_inode(inumber, f)
|
|||||||
* Clear out the old buffers
|
* Clear out the old buffers
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
register int level;
|
int level;
|
||||||
|
|
||||||
for (level = 0; level < NIADDR; level++)
|
for (level = 0; level < NIADDR; level++)
|
||||||
fp->f_blkno[level] = -1;
|
fp->f_blkno[level] = -1;
|
||||||
@ -193,8 +193,8 @@ block_map(f, file_block, disk_block_p)
|
|||||||
daddr_t file_block;
|
daddr_t file_block;
|
||||||
daddr_t *disk_block_p; /* out */
|
daddr_t *disk_block_p; /* out */
|
||||||
{
|
{
|
||||||
register struct file *fp = (struct file *)f->f_fsdata;
|
struct file *fp = (struct file *)f->f_fsdata;
|
||||||
register struct fs *fs = fp->f_fs;
|
struct fs *fs = fp->f_fs;
|
||||||
int level;
|
int level;
|
||||||
int idx;
|
int idx;
|
||||||
daddr_t ind_block_num;
|
daddr_t ind_block_num;
|
||||||
@ -298,10 +298,10 @@ buf_write_file(f, buf_p, size_p)
|
|||||||
char *buf_p;
|
char *buf_p;
|
||||||
size_t *size_p; /* out */
|
size_t *size_p; /* out */
|
||||||
{
|
{
|
||||||
register struct file *fp = (struct file *)f->f_fsdata;
|
struct file *fp = (struct file *)f->f_fsdata;
|
||||||
register struct fs *fs = fp->f_fs;
|
struct fs *fs = fp->f_fs;
|
||||||
long off;
|
long off;
|
||||||
register daddr_t file_block;
|
daddr_t file_block;
|
||||||
daddr_t disk_block;
|
daddr_t disk_block;
|
||||||
size_t block_size;
|
size_t block_size;
|
||||||
int rc;
|
int rc;
|
||||||
@ -375,10 +375,10 @@ buf_read_file(f, buf_p, size_p)
|
|||||||
char **buf_p; /* out */
|
char **buf_p; /* out */
|
||||||
size_t *size_p; /* out */
|
size_t *size_p; /* out */
|
||||||
{
|
{
|
||||||
register struct file *fp = (struct file *)f->f_fsdata;
|
struct file *fp = (struct file *)f->f_fsdata;
|
||||||
register struct fs *fs = fp->f_fs;
|
struct fs *fs = fp->f_fs;
|
||||||
long off;
|
long off;
|
||||||
register daddr_t file_block;
|
daddr_t file_block;
|
||||||
daddr_t disk_block;
|
daddr_t disk_block;
|
||||||
size_t block_size;
|
size_t block_size;
|
||||||
int rc;
|
int rc;
|
||||||
@ -437,8 +437,8 @@ search_directory(name, f, inumber_p)
|
|||||||
struct open_file *f;
|
struct open_file *f;
|
||||||
ino_t *inumber_p; /* out */
|
ino_t *inumber_p; /* out */
|
||||||
{
|
{
|
||||||
register struct file *fp = (struct file *)f->f_fsdata;
|
struct file *fp = (struct file *)f->f_fsdata;
|
||||||
register struct direct *dp;
|
struct direct *dp;
|
||||||
struct direct *edp;
|
struct direct *edp;
|
||||||
char *buf;
|
char *buf;
|
||||||
size_t buf_size;
|
size_t buf_size;
|
||||||
@ -486,8 +486,8 @@ ufs_open(upath, f)
|
|||||||
const char *upath;
|
const char *upath;
|
||||||
struct open_file *f;
|
struct open_file *f;
|
||||||
{
|
{
|
||||||
register char *cp, *ncp;
|
char *cp, *ncp;
|
||||||
register int c;
|
int c;
|
||||||
ino_t inumber, parent_inumber;
|
ino_t inumber, parent_inumber;
|
||||||
struct file *fp;
|
struct file *fp;
|
||||||
struct fs *fs;
|
struct fs *fs;
|
||||||
@ -525,8 +525,8 @@ ufs_open(upath, f)
|
|||||||
* Calculate indirect block levels.
|
* Calculate indirect block levels.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
register int mult;
|
int mult;
|
||||||
register int level;
|
int level;
|
||||||
|
|
||||||
mult = 1;
|
mult = 1;
|
||||||
for (level = 0; level < NIADDR; level++) {
|
for (level = 0; level < NIADDR; level++) {
|
||||||
@ -566,7 +566,7 @@ ufs_open(upath, f)
|
|||||||
* Get next component of path name.
|
* Get next component of path name.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
register int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
ncp = cp;
|
ncp = cp;
|
||||||
while ((c = *cp) != '\0' && c != '/') {
|
while ((c = *cp) != '\0' && c != '/') {
|
||||||
@ -622,7 +622,7 @@ ufs_open(upath, f)
|
|||||||
*/
|
*/
|
||||||
size_t buf_size;
|
size_t buf_size;
|
||||||
daddr_t disk_block;
|
daddr_t disk_block;
|
||||||
register struct fs *fs = fp->f_fs;
|
struct fs *fs = fp->f_fs;
|
||||||
|
|
||||||
if (!buf)
|
if (!buf)
|
||||||
buf = malloc(fs->fs_bsize);
|
buf = malloc(fs->fs_bsize);
|
||||||
@ -677,7 +677,7 @@ static int
|
|||||||
ufs_close(f)
|
ufs_close(f)
|
||||||
struct open_file *f;
|
struct open_file *f;
|
||||||
{
|
{
|
||||||
register struct file *fp = (struct file *)f->f_fsdata;
|
struct file *fp = (struct file *)f->f_fsdata;
|
||||||
int level;
|
int level;
|
||||||
|
|
||||||
f->f_fsdata = (void *)0;
|
f->f_fsdata = (void *)0;
|
||||||
@ -706,12 +706,12 @@ ufs_read(f, start, size, resid)
|
|||||||
size_t size;
|
size_t size;
|
||||||
size_t *resid; /* out */
|
size_t *resid; /* out */
|
||||||
{
|
{
|
||||||
register struct file *fp = (struct file *)f->f_fsdata;
|
struct file *fp = (struct file *)f->f_fsdata;
|
||||||
register size_t csize;
|
size_t csize;
|
||||||
char *buf;
|
char *buf;
|
||||||
size_t buf_size;
|
size_t buf_size;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
register char *addr = start;
|
char *addr = start;
|
||||||
|
|
||||||
while (size != 0) {
|
while (size != 0) {
|
||||||
if (fp->f_seekp >= fp->f_di.di_size)
|
if (fp->f_seekp >= fp->f_di.di_size)
|
||||||
@ -748,10 +748,10 @@ ufs_write(f, start, size, resid)
|
|||||||
size_t size;
|
size_t size;
|
||||||
size_t *resid; /* out */
|
size_t *resid; /* out */
|
||||||
{
|
{
|
||||||
register struct file *fp = (struct file *)f->f_fsdata;
|
struct file *fp = (struct file *)f->f_fsdata;
|
||||||
size_t csize;
|
size_t csize;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
register char *addr = start;
|
char *addr = start;
|
||||||
|
|
||||||
csize = size;
|
csize = size;
|
||||||
while ((size != 0) && (csize != 0)) {
|
while ((size != 0) && (csize != 0)) {
|
||||||
@ -779,7 +779,7 @@ ufs_seek(f, offset, where)
|
|||||||
off_t offset;
|
off_t offset;
|
||||||
int where;
|
int where;
|
||||||
{
|
{
|
||||||
register struct file *fp = (struct file *)f->f_fsdata;
|
struct file *fp = (struct file *)f->f_fsdata;
|
||||||
|
|
||||||
switch (where) {
|
switch (where) {
|
||||||
case SEEK_SET:
|
case SEEK_SET:
|
||||||
@ -802,7 +802,7 @@ ufs_stat(f, sb)
|
|||||||
struct open_file *f;
|
struct open_file *f;
|
||||||
struct stat *sb;
|
struct stat *sb;
|
||||||
{
|
{
|
||||||
register struct file *fp = (struct file *)f->f_fsdata;
|
struct file *fp = (struct file *)f->f_fsdata;
|
||||||
|
|
||||||
/* only important stuff */
|
/* only important stuff */
|
||||||
sb->st_mode = fp->f_di.di_mode;
|
sb->st_mode = fp->f_di.di_mode;
|
||||||
|
@ -76,7 +76,7 @@ write(fd, dest, bcount)
|
|||||||
void *dest;
|
void *dest;
|
||||||
size_t bcount;
|
size_t bcount;
|
||||||
{
|
{
|
||||||
register struct open_file *f = &files[fd];
|
struct open_file *f = &files[fd];
|
||||||
size_t resid;
|
size_t resid;
|
||||||
|
|
||||||
if ((unsigned)fd >= SOPEN_MAX || !(f->f_flags & F_WRITE)) {
|
if ((unsigned)fd >= SOPEN_MAX || !(f->f_flags & F_WRITE)) {
|
||||||
|
@ -53,7 +53,7 @@ void
|
|||||||
login(ut)
|
login(ut)
|
||||||
struct utmp *ut;
|
struct utmp *ut;
|
||||||
{
|
{
|
||||||
register int fd;
|
int fd;
|
||||||
int tty;
|
int tty;
|
||||||
|
|
||||||
tty = ttyslot();
|
tty = ttyslot();
|
||||||
|
@ -61,8 +61,8 @@ openpty(amaster, aslave, name, termp, winp)
|
|||||||
struct winsize *winp;
|
struct winsize *winp;
|
||||||
{
|
{
|
||||||
char line[] = "/dev/ptyXX";
|
char line[] = "/dev/ptyXX";
|
||||||
register const char *cp1, *cp2;
|
const char *cp1, *cp2;
|
||||||
register int master, slave, ttygid;
|
int master, slave, ttygid;
|
||||||
struct group *gr;
|
struct group *gr;
|
||||||
|
|
||||||
if ((gr = getgrnam("tty")) != NULL)
|
if ((gr = getgrnam("tty")) != NULL)
|
||||||
|
@ -103,8 +103,8 @@ int
|
|||||||
_nc_read_termcap_entry(const char *const name, TERMTYPE *const tp)
|
_nc_read_termcap_entry(const char *const name, TERMTYPE *const tp)
|
||||||
{
|
{
|
||||||
ENTRY *ep;
|
ENTRY *ep;
|
||||||
register char *p;
|
char *p;
|
||||||
register char *cp;
|
char *cp;
|
||||||
char *dummy;
|
char *dummy;
|
||||||
char **fname;
|
char **fname;
|
||||||
char *home;
|
char *home;
|
||||||
|
Loading…
Reference in New Issue
Block a user