Operating systems, development tools, and professional services
for connected embedded systems
for connected embedded systems
![]() |
![]() |
![]() |
![]() |
procmgr_session()
Provide process manager session support
Synopsis:
#include <sys/procmgr.h>
int procmgr_session( uint32_t nd,
pid_t sid,
int id,
unsigned event);
Arguments:
The interpretation of the arguments depends on the event.
- nd
- A node descriptor.
- sid
- A session ID.
- id
- A file descriptor, process group, or signal, depending on the event.
- event
- The event; one of:
- PROCMGR_SESSION_TCSETSID
- PROCMGR_SESSION_SETSID
- PROCMGR_SESSION_SETPGRP
- PROCMGR_SESSION_SIGNAL_PID
- PROCMGR_SESSION_SIGNAL_PGRP
- PROCMGR_SESSION_SIGNAL_LEADER
For more information, see below.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The procmgr_session() function provides session support to character device terminal drivers in their resource managers, C library functions, and session management applications.
The arguments that you provide need to match the event:
- PROCMGR_SESSION_TCSETSID
- Used by the tcsetsid() function to set the file descriptor, id, to be the controlling terminal for the session headed by the session leader, sid.
- PROCMGR_SESSION_SETSID
- Used by the setsid() function to create a new session with the calling process becoming the session leader. Pass zero for both sid and id arguments.
- PROCMGR_SESSION_SETPGRP
- Used by a character device resource manager to change the process group upon the request of a client calling the tcsetpgrp() function. Set the sid argument to the client's current session and the id argument to the new target process group for the client.
- PROCMGR_SESSION_SIGNAL_PID, PROCMGR_SESSION_SIGNAL_PGRP, PROCMGR_SESSION_SIGNAL_LEADER
- Used by a character device resource manager to drop a signal of the type specified as the id argument (generally a terminal/job control signal) on the appropriate member of the session specified by the sid argument.
Returns:
- 0
- Success.
- -1
- Failure.
Classification:
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | No |
| Thread | Yes |
See also:
setsid(), tcsetpgrp(), tcsetsid()
![]() |
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)