implement hook for link(2)