Support X_TRUNCATE operation and various fixes

Support X_TRUNCATE operation.

Fix bug in return value.

Fix buffer overflow in posixfd_init_signal_desc.