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

📄 lis_unregister_strmod.9

📁 7号信令功能代码,为开源代码
💻 9
字号:
'\" tr.\" -*- nroff -*-.\".\" @(#) lis_unregister_strmod.9,v 1.1.4.1 2004/01/12 23:33:08 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:08 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 LIS_UNREGISTER_STRMOD 9 "2004/01/12 23:33:08" "LiS-2_16_18-8" "Linux STREAMS DDI/DKI".SH NAME.B lis_unregister_strmod\- deregister a \fISTREAMS\fR module.SH SYNOPSIS.PP.B #include <sys/stream.h>.HP 8.BI "int " retval " = lis_unregister_strmod(struct streamtab *" strtab );.SH DESCRIPTION.PP.BR lis_unregister_strmod ()deregisters a.IR STREAMS (4)module previoulsy registered with.BR lis_register_strmod (9)..PP.BR lis_unregister_strmod ()removes the.IR STREAMS (4)module identified by.I strtabfrom all autopush lists, and removes the module from the.IR STREAMS (4)module switchtable.Subsequent attempts to push the module will fail unless the module isconfigured for demand loading (see.IR "\*(lqCAVEATS\*(rq" ,below)..PPFor demand loaded.IR STREAMS (4)modules,.BR lis_unregister_strmod ()is normally and properly called from within the.B Linuxkernel module's.B init_moduleroutine..SH "RETURN VALUES".PPUpon success,.BR lis_unregister_strmod ()returns zero (0).Upon failure,.BR lis_unregister_strmod ()returns a negative error number..SH ERRORS.PPWhen.BR lis_unregister_strmod ()fails, it returns the negative of one of the following errors:.TP 12.RB [ EINVAL ].I strtabdoes not refer to an existing registered.IR STREAMS (4)module..TP 12.RB [ EBUSY ]The.IR STREAMS (4)module indicated by.I strtabis currently pushed on an open stream..SH CAVEATS.PPThere are some interactions between thedemand.B Linuxkernel module loading described in.BR lis_register_strmod (9)and unloading of the driver..B LiS.[LiS.]does not attempt to unload a kernel module that calls.BR lis_unregister_strmod .One reason for this is that.BR lis_unregister_strmod ()is normally called during kernel module unloading.  If the kernel module doesnot unload, a subsequent attempt to.B I_PUSHthe module by name will result in a failed attempt to reload the kernel module\fB\)streams-\fI\)name\fB.o\fR.  (This attempt will fail because the kernelmodule is already loaded.).PPTherefore, demand loaded.B Linuxkernel modules that provide.B LiS.[LiS.].IR STREAMS (4)modules should only call.BR lis_register_strmod (9)from their kernel module intialization routines, and should only call.BR lis_unregister_strmod (9)from their kernel module cleanup routines.  See.IR "\*(lqEXAMPLES\*(rq" ,below..SH EXAMPLES.PPFollowing is an example of a.IR STREAMS (4)module which is dynamically registeredand deregistered from the.B LiS.[LiS.].IR STREAMS (4)subsystem:.sp.in +4.nf\fC\s-2\#define X_MOD_NAME "example"int x_initialized = 0;void x_init(void){    unless(x_initialized > 0, return);    if ((x_initialized = lis_register_strmod(&x_info, X_MOD_NAME))        == LIS_NULL_MID) {        cmn_err(CE_WARN, "%s: couldn't register module", X_MOD_NAME);    }    return;}void x_terminate(void){    ensure(x_initialized > 0, return);    if ((x_initialized = lis_unregister_strmod(&x_info)) < 0) {        cmn_err(CE_PANIC, "%s: couldn't unregister module", X_MOD_NAME);    }    return;}\s+2\fR.fi.PPBecause of interactions between demand.B Linuxkernel module loading and unloading and.B LiS.[LiS.].IR STREAMS (4)module registration and deregistration,.BR lis_register_strmod "(9) and " lis_unregister_strmod (9)should only be called from within the kernel module init and cleanup routinesas illustrated below:.sp.in +4.nf\fC\s-2\int init_module(void){    x_init();    if (x_initialized < 0)        return x_initialized;    return (0);}void cleanup_module(void){    x_terminate();}\s+2\fR.fi.SH "SEE ALSO".PP.BR lis_register_strdev (9),.BR lis_register_strmod (9),.BR lis_unregister_strdev (9)..SH VERSIONS.PPThis manpage was written for.B LiS\c..[LiS.].PP.BR lis_unregister_strdev ()is an LiS-specific function that first appeared in early version of.BR LiS ..\".\".XX.[magic.].[svr42.].[svr4.].\".\".[$LIST$.].TA

⌨️ 快捷键说明

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