PERFORCE change 137667 for review
Zhouyi ZHOU
zhouzhouyi at FreeBSD.org
Fri Mar 14 03:04:35 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=137667
Change 137667 by zhouzhouyi at zhouzhouyi_mactest on 2008/03/14 03:03:53
prepare the program to test vn_poll for MAC Framework
Affected files ...
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/mactest.c#17 edit
Differences ...
==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/mactest.c#17 (text+ko) ====
@@ -45,7 +45,7 @@
#include <assert.h>
#include <signal.h>
#include "mactest.h"
-
+#include <poll.h>
#ifndef HAS_TRUNCATE64
#define truncate64 truncate
@@ -88,6 +88,7 @@
ACTION_TRUNCATE,
ACTION_STAT,
ACTION_LSTAT,
+ ACTION_VNPOLL,
};
#define SIGUSER1 30
#define TYPE_NONE 0x0000
@@ -131,6 +132,7 @@
{ "truncate", ACTION_TRUNCATE, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
{ "stat", ACTION_STAT, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
{ "lstat", ACTION_LSTAT, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
+ { "vnpoll", ACTION_VNPOLL, { TYPE_STRING, TYPE_NONE } },
{ NULL, -1, { TYPE_NONE } }
};
@@ -528,6 +530,22 @@
return (i);
}
break;
+ case ACTION_VNPOLL:
+ {
+
+ struct pollfd pfd;
+ int fd;
+ fd = open("/root/pf.conf", O_RDWR);
+ if (fd <= 0)
+ goto erropen;
+ pfd.fd = fd;
+ pfd.events = POLLWRNORM;
+ pfd.revents = 0;
+ poll(&pfd, 1, 1);
+ close(fd);
+ erropen:
+ break;
+ }
default:
fprintf(stderr, "unsupported syscall\n");
close(logfd);
More information about the p4-projects
mailing list