I got it fixed. Thanks for all the help.
I\'ve now looked through quite a few articles, forum posts and topics here; however, none have actually fixed my issue. The
You should use strerror to format the error yourself or perror to print the system error matching with the errno.
strerror
perror
man errno may help you
man errno