New untested code

added error messages in freebsd-ioctl.c
fixed powermgmt.c under freebsd.