src example: send message from parent to child process - Minix

This is a discussion on src example: send message from parent to child process - Minix ; I wrote simple program, that create child process by fork() and send message by send() to child process. But child process not receive message from parent frocess. I.e. send() and receive() return -105, but errno is equal zero. I think ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: src example: send message from parent to child process

  1. src example: send message from parent to child process

    I wrote simple program, that create child process by fork() and send
    message by send() to child process. But child process not receive
    message from parent frocess. I.e. send() and receive() return -105,
    but errno is equal zero.

    I think that send() and receive() message is failed, because I fiiling
    ->m_type and ->m_source(and other fields) value of this fields is
    different in parent and child process.

    I need simple example that demonstarte how send/receive mesage in
    Minix3.

    What doc I can read for understanding how send/receive message between
    process in Minix3?

    Thank you all.

  2. Re: src example: send message from parent to child process

    Take my please doc that contain describe fields of 'message' typedef.

    I was use

    Simple program is not compiled by cc and gcc if it contain ipc_send()
    and ipc_receive() functions.

  3. Re: src example: send message from parent to child process

    > What doc I can read for understanding how send/receive message between
    > process in Minix3?


    These functions are not meant for user process IPC, but rather for
    system calls and calls between system processes. Since your processes
    are not allowed to use them they will always fail.

    IPC in Minix is fairly limited (for example shared memory and
    semaphores are missing), but the standard Unix primitives (pipes,
    signals and sockets) exist.

    For communication between parent and child processes, anonymous pipes
    (as created by the pipe() function) are generally the easiest and most
    light-weight way to do IPC.

    --
    With kind regards,
    Erik van der Kouwe

  4. Re: src example: send message from parent to child process

    On 30 อมา, 22:42, "Erik van der Kouwe" few.vu.nl> wrote:
    > > What doc I can read for understanding how send/receive message between
    > > process in Minix3?

    >
    > These functions are not meant for user process IPC, but rather for
    > system calls and calls between system processes. Since your processes
    > are not allowed to use them they will always fail.
    >
    > IPC in Minix is fairly limited (for example shared memory and
    > semaphores are missing), but the standard Unix primitives (pipes,
    > signals and sockets) exist.
    >
    > For communication between parent and child processes, anonymous pipes
    > (as created by the pipe() function) are generally the easiest and most
    > light-weight way to do IPC.
    >
    > --
    > With kind regards,
    > Erik van der Kouwe


    Thank you. Can you print list of IPC that I can use for echange data
    between process?
    What doc contain list for user IPC of Minix3?
    I glad that Minix3 not support semphores and shared memory, because I
    did like debug software with it. Also I sure that semaphores and
    shared memory is can't help for verification software.

  5. Re: src example: send message from parent to child process

    > Thank you. Can you print list of IPC that I can use for echange data
    > between process?
    > What doc contain list for user IPC of Minix3?


    These are all I know:

    - Anonymous pipes (only between related processes), pipe function
    - Files, open function and other file primitives
    - Named pipes, mkfifo function and file primitives
    - Signals (no data, just notification), kill and signal or sigaction
    - Sockets (also for remote processes), socket and related functions;
    STREAM sockets for full-duplex streams and DGRAM sockets for message
    passing and broadcasting

    Check out the Minix man pages for these functions to find out how they
    work (all these are Posix functions, so googling for them will also
    help).

    --
    With kind regards,
    Erik van der Kouwe

+ Reply to Thread