/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
#include <afsconfig.h>
#include <afs/param.h>
-
-#include <stdio.h>
-#include <errno.h>
-#include <stdlib.h> /* for malloc() */
+#include <roken.h>
#include <afs/cmd.h>
-
+
#if !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
/* Here be hacks. */
#ifdef AFS_LINUX24_ENV
#define _KERNEL 1
#endif
-#ifndef AFS_OSF_ENV
-#include <sys/param.h>
-#endif
-
#ifndef AFS_LINUX20_ENV
#include <nlist.h>
#endif
#endif
#include <afs/stds.h>
-#include <sys/types.h>
#if defined(AFS_OSF_ENV)
#define KERNEL
#ifdef _KERN_LOCK_H_
#include FFFFF
#endif
-#include <sys/time.h>
#include <kern/lock.h>
#include <sys/vnode.h>
#include <arch/alpha/pmap.h>
* kseg_to_phys()
* is_kseg_va()
* is_seg1_va()
- *
+ *
* when _KERNEL is defined, and expressions otherwise. Since need
* to define _KERNEL, we redefine these kernel functions as macros
* for the expressions that we would have gotten if _KERNEL had not
#ifdef AFS_SUN5_ENV /*XXXXX*/
#include <sys/t_lock.h>
struct vnode foo;
-#ifdef AFS_SUN54_ENV
-#else
-#ifdef AFS_SUN52_ENV
-typedef struct stat_mutex stat_mutex_t;
-#define kmutex_t stat_mutex_t
-#else
-typedef struct adaptive_mutex2 adaptive_mutex2_t;
-#define kmutex_t adaptive_mutex2_t
-#endif
-#endif
#endif
#ifdef AFS_SGI53_ENV
#include <sys/user.h>
#endif
-#ifndef AFS_LINUX20_ENV
-#include <sys/socket.h>
-#endif
-
#ifndef AFS_LINUX26_ENV
#include <sys/file.h>
#endif
# include <netinet/in.h> /* struct in_addr */
#endif
-#include <arpa/inet.h> /* inet_ntoa() */
-
#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
#ifdef AFS_SGI_ENV
#include <sys/vnode.h>
#endif
#endif
#endif
-#include <signal.h>
#endif
/* AFS includes */
#include <sys/elf.h>
#include <libelf.h>
#include <sys/elf_M32.h>
-#ifndef AFS_SUN54_ENV
-typedef ulong_t k_fltset_t; /* XXXXXXXXXXX */
-#endif /* !AFS_SUN54_ENV */
#include <sys/proc.h>
#include <sys/file.h>
#define _NLIST_H /* XXXXXXXXXXXXX */
#ifdef AFS_LINUX20_ENV
/* Find symbols in a live kernel. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#ifdef AFS_LINUX26_ENV
#define KSYMS "/proc/kallsyms"
while (fgets(line, MAXLINE, fp)) {
if (nksyms >= availksyms) {
availksyms += KSYM_ALLOC_STEP;
- ksyms =
- (symlist_t *) realloc(ksyms, availksyms * sizeof(symlist_t));
+ ksyms = realloc(ksyms, availksyms * sizeof(symlist_t));
if (!ksyms) {
printf("Failed to realloc %d symbols.\n", availksyms);
exit(1);
#ifndef AFS_KDUMP_LIB
static int
-cmdproc(register struct cmd_syndesc *as, void *arock)
+cmdproc(struct cmd_syndesc *as, void *arock)
{
- register afs_int32 code = 0;
+ afs_int32 code = 0;
-#if !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
+#if !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
if (as->parms[0].items) { /* -kobj */
obj = as->parms[0].items->data;
}
int
main(int argc, char **argv)
{
- register struct cmd_syndesc *ts;
- register afs_int32 code;
+ struct cmd_syndesc *ts;
+ afs_int32 code;
#ifdef AFS_AIX32_ENV
struct sigaction nsa;
int
Knlist(struct afs_nlist *sp, int cnt, int size)
{
- register int code;
+ int code;
if (UserLevel)
code = nlist(obj, sp);
(struct server **)malloc(NserversAllocated *
sizeof(struct server *));
} else {
- serversFound =
- (struct server **)realloc((char *)serversFound,
- NserversAllocated *
- sizeof(struct server *));
+ serversFound = realloc(serversFound,
+ NserversAllocated *
+ sizeof(struct server *));
}
if (!serversFound) {
printf("Can't allocate %lu bytes for list of found servers.\n",
int
readmem(kmem, buf, vad, len)
int kmem, len;
-#ifdef AFS_SUN57_ENV
+#ifdef AFS_SUN5_ENV
uintptr_t vad;
#else
int vad;
-#endif /** AFS_SUN57_ENV **/
+#endif /** AFS_SUN5_ENV **/
char *buf;
{
int newlen;
perror("lseek");
exit(1);
}
- if (loc == 0)
- printf("WARNING: Read failed: loc=0\n");
+ if (loc == 0)
+ printf("WARNING: Read failed: loc=0\n");
else
if ((i = read(kmem, buf, len)) != len) {
printf("WARNING: Read failed: ");
void
-print_exporter(int kmem, struct afs_exporter *exporter,
+print_exporter(int kmem, struct afs_exporter *exporter,
struct afs_exporter *ptr, int pnt)
{
if (pnt) {
void
-print_nfsclient(int kmem, struct nfsclientpag *ep,
+print_nfsclient(int kmem, struct nfsclientpag *ep,
struct nfsclientpag *ptr, int pnt)
{
char sysname[100];
void
pmutex(char *sp, kmutex_t *mp)
{
-#ifdef AFS_SUN54_ENV
-
-#else
- struct stat_mutex *smp = (struct stat_mutex *)mp;
-
- printf("%s mutex: %x %x\n", sp, smp->m_stats_lock, smp->m_type);
-#endif
}
#endif
void
-print_unixuser(int kmem, struct unixuser *uep,
+print_unixuser(int kmem, struct unixuser *uep,
struct unixuser *ptr, int pnt)
{
Sum_userstp += uep->stLen;
printf("\tlinked cellp %lx\n", clep->lcellp);
#endif
printf("\tCell's servers: ");
- for (i = 0; i < MAXCELLHOSTS; i++) {
+ for (i = 0; i < AFS_MAXCELLHOSTS; i++) {
if (pretty && (clep->cellHosts[i] == 0))
break;
printf("[%lx] ", clep->cellHosts[i]);
void
-print_server(int kmem, struct server *sep, struct server *ptr, int conns,
+print_server(int kmem, struct server *sep, struct server *ptr, int conns,
int pnt)
{
struct srvAddr sa, *sap = &sa, *sap1;
void
-print_conns(int kmem, struct srvAddr *srv, struct afs_conn *conns, int Con,
+print_conns(int kmem, struct srvAddr *srv, struct afs_conn *conns, int Con,
int pnt)
{
struct afs_conn *cep, ce, *centry = &ce;
vep->states);
#endif
printf("\tVolume's statuses: ");
- for (i = 0; i < MAXHOSTS && vep->serverHost[i]; i++)
+ for (i = 0; i < AFS_MAXHOSTS && vep->serverHost[i]; i++)
printf("[%d] ", vep->status[i]);
printf("\n");
printf("\tVolume's servers: ");
- for (i = 0; i < MAXHOSTS && vep->serverHost[i]; i++)
+ for (i = 0; i < AFS_MAXHOSTS && vep->serverHost[i]; i++)
printf("[%lx] ", vep->serverHost[i]);
printf("\n");
struct callo Co, *Coe = &Co, *Cop;
struct tos To, *Toe = &To, *tos;
struct trb Trb, *Trbe = &Trb, *trb;
- register int i = 0;
+ int i = 0;
printf("\n\nPrinting callout table info...\n\n");