OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems/] [c/] [src/] [exec/] [posix/] [src/] [getlogin.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.