ltp: update to latest
[openadk.git] / package / ltp / patches / patch-testcases_kernel_syscalls_pkeys_pkey_h
blob219cd36998a0b8206355fddeaa84e53820afc792
1 --- ltp-full-20190930.orig/testcases/kernel/syscalls/pkeys/pkey.h       2019-09-30 13:30:26.000000000 +0200
2 +++ ltp-full-20190930/testcases/kernel/syscalls/pkeys/pkey.h    2019-10-29 15:02:09.524423510 +0100
3 @@ -1,6 +1,7 @@
4  // SPDX-License-Identifier: GPL-2.0-or-later
5  /*
6   * Copyright (c) 2019 Red Hat, Inc.
7 + * Copyright (c) Linux Test Project, 2019
8   */
9  
10  #ifndef PKEYS_H
11 @@ -15,25 +16,29 @@
12  #endif
14  #ifndef HAVE_PKEY_MPROTECT
15 -static inline int pkey_mprotect(void *addr, size_t len, int prot, int pkey)
16 +inline int ltp_pkey_mprotect(void *addr, size_t len, int prot, int pkey)
17  {
18         return tst_syscall(__NR_pkey_mprotect, addr, len, prot, pkey);
19  }
21 -static inline int pkey_alloc(unsigned int flags, unsigned int access_rights)
22 +inline int ltp_pkey_alloc(unsigned int flags, unsigned int access_rights)
23  {
24         return tst_syscall(__NR_pkey_alloc, flags, access_rights);
25  }
27 -static inline int pkey_free(int pkey)
28 +inline int ltp_pkey_free(int pkey)
29  {
30         return tst_syscall(__NR_pkey_free, pkey);
31  }
32 +#else
33 +#define ltp_pkey_alloc pkey_alloc
34 +#define ltp_pkey_free pkey_free
35 +#define ltp_pkey_mprotect pkey_mprotect
36  #endif /* HAVE_PKEY_MPROTECT */
38  static inline void check_pkey_support(void)
39  {
40 -       int pkey = pkey_alloc(0, 0);
41 +       int pkey = ltp_pkey_alloc(0, 0);
43         if (pkey == -1) {
44                 if (errno == ENOSYS)
45 @@ -44,7 +49,7 @@ static inline void check_pkey_support(vo
46                         tst_brk(TCONF, "pkeys are not available for test");
47         }
49 -       pkey_free(pkey);
50 +       ltp_pkey_free(pkey);
51  }
53  #endif /* PKEYS_H */