1.\" $OpenBSD: ldattach.8,v 1.18 2014/10/02 09:28:03 jmc 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: October 2 2014 $ 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 indent -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.El 121.It Ar device 122Specifies the name of the serial line. 123.Ar device 124should be a string of the form 125.Dq cuaXX 126or 127.Dq /dev/cuaXX . 128.Pp 129.Xr cua 4 130devices should be used when 131.Nm 132is started from the command line; 133when started using 134.Xr init 8 , 135.Xr tty 4 136devices should be used. 137.El 138.Pp 139If 140.Nm 141was not started by 142.Xr init 8 , 143the line discipline can be detached by 144killing off the 145.Nm 146process. 147.Sh EXAMPLES 148To start 149.Nm 150using 151.Xr init 8 152to attach the 153.Xr nmea 4 154line discipline to 155.Pa /dev/tty01 156at 4800 baud using a device without a carrier (DCD) line, 157add a line of the following form to 158.Pa /etc/ttys : 159.Bd -literal -offset indent 160tty01 "/sbin/ldattach nmea" unknown on softcar 161.Ed 162.Sh SEE ALSO 163.Xr endrun 4 , 164.Xr msts 4 , 165.Xr nmea 4 , 166.Xr pty 4 , 167.Xr tty 4 , 168.Xr ttys 5 , 169.Xr init 8 170.Sh HISTORY 171The 172.Nm 173command first appeared in 174.Ox 4.3 . 175