Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-01

What about signals.pp on win32?

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Tiziano De Togni

I was trying to convert a C source to Pascal. It uses signals, and I thought that these things were not available on Win platforms.

Documentation talks about signals in oldlinux and baseunix units only (Linux).

Then I went on the signals.pp unit in:

C:\fpc\...\source\rtl\win32\signals.pp

I understand the function signal, but I don't see a way to "Raise" a signal.

(a second question is that I can't understand how to raise a signal under Linux without using the oldlinux unit)

Could someone enlight me?

tiziano

Reply by email

Michael Van Canneyt
to Tiziano De Togni
Tiziano De Togni wrote 12 lines
I was trying to convert a C source to Pascal. It uses signals, and I thought that these things were not available on Win platforms. Documentation talks about signals in oldlinux and baseunix units only (Linux). Then I went on the signals.pp unit in: C:\fpc\...\source\rtl\win32\signals.pp I understand the function signal, but I don't see a way to "Raise" a signal.

There isn't a proper way;
Signals on windows have totally different semantics than on Linux/unix. You should not try to imitate them.

(a second question is that I can't understand how to raise a signal under Linux without using the oldlinux unit)

use the fpKill etc functions in baseunix/unix. They have the same names as the oldlinux ones, with 'fp' prepended.

Michael.

Reply by email

Tiziano De Togni
to Michael Van Canneyt

Michael Van Canneyt ha scritto:

Show quoted text 18 lines
On Mon, 14 Jan 2008, Tiziano De Togni wrote: > I was trying to convert a C source to Pascal. It uses signals, and I thought > that these things were not available on Win platforms. > > Documentation talks about signals in oldlinux and baseunix units only (Linux). > > Then I went on the signals.pp unit in: > > C:\fpc\...\source\rtl\win32\signals.pp > > > I understand the function signal, but I don't see a way to "Raise" a signal. There isn't a proper way; Signals on windows have totally different semantics than on Linux/unix. You should not try to imitate them.

I agree, so I removed all signal related code from the C source and in win32 I used other things.

But then, what is signals.pp meant for?

tiziano

Reply by email

Michael Van Canneyt
to Tiziano De Togni
Tiziano De Togni wrote 27 lines
Michael Van Canneyt ha scritto: > > On Mon, 14 Jan 2008, Tiziano De Togni wrote: > > > I was trying to convert a C source to Pascal. It uses signals, and I > > thought > > that these things were not available on Win platforms. > > > > Documentation talks about signals in oldlinux and baseunix units only > > (Linux). > > > > Then I went on the signals.pp unit in: > > > > C:\fpc\...\source\rtl\win32\signals.pp > > > > > > I understand the function signal, but I don't see a way to "Raise" a > > signal. > > There isn't a proper way; Signals on windows have totally different > semantics than on Linux/unix. > You should not try to imitate them. I agree, so I removed all signal related code from the C source and in win32 I used other things. But then, what is signals.pp meant for?

It tries to do (for a limited amount of signals) what I advise not to do :-)

Michael.

Reply by email