Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent signal numbers in Sys and Unix modules #3584

Closed
vicuna opened this issue Apr 7, 2005 · 1 comment
Closed

Inconsistent signal numbers in Sys and Unix modules #3584

vicuna opened this issue Apr 7, 2005 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Apr 7, 2005

Original bug ID: 3584
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Dr Leonid Timochouk
Version: 3.08.3
OS: Linux (manual OCaml build from sources)
Submission from: 82-41-94-35.cable.ubr02.dund.blueyonder.co.uk (82.41.94.35)

In the Sys module, the integer values of the signals (Sys.sigabrt, Sys.sigalrm,
...) are not the actual POSIX values; they are translated into the POSIX values
by the function caml_convert_signal_number (located in asmrun/signals.c or
byterun/signals.c).

In the Unix module, according to the documentation, if Unix.wait or Unix.waitpid
returns process_status which is (WSIGNALLED of int) or (WSTOPPED of int), the
int value is the number of the corresp signal. However, this number appears to
be a real POSIX signal number, i.e. it is not compatible with constants declared
in Sys. Thus, it is impossible to check correctly, at the OCaml level, which
signal caused process termination.

Proposed solution: implement a function which is the inverse of
caml_convert_signal_number, and apply it in Unix.wait and Unix.waitpid before
returning a WSIGNALLED or WSTOPPED value. (I will provide a patch in a few
days).

@vicuna
Copy link
Author

vicuna commented Apr 17, 2005

Comment author: administrator

Fixed as suggested in trunk (3.09 branch). XL, 2005-04-17

@vicuna vicuna closed this as completed Apr 17, 2005
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant