NETSTAT(1): Initialize global variables

Use BSD program lock.
This commit is contained in:
Sebastian Huber
2013-10-30 15:42:53 +01:00
parent 5898fa13a3
commit 6da9b2397b
4 changed files with 64 additions and 22 deletions

View File

@@ -36,6 +36,12 @@
#include <sys/cdefs.h>
#ifdef __rtems__
#define rt_tables netstat_rt_tables
#define routename rtems_shell_netstats_routername
#define netname rtems_shell_netstats_netname
#define sotoxsocket rtems_shell_netstats_sotoxsocket
#endif /* __rtems__ */
extern int Aflag; /* show addresses of protocol control block */
extern int aflag; /* show all sockets (including servers) */
extern int bflag; /* show i/f total bytes in/out */
@@ -62,6 +68,11 @@ extern int unit; /* unit number for above */
extern int af; /* address family */
extern int live; /* true if we are examining a live system */
#ifdef __rtems__
extern int protopr_initialized;
extern int do_rtent;
extern struct radix_node_head **rt_tables;
#endif /* __rtems__ */
int kread(u_long addr, void *buf, size_t size);
const char *plural(uintmax_t);
@@ -126,13 +137,6 @@ char *ipx_phost(struct sockaddr *);
char *ns_phost(struct sockaddr *);
void upHex(char *);
#ifdef __rtems__
#define rt_tables netstat_rt_tables
#define routename rtems_shell_netstats_routername
#define netname rtems_shell_netstats_netname
#define sotoxsocket rtems_shell_netstats_sotoxsocket
#endif
char *routename(in_addr_t);
char *netname(in_addr_t, u_long);
char *atalk_print(struct sockaddr *, int);