Nicolas Setton da3b3cfc24 Merge pull request #17 from AdaCore/topic/addresssanitizer_mode
Add a build mode for AddressSanitizer
2021-08-27 11:18:18 +01:00
2020-12-24 22:35:16 +02:00
2020-11-20 11:25:36 +02:00
2020-11-20 12:18:57 +02:00
2020-12-24 22:35:16 +02:00
2020-11-20 12:18:57 +02:00

Ada Process API (spawn)

Build

This library provides simple API to spawn processes and communicate with them. We provide two implementations of the same API - the integrated into Glib event loop and the independent.

Install

Using alire

Run alr get --build spawn or alr get --build spawn_glib.

Build from sources

Run

make all install PREFIX=/path/to/install

Usage

  1. Add with "spawn"; or with "spawn_glib"; to your project file.
  2. Create a process object:
    P : Spawn.Processes.Process;
    
  3. Assign program name
    P.Set_Program ("/bin/bash");
    
  4. (Optional) Assign command line arguments, working directory, environments variables.
  5. Assign an event listener
    P.Set_Listener (L'Unchecked_Access);
    
  6. Start the process:
    P.Start;
    
  7. (Glib independent) With no event loop integration you should drive it by you-self periodically calling
    Spawn.Processes.Monitor_Loop (1);
    

The listener will get these events:

  • Standard_Output_Available
  • Standard_Error_Available
  • Standard_Input_Available
  • Started
  • Finished
  • Error_Occurred
  • Exception_Occurred

See an example in the spawn test

Maintainer

AdaCore

Contribute

Feel free to dive in! Open an issue or submit PRs.

License

GPL with GCC RTL Exception © AdaCore

Description
No description provided
Readme 494 KiB
Languages
Ada 98.8%
C 0.7%
Makefile 0.5%