Portability fixes from Mats Erik Andersson <debian@gisladisker.se>
It restores compilability and most functionality for GNU/Linux, GNU/kFreeBSD, FreeBSD, OpenBSD, OpenSolaris/NexentaCore.
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
#if defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__ \
|
#if defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__ \
|
||||||
|| ( defined __GNUC__ && ! defined __linux__ )
|
|| ( defined __GLIBC__ && ! defined __linux__ )
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#include <net/if_dl.h>
|
#include <net/if_dl.h>
|
||||||
@@ -81,7 +81,7 @@ get_addrs_ioctl(char *interface, char if_hw_addr[], struct in_addr *if_ip_addr,
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#if defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__ \
|
#if defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__ \
|
||||||
|| ( defined __GNUC__ && ! defined __linux__ )
|
|| ( defined __GLIBC__ && ! defined __linux__ )
|
||||||
{
|
{
|
||||||
int sysctlparam[6] = {CTL_NET, PF_ROUTE, 0, 0, NET_RT_IFLIST, 0};
|
int sysctlparam[6] = {CTL_NET, PF_ROUTE, 0, 0, NET_RT_IFLIST, 0};
|
||||||
size_t needed = 0;
|
size_t needed = 0;
|
||||||
|
|||||||
@@ -355,7 +355,7 @@ oldLIBS=$LIBS
|
|||||||
for curseslib in ncursesw curses ncurses ; do
|
for curseslib in ncursesw curses ncurses ; do
|
||||||
LIBS="$oldLIBS -l$curseslib"
|
LIBS="$oldLIBS -l$curseslib"
|
||||||
AC_TRY_LINK([
|
AC_TRY_LINK([
|
||||||
#include <curses.h>
|
#include <$curseslib.h>
|
||||||
], [
|
], [
|
||||||
mvchgat(0, 0, 1, A_REVERSE, 0, NULL)
|
mvchgat(0, 0, 1, A_REVERSE, 0, NULL)
|
||||||
], [
|
], [
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ typedef unsigned long ulong;
|
|||||||
#include <sys/dlpi.h>
|
#include <sys/dlpi.h>
|
||||||
#include <sys/signal.h>
|
#include <sys/signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "dlcommon.h"
|
#include "dlcommon.h"
|
||||||
|
|
||||||
@@ -462,7 +463,7 @@ char *bufp;
|
|||||||
err("dlphysaddrack: short response ctl.len: %d", ctl.len);
|
err("dlphysaddrack: short response ctl.len: %d", ctl.len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
sigalrm()
|
sigalrm()
|
||||||
{
|
{
|
||||||
(void) err("sigalrm: TIMEOUT");
|
(void) err("sigalrm: TIMEOUT");
|
||||||
|
|||||||
10
iftop.h
10
iftop.h
@@ -13,6 +13,16 @@
|
|||||||
#define RESOLUTION 2
|
#define RESOLUTION 2
|
||||||
#define DUMP_RESOLUTION 300
|
#define DUMP_RESOLUTION 300
|
||||||
|
|
||||||
|
/* At least OpenBSD and NexentaCore do not
|
||||||
|
* define s6_addr32 for user land settings.
|
||||||
|
*/
|
||||||
|
#if !defined s6_addr32 && defined __sun__
|
||||||
|
# define s6_addr32 _S6_un._S6_u32
|
||||||
|
#elif !defined s6_addr32 && \
|
||||||
|
( defined __OpenBSD__ || defined __FreeBSD__ )
|
||||||
|
# define s6_addr32 __u6_addr.__u6_addr32
|
||||||
|
#endif /* !defined s6_addr32 */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
long recv[HISTORY_LENGTH];
|
long recv[HISTORY_LENGTH];
|
||||||
long sent[HISTORY_LENGTH];
|
long sent[HISTORY_LENGTH];
|
||||||
|
|||||||
Reference in New Issue
Block a user