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

Implement platform-independent signal lists #1206

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Mar 9, 2023

  1. Implement compile-time sorting of the signal list

    It is possible to get the list of signals with their associated signal
    numbers in a platform-agnostic way using just the C preprocessor.
    However, the preprocessor is nor able to sort the list by signal
    number. Three solutions are viable:
    1. Leave the list unsorted, or sort by signal name.
    2. Sort the list on program startup.
    3. Sort the list at compile-time using gross hacks.
    
    In the discussion of bug htop-dev#1200, a preference for compile-time sorting
    emerged. To do that, a two-step approach is needed: A C source with
    the signal definitions is preprocessed, the output filtered through
    `sed` and `sort` and then included from another, final, C source file.
    
    As of this commit, the created list does not replace signal lists in
    from the `Platform.c` files in individual platform subdirectories, and
    therefore is not used in the final binary.
    vidraj committed Mar 9, 2023
    Configuration menu
    Copy the full SHA
    b48e6d0 View commit details
    Browse the repository at this point in the history
  2. Replace platform signal lists by a universal one

    Previously, each platform hardcoded its own signal list. However, at
    least on Linux, the signal numbers and even the available names vary
    between architectures, requiring a more clever approach. A platform
    independent code now replaces the individual lists for all platforms.
    
    This may cause minor changes in the UI. For example, Solaris used to
    display duplicate signal names as "22 SIGPOLL/IO", but now the panel
    will show two entries, "22 SIGIO" and "22 SIGPOLL", matching behavior
    on other platforms.
    
    Fixes htop-dev#1200
    vidraj committed Mar 9, 2023
    Configuration menu
    Copy the full SHA
    e33651a View commit details
    Browse the repository at this point in the history