svn commit: r258979 - user/pho/stress2/misc
Peter Holm
pho at FreeBSD.org
Thu Dec 5 12:58:34 UTC 2013
Author: pho
Date: Thu Dec 5 12:58:33 2013
New Revision: 258979
URL: http://svnweb.freebsd.org/changeset/base/258979
Log:
Use newfs_flags and added setrlimit(2) for the test of posix_openpt(2).
Sponsored by: EMC / Isilon storage division
Modified:
user/pho/stress2/misc/syscall4.sh
Modified: user/pho/stress2/misc/syscall4.sh
==============================================================================
--- user/pho/stress2/misc/syscall4.sh Thu Dec 5 11:48:50 2013 (r258978)
+++ user/pho/stress2/misc/syscall4.sh Thu Dec 5 12:58:33 2013 (r258979)
@@ -54,7 +54,7 @@ mdconfig -l | grep -q md$mdstart && mdc
mdconfig -a -t swap -s 2g -u $mdstart || exit 1
bsdlabel -w md$mdstart auto
-newfs -U md${mdstart}$part > /dev/null
+newfs $newfs_flags md${mdstart}$part > /dev/null
mount /dev/md${mdstart}$part $mntpoint
chmod 777 $mntpoint
@@ -107,6 +107,7 @@ EOF
#include <stdlib.h>
#include <string.h>
#include <sys/param.h>
+#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/wait.h>
@@ -132,7 +133,6 @@ static int ignore[] = {
#if __FreeBSD_version >= 900041
SYS_pdfork,
#endif
- SYS_posix_openpt
};
int fd[900], fds[2], socketpr[2];
@@ -275,10 +275,12 @@ int
main(int argc, char **argv)
{
struct passwd *pw;
+ struct rlimit limit;
pthread_t rp, cp[50];
time_t start;
int j;
+
magic1 = magic2 = MAGIC;
if ((pw = getpwnam("nobody")) == NULL)
err(1, "no such user: nobody");
@@ -289,6 +291,10 @@ main(int argc, char **argv)
err(1, "Can't drop privileges to \"nobody\"");
endpwent();
+ limit.rlim_cur = limit.rlim_max = 1000;
+ if (setrlimit(RLIMIT_NPTS, &limit) < 0)
+ err(1, "setrlimit");
+
signal(SIGALRM, hand);
signal(SIGILL, hand);
signal(SIGFPE, hand);
More information about the svn-src-user
mailing list