Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Aug 2007 06:29:45 GMT
From:      Zhouyi ZHOU <zhouzhouyi@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 125765 for review
Message-ID:  <200708280629.l7S6TjW1022222@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=125765

Change 125765 by zhouzhouyi@zhouzhouyi_mactest on 2007/08/28 06:29:39

	After this is beyond Google Summer Code
	Add sysvsem program

Affected files ...

.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/Makefile#8 edit
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/semtest.c#1 add
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/shmtest.c#5 edit

Differences ...

==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/Makefile#8 (text+ko) ====

@@ -6,7 +6,8 @@
 #CFLAGS+=-DHAS_TRUNCATE64
 #CFLAGS+=-DHAS_STAT64
 
-all:	macproc mactest mdconfigopenrdonly fifo_io pipe_io macping shmtest
+all:	macproc mactest mdconfigopenrdonly fifo_io pipe_io macping shmtest \
+	semtest
 
 macproc:	macproc.c
 	gcc -Wall ${CFLAGS} macproc.c -o macproc -lutil
@@ -24,6 +25,8 @@
 	chmod 4555 macping
 shmtest: shmtest.c  macconf.c mactestparser.tab.c
 	gcc ${CFLAGS} -o shmtest shmtest.c macconf.c mactestparser.tab.c
+semtest: semtest.c macconf.c mactestparser.tab.c
+	gcc ${CFLAGS} -o semtest semtest.c macconf.c mactestparser.tab.c
 
 clean:
 	rm -f macproc

==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/shmtest.c#5 (text+ko) ====

@@ -191,42 +191,7 @@
 		err(1, "error create");
 
 
-/*
-	if ((sender_shmid = shmget(shmkey, pgsize,   SHM_W)) == -1){
-		close(logfd);
-		err(1, "shmget");
-		exit(1);
-	}
-
-
-	if (shmctl(sender_shmid, IPC_STAT, &s_ds) == -1) {
-		close(logfd);
-		err(1, "shmctl IPC_STAT");
-		exit(1);
-	}
-
-	print_shmid_ds(&s_ds, 0640);
-
-	s_ds.shm_perm.mode = (s_ds.shm_perm.mode & ~0777) | 0600;
-
-	if (shmctl(sender_shmid, IPC_SET, &s_ds) == -1)
-		err(1, "shmctl IPC_SET");
-
-	memset(&s_ds, 0, sizeof(s_ds));
-
-	if (shmctl(sender_shmid, IPC_STAT, &s_ds) == -1)
-		err(1, "shmctl IPC_STAT");
 
-	if ((s_ds.shm_perm.mode & 0777) != 0600)
-		err(1, "IPC_SET of mode didn't hold");
-
-	print_shmid_ds(&s_ds, 0600);
-
-	if ((shm_buf = shmat(sender_shmid, NULL, 0)) == (void *) -1)
-		err(1, "sender: shmat");
-
-*/
-
 	/*
 	 * Write the test pattern into the shared memory buffer.
 	 */
@@ -317,7 +282,8 @@
 	if (waitpid(child_pid, 0, 0) == -1)
 		err(1, "error send");
 
-/*check for ipc_set */
+	
+	/*check for ipc_set */
 	switch ((child_pid = fork())) {
 	case -1:
 		err(1, "fork");
@@ -341,7 +307,7 @@
 			}
 			mac_free(label);
 		}
-		if ((sender_shmid = shmget(shmkey, pgsize, SHM_R)) == -1){
+		if ((sender_shmid = shmget(shmkey, pgsize, SHM_W)) == -1){
 			err(1, "shmget");
 			exit(1);
 		}
@@ -359,7 +325,7 @@
 
 
 	if (waitpid(child_pid, 0, 0) == -1)
-		err(1, "error send");
+		err(1, "error set");
 
 
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708280629.l7S6TjW1022222>