From: Lionel Sambuc Date: Mon, 25 Feb 2013 20:06:20 +0000 (+0100) Subject: Removing obsolete _NBSD_LIBC define X-Git-Tag: v3.3.0~1125 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=f640210005a9e4afd73b21523c5303978a30f2d3;p=minix.git Removing obsolete _NBSD_LIBC define Change-Id: Ia6ce84ccdf36cf6f64540b990baaa7d85c53533d --- diff --git a/commands/add_route/add_route.c b/commands/add_route/add_route.c index 29f87fc70..4e9787b3b 100644 --- a/commands/add_route/add_route.c +++ b/commands/add_route/add_route.c @@ -179,49 +179,28 @@ int main(int argc, char *argv[]) if (!(high_byte & 0x80)) /* class A or 0 */ { if (destination) -#ifdef __NBSD_LIBC defaultmask= htonl(0xff000000); -#else - defaultmask= HTONL(0xff000000); -#endif } else if (!(high_byte & 0x40)) /* class B */ { -#ifdef __NBSD_LIBC defaultmask= htonl(0xffff0000); -#else - defaultmask= HTONL(0xffff0000); -#endif } else if (!(high_byte & 0x20)) /* class C */ { -#ifdef __NBSD_LIBC defaultmask= htonl(0xffffff00); -#else - defaultmask= HTONL(0xffffff00); - -#endif } else /* class D is multicast ... */ { fprintf(stderr, "%s: Warning: Martian address '%s'\n", prog_name, inet_ntoa(destination)); -#ifdef __NBSD_LIBC defaultmask= htonl(0xffffffff); -#else - defaultmask= HTONL(0xffffffff); -#endif } if (destination & ~defaultmask) { /* host route */ -#ifdef __NBSD_LIBC defaultmask= htonl(0xffffffff); -#else - defaultmask= HTONL(0xffffffff); -#endif } if (!cidr) netmask= defaultmask; diff --git a/commands/ash/Makefile b/commands/ash/Makefile index b0a06dec7..b1e649a9b 100644 --- a/commands/ash/Makefile +++ b/commands/ash/Makefile @@ -33,7 +33,7 @@ CLEANFILES+=${GENSRCS} ${GENHDRS} DPADD+= ${LIBL} ${LIBEDIT} LDADD+= -ll -ledit -CPPFLAGS+= -DSHELL -D__NBSD_LIBC +CPPFLAGS+= -DSHELL CPPFLAGS+=${EDIT} ${NO_PATHS_H} ${NO_JOBS} CPPFLAGS+= -I. -I${.CURDIR} diff --git a/commands/dhcpd/dhcpd.c b/commands/dhcpd/dhcpd.c index b7f190e34..00f8e051c 100644 --- a/commands/dhcpd/dhcpd.c +++ b/commands/dhcpd/dhcpd.c @@ -39,11 +39,7 @@ static char *cachefile= PATH_DHCPCACHE; static int qflag; /* True if printing cached DHCP data. */ static int aflag, rflag; /* True if adding or deleting pool addresses. */ -#ifdef __NBSD_LIBC #define BCAST_IP htonl(0xFFFFFFFFUL) -#else -#define BCAST_IP HTONL(0xFFFFFFFFUL) -#endif /* We try to play with up to this many networks. */ #define N_NETS 32 @@ -108,24 +104,13 @@ network_t *if2net(int n) static ipaddr_t defaultmask(ipaddr_t ip) { /* Compute netmask by the oldfashioned Class rules. */ -#ifdef __NBSD_LIBC if (B(&ip)[0] < 0x80) return htonl(0xFF000000UL); /* Class A. */ if (B(&ip)[0] < 0xC0) return htonl(0xFFFF0000UL); /* Class B. */ if (B(&ip)[0] < 0xE0) return htonl(0xFFFFFF00UL); /* Class C. */ return htonl(0xFFFFFFFFUL); /* Multicast? Shouldn't happen... */ -#else - if (B(&ip)[0] < 0x80) return HTONL(0xFF000000UL); /* Class A. */ - if (B(&ip)[0] < 0xC0) return HTONL(0xFFFF0000UL); /* Class B. */ - if (B(&ip)[0] < 0xE0) return HTONL(0xFFFFFF00UL); /* Class C. */ - return HTONL(0xFFFFFFFFUL); /* Multicast? Shouldn't happen... */ -#endif } -#ifdef __NBSD_LIBC #define POOL_MAGIC htonl(0x81F85D00UL) -#else -#define POOL_MAGIC HTONL(0x81F85D00UL) -#endif typedef struct pool { /* Dynamic pool entry. */ u32_t magic; /* Pool file magic number. */ diff --git a/commands/dhcpd/ether.c b/commands/dhcpd/ether.c index 202979471..1b6384783 100644 --- a/commands/dhcpd/ether.c +++ b/commands/dhcpd/ether.c @@ -21,13 +21,8 @@ #include "dhcpd.h" static ether_addr_t BCAST_ETH = {{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }}; -#ifdef __NBSD_LIBC #define BCAST_IP htonl(0xFFFFFFFFUL) #define LOCALHOST htonl(0x7F000001UL) -#else -#define BCAST_IP HTONL(0xFFFFFFFFUL) -#define LOCALHOST HTONL(0x7F000001UL) -#endif static u16_t udp_cksum(ipaddr_t src, ipaddr_t dst, udp_hdr_t *udp) { @@ -69,21 +64,13 @@ void udp2ether(buf_t *bp, network_t *np) /* Fill in the Ethernet, IP and UDP headers. */ bp->eth->eh_dst= BCAST_ETH; bp->eth->eh_src= np->eth; -#ifdef __NBSD_LIBC bp->eth->eh_proto= htons(ETH_IP_PROTO); -#else - bp->eth->eh_proto= HTONS(ETH_IP_PROTO); -#endif bp->ip->ih_vers_ihl= 0x45; bp->ip->ih_tos= 0; bp->ip->ih_length= htons(sizeof(ip_hdr_t) + sizeof(udp_hdr_t) + udpio.uih_data_len); bp->ip->ih_id= 0; -#ifdef __NBSD_LIBC bp->ip->ih_flags_fragoff= ntohs(0x4000); -#else - bp->ip->ih_flags_fragoff= NTOHS(0x4000); -#endif bp->ip->ih_ttl= IP_MAX_TTL; bp->ip->ih_proto= IPPROTO_UDP; bp->ip->ih_hdr_chk= 0; @@ -104,11 +91,7 @@ int ether2udp(buf_t *bp) */ udp_io_hdr_t udpio; -#ifdef __NBSD_LIBC if (bp->eth->eh_proto != htons(ETH_IP_PROTO) -#else - if (bp->eth->eh_proto != HTONS(ETH_IP_PROTO) -#endif || bp->ip->ih_vers_ihl != 0x45 || bp->ip->ih_proto != IPPROTO_UDP || oneC_sum(0, bp->ip, 20) != (u16_t) ~0 @@ -135,17 +118,10 @@ void make_arp(buf_t *bp, network_t *np) memset(arp, 0, sizeof(*arp)); arp->dstaddr= BCAST_ETH; arp->srcaddr= np->eth; -#ifdef __NBSD_LIBC arp->ethtype= htons(ETH_ARP_PROTO); arp->hdr= htons(ARP_ETHERNET); arp->pro= htons(ETH_IP_PROTO); arp->op= htons(ARP_REQUEST); -#else - arp->ethtype= HTONS(ETH_ARP_PROTO); - arp->hdr= HTONS(ARP_ETHERNET); - arp->pro= HTONS(ETH_IP_PROTO); - arp->op= HTONS(ARP_REQUEST); -#endif arp->hln= 6; arp->pln= 4; @@ -161,18 +137,10 @@ int is_arp_me(buf_t *bp, network_t *np) */ arp46_t *arp= (arp46_t *) bp->eth; - if ( -#ifdef __NBSD_LIBC - arp->ethtype == htons(ETH_ARP_PROTO) + if (arp->ethtype == htons(ETH_ARP_PROTO) && arp->hdr == htons(ARP_ETHERNET) && arp->pro == htons(ETH_IP_PROTO) && arp->op == htons(ARP_REPLY) -#else - arp->ethtype == HTONS(ETH_ARP_PROTO) - && arp->hdr == HTONS(ARP_ETHERNET) - && arp->pro == HTONS(ETH_IP_PROTO) - && arp->op == HTONS(ARP_REPLY) -#endif && memcmp(&arp->spa, &np->ip, sizeof(np->ip)) == 0 && memcmp(&arp->sha, &np->eth, sizeof(np->eth)) != 0 ) { @@ -211,11 +179,7 @@ void icmp_advert(buf_t *bp, network_t *np) icmp->ih_hun.ihh_ram.iram_aes= 2; icmp->ih_hun.ihh_ram.iram_lt= htons(DELTA_ADV); ((u32_t *) icmp->ih_dun.uhd_data)[0] = np->gateway; -#ifdef __NBSD_LIBC ((u32_t *) icmp->ih_dun.uhd_data)[1] = htonl((u32_t) -9999); -#else - ((u32_t *) icmp->ih_dun.uhd_data)[1] = HTONL((u32_t) -9999); -#endif icmp->ih_chksum= 0; icmp->ih_chksum= ~oneC_sum(0, icmp, 16); } diff --git a/commands/diff/diff.h b/commands/diff/diff.h index 4ab7f4388..0aae6c8e4 100644 --- a/commands/diff/diff.h +++ b/commands/diff/diff.h @@ -31,9 +31,7 @@ * @(#)diff.h 8.1 (Berkeley) 6/6/93 */ -#ifdef __NBSD_LIBC #include -#endif #include #include diff --git a/commands/find/find.h b/commands/find/find.h index 176298401..cc2350f0c 100644 --- a/commands/find/find.h +++ b/commands/find/find.h @@ -53,10 +53,6 @@ enum ntype { N_PRUNE, N_REGEX, N_SIZE, N_TYPE, N_USER, N_XDEV, N_DELETE }; -#ifndef __NBSD_LIBC -typedef unsigned int u_int32_t; -#endif - /* node definition */ typedef struct _plandata { struct _plandata *next; /* next node */ diff --git a/commands/finger/Makefile b/commands/finger/Makefile index 266ac246a..34e9f8c59 100644 --- a/commands/finger/Makefile +++ b/commands/finger/Makefile @@ -1,7 +1,4 @@ PROG= finger MAN= -# LSC Force finger to use its local fwopen macro -CPPFLAGS.finger.c+=-D__NBSD_LIBC - .include diff --git a/commands/finger/finger.c b/commands/finger/finger.c index e4d3517f7..0682ec3ea 100644 --- a/commands/finger/finger.c +++ b/commands/finger/finger.c @@ -127,11 +127,9 @@ char *ctime(); char *prog_name; -#ifdef __NBSD_LIBC /* Already defined in stdio.h */ #undef fwopen #define fwopen finger_fwopen -#endif int main (int argc, char *argv[]); static void doall(void); diff --git a/commands/fix/Makefile b/commands/fix/Makefile index 468e9bc3b..9caaa4219 100644 --- a/commands/fix/Makefile +++ b/commands/fix/Makefile @@ -1,7 +1,4 @@ PROG= fix MAN= -# LSC Force fix to use its local definition of getline -CPPFLAGS.fix.c+= -D__NBSD_LIBC - .include diff --git a/commands/fix/fix.c b/commands/fix/fix.c index 3952fc2f9..5d101cc6b 100644 --- a/commands/fix/fix.c +++ b/commands/fix/fix.c @@ -38,10 +38,8 @@ char *prog = 0, *processing = 0; -#ifdef __NBSD_LIBC /* getline() already declared in stdio.h */ #define getline fix_getline -#endif char *getline(FILE *fp, char *b); char *range(char *s, int *p1, int *p2); int getcommand(FILE *fp, int *o1, int *o2, char *pcmd, int *n1, int diff --git a/commands/ftp101/Makefile b/commands/ftp101/Makefile index 642587ed4..553f02a2c 100644 --- a/commands/ftp101/Makefile +++ b/commands/ftp101/Makefile @@ -8,7 +8,4 @@ PROG= ftp SRCS= ftp.c local.c file.c xfer.c other.c net.c crc.c CPPFLAGS+= -DCRC_ONLY -# LSC Force ftp.c to use its local definition of getline -CPPFLAGS+= -D__NBSD_LIBC - .include diff --git a/commands/ftp101/ftp.c b/commands/ftp101/ftp.c index c968f6e60..3e0e80097 100644 --- a/commands/ftp101/ftp.c +++ b/commands/ftp101/ftp.c @@ -45,10 +45,8 @@ char *cmdargv[NUMARGS]; int printreply = 1; char reply[1024]; -#ifdef __NBSD_LIBC /* Already declared in stdio.h */ #define getline ftp_getline -#endif static void makeargs(char *buff); int DOver(void); diff --git a/commands/ftp101/net.c b/commands/ftp101/net.c index 9e6cab7b4..f6a1556da 100644 --- a/commands/ftp101/net.c +++ b/commands/ftp101/net.c @@ -104,11 +104,7 @@ struct servent *servent; /* This HACK allows the server to establish data connections correctly */ /* when using the loopback device to talk to ourselves */ -#ifdef __NBSD_LIBC if((hostip & ntohl(0xFF000000)) == inet_addr("127.0.0.0")) -#else - if((hostip & NTOHL(0xFF000000)) == inet_addr("127.0.0.0")) -#endif hostip = myip; if((tcp_device = getenv("TCP_DEVICE")) == NULL) @@ -227,11 +223,7 @@ int wasopen; #endif ripaddr = hostip; -#ifdef __NBSD_LIBC rport = htons(2); -#else - rport = HTONS(20); -#endif /* here we set up a connection to listen on if not passive mode */ /* otherwise we use this to connect for passive mode */ diff --git a/commands/gcov-pull/Makefile b/commands/gcov-pull/Makefile index d45578426..8a121bd58 100644 --- a/commands/gcov-pull/Makefile +++ b/commands/gcov-pull/Makefile @@ -1,6 +1,4 @@ PROG=gcov-pull MAN= -CPPFLAGS.gcov-pull.c+= -D__NBSD_LIBC - .include diff --git a/commands/gcov-pull/gcov-pull.c b/commands/gcov-pull/gcov-pull.c index e67241c26..361dc8206 100644 --- a/commands/gcov-pull/gcov-pull.c +++ b/commands/gcov-pull/gcov-pull.c @@ -9,9 +9,6 @@ #include #include #include -#ifndef __NBSD_LIBC -#include -#endif #include #include #include diff --git a/commands/host/Makefile b/commands/host/Makefile index 8a7cfb1b3..1186419b0 100644 --- a/commands/host/Makefile +++ b/commands/host/Makefile @@ -1,6 +1,4 @@ PROG= host MAN= -CPPFLAGS.host.c+= -D__NBSD_LIBC - .include diff --git a/commands/host/host.c b/commands/host/host.c index fe33c36c8..785afe4f6 100644 --- a/commands/host/host.c +++ b/commands/host/host.c @@ -64,12 +64,7 @@ extern int h_errno; FILE *filePtr; -#ifdef __NBSD_LIBC static struct __res_state orig; -#else -struct state orig; -extern struct state _res; -#endif static u8_t *cname = NULL; int getclass = C_IN; int gettype, getdeftype = T_A; @@ -104,11 +99,7 @@ main(c, v) char **v; { char *domain; -#ifdef __NBSD_LIBC struct in_addr addr; -#else - ipaddr_t addr; -#endif register struct hostent *hp; register char *s, *p; register int inverse = 0; @@ -192,33 +183,17 @@ main(c, v) hperror(h_errno); exit(1); } -#ifdef __NBSD_LIBC memcpy(&_res.nsaddr.sin_addr, hp->h_addr, NS_INADDRSZ); -#else - _res.nsaddr= *(ipaddr_t *)hp->h_addr; -#endif printf("Using domain server:\n"); printanswer(hp); } else { -#ifdef __NBSD_LIBC _res.nsaddr.sin_family = AF_INET; _res.nsaddr.sin_addr = addr; _res.nsaddr.sin_port = htons(NAMESERVER_PORT); printf("Using domain server %s:\n", inet_ntoa(_res.nsaddr.sin_addr)); -#else - _res.nsaddr_list[0]= addr; - _res.nsport_list[0]= htons(NAMESERVER_PORT); - printf("Using domain server %s", - inet_ntoa(_res.nsaddr)); - if (p != NULL) { - printf(" on port %d", atoi(p)); - _res.nsport_list[0]= htons(atoi(p)); - } - printf(":\n"); -#endif } } domain = v[1]; @@ -350,21 +325,12 @@ printanswer(hp) register struct hostent *hp; { register char **cp; -#ifdef __NBSD_LIBC struct in_addr **hptr; -#else - register ipaddr_t **hptr; -#endif printf("Name: %s\n", hp->h_name); printf("Address:"); -#ifdef __NBSD_LIBC for (hptr = (struct in_addr **)hp->h_addr_list; *hptr; hptr++) printf(" %s", inet_ntoa(**hptr)); -#else - for (hptr = (ipaddr_t **)hp->h_addr_list; *hptr; hptr++) - printf(" %s", inet_ntoa(*(ipaddr_t *)*hptr)); -#endif printf("\nAliases:"); for (cp = hp->h_aliases; cp && *cp && **cp; cp++) printf(" %s", *cp); @@ -519,37 +485,14 @@ printinfo(answer, eom, filter, isls) arcount = ntohs(hp->dh_arcount); if (_res.options & RES_DEBUG || (verbose && isls == 0)) printf("rcode = %d (%s), ancount=%d\n", -#ifdef __NBSD_LIBC hp->rcode, DecodeError(hp->rcode), -#else - hp->dh_flag2 & DHF_RCODE, - DecodeError(hp->dh_flag2 & DHF_RCODE), -#endif ancount); - if ( -#ifdef __NBSD_LIBC - hp->rcode != NOERROR || -#else - hp->dh_flag2 & DHF_RCODE != NOERROR || -#endif - (ancount+nscount+arcount) == 0) { - switch ( -#ifdef __NBSD_LIBC - hp->rcode -#else - hp->dh_flag2 & DHF_RCODE -#endif - ) { + if (hp->rcode != NOERROR || (ancount+nscount+arcount) == 0) { + switch (hp->rcode) { case NXDOMAIN: /* Check if it's an authoritive answer */ - if ( -#ifdef __NBSD_LIBC - hp->aa -#else - hp->dh_flag1 & DHF_AA -#endif - ) { + if (hp->aa) { h_errno = HOST_NOT_FOUND; return(0); } else { @@ -592,13 +535,7 @@ printinfo(answer, eom, filter, isls) cp += dn_skipname((u8_t *)cp,(u8_t *)eom) + QFIXEDSZ; } if (ancount) { - if (! -#ifdef __NBSD_LIBC - hp->aa -#else - (hp->dh_flag1 & DHF_AA) -#endif - ) + if (!hp->aa) if (verbose && isls == 0) printf("The following answer is not authoritative:\n"); while (--ancount >= 0 && cp && cp < eom) { @@ -642,11 +579,7 @@ pr_rr(cp, msg, file, filter) int filter; { int type, class, dlen, n, c, proto, ttl; -#ifdef __NBSD_LIBC struct in_addr inaddr; -#else - ipaddr_t inaddr; -#endif u8_t *cp1; struct protoent *protop; struct servent *servp; @@ -802,22 +735,6 @@ pr_rr(cp, msg, file, filter) } break; /* Roy end */ -#ifndef __NBSD_LIBC - case T_UINFO: - if (doprint) - fprintf(file,"%c%s", punc, cp); - cp += dlen; - break; - - case T_UID: - case T_GID: - if (dlen == 4) { - if (doprint) - fprintf(file,"%c%ld", punc, _getlong(cp)); - cp += sizeof(int); - } - break; -#endif case T_WKS: if (dlen < sizeof(u_long) + 1) break; @@ -919,14 +836,6 @@ pr_type(type) return("MAILA"); case T_ANY: /* matches any type */ return("ANY"); -#ifndef __NBSD_LIBC - case T_UINFO: - return("UINFO"); - case T_UID: - return("UID"); - case T_GID: - return("GID"); -#endif default: return (sprintf(nbuf, "%d", type) == EOF ? NULL : nbuf); } @@ -1092,55 +1001,24 @@ ListHosts(namePtr, queryType) } if (_res.options & RES_DEBUG || verbose) printf("rcode = %d (%s), ancount=%d\n", -#ifdef __NBSD_LIBC answer.qb1.rcode, DecodeError(answer.qb1.rcode), - ntohs(answer.qb1.ancount) -#else - answer.qb1.dh_flag2 & DHF_RCODE, - DecodeError(answer.qb1.dh_flag2 & DHF_RCODE), - ntohs(answer.qb1.dh_ancount) -#endif - ); + ntohs(answer.qb1.ancount)); /* * Analyze response to our NS lookup */ -#ifdef __NBSD_LIBC nscount = ntohs(answer.qb1.ancount) + ntohs(answer.qb1.nscount) + ntohs(answer.qb1.arcount); -#else - nscount = ntohs(answer.qb1.dh_ancount) + ntohs(answer.qb1.dh_nscount) + - ntohs(answer.qb1.dh_arcount); -#endif - if ( -#ifdef __NBSD_LIBC - answer.qb1.rcode != NOERROR || nscount == 0 -#else - answer.qb1.dh_flag2 & DHF_RCODE != NOERROR || nscount == 0 -#endif - ) { - switch ( -#ifdef __NBSD_LIBC - answer.qb1.rcode -#else - answer.qb1.dh_flag2 & DHF_RCODE -#endif - ) { + if (answer.qb1.rcode != NOERROR || nscount == 0) { + switch (answer.qb1.rcode) { case NXDOMAIN: /* Check if it's an authoritive answer */ - if ( -#ifdef __NBSD_LIBC - answer.qb1.aa -#else - answer.qb1.dh_flag1 & DHF_AA -#endif - ) { - + if (answer.qb1.aa) { printf("No such domain\n"); } else { printf("Unable to get information about domain -- try again later.\n"); @@ -1284,11 +1162,7 @@ again: tcpconf.nwtc_flags= NWTC_EXCL | NWTC_LP_SEL | NWTC_SET_RA | NWTC_SET_RP; tcpconf.nwtc_remaddr= *(ipaddr_t *)nsipaddr[thisns]; -#ifdef __NBSD_LIBC tcpconf.nwtc_remport= _res.nsaddr.sin_port; -#else - tcpconf.nwtc_remport= _res.nsport_list[0]; -#endif result= ioctl(tcp_fd, NWIOSTCPCONF, &tcpconf); if (result == -1) { @@ -1385,11 +1259,8 @@ again: break; } -#ifdef __NBSD_LIBC i = buf.qb1.rcode; -#else - i = buf.qb1.dh_flag2 & DHF_RCODE; -#endif + if (i != NOERROR || ntohs(buf.qb1.dh_ancount) == 0) { if ((thisns+1) < numnsaddr && (i == SERVFAIL || i == NOTIMP || i == REFUSED)) { @@ -1449,11 +1320,7 @@ again: fprintf(stderr,"ListHosts: error receiving zone transfer:\n"); fprintf(stderr, " result: %s, answers = %d, authority = %d, additional = %d\n", -#ifdef __NBSD_LIBC resultcodes[headerPtr->rcode], -#else - resultcodes[headerPtr->dh_flag2 & DHF_RCODE], -#endif ntohs(headerPtr->dh_ancount), ntohs(headerPtr->dh_nscount), ntohs(headerPtr->dh_arcount)); diff --git a/commands/hostaddr/Makefile b/commands/hostaddr/Makefile index 28de61595..38065619a 100644 --- a/commands/hostaddr/Makefile +++ b/commands/hostaddr/Makefile @@ -1,6 +1,5 @@ PROG= hostaddr BINMODE= 4755 MAN= -CPPFLAGS+= -D__NBSD_LIBC .include diff --git a/commands/hostaddr/hostaddr.c b/commands/hostaddr/hostaddr.c index d45f4a114..ddaf5d301 100644 --- a/commands/hostaddr/hostaddr.c +++ b/commands/hostaddr/hostaddr.c @@ -16,9 +16,7 @@ Created: Jan 27, 1992 by Philip Homburg #include #include -#ifdef __NBSD_LIBC #include -#endif #include #include diff --git a/commands/ipcs/ipcs.c b/commands/ipcs/ipcs.c index 640efdb8f..ed2d8f117 100644 --- a/commands/ipcs/ipcs.c +++ b/commands/ipcs/ipcs.c @@ -35,17 +35,6 @@ /* remove _() stuff */ #define _(a) a -#ifndef __NBSD_LIBC -typedef unsigned long ulong; -void err(int eval, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - exit(eval); -} -#endif /*-------------------------------------------------------------------*/ /* SHM_DEST and SHM_LOCKED are defined in kernel headers, diff --git a/commands/irdpd/irdpd.c b/commands/irdpd/irdpd.c index 2061ee95b..edbbbaa20 100644 --- a/commands/irdpd/irdpd.c +++ b/commands/irdpd/irdpd.c @@ -229,11 +229,7 @@ void time_functions(void) icmp_hdr= (icmp_hdr_t *) (ip_hdr + 1); ip_hdr->ih_vers_ihl= 0x45; -#ifdef __NBSD_LIBC ip_hdr->ih_dst= htonl(0xFFFFFFFFL); -#else - ip_hdr->ih_dst= HTONL(0xFFFFFFFFL); -#endif icmp_hdr->ih_type= ICMP_TYPE_ROUTE_SOL; icmp_hdr->ih_code= 0; icmp_hdr->ih_chksum= 0; @@ -256,11 +252,7 @@ void time_functions(void) * broadcast them (to keep bad hosts up.) */ -#ifdef __NBSD_LIBC advertize(bcast ? htonl(0xFFFFFFFFL) : htonl(0x7F000001L)); -#else - advertize(bcast ? HTONL(0xFFFFFFFFL) : HTONL(0x7F000001L)); -#endif next_advert= now + MaxAdvertisementInterval; #if !__minix_vmd /* Make sure we are listening to RIP now. */ @@ -577,11 +569,7 @@ int main(int argc, char **argv) ipopt.nwio_ttl= 1; ipopt.nwio_df= 0; ipopt.nwio_hdropt.iho_opt_siz= 0; -#ifdef __NBSD_LIBC ipopt.nwio_rem= htonl(0xFFFFFFFFL); -#else - ipopt.nwio_rem= HTONL(0xFFFFFFFFL); -#endif ipopt.nwio_proto= IPPROTO_ICMP; if (ioctl(irdp_fd, NWIOSIPOPT, &ipopt) < 0) diff --git a/commands/logger/Makefile b/commands/logger/Makefile index ec5c48ab5..ac8698341 100644 --- a/commands/logger/Makefile +++ b/commands/logger/Makefile @@ -1,5 +1,4 @@ PROG= logger MAN= -CPPFLAGS.logger.c+= -D__NBSD_LIBC .include diff --git a/commands/logger/logger.c b/commands/logger/logger.c index 68aa271b6..39a2dbfa8 100644 --- a/commands/logger/logger.c +++ b/commands/logger/logger.c @@ -100,22 +100,14 @@ int pencode(char *s) for (save = s; *s && *s != '.'; ++s); if (*s) { *s = '\0'; -#ifdef __NBSD_LIBC fac = decode(save, facilitynames); -#else - fac = decode(save, FacNames); -#endif if (fac < 0) bailout("unknown facility name:", save); *s++ = '.'; } else { fac = 0; s = save; } -#ifdef __NBSD_LIBC lev = decode(s, prioritynames); -#else - lev = decode(s, PriNames); -#endif if (lev < 0) bailout("unknown priority name:", save); return((lev & LOG_PRIMASK) | (fac & LOG_FACMASK)); } diff --git a/commands/mdb/gnu_sym.c b/commands/mdb/gnu_sym.c index bb4b521ee..626de5c5b 100644 --- a/commands/mdb/gnu_sym.c +++ b/commands/mdb/gnu_sym.c @@ -13,11 +13,7 @@ #include #include #include -#ifdef __NBSD_LIBC #include -#else -#include -#endif #include "proto.h" #define NN_UNDF 0 diff --git a/commands/mdb/io.c b/commands/mdb/io.c index 7df8146c8..fc8e7f0d0 100644 --- a/commands/mdb/io.c +++ b/commands/mdb/io.c @@ -74,24 +74,9 @@ int Printf(const char *format, ...) { va_list ap; int retval; -#ifndef __NBSD_LIBC - FILE tmp_stream; - - va_start(ap, format); - - tmp_stream._fd = -1; - tmp_stream._flags = _IOWRITE + _IONBF + _IOWRITING; - tmp_stream._buf = (unsigned char *) outbuf; - tmp_stream._ptr = (unsigned char *) outbuf; - tmp_stream._count = 512; - - retval = _doprnt(format, ap, &tmp_stream); - putc('\0',&tmp_stream); -#else va_start(ap, format); retval = vsnprintf(outbuf, OUTBUFSIZE, format, ap); -#endif va_end(ap); outstr(outbuf); diff --git a/commands/nonamed/Makefile b/commands/nonamed/Makefile index 5f25bbeca..251068e78 100644 --- a/commands/nonamed/Makefile +++ b/commands/nonamed/Makefile @@ -1,6 +1,4 @@ PROG= nonamed MAN= -CPPFLAGS+=-D__NBSD_LIBC - .include diff --git a/commands/nonamed/nonamed.c b/commands/nonamed/nonamed.c index 5448d1562..4d4813a07 100644 --- a/commands/nonamed/nonamed.c +++ b/commands/nonamed/nonamed.c @@ -26,10 +26,8 @@ static const char version[] = "2.7"; #include #include #include -#ifdef __NBSD_LIBC #include #include -#endif #include #include #include @@ -47,12 +45,10 @@ static const char version[] = "2.7"; #include -#ifdef __NBSD_LIBC #undef HTONL #undef HTONS #define HTONL htonl #define HTONS htons -#endif #define HTTL 3600L /* Default time to live for /etc/hosts data. */ #define SHORT_TIMEOUT 2 /* If you expect an answer soon. */ @@ -358,31 +354,15 @@ static void dns_tell(int indent, dns_t *dp, size_t size) if (size < sizeof(HEADER)) return; printf("%*s", indent, ""); -#ifdef __NBSD_LIBC printf("DNS %s:", (dp->hdr.qr) ? "reply" : "query"); r = dp->hdr.rcode; -#else - printf("DNS %s:", (dp->hdr.dh_flag1 & DHF_QR) ? "reply" : "query"); - r= dp->hdr.dh_flag2 & DHF_RCODE; -#endif printf(" %s", r < arraysize(rcodes) ? rcodes[r] : itoa("ERR_%lu", r)); -#ifdef __NBSD_LIBC if (dp->hdr.aa) printf(" AA"); if (dp->hdr.tc) printf(" TC"); if (dp->hdr.rd) printf(" RD"); if (dp->hdr.ra) printf(" RA"); if (dp->hdr.ad) printf(" AD"); if (dp->hdr.cd) printf(" CD"); -#else - if (dp->hdr.dh_flag1 & DHF_AA) printf(" AA"); - if (dp->hdr.dh_flag1 & DHF_TC) printf(" TC"); - if (dp->hdr.dh_flag1 & DHF_RD) printf(" RD"); - if (dp->hdr.dh_flag2 & DHF_RA) printf(" RA"); -#ifdef DHF_AD - if (dp->hdr.dh_flag2 & DHF_AD) printf(" AD"); - if (dp->hdr.dh_flag2 & DHF_CD) printf(" CD"); -#endif -#endif fputc('\n', stdout); count[0]= ntohs(dp->hdr.dh_qdcount); @@ -421,11 +401,7 @@ static u32_t dns_ttl(dns_t *dp, size_t size, u32_t delta) dlim= dns2oct(dp) + size; if (size < sizeof(HEADER)) return 0; -#ifdef __NBSD_LIBC rcode= dp->hdr.rcode; -#else - rcode= dp->hdr.dh_flag2 & DHF_RCODE; -#endif count[0]= ntohs(dp->hdr.dh_qdcount); count[1]= ntohs(dp->hdr.dh_ancount); count[2]= ntohs(dp->hdr.dh_nscount); @@ -929,7 +905,6 @@ static int query_hosts(u8_t *qname, unsigned type, dns_t *dp, size_t *pdlen) if (single) return 0; /* Assume we can answer. */ -#ifdef __NBSD_LIBC dns.hdr.qr = 1; dns.hdr.opcode = 0; dns.hdr.aa = 1; @@ -940,10 +915,6 @@ static int query_hosts(u8_t *qname, unsigned type, dns_t *dp, size_t *pdlen) dns.hdr.ad = 0; dns.hdr.cd = 0; dns.hdr.rcode = 0; -#else - dns.hdr.dh_flag1= DHF_QR | DHF_AA; - dns.hdr.dh_flag2= DHF_RA; -#endif dns.hdr.dh_qdcount= HTONS(1); ancount= 0; dns.hdr.dh_nscount= HTONS(0); @@ -1080,7 +1051,6 @@ static int query_chaos(u8_t *qname, unsigned type, dns_t *dp, size_t *pdlen) if (type != HTONS(T_TXT) || namecmp(qname, "version.bind") != 0) return 0; -#ifdef __NBSD_LIBC dns.hdr.qr = 1; dns.hdr.opcode = 0; dns.hdr.aa = 1; @@ -1091,10 +1061,6 @@ static int query_chaos(u8_t *qname, unsigned type, dns_t *dp, size_t *pdlen) dns.hdr.ad = 0; dns.hdr.cd = 0; dns.hdr.rcode = 0; -#else - dns.hdr.dh_flag1= DHF_QR | DHF_AA; - dns.hdr.dh_flag2= DHF_RA; -#endif dns.hdr.dh_qdcount= HTONS(1); dns.hdr.dh_ancount= HTONS(1); dns.hdr.dh_nscount= HTONS(0); @@ -1162,11 +1128,7 @@ static void cache_reply(dns_t *dp, size_t dlen) u8_t name[MAXDNAME]; u32_t minttl; -#if __NBSD_LIBC if ((dp->hdr.rd && !dp->hdr.tc)) return; -#else - if ((dp->hdr.dh_flag1 & (DHF_RD | DHF_TC)) != DHF_RD) return; -#endif if (dp->hdr.dh_qdcount != HTONS(1)) return; cp= dp->data; r= dn_expand(dns2oct(dp), dns2oct(dp) + dlen, cp, name, MAXDNAME); @@ -1250,27 +1212,16 @@ static int compose_reply(dns_t *dp, size_t *pdlen) /* Remember ID and RD. */ id= dp->hdr.dh_id; -#ifdef __NBSD_LIBC rd= dp->hdr.rd; -#else - rd= dp->hdr.dh_flag1 & DHF_RD; -#endif if (r == -1) { /* Malformed query, reply "FORMERR". */ -#ifdef __NBSD_LIBC dp->hdr.tc = 0; dp->hdr.qr = 1; dp->hdr.aa = 1; dp->hdr.unused = 0; dp->hdr.ra = 1; dp->hdr.rcode = FORMERR; -#else - dp->hdr.dh_flag1 &= ~(DHF_TC); - dp->hdr.dh_flag1 |= DHF_QR | DHF_AA; - dp->hdr.dh_flag2 &= ~(DHF_UNUSED | DHF_RCODE); - dp->hdr.dh_flag2 |= DHF_RA | FORMERR; -#endif } else if (class == HTONS(C_IN) && query_hosts(name, type, dp, pdlen)) { /* Answer to this query is in the hosts file. */ @@ -1279,11 +1230,7 @@ static int compose_reply(dns_t *dp, size_t *pdlen) if (class == HTONS(C_IN) && (qp= get_query(name, type)) != nil) { /* Answer to this query is present in the cache. */ memcpy(dp, &qp->dns, dlen= qp->size); -#ifdef __NBSD_LIBC dp->hdr.aa = 1; -#else - dp->hdr.dh_flag1 &= ~DHF_AA; -#endif (void) dns_ttl(dp, dlen, now - qp->age); if (rd) { if (qp->stale <= now) { @@ -1302,34 +1249,20 @@ static int compose_reply(dns_t *dp, size_t *pdlen) /* No real name daemon present, or this name has a repeated top level * domain sequence. Reply "no such domain". */ -#ifdef __NBSD_LIBC dp->hdr.tc = 0; dp->hdr.qr = 1; dp->hdr.aa = 1; dp->hdr.unused = 0; dp->hdr.ra = 1; dp->hdr.rcode = NXDOMAIN; -#else - dp->hdr.dh_flag1 &= ~(DHF_TC); - dp->hdr.dh_flag1 |= DHF_QR | DHF_AA; - dp->hdr.dh_flag2 &= ~(DHF_UNUSED | DHF_RCODE); - dp->hdr.dh_flag2 |= DHF_RA | NXDOMAIN; -#endif } else if (!rd) { /* "Recursion Desired" is off, so don't bother to relay. */ -#ifdef __NBSD_LIBC dp->hdr.tc = 0; dp->hdr.qr = 1; dp->hdr.unused = 0; dp->hdr.ra = 1; dp->hdr.rcode = NOERROR; -#else - dp->hdr.dh_flag1 &= ~(DHF_TC); - dp->hdr.dh_flag1 |= DHF_QR; - dp->hdr.dh_flag2 &= ~(DHF_UNUSED | DHF_RCODE); - dp->hdr.dh_flag2 |= DHF_RA | NOERROR; -#endif } else { /* Caller needs to consult with a real name daemon. */ return 0; @@ -1337,12 +1270,7 @@ static int compose_reply(dns_t *dp, size_t *pdlen) /* Copy ID and RD back to answer. */ dp->hdr.dh_id= id; -#ifdef __NBSD_LIBC dp->hdr.rd = rd; -#else - dp->hdr.dh_flag1 &= ~DHF_RD; - dp->hdr.dh_flag1 |= rd; -#endif *pdlen= dlen; return 1; } @@ -1395,7 +1323,6 @@ static void refresh_cache(void) dlen= cp - dns2oct(&udp.dns); udp.dns.hdr.dh_id= new_id(ID_REFRESH, my_port, ID_IPSELF); -#ifdef __NBSD_LIBC udp.dns.hdr.qr = 0; udp.dns.hdr.opcode = 0; udp.dns.hdr.aa = 0; @@ -1407,10 +1334,6 @@ static void refresh_cache(void) udp.dns.hdr.ad = 0; udp.dns.hdr.cd = 0; udp.dns.hdr.rcode = 0; -#else - udp.dns.hdr.dh_flag1= DHF_RD; - udp.dns.hdr.dh_flag2= 0; -#endif udp.dns.hdr.dh_qdcount= HTONS(1); udp.dns.hdr.dh_ancount= HTONS(0); udp.dns.hdr.dh_nscount= HTONS(0); @@ -1473,13 +1396,7 @@ static int job_read_udp(void *data, int expired) /* Check, and if necessary reinitialize my configuration. */ init_config(udp.hdr.uih_dst_addr); - if ( -#ifdef __NBSD_LIBC - udp.dns.hdr.qr -#else - udp.dns.hdr.dh_flag1 & DHF_QR -#endif - ) { + if (udp.dns.hdr.qr) { /* This is a remote named reply, not a query. */ /* Response to a query previously relayed? */ @@ -2038,7 +1955,6 @@ static void named_probe(ipaddr_t ip) * "What are the name servers for the root domain?" */ udp.dns.hdr.dh_id= new_id(ID_PROBE, my_port, ID_IPSELF); -#ifdef __NBSD_LIBC udp.dns.hdr.qr = 0; udp.dns.hdr.opcode = 0; udp.dns.hdr.aa = 0; @@ -2049,10 +1965,6 @@ static void named_probe(ipaddr_t ip) udp.dns.hdr.ad = 0; udp.dns.hdr.cd = 0; udp.dns.hdr.rcode = 0; -#else - udp.dns.hdr.dh_flag1= 0; - udp.dns.hdr.dh_flag2= 0; -#endif udp.dns.hdr.dh_qdcount= HTONS(1); udp.dns.hdr.dh_ancount= HTONS(0); udp.dns.hdr.dh_nscount= HTONS(0); diff --git a/commands/pwdauth/pwdauth.c b/commands/pwdauth/pwdauth.c index aef1fb4a6..7951731de 100644 --- a/commands/pwdauth/pwdauth.c +++ b/commands/pwdauth/pwdauth.c @@ -23,10 +23,8 @@ #include #include -#ifdef __NBSD_LIBC #define setkey pwdauth_setkey #define encrypt pwdauth_encrypt -#endif #define LEN 1024 diff --git a/commands/rarpd/rarpd.c b/commands/rarpd/rarpd.c index d989a5ad9..cf4a6b419 100644 --- a/commands/rarpd/rarpd.c +++ b/commands/rarpd/rarpd.c @@ -40,10 +40,8 @@ Changed: Dec 11, 2000 by Kees J. Bot #define MAX_RARP_RETRIES 5 #define RARP_TIMEOUT 5 -#ifdef __NBSD_LIBC #undef HTONS #define HTONS htons -#endif typedef struct rarp46 { diff --git a/commands/reboot/Makefile b/commands/reboot/Makefile index 18497691d..91c6cee4e 100644 --- a/commands/reboot/Makefile +++ b/commands/reboot/Makefile @@ -12,6 +12,4 @@ SYMLINKS+= ${BINDIR}/reboot /usr/bin/reboot MAN.shutdown= MAN.halt= -CPPFLAGS+= -D__NBSD_LIBC - .include diff --git a/commands/reboot/log.c b/commands/reboot/log.c index 74e7bd0f4..53633713d 100644 --- a/commands/reboot/log.c +++ b/commands/reboot/log.c @@ -51,17 +51,9 @@ void write_log(char *wtmpfile) fd = open(wtmpfile,O_APPEND|O_WRONLY|O_CREAT,1); if (fd) { if (strcmp(prog,"reboot")) -#ifdef __NBSD_LIBC strcpy (wtmp.ut_name, prog); -#else - strcpy (wtmp.ut_user, prog); -#endif else -#ifdef __NBSD_LIBC strcpy (wtmp.ut_name, "shutdown"); /* last ... */ -#else - strcpy (wtmp.ut_user, "shutdown"); /* last ... */ -#endif strcpy (wtmp.ut_id, "~~"); strcpy (wtmp.ut_line, "~"); wtmp.ut_pid = 0; diff --git a/commands/reboot/shutdown.c b/commands/reboot/shutdown.c index c5e40873a..9c381415f 100644 --- a/commands/reboot/shutdown.c +++ b/commands/reboot/shutdown.c @@ -383,13 +383,8 @@ int crash_check() crashed = (lseek(fd, - (off_t) sizeof(last), SEEK_END) == -1 || read(fd, (void *) &last, sizeof(last)) != sizeof(last) || last.ut_line[0] != '~' -#ifdef __NBSD_LIBC || (strncmp(last.ut_name, "shutdown", sizeof(last.ut_name)) - && strncmp(last.ut_name, "halt", sizeof(last.ut_name))) -#else - || (strncmp(last.ut_user, "shutdown", sizeof(last.ut_user)) - && strncmp(last.ut_user, "halt", sizeof(last.ut_user))) -#endif + && strncmp(last.ut_name, "halt", sizeof(last.ut_name))) ); close(fd); return crashed; diff --git a/commands/stty/stty.c b/commands/stty/stty.c index 1a14226ce..8e8f6c65e 100644 --- a/commands/stty/stty.c +++ b/commands/stty/stty.c @@ -15,9 +15,7 @@ #include #include #endif -#ifdef __NBSD_LIBC #include -#endif /* Default settings, the Minix ones are defined in */ diff --git a/commands/syslogd/Makefile b/commands/syslogd/Makefile index 01e2a2d14..09e1ab69b 100644 --- a/commands/syslogd/Makefile +++ b/commands/syslogd/Makefile @@ -6,7 +6,6 @@ PROG= syslogd PIDFILE= -DPIDFILE=\"/var/run/syslogd.pid\" CPPFLAGS+= -Ddebug=0 ${PIDFILE} -CPPFLAGS+= -D__NBSD_LIBC BINMODE= 700 MAN= diff --git a/commands/syslogd/syslogd.c b/commands/syslogd/syslogd.c index 49c9e2b44..21b5437c8 100644 --- a/commands/syslogd/syslogd.c +++ b/commands/syslogd/syslogd.c @@ -498,11 +498,7 @@ void cfline(char *line, struct filed * fLog) while (strchr(", ;", *q)) q++; /* Decode priority name */ -#ifdef __NBSD_LIBC pri = decode(buf, prioritynames); -#else - pri = decode(buf, PriNames); -#endif if (pri < 0) { sprintf(xbuf, "unknown priority name \"%s\"", buf); logerror(xbuf); @@ -520,11 +516,7 @@ void cfline(char *line, struct filed * fLog) fLog->f_pmask[ix] = pri; } } else { -#ifdef __NBSD_LIBC ix = decode(buf, facilitynames); -#else - ix = decode(buf, FacNames); -#endif if (ix < 0) { sprintf(xbuf, "unknown facility name \"%s\"", buf); logerror(xbuf); diff --git a/commands/tcpstat/Makefile b/commands/tcpstat/Makefile index 37d123357..298b47f3d 100644 --- a/commands/tcpstat/Makefile +++ b/commands/tcpstat/Makefile @@ -1,8 +1,6 @@ PROG= tcpstat CPPFLAGS+= -I${NETBSDSRCDIR}/servers -D'ARGS(a)=a' -# LSC Force inet.h to use ioc_net.h -CPPFLAGS+= -D__NBSD_LIBC MAN= .include diff --git a/commands/udpstat/Makefile b/commands/udpstat/Makefile index 07c321ed3..8d0894d5e 100644 --- a/commands/udpstat/Makefile +++ b/commands/udpstat/Makefile @@ -2,7 +2,4 @@ PROG= udpstat CPPFLAGS+= -I${NETBSDSRCDIR}/servers -D'ARGS(a)=a' MAN= -# LSC Force inet.h to use sys/ioc_net.h -CPPFLAGS+= -D__NBSD_LIBC - .include diff --git a/commands/writeisofs/Makefile b/commands/writeisofs/Makefile index 1355e8826..001a6a161 100644 --- a/commands/writeisofs/Makefile +++ b/commands/writeisofs/Makefile @@ -1,7 +1,4 @@ PROG= writeisofs MAN= -# LSC Prevent redefinition ot types -CPPFLAGS.writeisofs.c+= -D__NBSD_LIBC - .include diff --git a/commands/writeisofs/writeisofs.c b/commands/writeisofs/writeisofs.c index 55bdf53b9..4b0ae0ea4 100644 --- a/commands/writeisofs/writeisofs.c +++ b/commands/writeisofs/writeisofs.c @@ -21,12 +21,6 @@ extern char *optarg; extern int optind; -#ifndef __NBSD_LIBC -typedef unsigned char u_int8_t; -typedef unsigned short int u_int16_t; -typedef unsigned long int u_int32_t; -#endif - #ifndef min #define min(a,b) ((a) < (b) ? (a) : (b)) #endif diff --git a/drivers/random/random.c b/drivers/random/random.c index 7973b12fa..fa76481c4 100644 --- a/drivers/random/random.c +++ b/drivers/random/random.c @@ -12,11 +12,7 @@ that data into a seed for a psuedo random number generator. #include "assert.h" #include "random.h" -#ifdef __NBSD_LIBC #include -#else -#include -#endif #include "aes/rijndael.h" #define N_DERIV 16 diff --git a/include/env.h b/include/env.h index 2f6f64d77..eb115724c 100644 --- a/include/env.h +++ b/include/env.h @@ -1,5 +1,3 @@ -#ifdef __NBSD_LIBC -#endif int env_parse(char *env, char *fmt, int field, long *param, long min, long max); void env_panic(char *env); diff --git a/include/lib.h b/include/lib.h index 6677a3c51..0ddf280e6 100644 --- a/include/lib.h +++ b/include/lib.h @@ -6,13 +6,7 @@ #define _LIB_H /* First come the defines. */ -#ifdef __NBSD_LIBC #include /* tell headers to include NetBSD stuff. */ -#else /* !__NBSD_LIBC */ -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#endif - -#define _NETBSD_SOURCE 1 /* tell headers to include MINIX stuff */ /* The following are so basic, all the lib files get them automatically. */ #include /* must be first */ @@ -27,7 +21,6 @@ #include - int __execve(const char *_path, char *const _argv[], char *const _envp[], int _nargs, int _nenvps); int _syscall(endpoint_t _who, int _syscallnr, message *_msgptr); diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 85f3d8c87..a0f881365 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -1,8 +1,6 @@ #ifndef _IPC_H #define _IPC_H -#ifdef __NBSD_LIBC -#endif #include #include #include diff --git a/include/minix/minlib.h b/include/minix/minlib.h index 6a10450c2..52059eb5a 100644 --- a/include/minix/minlib.h +++ b/include/minix/minlib.h @@ -5,12 +5,6 @@ /* Miscellaneous BSD. */ char *itoa(int _n); -#ifndef __NBSD_LIBC -char *getpass(const char *_prompt); -#ifdef __ACK__ -void swab(char *_from, char *_to, int _count); -#endif -#endif /* !_NBSD_LIBC */ /* Miscellaneous MINIX. */ void std_err(const char *_s); diff --git a/include/minix/mthread.h b/include/minix/mthread.h index 1ac6b0c70..54281adc8 100644 --- a/include/minix/mthread.h +++ b/include/minix/mthread.h @@ -9,9 +9,7 @@ #include #include #include -#ifdef __NBSD_LIBC #include -#endif typedef int mthread_thread_t; typedef int mthread_once_t; diff --git a/include/minix/termios.h b/include/minix/termios.h index 2ca2b96af..ec9bc259a 100644 --- a/include/minix/termios.h +++ b/include/minix/termios.h @@ -74,18 +74,6 @@ struct termios { #define VSTART 9 /* cc_c[VSTART] = START char (^S) */ #define VSTOP 10 /* cc_c[VSTOP] = STOP char (^Q) */ -#ifdef __NBSD_LIBC -/* This is defined in in NetBSD headers. */ -#else /* !__NBSD_LIBC */ -#define _POSIX_VDISABLE (cc_t)0xFF /* You can't even generate this - * character with 'normal' keyboards. - * But some language specific keyboards - * can generate 0xFF. It seems that all - * 256 are used, so cc_t should be a - * short... - */ -#endif /* !__NBSD_LIBC */ - /* Values for the baud rate settings. POSIX Table 7-6. */ #define B0 0x0000 /* hang up the line */ #define B50 0x1000 /* 50 baud */ diff --git a/include/net/gen/dhcp.h b/include/net/gen/dhcp.h index 911d29380..15be0e76d 100644 --- a/include/net/gen/dhcp.h +++ b/include/net/gen/dhcp.h @@ -32,11 +32,7 @@ typedef struct dhcp { #define DHCP_FLAGS_BCAST 0x8000U /* Reply must be broadcast to client. */ /* "Magic" first four option bytes. */ -#ifdef __NBSD_LIBC #define DHCP_MAGIC htonl(0x63825363UL) -#else -#define DHCP_MAGIC HTONL(0x63825363UL) -#endif /* DHCP common tags: */ #define DHCP_TAG_NETMASK 1 /* Netmask. */ diff --git a/include/sys/elf_generic.h b/include/sys/elf_generic.h index 9a715f546..f02ce8f2d 100644 --- a/include/sys/elf_generic.h +++ b/include/sys/elf_generic.h @@ -50,18 +50,11 @@ #error "Unknown byte order" #endif -#ifdef __NBSD_LIBC #define CONCAT(x,y) __CONCAT(x,y) #define __elfN(x) CONCAT(CONCAT(CONCAT(elf,__ELF_WORD_SIZE),_),x) #define __ElfN(x) CONCAT(CONCAT(CONCAT(Elf,__ELF_WORD_SIZE),_),x) #define __ELFN(x) CONCAT(CONCAT(CONCAT(ELF,__ELF_WORD_SIZE),_),x) #define __ElfType(x) typedef __ElfN(x) __CONCAT(Elf_,x) -#else -#define __elfN(x) __CONCAT(__CONCAT(__CONCAT(elf,__ELF_WORD_SIZE),_),x) -#define __ElfN(x) __CONCAT(__CONCAT(__CONCAT(Elf,__ELF_WORD_SIZE),_),x) -#define __ELFN(x) __CONCAT(__CONCAT(__CONCAT(ELF,__ELF_WORD_SIZE),_),x) -#define __ElfType(x) typedef __ElfN(x) __CONCAT(Elf_,x) -#endif __ElfType(Addr); __ElfType(Half); diff --git a/lib/libc/minix/minix-malloc-debug.c b/lib/libc/minix/minix-malloc-debug.c index 848d0f424..6fe777482 100644 --- a/lib/libc/minix/minix-malloc-debug.c +++ b/lib/libc/minix/minix-malloc-debug.c @@ -124,13 +124,9 @@ static struct block *block_alloc(size_t size) assert(ptr_min < ptr_max); /* select address at random */ -#ifdef __NBSD_LIBC tsc = 0; -#else - tsc = 0; - /* LSC Broken for now... */ - /* read_tsc_64(&tsc); */ -#endif + /* LSC FIXME Broken for now... */ + /* read_tsc_64(&tsc); */ totalsize = block_get_totalsize(size); page_index_max = (ptr_max - ptr_min - totalsize) / PAGE_SIZE; page_index = (page_index_max > 0) ? (ex64lo(tsc) % page_index_max) : 0; diff --git a/libexec/Makefile.inc b/libexec/Makefile.inc index a12a65b66..41c5d26e0 100644 --- a/libexec/Makefile.inc +++ b/libexec/Makefile.inc @@ -1,7 +1,6 @@ # $NetBSD: Makefile.inc,v 1.9 2012/06/19 06:10:09 dholland Exp $ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 .if defined(__MINIX) -CPPFLAGS+= -D__NBSD_LIBC=1 USE_FORT?= no .else USE_FORT?= yes # network server diff --git a/servers/inet/generic/rand256.c b/servers/inet/generic/rand256.c index f75777532..631cbe0fa 100644 --- a/servers/inet/generic/rand256.c +++ b/servers/inet/generic/rand256.c @@ -6,11 +6,7 @@ Created: Oct 2000 by Philip Homburg Generate 256-bit random numbers */ -#ifdef __NBSD_LIBC #include -#else -#include -#endif #include "inet.h" #include "rand256.h" diff --git a/servers/inet/inet.h b/servers/inet/inet.h index 2e1b92224..684f3b622 100644 --- a/servers/inet/inet.h +++ b/servers/inet/inet.h @@ -53,11 +53,7 @@ typedef int ioreq_t; #include #include -#ifdef __NBSD_LIBC #include -#else -#include -#endif #include "const.h" #include "inet_config.h" diff --git a/servers/inet/inet_config.h b/servers/inet/inet_config.h index 25326e369..075f27ec7 100644 --- a/servers/inet/inet_config.h +++ b/servers/inet/inet_config.h @@ -79,22 +79,16 @@ extern struct ip_conf ip_conf[IP_PORT_MAX]; extern struct tcp_conf tcp_conf[IP_PORT_MAX]; extern struct udp_conf udp_conf[IP_PORT_MAX]; void read_conf(void); -#ifdef __NBSD_LIBC extern void *sbrk(int); -#else -extern char *sbrk(int); -#endif void *alloc(size_t size); /* Options */ extern int ip_forward_directed_bcast; -#ifdef __NBSD_LIBC #undef HTONL #undef HTONS #define HTONL htonl #define HTONS htons -#endif #endif /* INET__INET_CONFIG_H */ diff --git a/servers/init/Makefile b/servers/init/Makefile index d3f1f5b78..95d47b394 100644 --- a/servers/init/Makefile +++ b/servers/init/Makefile @@ -4,7 +4,6 @@ PROG= init SRCS= init.c -CPPFLAGS.init.c+= -D__NBSD_LIBC MAN= BINDIR?= /usr/sbin diff --git a/servers/init/init.c b/servers/init/init.c index 445eaf88e..f9f6499a6 100644 --- a/servers/init/init.c +++ b/servers/init/init.c @@ -29,16 +29,8 @@ #include #include -#ifdef __NBSD_LIBC /* Different ttyent structure. */ struct ttyent TT_REBOOT = { "console", "shutdown -d now CTRL-ALT_DEL", "-"}; -#else -/* Command to execute as a response to the three finger salute. */ -char *REBOOT_CMD[] = { "shutdown", "-d", "now", "CTRL-ALT-DEL", NULL }; - -/* Associated fake ttytab entry. */ -struct ttyent TT_REBOOT = { "console", "-", REBOOT_CMD, NULL }; -#endif char PATH_UTMP[] = "/etc/utmp"; /* current logins */ char PATH_WTMP[] = "/usr/adm/wtmp"; /* login/logout history */ @@ -65,9 +57,7 @@ void report(int fd, char *label); void wtmp(int type, int linenr, char *line, pid_t pid); void startup(int linenr, struct ttyent *ttyp); int execute(char **cmd); -#ifdef __NBSD_LIBC char **construct_argv(char *cmd); -#endif void onhup(int sig); void onterm(int sig); void onabrt(int sig); @@ -192,13 +182,9 @@ int main(void) if ((ttyp = getttyent()) == NULL) break; if (ttyp->ty_getty != NULL -#ifdef __NBSD_LIBC /* ty_getty is a string, and TTY_ON is * the way to check for enabled ternimanls. */ && (ttyp->ty_status & TTY_ON) -#else - && ttyp->ty_getty[0] != NULL -#endif && slotp->pid == NO_PID && slotp->errct < ERRCT_DISABLE) { @@ -238,12 +224,7 @@ void startup(int linenr, struct ttyent *ttyp) pid_t pid; /* new pid */ int err[2]; /* error reporting pipe */ char line[32]; /* tty device name */ -#ifndef __NBSD_LIBC - int status; -#endif -#ifdef __NBSD_LIBC char **ty_getty_argv; -#endif slotp = &slots[linenr]; @@ -276,44 +257,9 @@ void startup(int linenr, struct ttyent *ttyp) _exit(1); } -#ifdef __NBSD_LIBC - /* ty_init not present. */ -#else - if (ttyp->ty_init != NULL && ttyp->ty_init[0] != NULL) { - /* Execute a command to initialize the terminal line. */ - - if ((pid = fork()) == -1) { - report(2, "fork()"); - errno= 0; - write(err[1], &errno, sizeof(errno)); - _exit(1); - } - - if (pid == 0) { - alarm(10); - execute(ttyp->ty_init); - report(2, ttyp->ty_init[0]); - _exit(1); - } - - while (waitpid(pid, &status, 0) != pid) {} - if (status != 0) { - tell(2, "init: "); - tell(2, ttyp->ty_name); - tell(2, ": "); - tell(2, ttyp->ty_init[0]); - tell(2, ": bad exit status\n"); - errno = 0; - write(err[1], &errno, sizeof(errno)); - _exit(1); - } - } -#endif - /* Redirect standard error too. */ dup2(0, 2); -#ifdef __NBSD_LIBC /* Construct argv for execute() */ ty_getty_argv = construct_argv(ttyp->ty_getty); if (ty_getty_argv == NULL) @@ -321,18 +267,10 @@ void startup(int linenr, struct ttyent *ttyp) /* Execute the getty process. */ execute(ty_getty_argv); -#else - /* Execute the getty process. */ - execute(ttyp->ty_getty); -#endif /* Oops, disaster strikes. */ fcntl(2, F_SETFL, fcntl(2, F_GETFL) | O_NONBLOCK); -#ifdef __NBSD_LIBC if (linenr != 0) report(2, ty_getty_argv[0]); -#else - if (linenr != 0) report(2, ttyp->ty_getty[0]); -#endif write(err[1], &errno, sizeof(errno)); _exit(1); } diff --git a/servers/iso9660fs/read.c b/servers/iso9660fs/read.c index 012ee2bd7..bd097581f 100644 --- a/servers/iso9660fs/read.c +++ b/servers/iso9660fs/read.c @@ -2,9 +2,7 @@ #include #include #include -#ifdef __NBSD_LIBC #include -#endif #include "buf.h" static char getdents_buf[GETDENTS_BUFSIZ]; diff --git a/servers/mfs/mfsdir.h b/servers/mfs/mfsdir.h index 3a3f32295..3cfd7c6db 100644 --- a/servers/mfs/mfsdir.h +++ b/servers/mfs/mfsdir.h @@ -1,9 +1,7 @@ #ifndef _MFSDIR_H #define _MFSDIR_H -#ifdef __NBSD_LIBC #include -#endif #include /* Maximum Minix MFS on-disk directory filename. @@ -17,10 +15,6 @@ struct direct { ino_t mfs_d_ino; char mfs_d_name[MFS_DIRSIZ]; -#ifdef __NBSD_LIBC } __packed; -#else -}; -#endif #endif /* _MFSDIR_H */ diff --git a/servers/pfs/inc.h b/servers/pfs/inc.h index 34fa24906..b08231780 100644 --- a/servers/pfs/inc.h +++ b/servers/pfs/inc.h @@ -4,12 +4,7 @@ #define VERBOSE 0 /* display diagnostics */ -#ifdef __NBSD_LIBC #include -#else -#include -#endif - #include #include #include diff --git a/servers/pm/misc.c b/servers/pm/misc.c index dbe979fbf..dcf535e3b 100644 --- a/servers/pm/misc.c +++ b/servers/pm/misc.c @@ -477,11 +477,7 @@ int do_svrctl() extern char *_brksize; int brk(brk_addr) -#ifdef __NBSD_LIBC void *brk_addr; -#else -char *brk_addr; -#endif { int r; /* PM wants to call brk() itself. */ diff --git a/servers/vfs/select.c b/servers/vfs/select.c index 3fc08dac3..d62f4aa10 100644 --- a/servers/vfs/select.c +++ b/servers/vfs/select.c @@ -547,11 +547,7 @@ static int copy_fdsets(struct selectentry *se, int nfds, int direction) panic("select copy_fdsets: nfds wrong: %d", nfds); /* Only copy back as many bits as the user expects. */ -#ifdef __NBSD_LIBC fd_setsize = (size_t) (howmany(nfds, __NFDBITS) * sizeof(__fd_mask)); -#else - fd_setsize = (size_t) (_FDSETWORDS(nfds) * _FDSETBITSPERWORD/8); -#endif /* Set source and destination endpoints */ src_e = (direction == FROM_PROC) ? se->req_endpt : SELF; diff --git a/share/mk/minix.bootprog.mk b/share/mk/minix.bootprog.mk index effb18145..bb5bcb08c 100644 --- a/share/mk/minix.bootprog.mk +++ b/share/mk/minix.bootprog.mk @@ -22,7 +22,4 @@ LDADD+= -L/usr/pkg/compiler-rt/lib -lCompilerRT-Generic -lsys -lCompilerRT-Gener # 3. Minimal C library LDADD+= -lminc -# Some define still needed, hopefully will go away soon -CPPFLAGS+= -D__NBSD_LIBC - .include diff --git a/usr.sbin/mkfs.mfs/Makefile b/usr.sbin/mkfs.mfs/Makefile index 08416d2c1..82c7efddc 100644 --- a/usr.sbin/mkfs.mfs/Makefile +++ b/usr.sbin/mkfs.mfs/Makefile @@ -3,9 +3,6 @@ SRCS= mkfs.c BINDIR= /sbin MAN= -# LSC Adding this to activate the getline renaming macro -CPPFLAGS+= -D__NBSD_LIBC - .if ${HOST_OSTYPE:C/\-.*//:U} == "Minix" || !defined(HOSTPROGNAME) LDADD+= -lminlib -lcompat_minix .endif diff --git a/usr.sbin/mkfs.mfs/mfsdir.h b/usr.sbin/mkfs.mfs/mfsdir.h index ea4c71cd3..3610c1ab1 100644 --- a/usr.sbin/mkfs.mfs/mfsdir.h +++ b/usr.sbin/mkfs.mfs/mfsdir.h @@ -12,10 +12,6 @@ struct direct { uint32_t mfs_d_ino; char mfs_d_name[MFS_DIRSIZ]; -#ifdef __NBSD_LIBC } __packed; -#else -}; -#endif #endif /* _MFSDIR_H */ diff --git a/usr.sbin/mkfs.mfs/mkfs.c b/usr.sbin/mkfs.mfs/mkfs.c index c21d50d9d..b76f3c7ce 100644 --- a/usr.sbin/mkfs.mfs/mkfs.c +++ b/usr.sbin/mkfs.mfs/mkfs.c @@ -91,9 +91,7 @@ int extra_space_percent; FILE *proto; -#if defined(__NBSD_LIBC) || !defined(__minix) #define getline _mkfs_getline -#endif int main(int argc, char **argv); block_t sizeup(char *device);