home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume23 / crack / part01 / Sources / crack-port.c next >
Encoding:
C/C++ Source or Header  |  1991-09-22  |  708 b   |  30 lines

  1. #include "crack.h"
  2.  
  3. /*
  4.  * This program is copyright (c) Alec Muffett 1991 except for certain
  5.  * portions of code ("crack-fcrypt.c") copyright (c) Robert Baldwin, Icarus
  6.  * Sparry and Alec Muffett.  The author(s) disclaims all responsibility or
  7.  * liability with respect to it's usage or its effect upon hardware or
  8.  * computer systems.  This software is in freely redistributable PROVIDED
  9.  * that this notice remains intact.
  10.  */
  11.  
  12. #ifdef CRACK_UNAME
  13.  
  14. #include <sys/utsname.h>
  15.  
  16. int
  17. gethostname (name, namelen)
  18.     char *name;
  19.     int namelen;
  20. {
  21.     struct utsname uts;
  22.     if (uname (&uts))
  23.     {
  24.     return (-1);
  25.     }
  26.     strncpy (name, uts.nodename, namelen - 1);
  27.     return (0);
  28. }
  29. #endif                /* CRACK_UNAME */
  30.