home *** CD-ROM | disk | FTP | other *** search
/ ftp.ncftp.com / ftp.ncftp.com.zip / ftp.ncftp.com / libncftp / libncftp-3.2.5-src.zip / libncftp-3.2.5 / sio / UConnectByName.c < prev    next >
C/C++ Source or Header  |  2009-11-30  |  477b  |  26 lines

  1. #include "syshdrs.h"
  2. #ifdef PRAGMA_HDRSTOP
  3. #    pragma hdrstop
  4. #endif
  5.  
  6. #ifdef HAVE_SYS_UN_H
  7.  
  8. int
  9. UConnectByName(int sfd, const char * const addrStr, const int tlen)
  10. {
  11.     int result;
  12.     struct sockaddr_un remoteAddr;
  13.     int ualen;
  14.     
  15.     if ((addrStr == NULL) || (addrStr[0] == '\0')) {
  16.         errno = EINVAL;
  17.         return (-1);
  18.     }
  19.  
  20.     ualen = MakeSockAddrUn(&remoteAddr, addrStr);
  21.     result = UConnect(sfd, &remoteAddr, ualen, tlen);
  22.     return (result);
  23. }    /* UConnectByName */
  24.  
  25. #endif    /* HAVE_SYS_UN_H */
  26.