Find the answer to your Linux question:
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 ...
  1. #1
    Just 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?

  2. #2
    Linux 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.

  3. #3
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    I never understood why people use strange stuff which will cause portability problems.
    i92guboj, 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. :)

    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:
    Code:
    man -a malloc
    man -a realloc
    man -a free
    If man pages are not installed on your system, google for each of these:
    Code:
    man malloc linux
    man realloc linux
    man free linux
    Hope this helps.
    --
    Bill

    Old age and treachery will overcome youth and skill.

  4. #4
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by wje_lf View Post
    i92guboj, 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.
    Sorry, I did not want to imply that. It was a generic comment that wasn't aimed directly at him. That was not my intention at all.

  5. #5
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    Peace. :)
    --
    Bill

    Old age and treachery will overcome youth and skill.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...