45

Can someone please give me a document to describe the kernel source folders about their structure, functionality and how they are organized?

Specifically, what's the use of of the folder include/uapi/**?

Thanks.

1 Answer 1

60

The uapi folder is supposed to contain the user space API of the kernel. Then upon kernel installation, the uapi include files become the top level /usr/include/linux/ files. (I'm not entirely clear on what exceptions remain.)

The other headers in theory are then private to the kernel. This allow clean separation of the user-visible and kernel-only structures which previously were intermingled in a single header file.

The best discussion I have seen of this is located at a Linux Weekly News article that predates the patch landing.

The UAPI patch itself landed with kernel 3.7. Linus's quick and dirty summary is:

  • the "uapi" include file cleanups. The idea is that the stuff exported to user space should now be found under include/uapi and arch/$(ARCH)/include/uapi.

    Let's hope it actually works. Because otherwise this was just a totally pointless pain in the *ss. And regardless, I'm definitely done with these kinds of "let's do massive cleanup of the include files" forever.

1
  • Great pointers! Though the summary is not that dirty in my view of Linus ;-p Oct 12, 2022 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.