2
* Copyright (C) 2016 Canonical, Ltd.
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of version 2 of the GNU General Public
6
* License published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, contact Canonical Ltd.
22
int check_at_secure(unsigned long expected)
24
unsigned long at_secure;
27
at_secure = getauxval(AT_SECURE);
28
if (at_secure == 0 && errno != 0) {
29
perror("FAIL - getauxval");
33
if (at_secure != expected) {
35
"FAIL - AT_SECURE value (%lu) did not match the expected value (%lu)\n",
44
int main(int argc, char **argv)
46
unsigned long expected;
49
fprintf(stderr, "usage: %s EXPECTED_AT_SECURE\n", argv[0]);
53
expected = strtoul(argv[1], NULL, 10);
54
return check_at_secure(expected);