Exemple #1
0
char *procname(void) {
    if ((ps.flags & _PPF_TERMING) != 0)
	return "<defunct>";
    else if ((ps.flags & _PPF_VID) == 0)
	return ps.un.proc.name;
    else {
	static struct _psinfo vc;
	pid_t vd;

	if ((vd = qnx_vc_attach(ps.un.vproc.remote_nid, PROC_PID, sizeof vc, 0)) == -1 ||
	    (qnx_psinfo(vd, ps.un.vproc.remote_pid, &vc, 0, 0) != ps.un.vproc.remote_pid)) {
	    qnx_vc_detach(vd);
	    return "*";
	}
	qnx_vc_detach(vd);
	return vc.un.proc.name;
    }
}
Exemple #2
0
int FileSysNeedsCR( int handle )
{
    struct _fd_entry    fd_info;
    struct _psinfo      ps_info;
    pid_t               dos_pid;

    if( qnx_fd_query( 0, 0, handle, &fd_info ) != handle ) return( 0 );
    dos_pid = qnx_name_locate( fd_info.nid, "qnx/dosfsys", 0, NULL );
    if( dos_pid == -1 ) return( 0 );
    if( qnx_psinfo( PROC_PID, dos_pid, &ps_info, 0, NULL ) != dos_pid ) return( 0 );
    if( ps_info.flags & _PPF_VID ) {
        qnx_vc_detach( dos_pid );
        dos_pid =  ps_info.un.vproc.remote_pid;

    }
    return( dos_pid == fd_info.pid );
}