Closed kevdev158 closed 9 years ago
In order for me to help, you need to provide enough information for me to reproduce the problem. In this case, that means giving the specific set of instructions that you run.
Also, it is always wrong to be using a.out
to run your code. Why aren't you calling make
and then running bin/rshell
?
I didn't really understand how to compile it with the makefile and the flags until just now. I got it working now though, but I have to use getpwuid()
instead of getlogin()
.
I have encountered the same problem as yours!!! And then I switched to use other's computer, it just went well. It seems that script can make many things different from the real running process!
getlogin()
works fine when I do./a.out
by itself, but when I runscript
and then./a.out
,getlogin()
fails to return the login name until I exit the script in which case it works fine again.