2 * Copyright 2002-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
15 #include <errno_private.h>
21 pw
= getpwuid(getuid());
29 int getlogin_r(char *name
, size_t nameSize
)
32 pw
= getpwuid(getuid());
33 if (pw
&& (nameSize
>= LOGIN_NAME_MAX
)) {
34 memset(name
, 0, nameSize
);
35 strlcpy(name
, pw
->pw_name
, LOGIN_NAME_MAX
);
45 if (s
!= NULL
&& getlogin_r(s
, L_cuserid
))