📄 esbbcall.9
字号:
'\" tr.\" -*- nroff -*-.\".\" @(#) esbbcall.9,v 1.1.4.1 2004/01/12 23:33:00 brian Exp.\".\" =========================================================================.\".\" Copyright (C) 2001-2004 OpenSS7 Corp. <www.openss7.com>.\".\" All Rights Reserved..\".\" Permission is granted to make and distribute verbatim copies of this.\" manual provided the copyright notice and this permission notice are.\" preserved on all copies..\".\" Permission is granted to copy and distribute modified versions of this.\" manual under the conditions for verbatim copying, provided that the.\" entire resulting derived work is distributed under the terms of a.\" permission notice identical to this one.\" .\" Since the Linux kernel and libraries are constantly changing, this.\" manual page may be incorrect or out-of-date. The author(s) assume no.\" responsibility for errors or omissions, or for damages resulting from.\" the use of the information contained herein. The author(s) may not.\" have taken the same level of care in the production of this manual,.\" which is licensed free of charge, as they might when working.\" professionally..\" .\" Formatted or processed versions of this manual, if unaccompanied by.\" the source, must acknowledge the copyright and authors of this work..\".\" =========================================================================.\".\" Modified 2004/01/12 23:33:00 by brian.\".\" =========================================================================.so lis.macros.R1bracket-label "\fR[\fB" "\fR]" "\fR, \fB"no-default-databasedatabase lis.refsaccumulatemove-punctuationabbreviate Ajoin-authors ", " ", " " and "et-al " et al" 2 3abbreviate-label-ranges ".."sort-adjacent-labels.R2.\".\".TH ESBBCALL 9 "2004/01/12 23:33:00" "LiS-2_16_18-8" "Linux STREAMS DDI/DKI".SH NAME.B esbbcall\- installs a buffer callback for an extended \fISTREAMS\fR message block.SH SYNOPSIS.PP.B #include <sys/stream.h>.HP 8.BI "int " retval " = esbbcall(int " priority ", void (*" function ")(long), long " arg );.SH DESCRIPTION.PPWhen allocation of a message block fails as a result of a failed call to.BR esballoc (9),the service routine should place a.IR STREAMS (4)message that invoked.BR esballoc (9)call back on the queue with.BR putbq (9)and call the.BR esbbcall ()function with the queue's service routine as the.I functionargument and a pointer to the queue as the.I argargument to the call. The.I priorityargument should be the same as the.I priorityargument issued to the.BR esballoc (9)..PPIn this way, the queue service routine will be recalled once there issufficient memory to allocate the requested message block..PPThe arguments to.BR esbbcall ()are interpreted as follows:.TP 12.I priorityThe priority of the requested message. The priority can be one of thefollowing values:.RS.TP 12.B BPRI_LOThe message block needed is for a low priority buffer..TP 12.B BPRI_MEDThe message block needed is for a medium priority buffer..TP 12.B BPRI_HIThe message block needed is for a high priority buffer..PPThe.I priorityargument is ignored by SVR 4.2.[svr42.]and later.IR STREAMS (4)implementations. Thisargument is only used by SVR 3.[svr3.]implementations.This should be the priority which was provided to the failed.BR esballoc (9)call..RE.TP.I functionThe callback function to invoke when a buffer of the required size and messageof the requested priority becomes available. This is normally the serviceroutine which failed a call to.BR esballoc (9)..TP.I argThe argument to pass to the callback function. This is normally a pointer tothe queue whose service function failed the.BR esballoc (9)..SH "RETURN VALUES".PPUpon success,.BR esbbcall ()returnes true (1) and the sepcified.I functionwill be called with the specified.I argat a later time when buffers of the necessary size become available..PPUpon failure,.BR esbbcall ()returns false (0) and no call will be generated to the specified.IR function ..SH ERRORS.PPWhen.BR esbbcall ()encounters an error, it returns false (0)..PP.BR esbbcall ()returns false (0) when the function pointer to the callback function,.I functionis.BR NULL ,or.BR esbbcall ()cannot allocate the necessary internal structures..SH CAVEATS.PPThe.B LiS.[LiS.]implementation of.BR esbbcall ()does not actually generate a callback function once a message block of theappropriate priority becomes available. Instead,.B LiS.[LiS.]starts a timer. When the timer expires, the ability to allocate the necessarybuffers is checked and the callback function invoked if it is now able toallocate the necessary structures. This is not entirely consistent withSVR 4.2.[svr42.]operation..PP.B LiS.[LiS.]builds a linked list of buffer call structures and assigns an integer id toeach structure. Searches for unique buffer ides when ids are assigned andsearches for buffer ids when.BR unbufcall (9)is called are linear searches that are slow and inefficient. In fact,\*(lqThe Magic Garden\*(rq.[magic.]explains that in SVR 4.2.[svr42.]a.BR esbbcall ()results in the creation of a.B streventstructure which is linked to the.I strbcallssystem variable and sets the.I strbcwaitflag which then causes.BR kmem_free ()to set the.IR qrunflag .At no point in this process is an integer id assigned to the.B streventstructure. This means that.B LiS.[LiS.]meaninglessly assigns an integer id to the buffer call structure and theinefficiencies of linear searches are pointless..SH "SEE ALSO".PP.BR putbq (9),.BR esballoc "(9) and ".BR unbufcall (9)..SH HISTORY.PP.BR esbbcall ()first appeared in SVR 3..[svr3.].SH VERSIONS.PPThis manpage was written for.B LiS\c..[LiS.].\".\".XX.[magic.].[svr42.].[svr4.].\".\".[$LIST$.].TA
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -