Solved

C under UNIX

Posted on 1999-01-19
2
165 Views
Last Modified: 2010-03-18
In C, a the function connect() returns a non-zero integer on success and a negative integer on error, placed inside errno! I want to know how to view the error returned as a string using the system function strerror() or its equivalent!!
0
Comment
Question by:boosta
2 Comments
 
LVL 10

Accepted Solution

by:
rbr earned 50 total points
ID: 1588146
if (connect(sockfd,pserv_addr,addrlen ) < 0)
      printf ("Error: %s",strerror (errno));

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1588147
or simply:
perror("prefix to message" );
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Embeded Linux on Router 9 109
Error when calling SSH command 20 115
OpenWrt 1 47
Creating an alias to a directory so I can change the directory 'contents' by changing the alias 5 90
I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question