Re: [fpc-devel] Fpsigprocmask

2010-02-09 Thread Michael Schnell
On 02/08/2010 06:45 PM, Martin Schreiber wrote: > The potential problems of FPC libc unit (packages/libc/src/libc.pp) is that > it > is not included in .deb packages by default, that it is i386-linux only, that > it is not maintained maybe and that it is possible that FPC team will remove > the

Re: [fpc-devel] Fpsigprocmask

2010-02-09 Thread Marco van de Voort
In our previous episode, Martin Schreiber said: > > Of course it does not, as in the msesys unit the same code (just > > "external ") as in libc is available and thus introduced the same > > potential problems. > > The potential problems of FPC libc unit (packages/libc/src/libc.pp) is that >

Re: [fpc-devel] Fpsigprocmask

2010-02-08 Thread Martin Schreiber
On Monday 08 February 2010 10:53:00 Michael Schnell wrote: > On 02/05/2010 07:00 PM, Martin Schreiber wrote: > > MSEgui does not use the libc unit. > > Of course it does not, as in the msesys unit the same code (just > "external ") as in libc is available and thus introduced the same > potenti

Re: [fpc-devel] Fpsigprocmask

2010-02-08 Thread Michael Schnell
On 02/05/2010 07:00 PM, Martin Schreiber wrote: > MSEgui does not use the libc unit. > Of course it does not, as in the msesys unit the same code (just "external ") as in libc is available and thus introduced the same potential problems. I'd like to have the project benefit from the work th

Re: [fpc-devel] Fpsigprocmask

2010-02-05 Thread Martin Schreiber
On Friday 05 February 2010 14:40:25 you wrote: > I finally succeeded in getting a "proof of concept noguiapplication" > project compiled and running using the Lazarus IDE. > > Seemingly, the timer event is working correctly. > > It still uses the depreciated old libc unit. > > Martin, can we work t

Re: [fpc-devel] Fpsigprocmask

2010-02-05 Thread Michael Schnell
I finally succeeded in getting a "proof of concept noguiapplication" project compiled and running using the Lazarus IDE. Seemingly, the timer event is working correctly. It still uses the depreciated old libc unit. Martin, can we work together to create a common code base for both the msegui pro

Re: [fpc-devel] Fpsigprocmask

2010-01-26 Thread Michael Schnell
On 01/26/2010 03:00 PM, Marco van de Voort wrote: > In general the idea is that if you need unit libc or declare your own > exports to libc, you are doing something atypical. That can be because you > really are atypical (e.g. in the case of extreme requirements or deep OS > dependant system inter

Re: [fpc-devel] Fpsigprocmask

2010-01-26 Thread Michael Schnell
On 01/26/2010 02:47 PM, Marco van de Voort wrote: > IPC is a class of functions. If futex was a portable concept and would > become POSIX, it would probably all under the IPC class. > As I see it, Futex already is a portable Posix concept, as the PThread Library automatically uses it with the p

Re: [fpc-devel] Fpsigprocmask

2010-01-26 Thread Michael Schnell
On 01/25/2010 05:16 PM, Michael Schnell wrote: Can somebody provide a commend to this ? > I defined sem_post > like this: > > function sem_post(__sem:Psem_t):longint;cdecl;external; > > (also alike for sem_init() and friends) > > it does compiler and link, but I_m not sure if it will work. >

Re: [fpc-devel] Fpsigprocmask

2010-01-26 Thread Marco van de Voort
In our previous episode, Michael Schnell said: > On 01/26/2010 01:32 PM, Jonas Maebe wrote: > > I think that you are confusing two things: > > a) using the libc unit is always bad (except for keeping old Kylix code > > running on Linux/i386) > > b) the C *library* is perfectly fine to depend on f

Re: [fpc-devel] Fpsigprocmask

2010-01-26 Thread Marco van de Voort
In our previous episode, Michael Schnell said: [ Charset ISO-8859-1 unsupported, converting... ] > On 01/26/2010 01:18 PM, Marco van de Voort wrote: > > 1) syncobjs > > > OK for me, if the developers here don't discourage this, as they > discourage using libc.pp As Jonas (and the libc_unit link

Re: [fpc-devel] Fpsigprocmask

2010-01-26 Thread Michael Schnell
On 01/26/2010 01:32 PM, Jonas Maebe wrote: > I think that you are confusing two things: > a) using the libc unit is always bad (except for keeping old Kylix code > running on Linux/i386) > b) the C *library* is perfectly fine to depend on for stuff like this > Of course you are right that I am

Re: [fpc-devel] Fpsigprocmask

2010-01-26 Thread Michael Schnell
On 01/26/2010 01:18 PM, Marco van de Voort wrote: > 1) syncobjs > OK for me, if the developers here don't discourage this, as they discourage using libc.pp (see up in this thread: >>> On 01/20/2010 02:12 PM, Michael Van Canneyt wrote: > You should not use it. ) > 2) if it _has_ to be libc f

Re: [fpc-devel] Fpsigprocmask

2010-01-26 Thread Jonas Maebe
On 26 Jan 2010, at 12:54, Michael Schnell wrote: > On 01/26/2010 12:49 PM, Marco van de Voort wrote: >> >> Note that syncobjs is libc based (via cthreads basicevent*) on *nix, and >> wholly portable (also to windows). > > Ooops, that would mean I would not improve things when replacing direct >

Re: [fpc-devel] Fpsigprocmask

2010-01-26 Thread Marco van de Voort
In our previous episode, Michael Schnell said: > On 01/26/2010 12:49 PM, Marco van de Voort wrote: > > > > Note that syncobjs is libc based (via cthreads basicevent*) on *nix, and > > wholly portable (also to windows). > > Ooops, that would mean I would not improve things when replacing direct > l

Re: [fpc-devel] Fpsigprocmask

2010-01-26 Thread Michael Schnell
On 01/26/2010 12:49 PM, Marco van de Voort wrote: > > Note that syncobjs is libc based (via cthreads basicevent*) on *nix, and > wholly portable (also to windows). > Ooops, that would mean I would not improve things when replacing direct libc binding by syncobj binding ? Many thanks for pointi

Re: [fpc-devel] Fpsigprocmask

2010-01-26 Thread Michael Schnell
On 01/26/2010 12:39 PM, Michael Schnell wrote: > But FUTEX is a _very_ complicated and malicious issue. > Regarding Futex, there have been some 100 patches published in the Linux Kernel Mailing List only within the last three Months ! And what you are doing with interlockedincrement and sema

Re: [fpc-devel] Fpsigprocmask

2010-01-26 Thread Marco van de Voort
In our previous episode, Michael Schnell said: > > I only came across this issue, as your "sema" implementation uses the > "discouraged" old libc unit, and while porting your code I of course > wanted to do that along the lines the FPC developers suggest. But your > semty Type seems to be quite di

Re: [fpc-devel] Fpsigprocmask

2010-01-26 Thread Michael Schnell
On 01/25/2010 08:46 PM, Martin Schreiber wrote: > Do you think a futex is cheaper than an interlockedincrement()? > > Sorry, I forgot to answer to your question in the first mail. Of course any FUTEX implementation needs to use something like interlockedincrement() to do the user space impleme

Re: [fpc-devel] Fpsigprocmask

2010-01-26 Thread Michael Schnell
On 01/25/2010 08:46 PM, Martin Schreiber wrote: > > Possible, I don't touch such code if it works - or if I think it works. ;-) > Do you think a futex is cheaper than an interlockedincrement()? > > Other that System V "sema", Futex ("Fast Userspace mUTEX") does not do a system call if a program

Re: [fpc-devel] Fpsigprocmask

2010-01-25 Thread Martin Schreiber
On Monday 25 January 2010 17:16:59 Michael Schnell wrote: > > @Martin: > what is the complicated thread save stuff with sys_semdestroy() > necessary for ? > Would it not be useful to use a Futex instead of a sema ? > Possible, I don't touch such code if it works - or if I think it works. ;-) Do you

Re: [fpc-devel] Fpsigprocmask

2010-01-25 Thread Michael Schnell
On 01/22/2010 03:02 PM, Marco van de Voort wrote: > > (baseunix.) > fpsignal, fpsigemptyset fpsigaddset fpsigprocmask > Thanks ! Martins source now does compile with uses baseunix and fpsignal(), fpsigemptyset(), fpsigaddset() and fpsigprocmask(), fpwrite(), ... :) but there are some more lib

Re: [fpc-devel] Fpsigprocmask

2010-01-22 Thread Michael Schnell
> Maybe there was other code before or it was in order to ensure the right unit > was used or there was a problem with linking or a name clash, I really don't > r

Re: [fpc-devel] Fpsigprocmask

2010-01-22 Thread Marco van de Voort
In our previous episode, Martin Schreiber said: > On Friday 22 January 2010 15:32:36 Michael Schnell wrote: > > > > These _are_ the sources. There is not more to a library call. > > > Maybe there was other code before or it was in order to ensure the right unit > was used or there was a p

Re: [fpc-devel] Fpsigprocmask

2010-01-22 Thread Martin Schreiber
On Friday 22 January 2010 15:32:36 Michael Schnell wrote: > > These _are_ the sources. There is not more to a library call. > Maybe there was other code before or it was in order to ensure the right unit was used or there was a problem with linking or a name clash, I really don't remembe

Re: [fpc-devel] Fpsigprocmask

2010-01-22 Thread Michael Schnell
> > On Friday 22 January 2010 14:39:51 Michael Schnell wrote: > >> mselibc: >> function m_sigprocmask(__how:longint; var SigSet : TSigSet; >> var oldset: Tsigset):longint;cdecl;external clib name >> 'sigprocmask'; >> >> >> >> FPC RTL singnalh.inc: >> function sigprocmask(__how:longin

Re: [fpc-devel] Fpsigprocmask

2010-01-22 Thread Martin Schreiber
On Friday 22 January 2010 14:39:51 Michael Schnell wrote: > mselibc: > function m_sigprocmask(__how:longint; var SigSet : TSigSet; > var oldset: Tsigset):longint;cdecl;external clib name > 'sigprocmask'; > > > > FPC RTL singnalh.inc: > function sigprocmask(__how:longint; var SigSet : TS

Re: [fpc-devel] Fpsigprocmask

2010-01-22 Thread Michael Schnell
On 01/22/2010 03:02 PM, Marco van de Voort wrote: > > (baseunix.) > Great ! Found it, Thanks. > The whole libc unit has been unsupported for new development for the same > time. Don't use it. > OK, I'll try to convert Martin's code to use the fp* functions in the Lazarus package. -Michael

Re: [fpc-devel] Fpsigprocmask

2010-01-22 Thread Marco van de Voort
In our previous episode, Michael Schnell said: > > There is no libc.pp in the RTL. There is some old Kylix legacy package in > > packages/libc, maybe you mean that? > > > > If so, read this http://wiki.freepascal.org/libc_unit > > > > OK. > > What to use instead of signal(), sigemptyset(), s

Re: [fpc-devel] Fpsigprocmask

2010-01-22 Thread Michael Schnell
On 01/20/2010 09:07 PM, Marco van de Voort wrote: > > There is no libc.pp in the RTL. There is some old Kylix legacy package in > packages/libc, maybe you mean that? > > If so, read this http://wiki.freepascal.org/libc_unit > OK. What to use instead of signal(), sigemptyset(), sigaddset(), s

Re: [fpc-devel] Fpsigprocmask

2010-01-22 Thread Michael Schnell
On 01/20/2010 08:22 PM, Martin Schreiber wrote: > > I copied the bits used by MSEgui, fixed the bugs which affected MSEgui and > made it working on x86_64-linux. libc version compatibility is not so bad > IMHO. > MSEgui works with libc on Suse 9.3 and on 2.4 kernels up to Suse 11.2 and the > new

Re: [fpc-devel] Fpsigprocmask

2010-01-21 Thread Marco van de Voort
In our previous episode, Martin Schreiber said: > > That's still no reason to not use the supported routines. One can even > > simply recompile the RTL to have the normal routines use libc (a feature > > that is in production for e.g. OS X) > > > I trust more in libc than in FPC routines, libc is p

Re: [fpc-devel] Fpsigprocmask

2010-01-20 Thread Martin Schreiber
On Wednesday 20 January 2010 21:22:10 Marco van de Voort wrote: > That's still no reason to not use the supported routines. One can even > simply recompile the RTL to have the normal routines use libc (a feature > that is in production for e.g. OS X) > I trust more in libc than in FPC routines, li

Re: [fpc-devel] Fpsigprocmask

2010-01-20 Thread Marco van de Voort
In our previous episode, Martin Schreiber said: [ Charset ISO-8859-1 unsupported, converting... ] > On Wednesday 20 January 2010 17:54:33 Michael Schnell wrote: > > On 01/20/2010 02:12 PM, Michael Van Canneyt wrote: > > > You should not use it. > > > > Martin, why is your code better ? > > > > I do

Re: [fpc-devel] Fpsigprocmask

2010-01-20 Thread Marco van de Voort
In our previous episode, Michael Schnell said: > Do you see any problems with using the libc function defined in the RTL > libc.pp ? There is no libc.pp in the RTL. There is some old Kylix legacy package in packages/libc, maybe you mean that? If so, read this http://wiki.freepascal.org/libc_unit

Re: [fpc-devel] Fpsigprocmask

2010-01-20 Thread Martin Schreiber
On Wednesday 20 January 2010 17:54:33 Michael Schnell wrote: > On 01/20/2010 02:12 PM, Michael Van Canneyt wrote: > > You should not use it. > > Martin, why is your code better ? > > I don't see the difference. You just seem to have used the same coder as > in libc.pp in your own source file >

Re: [fpc-devel] Fpsigprocmask

2010-01-20 Thread Michael Schnell
On 01/20/2010 02:12 PM, Michael Van Canneyt wrote: > > You should not use it. Martin, why is your code better ? I don't see the difference. You just seem to have used the same coder as in libc.pp in your own source file -Michael ___ fpc-devel maill

Re: [fpc-devel] Fpsigprocmask

2010-01-20 Thread Michael Van Canneyt
On Wed, 20 Jan 2010, Michael Schnell wrote: Do you see any problems with using the libc function defined in the RTL libc.pp ? You should not use it. It's linux-x86 only, and meanwhile quite outdated. It's definitely not maintained to match the latest libc. Michael. _

Re: [fpc-devel] Fpsigprocmask

2010-01-20 Thread Michael Schnell
Do you see any problems with using the libc function defined in the RTL libc.pp ? -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel

Re: [fpc-devel] Fpsigprocmask

2010-01-20 Thread Michael Schnell
On 01/20/2010 12:59 PM, Martin Schreiber wrote: > > You can use the minimal MSEgui libc bindings in lib/common/kernel/mselibc.pas. > They work for i386-linux and x86_84-linux and can be ported to other systems > too if necessary. > I did this with the first step (no testing, just trying to get

Re: [fpc-devel] Fpsigprocmask

2010-01-20 Thread Michael Schnell
I found that the correct libc.pp function name of course (silly me) is just "sigprocmask" without any prefix. Now this part does compile Thanks, -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listin

Re: [fpc-devel] Fpsigprocmask

2010-01-20 Thread Martin Schreiber
On Wednesday 20 January 2010 12:29:58 Michael Schnell wrote: > When I try to define the function"Fpsigprocmask" in that way myself I > get some type conflicts when calling it with Martin's code. (I'll try to > solve this when I am able to point it to the proper RTL function. > You can use the mini

[fpc-devel] Fpsigprocmask

2010-01-20 Thread Michael Schnell
Hi RTL/libc experts. I'm trying top port the TNoGUIApplication (Linux version) I found in MSEIDE to Lazarus. Here Martin uses a function called "m_sigprocmask". In his code in "mselibc.pas" it is defined as function m_sigprocmask(__how:longint; var SigSet : TSigSet; var oldset: Tsi