Module Name:    src
Committed By:   pooka
Date:           Thu Nov 26 17:33:23 UTC 2009

Modified Files:
        src/tests/syscall: Makefile t_cmsg.c

Log Message:
Since rumpfs has supported file system sockets for quite a while
now, we don't need tmpfs here.  But, rumpfs doesn't support regular
files, so pass a pipe descriptor instead of an open file fd.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/syscall/Makefile
cvs rdiff -u -r1.11 -r1.12 src/tests/syscall/t_cmsg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/syscall/Makefile
diff -u src/tests/syscall/Makefile:1.7 src/tests/syscall/Makefile:1.8
--- src/tests/syscall/Makefile:1.7	Wed Nov 25 16:17:11 2009
+++ src/tests/syscall/Makefile	Thu Nov 26 17:33:23 2009
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2009/11/25 16:17:11 pooka Exp $
+# $NetBSD: Makefile,v 1.8 2009/11/26 17:33:23 pooka Exp $
 
 .include <bsd.own.mk>
 
@@ -7,7 +7,7 @@
 TESTS_C+=	t_cmsg
 
 LDADD+=	-lrumpnet_local -lrumpnet_net -lrumpnet
-LDADD+=	-lrumpfs_tmpfs -lrumpvfs -lrump -lrumpuser -lpthread
+LDADD+=	-lrumpvfs -lrump -lrumpuser -lpthread
 
 WARNS=		4
 

Index: src/tests/syscall/t_cmsg.c
diff -u src/tests/syscall/t_cmsg.c:1.11 src/tests/syscall/t_cmsg.c:1.12
--- src/tests/syscall/t_cmsg.c:1.11	Fri Nov  6 15:28:21 2009
+++ src/tests/syscall/t_cmsg.c	Thu Nov 26 17:33:23 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_cmsg.c,v 1.11 2009/11/06 15:28:21 pooka Exp $	*/
+/*	$NetBSD: t_cmsg.c,v 1.12 2009/11/26 17:33:23 pooka Exp $	*/
 
 #include <sys/types.h>
 #include <sys/mount.h>
@@ -8,8 +8,6 @@
 #include <rump/rump.h>
 #include <rump/rump_syscalls.h>
 
-#include <fs/tmpfs/tmpfs_args.h>
-
 #include <atf-c.h>
 #include <fcntl.h>
 #include <err.h>
@@ -84,25 +82,14 @@
 	char buf[128];
 	struct cmsghdr *cmp;
 	struct msghdr msg;
-	struct tmpfs_args args;
 	struct sockaddr_un sun;
 	struct lwp *l1, *l2;
 	struct iovec iov;
 	socklen_t sl;
 	int s1, s2, sgot;
-	int rfd, fd, storage;
-
-	memset(&args, 0, sizeof(args));
-	args.ta_version = TMPFS_ARGS_VERSION;
-	args.ta_root_mode = 0777;
+	int rfd, fd[2], storage;
 
 	rump_init();
-	/*
-	 * mount tmpfs as root -- rump root file system does not support
-	 * unix domain sockets.
-	 */
-	if (rump_sys_mount(MOUNT_TMPFS, "/", 0, &args, sizeof(args)) == -1)
-		atf_tc_fail_errno("mount tmpfs");
 
 	/* create first (non-proc0) process to be used in test */
 	l1 = rump_pub_newproc_switch();
@@ -133,16 +120,13 @@
 	if (rump_sys_connect(s2, (struct sockaddr *)&sun, SUN_LEN(&sun)) == -1)
 		atf_tc_fail_errno("socket 2 connect");
 
-	/* open a file and write stuff to it */
-	fd = rump_sys_open("/foobie", O_RDWR | O_CREAT, 0777);
-	if (fd == -1)
-		atf_tc_fail_errno("can't open file");
+	/* open a pipe and write stuff to it */
+	if (rump_sys_pipe(fd) == -1)
+		atf_tc_fail_errno("can't open pipe");
 #define MAGICSTRING "duam xnaht"
-	if (rump_sys_write(fd, MAGICSTRING, sizeof(MAGICSTRING)) !=
+	if (rump_sys_write(fd[1], MAGICSTRING, sizeof(MAGICSTRING)) !=
 	    sizeof(MAGICSTRING))
-		atf_tc_fail_errno("file write"); /* XXX: errno */
-	/* reset offset */
-	rump_sys_lseek(fd, 0, SEEK_SET);
+		atf_tc_fail_errno("pipe write"); /* XXX: errno */
 
 	cmp = malloc(CMSG_LEN(sizeof(int)));
 
@@ -159,7 +143,7 @@
 	msg.msg_namelen = 0;
 	msg.msg_control = cmp;
 	msg.msg_controllen = CMSG_LEN(sizeof(int));
-	*(int *)CMSG_DATA(cmp) = fd;
+	*(int *)CMSG_DATA(cmp) = fd[0];
 
 	/* pass the fd */
 	if (rump_sys_sendmsg(s2, &msg, 0) == -1)

Reply via email to