(root)/
strace-6.5/
tests-mx32/
pkey_free.c
       1  /*
       2   * Check decoding of pkey_free syscall.
       3   *
       4   * Copyright (c) 2016 Eugene Syromyatnikov <evgsyr@gmail.com>
       5   * Copyright (c) 2016-2021 The strace developers.
       6   * All rights reserved.
       7   *
       8   * SPDX-License-Identifier: GPL-2.0-or-later
       9   */
      10  
      11  #include "tests.h"
      12  #include "scno.h"
      13  
      14  #include <stdio.h>
      15  #include <unistd.h>
      16  
      17  int
      18  main(void)
      19  {
      20  	static const kernel_ulong_t keys[] = {
      21  		0,
      22  		3141592653U,
      23  		(kernel_ulong_t) 0xbadc0ded00000000ULL,
      24  		(kernel_ulong_t) 0xffff00001111eeeeULL,
      25  		(kernel_ulong_t) 0x123456789abcdef0ULL,
      26  	};
      27  
      28  	for (unsigned int i = 0; i < ARRAY_SIZE(keys); ++i) {
      29  		long rc = syscall(__NR_pkey_free, keys[i]);
      30  		printf("pkey_free(%d) = %s\n", (int) keys[i], sprintrc(rc));
      31  	}
      32  
      33  	puts("+++ exited with 0 +++");
      34  
      35  	return 0;
      36  }