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
This commit is contained in:
parent
c9f644bd68
commit
df3975243b
21 changed files with 56 additions and 185 deletions
|
@ -17,6 +17,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
all test clean:
|
all test clean:
|
||||||
|
$(MAKE) -C ./lib $@
|
||||||
# $(MAKE) -C ./msgctl $@
|
# $(MAKE) -C ./msgctl $@
|
||||||
# $(MAKE) -C ./msgget $@
|
# $(MAKE) -C ./msgget $@
|
||||||
# $(MAKE) -C ./msgrcv $@
|
# $(MAKE) -C ./msgrcv $@
|
||||||
|
|
|
@ -16,11 +16,11 @@
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
# 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)
|
OBJS = $(SRCS:.c=.o)
|
||||||
LIBIPC = ../libipc.a
|
LIBIPC = ../libipc.a
|
||||||
|
|
||||||
CFLAGS += -I../../../../../include -Wall
|
CFLAGS += -I../../../../../include -Wall -D_NETBSD_SOURCE=1
|
||||||
|
|
||||||
all: $(LIBIPC)
|
all: $(LIBIPC)
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
#include "ipcsem.h"
|
#include "ipcsem.h"
|
||||||
|
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <sys/timeb.h>
|
#include <sys/time.h>
|
||||||
#include <sys/ipc.h>
|
#include <sys/ipc.h>
|
||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
#include <sys/sem.h>
|
#include <sys/sem.h>
|
||||||
|
@ -61,7 +61,7 @@ getipckey()
|
||||||
char curdira[PATH_MAX];
|
char curdira[PATH_MAX];
|
||||||
size_t size = sizeof(curdira);
|
size_t size = sizeof(curdira);
|
||||||
key_t ipc_key;
|
key_t ipc_key;
|
||||||
struct timeb time_info;
|
struct timeval tv;
|
||||||
|
|
||||||
if (NULL == (curdir = getcwd(curdira, size))) {
|
if (NULL == (curdir = getcwd(curdira, size))) {
|
||||||
tst_brkm(TBROK, cleanup, "Can't get current directory "
|
tst_brkm(TBROK, cleanup, "Can't get current directory "
|
||||||
|
@ -77,11 +77,11 @@ getipckey()
|
||||||
* project identifier is a "random character" produced by
|
* project identifier is a "random character" produced by
|
||||||
* generating a random number between 0 and 25 and then adding
|
* generating a random number between 0 and 25 and then adding
|
||||||
* that to the ascii value of 'a'. The "seed" for the random
|
* that to the ascii value of 'a'. The "seed" for the random
|
||||||
* number is the millisecond value that is set in the timeb
|
* number is the microsecond value that is set in the timeval
|
||||||
* structure after calling ftime().
|
* structure after calling gettimeofday().
|
||||||
*/
|
*/
|
||||||
(void)ftime(&time_info);
|
(void) gettimeofday(&tv, NULL);
|
||||||
srandom((unsigned int)time_info.millitm);
|
srandom((unsigned int)tv.tv_usec);
|
||||||
|
|
||||||
if ((ipc_key = ftok(curdir, ascii_a + random()%26)) == -1) {
|
if ((ipc_key = ftok(curdir, ascii_a + random()%26)) == -1) {
|
||||||
tst_brkm(TBROK, cleanup, "Can't get msgkey from ftok()");
|
tst_brkm(TBROK, cleanup, "Can't get msgkey from ftok()");
|
||||||
|
|
|
@ -577,7 +577,7 @@ STD_opts_help(void)
|
||||||
|
|
||||||
for(i = 0; std_options[i].optstr; ++i) {
|
for(i = 0; std_options[i].optstr; ++i) {
|
||||||
if (std_options[i].help)
|
if (std_options[i].help)
|
||||||
printf(std_options[i].help);
|
fputs(std_options[i].help, stdout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,32 +1,14 @@
|
||||||
# Makefile for the tests
|
# Makefile for the tests
|
||||||
|
|
||||||
CC = exec cc
|
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
|
PROG = semctl01 semctl02 semctl03 semctl04 semctl05 semctl06 semctl07
|
||||||
|
|
||||||
all: $(PROG)
|
all: $(PROG)
|
||||||
|
|
||||||
$(PROG): tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o
|
$(PROG): ../libipc.a
|
||||||
$(CC) $(CFLAGS) -o $@ $@.c tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o
|
$(CC) $(CFLAGS) -o $@ $@.c ../libipc.a
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o $(PROG)
|
rm -f *.o $(PROG)
|
||||||
|
|
|
@ -94,7 +94,6 @@ int main(int ac, char **av)
|
||||||
TEST(semctl(sem_id_1, 0, IPC_STAT, un_arg));
|
TEST(semctl(sem_id_1, 0, IPC_STAT, un_arg));
|
||||||
|
|
||||||
if (TEST_RETURN != -1) {
|
if (TEST_RETURN != -1) {
|
||||||
printf("result: %d\n", TEST_RETURN);
|
|
||||||
tst_resm(TFAIL, "call succeeded when error expected");
|
tst_resm(TFAIL, "call succeeded when error expected");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +1,14 @@
|
||||||
# Makefile for the tests
|
# Makefile for the tests
|
||||||
|
|
||||||
CC = exec cc
|
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
|
PROG = semget01 semget02 semget03 semget05 semget06
|
||||||
|
|
||||||
all: $(PROG)
|
all: $(PROG)
|
||||||
|
|
||||||
$(PROG): tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o
|
$(PROG): ../libipc.a
|
||||||
$(CC) $(CFLAGS) -o $@ $@.c tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o
|
$(CC) $(CFLAGS) -o $@ $@.c ../libipc.a
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o $(PROG)
|
rm -f *.o $(PROG)
|
||||||
|
|
|
@ -72,7 +72,7 @@ int num_sems = 0; /* count the semaphores created */
|
||||||
|
|
||||||
int main(int ac, char **av)
|
int main(int ac, char **av)
|
||||||
{
|
{
|
||||||
int lc,getmaxid; /* loop counter */
|
int lc,getmaxid=0; /* loop counter */
|
||||||
char *msg; /* message returned from parse_opts */
|
char *msg; /* message returned from parse_opts */
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
|
|
|
@ -1,32 +1,14 @@
|
||||||
# Makefile for the tests
|
# Makefile for the tests
|
||||||
|
|
||||||
CC = exec cc
|
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
|
PROG = semop01 semop02 semop03 semop04 semop05
|
||||||
|
|
||||||
all: $(PROG)
|
all: $(PROG)
|
||||||
|
|
||||||
$(PROG): tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o
|
$(PROG): ../libipc.a
|
||||||
$(CC) $(CFLAGS) -o $@ $@.c tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o
|
$(CC) $(CFLAGS) -o $@ $@.c ../libipc.a
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o $(PROG)
|
rm -f *.o $(PROG)
|
||||||
|
|
|
@ -1,32 +1,14 @@
|
||||||
# Makefile for the tests
|
# Makefile for the tests
|
||||||
|
|
||||||
CC = exec cc
|
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
|
PROG = shmat01 shmat02 shmat03
|
||||||
|
|
||||||
all: $(PROG)
|
all: $(PROG)
|
||||||
|
|
||||||
$(PROG): tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o
|
$(PROG): ../libipc.a
|
||||||
$(CC) $(CFLAGS) -o $@ $@.c tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o
|
$(CC) $(CFLAGS) -o $@ $@.c ../libipc.a
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o $(PROG)
|
rm -f *.o $(PROG)
|
||||||
|
|
|
@ -124,7 +124,7 @@ int main(int ac, char **av)
|
||||||
addr = shmat(*(TC[i].shmid), (void *)(TC[i].addr),
|
addr = shmat(*(TC[i].shmid), (void *)(TC[i].addr),
|
||||||
TC[i].flags);
|
TC[i].flags);
|
||||||
TEST_ERRNO = errno;
|
TEST_ERRNO = errno;
|
||||||
|
|
||||||
if (addr == (void *)-1) {
|
if (addr == (void *)-1) {
|
||||||
tst_brkm(TFAIL, cleanup, "%s call failed - "
|
tst_brkm(TFAIL, cleanup, "%s call failed - "
|
||||||
"errno = %d : %s", TCID, TEST_ERRNO,
|
"errno = %d : %s", TCID, TEST_ERRNO,
|
||||||
|
|
|
@ -1,32 +1,14 @@
|
||||||
# Makefile for the tests
|
# Makefile for the tests
|
||||||
|
|
||||||
CC = exec cc
|
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
|
PROG = shmctl01 shmctl02 shmctl03 shmctl04
|
||||||
|
|
||||||
all: $(PROG)
|
all: $(PROG)
|
||||||
|
|
||||||
$(PROG): tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o
|
$(PROG): ../libipc.a
|
||||||
$(CC) $(CFLAGS) -o $@ $@.c tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o
|
$(CC) $(CFLAGS) -o $@ $@.c ../libipc.a
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o $(PROG)
|
rm -f *.o $(PROG)
|
||||||
|
|
|
@ -1,32 +1,14 @@
|
||||||
# Makefile for the tests
|
# Makefile for the tests
|
||||||
|
|
||||||
CC = exec cc
|
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
|
PROG = shmdt01 shmdt02
|
||||||
|
|
||||||
all: $(PROG)
|
all: $(PROG)
|
||||||
|
|
||||||
$(PROG): tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o
|
$(PROG): ../libipc.a
|
||||||
$(CC) $(CFLAGS) -o $@ $@.c tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o
|
$(CC) $(CFLAGS) -o $@ $@.c ../libipc.a
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o $(PROG)
|
rm -f *.o $(PROG)
|
||||||
|
|
|
@ -1,32 +1,14 @@
|
||||||
# Makefile for the tests
|
# Makefile for the tests
|
||||||
|
|
||||||
CC = exec cc
|
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
|
PROG = shmget01 shmget02 shmget04 shmget05
|
||||||
|
|
||||||
all: $(PROG)
|
all: $(PROG)
|
||||||
|
|
||||||
$(PROG): tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o
|
$(PROG): ../libipc.a
|
||||||
$(CC) $(CFLAGS) -o $@ $@.c tst_res.o libipc.o tst_sig.o parse_opts.o tst_tmpdir.o rmobj.o
|
$(CC) $(CFLAGS) -o $@ $@.c ../libipc.a
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o $(PROG)
|
rm -f *.o $(PROG)
|
||||||
|
|
|
@ -1,18 +1,15 @@
|
||||||
# Makefile for the tests
|
# Makefile for the tests
|
||||||
|
|
||||||
CC = exec cc
|
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 \
|
PROG = shmt02 shmt03 shmt04 shmt05 shmt06 \
|
||||||
shmt07 shmt08 shmt10 shmt01
|
shmt07 shmt08 shmt10 shmt01
|
||||||
|
|
||||||
all: $(PROG)
|
all: $(PROG)
|
||||||
|
|
||||||
$(PROG): tst_res.o
|
$(PROG): ../libipc.a
|
||||||
$(CC) $(CFLAGS) -o $@ $@.c tst_res.o
|
$(CC) $(CFLAGS) -o $@ $@.c ../libipc.a
|
||||||
|
|
||||||
tst_res.o: ../lib/tst_res.c
|
|
||||||
$(CC) $(CFLAGS) -c -o tst_res.o ../lib/tst_res.c
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
sh testshm.sh
|
sh testshm.sh
|
||||||
|
|
|
@ -59,7 +59,7 @@ int main(void)
|
||||||
|
|
||||||
|
|
||||||
/* are we doing with ia64 or arm_arch_4t arch */
|
/* 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);
|
cp = (char *) shmat(shmid, (void *)NULL, 0);
|
||||||
#else
|
#else
|
||||||
cp = (char *) shmat(shmid, (void *)0x80000, 0);
|
cp = (char *) shmat(shmid, (void *)0x80000, 0);
|
||||||
|
|
|
@ -81,7 +81,7 @@ int main(void)
|
||||||
|
|
||||||
|
|
||||||
/* are we doing with ia64 or arm_arch_4t arch */
|
/* 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);
|
cp = (char *) shmat(shmid, (void *)NULL, 0);
|
||||||
#else
|
#else
|
||||||
cp = (char *) shmat(shmid, (void *)0x80000, 0);
|
cp = (char *) shmat(shmid, (void *)0x80000, 0);
|
||||||
|
|
|
@ -61,7 +61,7 @@ extern int Tst_count; /* Test Case counter for tst_* routines */
|
||||||
|
|
||||||
|
|
||||||
key_t key;
|
key_t key;
|
||||||
sigset_t sigset;
|
sigset_t mysigset;
|
||||||
|
|
||||||
#define ADDR1 (void *)0x40000000
|
#define ADDR1 (void *)0x40000000
|
||||||
#define ADDR (void *)0x80000
|
#define ADDR (void *)0x80000
|
||||||
|
@ -81,9 +81,9 @@ int main(void)
|
||||||
|
|
||||||
signal(SIGUSR1, SIG_DFL);
|
signal(SIGUSR1, SIG_DFL);
|
||||||
|
|
||||||
sigemptyset(&sigset);
|
sigemptyset(&mysigset);
|
||||||
sigaddset(&sigset,SIGUSR1);
|
sigaddset(&mysigset,SIGUSR1);
|
||||||
sigprocmask(SIG_BLOCK,&sigset,NULL);
|
sigprocmask(SIG_BLOCK,&mysigset,NULL);
|
||||||
|
|
||||||
pid = fork();
|
pid = fork();
|
||||||
switch (pid) {
|
switch (pid) {
|
||||||
|
@ -109,7 +109,7 @@ if ((shmid = shmget(key, SIZE, IPC_CREAT|0666)) < 0 ) {
|
||||||
else {
|
else {
|
||||||
#ifdef __ia64__
|
#ifdef __ia64__
|
||||||
cp = (char *) shmat(shmid, ADDR1, 0);
|
cp = (char *) shmat(shmid, ADDR1, 0);
|
||||||
#elif defined(__ARM_ARCH_4T__)
|
#elif defined(__ARM_ARCH_4T__) || defined(__minix)
|
||||||
cp = (char *) shmat(shmid, NULL, 0);
|
cp = (char *) shmat(shmid, NULL, 0);
|
||||||
#else
|
#else
|
||||||
cp = (char *) shmat(shmid, ADDR, 0);
|
cp = (char *) shmat(shmid, ADDR, 0);
|
||||||
|
@ -171,8 +171,8 @@ int shmid,
|
||||||
chld_pid ;
|
chld_pid ;
|
||||||
char *cp;
|
char *cp;
|
||||||
|
|
||||||
sigemptyset(&sigset);
|
sigemptyset(&mysigset);
|
||||||
sigsuspend(&sigset);
|
sigsuspend(&mysigset);
|
||||||
chld_pid = getpid() ;
|
chld_pid = getpid() ;
|
||||||
/*--------------------------------------------------------*/
|
/*--------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ else
|
||||||
{
|
{
|
||||||
#ifdef __ia64__
|
#ifdef __ia64__
|
||||||
cp = (char *) shmat(shmid, ADDR1, 0);
|
cp = (char *) shmat(shmid, ADDR1, 0);
|
||||||
#elif defined(__ARM_ARCH_4T__)
|
#elif defined(__ARM_ARCH_4T__) || defined(__minix)
|
||||||
cp = (char *) shmat(shmid, NULL, 0);
|
cp = (char *) shmat(shmid, NULL, 0);
|
||||||
#else
|
#else
|
||||||
cp = (char *) shmat(shmid, ADDR, 0);
|
cp = (char *) shmat(shmid, ADDR, 0);
|
||||||
|
|
|
@ -88,7 +88,7 @@ int main(void)
|
||||||
} else {
|
} else {
|
||||||
#ifdef __ia64__
|
#ifdef __ia64__
|
||||||
cp = (char *) shmat(shmid, ADDR_IA, 0);
|
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);
|
cp = (char *) shmat(shmid, (void *)NULL, 0);
|
||||||
#else
|
#else
|
||||||
cp = (char *) shmat(shmid, ADDR, 0);
|
cp = (char *) shmat(shmid, ADDR, 0);
|
||||||
|
|
|
@ -66,7 +66,7 @@ extern int Tst_count; /* Test Case counter for tst_* routines */
|
||||||
/**************/
|
/**************/
|
||||||
|
|
||||||
key_t key;
|
key_t key;
|
||||||
sigset_t sigset;
|
sigset_t mysigset;
|
||||||
|
|
||||||
int child(void);
|
int child(void);
|
||||||
int rm_shm(int);
|
int rm_shm(int);
|
||||||
|
@ -81,9 +81,9 @@ int main(void)
|
||||||
|
|
||||||
signal(SIGUSR1, SIG_DFL);
|
signal(SIGUSR1, SIG_DFL);
|
||||||
|
|
||||||
sigemptyset(&sigset);
|
sigemptyset(&mysigset);
|
||||||
sigaddset(&sigset,SIGUSR1);
|
sigaddset(&mysigset,SIGUSR1);
|
||||||
sigprocmask(SIG_BLOCK,&sigset,NULL);
|
sigprocmask(SIG_BLOCK,&mysigset,NULL);
|
||||||
|
|
||||||
pid = fork();
|
pid = fork();
|
||||||
switch (pid) {
|
switch (pid) {
|
||||||
|
@ -109,7 +109,7 @@ int main(void)
|
||||||
else {
|
else {
|
||||||
#ifdef __ia64__
|
#ifdef __ia64__
|
||||||
cp = (char *) shmat(shmid, ADDR_IA, 0);
|
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);
|
cp = (char *) shmat(shmid, (void*) NULL, 0);
|
||||||
#elif defined(__mips__)
|
#elif defined(__mips__)
|
||||||
cp = (char *) shmat(shmid, ADDR_MIPS, 0);
|
cp = (char *) shmat(shmid, ADDR_MIPS, 0);
|
||||||
|
@ -172,8 +172,8 @@ int child(void)
|
||||||
chld_pid ;
|
chld_pid ;
|
||||||
char *cp;
|
char *cp;
|
||||||
|
|
||||||
sigemptyset(&sigset);
|
sigemptyset(&mysigset);
|
||||||
sigsuspend(&sigset);
|
sigsuspend(&mysigset);
|
||||||
chld_pid = getpid() ;
|
chld_pid = getpid() ;
|
||||||
|
|
||||||
if ((shmid = shmget(key, SIZE, 0)) < 0) {
|
if ((shmid = shmget(key, SIZE, 0)) < 0) {
|
||||||
|
@ -185,7 +185,7 @@ int child(void)
|
||||||
else {
|
else {
|
||||||
#ifdef __ia64__
|
#ifdef __ia64__
|
||||||
cp = (char *) shmat(shmid, ADDR1_IA, 0);
|
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);
|
cp = (char *) shmat(shmid, (void *) NULL, 0);
|
||||||
#elif defined(__mips__)
|
#elif defined(__mips__)
|
||||||
cp = (char *) shmat(shmid, ADDR1_MIPS, 0);
|
cp = (char *) shmat(shmid, ADDR1_MIPS, 0);
|
||||||
|
|
|
@ -84,7 +84,7 @@ int main(void)
|
||||||
|
|
||||||
#ifdef __ia64__
|
#ifdef __ia64__
|
||||||
cp = (char *) shmat(shmid, ADDR_IA, 0);
|
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);
|
cp = (char *) shmat(shmid, (void *) NULL, 0);
|
||||||
#else
|
#else
|
||||||
cp = (char *) shmat(shmid, ADDR, 0);
|
cp = (char *) shmat(shmid, ADDR, 0);
|
||||||
|
|
Loading…
Reference in a new issue