Getting symbols from /etc/lddrv/wind (was Re: sockets & ptys)

Lenny Tropiano lenny at icus.islp.ny.us
Tue Aug 8 12:11:22 AEST 1989


In article <2229 at umbc3.UMBC.EDU> alex at umbc3.umbc.edu.UMBC.EDU (Alex S. Crain) 
writes:
|>In article <637 at holin.ATT.COM> bes at holin.ATT.COM (Bradley Smith) writes:
|>
|>>Now a question. I want select to work on the /dev/window as well
|>>(like stdin, stdout) but you can't access data in other loadable
|>>devices.  I thought of find out what address the struct tty is at
|>>and looking at it that way.  Does anyone have an idea?
|>
|>	You can access data in loadable devices, *if you know the address*.
|>One way of doing this is to link with /etc/lddrv/ifile.wind and assume that
|>this info will not change. Another way would be to have uipcinit() read
|>/etc/lddrv/ifile.wind (yuk). Since its reasonable to assume that wind.o
|>will always be the first driver loaded, then there is no reason that the
|>addresses should change, ever, so using that ifile is a reasonably good
|>way of doing it. You could justify it by assuming that the window driver 
|>will someday be replaced, so this is only temporary :-).
|>
|>	ld -r -o uipc.o /etc/lddrv/ifile.wind *.o 
|>

Why not use nlist(3C)?  That's what it was made for!   All you need
to do is to set up a struct nlist with all the symbols (assuming you know
the symbol name [which can be gotten with nm or looking at the ifile.wind])
you need and then call nlist("/etc/lddrv/wind",&nl) ...

The symbol and their appropriate addresses are returned right there
for you.  Then you can do what you need with them ...

-Lenny
-- 
Lenny Tropiano             ICUS Software Systems         [w] +1 (516) 589-7930
lenny at icus.islp.ny.us      Telex; 154232428 ICUS         [h] +1 (516) 968-8576
{ames,talcott,decuac,hombre,pacbell,sbcs}!icus!lenny     attmail!icus!lenny
        ICUS Software Systems -- PO Box 1; Islip Terrace, NY  11752



More information about the Unix-pc.general mailing list