Module Name: src
Committed By: pooka
Date: Wed Sep 1 19:41:28 UTC 2010
Modified Files:
src/tests/fs/common: fstest_puffs.c
src/tests/fs/tmpfs: t_renamerace.c
src/tests/fs/vfs: t_renamerace.c
src/tests/syscall: t_cmsg.c
Log Message:
update to new rump lwp/proc interfaces
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/common/fstest_puffs.c
cvs rdiff -u -r1.8 -r1.9 src/tests/fs/tmpfs/t_renamerace.c
cvs rdiff -u -r1.11 -r1.12 src/tests/fs/vfs/t_renamerace.c
cvs rdiff -u -r1.14 -r1.15 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/fs/common/fstest_puffs.c
diff -u src/tests/fs/common/fstest_puffs.c:1.2 src/tests/fs/common/fstest_puffs.c:1.3
--- src/tests/fs/common/fstest_puffs.c:1.2 Fri Jul 30 16:15:05 2010
+++ src/tests/fs/common/fstest_puffs.c Wed Sep 1 19:41:27 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: fstest_puffs.c,v 1.2 2010/07/30 16:15:05 pooka Exp $ */
+/* $NetBSD: fstest_puffs.c,v 1.3 2010/09/01 19:41:27 pooka Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -72,8 +72,7 @@
phdr = (void *)buf;
preq = (void *)buf;
- /* use static thread id */
- rump_pub_lwp_alloc_and_switch(0, 10);
+ rump_pub_lwproc_newlwp(0);
for (;;) {
ssize_t n;
@@ -114,8 +113,7 @@
size_t toread;
int comfd, puffsfd;
- /* use static thread id */
- rump_pub_lwp_alloc_and_switch(0, 11);
+ rump_pub_lwproc_newlwp(0);
comfd = args->pta_servfd;
puffsfd = args->pta_rumpfd;
Index: src/tests/fs/tmpfs/t_renamerace.c
diff -u src/tests/fs/tmpfs/t_renamerace.c:1.8 src/tests/fs/tmpfs/t_renamerace.c:1.9
--- src/tests/fs/tmpfs/t_renamerace.c:1.8 Wed Jul 14 21:39:31 2010
+++ src/tests/fs/tmpfs/t_renamerace.c Wed Sep 1 19:41:27 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: t_renamerace.c,v 1.8 2010/07/14 21:39:31 pooka Exp $ */
+/* $NetBSD: t_renamerace.c,v 1.9 2010/09/01 19:41:27 pooka Exp $ */
/*
* Modified for rump and atf from a program supplied
@@ -33,13 +33,14 @@
}
static volatile int quittingtime = 0;
+static pid_t wrkpid;
static void *
r2w1(void *arg)
{
int fd;
- rump_pub_lwp_alloc_and_switch(0, 0);
+ rump_pub_lwproc_newlwp(wrkpid);
fd = rump_sys_open("/file", O_CREAT | O_RDWR, 0777);
if (fd == -1)
@@ -61,7 +62,7 @@
{
int fd;
- rump_pub_lwp_alloc_and_switch(0, 0);
+ rump_pub_lwproc_newlwp(wrkpid);
while (!quittingtime) {
fd = rump_sys_open("/dir/file1", O_RDWR);
@@ -104,6 +105,8 @@
if (rump_sys_mkdir("/dir", 0777) == -1)
atf_tc_fail_errno("cannot create directory");
+ RZ(rump_pub_lwproc_newproc());
+ RL(wrkpid = rump_sys_getpid());
pthread_create(&pt[0], NULL, r2w1, NULL);
pthread_create(&pt[1], NULL, r2w2, NULL);
Index: src/tests/fs/vfs/t_renamerace.c
diff -u src/tests/fs/vfs/t_renamerace.c:1.11 src/tests/fs/vfs/t_renamerace.c:1.12
--- src/tests/fs/vfs/t_renamerace.c:1.11 Thu Aug 26 18:06:44 2010
+++ src/tests/fs/vfs/t_renamerace.c Wed Sep 1 19:41:28 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: t_renamerace.c,v 1.11 2010/08/26 18:06:44 pooka Exp $ */
+/* $NetBSD: t_renamerace.c,v 1.12 2010/09/01 19:41:28 pooka Exp $ */
/*
* Modified for rump and atf from a program supplied
@@ -25,13 +25,14 @@
#include "../../h_macros.h"
static volatile int quittingtime;
+pid_t wrkpid;
static void *
w1(void *arg)
{
int fd;
- rump_pub_lwp_alloc_and_switch(0, 10);
+ rump_pub_lwproc_newlwp(wrkpid);
while (!quittingtime) {
fd = rump_sys_open("rename.test1",
@@ -49,7 +50,7 @@
w1_dirs(void *arg)
{
- rump_pub_lwp_alloc_and_switch(0, 10);
+ rump_pub_lwproc_newlwp(wrkpid);
while (!quittingtime) {
if (rump_sys_mkdir("rename.test1", 0777) == -1)
@@ -64,7 +65,7 @@
w2(void *arg)
{
- rump_pub_lwp_alloc_and_switch(0, 11);
+ rump_pub_lwproc_newlwp(wrkpid);
while (!quittingtime) {
rump_sys_rename("rename.test1", "rename.test2");
@@ -123,6 +124,9 @@
FSTYPE_MSDOS(tc))
atf_tc_expect_signal(-1, "PR kern/43626");
+ RZ(rump_pub_lwproc_newproc());
+ RL(wrkpid = rump_sys_getpid());
+
RL(rump_sys_chdir(mp));
pthread_create(&pt1, NULL, w1_dirs, NULL);
pthread_create(&pt2, NULL, w2, NULL);
Index: src/tests/syscall/t_cmsg.c
diff -u src/tests/syscall/t_cmsg.c:1.14 src/tests/syscall/t_cmsg.c:1.15
--- src/tests/syscall/t_cmsg.c:1.14 Fri Aug 27 10:03:14 2010
+++ src/tests/syscall/t_cmsg.c Wed Sep 1 19:41:28 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: t_cmsg.c,v 1.14 2010/08/27 10:03:14 pgoyette Exp $ */
+/* $NetBSD: t_cmsg.c,v 1.15 2010/09/01 19:41:28 pooka Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@@ -92,7 +92,8 @@
rump_init();
/* create first (non-proc0) process to be used in test */
- l1 = rump_pub_newproc_switch();
+ RZ(rump_pub_lwproc_newproc());
+ l1 = rump_pub_lwproc_curlwp();
/* create unix socket and bind it to a path */
memset(&sun, 0, sizeof(sun));
@@ -108,7 +109,8 @@
atf_tc_fail_errno("socket 1 listen");
/* create second process for test */
- l2 = rump_pub_newproc_switch();
+ RZ(rump_pub_lwproc_newproc());
+ l2 = rump_pub_lwproc_curlwp();
/* connect to unix domain socket */
memset(&sun, 0, sizeof(sun));
@@ -157,7 +159,7 @@
*(int *)CMSG_DATA(cmp) = -1;
/* switch back to original proc */
- rump_pub_lwp_switch(l1);
+ rump_pub_lwproc_switch(l1);
/* accept connection and read fd */
sl = sizeof(sun);