"Gustavo Sverzut Barbieri" <[EMAIL PROTECTED]> writes:
> On 2/1/07, Marius Gedminas <[EMAIL PROTECTED]> wrote:
>> >
>> > Yep, the point is that looks like Dummy is not accepted as connection
>> > type. So you are supposed to enable wi-fi if you wish to connect to
>> > 127.0.0.1.
>>
>
> As willian said, the problem still remain... we're fixing the problem
> in the wrong area.
>
> Maemo is broken: it traps "socket()" calls instead of "connect()", why?
There might be some other reason than this: I do not know any program
timeouting socket() call (everyone just calls socket() and expects it to
return quickly). connect() (blocking or non-blocking) is expected to return
in a short while or an error message is printed out (firefox does this, for
example)...
I've been wondering how to go around this, like:
1) would it be possible to make replacement LD_PRELOAD library that wraps
connect() instead (and would that work...) ...and bind() too.
2) in some cases, just writing a shell wrapper that unsets LD_PRELOAD
before loading other program might be useful
3) In (C) programs that needs both to avoid this wrapping (for example
bind()ing socket to 127.0.0.1 on some port). but then needing that
wrapping (connect()ing to internet to do some work) could probably try
like:
int (*sys_socket)(int, int, int);
int s;
void * handle = dlopen("/lib/libc.so.6", RTLD_LAZY);
if (!handle)
exit(1);
sys_socket = dlsym(handle "socket");
if (dlerror())
exit(1);
...
s = sys_socket(AF_INET, SOCK_STREAM, 0);
...
Some of these might work... or then not. I'll be trying
cases 2 and 3 in (near?) future; 2 when launching web browser
and 3 when starting program web browser will connect to.
>
> Gustavo Sverzut Barbieri
Tomi
_______________________________________________
maemo-developers mailing list
[email protected]
https://maemo.org/mailman/listinfo/maemo-developers