LQ Newbie
Registered: Feb 2010
Posts: 2
Rep:
|
setlocale problem
Hi,
I am trying to setlocale on ppc, but due to memory shortage the locale package is not installed completely- only the related files are copied. There may be a missing file but I cannot find which is. The simple test code below does not work and prints error message.
int main()
{
if ( setlocale(LC_COLLATE,"tr_TR") == NULL )
printf("could not set locale\n");
return 0;
}
strace output is as follows.
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2601, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x30000000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2601
read(3, "", 4096) = 0
close(3) = 0
munmap(0x30000000, 4096) = 0
open("/usr/lib/locale/tr_TR/LC_COLLATE", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=22471, ...}) = 0
mmap(NULL, 22471, PROT_READ, MAP_PRIVATE, 3, 0) = 0x30000000
close(3) = 0
munmap(0x30000000, 22471) = 0
open("/usr/lib/locale/tr/LC_COLLATE", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=22471, ...}) = 0
mmap(NULL, 22471, PROT_READ, MAP_PRIVATE, 3, 0) = 0x30000000
close(3) = 0
munmap(0x30000000, 22471) = 0
fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(3, 0), ...}) = 0
ioctl(1, TCGETS, {B9600 opost isig icanon echo ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x30000000
write(1, "could not set locale\n", 21could not set locale
Also I cannot understand why it is trying to open
"/usr/lib/locale/tr/LC_COLLATE" after finding "/usr/lib/locale/tr_TR/LC_COLLATE".
Does anybody have an idea??
|