Write a Wrapper function for open () , read()

  • davidron
  • Born
  • Born
  • davidron
  • Posts: 2

Post 3+ Months Ago

Hi ,

I'm requested to write wrapper function for open() and read() in Linux .
I've tried to search the web regarding how to that, but couldn't find anything worthwhile .
So , can anyone please give me some hints how to do that ?

I need to use "errno" to the correct value , if the system call fail .
I've check the tutorial on your site , very nice , BTW , but still I'd appreciate any help.

Regards,
David
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6243
  • Loc: Seattle, WA

Post 3+ Months Ago

A little more info would be helpful here. What language are you using? What is the wrapper supposed to do?
  • davidron
  • Born
  • Born
  • davidron
  • Posts: 2

Post 3+ Months Ago

spork wrote:
A little more info would be helpful here. What language are you using? What is the wrapper supposed to do?



I'm requested to implement wrapper functions for open(), read(), write(),
close() and fork() system calls.
If the system call failed, the wrapper should set the value of errno correctly.

The output should produce a static library (or archive) with a name-
libmywrapper.a.

I've written quite a lot in C and C++ in my courses , however I have no idea how to
do this task .

Please notice ,that I'm not asking you to solve my homework , what I'm asking for is
any information and/or directions that you can advise me with .


Furthermore , I cannot call the libc wrappers, i.e., I'm not allowed to call open(), read(),
write(), close(), fork(), syscall() or any other system call in my code (to be).

Much appreciated ,

David

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 58 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.