Methods to set process priority. More...
Go to the source code of this file.
Data Structures | |
| struct | GNUNET_OS_CommandHandle |
| Handle to a command. More... | |
Macros | |
| #define | LOG(kind, ...) GNUNET_log_from (kind, "util-os-priority", __VA_ARGS__) |
| #define | LOG_STRERROR(kind, syscall) GNUNET_log_from_strerror (kind, "util-os-priority", syscall) |
| #define | LOG_STRERROR_FILE(kind, syscall, filename) |
| #define | GNUNET_OS_CONTROL_PIPE "GNUNET_OS_CONTROL_PIPE" |
Functions | |
| static void | shutdown_pch (void *cls) |
| This handler is called on shutdown to remove the pch. | |
| static void | parent_control_handler (void *cls) |
| This handler is called when there are control data to be read on the pipe. | |
| void | GNUNET_OS_install_parent_control_handler (void *cls) |
| Connects this process to its parent via pipe; essentially, the parent control handler will read signal numbers from the GNUNET_OS_CONTROL_PIPE (as given in an environment variable) and raise those signals. | |
| void | GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd) |
| Stop/kill a command. | |
| static void | cmd_read (void *cls) |
| Read from the process and call the line processor. | |
| struct GNUNET_OS_CommandHandle * | GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, void *proc_cls, struct GNUNET_TIME_Relative timeout, const char *binary,...) |
| Run the given command line and call the given function for each line of the output. | |
Variables | |
| static struct GNUNET_SCHEDULER_Task * | pch |
| Handle for the parent_control_handler() Task. | |
| static struct GNUNET_SCHEDULER_Task * | spch |
| Handle for the shutdown_pch() Task. | |
Methods to set process priority.
Definition in file os_priority.c.
| #define LOG | ( | kind, | |
| ... | |||
| ) | GNUNET_log_from (kind, "util-os-priority", __VA_ARGS__) |
Definition at line 31 of file os_priority.c.
| #define LOG_STRERROR | ( | kind, | |
| syscall | |||
| ) | GNUNET_log_from_strerror (kind, "util-os-priority", syscall) |
Definition at line 33 of file os_priority.c.
| #define LOG_STRERROR_FILE | ( | kind, | |
| syscall, | |||
| filename | |||
| ) |
Definition at line 36 of file os_priority.c.
| #define GNUNET_OS_CONTROL_PIPE "GNUNET_OS_CONTROL_PIPE" |
Definition at line 40 of file os_priority.c.
|
static |
This handler is called on shutdown to remove the pch.
| cls | the struct GNUNET_DISK_FileHandle of the control pipe |
Definition at line 59 of file os_priority.c.
References GNUNET_DISK_file_close(), GNUNET_SCHEDULER_cancel(), and pch.
Referenced by GNUNET_OS_install_parent_control_handler().
|
static |
This handler is called when there are control data to be read on the pipe.
| cls | the struct GNUNET_DISK_FileHandle of the control pipe |
Definition at line 76 of file os_priority.c.
References getenv(), GNUNET_assert, GNUNET_DISK_file_close(), GNUNET_DISK_file_read(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_OS_CONTROL_PIPE, GNUNET_SCHEDULER_add_read_file(), GNUNET_SCHEDULER_cancel(), GNUNET_SIGNAL_raise(), GNUNET_TIME_UNIT_FOREVER_REL, LOG, LOG_STRERROR, parent_control_handler(), pch, ret, and spch.
Referenced by GNUNET_OS_install_parent_control_handler(), and parent_control_handler().
|
static |
Read from the process and call the line processor.
| cls | the struct GNUNET_OS_CommandHandle * |
Definition at line 251 of file os_priority.c.
References GNUNET_OS_CommandHandle::buf, cmd_read(), end, GNUNET_DISK_file_read(), GNUNET_NETWORK_fdset_handle_isset(), GNUNET_SCHEDULER_add_read_file(), GNUNET_SCHEDULER_get_task_context(), GNUNET_TIME_absolute_get_remaining(), GNUNET_YES, GNUNET_OS_CommandHandle::off, GNUNET_OS_CommandHandle::proc, GNUNET_OS_CommandHandle::proc_cls, GNUNET_OS_CommandHandle::r, GNUNET_SCHEDULER_TaskContext::read_ready, ret, GNUNET_OS_CommandHandle::rtask, tc, and GNUNET_OS_CommandHandle::timeout.
Referenced by cmd_read(), and GNUNET_OS_command_run().
|
static |
Handle for the parent_control_handler() Task.
Definition at line 45 of file os_priority.c.
Referenced by extract_filename(), GNUNET_OS_install_parent_control_handler(), parent_control_handler(), and shutdown_pch().
|
static |
Handle for the shutdown_pch() Task.
Definition at line 50 of file os_priority.c.
Referenced by GNUNET_OS_install_parent_control_handler(), and parent_control_handler().