3 * Copyright (C) 2000-2006 by Erik Andersen <andersen@uclibc.org>
4 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
13 /* uClibc makes it policy to not mess with the utmp file whenever
14 * possible, since I consider utmp a complete waste of time. Since
15 * getlogin() should never be used for security purposes, we kindly let
16 * the user specify whatever they want via the LOGNAME environment
17 * variable, or we return NULL if getenv() fails to find anything */
21 return (getenv("LOGNAME"));
23 libc_hidden_def(getlogin
)
25 int getlogin_r(char *name
, size_t len
)
27 char * foo
= getenv("LOGNAME");
32 strncpy(name
, foo
, len
);
37 char *cuserid(char *s
)
39 char *name
= getlogin();
41 return(strcpy(s
, name
? name
: ""));