get information on a segment owned by a given process
#include <sys/seginfo.h> unsigned qnx_segment_info( pid_t proc, pid_t pid, unsigned segment, struct _seginfo *buf );
The qnx_segment_info() function allows you to get information on segment segment owned by process pid. The information is placed in buf. This information includes the segment's location, its size in bytes and its access flags.
If proc is equal to zero or PROC_PID, pid is assumed to be local on this node. To obtain information on a process on another node, proc should be a virtual circuit to that node and pid should be the local process ID on that node.
The _seginfo() structure contains at least the following members:
Take care if this address is passed to qnx_segment_overlay(), since it assumes a physical address. The qnx_segment_overlay_flags() function allows you to specify either a physical or virtual address. |
A segment number on success. On error, it returns -1, and errno is set.
#include <i86.h> #include <stdio.h> #include <sys/seginfo.h> void main() { struct _seginfo buf; unsigned char msg[100]; unsigned seg; seg = FP_SEG( msg ); qnx_segment_info( 0, 0, seg, &buf ); printf( "Seg %4.4x Offset %8.8lx Size %ld\n", buf.selector, buf.addr, buf.nbytes ); }
QNX
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | Yes, but modifies errno |
Thread | Yes |
errno, qnx_segment_alloc(), qnx_segment_alloc_flags(), qnx_segment_arm(), qnx_segment_flags(), qnx_segment_free(), qnx_segment_get(), qnx_segment_huge(), qnx_segment_index(), qnx_segment_overlay_flags(), qnx_segment_overlay(), qnx_segment_put(), qnx_segment_raw_alloc(), qnx_segment_raw_free(), qnx_segment_realloc()