From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,798b134949f679fd,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-11-21 23:27:47 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!gatech!newsxfer.itd.umich.edu!zip.eecs.umich.edu!newshost.marcam.com!charnel.ecst.csuchico.edu!olivea!news.hal.COM!decwrl!tribune.usask.ca!canopus.cc.umanitoba.ca!newsflash.concordia.ca!news.mcgill.ca!sifon.cc.mcgill.ca!duha From: duha@ralph.biomed.mcgill.ca (Jan A. Duha) Newsgroups: comp.unix.osf.osf1 Subject: 64-bit FILE* pointer problem in OSF1 Date: 21 Nov 1994 14:50:50 GMT Organization: McGill University Computing Centre Message-ID: NNTP-Posting-Host: ralph.biomed.mcgill.ca Greetings! I have a question about the implementation of FILE* pointers in OSF1: I'm trying to port a file server program (the "iserver" protocol, for Transputer processors, for those who know) to a DEC Alpha running OSF1 v.2.1. Part of the protocol involves a remote device requesting the server to open a file. The server does this, and returns a FILE* pointer (fp). Whenever the remote device subsequently wants to access the file, it passes the server its fp. Unfortunately, the original protocol design lacked foresight, and hard-coded FILE* pointers as being 32-bits long!! This means that only the lower 4 bytes of the OSF1 fp will get sent to the remote device. I don't have access to the code running on the remote device, and hence can't modify the protocol to support n-bit fp's. I think this limits my options to a bad hack: through much poking around, I've discovered that all fp's (that i've seen so far, anyway) have only 0x3FF in the upper 4 bytes. Thus, if I append this value to all fp's received from the remote device, I can reconstruct the correct pointer. My question, then: is this a valid method? A longer version of the question is: how exactly are fp's implemented in OSF1, and what is the significance of moving from 32-bit to 64-bit pointers for FILE structures? Can I have it guaranteed that the OS will place the pointers in known (constant) locations? (my guess is that since a FILE* pointer is associated to a specific stream, the answer to the last question would be "yes", but i need this confirmed) i appreciate any help (as soon as possible, please), thanks, jan. -- -------------------------------------------------------------------------- jan a. duha Office: Lyman-Duff Bldg duha@ee.mcgill.ca || duha@ralph.biomed.mcgill.ca Room #328 McGill University, Montreal CANADA Phone: 514-398-6734 -- -------------------------------------------------------------------------- jan a. duha Office: Lyman-Duff Bldg duha@ee.mcgill.ca || duha@ralph.biomed.mcgill.ca Room #328 McGill University, Montreal CANADA Phone: 514-398-6734