alq alq_open alq_write alq_flush alq_close alq_get alq_post - Asynchronous Logging Queues
An ``asynchronous log entry'' is defined as Vt struct ale , which has the following members:
struct ale { struct ale *ae_next; /* Next Entry */ char *ae_data; /* Entry buffer */ int ae_flags; /* Entry flags */ };
The ae_flags field is for internal use, clients of the interface should not modify this field. Behaviour is undefined if this field is modified.
The
alq_write ();
function writes
Fa data
to the designated queue,
Fa alq .
In the event that
alq_write ();
could not write the entry immediately, and
ALQ_WAITOK
is passed to
Fa waitok ,
then
alq_write ();
will be allowed to
tsleep(9).
The
alq_flush ();
function is used for flushing
Fa alq
to the log medium that was passed to
alq_open (.);
The
alq_close ();
function will close the asynchronous logging queue,
Fa alq ,
and flush all pending write requests to the log medium.
It will free all resources that were previously allocated.
The
alq_get ();
function returns the next available asynchronous logging entry
from the queue,
Fa alq .
This function leaves the queue in a locked state, until a subsequent
alq_post ();
call is made.
In the event that
alq_get ();
could not retrieve an entry immediately, it will
tsleep(9)
with the
``alqget
''
wait message.
The
alq_post ();
function schedules the asynchronous logging entry,
Fa ale ,
which is retrieved using the
alq_get ();
function,
for writing to the asynchronous logging queue,
Fa alq .
This function leaves the queue,
Fa alq ,
in an unlocked state.
Functions
alq_flush (,);
alq_open ();
and
alq_post ();
may attempt to acquire an internal sleep mutex, and should
consequently not be used in contexts where sleeping is
not allowed.
The
alq_write ();
function returns
Er EWOULDBLOCK
if
ALQ_NOWAIT
was provided as a value to
Fa waitok
and either the queue is full, or when the system is shutting down.
The
alq_get ();
function returns
NULL
if
ALQ_NOWAIT
was provided as a value to
Fa waitok
and either the queue is full, or when the system is shutting down.
NOTE: invalid arguments to non-void functions will result in undefined behaviour.
This manual page was written by An Hiten Pandya Aq hmp@FreeBSD.org .
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |