Fix taskstats for libnl
taskstats doesn't work, probably caused by when I switched it from
using system/core/libnl_2 to external/libnl. Fix a few bugs that
libnl_2 didn't care about:
- callbacks must be registered with NL_CB_CUSTOM
- nla_next is not guaranteed to work if !nla_ok, use nla_for_each_attr
which does the right thing
- instead of fixing get_family_id, use genl_ctrl_resolve
- instead of manually setting pid, seq, and flags, use
nl_send_auto_complete
- since there is now only one command sent, get rid of send_command
and take advantage of the known parameter type to use nla_put_u32
- libnl does not set errno, return nl error codes and use nl_perror
instead of perror
Change-Id: Ic631c8c1d9cc6ed288cbbeb6fe40c45ca5fe9143
1 file changed