Xref: utzoo comp.sys.att:7223 unix-pc.general:3519 Path: utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!cica!gatech!rayssd!icus!lenny From: lenny@icus.islp.ny.us (Lenny Tropiano) Newsgroups: comp.sys.att,unix-pc.general Subject: Getting symbols from /etc/lddrv/wind (was Re: sockets & ptys) Summary: why not use nlist(3C)? Message-ID: <945@icus.islp.ny.us> Date: 8 Aug 89 02:11:22 GMT References: <637@holin.ATT.COM> <2229@umbc3.UMBC.EDU> Reply-To: lenny@icus.islp.ny.us (Lenny Tropiano) Organization: ICUS Software Systems, Islip, New York Lines: 35 In article <2229@umbc3.UMBC.EDU> alex@umbc3.umbc.edu.UMBC.EDU (Alex S. Crain) writes: |>In article <637@holin.ATT.COM> bes@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@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