Add include files to get prototype declarations, and fix bugs found.
[unix-history] / usr / src / lib / libc / gen / getlogin.c
index d92688a..16b116b 100644 (file)
@@ -6,13 +6,15 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getlogin.c 5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)getlogin.c 5.9 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/param.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/param.h>
-#include <stdio.h>
 #include <pwd.h>
 #include <utmp.h>
 #include <pwd.h>
 #include <utmp.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
 
 int    _logname_valid;         /* known to setlogin() */
 
 
 int    _logname_valid;         /* known to setlogin() */
 
@@ -29,8 +31,6 @@ getlogin()
        return (*logname ? logname : (char *)NULL);
 }
 
        return (*logname ? logname : (char *)NULL);
 }
 
-uid_t  geteuid();
-
 char *
 cuserid(s)
        char *s;
 char *
 cuserid(s)
        char *s;