blob: 729743696a9008ade0ff1a35bfc0339611991f1a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
/*PAGE
*
* 4.2.4 Get User Name, P1003.1b-1993, p. 87
*
* NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
*/
static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ];
char *getlogin( void )
{
(void) getlogin_r( _POSIX_types_Getlogin_buffer, LOGIN_NAME_MAX );
return _POSIX_types_Getlogin_buffer;
}
/*PAGE
*
* 4.2.4 Get User Name, P1003.1b-1993, p. 87
*
* NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
*/
int getlogin_r(
char *name,
size_t namesize
)
{
if ( namesize < LOGIN_NAME_MAX )
return ERANGE;
strcpy( name, "posixapp" );
return 0;
}
|