getdtablesize() / DU-loader (reason why netscape DU binaries don't

Herbert Valerio Riedel (hvr@hvrlab.ml.org)
Tue, 8 Dec 1998 16:17:44 +0100 (CET)


Hi all

consider this:

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

int main(int argc, char *argv[])
{
int size = getdtablesize();

printf("getdtablesize() = %i\n", size);

return 0;
}

output of the above compiled under axp-linux with linux-gcc and run under
2.1.131-ac5:

getdtablesize() = 1024

output of the above compiled under DU4 with DU-gcc and run under
2.1.131-ac5:

getdtablesize() = 1048576

(I am quite sure although I haven't verified, that the behaviour has
changed since 2.1.130)

btw: 2.1.131-ac5 was compiled with egcs-1.1.1 and runs fine except for
that one thing...

----------------------------------------------------------------------

here are the corresponding strace-logs:

execve("./dtable-linux", ["./dtable-linux"], [/* 29 vars */]) = 0
brk(0) = 0x120100a30
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 4
fstat(4, {st_mode=01, st_size=913129959, ...}) = 0
mmap(0, 4831835312, PROT_READ, 0 /* MAP_??? */, 0, 0) = 0x20000010000
close(4) = 0
open("/lib/libc.so.6.1", O_RDONLY) = 4
mmap(0, 0, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x20000016000
munmap(0x20000016000, 8192) = 0
mmap(0, 8192, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x20000110000
mprotect(0x200001d8000, 1153256, PROT_NONE) = 0
mmap(0x200002d0000, 1153256, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x200002d0000
mmap(0x200002e8000, 1153256, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x200002e8000
close(4) = 0
munmap(0x20000010000, 17665) = 0
personality(PER_LINUX) = 0
osf_getsysinfo(0x2d, 0x11ffffaf0, 0x11ffffb58, 0, 0x2) = 0
osf_setsysinfo(0xe, 0x11ffffaf0, 0x11ffffb58, 0, 0x2) = 0
getxpid() = 1055
getrlimit(RLIMIT_NOFILE, {rlim_cur=1024, rlim_max=1024}) = 0
fstat(1, {st_mode=01, st_size=913129959, ...}) = 0
mmap(0, 4831834800, 0x1ffffb58, 0 /* MAP_??? */, 2, 0) = 0x20000010000
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(1, "getdtablesize() = 1024 \n", 24) = 24
munmap(0x20000010000, 8192) = 0
exit(0) = ?

--------------------------------------------------------------

execve("./dtable-du-gcc", ["./dtable-du-gcc"], [/* 29 vars */]) = 0
getpagesize() = 0x2000
getpagesize() = 0x2000
getrlimit(RLIMIT_DATA, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0
mmap(0x3ffc0004000, 4831836648, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x3ffc0004000
getrlimit(RLIMIT_DATA, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0
mmap(0x3ffc0006000, 4831836648, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x3ffc0006000
open("./dtable-du-gcc", O_RDONLY) = 4
getxuid() = 500
getxgid(0x3ffc0002800) = 500
getxuid() = 500
getxgid(0x3ffc0002800) = 500
read(4, "\203\1\21\0\316>m6\0@\0\0\0\0\0\0"..., 2664) = 2664
mmap(0x120000000, 4831834176, 0xa68, 0 /* MAP_??? */, 0, 0) = 0x120000000
mmap(0x140000000, 4831834176, 0xa68, 0 /* MAP_??? */, 0, 0) = 0x140000000
open("/usr/shlib/libc.so", O_RDONLY) = 5
read(5, "\203\1\23\0\372\341\3373\0\200\22"..., 2664) = 2664
mmap(0x3ff80080000, 4831833920, 0xa68, 0 /* MAP_??? */, 0, 0) = 0x3ff80080000
mmap(0x3ffc0080000, 4831833920, 0xa68, 0 /* MAP_??? */, 0, 0) = 0x3ffc0080000
mmap(0x3ffc0090000, 4831833920, 0xa68, 0 /* MAP_??? */, 0, 0) = 0x3ffc0090000
close(5) = 0
stat("/usr/shlib/libc.so", {st_mode=01, st_size=913129995, ...}) = 0
SYS_43(0x120000000, 0x2000, 0x140000000, 0x1a0, 0) = 0
close(4) = 0
getpagesize() = 0x2000
brk(0x14000e1a0) = 0x14000e1a0
getdtablesize() = 1048576
ioctl(1, TIOCGETP, 0x11ffff2d8) = 0
write(1, "getdtablesize() = 1048576 \n", 27) = 27
close(0) = 0
close(1) = 0
close(2) = 0
sigprocmask(SIG_BLOCK, ~[ILL EMT FPE BUS SEGV SYS]) = 0 (old mask [])
exit(0) = ?

--
"The idea that Bill Gates has appeared like a knight in shining armour to
lead all customers out of a mire of  technological chaos neatly ignores the
fact that it was he who, by peddling second-rate technology, led them into
it in the first place." - Douglas Adams, on Windows '95.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/