1.\" $OpenBSD: ldattach.8,v 1.14 2009/05/06 20:14:18 stevesk Exp $ 2.\" 3.\" Copyright (c) 2007, 2008 Marc Balmer <mbalmer@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: May 6 2009 $ 18.Dt LDATTACH 8 19.Os 20.Sh NAME 21.Nm ldattach 22.Nd attach a line discipline to a serial line 23.Sh SYNOPSIS 24.Nm ldattach 25.Op Fl 27dehmop 26.Op Fl s Ar baudrate 27.Op Fl t Ar cond 28.Ar discipline 29.Ar device 30.Sh DESCRIPTION 31.Nm 32is used to attach a line discipline to a serial line to allow for in-kernel 33processing of the received and/or sent data. 34Depending on the line discipline being attached, one or more options may be 35applied. 36.Pp 37.Nm 38can be run from the command line or at system startup by having 39.Xr init 8 40read 41.Xr ttys 5 42entries to attach line disciplines. 43.Pp 44The following options are available: 45.Bl -tag -width Ds 46.It Fl 2 47Use 2 stopbits instead of 1. 48.It Fl 7 49Use 7 databits instead of 8. 50.It Fl d 51Do not daemonize. 52.It Fl e 53Use even parity. 54.It Fl h 55Turn on RTS/CTS flow control. 56By default, no flow control is done. 57.It Fl m 58Maintain modem control signals after closing the line. 59Specifically, this disables HUPCL. 60.It Fl o 61Use odd parity. 62.It Fl p 63Pass the data received from 64.Ar device 65to the master device of a 66.Xr pty 4 67pair and vice versa. 68The name of the slave device is written to standard output. 69.It Fl s Ar baudrate 70Specifies the speed of the connection. 71If not specified, the default of 9600 baud is used 72(4800 baud for 73.Xr nmea 4 ) . 74.It Fl t Ar cond 75.Xr nmea 4 , 76.Xr msts 4 77and 78.Xr endrun 4 79line disciplines only. 80Chooses the condition which will cause the current system time to be 81immediately copied to the terminal timestamp storage for subsequent use by 82.Xr nmea 4 , 83.Xr msts 4 84or 85.Xr endrun 4 . 86Only one can be used. 87.Pp 88.Bl -tag -width DCDXX -offset indent -compact 89.It dcd 90Copy the timestamp when DCD is asserted. 91.It !dcd 92Copy the timestamp when DCD is deasserted. 93.It cts 94Copy the timestamp when CTS is asserted. 95.It !cts 96Copy the timestamp when CTS is deasserted. 97.El 98.Pp 99If no condition is specified, the 100.Xr nmea 4 101line discipline will timestamp on receiving the leading 102.Sq $ 103character of each block of NMEA sentences. 104.It Ar discipline 105Specifies the name of the line discipline to be attached. 106.Pp 107.Bl -tag -width nmeaXX -offset -indet -compact 108.It endrun 109Attach the 110.Xr endrun 4 111line discipline. 112.It msts 113Attach the 114.Xr msts 4 115line discipline. 116.It nmea 117Attach the 118.Xr nmea 4 119line discipline. 120.It slip 121Attach the 122.Xr sl 4 123line discipline. 124.El 125.It Ar device 126Specifies the name of the serial line. 127.Ar device 128should be a string of the form 129.Dq cuaXX 130or 131.Dq /dev/cuaXX . 132.Pp 133.Xr cua 4 134devices should be used when 135.Nm 136is started from the command line; 137when started using 138.Xr init 8 , 139.Xr tty 4 140devices should be used. 141.El 142.Pp 143If 144.Nm 145was not started by 146.Xr init 8 , 147the line discipline can be detached by 148killing off the 149.Nm 150process. 151.Sh EXAMPLES 152To start 153.Nm 154using 155.Xr init 8 156to attach the 157.Xr nmea 4 158line discipline to 159.Pa /dev/tty01 160at 4800 baud using a device without a carrier (DCD) line, 161add a line of the following form to 162.Pa /etc/ttys : 163.Bd -literal -offset indent 164tty01 "/sbin/ldattach nmea" unknown on softcar 165.Ed 166.Sh SEE ALSO 167.Xr endrun 4 , 168.Xr msts 4 , 169.Xr nmea 4 , 170.Xr pty 4 , 171.Xr sl 4 , 172.Xr tty 4 , 173.Xr ttys 5 , 174.Xr init 8 175.Sh HISTORY 176The 177.Nm 178command first appeared in 179.Ox 4.3 . 180