cloned from tip of barrelfish.org