Lines Matching full:n
23 \f2\s12\h'\\n(.lu-\w'\\*(=f'u'\\*(=f\fP\s0\h'|0u'
36 'if \\n(cm=1 'ft 2
59 \f2\s14\h'\\n(.lu-\w'\\$1'u'\\$1\fP\s0\h'|0u'\c
133 \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
135 \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K ncalls;
137 \h'|11n'\*(+Kif\*(-K (argc < 2) \*(+K{\*(-K
138 \h'|21n'printf("usage: %s #syscalls\en", argv[0]);
139 \h'|21n'exit(1);
140 \h'|11n'\*(+K}\*(-K
141 \h'|11n'ncalls = atoi(argv[1]);
142 \h'|11n'\*(+Kwhile\*(-K (ncalls\*-\*- > 0)
143 \h'|21n'(\*(+Kvoid\*(-K) getpid();
162 \fI*\fP\h'|11n't1 = time csw <n>
163 \fI*\fP\h'|11n't2 = time signocsw <n>
164 \fI*\fP\h'|11n'overhead = t1 \*- 2 \fI*\fP t2;
170 \*(+Kint\*(-K\h'|11n'sigsub();
171 \*(+Kint\*(-K\h'|11n'otherpid;
172 \*(+Kint\*(-K\h'|11n'nsigs;
176 \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
178 \h'|11n'\*(+Kint\*(-K pid;
180 \h'|11n'\*(+Kif\*(-K (argc < 2) \*(+K{\*(-K
181 \h'|21n'printf("usage: %s nsignals\en", argv[0]);
182 \h'|21n'exit(1);
183 \h'|11n'\*(+K}\*(-K
184 \h'|11n'nsigs = atoi(argv[1]);
185 \h'|11n'signal(SIGALRM, sigsub);
186 \h'|11n'otherpid = getpid();
187 \h'|11n'pid = fork();
188 \h'|11n'\*(+Kif\*(-K (pid != 0) \*(+K{\*(-K
189 \h'|21n'otherpid = pid;
190 \h'|21n'kill(otherpid, SIGALRM);
191 \h'|11n'\*(+K}\*(-K
192 \h'|11n'\*(+Kfor\*(-K (;;)
193 \h'|21n'sigpause(0);
202 \h'|11n'signal(SIGALRM, sigsub);
203 \h'|11n'kill(otherpid, SIGALRM);
204 \h'|11n'\*(+Kif\*(-K (\*-\*-nsigs <= 0)
205 \h'|21n'exit(0);
223 \*(+Kint\*(-K\h'|11n'pid;
224 \*(+Kint\*(-K\h'|11n'nsigs;
225 \*(+Kint\*(-K\h'|11n'sigsub();
229 \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
231 \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K i;
233 \h'|11n'\*(+Kif\*(-K (argc < 2) \*(+K{\*(-K
234 \h'|21n'printf("usage: %s nsignals\en", argv[0]);
235 \h'|21n'exit(1);
236 \h'|11n'\*(+K}\*(-K
237 \h'|11n'nsigs = atoi(argv[1]);
238 \h'|11n'signal(SIGALRM, sigsub);
239 \h'|11n'pid = getpid();
240 \h'|11n'\*(+Kfor\*(-K (i = 0; i < nsigs; i++)
241 \h'|21n'kill(pid, SIGALRM);
250 \h'|11n'signal(SIGALRM, sigsub);
270 \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
272 \h'|11n'\*(+Kchar\*(-K buf[512];
273 \h'|11n'\*(+Kint\*(-K fd[2], msgsize;
274 \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K i, iter;
276 \h'|11n'\*(+Kif\*(-K (argc < 3) \*(+K{\*(-K
277 \h'|21n'printf("usage: %s iterations message\*-size\en", argv[0]);
278 \h'|21n'exit(1);
279 \h'|11n'\*(+K}\*(-K
280 \h'|11n'argc\*-\*-, argv++;
281 \h'|11n'iter = atoi(\fI*\fPargv);
282 \h'|11n'argc\*-\*-, argv++;
283 \h'|11n'msgsize = atoi(\fI*\fPargv);
284 \h'|11n'\*(+Kif\*(-K (msgsize > \*(+Ksizeof\*(-K (buf) || msgsize <= 0) \*(+K{\*(-K
285 \h'|21n'printf("%s: Bad message size\&.\en", \fI*\fPargv);
286 \h'|21n'exit(2);
287 \h'|11n'\*(+K}\*(-K
288 \h'|11n'\*(+Kif\*(-K (pipe(fd) < 0) \*(+K{\*(-K
289 \h'|21n'perror("pipe");
290 \h'|21n'exit(3);
291 \h'|11n'\*(+K}\*(-K
292 \h'|11n'\*(+Kfor\*(-K (i = 0; i < iter; i++) \*(+K{\*(-K
293 \h'|21n'write(fd[1], buf, msgsize);
294 \h'|21n'read(fd[0], buf, msgsize);
295 \h'|11n'\*(+K}\*(-K
315 \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
317 \h'|11n'\*(+Kchar\*(-K buf[512];
318 \h'|11n'\*(+Kint\*(-K fd[2], msgsize;
319 \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K i, iter;
321 \h'|11n'\*(+Kif\*(-K (argc < 3) \*(+K{\*(-K
322 \h'|21n'printf("usage: %s iterations message\*-size\en", argv[0]);
323 \h'|21n'exit(1);
324 \h'|11n'\*(+K}\*(-K
325 \h'|11n'argc\*-\*-, argv++;
326 \h'|11n'iter = atoi(\fI*\fPargv);
327 \h'|11n'argc\*-\*-, argv++;
328 \h'|11n'msgsize = atoi(\fI*\fPargv);
329 \h'|11n'\*(+Kif\*(-K (msgsize > \*(+Ksizeof\*(-K (buf) || msgsize <= 0) \*(+K{\*(-K
330 \h'|21n'printf("%s: Bad message size\&.\en", \fI*\fPargv);
331 \h'|21n'exit(2);
332 \h'|11n'\*(+K}\*(-K
333 \h'|11n'\*(+Kif\*(-K (pipe(fd) < 0) \*(+K{\*(-K
334 \h'|21n'perror("pipe");
335 \h'|21n'exit(3);
336 \h'|11n'\*(+K}\*(-K
337 \h'|11n'\*(+Kif\*(-K (fork() == 0)
338 \h'|21n'\*(+Kfor\*(-K (i = 0; i < iter; i++)
339 \h'|31n'read(fd[0], buf, msgsize);
340 \h'|11n'\*(+Kelse\*(-K
341 \h'|21n'\*(+Kfor\*(-K (i = 0; i < iter; i++)
342 \h'|31n'write(fd[1], buf, msgsize);
365 \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
367 \h'|11n'\*(+Kchar\*(-K buf[512];
368 \h'|11n'\*(+Kint\*(-K fd[2], fd2[2], msgsize;
369 \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K i, iter;
371 \h'|11n'\*(+Kif\*(-K (argc < 3) \*(+K{\*(-K
372 \h'|21n'printf("usage: %s iterations message\*-size\en", argv[0]);
373 \h'|21n'exit(1);
374 \h'|11n'\*(+K}\*(-K
375 \h'|11n'argc\*-\*-, argv++;
376 \h'|11n'iter = atoi(\fI*\fPargv);
377 \h'|11n'argc\*-\*-, argv++;
378 \h'|11n'msgsize = atoi(\fI*\fPargv);
379 \h'|11n'\*(+Kif\*(-K (msgsize > \*(+Ksizeof\*(-K (buf) || msgsize <= 0) \*(+K{\*(-K
380 \h'|21n'printf("%s: Bad message size\&.\en", \fI*\fPargv);
381 \h'|21n'exit(2);
382 \h'|11n'\*(+K}\*(-K
383 \h'|11n'\*(+Kif\*(-K (pipe(fd) < 0) \*(+K{\*(-K
384 \h'|21n'perror("pipe");
385 \h'|21n'exit(3);
386 \h'|11n'\*(+K}\*(-K
387 \h'|11n'\*(+Kif\*(-K (pipe(fd2) < 0) \*(+K{\*(-K
388 \h'|21n'perror("pipe");
389 \h'|21n'exit(3);
390 \h'|11n'\*(+K}\*(-K
391 \h'|11n'\*(+Kif\*(-K (fork() == 0)
392 \h'|21n'\*(+Kfor\*(-K (i = 0; i < iter; i++) \*(+K{\*(-K
393 \h'|31n'read(fd[0], buf, msgsize);
394 \h'|31n'write(fd2[1], buf, msgsize);
395 \h'|21n'\*(+K}\*(-K
396 \h'|11n'\*(+Kelse\*(-K
397 \h'|21n'\*(+Kfor\*(-K (i = 0; i < iter; i++) \*(+K{\*(-K
398 \h'|31n'write(fd[1], buf, msgsize);
399 \h'|31n'read(fd2[0], buf, msgsize);
400 \h'|21n'\*(+K}\*(-K
423 \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
425 \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K nforks, i;
426 \h'|11n'\*(+Kchar\*(-K \fI*\fPcp;
427 \h'|11n'\*(+Kint\*(-K pid, child, status, brksize;
429 \h'|11n'\*(+Kif\*(-K (argc < 2) \*(+K{\*(-K
430 \h'|21n'printf("usage: %s number\*-of\*-forks sbrk\*-size\en", argv[0]);
431 \h'|21n'exit(1);
432 \h'|11n'\*(+K}\*(-K
433 \h'|11n'nforks = atoi(argv[1]);
434 \h'|11n'\*(+Kif\*(-K (nforks < 0) \*(+K{\*(-K
435 \h'|21n'printf("%s: bad number of forks\en", argv[1]);
436 \h'|21n'exit(2);
437 \h'|11n'\*(+K}\*(-K
438 \h'|11n'brksize = atoi(argv[2]);
439 \h'|11n'\*(+Kif\*(-K (brksize < 0) \*(+K{\*(-K
440 \h'|21n'printf("%s: bad size to sbrk\en", argv[2]);
441 \h'|21n'exit(3);
442 \h'|11n'\*(+K}\*(-K
443 \h'|11n'cp = (\*(+Kchar\*(-K \fI*\fP)sbrk(brksize);
444 \h'|11n'\*(+Kif\*(-K ((\*(+Kint\*(-K)cp == \*-1) \*(+K{\*(-K
445 \h'|21n'perror("sbrk");
446 \h'|21n'exit(4);
447 \h'|11n'\*(+K}\*(-K
448 \h'|11n'\*(+Kfor\*(-K (i = 0; i < brksize; i += 1024)
449 \h'|21n'cp[i] = i;
450 \h'|11n'\*(+Kwhile\*(-K (nforks\*-\*- > 0) \*(+K{\*(-K
451 \h'|21n'child = fork();
452 \h'|21n'\*(+Kif\*(-K (child == \*-1) \*(+K{\*(-K
453 \h'|31n'perror("fork");
454 \h'|31n'exit(\*-1);
455 \h'|21n'\*(+K}\*(-K
456 \h'|21n'\*(+Kif\*(-K (child == 0)
457 \h'|31n'\*_exit(\*-1);
458 \h'|21n'\*(+Kwhile\*(-K ((pid = wait(&status)) != \*-1 && pid != child)
459 \h'|31n';
460 \h'|11n'\*(+K}\*(-K
461 \h'|11n'exit(0);
485 \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
487 \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K nexecs, i;
488 \h'|11n'\*(+Kchar\*(-K \fI*\fPcp, \fI*\fPsbrk();
489 \h'|11n'\*(+Kint\*(-K pid, child, status, brksize;
491 \h'|11n'\*(+Kif\*(-K (argc < 3) \*(+K{\*(-K
492 \h'|21n'printf("usage: %s number\*-of\*-execs sbrk\*-size job\*-name\en",
493 \h'|21n' argv[0]);
494 \h'|21n'exit(1);
495 \h'|11n'\*(+K}\*(-K
496 \h'|11n'nexecs = atoi(argv[1]);
497 \h'|11n'\*(+Kif\*(-K (nexecs < 0) \*(+K{\*(-K
498 \h'|21n'printf("%s: bad number of execs\en", argv[1]);
499 \h'|21n'exit(2);
500 \h'|11n'\*(+K}\*(-K
501 \h'|11n'brksize = atoi(argv[2]);
502 \h'|11n'\*(+Kif\*(-K (brksize < 0) \*(+K{\*(-K
503 \h'|21n'printf("%s: bad size to sbrk\en", argv[2]);
504 \h'|21n'exit(3);
505 \h'|11n'\*(+K}\*(-K
506 \h'|11n'cp = sbrk(brksize);
507 \h'|11n'\*(+Kif\*(-K ((\*(+Kint\*(-K)cp == \*-1) \*(+K{\*(-K
508 \h'|21n'perror("sbrk");
509 \h'|21n'exit(4);
510 \h'|11n'\*(+K}\*(-K
511 \h'|11n'\*(+Kfor\*(-K (i = 0; i < brksize; i += 1024)
512 \h'|21n'cp[i] = i;
513 \h'|11n'\*(+Kwhile\*(-K (nexecs\*-\*- > 0) \*(+K{\*(-K
514 \h'|21n'child = fork();
515 \h'|21n'\*(+Kif\*(-K (child == \*-1) \*(+K{\*(-K
516 \h'|31n'perror("fork");
517 \h'|31n'exit(\*-1);
518 \h'|21n'\*(+K}\*(-K
519 \h'|21n'\*(+Kif\*(-K (child == 0) \*(+K{\*(-K
520 \h'|31n'execv(argv[3], argv);
521 \h'|31n'perror("execv");
522 \h'|31n'\*_exit(\*-1);
523 \h'|21n'\*(+K}\*(-K
524 \h'|21n'\*(+Kwhile\*(-K ((pid = wait(&status)) != \*-1 && pid != child)
525 \h'|31n';
526 \h'|11n'\*(+K}\*(-K
527 \h'|11n'exit(0);
546 \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
549 \h'|11n'exit(0);
570 \*(+Kchar\*(-K\h'|11n'space[1024 \fI*\fP 250] = "force into data segment";
574 \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
577 \h'|11n'exit(0);
596 \*(+Kchar\*(-K\h'|11n'\fI*\fPvalloc();
600 \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
602 \h'|11n'\*(+Kregister\*(-K i, niter;
603 \h'|11n'\*(+Kregister\*(-K \*(+Kchar\*(-K \fI*\fPpf, \fI*\fPlastpage;
604 \h'|11n'\*(+Kint\*(-K npages = 4096, pagesize, vflag = 0;
605 \h'|11n'\*(+Kchar\*(-K \fI*\fPpages, \fI*\fPname;
607 \h'|11n'name = argv[0];
608 \h'|11n'argc\*-\*-, argv++;
610 \h'|11n'\*(+Kif\*(-K (argc < 1) \*(+K{\*(-K
612 \h'|21n'printf("usage: %s [ \*-v ] [ \*-p #pages ] niter\en", name);
613 \h'|21n'exit(1);
614 \h'|11n'\*(+K}\*(-K
615 \h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-p") == 0) \*(+K{\*(-K
616 \h'|21n'argc\*-\*-, argv++;
617 \h'|21n'\*(+Kif\*(-K (argc < 1)
618 \h'|31n'\*(+Kgoto\*(-K usage;
619 \h'|21n'npages = atoi(\fI*\fPargv);
620 \h'|21n'\*(+Kif\*(-K (npages <= 0) \*(+K{\*(-K
621 \h'|31n'printf("%s: Bad page count\&.\en", \fI*\fPargv);
622 \h'|31n'exit(2);
623 \h'|21n'\*(+K}\*(-K
624 \h'|21n'argc\*-\*-, argv++;
625 \h'|21n'\*(+Kgoto\*(-K again;
626 \h'|11n'\*(+K}\*(-K
627 \h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-v") == 0) \*(+K{\*(-K
628 \h'|21n'argc\*-\*-, argv++;
629 \h'|21n'vflag++;
630 \h'|21n'\*(+Kgoto\*(-K again;
631 \h'|11n'\*(+K}\*(-K
632 \h'|11n'niter = atoi(\fI*\fPargv);
633 \h'|11n'pagesize = getpagesize();
634 \h'|11n'pages = valloc(npages \fI*\fP pagesize);
635 \h'|11n'\*(+Kif\*(-K (pages == (\*(+Kchar\*(-K \fI*\fP)0) \*(+K{\*(-K
636 \h'|21n'printf("Can\'t allocate %d pages (%2\&.1f megabytes)\&.\en",
637 \h'|21n' npages, (npages \fI*\fP pagesize) \fI\h'\w' 'u-\w'/'u'/\fP (1024\&. \fI*\fP 1024\&.));
638 \h'|21n'exit(3);
639 \h'|11n'\*(+K}\*(-K
640 \h'|11n'lastpage = pages + (npages \fI*\fP pagesize);
641 \h'|11n'\*(+Kif\*(-K (vflag)
642 \h'|21n'vadvise(VA\*_SEQL);
643 \h'|11n'\*(+Kfor\*(-K (i = 0; i < niter; i++)
644 \h'|21n'\*(+Kfor\*(-K (pf = pages; pf < lastpage; pf += pagesize)
645 \h'|31n'\fI*\fPpf = 1;
663 \*(+Kchar\*(-K\h'|11n'\fI*\fPvalloc();
664 \*(+Kint\*(-K\h'|11n'rand();
668 \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
670 \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K npages = 4096, pagesize, pn, i, niter;
671 \h'|11n'\*(+Kint\*(-K vflag = 0, debug = 0;
672 \h'|11n'\*(+Kchar\*(-K \fI*\fPpages, \fI*\fPname;
674 \h'|11n'name = argv[0];
675 \h'|11n'argc\*-\*-, argv++;
677 \h'|11n'\*(+Kif\*(-K (argc < 1) \*(+K{\*(-K
679 \h'|21n'printf("usage: %s [ \*-d ] [ \*-v ] [ \*-p #pages ] niter\en", name);
680 \h'|21n'exit(1);
681 \h'|11n'\*(+K}\*(-K
682 \h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-p") == 0) \*(+K{\*(-K
683 \h'|21n'argc\*-\*-, argv++;
684 \h'|21n'\*(+Kif\*(-K (argc < 1)
685 \h'|31n'\*(+Kgoto\*(-K usage;
686 \h'|21n'npages = atoi(\fI*\fPargv);
687 \h'|21n'\*(+Kif\*(-K (npages <= 0) \*(+K{\*(-K
688 \h'|31n'printf("%s: Bad page count\&.\en", \fI*\fPargv);
689 \h'|31n'exit(2);
690 \h'|21n'\*(+K}\*(-K
691 \h'|21n'argc\*-\*-, argv++;
692 \h'|21n'\*(+Kgoto\*(-K again;
693 \h'|11n'\*(+K}\*(-K
694 \h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-v") == 0) \*(+K{\*(-K
695 \h'|21n'argc\*-\*-, argv++;
696 \h'|21n'vflag++;
697 \h'|21n'\*(+Kgoto\*(-K again;
698 \h'|11n'\*(+K}\*(-K
699 \h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-d") == 0) \*(+K{\*(-K
700 \h'|21n'argc\*-\*-, argv++;
701 \h'|21n'debug++;
702 \h'|21n'\*(+Kgoto\*(-K again;
703 \h'|11n'\*(+K}\*(-K
704 \h'|11n'niter = atoi(\fI*\fPargv);
705 \h'|11n'pagesize = getpagesize();
706 \h'|11n'pages = valloc(npages \fI*\fP pagesize);
707 \h'|11n'\*(+Kif\*(-K (pages == (\*(+Kchar\*(-K \fI*\fP)0) \*(+K{\*(-K
708 \h'|21n'printf("Can\'t allocate %d pages (%2\&.1f megabytes)\&.\en",
709 \h'|21n' npages, (npages \fI*\fP pagesize) \fI\h'\w' 'u-\w'/'u'/\fP (1024\&. \fI*\fP 1024\&.));
710 \h'|21n'exit(3);
711 \h'|11n'\*(+K}\*(-K
712 \h'|11n'\*(+Kif\*(-K (vflag)
713 \h'|21n'vadvise(VA\*_ANOM);
714 \h'|11n'\*(+Kfor\*(-K (i = 0; i < niter; i++) \*(+K{\*(-K
715 \h'|21n'pn = random() % npages;
716 \h'|21n'\*(+Kif\*(-K (debug)
717 \h'|31n'printf("touch page %d\en", pn);
718 \h'|21n'pages[pagesize \fI*\fP pn] = 1;
719 \h'|11n'\*(+K}\*(-K
741 \*(+Kfloat\*(-K\h'|11n'sqrt(), log(), rnd(), cos(), gauss();
742 \*(+Kchar\*(-K\h'|11n'\fI*\fPvalloc();
743 \*(+Kint\*(-K\h'|11n'rand();
747 \h'|11n'\*(+Kchar\*(-K \fI*\fPargv[];
749 \h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K pn, i, niter, delta;
750 \h'|11n'\*(+Kregister\*(-K \*(+Kchar\*(-K \fI*\fPpages;
751 \h'|11n'\*(+Kfloat\*(-K sd = 10\&.0;
752 \h'|11n'\*(+Kint\*(-K npages = 4096, pagesize, debug = 0;
753 \h'|11n'\*(+Kchar\*(-K \fI*\fPname;
755 \h'|11n'name = argv[0];
756 \h'|11n'argc\*-\*-, argv++;
758 \h'|11n'\*(+Kif\*(-K (argc < 1) \*(+K{\*(-K
760 \h'|21n'printf(
762 \h'|21n'exit(1);
763 \h'|11n'\*(+K}\*(-K
764 \h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-s") == 0) \*(+K{\*(-K
765 \h'|21n'argc\*-\*-, argv++;
766 \h'|21n'\*(+Kif\*(-K (argc < 1)
767 \h'|31n'\*(+Kgoto\*(-K usage;
768 \h'|21n'sscanf(\fI*\fPargv, "%f", &sd);
769 \h'|21n'\*(+Kif\*(-K (sd <= 0) \*(+K{\*(-K
770 \h'|31n'printf("%s: Bad standard deviation\&.\en", \fI*\fPargv);
771 \h'|31n'exit(2);
772 \h'|21n'\*(+K}\*(-K
773 \h'|21n'argc\*-\*-, argv++;
774 \h'|21n'\*(+Kgoto\*(-K again;
775 \h'|11n'\*(+K}\*(-K
776 \h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-p") == 0) \*(+K{\*(-K
777 \h'|21n'argc\*-\*-, argv++;
778 \h'|21n'\*(+Kif\*(-K (argc < 1)
779 \h'|31n'\*(+Kgoto\*(-K usage;
780 \h'|21n'npages = atoi(\fI*\fPargv);
781 \h'|21n'\*(+Kif\*(-K (npages <= 0) \*(+K{\*(-K
782 \h'|31n'printf("%s: Bad page count\&.\en", \fI*\fPargv);
783 \h'|31n'exit(2);
784 \h'|21n'\*(+K}\*(-K
785 \h'|21n'argc\*-\*-, argv++;
786 \h'|21n'\*(+Kgoto\*(-K again;
787 \h'|11n'\*(+K}\*(-K
788 \h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-d") == 0) \*(+K{\*(-K
789 \h'|21n'argc\*-\*-, argv++;
790 \h'|21n'debug++;
791 \h'|21n'\*(+Kgoto\*(-K again;
792 \h'|11n'\*(+K}\*(-K
793 \h'|11n'niter = atoi(\fI*\fPargv);
794 \h'|11n'pagesize = getpagesize();
795 \h'|11n'pages = valloc(npages\fI*\fPpagesize);
796 \h'|11n'\*(+Kif\*(-K (pages == (\*(+Kchar\*(-K \fI*\fP)0) \*(+K{\*(-K
797 \h'|21n'printf("Can\'t allocate %d pages (%2\&.1f megabytes)\&.\en",
798 \h'|21n' npages, (npages\fI*\fPpagesize) \fI\h'\w' 'u-\w'/'u'/\fP (1024\&. \fI*\fP 1024\&.));
799 \h'|21n'exit(3);
800 \h'|11n'\*(+K}\*(-K
801 \h'|11n'pn = 0;
802 \h'|11n'\*(+Kfor\*(-K (i = 0; i < niter; i++) \*(+K{\*(-K
803 \h'|21n'delta = gauss(sd, 0\&.0);
804 \h'|21n'\*(+Kwhile\*(-K (pn + delta < 0 || pn + delta > npages)
805 \h'|31n'delta = gauss(sd, 0\&.0);
806 \h'|21n'pn += delta;
807 \h'|21n'\*(+Kif\*(-K (debug)
808 \h'|31n'printf("touch page %d\en", pn);
809 \h'|21n'\*(+Kelse\*(-K
810 \h'|31n'pages[pn \fI*\fP pagesize] = 1;
811 \h'|11n'\*(+K}\*(-K
819 \h'|11n'\*(+Kfloat\*(-K sd, mean;
821 \h'|11n'\*(+Kregister\*(-K \*(+Kfloat\*(-K qa, qb;
823 \h'|11n'qa = sqrt(log(rnd()) \fI*\fP \*-2\&.0);
824 \h'|11n'qb = 3\&.14159 \fI*\fP rnd();
825 \h'|11n'\*(+Kreturn\*(-K (qa \fI*\fP cos(qb) \fI*\fP sd + mean);
834 \h'|11n'\*(+Kstatic\*(-K \*(+Kint\*(-K seed = 1;
835 \h'|11n'\*(+Kstatic\*(-K \*(+Kint\*(-K biggest = 0x7fffffff;
837 \h'|11n'\*(+Kreturn\*(-K ((\*(+Kfloat\*(-K)rand(seed) \fI\h'\w' 'u-\w'/'u'/\fP (\*(+Kfloat\*(-K)big…
865 \f2\s12\h'\\n(.lu-\w'\\*(=f'u'\\*(=f\fP\s0\h'|0u'
878 'if \\n(cm=1 'ft 2
901 \f2\s14\h'\\n(.lu-\w'\\$1'u'\\$1\fP\s0\h'|0u'\c
1015 setenv n 012345678901234567890123456789012345678901234567890123456780123456789