Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project shows a simple example of using userfaultfd with minor faults on shared memory (UFFD_FEATURE_MINOR_SHMEM). I create two virtual memory ranges that both point to the same physical memory (backed by memfd) and register one of the virtual memory ranges with userfaultfd (UFFDIO_REGISTER_MODE_MINOR). I then access the registered virtual memory range and handle the generated userfaultfd page faults with the UFFDIO_CONTINUE ioctl.

Compile:

g++ main.cc -pthread -o main

Run:

./main

The userfaultfd.h file included in this repository is the userfaultfd UAPI header from Linux v5.16. This is directly included in main.cc rather than <linux/userfaultfd.h>, which makes it easier to compile this project on a kernel that has out-of-date kernel headers.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages