From: Lionel Sambuc Date: Mon, 25 Feb 2013 11:43:15 +0000 (+0100) Subject: Removing obsolete _MINIX define X-Git-Tag: v3.3.0~1128 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=8e4736f2df923b4eb3661abc11dadcd09f5b6a20;p=minix.git Removing obsolete _MINIX define Change-Id: Id33ac7e973d1c0e249b690fe44a597474fac6076 --- diff --git a/benchmarks/unixbench-5.1.2/pgms/Makefile.inc b/benchmarks/unixbench-5.1.2/pgms/Makefile.inc index 214481361..52130c89e 100644 --- a/benchmarks/unixbench-5.1.2/pgms/Makefile.inc +++ b/benchmarks/unixbench-5.1.2/pgms/Makefile.inc @@ -1,4 +1,4 @@ -CPPFLAGS+=-DTIME -DMINIX=1 -D_MINIX=1 -D_POSIX_SOURCE=1 -I../../src/ -D_NETBSD_SOURCE +CPPFLAGS+=-DTIME -DMINIX=1 -I../../src/ HZ=60 BINDIR=/usr/benchmarks/unixbench/pgms diff --git a/commands/Makefile.inc b/commands/Makefile.inc index 2dcded8a4..cd46d6db0 100644 --- a/commands/Makefile.inc +++ b/commands/Makefile.inc @@ -1,3 +1,3 @@ -CPPFLAGS+= -D_MINIX -D_NETBSD_SOURCE -D_MINIX_COMPAT +CPPFLAGS+= -D_MINIX_COMPAT LDADD+= -lminlib -lcompat_minix -lasyn -lterminfo BINDIR?=/usr/bin diff --git a/commands/add_route/add_route.c b/commands/add_route/add_route.c index a45892cb8..29f87fc70 100644 --- a/commands/add_route/add_route.c +++ b/commands/add_route/add_route.c @@ -4,8 +4,6 @@ add_route.c Created August 7, 1991 by Philip Homburg */ -#define _POSIX_C_SOURCE 2 - #include #include #include diff --git a/commands/compress/compress.c b/commands/compress/compress.c index 6ae404b8d..256ee72b7 100644 --- a/commands/compress/compress.c +++ b/commands/compress/compress.c @@ -1591,7 +1591,7 @@ void version() #ifdef vax fprintf(stderr, "vax, "); #endif -#ifdef _MINIX +#ifdef __minix fprintf(stderr, "MINIX, "); #endif #ifdef NO_UCHAR diff --git a/commands/fetch/Makefile b/commands/fetch/Makefile index 2112a33b8..e33ddb754 100644 --- a/commands/fetch/Makefile +++ b/commands/fetch/Makefile @@ -13,7 +13,6 @@ CPPFLAGS+= -DHAVE_SYS_PARAM_H \ -DHAVE_SYSEXITS_H \ -DHAVE_UTIME_H -CPPFLAGS+= -D_POSIX_SOURCE DPADD+= ${LIBFETCH} LDADD+= -lfetch diff --git a/commands/find/find.h b/commands/find/find.h index ce4a95f24..176298401 100644 --- a/commands/find/find.h +++ b/commands/find/find.h @@ -42,7 +42,7 @@ enum ntype { N_AMIN, N_ANEWER, N_ATIME, N_CLOSEPAREN, N_CMIN, N_CNEWER, N_CTIME, N_DEPTH, N_EMPTY, N_EXEC, N_EXECDIR, N_EXIT, N_EXPR, N_FALSE, N_FOLLOW, N_FPRINT, -#ifndef _MINIX +#if !defined(__minix) N_FSTYPE, N_FLAGS, #endif diff --git a/commands/find/function.c b/commands/find/function.c index de08ef711..fea457900 100644 --- a/commands/find/function.c +++ b/commands/find/function.c @@ -377,7 +377,7 @@ f_delete(PLAN *plan __unused, FTSENT *entry) errx(1, "-delete: %s: relative path potentially not safe", entry->fts_accpath); -#ifndef _MINIX +#if !defined(__minix) /* Turn off user immutable bits if running as root */ if ((entry->fts_statp->st_flags & (UF_APPEND|UF_IMMUTABLE)) && !(entry->fts_statp->st_flags & (SF_APPEND|SF_IMMUTABLE)) && @@ -857,7 +857,7 @@ c_false(char ***argvp, int isok) } -#ifndef _MINIX +#if !defined(__minix) /* * -flags [-]flags functions -- */ @@ -955,7 +955,7 @@ c_fprint(char ***argvp, int isok) * * True if the file is of a certain type. */ -#ifndef _MINIX +#if !defined(__minix) int f_fstype(PLAN *plan, FTSENT *entry) { diff --git a/commands/find/option.c b/commands/find/option.c index cdca27c73..f30f7d8ce 100644 --- a/commands/find/option.c +++ b/commands/find/option.c @@ -70,7 +70,7 @@ static OPTION const options[] = { { "-false", N_FALSE, c_false, 0 }, { "-follow", N_FOLLOW, c_follow, 0 }, { "-fprint", N_FPRINT, c_fprint, 1 }, -#ifndef _MINIX +#if !defined(__minix) { "-flags", N_FLAGS, c_flags, 1 }, { "-fstype", N_FSTYPE, c_fstype, 1 }, #endif diff --git a/commands/finger/finger.c b/commands/finger/finger.c index 9d92e6643..e4d3517f7 100644 --- a/commands/finger/finger.c +++ b/commands/finger/finger.c @@ -120,7 +120,7 @@ int lf; /* LASTLOG file descriptor */ struct person *person1; /* list of people */ long tloc; /* current time */ -#if !_MINIX +#if !defined(__minix) char *strcpy(); char *ctime(); #endif @@ -893,7 +893,7 @@ netfinger(name) char *host; struct hostent *hp; int s, result; -#if !_MINIX +#if !defined(__minix) char *rindex(); #endif register FILE *f; @@ -1027,7 +1027,7 @@ char *name; char *mbxdir = preamble; /* string with path preamble */ char *mbxpath; /* space for entire pathname */ -#if !_MINIX +#if !defined(__minix) char *ctime(); /* convert longword time to ascii */ #endif char *timestr; diff --git a/commands/host/host.c b/commands/host/host.c index 7a732364b..fe33c36c8 100644 --- a/commands/host/host.c +++ b/commands/host/host.c @@ -16,30 +16,6 @@ * that copyright notice. */ -#if _MINIX && !defined(__NBSD_LIBC) -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#undef ERROR -#else #include #include #include @@ -60,7 +36,6 @@ #include #include #include -#endif extern int h_errno; diff --git a/commands/less/less/Makefile b/commands/less/less/Makefile index b9916e3b9..9416e8e0f 100644 --- a/commands/less/less/Makefile +++ b/commands/less/less/Makefile @@ -12,10 +12,10 @@ SRCS= brac.c ch.c charset.c cmdbuf.c command.c decode.c edit.c \ linenum.c lsystem.c main.c mark.c optfunc.c option.c opttbl.c \ os.c output.c position.c prompt.c screen.c search.c signal.c \ tags.c ttyin.c version.c -.if defined(NBSD_LIBC) && (${NBSD_LIBC} != "no") + LDADD+= -ltermcap DPADD+= ${LIBTERM} -.endif + MLINKS= less.1 more.1 less.1 page.1 LINKS= ${BINDIR}/less ${BINDIR}/more ${BINDIR}/less ${BINDIR}/page diff --git a/commands/rcp/rcp.c b/commands/rcp/rcp.c index baa3610c4..2087a7bef 100644 --- a/commands/rcp/rcp.c +++ b/commands/rcp/rcp.c @@ -20,7 +20,6 @@ static char sccsid[] = "@(#)rcp.c 1.1 87/12/21 SMI"; /* from UCB 5.3 6/8/85"*/ * rcp */ -#undef _MINIX #define NAMESERVER #include diff --git a/commands/rsh/rsh.c b/commands/rsh/rsh.c index 377eb8fc2..2c308f8c4 100644 --- a/commands/rsh/rsh.c +++ b/commands/rsh/rsh.c @@ -48,7 +48,7 @@ static char sccsid[] = "@(#)rsh.c 5.24 (Berkeley) 7/1/91"; * $Header$ */ -#if _MINIX +#if defined(__minix) #include #include #include @@ -118,7 +118,7 @@ main(argc, argv) int argoff, asrsh, ch, dflag, nflag, one, pid, rem, uid; register char *p; char *args, *host, *user; -#if !_MINIX +#if !defined(__minix) char *copyargs(); void sendsig(); #endif @@ -294,7 +294,7 @@ try_connect: (void)fprintf(stderr, "rsh: can't establish stderr.\n"); exit(1); } -#if !_MINIX +#if !defined(__minix) if (dflag) { if (setsockopt(rem, SOL_SOCKET, SO_DEBUG, &one, sizeof(one)) < 0) @@ -308,7 +308,7 @@ try_connect: #endif (void)setuid(uid); -#if !_MINIX +#if !defined(__minix) omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGTERM)); #endif if (signal(SIGINT, SIG_IGN) != SIG_IGN) @@ -333,7 +333,7 @@ try_connect: #endif #endif { -#if _MINIX +#if defined(__minix) ; #else (void)ioctl(rfd2, FIONBIO, &one); @@ -361,11 +361,11 @@ talk(nflag, omask, pid, rem) { register int cc, wc; register char *bp; -#if !_MINIX +#if !defined(__minix) int readfrom, ready, rembits; #endif char buf[BUFSIZ]; -#if _MINIX +#if defined(__minix) int pid1; #endif @@ -378,7 +378,7 @@ reread: errno = 0; bp = buf; rewrite: -#if !_MINIX +#if !defined(__minix) rembits = 1 << rem; if (select(16, 0, &rembits, 0, 0) < 0) { if (errno != EINTR) { @@ -400,7 +400,7 @@ rewrite: #endif wc = write(rem, bp, cc); if (wc < 0) { -#if !_MINIX +#if !defined(__minix) if (errno == EWOULDBLOCK) goto rewrite; #endif @@ -412,7 +412,7 @@ rewrite: goto reread; goto rewrite; done: -#if _MINIX +#if defined(__minix) ioctl(rem, NWIOTCPSHUTDOWN, NULL); #else (void)shutdown(rem, 1); @@ -420,7 +420,7 @@ done: exit(0); } -#if _MINIX +#if defined(__minix) pid1= fork(); if (pid1 == -1) { @@ -533,7 +533,7 @@ copyargs(argv) register int cc; register char **ap, *p; char *args; -#if !_MINIX +#if !defined(__minix) char *malloc(); #endif diff --git a/commands/telnet/ttn.c b/commands/telnet/ttn.c index cabfb83e3..ba4f0c716 100644 --- a/commands/telnet/ttn.c +++ b/commands/telnet/ttn.c @@ -2,10 +2,6 @@ ttn.c */ -#ifndef _POSIX_SOURCE -#define _POSIX_SOURCE 1 -#endif - #include #include #include diff --git a/commands/umount/umount.c b/commands/umount/umount.c index 6ec9e2da5..34b3cfe6c 100644 --- a/commands/umount/umount.c +++ b/commands/umount/umount.c @@ -1,8 +1,5 @@ /* umount - unmount a file system Author: Andy Tanenbaum */ -#define _MINIX 1 /* for proto of the non-POSIX umount() */ -#define _POSIX_SOURCE 1 /* for PATH_MAX from limits.h */ - #include #include #include diff --git a/drivers/Makefile.inc b/drivers/Makefile.inc index ef189d63e..b423a45c8 100644 --- a/drivers/Makefile.inc +++ b/drivers/Makefile.inc @@ -1,4 +1,3 @@ -CPPFLAGS+= -D_MINIX -D_NETBSD_SOURCE LDADD+= -lminlib -lcompat_minix DPADD+= ${LIBMINLIB} ${LIBCOMPAT_MINIX} BINDIR?=/usr/sbin diff --git a/drivers/acpi/include/platform/acenv.h b/drivers/acpi/include/platform/acenv.h index 21e1e388f..1b9db566f 100644 --- a/drivers/acpi/include/platform/acenv.h +++ b/drivers/acpi/include/platform/acenv.h @@ -190,7 +190,7 @@ * *****************************************************************************/ -#if defined(_MINIX) || defined(__minix) +#if defined(__minix) #include "acminix.h" #elif defined(_LINUX) || defined(__linux__) diff --git a/drivers/filter/inc.h b/drivers/filter/inc.h index c54a77e0c..48a42f2f9 100644 --- a/drivers/filter/inc.h +++ b/drivers/filter/inc.h @@ -1,5 +1,4 @@ /* Filter driver - general include file */ -#define _MINIX 1 #define _SYSTEM 1 #include #include diff --git a/external/gpl3/gcc/patches/0001-minix.patch b/external/gpl3/gcc/patches/0001-minix.patch index 91a53acc9..c2a7762b4 100644 --- a/external/gpl3/gcc/patches/0001-minix.patch +++ b/external/gpl3/gcc/patches/0001-minix.patch @@ -43,7 +43,7 @@ diff -r -x CVS -N -U 3 dist.orig/gcc/gcov.c dist/gcc/gcov.c #define STRING_SIZE 200 -+#ifdef _MINIX ++#if defined(__minix) +#define block_t gcc_block_t +#endif + diff --git a/include/arpa/nameser_compat.h b/include/arpa/nameser_compat.h index 7bd56e53b..abc3c0b33 100644 --- a/include/arpa/nameser_compat.h +++ b/include/arpa/nameser_compat.h @@ -133,13 +133,13 @@ typedef struct { unsigned arcount :16; /*%< number of resource entries */ } HEADER; -#ifdef _MINIX +#if defined(__minix) && defined(_NETBSD_SOURCE) #define dh_id id #define dh_qdcount qdcount #define dh_ancount ancount #define dh_nscount nscount #define dh_arcount arcount -#endif +#endif /* defined(__minix) && defined(_NETBSD_SOURCE) */ #define PACKETSZ NS_PACKETSZ #define MAXDNAME NS_MAXDNAME diff --git a/include/lib.h b/include/lib.h index cb60ef0bd..6677a3c51 100644 --- a/include/lib.h +++ b/include/lib.h @@ -9,10 +9,10 @@ #ifdef __NBSD_LIBC #include /* tell headers to include NetBSD stuff. */ #else /* !__NBSD_LIBC */ -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ +#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ #endif -#define _MINIX 1 /* tell headers to include MINIX stuff */ +#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 */ diff --git a/include/minix/driver.h b/include/minix/driver.h index 411637bc8..2995fef45 100644 --- a/include/minix/driver.h +++ b/include/minix/driver.h @@ -3,9 +3,9 @@ /* Types and constants shared between block and character drivers. */ -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ -#define _SYSTEM 1 /* get negative error number in */ +#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ +#define _NETBSD_SOURCE 1 /* tell headers to include MINIX stuff */ +#define _SYSTEM 1 /* get negative error number in */ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ @@ -28,8 +28,8 @@ /* Base and size of a partition in bytes. */ struct device { - u64_t dv_base; - u64_t dv_size; + u64_t dv_base; + u64_t dv_size; }; /* Generic receive function for all drivers. */ diff --git a/include/minix/drivers.h b/include/minix/drivers.h index ca0974602..f7752dedb 100644 --- a/include/minix/drivers.h +++ b/include/minix/drivers.h @@ -5,9 +5,9 @@ #ifndef _INC_DRIVERS_H #define _INC_DRIVERS_H -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ -#define _SYSTEM 1 /* get negative error number in */ +#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ +#define _NETBSD_SOURCE 1 /* tell headers to include MINIX stuff */ +#define _SYSTEM 1 /* get negative error number in */ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ diff --git a/include/minix/termios.h b/include/minix/termios.h index 9ed08c918..2ca2b96af 100644 --- a/include/minix/termios.h +++ b/include/minix/termios.h @@ -166,7 +166,7 @@ int tcsetattr(int _filedes, int _opt_actions, const struct termios #define VDISCARD 13 /* cc_c[VDISCARD] (^O) */ /* Extensions to baud rate settings. */ -#ifdef _MINIX +#if defined(__minix) && defined(_NETBSD_SOURCE) #define B57600 0x0100 /* 57600 baud */ #define B115200 0x0200 /* 115200 baud */ #define B230400 0x0400 /* 230400 baud */ @@ -175,7 +175,7 @@ int tcsetattr(int _filedes, int _opt_actions, const struct termios #define B1843200 0x2000 /* 1843200 baud */ #define B3000000 0x4000 /* 3000000 baud */ #define B3686400 0x8000 /* 3686400 baud */ -#endif /* _MINIX */ +#endif /* defined(__minix) && defined(_NETBSD_SOURCE) */ /* These are the default settings used by the kernel and by 'stty sane' */ diff --git a/include/unistd.h b/include/unistd.h index 55a146bac..0ffba9f24 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -323,7 +323,7 @@ int unlinkat(int, const char *, int); */ #ifdef __minix int lseek64(int fd, u64_t _offset, int _whence, u64_t *_newpos); -#if defined(_MINIX) +#if defined(_NETBSD_SOURCE) #include int getprocnr(void); @@ -337,7 +337,7 @@ gid_t getngid(endpoint_t proc_ep); int getnucred(endpoint_t proc_ep, struct ucred *ucred); ssize_t pread64(int fd, void *buf, size_t count, u64_t where); ssize_t pwrite64(int fd, const void *buf, size_t count, u64_t where); -#endif /* __MINIX */ +#endif /* defined(_NETBSD_SOURCE) */ #endif /* __minix */ #if defined(_NETBSD_SOURCE) diff --git a/kernel/Makefile b/kernel/Makefile index 7bcde0eeb..a55dbdf28 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -19,7 +19,7 @@ LDFLAGS+= -T ${LINKERSCRIPT} LDFLAGS+= -nostdlib CFLAGS += -fno-stack-protector -CPPFLAGS+= -D_NETBSD_SOURCE -D_MINIX -D__kernel__ +CPPFLAGS+= -D__kernel__ # kernel headers are always called through kernel/*.h CPPFLAGS+= -I${NETBSDSRCDIR} diff --git a/kernel/kernel.h b/kernel/kernel.h index 03cd3bd8d..f38c22737 100644 --- a/kernel/kernel.h +++ b/kernel/kernel.h @@ -14,8 +14,6 @@ /* This is the master header for the kernel. It includes some other files * and defines the principal constants. */ -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ #define _SYSTEM 1 /* tell headers that this is the kernel */ /* diff --git a/lib/Makefile.inc b/lib/Makefile.inc index fd55c1cd1..2d5ac08ef 100644 --- a/lib/Makefile.inc +++ b/lib/Makefile.inc @@ -1,5 +1,3 @@ -.if defined(NBSD_LIBC) && (${NBSD_LIBC} == "yes") -CPPFLAGS+= -D_MINIX -D_NETBSD_SOURCE -.else -CPPFLAGS+= -D_MINIX -D_POSIX_SOURCE -.endif +# $NetBSD: Makefile.inc,v 1.7 2012/03/21 05:39:21 matt Exp $ + +#WARNS?= 5 diff --git a/lib/libc/sys-minix/minix_rs.c b/lib/libc/sys-minix/minix_rs.c index 6b3f3e9d2..e7b19fded 100644 --- a/lib/libc/sys-minix/minix_rs.c +++ b/lib/libc/sys-minix/minix_rs.c @@ -1,6 +1,6 @@ -#include #define _SYSTEM 1 -#define _MINIX 1 + +#include #include #include diff --git a/lib/libc/sys-minix/sem.c b/lib/libc/sys-minix/sem.c index afb9bb828..3726811ce 100644 --- a/lib/libc/sys-minix/sem.c +++ b/lib/libc/sys-minix/sem.c @@ -1,6 +1,5 @@ #define __USE_MISC #define _SYSTEM 1 -#define _MINIX 1 #include #include diff --git a/lib/libc/sys-minix/shmat.c b/lib/libc/sys-minix/shmat.c index 6ed02ce58..3ea34e3e9 100644 --- a/lib/libc/sys-minix/shmat.c +++ b/lib/libc/sys-minix/shmat.c @@ -1,5 +1,4 @@ #define _SYSTEM 1 -#define _MINIX 1 #include #include diff --git a/lib/libc/sys-minix/shmctl.c b/lib/libc/sys-minix/shmctl.c index ee6265e9d..1c7d47dea 100644 --- a/lib/libc/sys-minix/shmctl.c +++ b/lib/libc/sys-minix/shmctl.c @@ -1,5 +1,4 @@ #define _SYSTEM 1 -#define _MINIX 1 #include #include diff --git a/lib/libc/sys-minix/shmget.c b/lib/libc/sys-minix/shmget.c index f1d9b7064..968b31c6e 100644 --- a/lib/libc/sys-minix/shmget.c +++ b/lib/libc/sys-minix/shmget.c @@ -1,5 +1,5 @@ #define _SYSTEM 1 -#define _MINIX 1 + #include #include #include "namespace.h" diff --git a/lib/libddekit/src/common.h b/lib/libddekit/src/common.h index d74ac3203..3b6043b83 100644 --- a/lib/libddekit/src/common.h +++ b/lib/libddekit/src/common.h @@ -1,5 +1,3 @@ -#define _MINIX -#define _POSIX_SOURCE #include #include #include diff --git a/lib/libexec/Makefile b/lib/libexec/Makefile index 06f9904f7..0456ef81d 100644 --- a/lib/libexec/Makefile +++ b/lib/libexec/Makefile @@ -7,10 +7,6 @@ LIB= exec INCS= libexec.h SRCS= exec_aout.c exec_elf.c exec_general.c -.if (${NBSD_LIBC} != "no") INCSDIR= /usr/include -.else -INCSDIR= /usr/include.ack -.endif .include diff --git a/lib/libfetch/Makefile b/lib/libfetch/Makefile index c726485dc..d69c95a2e 100644 --- a/lib/libfetch/Makefile +++ b/lib/libfetch/Makefile @@ -10,7 +10,6 @@ MKPROFILE= no .include -CPPFLAGS+= -D_POSIX_SOURCE CPPFLAGS+= -I. CPPFLAGS+= -D_LARGEFILE_SOURCE -D_LARGE_FILES diff --git a/lib/libgpio/Makefile b/lib/libgpio/Makefile index 4e27eb3bb..b12822084 100644 --- a/lib/libgpio/Makefile +++ b/lib/libgpio/Makefile @@ -1,6 +1,6 @@ # Makefile for libmthread -CPPFLAGS+=-O -D_MINIX -D_POSIX_SOURCE -Wall -Werror -D_SYSTEM +CPPFLAGS+= -O1 -Wall -Werror -D_SYSTEM LIB= gpio diff --git a/lib/libmthread/Makefile b/lib/libmthread/Makefile index 6c61a76e9..c30afa63f 100644 --- a/lib/libmthread/Makefile +++ b/lib/libmthread/Makefile @@ -1,6 +1,6 @@ # Makefile for libmthread -CPPFLAGS+=-O -D_MINIX -D_POSIX_SOURCE -Wall -Werror +CPPFLAGS+= -O1 -Wall -Werror LIB= mthread diff --git a/lib/libnetsock/Makefile b/lib/libnetsock/Makefile index 4da9229bb..c2f1d369b 100644 --- a/lib/libnetsock/Makefile +++ b/lib/libnetsock/Makefile @@ -1,6 +1,6 @@ LIB = netsock -CPPFLAGS += -I${.CURDIR}/include/ -D_SYSTEM -D_MINIX +CPPFLAGS += -I${.CURDIR}/include/ -D_SYSTEM CPPFLAGS+= -I${.CURDIR}/../../lib/liblwip/include CFLAGS += -Wall -Wextra -std=c99 diff --git a/lib/libpadconf/Makefile b/lib/libpadconf/Makefile index fd2c713d9..c6d1e92b7 100644 --- a/lib/libpadconf/Makefile +++ b/lib/libpadconf/Makefile @@ -1,6 +1,6 @@ # Makefile for libpadconf -CPPFLAGS+=-O -D_MINIX -D_POSIX_SOURCE -Wall -Werror -D_SYSTEM +CPPFLAGS+= -O1 -Wall -Werror -D_SYSTEM LIB= padconf diff --git a/lib/libpuffs/fs.h b/lib/libpuffs/fs.h index 7c711d124..5350a0574 100644 --- a/lib/libpuffs/fs.h +++ b/lib/libpuffs/fs.h @@ -1,15 +1,12 @@ -/* This is the master header for fs. It includes some other files - * and defines the principal constants. - */ - #ifndef LIBPUFFS_FS_H #define LIBPUFFS_FS_H -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ -#define _SYSTEM 1 /* tell headers that this is the kernel */ +/* This is the master header for fs. It includes some other files + * and defines the principal constants. + */ +#define _SYSTEM 1 /* tell headers that this is the kernel */ -#define VERBOSE 0 /* show messages during initialization? */ +#define VERBOSE 0 /* show messages during initialization? */ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ diff --git a/lib/libsys/arch/i386/getidle.c b/lib/libsys/arch/i386/getidle.c index 989eac53a..8fc225e7c 100644 --- a/lib/libsys/arch/i386/getidle.c +++ b/lib/libsys/arch/i386/getidle.c @@ -15,8 +15,7 @@ * */ -#define _MINIX 1 -#define _SYSTEM 1 +#define _SYSTEM 1 #include #include #include diff --git a/lib/libsys/asynsend.c b/lib/libsys/asynsend.c index c1f4ea47e..c26bc1ecb 100644 --- a/lib/libsys/asynsend.c +++ b/lib/libsys/asynsend.c @@ -1,5 +1,4 @@ -#define _MINIX 1 -#define _SYSTEM 1 +#define _SYSTEM 1 #include #include diff --git a/lib/libsys/optset.c b/lib/libsys/optset.c index f3ef2a006..be65cfa9e 100644 --- a/lib/libsys/optset.c +++ b/lib/libsys/optset.c @@ -12,7 +12,6 @@ * May 2009 (D.C. van Moolenbroek) */ -#define _MINIX 1 #include #include #include diff --git a/lib/libvtreefs/inc.h b/lib/libvtreefs/inc.h index 7e7b85072..a9727f344 100644 --- a/lib/libvtreefs/inc.h +++ b/lib/libvtreefs/inc.h @@ -1,6 +1,4 @@ -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ -#define _SYSTEM 1 /* tell headers that this is the kernel */ +#define _SYSTEM 1 /* tell headers that this is the kernel */ #include #include diff --git a/lib/libz/Makefile b/lib/libz/Makefile index b23fa456b..87a48264c 100644 --- a/lib/libz/Makefile +++ b/lib/libz/Makefile @@ -5,11 +5,7 @@ LIB= z SRCS= adler32.c compress.c crc32.c deflate.c gzclose.c gzlib.c gzread.c \ gzwrite.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c -.if (${NBSD_LIBC} != "no") INCSDIR= /usr/include -.else -INCSDIR= /usr/include.ack -.endif INCS= zconf.h zlib.h diff --git a/sbin/newfs_ext2fs/mke2fs.c b/sbin/newfs_ext2fs/mke2fs.c index 5ecb882f4..b5a739163 100644 --- a/sbin/newfs_ext2fs/mke2fs.c +++ b/sbin/newfs_ext2fs/mke2fs.c @@ -118,7 +118,6 @@ __RCSID("$NetBSD: mke2fs.c,v 1.14 2010/09/10 15:51:20 tsutsui Exp $"); #include #include -#define _MINIX #include #include #include diff --git a/servers/Makefile.inc b/servers/Makefile.inc index ef189d63e..b423a45c8 100644 --- a/servers/Makefile.inc +++ b/servers/Makefile.inc @@ -1,4 +1,3 @@ -CPPFLAGS+= -D_MINIX -D_NETBSD_SOURCE LDADD+= -lminlib -lcompat_minix DPADD+= ${LIBMINLIB} ${LIBCOMPAT_MINIX} BINDIR?=/usr/sbin diff --git a/servers/devman/buf.c b/servers/devman/buf.c index a6af6aa47..e7f0024e5 100755 --- a/servers/devman/buf.c +++ b/servers/devman/buf.c @@ -1,8 +1,6 @@ /* buf.c - by Alen Stojanov and David van Moolenbroek, taken from procfs */ -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ -#define _SYSTEM 1 /* tell headers that this is the kernel */ -#define DEVMAN_SERVER 1 +#define _SYSTEM 1 /* tell headers that this is the kernel */ +#define DEVMAN_SERVER 1 #include #include diff --git a/servers/devman/devman.h b/servers/devman/devman.h index 64d011a76..df8cd6282 100644 --- a/servers/devman/devman.h +++ b/servers/devman/devman.h @@ -1,9 +1,7 @@ #ifndef _SERVERS_DEVMAN_DEVMAN_H #define _SERVERS_DEVMAN_DEVMAN_H -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ -#define _SYSTEM 1 /* tell headers that this is the kernel */ -#define DEVMAN_SERVER 1 +#define _SYSTEM 1 /* tell headers that this is the kernel */ +#define DEVMAN_SERVER 1 #include #include diff --git a/servers/devman/main.c b/servers/devman/main.c index 2cb77b6fc..78521cdc1 100644 --- a/servers/devman/main.c +++ b/servers/devman/main.c @@ -1,6 +1,4 @@ -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ -#define _SYSTEM 1 /* tell headers that this is the kernel */ +#define _SYSTEM 1 /* tell headers that this is the kernel */ #include #include diff --git a/servers/ds/inc.h b/servers/ds/inc.h index 7ed2d76cb..f34cfedb7 100644 --- a/servers/ds/inc.h +++ b/servers/ds/inc.h @@ -3,9 +3,7 @@ /* Header file including all needed system headers. */ -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ -#define _SYSTEM 1 /* get OK and negative error codes */ +#define _SYSTEM 1 /* get OK and negative error codes */ #include #include diff --git a/servers/ext2/fs.h b/servers/ext2/fs.h index 068306594..775fb9626 100644 --- a/servers/ext2/fs.h +++ b/servers/ext2/fs.h @@ -1,15 +1,12 @@ -/* This is the master header for fs. It includes some other files - * and defines the principal constants. - */ - #ifndef EXT2_FS_H #define EXT2_FS_H -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ -#define _SYSTEM 1 /* tell headers that this is the kernel */ +/* This is the master header for fs. It includes some other files + * and defines the principal constants. + */ +#define _SYSTEM 1 /* tell headers that this is the kernel */ -#define VERBOSE 0 /* show messages during initialization? */ +#define VERBOSE 0 /* show messages during initialization? */ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ diff --git a/servers/inet/Makefile b/servers/inet/Makefile index 9bb7426fd..6445e0398 100644 --- a/servers/inet/Makefile +++ b/servers/inet/Makefile @@ -21,6 +21,6 @@ MAN= BINDIR?= /usr/sbin -CPPFLAGS+= -I${.CURDIR} -D_MINIX -D'ARGS(a)=a' -Wall -Werror +CPPFLAGS+= -I${.CURDIR} -D'ARGS(a)=a' -Wall -Werror .include diff --git a/servers/inet/inet_config.c b/servers/inet/inet_config.c index c5ebd5d9b..b9d1e325b 100644 --- a/servers/inet/inet_config.c +++ b/servers/inet/inet_config.c @@ -10,7 +10,6 @@ Copyright 1995 Philip Homburg */ #define _MINIX_SOURCE 1 -#define _POSIX_SOURCE 1 #include #include diff --git a/servers/ipc/inc.h b/servers/ipc/inc.h index e3e1dc888..4579a5989 100644 --- a/servers/ipc/inc.h +++ b/servers/ipc/inc.h @@ -1,6 +1,4 @@ -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ -#define _SYSTEM 1 /* get OK and negative error codes */ +#define _SYSTEM 1 /* get OK and negative error codes */ #include #include diff --git a/servers/is/inc.h b/servers/is/inc.h index f0133dc74..fe5025e67 100644 --- a/servers/is/inc.h +++ b/servers/is/inc.h @@ -4,8 +4,7 @@ * Jul 13, 2004 by Jorrit N. Herder */ -#define _SYSTEM 1 /* get OK and negative error codes */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ +#define _SYSTEM 1 /* get OK and negative error codes */ #include #include diff --git a/servers/iso9660fs/inc.h b/servers/iso9660fs/inc.h index 602c56616..85301ca6f 100644 --- a/servers/iso9660fs/inc.h +++ b/servers/iso9660fs/inc.h @@ -1,8 +1,7 @@ -#define _SYSTEM 1 /* get OK and negative error codes */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ +#define _SYSTEM 1 /* get OK and negative error codes */ -#define VERBOSE 0 /* display diagnostics */ +#define VERBOSE 0 /* display diagnostics */ #include #include diff --git a/servers/lwip/Makefile b/servers/lwip/Makefile index cc6912496..5c4edbc7b 100644 --- a/servers/lwip/Makefile +++ b/servers/lwip/Makefile @@ -17,7 +17,7 @@ MAN= BINDIR?= /usr/sbin -CPPFLAGS+= -I${.CURDIR} -D_MINIX -D_SYSTEM +CPPFLAGS+= -I${.CURDIR} -D_SYSTEM CPPFLAGS+= -I${.CURDIR}/../../lib/liblwip/include CFLAGS += -Wextra -std=c99 diff --git a/servers/mfs/fs.h b/servers/mfs/fs.h index caa2291b4..096a5083d 100644 --- a/servers/mfs/fs.h +++ b/servers/mfs/fs.h @@ -4,11 +4,9 @@ /* This is the master header for fs. It includes some other files * and defines the principal constants. */ -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ -#define _SYSTEM 1 /* tell headers that this is the kernel */ +#define _SYSTEM 1 /* tell headers that this is the kernel */ -#define VERBOSE 0 /* show messages during initialization? */ +#define VERBOSE 0 /* show messages during initialization? */ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ diff --git a/servers/pfs/fs.h b/servers/pfs/fs.h index 3eb79b50c..99470f050 100644 --- a/servers/pfs/fs.h +++ b/servers/pfs/fs.h @@ -1,12 +1,10 @@ #ifndef __PFS_FS_H__ #define __PFS_FS_H__ -/* This is the master header for pfs. It includes some other files +/* This is the master header for fs. It includes some other files * and defines the principal constants. */ -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ -#define _SYSTEM 1 /* tell headers that this is the kernel */ +#define _SYSTEM 1 /* tell headers that this is the kernel */ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ @@ -14,6 +12,7 @@ #include #include #include + #include #include #include diff --git a/servers/pfs/inc.h b/servers/pfs/inc.h index 6a1fcaa6c..34fa24906 100644 --- a/servers/pfs/inc.h +++ b/servers/pfs/inc.h @@ -1,8 +1,8 @@ -#define _SYSTEM 1 /* get OK and negative error codes */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ +#define _SYSTEM 1 /* get OK and negative error codes */ +#define _NETBSD_SOURCE 1 /* tell headers to include MINIX stuff */ -#define VERBOSE 0 /* display diagnostics */ +#define VERBOSE 0 /* display diagnostics */ #ifdef __NBSD_LIBC #include diff --git a/servers/pm/pm.h b/servers/pm/pm.h index 1aa319f6c..b362115b5 100644 --- a/servers/pm/pm.h +++ b/servers/pm/pm.h @@ -1,9 +1,7 @@ /* This is the master header for PM. It includes some other files * and defines the principal constants. */ -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ -#define _SYSTEM 1 /* tell headers that this is the kernel */ +#define _SYSTEM 1 /* tell headers that this is the kernel */ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ diff --git a/servers/procfs/inc.h b/servers/procfs/inc.h index 61408f082..ae411730f 100644 --- a/servers/procfs/inc.h +++ b/servers/procfs/inc.h @@ -1,9 +1,7 @@ #ifndef _PROCFS_INC_H #define _PROCFS_INC_H -#define _POSIX_SOURCE 1 -#define _MINIX 1 -#define _SYSTEM 1 +#define _SYSTEM 1 #include #include diff --git a/servers/rs/inc.h b/servers/rs/inc.h index 6077f1868..ecc518df4 100644 --- a/servers/rs/inc.h +++ b/servers/rs/inc.h @@ -4,8 +4,7 @@ * Jul 22, 2005 by Jorrit N. Herder */ -#define _SYSTEM 1 /* get OK and negative error codes */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ +#define _SYSTEM 1 /* get OK and negative error codes */ #include #include diff --git a/servers/sched/sched.h b/servers/sched/sched.h index 80a75a98f..c1bd76d1f 100644 --- a/servers/sched/sched.h +++ b/servers/sched/sched.h @@ -1,9 +1,7 @@ /* This is the master header for the Scheduler. It includes some other files * and defines the principal constants. */ -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ -#define _SYSTEM 1 /* tell headers that this is the kernel */ +#define _SYSTEM 1 /* tell headers that this is the kernel */ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ diff --git a/servers/vfs/fs.h b/servers/vfs/fs.h index 125692131..3c95e26d5 100644 --- a/servers/vfs/fs.h +++ b/servers/vfs/fs.h @@ -4,9 +4,7 @@ /* This is the master header for fs. It includes some other files * and defines the principal constants. */ -#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ -#define _MINIX 1 /* tell headers to include MINIX stuff */ -#define _SYSTEM 1 /* tell headers that this is the kernel */ +#define _SYSTEM 1 /* tell headers that this is the kernel */ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ diff --git a/servers/vm/arch/i386/pagetable.c b/servers/vm/arch/i386/pagetable.c index 7187afda0..848cf45c8 100644 --- a/servers/vm/arch/i386/pagetable.c +++ b/servers/vm/arch/i386/pagetable.c @@ -1,6 +1,5 @@ #define _SYSTEM 1 -#define _POSIX_SOURCE 1 #include #include diff --git a/servers/vm/main.c b/servers/vm/main.c index c3a4e3a05..77fe7b5b3 100644 --- a/servers/vm/main.c +++ b/servers/vm/main.c @@ -1,7 +1,5 @@ -#define _POSIX_SOURCE 1 -#define _MINIX 1 -#define _SYSTEM 1 +#define _SYSTEM 1 #include #include diff --git a/servers/vm/utility.c b/servers/vm/utility.c index 26f2d9ef7..4c835b85f 100644 --- a/servers/vm/utility.c +++ b/servers/vm/utility.c @@ -1,9 +1,7 @@ /* This file contains some utility routines for VM. */ -#define _SYSTEM 1 - -#define _MINIX 1 /* To get the brk() prototype (as _brk()). */ +#define _SYSTEM 1 #include #include diff --git a/share/mk/sys.mk b/share/mk/sys.mk index d1b4c638b..6bb19769e 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -12,8 +12,6 @@ CFLAGS+= -DNDEBUG unix?= We run MINIX. -NBSD_LIBC= yes - DBG?= -O CPP?= /usr/lib/cpp .endif # defined(__MINIX) diff --git a/sys/arch/arm/include/signal.h b/sys/arch/arm/include/signal.h index f4d6d4f63..8c539f188 100644 --- a/sys/arch/arm/include/signal.h +++ b/sys/arch/arm/include/signal.h @@ -50,10 +50,10 @@ struct sigcontext { #define sc_pc sc_regs.pc #define sc_psr sc_regs.psr -#ifdef _MINIX +#if defined(__minix) && defined(_NETBSD_SOURCE) __BEGIN_DECLS int sigreturn(struct sigcontext *_scp); __END_DECLS -#endif /* _MINIX */ +#endif /* defined(__minix) && defined(_NETBSD_SOURCE) */ #endif /* !_ARM_SIGNAL_H_ */ diff --git a/sys/arch/i386/include/signal.h b/sys/arch/i386/include/signal.h index c3436460a..6bac4db25 100644 --- a/sys/arch/i386/include/signal.h +++ b/sys/arch/i386/include/signal.h @@ -54,10 +54,10 @@ struct sigcontext { #define sc_sp sc_regs.sp #define sc_ss sc_regs.ss -#ifdef _MINIX +#if defined(__minix) && defined(_NETBSD_SOURCE) __BEGIN_DECLS int sigreturn(struct sigcontext *_scp); __END_DECLS -#endif /* _MINIX */ +#endif /* defined(__minix) && defined(_NETBSD_SOURCE) */ #endif /* !_I386_SIGNAL_H_ */ diff --git a/sys/arch/i386/stand/boot/Makefile.boot b/sys/arch/i386/stand/boot/Makefile.boot index 7c29dba74..174d1e7eb 100644 --- a/sys/arch/i386/stand/boot/Makefile.boot +++ b/sys/arch/i386/stand/boot/Makefile.boot @@ -38,7 +38,6 @@ CPPFLAGS+= -I ${.CURDIR}/.. -I ${.CURDIR}/../../lib -I ${S}/lib/libsa CPPFLAGS+= -I ${.OBJDIR} .if defined(__MINIX) CPPFLAGS+=-isystem ${DESTDIR}/usr/include -CPPFLAGS+= -D_MINIX .endif # defined(__MINIX) # Make sure we override any optimization options specified by the user COPTS= -Os diff --git a/sys/arch/i386/stand/bootxx/Makefile.bootxx b/sys/arch/i386/stand/bootxx/Makefile.bootxx index 37d4a6186..fee5e69b8 100644 --- a/sys/arch/i386/stand/bootxx/Makefile.bootxx +++ b/sys/arch/i386/stand/bootxx/Makefile.bootxx @@ -116,7 +116,6 @@ SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" .if defined(__MINIX) SAMISCMAKEFLAGS+="SA_INCLUDE_NET=no" CPPFLAGS+= -isystem ${DESTDIR}/usr/include -CPPFLAGS+= -D_MINIX AFLAGS+= -Wa,--divide .endif .include "${S}/lib/libsa/Makefile.inc" diff --git a/sys/sys/select.h b/sys/sys/select.h index e4ba9ce60..fa9d1b4b4 100644 --- a/sys/sys/select.h +++ b/sys/sys/select.h @@ -75,13 +75,13 @@ int select(int, fd_set * __restrict, fd_set * __restrict, __END_DECLS #endif /* _KERNEL */ -#ifdef _MINIX +#if defined(__minix) && defined(_NETBSD_SOURCE) /* possible select() operation types; read, write, errors */ /* (FS/driver internal use only) */ #define SEL_RD (1 << 0) #define SEL_WR (1 << 1) #define SEL_ERR (1 << 2) #define SEL_NOTIFY (1 << 3) /* not a real select operation */ -#endif +#endif /* defined(__minix) && defined(_NETBSD_SOURCE) */ #endif /* !_SYS_SELECT_H_ */ diff --git a/sys/sys/signal.h b/sys/sys/signal.h index d395fd72d..4542caccd 100644 --- a/sys/sys/signal.h +++ b/sys/sys/signal.h @@ -77,7 +77,7 @@ #define SIGTTIN 22 /* background process wants to read */ #define SIGTTOU 23 /* background process wants to write */ -#ifdef _MINIX +#if defined(__minix) && defined(_NETBSD_SOURCE) #define SIGIOT SIGABRT /* for people who speak PDP-11 */ /* MINIX specific signals. These signals are not used by user proceses, @@ -110,7 +110,7 @@ || (sig == SIGKILL || sig == SIGPIPE)) #define SIGS_IS_STACKTRACE(sig) (SIGS_IS_LETHAL(sig) && sig != SIGABRT) -#endif +#endif /* defined(__minix) && deinfed(_NETBSD_SOURCE) */ #ifndef _KERNEL #include diff --git a/sys/sys/types.h b/sys/sys/types.h index 74abeecc7..acc33f114 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -115,7 +115,7 @@ typedef u32_t big_nlink_t; typedef u32_t big_uid_t; -#ifdef _MINIX +#ifdef _NETBSD_SOURCE /* some Minix specific types that do not conflict with posix */ typedef uint32_t zone_t; /* zone number */ typedef uint32_t block_t; /* block number */ diff --git a/test/Makefile b/test/Makefile index 9af6b48d5..8f53897c4 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,5 +1,5 @@ DBG=-O0 -g -CFLAGS+= -Wall -Werror -D_NETBSD_SOURCE -fno-builtin -D_MINIX -D_POSIX_SOURCE +CFLAGS+= -Wall -Werror -fno-builtin LDADD+= -lm -lcompat_minix # Tests have no manpages diff --git a/test/blocktest/Makefile.inc b/test/blocktest/Makefile.inc index 7ffad558a..fc54f99c5 100644 --- a/test/blocktest/Makefile.inc +++ b/test/blocktest/Makefile.inc @@ -1,5 +1,4 @@ # Copied from drivers/Makefile.inc, and slightly edited. -CPPFLAGS+= -D_MINIX -D_NETBSD_SOURCE LDADD+= -lminlib -lcompat_minix -lc DPADD+= ${LIBMINLIB} ${LIBCOMPAT_MINIX} BINDIR?=/usr/sbin diff --git a/test/ds/Makefile.inc b/test/ds/Makefile.inc index f166ffed1..42bdd2bec 100644 --- a/test/ds/Makefile.inc +++ b/test/ds/Makefile.inc @@ -1,5 +1,4 @@ # Copied from drivers/Makefile.inc -CPPFLAGS+= -D_MINIX -D_NETBSD_SOURCE LDADD+= -lminlib -lcompat_minix DPADD+= ${LIBMINLIB} ${LIBCOMPAT_MINIX} BINDIR?=/usr/sbin diff --git a/test/ipc/semctl/Makefile b/test/ipc/semctl/Makefile index 52e639b4a..05c29f2b9 100644 --- a/test/ipc/semctl/Makefile +++ b/test/ipc/semctl/Makefile @@ -1,7 +1,7 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -D_NETBSD_SOURCE=1 -I../lib/ +CFLAGS = -Wall -I../lib/ PROG = semctl01 semctl02 semctl03 semctl04 semctl05 semctl06 semctl07 diff --git a/test/ipc/semget/Makefile b/test/ipc/semget/Makefile index 86bb5e53b..185ceda5a 100644 --- a/test/ipc/semget/Makefile +++ b/test/ipc/semget/Makefile @@ -1,7 +1,7 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -D_NETBSD_SOURCE=1 -I../lib/ +CFLAGS = -Wall -I../lib/ PROG = semget01 semget02 semget03 semget05 semget06 diff --git a/test/ipc/semop/Makefile b/test/ipc/semop/Makefile index 88daa7fbf..1bc7e24c3 100644 --- a/test/ipc/semop/Makefile +++ b/test/ipc/semop/Makefile @@ -1,7 +1,7 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -D_NETBSD_SOURCE=1 -I../lib/ +CFLAGS = -Wall -I../lib/ PROG = semop01 semop02 semop03 semop04 semop05 diff --git a/test/ipc/shmat/Makefile b/test/ipc/shmat/Makefile index 0a6c9fddd..fe01d33cc 100644 --- a/test/ipc/shmat/Makefile +++ b/test/ipc/shmat/Makefile @@ -1,7 +1,7 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -D_NETBSD_SOURCE=1 -I../lib/ +CFLAGS = -Wall -I../lib/ PROG = shmat01 shmat02 shmat03 diff --git a/test/ipc/shmctl/Makefile b/test/ipc/shmctl/Makefile index 9ccfbee90..b4693636a 100644 --- a/test/ipc/shmctl/Makefile +++ b/test/ipc/shmctl/Makefile @@ -1,7 +1,7 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -D_NETBSD_SOURCE=1 -I../lib/ +CFLAGS = -Wall -I../lib/ PROG = shmctl01 shmctl02 shmctl03 shmctl04 diff --git a/test/ipc/shmdt/Makefile b/test/ipc/shmdt/Makefile index 3a61858d9..2a4d6b389 100644 --- a/test/ipc/shmdt/Makefile +++ b/test/ipc/shmdt/Makefile @@ -1,7 +1,7 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -D_NETBSD_SOURCE=1 -I../lib/ +CFLAGS = -Wall -I../lib/ PROG = shmdt01 shmdt02 diff --git a/test/ipc/shmget/Makefile b/test/ipc/shmget/Makefile index bf814600e..dbc369a43 100644 --- a/test/ipc/shmget/Makefile +++ b/test/ipc/shmget/Makefile @@ -1,7 +1,7 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -D_NETBSD_SOURCE=1 -I../lib/ +CFLAGS = -Wall -I../lib/ PROG = shmget01 shmget02 shmget04 shmget05 diff --git a/test/ipc/shmt/Makefile b/test/ipc/shmt/Makefile index 6be476395..fc1fc10b6 100644 --- a/test/ipc/shmt/Makefile +++ b/test/ipc/shmt/Makefile @@ -1,7 +1,7 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -D_NETBSD_SOURCE=1 -I../lib/ +CFLAGS = -Wall -I../lib/ PROG = shmt02 shmt03 shmt04 shmt05 shmt06 \ shmt07 shmt08 shmt10 shmt01 diff --git a/test/kernel/sys_vumap/Makefile.inc b/test/kernel/sys_vumap/Makefile.inc index f166ffed1..42bdd2bec 100644 --- a/test/kernel/sys_vumap/Makefile.inc +++ b/test/kernel/sys_vumap/Makefile.inc @@ -1,5 +1,4 @@ # Copied from drivers/Makefile.inc -CPPFLAGS+= -D_MINIX -D_NETBSD_SOURCE LDADD+= -lminlib -lcompat_minix DPADD+= ${LIBMINLIB} ${LIBCOMPAT_MINIX} BINDIR?=/usr/sbin diff --git a/test/safecopy/inc.h b/test/safecopy/inc.h index ff1277755..f5e1f321d 100644 --- a/test/safecopy/inc.h +++ b/test/safecopy/inc.h @@ -1,5 +1,6 @@ -#define _SYSTEM -#define _MINIX + +#define _SYSTEM 1 + #include #include #include diff --git a/test/scancodes/test-scancodes.c b/test/scancodes/test-scancodes.c index 1ca917909..599bc2a12 100644 --- a/test/scancodes/test-scancodes.c +++ b/test/scancodes/test-scancodes.c @@ -1,5 +1,3 @@ -#define _MINIX - #include #include #include diff --git a/test/select/Makefile b/test/select/Makefile index 13e319371..5b776dec3 100644 --- a/test/select/Makefile +++ b/test/select/Makefile @@ -1,7 +1,7 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE +CFLAGS = -Wall PROG = speed test00 test01 test02 test03 test04_srv test04_cli test05_srv \ test05_cli test06_srv test06_cli test07_srv test07_cli test08_srv \ diff --git a/test/t40e.c b/test/t40e.c index 1a8f8293a..9759d67e1 100644 --- a/test/t40e.c +++ b/test/t40e.c @@ -158,7 +158,7 @@ void do_child(int childno) { #endif /* Normally we'd zerofill sin_zero, but there is no such thing on Minix */ -#ifndef _MINIX +#if !defined(__minix) memset(server.sin_zero, '\0', sizeof server.sin_zero); #endif @@ -219,7 +219,7 @@ void do_child(int childno) { } void do_parent(void) { -#ifndef _MINIX +#if !defined(__minix) int yes = 1; #endif int fd_sock, fd_new, exitstatus; @@ -242,12 +242,12 @@ void do_parent(void) { my_addr.sin_port = htons(MYPORT); /* Short, network byte order */ my_addr.sin_addr.s_addr = INADDR_ANY; /* Normally we'd zerofill sin_zero, but there is no such thing on Minix */ -#ifndef _MINIX +#if !defined(__minix) memset(my_addr.sin_zero, '\0', sizeof my_addr.sin_zero); #endif /* Reuse port number. Not implemented in Minix. */ -#ifndef _MINIX +#if !defined(__minix) if(setsockopt(fd_sock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) < 0) { perror("Error setting port reuse option"); exit(-1); diff --git a/test/test27.c b/test/test27.c index 1271daada..412576de8 100644 --- a/test/test27.c +++ b/test/test27.c @@ -123,7 +123,7 @@ void test27a() /* Check special file. */ if (stat("/dev/tty", &st1) != 0) e(40); if (!S_ISCHR(st1.st_mode)) e(41); -#ifdef _MINIX +#if defined(__minix) && defined(_NETBSD_SOURCE) if (stat("/dev/ram", &st1) != 0) e(42); if (!S_ISBLK(st1.st_mode)) e(43); #endif diff --git a/test/test28.c b/test/test28.c index c610bc728..cea5ba3b6 100644 --- a/test/test28.c +++ b/test/test28.c @@ -231,7 +231,7 @@ void test28b() if (errno != ENOENT) e(38); /* is gone */ } #endif -#ifdef _MINIX +#if defined(__minix) && defined(_NETBSD_SOURCE) /* Some implementations might allow users to link directories. */ if (!superuser) { if (link("foo", "footoo") != -1) e(39); diff --git a/test/test42.c b/test/test42.c index ec1f1a806..12b726cbf 100644 --- a/test/test42.c +++ b/test/test42.c @@ -1,5 +1,4 @@ /* Tests for MINIX3 ptrace(2) - by D.C. van Moolenbroek */ -#define _POSIX_SOURCE 1 #include #include #include diff --git a/test/test43.c b/test/test43.c index 354af2a14..e06838af9 100644 --- a/test/test43.c +++ b/test/test43.c @@ -1,5 +1,4 @@ /* Tests for MINIX3 realpath(3) - by Erik van der Kouwe */ -#define _POSIX_SOURCE 1 #include #include #include diff --git a/test/test50.c b/test/test50.c index 3733f7f62..6c2d6a69d 100644 --- a/test/test50.c +++ b/test/test50.c @@ -1,5 +1,4 @@ /* Tests for truncate(2) call family - by D.C. van Moolenbroek */ -#define _POSIX_SOURCE 1 #include #include #include diff --git a/test/test52.c b/test/test52.c index c4fd6a7f9..1ac0e2f6a 100644 --- a/test/test52.c +++ b/test/test52.c @@ -1,4 +1,3 @@ -#define _POSIX_SOURCE 1 #include #include #include diff --git a/usr.sbin/installboot/install_master.c b/usr.sbin/installboot/install_master.c index 1e8edf309..1060eb48c 100644 --- a/usr.sbin/installboot/install_master.c +++ b/usr.sbin/installboot/install_master.c @@ -3,10 +3,6 @@ * installboot 3.0 - Make a device bootable Author: Kees J. Bot * 21 Dec 1991 */ - -#define _POSIX_SOURCE 1 -#define _MINIX 1 - #include #include #include diff --git a/usr.sbin/mkfs.mfs/Makefile b/usr.sbin/mkfs.mfs/Makefile index 22c461416..08416d2c1 100644 --- a/usr.sbin/mkfs.mfs/Makefile +++ b/usr.sbin/mkfs.mfs/Makefile @@ -3,8 +3,6 @@ SRCS= mkfs.c BINDIR= /sbin MAN= -CPPFLAGS+= -D_MINIX - # LSC Adding this to activate the getline renaming macro CPPFLAGS+= -D__NBSD_LIBC