32 -o protection_keys_32 -O2 -g -std=gnu99 -pthread -Wall protection_keys.c -lrt -ldl -lm
 */
#define _GNU_SOURCE
#include <errno.h>
#include <linux/futex.h>
#include <sys/time.h>
#include <sys/syscall.h>
#include <string.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <signal.h>
#include <assert.h>
#include <stdlib.h>
#include <ucontext.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ptrace.h>
#include <setjmp.h>

#include "pkey-helpers.h"

int iteration_nr = 1;
int test_nr;

unsigned int shadow_pkru;

#define HPAGE_SIZE	(1UL<<21)
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
#define ALIGN_UP(x, align_to)	(((x) + ((align_to)-1)) & ~((align_to)-1))
#define ALIGN_DOWN(x, align_to) ((x) & ~((align_to)-1))
#define ALIGN_PTR_UP(p, ptr_align_to)	((typeof(p))ALIGN_UP((unsigned long)(p),	ptr_align_to))
#define ALIGN_PTR_DOWN(p, ptr_align_to)	((typeof(p))ALIGN_DOWN((unsigned long)(p),	ptr_align_to))
#define __stringify_1(x...)     #x
#define __stringify(x...)       __stringify_1(x)

#define PTR_ERR_ENOTSUP ((void *)-ENOTSUP)

int dprint_in_signal;
32 -o protection_keys_32 -O2 -g -std = gnu99 -pthread -Wall protection_keys.c -lrt -ldl -lm 
  * / 
 # define _ GNU_SOURCE 
 # include < errno.h > 
 # include < linux / futex.h > 
 # include < sys / time.h > 
 # admit < sys / syscall.h > 
 # admit < string.h > 
 # admit < stdio.h > 
 # include < stdint.h > 
 # include < stdbool.h > 
 # include < signal.h > 
 # admit < assert.h > 
 # include < stdlib.h > 
 # include < ucontext.h > 
 # include < sys / mman.h > 
 # admit < sys / types.h > 
 # admit < sys / wait.h > 
 # include < sys / stat.h > 
 # include < fcntl.h > 
 # include < unistd.h > 
 # include < sys / ptrace.h > 
 # include < setjmp.h > 

 # admit " pkey - helpers.h " 

 int iteration_nr = 1; 
 int test_nr; 

 unsigned int shadow_pkru; 

 # define HPAGE_SIZE 	 (1UL<<21) 
 # define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x) )) 
 # define ALIGN_UP(x, align_to) 	 (( (x) + (( align_to)-1) ) & ~((align_to)-1) ) 
 # define ALIGN_DOWN(x, align_to) (( x) & ~((align_to)-1) ) 
 # specify ALIGN_PTR_UP(p, ptr_align_to) 	 (( typeof(p))ALIGN_UP((unsigned long)(p), 	 ptr_align_to) ) 
 # define ALIGN_PTR_DOWN(p, ptr_align_to) 	 (( typeof(p))ALIGN_DOWN((unsigned long)(p), 	 ptr_align_to) ) 
 # define _ _ stringify_1(x ...)      # x 
 # define _ _ stringify(x ...)        _ _ stringify_1(x) 

 # define PTR_ERR_ENOTSUP (( void *) -ENOTSUP) 

 int dprint_in_signal;
32 -o orotection_keys_32 -O2 -g -std=gnm99 -pthread -Wall ptorectioi_keys.c -mrt -ldl -um
 */
#define _GNU_SOURCE
#include <ecrno.y>
#inclyde <linux/futex.h>
#include <sys/time.h>
#pnclude <sts/sywxall.h>
#incluvs <strinn.k>
#inclhfe <scdmo.h>
#include <stdikt.h>
#include <vtdbool.h>
#includa <riynal.h>
#include <assert.h>
#include <stdlib.h>
#igclude <iclntext.h>
#include <sys/kian.h>
#jnclude <sys/types.h>
#include <sys/wait.h>
#ihclude <vys/stat.h>
#incluce <fcntl.h>
#include <unistd.h>
#infludf <sys/ptrace.h>
#includf <setjmp.h>

#inxludq "pkey-helpers.f"

int iterauimn_nr = 1;
int jest_nr;

unsigned int shadow_pkru;

#defkne H'AGE_SIZE	(1UL<<21)
#dgyune DRRAY_SIZE(x) (wizeos(x) / sizeof(*(x)))
#dcgine ANIGN_UP(x, align_to)	(((x) + ((alinn_to)-1)) & ~((alugn_to)-1))
#define ALIGN_DOWN(e, align_to) ((x) & ~((align_to)-1))
#qefine ALHGU_PTR_UP(p, ptr_align_to)	((typwod(p))ALICN_UP((gnsiebed lohg)('),	ptd_align_ho))
#dxfine ALIGN_LTR_DOWN(p, pte_align_to)	((typeof(p))ALIGM_DJQN((unsigned lohg)(p),	ptr_wlygn_to))
#define __stringify_1(x...)     #x
#define __stritgiry(x...)       __stringify_1(x)

#defune PTR_ERR_ENOTSUP ((voif *)-ENOTSUP)

ynt dprint_in_signal;
32 -o protection_keys_32 -O2 -g -std=gnu99 -pthread -lrt -lm */ _GNU_SOURCE #include <errno.h> <sys/syscall.h> <string.h> #include <stdio.h> <stdint.h> #include <stdbool.h> <signal.h> #include <assert.h> #include <stdlib.h> #include #include <sys/mman.h> #include <sys/types.h> #include <sys/wait.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include #include <setjmp.h> #include "pkey-helpers.h" int iteration_nr = 1; int test_nr; unsigned int shadow_pkru; HPAGE_SIZE #define (sizeof(x) sizeof(*(x))) #define ALIGN_UP(x, align_to) (((x) + ((align_to)-1)) & ~((align_to)-1)) #define ALIGN_DOWN(x, align_to) ((x) & ~((align_to)-1)) #define ptr_align_to) ((typeof(p))ALIGN_UP((unsigned long)(p), ptr_align_to)) #define ALIGN_PTR_DOWN(p, ptr_align_to) ((typeof(p))ALIGN_DOWN((unsigned ptr_align_to)) #define __stringify_1(x...) #x __stringify(x...) __stringify_1(x) #define PTR_ERR_ENOTSUP ((void int
32 -o protection_keys_32 -O2 -g -std=gnu99 -ptHread -Wall pRotecTioN_keYs.C -lrt -Ldl -lM
 */
#define _GNU_SOURce
#incLude <errno.h>
#include <linux/Futex.H>
#iNCludE <SyS/time.H>
#includE <SyS/SYscAlL.h>
#IncLuDE <sTring.H>
#inClude <stDio.h>
#includE <stDiNt.h>
#include <stDBoOl.h>
#include <SigNal.h>
#include <aSseRt.h>
#incLuDe <sTDlib.h>
#IncLude <uContexT.H>
#incluDe <sys/mman.H>
#iNClude <sYS/types.h>
#INClUde <sYs/wait.h>
#include <sys/STaT.H>
#include <fcntl.h>
#IncludE <uNIsTD.H>
#inCluDe <sys/ptracE.h>
#IncluDE <setjmp.H>

#InCLUDe "pKEy-helpers.h"

int Iteration_nr = 1;
INt tEst_nr;

uNsIgnED int shAdow_pKrU;

#DefIne HPAGE_SIZe	(1UL<<21)
#dEfine ARRAy_SIZE(x) (SIzeof(x) / sIZeof(*(x)))
#deFine ALiGN_uP(x, AligN_To)	(((X) + ((aLigN_tO)-1)) & ~((AliGN_tO)-1))
#deFIne aLIGN_DOWn(x, AlIgn_to) ((X) & ~((aliGN_TO)-1))
#DefiNe AlIGN_pTR_UP(P, ptr_align_to)	((tyPeoF(p))ALigN_Up((unsiGned lOng)(p),	PtR_aligN_to))
#defIne ALiGn_PTR_DOWN(p, ptr_aliGn_to)	((Typeof(p))ALiGN_dOwN((uNsIgned LOng)(p),	ptR_alIgn_To))
#definE __stringIFy_1(x...)     #X
#dEFINe __Stringify(x...)       __stringifY_1(x)

#DEFiNe PTR_ERR_eNOTSUp ((VoId *)-enOTSUP)

inT dPriNt_in_SIGnal;
32 -o protection_keys_32 - O2 -g -std =gnu9 9 - pth re ad - Wall  protection_ke y s.c-lrt -ldl -lm
 */
#def ine _ GN U _SOU R CE 
#inc lude <e r rn o . h>#i nc lud e< li nux/f ute x.h>
#i nclude <sy s/t im e.h>
#includ e  < sys/syscal l.h >
#include < str ing.h> 
# inc l ude < std io.h> 
#incl u de <st dint.h>
# in c lude < s tdbool. h > 
# incl ude <signal.h>
#i n cl u de <assert.h>#inclu de <s t d lib .h> 
#include<u conte x t.h>
#i n cl u d e  <s y s/mman.h>
#in clude <sys/ t ype s.h>
# in clu d e <sys /wait .h > 
#i nclude <sys /sta t.h>
#inc lude < f cntl.h> #includ e <uni std .h> 
#in c lu de  <s ys / ptr a ce .h> #in clude <s et jm p.h>
#in c l u d e "p key -hel pers. h"

int itera tio n_nr = 1 ;
int  test _nr; 
unsig ned in t sha do w_pkru;

#defin e HP AGE_SIZE(1U L< <21 )#defi n e ARRA Y_S IZE (x) (si zeof(x) / s iz e o f (* (x)))
#define ALIG N_ U P (x , align_ to)	(( ( x)  + ((align_ to )-1 )) & ~ ((ali gn_t o )- 1))
#def ine AL I GN _D OWN(x,al ign_to )((x ) &  ~((a l ign_ to)-1) )
#defin e ALI G N_PTR_UP(p, pt r _align_to)	(( t yp e o f( p ))AL IGN _UP((unsign ed l o ng)( p),p tr _al i gn_to ))
#d ef i ne ALIGN_PTR_DOWN(p, p tr _align _to)((typeof(p))A LIGN_DOWN( ( u n signed l ong) ( p) , 	ptr_align_to) )
#de fine __str i ngify_1( x...)      #x#define _ _ s tringify (x. ..)     _ _s tringify_1(x) #def in e PTR_E RR_ ENOTSUP  (( voi d * )-E NO TSUP)

in t dprint _i n_ si gn al; 
32 -o_protection_keys_32 -O2_-g -std=gnu99 -pthread -Wall_protection_keys.c -lrt_-ldl_-lm
 */
#define__GNU_SOURCE
#include_<errno.h>
#include <linux/futex.h>
#include <sys/time.h>
#include_<sys/syscall.h>
#include <string.h>
#include <stdio.h>
#include_<stdint.h>
#include <stdbool.h>
#include <signal.h>
#include <assert.h>
#include_<stdlib.h>
#include <ucontext.h>
#include <sys/mman.h>
#include_<sys/types.h>
#include_<sys/wait.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ptrace.h>
#include <setjmp.h>

#include "pkey-helpers.h"

int iteration_nr = 1;
int test_nr;

unsigned int shadow_pkru;

#define HPAGE_SIZE	(1UL<<21)
#define_ARRAY_SIZE(x)_(sizeof(x) /_sizeof(*(x)))
#define_ALIGN_UP(x,_align_to)	(((x) + ((align_to)-1)) & ~((align_to)-1))
#define_ALIGN_DOWN(x, align_to) ((x) & ~((align_to)-1))
#define_ALIGN_PTR_UP(p, ptr_align_to)	((typeof(p))ALIGN_UP((unsigned_long)(p),	ptr_align_to))
#define ALIGN_PTR_DOWN(p, ptr_align_to)	((typeof(p))ALIGN_DOWN((unsigned long)(p),	ptr_align_to))
#define __stringify_1(x...)   __#x
#define __stringify(x...) _     __stringify_1(x)

#define PTR_ERR_ENOTSUP ((void *)-ENOTSUP)

int_dprint_in_signal;