This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Possible problem with GNU libc & Linux 2.2.X ? (fwd)


Jan Rafaj <Jan.Rafaj@cedric.vabo.cz> writes:

> Recently, while trying to get a program to work on system equipped
> with Linux 2.2.17, configured NOT TO USE Unix98 ttys, and glibc-2.1.3,
> I've faced this problem:
> 
> The function ttyname(0) returns just "/dev/tty" for ordinary user,
> while for root, it returns the real tty he's connected through.

 I'm using glibc-2.1.3 and Linux-2.1.17, but not using Unix98 ttys.

 The program...

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main(void)
{

 printf("%s\n", ttyname(0));

 exit (EXIT_SUCCESS);
}

 Prints...
/dev/ttyp4

 And ls -l /proc/self/fd/0 prints...
lrwx------   1 james    users          64 Sep 13 16:02 /proc/self/fd/0 -> /dev/ttyp4

 I'm not using a distribution though, what does the ls command above
show for you ?

-- 
James Antill -- james@and.org

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]