Fix mistakes in link(2) and shm_open(2)
PR: 258957
(cherry picked from commit 8d3cd7767a2ea1816c31e1dbe7957253e723e559)