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

📄 t_alloc.3.man

📁 This a separate release of the OpenSS7 X/Open XTI/TLI library, TLI modules (timod, tirdwr) and the I
💻 MAN
字号:
'\" rtp.\" -*- nroff -*- vim: ft=nroff noautoindent nocindent nosmartindent.\".\" @(#) t_alloc.3.man,v 0.9.2.2 2004/05/16 02:35:36 brian Exp.\".\" =========================================================================.\".\" Copyright (C) 2001-2004  OpenSS7 Corporation <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..\".\" -------------------------------------------------------------------------.\".\" U.S. GOVERNMENT RESTRICTED RIGHTS.  If you are licensing this Software.\" on behalf of the U.S. Government ("Government"), the following.\" provisions apply to you.  If the Software is supplied by the Department.\" of Defense ("DoD"), it is classified as "Commercial Computer Software".\" under paragraph 252.227-7014 of the DoD Supplement to the Federal.\" Acquisition Regulations ("DFARS") (or any successor regulations) and the.\" Government is acquiring only the license rights granted herein (the.\" license rights customarily provided to non-Government users).  If the.\" Software is supplied to any unit or agency of the Government other than.\" DoD, it is classified as "Restricted Computer Software" and the.\" Government's rights in the Software are defined in paragraph 52.227-19.\" of the Federal Acquisition Regulations ("FAR") (or any success.\" regulations) or, in the cases of NASA, in paragraph 18.52.227-86 of the.\" NASA Supplement to the FAR (or any successor regulations)..\".\" =========================================================================.\" .\" Commercial licensing and support of this software is available from.\" OpenSS7 Corporation at a fee.  See http://www.openss7.com/.\" .\" =========================================================================.\".\" Last Modified 2004/05/16 02:35:36 by brian.\".\" =========================================================================.so strxnet.macros.R1bracket-label "\fR[\fB" "\fR]" "\fR, \fB"no-default-databasedatabase strxnet.refsaccumulatemove-punctuationabbreviate Ajoin-authors ", " ", " " and "et-al " et al" 2 3abbreviate-label-ranges ".."sort-adjacent-labels.R2.\".\".\".\".TH T_ALLOC 3 "2004/05/16 02:35:36" "strxnet-0_9_2-4" "OpenSS7 XTI/TLI Library".SH NAME.B t_alloc\- allocate a library structure.SH SYNOPSIS.PP.B #include <xti.h>.HP 8.BI "void *t_alloc(int " fd ", int " type ", int " fields );.SH ARGUMENTS.PP.TP.I fdthe transport endpoint against which to allocate the structure..TP.I typethe type of structure to allocate..TP.I fieldsthe.BR netbuf (3)fields to populate and for which to allocate buffers..SH DESCRIPTION.PP.BR t_alloc ()allocates the specified XTI/TLI.[XTI.].[XNS.]structure.I typeand initializes requested.BR netbuf (3)parameter.I fieldsin the structure..PP.I fdspecifies the local endpoint for which to allocate structures.  The localendpoint is necessary because the sizes of.BR netbuf (3)fields is determined by the protocol limits returned in the.B t_infostructure from calls to.BR t_open "(3) or " t_getinfo (3)..PP.I typespecifies the type of XTI/TLI.[XTI.].[XNS.]structure to allocate, and may be one of thefollowing:.TP \w'T_UNITDATA\(em'u.B T_BINDspecifies the.B t_bindstructure..PD 0.TP.B T_OPTMGMTspecifies the.B t_optmgmtstructure..TP.B T_CALLspecifies the.B t_callstructure..TP.B T_DISspecifies the.B t_disconstructure..TP.B T_UNITDATAspecifies the.B t_unitdatastructure..TP.B T_UDERRORspecifies the.B t_uderrstructure..TP.B T_INFOspecifies the.B t_infostructure..PD.PP.I fieldsspecifies which.BR netbuf (3)parameters to initialize with buffers in addition to allocating the structure.The size of the buffer is gleened by.BR t_alloc ()from protocol sizing information associated with the local transport endpoint.IR fd ..I fieldsis a bitwise OR of zero or more of the following flags:.TP \w'T_UNITDATA\(em'u.B T_ADDRallocate and initialize the.I addr.BR netbuf (3)structure and buffer..TP.B T_OPTallocate and initialize the.I opt.BR netbuf (3)structure and buffer..TP.B T_UDATAallocate and initialize the.I udata.BR netbuf (3)structure and buffer..TP.B T_ALLallocate and initialize all relevant.BR netbuf (3)structures and buffers..PPThe.BR netbuf (3)parameters in the allocated structure that have their corresponding flag setwill have their.I buffields set to the allocated buffer, their.I maxlenfields set to the length of the allocated buffer, and their.I lenfields set to zero (0).  (The caller must sent the.I lenfields appropriately after placing contents into the buffer, but not in excessof.IR maxlen .).PPThe.BR netbuf (3)parameters in the allocated structure that do not have the corresponding flagset,which have a length of zero (0) in the information structure returned by.BR t_getinfo (3),or which have a length of.B T_INVALIDin the information structure returned by.BR t_getinfo (3)and.I fieldsis set to.BR T_ALL ,will have their.I buffields set to.BR NULL ,and their.IR maxlen " and " lenfields set to zero..PPIf a field with its flag set has a length of.B T_INVALIDin the information structure returned by.BR t_getinfo (3)and.B T_ALLwas not specified for.IR fields ,.BR t_alloc ()will fail with error.RB [ EINVAL ]..PPAny flag positions in the.I fieldsargument not relevant to the structure type in the.I typeargument will be ignored..SH "RETURN VALUE".PPUpon success,.BR t_alloc ()returns a.BR "" non- NULLpointer to the allocated structure.Upon failure,.BR t_alloc ()returns.B NULLand sets.IR t_errno (3)to an appropriate error number..SH ERRORS.PPWhen.BR t_alloc ()fails, it returns.B NULLand sets.IR t_errno (3)to an appropriate error number as follows:.TP \w'[TNOTSUPPORT]\(em'u.RB [ TBADF ].I fdis invalid..TP.RB [ TNOSTRUCTYPE ]The argument \fItype\fR was not a valid or supported structure type, or wasnot an appropriate structure type for the service type of the transportendpoint..TP.RB [ TPROTO ]A protocol error occured between the XTI/TLI library and the underlying transport provider..TP.RB [ TSYSERR ]A \fBLinux\fR system error occured and the \fBLinux\fR error number is set in \fIerrno\fR(3).This occurs in the following situations:.TP.RB [ ENOMEM ]Memory could not be allocated for the structure or a buffer in the structure..TP.RB [ EINVAL ].I fieldswas specified (i.e. not set to.BR T_ALL )and at least one of the specified fields was of size.B T_INVALIDin the information structure (see.BR t_getinfo (3))..SH NOTICES.PPIf a field with its flag set has a length of.B T_INFINITEin the information structure returned by.BR t_getinfo (3),or if the length is greater that an internal maximum size,.BR t_alloc ()will only allocate the internal maximum size..SH "SEE ALSO".PP.BR t_getinfo (3),.BR t_free (3)..SH "CONFORMING TO".PPXTI/TLI,.[XTI.]TPI,.[TPI Revision 2.0.0.]XPG5,XNS 5.2,.[xns.]SUSv2..[susv2.].\".\".[$LIST$.].T4

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -