userfaultfd.2: Use a better type (uint64_t) for 'len' in EXAMPLES

See the previous commit to bswap.3...

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2020-09-11 14:19:24 +02:00
parent 581c3ea730
commit 68041421a1
1 changed files with 2 additions and 2 deletions

View File

@ -683,7 +683,7 @@ main(int argc, char *argv[])
{
long uffd; /* userfaultfd file descriptor */
char *addr; /* Start of region handled by userfaultfd */
unsigned long len; /* Length of region handled by userfaultfd */
uint64_t len; /* Length of region handled by userfaultfd */
pthread_t thr; /* ID of thread that handles page faults */
struct uffdio_api uffdio_api;
struct uffdio_register uffdio_register;
@ -695,7 +695,7 @@ main(int argc, char *argv[])
}
page_size = sysconf(_SC_PAGE_SIZE);
len = strtoul(argv[1], NULL, 0) * page_size;
len = strtoull(argv[1], NULL, 0) * page_size;
/* Create and enable userfaultfd object */