Thread: Far pointers in unix

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    22

    Far pointers in unix

    Hi,
    Can anyone tell how should i use far pointers in unix.
    If far pointer is not available,
    Is there any other mechanism to acheive that.

    Thanks
    by
    A.Sebasti

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    The keyword 'far' is obsoleted by 32bit integers (and thus, pointers). The word 'far' is only ever used on 16bit-integer compilers. Just use pointers as normal, and omit 'far'.

    Quzah.

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    22

    Reply

    Hi,
    Thanks for your solution.
    I have tried that one also but i am not able to achive the task.

    The situation is like this.
    I am forking many processes.
    The variable(actually the address of it) that i have created by parent process should be available to the children also.
    Any approach is welcomed.

    Thanks
    By
    A.Sebasti...

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > The variable(actually the address of it) that i have created by parent process should be available to the children also.
    Then you haven't understood how fork works - each process has its own address space which only "looks" identical at the moment of fork.

    As soon as either process writes to their respective data spaces, they diverge, and the change is not reflected in the data space of the other process.

    You need to look up shared memory if you want to do this.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sorting number
    By Leslie in forum C Programming
    Replies: 8
    Last Post: 05-20-2009, 04:23 AM
  2. moving pointers to pointers
    By Benzakhar in forum C++ Programming
    Replies: 9
    Last Post: 12-27-2003, 08:30 AM
  3. pointers to pointers within structs
    By Lord_azrael99 in forum C Programming
    Replies: 2
    Last Post: 08-28-2003, 04:29 AM
  4. Pointers program
    By Jamina in forum C++ Programming
    Replies: 3
    Last Post: 08-06-2003, 02:31 PM
  5. delete and delete[]
    By Hunter2 in forum C++ Programming
    Replies: 13
    Last Post: 06-26-2003, 04:40 AM