home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / unix / unixlib_1 / !UnixLib37_src_pwd_c_getlogin < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-09  |  762 b   |  34 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/pwd/c/RCS/getlogin,v $
  4.  * $Date: 1996/10/30 21:59:00 $
  5.  * $Revision: 1.1 $
  6.  * $State: Rel $
  7.  * $Author: unixlib $
  8.  *
  9.  * $Log: getlogin,v $
  10.  * Revision 1.1  1996/10/30 21:59:00  unixlib
  11.  * Initial revision
  12.  *
  13.  * Revision 1.1  1996/04/19 21:26:42  simon
  14.  * Initial revision
  15.  *
  16.  ***************************************************************************/
  17.  
  18. static const char rcs_id[] = "$Id: getlogin,v 1.1 1996/10/30 21:59:00 unixlib Rel $";
  19.  
  20. #include <pwd.h>
  21. #include <unistd.h>
  22.  
  23. /* getlogin() */
  24.  
  25. char *
  26. getlogin (void)
  27. {
  28.   register struct passwd *p;
  29.  
  30.   if (!(p = getpwuid (getuid ())))
  31.     return (0);
  32.   return (p->pw_name);
  33. }
  34.