op_pro_self()

Abstract

Obtains a process handle for the process currently executing.

Syntax

op_pro_self ()
Argument Type Description
no arguments

Return Type

Prohandle

Process handle of the process currently executing. This handle can be used in calls to other KPs in order to perform operations related to this process.

Example

/* Get the pointer to the module wide variables. */
mod_vars = (TP_Global_State *) op_pro_modmem_access ();

/* Obtain a process handle for the current session process. */
local_process_handle = op_pro_self ();

/* Register new process in module-wide data structure and initialize */
/* parent-to-child communication memory.                             */
tp_sess_init (sess_config_ptr, mod_vars, op_pro_id (local_process_handle);

Details

The currently executing process often needs to use a handle for itself as the argument to other KPs in both the Process and Interrupt packages. For instance, this handle may serve as a point of reference to obtain handles for parent processes. Other typical uses include obtaining a process’ unique id, and having a process destroy itself when it is no longer useful.

Purpose

Provides a process handle for the process that called this KP. This handle is a required argument of many other KPs in the Process and Interrupt packages.

Errors

  • Program Abort: KP requires process context.

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com