source: rtems/c/src/exec/posix/src/getlogin.c @ 188c82b

4.104.114.84.95
Last change on this file since 188c82b was 188c82b, checked in by Joel Sherrill <joel.sherrill@…>, on 08/30/00 at 17:12:55

2000-08-30 Joel Sherrill <joel@…>

  • Many files: Moved posix/include/rtems/posix/seterr.h to score/include/rtems/seterr.h so it would be available within all APIs.
  • Property mode set to 100644
File size: 764 bytes
Line 
1/*
2 *  $Id$
3 */
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/seterr.h>
13
14/*PAGE
15 *
16 *  4.2.4 Get User Name, P1003.1b-1993, p. 87
17 *
18 *  NOTE:  P1003.1c/D10, p. 49 adds getlogin_r().
19 */
20
21static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ];
22
23char *getlogin( void )
24{
25  (void) getlogin_r( _POSIX_types_Getlogin_buffer, LOGIN_NAME_MAX );
26  return _POSIX_types_Getlogin_buffer;
27}
28
29/*PAGE
30 *
31 *  4.2.4 Get User Name, P1003.1b-1993, p. 87
32 *
33 *  NOTE:  P1003.1c/D10, p. 49 adds getlogin_r().
34 */
35
36int getlogin_r(
37  char   *name,
38  size_t  namesize
39)
40{
41  if ( namesize < LOGIN_NAME_MAX )
42    return ERANGE;
43
44  strcpy( name, "posixapp" );
45  return 0;
46}
Note: See TracBrowser for help on using the repository browser.