2000-05-24 Fernando Ruiz Casas <fernando.ruiz@ctv.es>

* src/getegid.c, src/geteuid.c, src/getgid.c, src/getlogin.c,
	src/getuid.c: Now save their values in private user environment.
This commit is contained in:
Joel Sherrill
2001-05-24 21:38:10 +00:00
parent 9a23bf6453
commit aaf6063737
12 changed files with 86 additions and 2 deletions

View File

@@ -1,3 +1,8 @@
2000-05-24 Fernando Ruiz Casas <fernando.ruiz@ctv.es>
* src/getegid.c, src/geteuid.c, src/getgid.c, src/getlogin.c,
src/getuid.c: Now save their values in private user environment.
2001-04-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.in: Add [-ansi -fasm] to RTEMS_PROG_CC_FOR_TARGET.

View File

@@ -15,7 +15,12 @@
#include <rtems/score/object.h>
#include <rtems/seterr.h>
#include <rtems/libio_.h>
/*
* MACRO in libio_.h
gid_t _POSIX_types_Egid = 0;
*/
/*PAGE
*

View File

@@ -15,7 +15,12 @@
#include <rtems/score/object.h>
#include <rtems/seterr.h>
#include <rtems/libio_.h>
/*
* MACRO in libio_.h
uid_t _POSIX_types_Euid = 0;
*/
/*PAGE
*

View File

@@ -15,7 +15,13 @@
#include <rtems/score/object.h>
#include <rtems/seterr.h>
#include <rtems/libio_.h>
/*
* MACRO in libio_.h
*
gid_t _POSIX_types_Gid = 0;
*/
/*PAGE
*

View File

@@ -15,6 +15,11 @@
#include <rtems/score/object.h>
#include <rtems/seterr.h>
#include <rtems/libio_.h>
#include <string.h>
#include <unistd.h>
#include <pwd.h>
/*PAGE
*
* 4.2.4 Get User Name, P1003.1b-1993, p. 87
@@ -22,7 +27,11 @@
* NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
*/
/*
* MACRO in libio_.h
*
static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ];
*/
char *getlogin( void )
{
@@ -42,9 +51,15 @@ int getlogin_r(
size_t namesize
)
{
struct passwd *pw;
if ( namesize < LOGIN_NAME_MAX )
return ERANGE;
strcpy( name, "posixapp" );
pw=getpwuid(getuid());
if (!pw) {
strcpy(name,"");
} else {
strncpy(name,pw->pw_name,LOGIN_NAME_MAX);
};
return 0;
}

View File

@@ -15,7 +15,13 @@
#include <rtems/score/object.h>
#include <rtems/seterr.h>
#include <rtems/libio_.h>
/*
* MACRO in libio_.h
*
uid_t _POSIX_types_Uid = 0;
*/
/*PAGE
*