-
Notifications
You must be signed in to change notification settings - Fork 4
PortingNotes
- summary Information about how to port new changes
- labels Porting
There are a number of differences between OSX and OpenSolaris that make porting more of a challenge than in other environments (including FreeBSD).
Mac OSX defines a `vnode_t` to be a pointer to a `struct vnode *`; but in OpenSolaris, a `vnode_t` is a pointer to a `struct vnode`. This was previously handled by Issue 27 and a set of `#ifdef` around the types - but this grows to be a porting problem generally.
To solve this problem, `zfs_context.h` defines a `#def` to replace `vnode_t` on the fly with `struct vnode`. That way, we're source compatible at the point of use. However, this then breaks Mac OSX libraries like `ubc.h` and `mount.h` which (understandably) need to use the right type.
This means we need to (conditionally) replace any system headers, including:
|| *Original code* || *Replacement* || || `#include <sys/mount.h></sys/mount.h>` || `#include <maczfs/maczfs_mount.h></maczfs/maczfs_mount.h>` || || `#include <sys/file.h></sys/file.h>` || `#include <maczfs/maczfs_mount.h></maczfs/maczfs_mount.h>` || || `#include <sys/ubc.h></sys/ubc.h>` || `#include <maczfs/maczfs_mount.h></maczfs/maczfs_mount.h>` || || `#include <libc.h`></libc.h`>follows: