internal_attach_dependent
extern int internal_attach_dependent(entity_t *, pgroup_t *);
if (internal_attach_dependent(entity, pg) != 0) {