This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Possible problem with GNU libc & Linux 2.2.X ? (fwd)
- To: Jan Rafaj <Jan dot Rafaj at cedric dot vabo dot cz>
- Subject: Re: Possible problem with GNU libc & Linux 2.2.X ? (fwd)
- From: James Antill <james at and dot org>
- Date: 13 Sep 2000 16:05:52 -0400
- Cc: libc-alpha at sources dot redhat dot com
- References: <Pine.LNX.4.21.0009132106550.23292-100000@cedric.vabo.cz>
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