Results 1 to 5 of 5
Which system calls are used to create a buffer in linux........
i m searching for functions similar to
getbuffer()
freebuffer()
getbufferID()
etc in linux
This buffer is to be shared ...
- 04-04-2008 #1Just Joined!
- Join Date
- Mar 2008
- Posts
- 13
Buffer Creation
Which system calls are used to create a buffer in linux........
i m searching for functions similar to
getbuffer()
freebuffer()
getbufferID()
etc in linux
This buffer is to be shared by multiple threads.
how do i proceed?
- 04-04-2008 #2Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
A buffer is anything that stores data and can be accessed with an index. I never understood why people use strange stuff which will cause portability problems.
Why not just use an array (if it's of a fixed size) or malloc/realloc if you need to dynamically size it? Anyway, if you love those names or something, you can wrap malloc into functions with those names if you need a more specific behavior.
- 04-04-2008 #3i92guboj, I don't think that Mugdha wants to use any sort of strange stuff. I think he's just new here, and wants to know how we normally do things. :)I never understood why people use strange stuff which will cause portability problems.
Mugdha, i92guboj is correct. Use the functions malloc() and (if you need it) realloc() for your memory needs. Use free() to free memory you no longer need.
For information on how these functions work, enter each of these commands at the command line:
If man pages are not installed on your system, google for each of these:Code:man -a malloc man -a realloc man -a free
Hope this helps.Code:man malloc linux man realloc linux man free linux
--
Bill
Old age and treachery will overcome youth and skill.
- 04-04-2008 #4Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
- 04-04-2008 #5
Peace. :)
--
Bill
Old age and treachery will overcome youth and skill.


Reply With Quote
