globus_callback_signal(3)

πŸ“¦
version 18.15 Β· 6 versions
, in epel 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– globus_callback_signal(3) πŸ’–

okay bestie, welcome to the Library Functions Manual page for globus_callback_signal β€” she's giving signal handling, she's giving callbacks, she's lowkey the whole vibe of the Globus Callback Signal Handling situation ✨


🌸 NAME 🌸

globus_callback_signal β€” Globus Callback Signal Handling

  • Globus Callback Signal Handling. (yes she says it twice, she's that confident πŸ’…)

✨ SYNOPSIS ✨

πŸŽ€ Miscellaneous πŸŽ€

  • globus_result_t globus_callback_space_register_signal_handler (int signum, globus_bool_t persist, globus_callback_func_t callback_func, void *callback_user_arg, globus_callback_space_t space) β€” fire off a callback the moment the signal you asked for shows up. main character notification energy πŸ””
  • globus_result_t globus_callback_unregister_signal_handler (int signum, globus_callback_func_t unregister_callback, void *unreg_arg) β€” unregister a signal handling callback. it's giving "we're done here" πŸ’…
  • void globus_callback_add_wakeup_handler (void(*wakeup)(void *), void *user_arg) β€” register a wakeup handler with the callback library. hey bestie, wake up β˜€οΈ
  • #define GLOBUS_SIGNAL_INTERRUPT β€” the macro, she's here, she's iconic ✨

Detailed Description

Globus Callback Signal Handling. periodt. 🫢


πŸ¦‹ Macro Definition Documentation πŸ¦‹

#define GLOBUS_SIGNAL_INTERRUPT

Use this to trap interrupts (SIGINT on unix, iykyk). And in the future? she's gonna also map to handling ctrl-C on win32. not yet, but soon, manifesting it 🌈


πŸ’œ Function Documentation πŸ’œ

void globus_callback_add_wakeup_handler (void(* wakeup )(void *), void * user_arg)

Register a wakeup handler with the callback library. ngl this is really only needed in non-threaded builds, but for cross builds you should be using it everywhere that a callback might sleep for an extended period of time. no cap. 😴

An example use is for an io poller that sleeps indefinitely on select(). So like, if the callback library receives a signal that it needs to deliver asap, it will call the wakeup handler(s). These wakeup handlers must run as though they were called from a signal handler (so pls don't use any thread utilities, that's a red flag 🚩). The io poll example will likely write a single byte to a pipe that select() is monitoring. cute, efficient, slay.

This handler will not be unregistered until the callback library is deactivated (via common). she's committed fr fr πŸ’–

Parameters

  • wakeup β€” function to call when the callback library needs you to return asap from any blocked callbacks.
  • user_arg β€” user data that will be passed along in the wakeup handler.

globus_result_t globus_callback_space_register_signal_handler (int signum, globus_bool_t persist, globus_callback_func_t callback_func, void * callback_user_arg, globus_callback_space_t space)

Fire a callback when the specified signal is received. okay so heads up: there's a tiny delay between the time this call returns and the signal is actually handled by this library. so if the signal arrived the exact instant the call returned, it will likely be lost 😭. (this is normally not an issue though, since you'd be calling this in your startup code anyway β€” no stress bestie.)

Parameters

  • signum β€” the signal to receive. but bestie, listen, the following signals are not allowed: SIGKILL, SIGSEGV, SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGIOT, SIGPIPE, SIGEMT, SIGSYS, SIGTRAP, SIGSTOP, SIGCONT, and SIGWAITING. do not try it. it's giving forbidden πŸ’€
  • persist β€” if GLOBUS_TRUE, keep this callback registered for multiple signals. if GLOBUS_FALSE, the signal handler will automatically be unregistered once the signal has been received. one and done πŸŽ€
  • callback_func β€” the user func to call when a signal is received.
  • callback_user_arg β€” user arg that will be passed to callback.
  • space β€” the space to deliver callbacks to.

Returns

  • GLOBUS_CALLBACK_ERROR_INVALID_SPACE
  • GLOBUS_CALLBACK_ERROR_INVALID_ARGUMENT
  • GLOBUS_SUCCESS otherwise ✨

globus_result_t globus_callback_unregister_signal_handler (int signum, globus_callback_func_t unregister_callback, void * unreg_arg)

Unregister a signal handling callback. the breakup text, but make it API πŸ“΅

Parameters

  • signum β€” the signal to unregister.
  • unregister_callback β€” the function to call when the callback has been canceled and there are no running instances of it (may be NULL). This will be delivered to the same space used in the register call.
  • unreg_arg β€” user arg that will be passed to callback.

Returns

  • GLOBUS_CALLBACK_ERROR_INVALID_ARGUMENT β€” if this signal was registered with persist == false, then there is a race between a signal actually being caught and therefore automatically unregistered, and the attempt to manually unregister it. If that race occurs, you will receive this error just as you would for any signal not registered. it's giving chaos, watch out πŸ˜΅β€πŸ’«
  • GLOBUS_SUCCESS otherwise πŸ’š

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for globus_common from the source code. (so if the vibes are immaculate, thank the source code, not me 🫢)


okay that's the whole page, bestie, you ate that πŸŒˆπŸ’… β€” this lil manual came to you from globus_common, Version 18.15, and she's the globus_callback_signal(3) page, so go forth and register those signal handlers responsibly. mwah! πŸ’–πŸŽ€πŸ¦‹