summaryrefslogtreecommitdiff
path: root/libc/unistd/getlogin.c
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2006-01-14 00:58:03 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2006-01-14 00:58:03 +0000
commitaf0172162f7c653cad6a11ed1c1a5459bc154465 (patch)
tree70031dad1e7286d58762da7b9e3d3f93d043c278 /libc/unistd/getlogin.c
parentc8609543a9a8bf6559c2931dbbef6b3c41b3fbf2 (diff)
hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed
Diffstat (limited to 'libc/unistd/getlogin.c')
-rw-r--r--libc/unistd/getlogin.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/libc/unistd/getlogin.c b/libc/unistd/getlogin.c
index 0747a49f6..f2ee1d355 100644
--- a/libc/unistd/getlogin.c
+++ b/libc/unistd/getlogin.c
@@ -23,35 +23,40 @@
#include <stdlib.h>
#include <string.h>
+libc_hidden_proto(strcpy)
+libc_hidden_proto(strncpy)
+libc_hidden_proto(getenv)
+
/* uClibc makes it policy to not mess with the utmp file whenever
* possible, since I consider utmp a complete waste of time. Since
* getlogin() should never be used for security purposes, we kindly let
* the user specify whatever they want via the LOGNAME environment
* variable, or we return NULL if getenv() fails to find anything */
-extern char attribute_hidden * __getlogin(void)
+char * getlogin(void)
{
- return (__getenv("LOGNAME"));
+ return (getenv("LOGNAME"));
}
-strong_alias(__getlogin,getlogin)
+libc_hidden_proto(getlogin)
+libc_hidden_def(getlogin)
int getlogin_r(char *name, size_t len)
{
- char * foo = __getenv("LOGNAME");
+ char * foo = getenv("LOGNAME");
if (! foo)
return -1;
- __strncpy(name, foo, len);
+ strncpy(name, foo, len);
name[len-1] = '\0';
return 0;
}
char *cuserid(char *s)
{
- char *name = __getlogin();
+ char *name = getlogin();
if (s) {
- return(__strcpy(s, name ? name : ""));
+ return(strcpy(s, name ? name : ""));
}
return name;
}