📄 dial.3c
字号:
.\" @(#)dial.3c 5.2 of 5/18/82.TH dial 3c VAX "" Unsupported.SH Namedial \- establish an out-going terminal line connection.SH Syntax.B #include <dial.h>.PPint dial(\fIcall\fP).br\s-1CALL\s+1 \(**\fIcall\fP;.PPvoid undial(\fIfd\fP).brint \fIfd\fP;.SH DescriptionThe .PN dial routinereturns a file-descriptor for a terminal line open for read/write.The argument to.PN dial is a \s-1CALL\s+1 structure which is defined in the<dial.h> header file..PPWhen finished with the terminal line,the calling program must invoke.PN undialto release the semaphore that has been setduring the allocation of the terminal device..PPThe \s-1CALL\s+1 typedef in the <dial.h> header file is:.EXtypedef struct { struct termio \(**attr; /\(** pointer to termio attribute struct \(**/ int baud; /\(** transmission data rate \(**/ int speed; /\(** 212A modem: low=300, high=1200 \(**/ char \(**line; /\(** device name for out-going line \(**/ char \(**telno; /\(** pointer to tel-no digits string \(**/ int modem; /\(** specify modem control for direct lines \(**/} \s-1CALL\s+1;.EEThe \s-1CALL\s+1 element.PN speedis intended only for use withan outgoing dialed call..PPThe \s-1CALL\s+1 element.PN baudis for the desired transmissionbaud rate.For example, one might setbaud to 110 and speedto 300 (or 1200)..PPIf the desired terminal line is a direct line, a stringpointer to its device-name should be placed in the.PN line element in the \s-1CALL\s+1 structure.Legal values for such terminal device names are kept in theL-devices file.In this case, the value of the.PN baudelement need not be specified as it is determinedfrom theL-devicesfile..PPThe.PN telno\^element is for a pointer to a character stringrepresenting the telephone number to be dialed.The termination symbolis supplied by the.PN dialfunction, and should not be included in the.PN telnostring passed to.PN dialin the \s-1CALL\s+1 structure..PPThe \s-1CALL\s+1 element.PN modemis used to specify modem control for direct lines.This element should be non-zero if modem control is required..PPThe \s-1CALL\s+1 element.PN attris a pointer to a.PN termiostructure, as defined in thetermio.h header file.A \s-1NULL\s+1 value for this pointer element may be passed tothe.PN dialfunction, but if such a structure is included, the elements specifiedin it are set for the outgoing terminal line before the connectionis established.This is often important for certain attributessuch as parity and baud-rate..SH RestrictionsIncluding the.B <dial.h>header file automatically includes the.B <termio.h> header file..PPAn.MS alarm 3system call for 3600 seconds is made (and caught) within the.PN dialmodule for the purpose of ``touching'' the \fI\s-1LCK\s+1..\fP fileand constitutes the device allocation semaphore for the terminaldevice.Otherwise,.MS uucp 1cmay simply delete the \fI\s-1LCK\s+1..\fP entry on its 90-minute clean-up rounds.The alarm may go off while the user program is in a.MS read 2or.MS write 2system call, causing an apparent error return.If the user program expects to be around for an hour or more, errorreturns from.IR read sshould be checked for \fB(errno==\s-1EINTR\s+1)\fP, and the.I read\^possibly reissued..SH DiagnosticsOn failure, a negative value indicating the reason forthe failure is returned.Mnemonics for these negative indices as listed here are definedin the <dial.h>header file..sp 2.nf.ta .5i 1.3i 2.0i \s-1INTRPT\s+1 \-1 /\(** interrupt occured \(**/ \s-1D_HUNG\s+1 \-2 /\(** dialer hung (no return from write) \(**/ \s-1NO_ANS\s+1 \-3 /\(** no answer within 10 seconds \(**/ \s-1ILL_BD\s+1 \-4 /\(** illegal baud-rate \(**/ \s-1A_PROB\s+1 \-5 /\(** acu problem (open() failure) \(**/ \s-1L_PROB\s+1 \-6 /\(** line problem (open() failure) \(**/ \s-1NO_L\s+1dv \-7 /\(** can't open \s-1LDEVS\s+1 file \(**/ \s-1DV_NT_A\s+1 \-8 /\(** requested device not available \(**/ \s-1DV_NT_E\s+1 \-12 /\(** requested speed does not match \(**/ \s-1DV_NT_K\s+1 \-9 /\(** requested device not known \(**/ \s-1NO_BD_A\s+1 \-10 /\(** no device available at requested baud \(**/ \s-1NO_BD_K\s+1 \-11 /\(** no device known at requested baud \(**/.fi.SH Files\f(CW/usr/lib/uucp/L-devices\fP.br\f(CW/usr/spool/uucp/\s-1LCK\s+1..\fItty-device\fP.SH See Alsouucp(1c), alarm(3), read(2), write(2), termio(7)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -