home *** CD-ROM | disk | FTP | other *** search
/ ftp.ncftp.com / ftp.ncftp.com.zip / ftp.ncftp.com / ncftp / older_versions / ncftp-3.2.2-src.tar.bz2 / ncftp-3.2.2-src.tar / ncftp-3.2.2 / sio / USendtoByName.c < prev    next >
C/C++ Source or Header  |  2003-08-31  |  510b  |  22 lines

  1. #include "syshdrs.h"
  2. #ifdef PRAGMA_HDRSTOP
  3. #    pragma hdrstop
  4. #endif
  5.  
  6. int
  7. USendtoByName(int sfd, const char *const buf, size_t size, int fl, const char *const toAddrStr, int tlen)
  8. {
  9.     struct sockaddr_un toAddr;
  10.     int ualen;
  11.     int result;
  12.     
  13.     if ((toAddrStr == NULL) || (toAddrStr[0] == '\0') || (size == 0) || (buf == NULL)) {
  14.         errno = EINVAL;
  15.         return (-1);
  16.     }
  17.  
  18.     ualen = (int) MakeSockAddrUn(&toAddr, toAddrStr);
  19.     result = USendto(sfd, buf, size, fl, &toAddr, ualen, tlen);
  20.     return (result);
  21. }    /* USendtoByName */
  22.