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

📄 intro.3ncs

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 3NCS
📖 第 1 页 / 共 2 页
字号:
.TH intro 3ncs.SH Nameintro \- introduction to the Network Computing System's (NCS) libraryroutines  .SH DescriptionThis section describes the NCS library routines. .NTThe Title, Name, and See Also sections of the NCS reference pages do notcontain the dollar ($) sign in the command names and library routines.The actual NCS commands and library routines do contain thedollar ($) sign. .NXR "NCS commands and library routines".NEThe NCS commands and library routines are as follows:.IP \(bu 5 Error Text Database Operations .PN (error_$).IP \(bu 5Interface to the Location Broker .PN (lb_$).IP \(bu 5Fault Management .PN (pfm_$).IP \(bu 5Program Management .PN (pgm_$).IP \(bu 5Interface to the Remote Procedure Call Runtime Library.PN (rpc_$).IP \(bu 5Remote Remote Procedure Call Interface .PN (rrpc_$).IP \(bu 5Operations on Socket Addresses .PN (socket_$).IP \(bu 5Operations on Universal Unique Identifiers .PN (uuid_$).SS Error Text Database Operations The error text database operations use the.PN error_$c_get_textand.PN error_$c_textlibrary routines to convert status codes into textual error messages.  Theruntime library reports operational problems back to the applicationfollowing a call by setting the `all' field of the.B status_$tstructure.  A value of.B status_$okindicates that no errors were detected.  Any other value implies that aproblem occurred.  The.B status_$tstructure and the.PN error_$routines can be used to display a textual representation of the errorcondition..PP.B Data Types.brThis section describes the data types used in .PN error_$routines..PPThe .PN error_$routines take as input a status code in \fBstatus_$t\fR format..TP\fBstatus_$t\fRA status code.Most of the NCS routines supply their completion status in this format.The \fBstatus_$t\fR type is defined as a structure containing a long integer:.EXstruct status_$t {   long all;}.EEHowever, the routines can also use \fBstatus_$t\fR as a set of bit fields.To access the fields in a returned status code,you can assign the value of the status codeto a union defined as follows:.br.ne 3.EXtypedef union { struct {     unsigned fail : 1,           subsys : 7,           modc : 8;     short    code; } s; long all;} status_u;\fR.EE.RS.TP\fBall\fRAll 32 bits in the status code.If \fBall\fR is equal to \fBstatus_$ok\fR,the routine that supplied the status was successful..TP\fBfail\fRIf this bit is set,the error was not within the scope of the module invoked,but occurred within a lower-level module..TP\fBsubsys\fRThis indicates the subsystem that encountered the error..TP\fBmodc\fRThis indicates the module that encountered the error..TP\fBcode\fRThis is a signed number that identifies thetype of error that occurred..RE.SS Interface To The Location Broker The .PN lb_$library routines implement the programmatic interfaceto the Location Broker Client Agent.\" actually to the LBCAThe file .PN /usr/include/idl/c/glb.hdefines this interface..PP.B External Variables.brThis section describes the external variable used in .PN lb_$routines..TP 20\fBuuid_$nil\fRAn external \fBuuid_$t\fR variablethat is preassigned the value of the nil UUID.Do not change the value of this variable..PP.B Constants.brThis section describes constants used in .PN lb_$routines..TP 20\fBlb_$default_lookup_handle\fR\" 0Used as an input in Location Broker lookup routines.Specifies that a lookupis to start searching at the beginning of the database..TP 20\fBlb_$server_flag_local\fR\" 1Used in the \fBflags\fR field of an \fBlb_$entry_t\fR variable.Specifies that an entryis to be registered only in the Local Location Broker (LLB) database.See the description of \fBlb_$server_flag_t\fR in the Data Typessection..TP 20\fBstatus_$ok\fRA constant used to check status.If a completion statusis equal to \fBstatus_$ok\fR,then the routine that supplied it was successful..PP.B Data Types.brThis section describes data types used in .PN lb_$routines..TP 20\fBlb_$entry_t\fRAn identifier foran object,a type,an interface,and the socket address used to access a server exporting the interface to the object.The \fBlb_$entry_t\fR type is defined as follows:.br.ne 3.EXtypedef struct lb_$entry_t lb_$entry_t;struct lb_$entry_t {    uuid_$t object;    uuid_$t obj_type;    uuid_$t obj_interface;    lb_$server_flag_t flags;    ndr_$char annotation[64];    ndr_$ulong_int saddr_len;    socket_$addr_t saddr;};.EE.RS.TP 20\fBobject\fRA \fBuuid_$t\fR.The UUID for the object.Can be \fBuuid_$nil\fR if no object is associated..TP 20\fBobj_type\fRA \fBuuid_$t\fR.The UUID for the type of the object.Can be \fBuuid_$nil\fR if no type is associated..TP 20\fBobj_interface\fRA \fBuuid_$t\fR.The UUID for the interface.Can be \fBuuid_$nil\fR if no interface is associated..TP 20\fBflags\fRAn \fBlb_$server_flag_t\fR.Must be 0 or \fBlb_$server_flag_local\fR.A value of 0 specifies that the entry is to be registeredin both the Local Location Broker (LLB) and global Location Broker (GLB) databases.A value of \fBlb_$server_flag_local\fR specifies registrationonly in the LLB database..TP 20\fBannotation\fRA 64-character array.User-defined textual annotation..TP 20\fBsaddr_len\fRA 32-bit integer.The length of the \fBsaddr\fR field..TP 20\fBsaddr\fRA \fBsocket_$addr_t\fR.The socket address of the server..RE.TP 20\fBlb_$lookup_handle_t\fRA 32-bit integer used to specify the location in the databaseat which a Location Broker lookup operation will start..TP 20\fBlb_$server_flag_t\fRA 32-bit integer used to specify the Location Broker databasesin which an entry is to be registered.A value of 0 specifies registrationin both the Local Location Broker (LLB) and Global Location Broker (GLB) databases.A value of \fBlb_$server_flag_local\fR specifies registrationonly in the LLB database..TP 20\fBsocket_$addr_t\fRA socket address record that uniquely identifies a socket..\".if t the \fBsocket_$intro\fR section of Chapter \n(sO.\".if n \fBsocket_$intro\fR.TP 20\fBstatus_$t\fRA status code.  Most of the NCS routines supply a completion code inthis format.  The \fBstatus_$t\fR type is defined as a structurecontaining a long integer:.br.ne 3.EXstruct status_$t {    long all;    }.EEHowever, the system calls can also use \fBstatus_$t\fR as a set of bit fields.To access the fields in a returned status code,you can assign the value of the status codeto a union defined as follows:.EXtypedef union {    struct {        unsigned fail : 1,                 subsys : 7,                 modc : 8;        short    code;    } s;    long all;} status_u;.EE.RS.TP 20\fBall\fRAll 32 bits in the status code.If \fBall\fR is equal to \fBstatus_$ok\fR,the system call that supplied the status was successful..TP 20\fBfail\fRIf this bit is set,the error was not within the scope of the module invoked,but occurred within a lower-level module..TP 20\fBsubsys\fRThis indicates the subsystem that encountered the error..TP 20\fBmodc\fRThis indicates the module that encountered the error..TP 20\fBcode\fRThis is a signed number that identifies thetype of error that occurred..RE.TP 20\fBuuid_$t\fRA 128-bit value that uniquely identifiesan object, type, or interface for all time..\".if t the \fBuuid_$intro\fR section of Chapter \n(uU.\".if n \fBuuid_$intro\fR.PP.B Example.brThe following statement looks up information in the GLB databaseabout a matrix multiplication interface:.EXlb_$lookup_interface (&matrix_id, &lookup_handle, max_results,     &num_results, &matrix_results, &st);.EE.SS Fault Management The .PN pfm_$routines allow programs to manage signals, faults, and exceptionsby establishing clean-up handlers..PPA clean-up handler is a piece of code that ensures a program terminatesgracefully when it receives a fatal error.  A clean-up handler begins with a .PN pfm_$cleanupcall, and usually ends with a call to .PN pfm_$signalor .PN pgm_$exit ,though it can also simply continue back into the program after the clean-upcode..PPA clean-up handler is not entered until all fault handlers establishedfor a fault have returned.If there is more than one established clean-up handler for a program,the most recently established clean-up handler is entered first,followed by the next most recently established clean-up handler,and so on to the first established clean-up handler if necessary..PPThere is a default clean-up handler invokedafter all user-defined handlers have completed.It releases any resources still held by the program,before returning control to the process that invoked it..PP.B Constants.br.TP 20.I pfm_$init_signal_handlersA constant used as the .I flagsparameter to .PN pfm_$init ,causing C signals to be intercepted and converted to PFMsignals..PP.B Data Types.brThis section describes the data typed used in pfm_$ routines..TP 20\fBpfm_$cleanup_rec\fRA record type for passing process contextamong clean-up handler routines.  It is an opaque data type..TP 20\fBstatus_$t\fRA status code.  Most of the NCS routines supply a completion code inthis format.  The \fBstatus_$t\fR type is defined as a structurecontaining a long integer:.EXstruct status_$t {    long all;    }.EEHowever, the system calls can also use \fBstatus_$t\fR as a set of bit fields.To access the fields in a returned status code,you can assign the value of the status codeto a union defined as follows:.EXtypedef union {    struct {        unsigned fail : 1,                 subsys : 7,                 modc : 8;        short    code;    } s;    long all;} status_u;.EE.RS.TP 20\fBall\fRAll 32 bits in the status code.If \fBall\fR is equal to \fBstatus_$ok\fR,the system call that supplied the status was successful..TP 20\fBfail\fRIf this bit is set,the error was not within the scope of the module invoked,but occurred within a lower-level module..TP 20\fBsubsys\fRThis indicates the subsystem that encountered the error..br.ne 3.TP 20\fBmodc\fRThis indicates the module that encountered the error..TP 20\fBcode\fRThis is a signed number that identifies thetype of error that occurred..RE.SS Program Management The NCS software products contain a portable version of the.PN pgm_$exitroutine.  The include file for the PFM interface(see the Syntax section of the .MS pfm 3ncsreference pages) contains a declaration for this routine..SS Interface To The Remote Procedure Call Runtime LibraryThe .PN rpc_$library routines implement the NCS Remote Procedure Call (RPC) mechanism. .PPThe .PN rpc_interface is defined by the file.PN /usr/include/idl/rpc.idl ..PPMost of the .PN rpc_$routines can be used only by clients or only by servers.This aspect of their usage is specified at the beginning of each routinedescription, in the Name section..PP.B External Variables.brThis section describes the external variable used in\fBrpc_$\fR routines..TP 20\fBuuid_$nil\fRAn external \fBuuid_$t\fR variable that ispreassigned the value of the nil UUID.Do not change the value of this variable..PP.B Constants.brThis section describes constants used in \fBrpc_$\fR routines..TP 20\fBrpc_$mod\fRA module code indicating the RPC module.  .TP 20\fBstatus_$ok\fRA constant used to check status.If a completion statusis equal to \fBstatus_$ok\fR,then the routine that supplied it was successful.See the description of the \fBstatus_$t\fR type..TP 20\fBrpc_$unbound_port\fR\" 0A port number indicatingto the RPC runtime library that no port is specified.Identical to \fBsocket_$unspec_port\fR..PPThe following 16-bit-integer constants are usedto specify the communications protocol address families in \fBsocket_$addr_t\fR structures.Note that several of the \fBrpc_$\fR and \fBsocket_$\fR callsuse the 32-bit-integer equivalents of these values..igNote that the \fBrpc_$use_family\fR and \fBrpc_$use_family_wk\fR callsuse the 32-bit-integer equivalents of these values....RS.TP 20\fBsocket_$unspec\fR\" 0Address family is unspecified. .TP 20\fBsocket_$internet\fR\" 2Internet Protocols (IP)..RE.PP.B Data Types.brThis section describes data types used in \fBrpc_$\fR routines..TP 20\fBhandle_t\fRAn RPC handle..TP 20\fBrpc_$epv_t\fRAn entry point vector (EPV).An array of \fBrpc_$server_stub_t\fR,pointers to server stub procedures..TP 20\fBrpc_$generic_epv_t\fRAn entry point vector (EPV).An array of \fBrpc_$generic_server_stub_t\fR,pointers to generic server stub procedures..TP 20\fBrpc_$if_spec_t\fRAn RPC interface specifier.This opaque data type contains information about an interface, includingits UUID,the current version number,any well-known ports used by servers that export the interface,and the number of operations in the interface. .TP 20\fBrpc_$mgr_epv_t\fRAn entry point vector (EPV).An array of pointers to manager procedures.

⌨️ 快捷键说明

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