Controlling terminal of a process

Can anyone tell me how to get the name of the controlling terminal for
given process programmatically. I know I can use ps from a shell and
ctermid() and ttyname() from a process to get its OWN controlling
terminal, but how about the controlling terminal for another process?

Thanks for any help.

Regards

William Morris
wrm@innovation-tk.com

if it will help you can use attached utility

“William Morris” <wrm@innovation-tk.com> wrote in message
news:9lqikh$s6t$1@inn.qnx.com

Can anyone tell me how to get the name of the controlling terminal for
given process programmatically. I know I can use ps from a shell and
ctermid() and ttyname() from a process to get its OWN controlling
terminal, but how about the controlling terminal for another process?

Thanks for any help.

Regards

William Morris
wrm@innovation-tk.com

// wbr



begin 666 sidinfo.tar.gz
M’XL("/KN@CLW-I9&EN9F\N=&%R`.PZ"W13QY4C6;;DQ\>&D$U(0GFX`BSC MCXP--C8$J&T2IX"%/\+A$T5(LO5 >E*D)Q.:L#61:2UD4G:A;!)B-BY.EZ1L MLINR"0N40/!)X;3=A;3Y;)ONX9S5GK4+/<WOM/2S>.^=>4_2DV5CR&>;W0Q( M>C/WSMSOW#MOKKUV02QV^/WD4VQFLWEA>3F/O]!2?TO-\Q>8>7-%6;EYP<** M^:45O+ET?L7",H!_FDPI+124[ %@1;"+7[.WCXX7\/FDL=9)%>YSTK@O"Z+# M$W*Z^,5!R>D1-A6[[U:/";[4H8 @MJO'0J(`F.HQ5R @ID[=%BS9X@J(+L_( M<7]0$-O2X <%9WI AP/'.)<8\O*/<-DUJVIMJQM6UQ6R1TMC0XVMOC:YMWKY M*@5:U]C8T,AMK^8XL+XD.'A1<-HD?K7/Z:IW5BN#?CKX5<JP17 FL 51&5XN M27:'.[_#)SA-R 5 LK,#KF#((U5#KXW/9VORLY;P[2X)R.2;*"*%Y<?7YI?P M#XD/VSH<-CM;D4TKI(Q;0(Y2<*I",\R%A8I*V1(R(9AK!F+9VWF7)^ABD#8_ M&$EJRP>K@!T*\QB??(<0D$)V#^\0`HZ0(/&2C[<$? X><'R!*GYV<(.85P@& MIOU\:D&3J5I%JJB4TN*2R26+H7",6"K^8$K )84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EC/)]K,_%8UW6Y MVDXN.0,;X.X14SN;2:$M D’RH(H6X[=36S3$.-ZK]-3G!=JK7G/LMYQL=L
M]PBH8%U
\R2".::>L?)E/3;L[;K%C(= YVC3T+83"LC54SUZ/[7ABY.!LL G
M6,@Z[T^:9J’EX7!OZB,IPBD7-O#6
<E(D/TFDMW’Q0W]U!VN11](JNZV2
M-6Q3*MD;0CI_/;=E03+78XBTVXTP*]J;_N^SGVA%>7D;&E)] -PWRKKP<6P M_/GR;:.6W0W<B;LUG+3<$B2'8]1.0=XE$[PG;_HI@+K-WFD&*R2<:\<[$]63 M]8[N;ZAP>LVU"],+H.]C^SH_')PO-/2PX"S9#^%%;7.2V"Z15@@T*3^AESM& MWW,#H#FS\;HI'N;-C!@VK3C/JU@!&V3>D^[0%URG'@$PCN]WEX%'TVB@?3O! M;3?62Q'&U33$_*T4=#% I8S5\EG??%[F"\#HPD;J*P&<-AJ8^K.8(]2)\]OI M)?%_P(]^#O,_/,??^_XWVSGCQO=_SFPG?O_WT,SOOO_]A_S^+WVS][]-B^]^ 3W_V^^WWW^__T^V]A4E[1&X`````
`
end

“ian zagorskih” <ianzag@novosoft-us.com> wrote in message
news:9lu2p0$5ii$1@inn.qnx.com

if it will help you can use attached utility

ups, sorry, there’s a little mistake. this should be better :slight_smile:

“William Morris” <> wrm@innovation-tk.com> > wrote in message
news:9lqikh$s6t$> 1@inn.qnx.com> …
Can anyone tell me how to get the name of the controlling terminal for
given process programmatically. I know I can use ps from a shell and
ctermid() and ttyname() from a process to get its OWN controlling
terminal, but how about the controlling terminal for another process?

Thanks for any help.

Regards

William Morris
wrm@innovation-tk.com

// wbr



begin 666 sidinfo.tar.gz
M’XL(" 7R@CLW-I9&EN9F\N=&%R`.U8>V_;1@S?O]:G8+TFD1W9D>,TP>RD M19''8"QKC'HI"K2%H4BR?8MT<J5STF[-=Q_OI9?EM$L?P 8?@EC'XY$\\D<> MI= AM.W.YS]]QV';]O[>'O!?'.5?^^# /@#[H+MG/SFP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