t_sync.3xti

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3XTI 代码 · 共 108 行

3XTI
108
字号
.TH t_sync 3xti.SH Namet_sync \- synchronize transport library .SH Syntax.B #include <xti.h>.br.sp 1.B int t_sync(\fIfd\fB).br.B int \fIfd\fB;.SH Arguments.IP \fIfd\fR 10Identifies the local transport endpoint. .SH DescriptionFor the transport endpoint specified by \fIfd\fR, .PN t_sync()synchronizes the data structures managed by the transport library withinformation from the underlying transport provider. In doing so, .PN t_sync()can convert an uninitialized file descriptor to an initialized transport endpoint, byupdating and allocating the necessary library data structures. The file descriptor, which isassumed to have referenced a transport endpoint, has to be obtained by means of an.PN open()\fR,\fR.PN dup()\fR,\fRor be the result of a fork and.PN exec()\fR.\fRThe function also allows twocooperating processes to synchronize their interaction with a transportprovider..NXR "t_sync system call".NXR "transport library" "synchronizing".PPFor example, if a process forks a new process and issues an.PN exec()\fR,\fR the new process must issue a .PN t_sync() to build theprivate library data structure associated with a transport endpoint andto synchronize the data structure with the relevant providerinformation..PPIt is important to remember that the transport provider treats all usersof a transport endpoint as a single user. If multiple processes areusing the same endpoint, they should coordinate their activates so as notto violate the state of the transport endpoint. The .PN t_sync()function returns the current state of the transport endpoint to theuser, thereby enabling the user to verify the state before takingfurther action. This coordination is valid only among cooperatingprocesses; it is possible that a process or an incoming event couldchange the endpoint's state after a .PN t_sync() is issued..PP.TStab(@);lfHB lfHB lfHBlfR  lfR  lfR ._.sp 6pParameters@Before Call@After Call.sp 6p_.sp 6pfd@x@/.sp 6p_.TE.PP.sp 12p.SH Return ValuesUpon successful completion, .PN t_syncreturns the state of thetransport endpoint. On failure, a value of \-1 is returned, and \fBt_errno\fR is set to indicate the error. The state returned is one of thefollowing:.IP \fBT_IDLE\fP 10Idle.IP \fBT_OUTCON\fPOutgoing connection pending.IP \fBT_INCON\fPIncoming connection pending.IP \fBT_DATAXFER\fPData transfer.IP \fBT_OUTREL\fPOutgoing orderly release (waiting for an orderly release indication)..IP \fBT_INREL\fPIncoming orderly release (waiting for an orderly release request) .SH DiagnosticsOn failure, \fBt_errno\fR is set to one of the following:.TP 20[TBADF]The specified file descriptor does not refer to a transport endpoint.This error may be returned when the \fIfd\fR has been previously closedor an erroneous number may have been passed to the call..TP 20 [TSTATECHNG]The transport endpoint is undergoing a state change..TP 20[TSYSERR]A system error has occurred during execution of this function..SH See Alsodup(2), exec(2), fork(2), open(2)

⌨️ 快捷键说明

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