⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 esballoc.9

📁 7号信令功能代码,为开源代码
💻 9
字号:
'\" tr.\" -*- nroff -*-.\".\" @(#) esballoc.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 ESBALLOC 9 "2004/01/12 23:33:00" "LiS-2_16_18-8" "Linux STREAMS DDI/DKI".SH NAME.B esballoc\- allocate a \fISTREAMS\fR message and data block with a caller supplied data buffer.SH SYNOPSIS.PP.B #include <sys/stream.h>.HP 8.BI "mblk_t *" mp " = esballoc(unsigned char *" base ", int " size, ", int " priority ", frtn_t *" freeinfo );.SH DESCRIPTION.PP.B ESBALLOCis used where the.IR STREAMS (4)driver needs control over the location, allocation and deallocation of databuffers.  This may be because the data buffers are subject to some physicalcontraints (e.g. must be allocated in DMA-able memory, or must exist indual-ported RAM or in a decriptor ring).  This may also be because some othermechanism outside of.IR STREAMS (4)has already allocated and passed the data buffer to a.IR STREAMS (4)driver..PPWhere it is not necessary that the caller provide the data buffer,.BR allocb (9)is more appropriate..PP.B ESBALLOCallocates a message block and a data block using the caller supplied databuffer at.I baseof the specified.IR size " and " priority ..PPThe.I prioritycan be one of the following values:.TP 12.B BPRI_LOThe caller requests a low priority message buffer..TP 12.B BPRI_MEDThe caller requests a medium priority message buffer..TP 12.B BPRI_HIThe caller requests a high priority message buffer..PPThe data buffer of length.I sizehas already been allocated by the caller and is pointed to by the argument.IR base .In addition,.B ESBALLOCaccepts a pointer to a.B free_rtnstructure that contains the following elements:.TP.BI "void (*" free_func ")(char *)"A function pointer.I free_functo a function returning void and taking a single characterpointer argument.  This function should perform whatever actions are necessaryto free the buffer pointed to by.I basein the call to.BR ESBALLOC ..TP.BI "char *" free_argA character pointer argument.I free_argthat will be passed to a call to.I free_funcwhen the message block returned by.B ESBALLOCis freed with.BR freeb "(9) or " freemsg (9)..PPThe allocated message block will have a data block type of.BR M_DATA ..SH "RETURN VALUES".PPUpon success,.B ESBALLOCreturns a pointer,.IR mp ,to the allocated message block..PPUpon failure,.B ESBALLOCreturns a.B NULLmessage pointer,.IR mp ..SH ERRORS.PPWhen an error occurs,.BR ESBALLOCwill return a.B NULLmessage pointer,.IR mp ..PP.BR ESBALLOCwill fail if.I baseis.BR NULL ,or if.I freeinfois.BR NULL ,or there is insufficient memory to allocate the necessary datastructures forthe message block or data block..PPFailure to allocate a message block is typically followed by a call to.BR esbbcall (9)..SH CAVEATS.PPAs with other post-SVR 4.2.[svr42.]compliant.IR STREAMS (4)implementations,.B LiS.[LiS.]ignores the.I priorityargument to.BR ESBALLOC .The message block.I prioritywas an SVR 3.[svr3.]concept which was found not to be useful, primarily due topriority inversion.For a history of the.I prioritymechanism and a discussion as to why the mechanism was abandonned in SVR 4.2,.[svr42.]see \*(lqThe Magic Garden\*(rq section 7.2.2..[magic%S 7.2.2.].SH "SEE ALSO".PP.BR freeb (9),.BR freemsg (9),.BR bufcall "(9), and ".BR esbbcall (9)..SH HISTORY.PP.B ESBALLOCfirst appeared in SVR 3 STREAMS.[svr3.]and continued in SVR 4.2 STREAMS..[svr42.].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 + -