-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshow_secbits.c
30 lines (24 loc) · 1.05 KB
/
show_secbits.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*************************************************************************\
* Copyright (C) Michael Kerrisk, 2024. *
* *
* This program is free software. You may use, modify, and redistribute it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation, either version 3 or (at your option) any *
* later version. This program is distributed without any warranty. See *
* the file COPYING.gpl-v3 for details. *
\*************************************************************************/
/* Supplementary program for Chapter 39 */
#include <sys/prctl.h>
#include "cap_functions.h"
#include "tlpi_hdr.h"
int
main(int argc, char *argv[])
{
int secbits = prctl(PR_GET_SECUREBITS, 0, 0, 0, 0);
if (secbits == -1)
errExit("prctl");
printf("secbits = 0x%x => ", secbits);
printSecbits(secbits, argc == 1, stdout);
printf("\n");
exit(EXIT_SUCCESS);
}