🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.unix
Article #9

Re: Ramdisk Problem

#9
From: User
Date: Wed, 04 Feb 1998 00:00
35 lines
1535 bytes
Saurav Chatterjee wrote:
> 
> I have some software that uses the standard Unix I/O read()
> and write() calls. Normally, these will get linked with
> the system calls in libc.a.
> 
> I want to write my own read() and write() routines that
> will intercept certain file descriptors, while passing
> others to the standard read() and write() calls.
> 
> For example, if foo.c has this code:
> 
> {
>  ...
>  n = read (...);
>  ...
> }
> 
> I want to write a read() routine that will be called from
> foo.c. My read() routine will then need to call the read()
> routine in libc.a (this last part is what makes it tricky).
> 
> Constraints: I cannot modify the libc.a file. I don't want
> to modify the name of the read() function in foo.c
> 
> Any solutions?
> 


What about 
#define read __read__
in the header file that defines the interface to your RAM disk?

Dima.
Technical Details
Message-ID: <34D945BE.4D52@ptc.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <34C7A30C.AA7@erg.sri.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,f9e5cbd8478f99,start
X-Google-Attributes: gid11318c,public
X-Google-Thread: ff469,f9e5cbd8478f99,start
X-Google-Attributes: gidff469,public
From: User <user%nunivak@ptc.com>
Subject: Re: Ramdisk Problem
Date: 1998/02/04
Message-ID: <34D945BE.4D52@ptc.com>
X-Deja-AN: 322212281
Content-Transfer-Encoding: 7bit
References: <34C7A30C.AA7@erg.sri.com>
To: Saurav Chatterjee <saurav@erg.sri.com>
Content-Type: text/plain; charset=koi8-r
Organization: My organization
MIME-Version: 1.0
Reply-To: tuser%nunivak@ptc.com
Newsgroups: comp.os.unix,gnu.gcc.help