SEND

Purpose

send sends a message to a mailbox.  

Synopsis

#include <types.h>  
#include <stub.h>  

int send(Message_Header *header, char *buffer, int size);  

Parameters

Description

send sends the message pointed by buffer, that is size bytes long, to the mailbox specified by the field to in header 

This system call is normally used by servers to send back a reply to a client service request. Although there is no formal restrictions on its use by clients, the act system call is by far more adequate.  

send verifies the message destination to determine one of the following three cases:   Note that in the last case, the sender blocks only until one of the network server threads executes receive, i. e., there are no delivery guaranties for the message. In network terminology, this implementation of send is synchronous and not confirmed.  

The handling of non-local messages is do entirely outside the kernel by the network server 

Return Values

On success, send returns 0 and the message stored in buffer is delivered to its recipient or to the network server.  

On fail, send returns a negative value indicating one of the following errors:  

See Also

receive, act, Capability, Message_Header, network server  

Notes

The decision of making a blocking send is to avoid buffer handling inside the kernel. In this implementation the message is directly copied to the destination task address space if it is small or shared and marked copy-on-write if it is bigger the a certain value.

send is indeed, act(header, buffer, size, NULL, NULL, NULL).