Interface ChildWatchFunc

All Superinterfaces:
FunctionPointer
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @Generated("org.javagi.JavaGI") public interface ChildWatchFunc extends FunctionPointer

Functional interface declaration of the ChildWatchFunc callback.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    run(Pid pid, int waitStatus)
    Prototype of a GChildWatchSource callback, called when a child process has exited.
    Creates a native function pointer to the upcall(int, int, MemorySegment) method.
    default void
    upcall(int pid, int waitStatus, MemorySegment userData)
    The upcall method is called from native code.
  • Method Details

    • run

      void run(Pid pid, int waitStatus)

      Prototype of a GChildWatchSource callback, called when a child process has exited.

      To interpret waitStatus, see the documentation for GLib.spawnCheckWaitStatus(int). In particular, on Unix platforms, note that it is usually not equal to the integer passed to exit() or returned from main().

      Parameters:
      pid - the process id of the child process
      waitStatus - Status information about the child process, encoded in a platform-specific manner
    • upcall

      default void upcall(int pid, int waitStatus, MemorySegment userData)
      The upcall method is called from native code. The parameters are marshaled and run(Pid, int) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(int, int, MemorySegment) method.
      Specified by:
      toCallback in interface FunctionPointer
      Parameters:
      arena - the arena in which the function pointer is allocated
      Returns:
      the native function pointer