We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea5f95c commit 6e37326Copy full SHA for 6e37326
tools/testing/selftests/vm/protection_keys.c
@@ -25,6 +25,7 @@
25
#define __SANE_USERSPACE_TYPES__
26
#include <errno.h>
27
#include <linux/futex.h>
28
+#include <time.h>
29
#include <sys/time.h>
30
#include <sys/syscall.h>
31
#include <string.h>
@@ -546,10 +547,10 @@ int alloc_random_pkey(void)
546
547
int nr_alloced = 0;
548
int random_index;
549
memset(alloced_pkeys, 0, sizeof(alloced_pkeys));
550
+ srand((unsigned int)time(NULL));
551
552
/* allocate every possible key and make a note of which ones we got */
553
max_nr_pkey_allocs = NR_PKEYS;
- max_nr_pkey_allocs = 1;
554
for (i = 0; i < max_nr_pkey_allocs; i++) {
555
int new_pkey = alloc_pkey();
556
if (new_pkey < 0)
0 commit comments