File: tsc.t

package info (click to toggle)
liblinux-prctl-perl 1.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 368 kB
  • ctags: 768
  • sloc: perl: 166; ansic: 19; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 458 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use strict;
no strict 'subs';
use warnings;

use Test::More tests => 4;
use POSIX qw(uname);
use Linux::Prctl qw(:constants :functions);

my $arch = uname;

SKIP: {
    skip "get_tsc/set_tsc are x86 specific", 4 unless $arch =~ /^i.86$/;
    skip "get_tsc not available", 4 unless Linux::Prctl->can('set_tsc');
    for(TSC_ENABLE, TSC_SIGSEGV) {
        is(set_tsc($_), 0, "Setting tsc to $_");
        is(get_tsc, $_, "Checking whether tsc is $_");
    }
}