xref: /netbsd-src/lib/libutil/ttymsg.3 (revision 2dda5775d9f358d7375074e13caca86521c9e291)
1*2dda5775Swiz.\" $NetBSD: ttymsg.3,v 1.13 2013/01/16 06:44:27 wiz Exp $
2f5646a08Schristos.\"
3f5646a08Schristos.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
4f5646a08Schristos.\" All rights reserved.
5f5646a08Schristos.\"
6f5646a08Schristos.\" Redistribution and use in source and binary forms, with or without
7f5646a08Schristos.\" modification, are permitted provided that the following conditions
8f5646a08Schristos.\" are met:
9f5646a08Schristos.\" 1. Redistributions of source code must retain the above copyright
10f5646a08Schristos.\"    notice, this list of conditions and the following disclaimer.
11f5646a08Schristos.\" 2. Redistributions in binary form must reproduce the above copyright
12f5646a08Schristos.\"    notice, this list of conditions and the following disclaimer in the
13f5646a08Schristos.\"    documentation and/or other materials provided with the distribution.
14f5646a08Schristos.\"
15f5646a08Schristos.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16f5646a08Schristos.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17f5646a08Schristos.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1823bee85aSjtc.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
1923bee85aSjtc.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20f5646a08Schristos.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21f5646a08Schristos.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22f5646a08Schristos.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23f5646a08Schristos.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24f5646a08Schristos.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25f5646a08Schristos.\" POSSIBILITY OF SUCH DAMAGE.
26f5646a08Schristos.\"
27d0359818Schristos.Dd January 15, 2013
28f5646a08Schristos.Dt TTYMSG 3
2938c96853Sgarbled.Os
30f5646a08Schristos.Sh NAME
31f5646a08Schristos.Nm ttymsg
32f5646a08Schristos.Nd ttymsg utility function
33312aca53Sperry.Sh LIBRARY
34312aca53Sperry.Lb libutil
35f5646a08Schristos.Sh SYNOPSIS
36472351e1Swiz.In util.h
37f5646a08Schristos.Ft char *
38dea51c3aSmikel.Fn ttymsg "struct iovec *iov" "int iovlen" "const char *tty" "int tmout"
39f5646a08Schristos.Sh DESCRIPTION
40f5646a08SchristosThe
41dea51c3aSmikel.Fn ttymsg
42f5646a08Schristosfunction is used by
43f5646a08Schristosprograms such as
44f5646a08Schristos.Xr talkd 8 ,
45f5646a08Schristos.Xr syslogd 8 ,
46f5646a08Schristos.Xr wall 1 ,
47dea51c3aSmikeletc., to display the contents of a uio structure on a terminal.
48dea51c3aSmikel.Fn ttymsg
49dea51c3aSmikelforks and finishes in the child if the write would block after
50dea51c3aSmikelwaiting up to
51dea51c3aSmikel.Fa tmout
52dea51c3aSmikelseconds.
53f5646a08Schristos.Sh RETURN VALUES
54dea51c3aSmikel.Fn ttymsg
55dea51c3aSmikelreturns a pointer to an error string on unexpected
5627adb020Swizerror; the string is not newline-terminated.
5727adb020SwizVarious "normal" errors are
58f5646a08Schristosignored (exclusive-use, lack of permission, etc.).
59*2dda5775Swiz.Sh SEE ALSO
60*2dda5775Swiz.Xr writev 2
61d0359818Schristos.Sh BUGS
62d0359818Schristos.Nm
63d0359818Schristoscould grow some flags and a username/uid who is the expected owner
64d0359818Schristosof the tty.
65d0359818SchristosIf the flags say so then the owner should be checked against the tty
66d0359818Schristosowner, and the message should not be sent if there is a mismatch.
67d0359818SchristosAlso another flag could say check against group writable, and don't
68d0359818Schristossend a message.
69