home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / kerberosIV / krb / k_gethostname.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-22  |  956 b   |  35 lines

  1. /*
  2.  * $Source: /usr/src/kerberosIV/krb/RCS/k_gethostname.c,v $
  3.  * $Author: kfall $
  4.  *
  5.  * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
  6.  *
  7.  * For copying and distribution information, please see the file
  8.  * <mit-copyright.h>.
  9.  */
  10.  
  11. #ifndef lint
  12. static char rcsid_k_gethostname_c[] =
  13. "$Header: /usr/src/kerberosIV/krb/RCS/k_gethostname.c,v 4.2 90/06/23 03:10:52 kfall Exp $";
  14. #endif /* lint */
  15.  
  16. #include <mit-copyright.h>
  17.  
  18. /*
  19.  * Return the local host's name in "name", up to "namelen" characters.
  20.  * "name" will be null-terminated if "namelen" is big enough.
  21.  * The return code is 0 on success, -1 on failure.  (The calling
  22.  * interface is identical to gethostname(2).)
  23.  *
  24.  * Currently defined for BSD 4.2 and PC.  The BSD version just calls
  25.  * gethostname(); the PC code was taken from "kinit.c", and may or may
  26.  * not work.
  27.  */
  28.  
  29. k_gethostname(name, namelen)
  30.     char *name;
  31.     int namelen;
  32. {
  33.     return (gethostname(name, namelen));
  34. }
  35.