Functions | |
L4_CV int | LOG_channel_open (int channel, l4_fpage_t fpage) |
Open a binary output channel. | |
L4_CV int | LOG_channel_write (int id, unsigned off, unsigned size) |
Send data to a binary output channel. | |
L4_CV int | LOG_channel_flush (int id) |
Wait until data is sent by the logserver. | |
L4_CV int | LOG_channel_close (int id) |
Close a binary output channel. |
L4_CV int LOG_channel_close | ( | int | id | ) |
Close a binary output channel.
This function removes the mapping and decrements the reference counter to an open binary output channel at the logserver. If the reference counter becomes 0, the channel is actually closed, i.e. the resources are freed in the logserver.
id | id of the connection as returned from LOG_channel_open() |
0 | no error | |
<0 | in the case of error |
id | connection identifier |
Definition at line 116 of file logchannel.c.
L4_CV int LOG_channel_flush | ( | int | id | ) |
Wait until data is sent by the logserver.
This function waits until the prior write-request is fulfilled and the according memory in the mapped fpage can be reused.
id | id of the connection as returned from LOG_channel_open() |
0 | no error | |
<0 | in the case of error |
id | connection identifier |
Definition at line 92 of file logchannel.c.
L4_CV int LOG_channel_open | ( | int | channel, | |
l4_fpage_t | page | |||
) |
Open a binary output channel.
This function opens a binary output channel at the logserver. Multiple clients/programs can send data to the same output channel at the logserver, the output is merged then. To do so, the clients must specify the same channel nr when opening. A reference counter holds the number of clients that opened that channel. Channel 1 is used for sending the standard logging text on, using it for sending binary data is not recommended.
The caller of this function must specify a flexpage which is mapped to the logserver. This flexpage is used for transfering data later when using LOG_channel_write().
channel | channel nr of the channel to open | |
fpage | a flexpage that will later be used for writing data. The flexpage must contain pinned pages prior to calling this function. The flexpage must not exceed 2MB in its size. |
>=0 | the id of the connection to use later | |
-L4_ENOMEM | the specified fpage exceeded the maximum size | |
-L4_ENOMAP | if the server did not have a free area to receive the fpage or is otherwise short on resources | |
-L4_EIPC | some problem with server communication occured | |
-L4_EBUSY | the server is configured using normal mode, not multiplexed mode for TCP-output. Sending binary data to the client requires multiplexed output. See The LOG Server on how to configure multiplexed mode. |
channel | the channel to open | |
page | an fpage containing buffer memory used with LOG_channel_write() later |
Definition at line 35 of file logchannel.c.
L4_CV int LOG_channel_write | ( | int | id, | |
unsigned | off, | |||
unsigned | size | |||
) |
Send data to a binary output channel.
This function sends data to an open binary output channel at the logserver. This function does not wait until the data is actually sent. Therefore, you should not overwrite the data beeing sent, until a subsequently call to LOG_channel_flush() returns.
Multiple clients/programs can send to the same output channel at the logserver, the output is merged then. It is ensured, that data of different calls to LOG_channel_write() does not intercept each other. When multiple clients/programs use the same channel, it is recommended to use an additional encapsulation to demultiplex the data lateron.
id | id of the connection as returned from LOG_channel_open() | |
off | offset of the data in the flexpage provided on LOG_channel_open() | |
size | number of bytes to write |
0 | no error | |
<0 | in the case of error |
id | connection identifier | |
off | offset of data in the connection buffer | |
size | size of data to write |
Definition at line 68 of file logchannel.c.