Pádraig Brady wrote:
> >
> > FAIL: tests/misc/stty-row-col
> > =============================
>
> Any of the commands like `stty rows 40 columns 80` are being silently ignored.
'stty size' retrieves the info from an ioctl(1,TIOCGWINSZ) call and an
ioctl(0,TIOCGWINSZ) call. Even the value of environment variable COLUMNS
is ignored in this case (I have set COLUMNS=72, for testing).
The terminal in this case is a Solaris console, not a X11 based terminal
emulator.
Find attached the output of
truss src/stty 2>&1 | tee truss.out
truss -u a.out src/stty 2>&1 | tee truss-u.out
Btw, I find the output of the latter (call hierarchy within the main executable)
quite interesting; do we have a similar tool on Linux?
Bruno
execve("src/stty", 0x7FFFBFFFF908, 0x7FFFBFFFF920) argc = 2
sysinfo(SI_MACHINE, "i86pc", 257) = 6
mmap(0x00000000, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) =
0x7FFFBF6E5000
memcntl(0x7FFFBF400000, 103248, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
memcntl(0x00400000, 22352, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
getcwd("/export/home/bruno/coreutils-9.0.207-b411f-dirty/build-64", 1014) = 0
resolvepath("/export/home/bruno/coreutils-9.0.207-b411f-dirty/build-64/src/stty",
"/export/home/bruno/coreutils-9.0.207-b411f-dirty/build-64/src/stty", 1023) =
66
resolvepath("/usr/lib/amd64/ld.so.1", "/lib/amd64/ld.so.1", 1023) = 18
fstatat(AT_FDCWD,
"/export/home/bruno/coreutils-9.0.207-b411f-dirty/build-64/src/stty",
0x7FFFBFFFF4B0, 0) = 0
openat(AT_FDCWD, "/var/ld/64/ld.config", O_RDONLY) Err#2 ENOENT
fstatat(AT_FDCWD, "/lib/64/libc.so.1", 0x7FFFBFFFE4B0, 0) = 0
resolvepath("/lib/64/libc.so.1", "/lib/amd64/libc.so.1", 1023) = 20
openat(AT_FDCWD, "/lib/64/libc.so.1", O_RDONLY) = 3
mmapobj(3, MMOBJ_INTERPRET, 0x7FFFBF6E6F58, 0x7FFFBFFFE43C, 0x00000000) = 0
close(3) = 0
memcntl(0x7FFFBEB00000, 790032, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
mmap(0x00010000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON|MAP_ALIGN,
-1, 0) = 0x7FFFBF6D0000
getcontext(0x7FFFBFFFEEE0)
getrlimit(RLIMIT_STACK, 0x7FFFBFFFF240) = 0
getpid() = 28113 [28111]
lwp_private(0, 0, 0x7FFFBF6D2A40) = 0x00000000
setustack(0x7FFFBF6D2AE8)
sigfillset(0x7FFFBEEACCF0) = 0
sysi86(SI86FPSTART, 0x7FFFBFFFF8AC, 0x0000133F, 0x00001F80) = 0x00000001
brk(0x00000000) = 0x005194E8
brk(0x005194F0) = 0x00000000
brk(0x0051D4F0) = 0x00000000
openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/en_US.UTF-8", O_RDONLY) = 3
fstatat(3, NULL, 0x7FFFBFFFF110, 0) = 0
mmap(0x00000000, 7300240, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7FFFBE400000
sysconfig(_CONFIG_PAGESIZE) = 4096
memcntl(0x7FFFBE400000, 7303168, MC_HAT_ADVISE, 0x7FFFBFFFEC30, 0, 0) = 0
fstatat(AT_FDCWD, "/usr/lib/locale/common/amd64/methods_unicode.so.3",
0x7FFFBFFFE1B0, 0) = 0
resolvepath("/usr/lib/locale/common/amd64/methods_unicode.so.3",
"/usr/lib/locale/common/amd64/methods_unicode.so.3", 1023) = 49
openat(AT_FDCWD, "/usr/lib/locale/common/amd64/methods_unicode.so.3", O_RDONLY)
= 4
mmapobj(4, MMOBJ_INTERPRET, 0x7FFFBF6EC488, 0x7FFFBFFFE13C, 0x00000000) = 0
close(4) = 0
memcntl(0x7FFFBF200000, 7336, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(3) = 0
brk(0x0051D4F0) = 0x00000000
brk(0x005214F0) = 0x00000000
openat(AT_FDCWD,
"/export/home/bruno/prefix64/share/locale/en_US.UTF-8/LC_MESSAGES/coreutils.mo",
O_RDONLY) Err#2 ENOENT
openat(AT_FDCWD,
"/export/home/bruno/prefix64/share/locale/en_US/LC_MESSAGES/coreutils.mo",
O_RDONLY) Err#2 ENOENT
openat(AT_FDCWD,
"/export/home/bruno/prefix64/share/locale/en/LC_MESSAGES/coreutils.mo",
O_RDONLY) Err#2 ENOENT
ioctl(0, TCGETS, 0x00517400) = 0
ioctl(1, TIOCGWINSZ, 0x7FFFBFFFF7B8) Err#22 EINVAL
ioctl(0, TIOCGWINSZ, 0x7FFFBFFFF798) = 0
ioctl(1, TCGETA, 0x7FFFBFFFF530) Err#22 EINVAL
fstatat(1, NULL, 0x7FFFBFFFF580, 0) = 0
fstatat(1, NULL, 0x7FFFBFFFF4C0, 0) = 0
34 80
write(1, " 3 4 8 0\n", 6) = 6
close(1) = 0
close(2) = 0
_exit(0)
execve("src/stty", 0x7FFFBFFFF908, 0x7FFFBFFFF920) argc = 2
sysinfo(SI_MACHINE, "i86pc", 257) = 6
mmap(0x00000000, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) =
0x7FFFBF6E5000
memcntl(0x7FFFBF400000, 103248, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
memcntl(0x00400000, 22352, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
getcwd("/export/home/bruno/coreutils-9.0.207-b411f-dirty/build-64", 1014) = 0
resolvepath("/export/home/bruno/coreutils-9.0.207-b411f-dirty/build-64/src/stty",
"/export/home/bruno/coreutils-9.0.207-b411f-dirty/build-64/src/stty", 1023) =
66
resolvepath("/usr/lib/amd64/ld.so.1", "/lib/amd64/ld.so.1", 1023) = 18
fstatat(AT_FDCWD,
"/export/home/bruno/coreutils-9.0.207-b411f-dirty/build-64/src/stty",
0x7FFFBFFFF4B0, 0) = 0
openat(AT_FDCWD, "/var/ld/64/ld.config", O_RDONLY) Err#2 ENOENT
fstatat(AT_FDCWD, "/lib/64/libc.so.1", 0x7FFFBFFFE4B0, 0) = 0
resolvepath("/lib/64/libc.so.1", "/lib/amd64/libc.so.1", 1023) = 20
openat(AT_FDCWD, "/lib/64/libc.so.1", O_RDONLY) = 3
mmapobj(3, MMOBJ_INTERPRET, 0x7FFFBF6E6F58, 0x7FFFBFFFE43C, 0x00000000) = 0
close(3) = 0
memcntl(0x7FFFBEB00000, 790032, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
mmap(0x00010000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON|MAP_ALIGN,
-1, 0) = 0x7FFFBF6D0000
getcontext(0x7FFFBFFFEEE0)
getrlimit(RLIMIT_STACK, 0x7FFFBFFFF240) = 0
getpid() = 28108 [28106]
lwp_private(0, 0, 0x7FFFBF6D2A40) = 0x00000000
setustack(0x7FFFBF6D2AE8)
sigfillset(0x7FFFBEEACCF0) = 0
/1@1: -> frame_dummy(0x7fffbeea26c0, 0x0, 0x0, 0x0, 0x10, 0x101010101010101)
/1@1: -> register_tm_clones(0x7fffbeea26c0, 0x0, 0x0, 0x0, 0x10,
0x101010101010101)
/1@1: <- frame_dummy() = 0
/1@1: -> __start_crt(0x2, 0x7fffbffff908, 0x7fffbffff920, 0x7fffbf432eb0,
0x10, 0x101010101010101)
sysi86(SI86FPSTART, 0x7FFFBFFFF8AC, 0x0000133F, 0x00001F80) = 0x00000001
/1@1: -> _init(0x29, 0x7fffbffff8ac, 0x0, 0x1f80, 0x10, 0x101010101010101)
/1@1: <- _init() = 0x416d10
/1@1: <- __start_crt() = 0
/1@1: -> main(0x2, 0x7fffbffff908, 0x7fffbffff920, 0x1f80, 0x10,
0x101010101010101)
/1@1: -> set_program_name(0x7fffbffffade, 0x7fffbffff908, 0x7fffbffff920,
0x1f80, 0x10, 0x101010101010101)
/1@1: <- set_program_name() = 0x7fffbffffae1
brk(0x00000000) = 0x005194E8
brk(0x005194F0) = 0x00000000
brk(0x0051D4F0) = 0x00000000
openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/en_US.UTF-8", O_RDONLY) = 3
fstatat(3, NULL, 0x7FFFBFFFF110, 0) = 0
mmap(0x00000000, 7300240, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7FFFBE400000
sysconfig(_CONFIG_PAGESIZE) = 4096
memcntl(0x7FFFBE400000, 7303168, MC_HAT_ADVISE, 0x7FFFBFFFEC30, 0, 0) = 0
fstatat(AT_FDCWD, "/usr/lib/locale/common/amd64/methods_unicode.so.3",
0x7FFFBFFFE1B0, 0) = 0
resolvepath("/usr/lib/locale/common/amd64/methods_unicode.so.3",
"/usr/lib/locale/common/amd64/methods_unicode.so.3", 1023) = 49
openat(AT_FDCWD, "/usr/lib/locale/common/amd64/methods_unicode.so.3", O_RDONLY)
= 4
mmapobj(4, MMOBJ_INTERPRET, 0x7FFFBF6EC488, 0x7FFFBFFFE13C, 0x00000000) = 0
close(4) = 0
memcntl(0x7FFFBF200000, 7336, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(3) = 0
brk(0x0051D4F0) = 0x00000000
brk(0x005214F0) = 0x00000000
/1@1: -> rpl_getopt_long(0x2, 0x7fffbffff908, 0x40a54c, 0x405a40, 0x0, 0x10)
/1@1: -> rpl_getopt_internal(0x2, 0x7fffbffff908, 0x40a54c, 0x405a40,
0x0, 0x0)
/1@1: -> _getopt_internal_r(0x2, 0x7fffbffff908, 0x40a54c, 0x405a40,
0x0, 0x0)
/1@1: <- _getopt_internal_r() = 1
/1@1: <- rpl_getopt_internal() = 1
/1@1: <- rpl_getopt_long() = 1
/1@1: -> rpl_getopt_long(0x1, 0x7fffbffff910, 0x40a54c, 0x405a40, 0x0, 0x0)
/1@1: -> rpl_getopt_internal(0x1, 0x7fffbffff910, 0x40a54c, 0x405a40,
0x0, 0x0)
/1@1: -> _getopt_internal_r(0x1, 0x7fffbffff910, 0x40a54c, 0x405a40,
0x0, 0x0)
/1@1: <- _getopt_internal_r() = 0xffffffff
/1@1: <- rpl_getopt_internal() = 0xffffffff
/1@1: <- rpl_getopt_long() = 0xffffffff
openat(AT_FDCWD,
"/export/home/bruno/prefix64/share/locale/en_US.UTF-8/LC_MESSAGES/coreutils.mo",
O_RDONLY) Err#2 ENOENT
openat(AT_FDCWD,
"/export/home/bruno/prefix64/share/locale/en_US/LC_MESSAGES/coreutils.mo",
O_RDONLY) Err#2 ENOENT
openat(AT_FDCWD,
"/export/home/bruno/prefix64/share/locale/en/LC_MESSAGES/coreutils.mo",
O_RDONLY) Err#2 ENOENT
/1@1: -> apply_settings(0x1, 0x40a562, 0x7fffbffff908, 0x2, 0x517440,
0x7fffbffff8af)
/1@1: <- apply_settings() = 0
ioctl(0, TCGETS, 0x00517400) = 0
/1@1: -> apply_settings(0x0, 0x40a562, 0x7fffbffff908, 0x2, 0x517400,
0x7fffbffff8af)
/1@1: -> screen_columns(0x7fffbffffae7, 0x40a51c, 0x4, 0x0, 0x0, 0x2)
ioctl(1, TIOCGWINSZ, 0x7FFFBFFFF7B8) Err#22 EINVAL
/1@1: -> xstrtol(0x7fffbffffc3e, 0x0, 0x0, 0x7fffbffff7b0, 0x407ba0,
0x3d)
/1@1: <- xstrtol() = 0
/1@1: <- screen_columns() = 72
/1@1: -> display_window_size(0x0, 0x40a562, 0x47, 0x48, 0x407ba0, 0x3d)
ioctl(0, TIOCGWINSZ, 0x7FFFBFFFF798) = 0
/1@1: -> wrapf(0x40a3cb, 0x22, 0x50, 0x48, 0x407ba0, 0x3d)
/1@1: -> rpl_vasprintf(0x7fffbffff6a0, 0x40a3cb, 0x7fffbffff6a8,
0x48, 0x407ba0, 0x3d)
/1@1: -> vasnprintf(0x0, 0x7fffbffff678, 0x40a3cb, 0x7fffbffff6a8,
0x407ba0, 0x3d)
/1@1: -> printf_parse(0x40a3cb, 0x7fffbfffee20, 0x7fffbfffed30,
0x7fffbffff6a8, 0x407ba0, 0x3d)
/1@1: <- printf_parse() = 0
/1@1: -> printf_fetchargs(0x7fffbffff6a8, 0x7fffbfffed30, 0x0,
0x7fffbfffee40, 0x7fffbfffed30, 0xffffffffffffffff)
/1@1: <- printf_fetchargs() = 0
/1@1: -> rpl_malloc(0xc, 0x0, 0x0, 0x5, 0x0, 0x0)
/1@1: <- rpl_malloc() = 0x519610
/1@1: -> rpl_realloc(0x519610, 0x7, 0x40a3d1, 0x519616, 0x1, 0xa)
/1@1: <- rpl_realloc() = 0x519610
/1@1: <- vasnprintf() = 0x519610
/1@1: <- rpl_vasprintf() = 6
ioctl(1, TCGETA, 0x7FFFBFFFF530) Err#22 EINVAL
fstatat(1, NULL, 0x7FFFBFFFF580, 0) = 0
fstatat(1, NULL, 0x7FFFBFFFF4C0, 0) = 0
/1@1: <- wrapf() = 0
/1@1: <- display_window_size() = 0
/1@1: <- apply_settings() = 0
/1@1: <- main() = 0
/1@1: -> close_stdout(0x7fffbeea4f00, 0x0, 0x0, 0x0, 0x6, 0x38203433)
/1@1: -> close_stream(0x518940, 0x0, 0x0, 0x0, 0x6, 0x38203433)
34 80
write(1, " 3 4 8 0\n", 6) = 6
close(1) = 0
/1@1: <- close_stream() = 0
/1@1: -> close_stream(0x5189c0, 0x0, 0x0, 0x0, 0x6, 0x38203433)
close(2) = 0
/1@1: <- close_stream() = 0
/1@1: <- close_stdout() = 0
/1@1: -> _fini(0x7fffbeea4c80, 0x0, 0x0, 0x0, 0x40, 0x101010101010101)
/1@1: <- _fini() = 0
/1@1: -> __do_global_dtors_aux(0x7fffbeea26c0, 0x0, 0x0, 0x0, 0x8,
0x7fffbf6ec638)
/1@1: -> deregister_tm_clones(0x7fffbeea26c0, 0x0, 0x0, 0x0, 0x8,
0x7fffbf6ec638)
/1@1: <- deregister_tm_clones() = 0x517378
/1@1: <- __do_global_dtors_aux() = 0x517378
_exit(0)