[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Unthreaded applications?



Please break you Mails at 72 characters since my terminal is only
132 chars (others may only 80 characters) because I do not want to
break code sniples into several lines...

Your longest line is 254 characters!!!

Am 2007-04-05 22:30:55, schrieb memutza:
> Hi,
> 
> I have an application that needs to run its own version of some system-calls (fork, wait, kill, etc.): the source-code therefore includes a small assembly-code module to do that, calling the kernel directly using "int 0x80" and bypassing the libraries.

No it is not posibel, except you want to crash your system.

> The application is not threaded, but since a new glibc library was installed, it occasionally gets stuck.  Using STRACE, I found that it is stuck on the "futex()" system-call, which I understand is used for threading.

Which NEW glibc?  2.5?


> I have no idea why "futex()" was called in the first place because the application uses no threads, but it seems that futex is waiting for some value in memory to change, which was probably supposed to be set by one of the bypassed system-calls.
> 
> 1. Is there a way to tell GLIBC that my application is not threaded, so it does not attempt to use threading system-calls (perhaps a compilation flag, or an environment variable)?

It does this automaticaly, and you get your error,
BECAUSE you want to bypass glibc

> 2. Is there anything wrong for a program to issue system-calls directly?
> 
> 3. Is there a correct way to bypass such unwanted threading system-calls (for example by providing dummy routines that return 0 or -1/ENOSYS)?

Not that I know...


Note:  Currently I am reading "Programming with POSIX threads"
       and you should do this too...  :-)

Thanks, Greetings and nice Day
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSN LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)

Attachment: signature.pgp
Description: Digital signature


Reply to: