On Wed, Jul 21, 2021, 11:48 AM gogineni kailashnath <
[email protected]> wrote:
> Hello,
>
> I have a C code, which creates a file *file.txt* and prints the hello
> world content in the file.
>
> #include<stdio.h>
>
> int main () {
> FILE *fp;
> char str[] = "Hello world";
>
> fp = fopen( "file.txt" , "w" );
> fwrite(str , 1 , sizeof(str) , fp );
>
> fclose(fp);
>
> return(0);
> }
>
> This binary is compiled in a static form My question is that, since I'm
> using a gem5 simulator in syscall emulation mode. I'm working on linux
> system.
>
> In the hardware level, since we only know the instructions, for example if
> the binary has to open *file.txt*, how can I redirect it to open a
> different file (say *hello.txt*, i.e., for any filename specified, it
> should just trigger hello.txt). Any help would be appreciated.
>
_______________________________________________
gem5-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s