gen_fun::read: read gen_fun from file descriptor