Today I did a massive cleanup of the source code.
As of now, there's a new library called libsolcompat that implements or translates all necessary Solaris-specific functions into glibc functions (yes, FreeBSD will require some work here).
This massive cleanup also means that all #includes will be exactly the same between the original source files and the Linux port! :)
This was achieved by overriding some glibc system headers with a local header, with the help of a gcc-specific preprocessor directive called #include_next. This directive allows one to include the overriden system header, while adding some functionality to it.
You can see a trivial example of this in the libsolcompat string.h, where a Solaris-specific function called strlcpy() was added.
With this new file structure in place, it is now much easier to port new files.
This also means libzfs is almost fully compiling. There are only a few functions left to be ported, which don't seem too difficult. However, getting it to work correctly will still require some work, as there are some differences between a real filesystem and a FUSE filesystem (I don't think mount(2) will work, ioctls must be replaced by UNIX sockets, etc), and between Solaris and Linux, obviously (some /dev/dsk references are still in place, etc).