From: David van Moolenbroek Date: Sat, 8 Sep 2012 15:25:00 +0000 (+0200) Subject: tests: fix IPC test set X-Git-Tag: v3.2.1~341 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=df39752;p=minix.git tests: fix IPC test set - use one single library instead of loose library files - we don't have ftime() anymore - shmat(non-NULL) is currently broken, fix shmt test set to bypass this - some other small issues --- diff --git a/test/ipc/Makefile b/test/ipc/Makefile index 96fcb2aa6..ff181418d 100644 --- a/test/ipc/Makefile +++ b/test/ipc/Makefile @@ -17,6 +17,7 @@ # all test clean: + $(MAKE) -C ./lib $@ # $(MAKE) -C ./msgctl $@ # $(MAKE) -C ./msgget $@ # $(MAKE) -C ./msgrcv $@ diff --git a/test/ipc/lib/Makefile b/test/ipc/lib/Makefile index 0ade066fc..8a3f305b3 100644 --- a/test/ipc/lib/Makefile +++ b/test/ipc/lib/Makefile @@ -16,11 +16,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -SRCS = libipc.c +SRCS = libipc.c rmobj.c parse_opts.c tst_res.c tst_sig.c tst_tmpdir.c OBJS = $(SRCS:.c=.o) LIBIPC = ../libipc.a -CFLAGS += -I../../../../../include -Wall +CFLAGS += -I../../../../../include -Wall -D_NETBSD_SOURCE=1 all: $(LIBIPC) diff --git a/test/ipc/lib/libipc.c b/test/ipc/lib/libipc.c index 30374da3a..5af36de37 100644 --- a/test/ipc/lib/libipc.c +++ b/test/ipc/lib/libipc.c @@ -42,7 +42,7 @@ #include "ipcsem.h" #include -#include +#include #include #include #include @@ -61,7 +61,7 @@ getipckey() char curdira[PATH_MAX]; size_t size = sizeof(curdira); key_t ipc_key; - struct timeb time_info; + struct timeval tv; if (NULL == (curdir = getcwd(curdira, size))) { tst_brkm(TBROK, cleanup, "Can't get current directory " @@ -77,11 +77,11 @@ getipckey() * project identifier is a "random character" produced by * generating a random number between 0 and 25 and then adding * that to the ascii value of 'a'. The "seed" for the random - * number is the millisecond value that is set in the timeb - * structure after calling ftime(). + * number is the microsecond value that is set in the timeval + * structure after calling gettimeofday(). */ - (void)ftime(&time_info); - srandom((unsigned int)time_info.millitm); + (void) gettimeofday(&tv, NULL); + srandom((unsigned int)tv.tv_usec); if ((ipc_key = ftok(curdir, ascii_a + random()%26)) == -1) { tst_brkm(TBROK, cleanup, "Can't get msgkey from ftok()"); diff --git a/test/ipc/lib/parse_opts.c b/test/ipc/lib/parse_opts.c index 50e2f5a88..89f4b07b7 100644 --- a/test/ipc/lib/parse_opts.c +++ b/test/ipc/lib/parse_opts.c @@ -577,7 +577,7 @@ STD_opts_help(void) for(i = 0; std_options[i].optstr; ++i) { if (std_options[i].help) - printf(std_options[i].help); + fputs(std_options[i].help, stdout); } } diff --git a/test/ipc/semctl/Makefile b/test/ipc/semctl/Makefile index 354330a75..52e639b4a 100644 --- a/test/ipc/semctl/Makefile +++ b/test/ipc/semctl/Makefile @@ -1,32 +1,14 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -I../lib/ +CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -D_NETBSD_SOURCE=1 -I../lib/ PROG = semctl01 semctl02 semctl03 semctl04 semctl05 semctl06 semctl07 all: $(PROG) -$(PROG): tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o - $(CC) $(CFLAGS) -o $@ $@.c tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o - -rmobj.o: ../lib/rmobj.c - $(CC) $(CFLAGS) -c -o rmobj.o ../lib/rmobj.c - -tst_res.o: ../lib/tst_res.c - $(CC) $(CFLAGS) -c -o tst_res.o ../lib/tst_res.c - -tst_sig.o: ../lib/tst_sig.c - $(CC) $(CFLAGS) -c -o tst_sig.o ../lib/tst_sig.c - -tst_tmpdir.o: ../lib/tst_tmpdir.c - $(CC) $(CFLAGS) -c -o tst_tmpdir.o ../lib/tst_tmpdir.c - -parse_opts.o: ../lib/parse_opts.c - $(CC) $(CFLAGS) -c -o parse_opts.o ../lib/parse_opts.c - -libipc.o: ../lib/libipc.c - $(CC) $(CFLAGS) -c -o libipc.o ../lib/libipc.c +$(PROG): ../libipc.a + $(CC) $(CFLAGS) -o $@ $@.c ../libipc.a clean: rm -f *.o $(PROG) diff --git a/test/ipc/semctl/semctl02.c b/test/ipc/semctl/semctl02.c index 857c242f2..ddfcd6922 100644 --- a/test/ipc/semctl/semctl02.c +++ b/test/ipc/semctl/semctl02.c @@ -94,7 +94,6 @@ int main(int ac, char **av) TEST(semctl(sem_id_1, 0, IPC_STAT, un_arg)); if (TEST_RETURN != -1) { -printf("result: %d\n", TEST_RETURN); tst_resm(TFAIL, "call succeeded when error expected"); continue; } diff --git a/test/ipc/semget/Makefile b/test/ipc/semget/Makefile index 71d78ab24..86bb5e53b 100644 --- a/test/ipc/semget/Makefile +++ b/test/ipc/semget/Makefile @@ -1,32 +1,14 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -I../lib/ +CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -D_NETBSD_SOURCE=1 -I../lib/ PROG = semget01 semget02 semget03 semget05 semget06 all: $(PROG) -$(PROG): tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o - $(CC) $(CFLAGS) -o $@ $@.c tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o - -rmobj.o: ../lib/rmobj.c - $(CC) $(CFLAGS) -c -o rmobj.o ../lib/rmobj.c - -tst_res.o: ../lib/tst_res.c - $(CC) $(CFLAGS) -c -o tst_res.o ../lib/tst_res.c - -tst_sig.o: ../lib/tst_sig.c - $(CC) $(CFLAGS) -c -o tst_sig.o ../lib/tst_sig.c - -tst_tmpdir.o: ../lib/tst_tmpdir.c - $(CC) $(CFLAGS) -c -o tst_tmpdir.o ../lib/tst_tmpdir.c - -parse_opts.o: ../lib/parse_opts.c - $(CC) $(CFLAGS) -c -o parse_opts.o ../lib/parse_opts.c - -libipc.o: ../lib/libipc.c - $(CC) $(CFLAGS) -c -o libipc.o ../lib/libipc.c +$(PROG): ../libipc.a + $(CC) $(CFLAGS) -o $@ $@.c ../libipc.a clean: rm -f *.o $(PROG) diff --git a/test/ipc/semget/semget05.c b/test/ipc/semget/semget05.c index 4b7e37419..f2642b1d1 100644 --- a/test/ipc/semget/semget05.c +++ b/test/ipc/semget/semget05.c @@ -72,7 +72,7 @@ int num_sems = 0; /* count the semaphores created */ int main(int ac, char **av) { - int lc,getmaxid; /* loop counter */ + int lc,getmaxid=0; /* loop counter */ char *msg; /* message returned from parse_opts */ FILE *fp; diff --git a/test/ipc/semop/Makefile b/test/ipc/semop/Makefile index 317230ee0..88daa7fbf 100644 --- a/test/ipc/semop/Makefile +++ b/test/ipc/semop/Makefile @@ -1,32 +1,14 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -I../lib/ +CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -D_NETBSD_SOURCE=1 -I../lib/ PROG = semop01 semop02 semop03 semop04 semop05 all: $(PROG) -$(PROG): tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o - $(CC) $(CFLAGS) -o $@ $@.c tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o - -rmobj.o: ../lib/rmobj.c - $(CC) $(CFLAGS) -c -o rmobj.o ../lib/rmobj.c - -tst_res.o: ../lib/tst_res.c - $(CC) $(CFLAGS) -c -o tst_res.o ../lib/tst_res.c - -tst_sig.o: ../lib/tst_sig.c - $(CC) $(CFLAGS) -c -o tst_sig.o ../lib/tst_sig.c - -tst_tmpdir.o: ../lib/tst_tmpdir.c - $(CC) $(CFLAGS) -c -o tst_tmpdir.o ../lib/tst_tmpdir.c - -parse_opts.o: ../lib/parse_opts.c - $(CC) $(CFLAGS) -c -o parse_opts.o ../lib/parse_opts.c - -libipc.o: ../lib/libipc.c - $(CC) $(CFLAGS) -c -o libipc.o ../lib/libipc.c +$(PROG): ../libipc.a + $(CC) $(CFLAGS) -o $@ $@.c ../libipc.a clean: rm -f *.o $(PROG) diff --git a/test/ipc/shmat/Makefile b/test/ipc/shmat/Makefile index 38fc72c00..0a6c9fddd 100644 --- a/test/ipc/shmat/Makefile +++ b/test/ipc/shmat/Makefile @@ -1,32 +1,14 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -I../lib/ +CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -D_NETBSD_SOURCE=1 -I../lib/ PROG = shmat01 shmat02 shmat03 all: $(PROG) -$(PROG): tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o - $(CC) $(CFLAGS) -o $@ $@.c tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o - -rmobj.o: ../lib/rmobj.c - $(CC) $(CFLAGS) -c -o rmobj.o ../lib/rmobj.c - -tst_res.o: ../lib/tst_res.c - $(CC) $(CFLAGS) -c -o tst_res.o ../lib/tst_res.c - -tst_sig.o: ../lib/tst_sig.c - $(CC) $(CFLAGS) -c -o tst_sig.o ../lib/tst_sig.c - -tst_tmpdir.o: ../lib/tst_tmpdir.c - $(CC) $(CFLAGS) -c -o tst_tmpdir.o ../lib/tst_tmpdir.c - -parse_opts.o: ../lib/parse_opts.c - $(CC) $(CFLAGS) -c -o parse_opts.o ../lib/parse_opts.c - -libipc.o: ../lib/libipc.c - $(CC) $(CFLAGS) -c -o libipc.o ../lib/libipc.c +$(PROG): ../libipc.a + $(CC) $(CFLAGS) -o $@ $@.c ../libipc.a clean: rm -f *.o $(PROG) diff --git a/test/ipc/shmat/shmat01.c b/test/ipc/shmat/shmat01.c index 8f88f98e7..5163fe13a 100644 --- a/test/ipc/shmat/shmat01.c +++ b/test/ipc/shmat/shmat01.c @@ -124,7 +124,7 @@ int main(int ac, char **av) addr = shmat(*(TC[i].shmid), (void *)(TC[i].addr), TC[i].flags); TEST_ERRNO = errno; - + if (addr == (void *)-1) { tst_brkm(TFAIL, cleanup, "%s call failed - " "errno = %d : %s", TCID, TEST_ERRNO, diff --git a/test/ipc/shmctl/Makefile b/test/ipc/shmctl/Makefile index 95215ae96..9ccfbee90 100644 --- a/test/ipc/shmctl/Makefile +++ b/test/ipc/shmctl/Makefile @@ -1,32 +1,14 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -I../lib/ +CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -D_NETBSD_SOURCE=1 -I../lib/ PROG = shmctl01 shmctl02 shmctl03 shmctl04 all: $(PROG) -$(PROG): tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o - $(CC) $(CFLAGS) -o $@ $@.c tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o - -rmobj.o: ../lib/rmobj.c - $(CC) $(CFLAGS) -c -o rmobj.o ../lib/rmobj.c - -tst_res.o: ../lib/tst_res.c - $(CC) $(CFLAGS) -c -o tst_res.o ../lib/tst_res.c - -tst_sig.o: ../lib/tst_sig.c - $(CC) $(CFLAGS) -c -o tst_sig.o ../lib/tst_sig.c - -tst_tmpdir.o: ../lib/tst_tmpdir.c - $(CC) $(CFLAGS) -c -o tst_tmpdir.o ../lib/tst_tmpdir.c - -parse_opts.o: ../lib/parse_opts.c - $(CC) $(CFLAGS) -c -o parse_opts.o ../lib/parse_opts.c - -libipc.o: ../lib/libipc.c - $(CC) $(CFLAGS) -c -o libipc.o ../lib/libipc.c +$(PROG): ../libipc.a + $(CC) $(CFLAGS) -o $@ $@.c ../libipc.a clean: rm -f *.o $(PROG) diff --git a/test/ipc/shmdt/Makefile b/test/ipc/shmdt/Makefile index 719667195..3a61858d9 100644 --- a/test/ipc/shmdt/Makefile +++ b/test/ipc/shmdt/Makefile @@ -1,32 +1,14 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -I../lib/ +CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -D_NETBSD_SOURCE=1 -I../lib/ PROG = shmdt01 shmdt02 all: $(PROG) -$(PROG): tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o - $(CC) $(CFLAGS) -o $@ $@.c tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o - -rmobj.o: ../lib/rmobj.c - $(CC) $(CFLAGS) -c -o rmobj.o ../lib/rmobj.c - -tst_res.o: ../lib/tst_res.c - $(CC) $(CFLAGS) -c -o tst_res.o ../lib/tst_res.c - -tst_sig.o: ../lib/tst_sig.c - $(CC) $(CFLAGS) -c -o tst_sig.o ../lib/tst_sig.c - -tst_tmpdir.o: ../lib/tst_tmpdir.c - $(CC) $(CFLAGS) -c -o tst_tmpdir.o ../lib/tst_tmpdir.c - -parse_opts.o: ../lib/parse_opts.c - $(CC) $(CFLAGS) -c -o parse_opts.o ../lib/parse_opts.c - -libipc.o: ../lib/libipc.c - $(CC) $(CFLAGS) -c -o libipc.o ../lib/libipc.c +$(PROG): ../libipc.a + $(CC) $(CFLAGS) -o $@ $@.c ../libipc.a clean: rm -f *.o $(PROG) diff --git a/test/ipc/shmget/Makefile b/test/ipc/shmget/Makefile index ae58b4581..bf814600e 100644 --- a/test/ipc/shmget/Makefile +++ b/test/ipc/shmget/Makefile @@ -1,32 +1,14 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -I../lib/ +CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -D_NETBSD_SOURCE=1 -I../lib/ PROG = shmget01 shmget02 shmget04 shmget05 all: $(PROG) -$(PROG): tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o - $(CC) $(CFLAGS) -o $@ $@.c tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o - -rmobj.o: ../lib/rmobj.c - $(CC) $(CFLAGS) -c -o rmobj.o ../lib/rmobj.c - -tst_res.o: ../lib/tst_res.c - $(CC) $(CFLAGS) -c -o tst_res.o ../lib/tst_res.c - -tst_sig.o: ../lib/tst_sig.c - $(CC) $(CFLAGS) -c -o tst_sig.o ../lib/tst_sig.c - -tst_tmpdir.o: ../lib/tst_tmpdir.c - $(CC) $(CFLAGS) -c -o tst_tmpdir.o ../lib/tst_tmpdir.c - -parse_opts.o: ../lib/parse_opts.c - $(CC) $(CFLAGS) -c -o parse_opts.o ../lib/parse_opts.c - -libipc.o: ../lib/libipc.c - $(CC) $(CFLAGS) -c -o libipc.o ../lib/libipc.c +$(PROG): ../libipc.a + $(CC) $(CFLAGS) -o $@ $@.c ../libipc.a clean: rm -f *.o $(PROG) diff --git a/test/ipc/shmt/Makefile b/test/ipc/shmt/Makefile index 858382727..6be476395 100644 --- a/test/ipc/shmt/Makefile +++ b/test/ipc/shmt/Makefile @@ -1,18 +1,15 @@ # Makefile for the tests CC = exec cc -CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -I../lib/ +CFLAGS = -Wall -D_MINIX -D_POSIX_SOURCE -D_NETBSD_SOURCE=1 -I../lib/ PROG = shmt02 shmt03 shmt04 shmt05 shmt06 \ shmt07 shmt08 shmt10 shmt01 all: $(PROG) -$(PROG): tst_res.o - $(CC) $(CFLAGS) -o $@ $@.c tst_res.o - -tst_res.o: ../lib/tst_res.c - $(CC) $(CFLAGS) -c -o tst_res.o ../lib/tst_res.c +$(PROG): ../libipc.a + $(CC) $(CFLAGS) -o $@ $@.c ../libipc.a test: sh testshm.sh diff --git a/test/ipc/shmt/shmt01.c b/test/ipc/shmt/shmt01.c index 4264b5878..dda9fbe86 100644 --- a/test/ipc/shmt/shmt01.c +++ b/test/ipc/shmt/shmt01.c @@ -59,7 +59,7 @@ int main(void) /* are we doing with ia64 or arm_arch_4t arch */ -#if defined (__ia64__) || defined (__ARM_ARCH_4T__) +#if defined (__ia64__) || defined (__ARM_ARCH_4T__) || defined(__minix) cp = (char *) shmat(shmid, (void *)NULL, 0); #else cp = (char *) shmat(shmid, (void *)0x80000, 0); diff --git a/test/ipc/shmt/shmt02.c b/test/ipc/shmt/shmt02.c index 836d16d31..c475c4a61 100644 --- a/test/ipc/shmt/shmt02.c +++ b/test/ipc/shmt/shmt02.c @@ -81,7 +81,7 @@ int main(void) /* are we doing with ia64 or arm_arch_4t arch */ -#if defined (__ia64__) || defined (__ARM_ARCH_4T__) +#if defined (__ia64__) || defined (__ARM_ARCH_4T__) || defined(__minix) cp = (char *) shmat(shmid, (void *)NULL, 0); #else cp = (char *) shmat(shmid, (void *)0x80000, 0); diff --git a/test/ipc/shmt/shmt04.c b/test/ipc/shmt/shmt04.c index 5d0ec3c45..f2324f187 100644 --- a/test/ipc/shmt/shmt04.c +++ b/test/ipc/shmt/shmt04.c @@ -61,7 +61,7 @@ extern int Tst_count; /* Test Case counter for tst_* routines */ key_t key; -sigset_t sigset; +sigset_t mysigset; #define ADDR1 (void *)0x40000000 #define ADDR (void *)0x80000 @@ -81,9 +81,9 @@ int main(void) signal(SIGUSR1, SIG_DFL); - sigemptyset(&sigset); - sigaddset(&sigset,SIGUSR1); - sigprocmask(SIG_BLOCK,&sigset,NULL); + sigemptyset(&mysigset); + sigaddset(&mysigset,SIGUSR1); + sigprocmask(SIG_BLOCK,&mysigset,NULL); pid = fork(); switch (pid) { @@ -109,7 +109,7 @@ if ((shmid = shmget(key, SIZE, IPC_CREAT|0666)) < 0 ) { else { #ifdef __ia64__ cp = (char *) shmat(shmid, ADDR1, 0); -#elif defined(__ARM_ARCH_4T__) +#elif defined(__ARM_ARCH_4T__) || defined(__minix) cp = (char *) shmat(shmid, NULL, 0); #else cp = (char *) shmat(shmid, ADDR, 0); @@ -171,8 +171,8 @@ int shmid, chld_pid ; char *cp; -sigemptyset(&sigset); -sigsuspend(&sigset); +sigemptyset(&mysigset); +sigsuspend(&mysigset); chld_pid = getpid() ; /*--------------------------------------------------------*/ @@ -187,7 +187,7 @@ else { #ifdef __ia64__ cp = (char *) shmat(shmid, ADDR1, 0); -#elif defined(__ARM_ARCH_4T__) +#elif defined(__ARM_ARCH_4T__) || defined(__minix) cp = (char *) shmat(shmid, NULL, 0); #else cp = (char *) shmat(shmid, ADDR, 0); diff --git a/test/ipc/shmt/shmt05.c b/test/ipc/shmt/shmt05.c index 93326e9e0..10086930d 100644 --- a/test/ipc/shmt/shmt05.c +++ b/test/ipc/shmt/shmt05.c @@ -88,7 +88,7 @@ int main(void) } else { #ifdef __ia64__ cp = (char *) shmat(shmid, ADDR_IA, 0); -#elif defined(__ARM_ARCH_4T__) +#elif defined(__ARM_ARCH_4T__) || defined(__minix) cp = (char *) shmat(shmid, (void *)NULL, 0); #else cp = (char *) shmat(shmid, ADDR, 0); diff --git a/test/ipc/shmt/shmt06.c b/test/ipc/shmt/shmt06.c index 54e829dcc..2f3f8e858 100644 --- a/test/ipc/shmt/shmt06.c +++ b/test/ipc/shmt/shmt06.c @@ -66,7 +66,7 @@ extern int Tst_count; /* Test Case counter for tst_* routines */ /**************/ key_t key; -sigset_t sigset; +sigset_t mysigset; int child(void); int rm_shm(int); @@ -81,9 +81,9 @@ int main(void) signal(SIGUSR1, SIG_DFL); - sigemptyset(&sigset); - sigaddset(&sigset,SIGUSR1); - sigprocmask(SIG_BLOCK,&sigset,NULL); + sigemptyset(&mysigset); + sigaddset(&mysigset,SIGUSR1); + sigprocmask(SIG_BLOCK,&mysigset,NULL); pid = fork(); switch (pid) { @@ -109,7 +109,7 @@ int main(void) else { #ifdef __ia64__ cp = (char *) shmat(shmid, ADDR_IA, 0); -#elif defined(__ARM_ARCH_4T__) +#elif defined(__ARM_ARCH_4T__) || defined(__minix) cp = (char *) shmat(shmid, (void*) NULL, 0); #elif defined(__mips__) cp = (char *) shmat(shmid, ADDR_MIPS, 0); @@ -172,8 +172,8 @@ int child(void) chld_pid ; char *cp; - sigemptyset(&sigset); - sigsuspend(&sigset); + sigemptyset(&mysigset); + sigsuspend(&mysigset); chld_pid = getpid() ; if ((shmid = shmget(key, SIZE, 0)) < 0) { @@ -185,7 +185,7 @@ int child(void) else { #ifdef __ia64__ cp = (char *) shmat(shmid, ADDR1_IA, 0); -#elif defined(__ARM_ARCH_4T__) +#elif defined(__ARM_ARCH_4T__) || defined(__minix) cp = (char *) shmat(shmid, (void *) NULL, 0); #elif defined(__mips__) cp = (char *) shmat(shmid, ADDR1_MIPS, 0); diff --git a/test/ipc/shmt/shmt07.c b/test/ipc/shmt/shmt07.c index dbf7f136c..1342607da 100644 --- a/test/ipc/shmt/shmt07.c +++ b/test/ipc/shmt/shmt07.c @@ -84,7 +84,7 @@ int main(void) #ifdef __ia64__ cp = (char *) shmat(shmid, ADDR_IA, 0); -#elif defined(__ARM_ARCH_4T__) +#elif defined(__ARM_ARCH_4T__) || defined(__minix) cp = (char *) shmat(shmid, (void *) NULL, 0); #else cp = (char *) shmat(shmid, ADDR, 0);