The second approach is to implement a kernel-level library supported directly by the operating system.
In this case, code and data structures for the library exist in kernel space. Invoking a function in the API for the library typically results in a system call to the kernel.