📄 lis_unregister_strdev.9
字号:
'\" tr.\" -*- nroff -*-.\".\" @(#) lis_unregister_strdev.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_UNREGSITER_STRDEV 9 "2004/01/12 23:33:08" "LiS-2_16_18-8" "Linux STREAMS DDI/DKI".SH NAME.B lis_unregister_strdev\- unregister a \fISTREAMS\fR device.SH SYNOPSIS.PP.B #include <sys/stream.h>.HP 8.BI "int " retval " = lis_unregister_strdev(major_t " major );.SH DESCRIPTION.PP.BR lis_unregister_strdev ()deregisters a.IR STREAMS (4)driver previously registered with.BR lis_register_strdev (9)..PP.BR lis_unregister_strdev ()removes the.IR STREAMS (4)driver identified by its major device number,.IR major ,from the.IR STREAMS (4)device switch table and deregisters the character majornumber,.IR major ,from the.B Linuxkernel using.BR unregister_chrdev ().Before removing the.IR STREAMS (4)driver,.B LiS.[LiS.]will also clear any autopush list associated with the.IR STREAMS (4)driver..SH "RETURN VALUES".PPUpon succes,.BR lis_unregister_strdev ()returns zero (0).Upon failure,.BR lis_unregister_strdev ()returns a negative error number..SH ERRORS.PPWhen.BR lis_unregister_strdev ()fails, it returns the negative of one of the following errors:.PP.TP 12.RB [ ENODEV ]The character device major number.IR major ,is not registered to.B LiS\c..[LiS.].TP 12.RB [ EBUSY ]The.IR STREAMS (4)driver identified by.I majorhas open file descriptors..SH CAVEATS.PPAlthough.B LiS.[LiS.]will demand load a.B Linuxkernel module supporting a.IR STREAMS (4)driver, it will not remove that module onceit is deregistered..B Linuxdoes, however, provide a mechanism for autocleaning kernel modules that have azero reference count and this facility could be used instead..SH EXAMPLES.PPFollowing is an example that demonstrates how 4 major device numbers could beregistered and deregistered against a.IR STREAMS (4)driver:.sp.in +4.nf\fC\s-2\#define X_MAJOR 222#define X_NMAJOR 4#define X_NMINOR 255#define X_DRV_NAME "example"int x_initialized = 0;ushort x_majors[X_NMAJOR] = { X_CMAJOR, };void x_init(void){ int err, mindex; for (mindex = 0; mindex < X_NMAJOR; mindex++) { if ((err = lis_register_strdev(x_majors[mindex], &x_info, X_NMINOR, X_DRV_NAME)) < 0) { if (!mindex) { cmn_err(CE_PANIC, "%s: could not register 1'st major %d", X_DRV_NAME, x_majors[mindex]); x_initialized = err; return; } cmn_err(CE_WARN, "%s: could not register %d'th major", X_DRV_NAME, mindex + 1); x_majors[mindex] = 0; } else if (mindex) x_majors[mindex] = err; } x_initialized = 1; return;}void x_terminate(void){ int err, mindex; for (mindex = 0; mindex < X_NMAJOR; mindex++) { if (x_majors[mindex]) { if ((err = lis_unregister_strdev(x_majors[mindex]))) cmn_err(CE_PANIC, "%s: could not unregister major %d", X_DRV_NAME, x_majors[mindex]); if (mindex) x_majors[mindex] = 0; } } return;}\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 + -