Skip to contentSkip to conversation

getlogin problem

Linux-ia64 Donny Cooper 1 participant 1 message Jun 1, 2001

lore
Share & tools
lore
#0 lore raw

Hello,

Below is a small test that shows a getlogin problem.

Please review the following session. The getlogin does not return username if the code is executed in a script with background command, but returns correctly when run in foreground.

Note: below test uses ecc (Intel Compiler), gcc compiler yields same results.

This works correctly in 000828 with 2.4.0-test10 kernel.

Any ideas?

Thanks.

Donny
NEC Systems, Inc.

--- Begin Test Case -----------------
Failed Environments:
TurboLinux Beta2-R1 w/ 2.4.0-010109-61 kernel on Lion system TurboLinux Beta2-R1 w/ 2.4.3-AzusA kernel on AzusA system
TurboLinux Beta3 w/ 2.4.3-010405 kernel on Lion system

[aamin@lion]$ cat getlogin.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
main()
{
char *s;
s=malloc(32);
s=getlogin();
printf("arvind login %s \n",s);
}
[aamin@lion]$ ecc -o getlogin getlogin.c
[aamin@lion]$ cat test.csh
#!/bin/csh
./getlogin &
[aamin@lion]$ ./getlogin
arvind login aamin
[aamin@lion]$ test.csh
[1] 15977
[aamin@lion]$ arvind login (null)

--- End Test Case -------------------

-----------------------------------
Donny Cooper
NEC Systems, Inc.
Advanced Technical Computing Center
[email protected]
http://www.necservers.com
-----------------------------------