The following guidelines apply to libraries which are meant to be used extensively, e.g. in an upper layer of the Fuchsia codebase or via an SDK, where “upper layer of the Fuchsia codebase” means “garnet” and above (peridot, topaz, vendor/foo).
There are three categories of headers: system, fuchsia, other.
These headers describe kernel interfaces (syscalls, related structs and defines), shared definitions and data structures between kernel and userspace (and bootloader), that are often useful to higher layers as well.
These are libraries that define a low level ABI/API in Fuchsia but are not specific to the kernel.
Some libraries in that space are not necessarily Fuchsia-specific, or they may be Fuchsia-specific but do not fall into either of the above categories. We use a rather bland namespace that will likely not cause any collisions in the outside world: “lib”.
lib/. Subdirectories (
lib/foo/) are mandatory.