xref: /minix3/lib/libutil/ttymsg.3 (revision 84d9c625bfea59e274550651111ae9edfdc40fbd)
1*84d9c625SLionel Sambuc.\" $NetBSD: ttymsg.3,v 1.13 2013/01/16 06:44:27 wiz Exp $
20c3983b2SBen Gras.\"
30c3983b2SBen Gras.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
40c3983b2SBen Gras.\" All rights reserved.
50c3983b2SBen Gras.\"
60c3983b2SBen Gras.\" Redistribution and use in source and binary forms, with or without
70c3983b2SBen Gras.\" modification, are permitted provided that the following conditions
80c3983b2SBen Gras.\" are met:
90c3983b2SBen Gras.\" 1. Redistributions of source code must retain the above copyright
100c3983b2SBen Gras.\"    notice, this list of conditions and the following disclaimer.
110c3983b2SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright
120c3983b2SBen Gras.\"    notice, this list of conditions and the following disclaimer in the
130c3983b2SBen Gras.\"    documentation and/or other materials provided with the distribution.
140c3983b2SBen Gras.\"
150c3983b2SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
160c3983b2SBen Gras.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
170c3983b2SBen Gras.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
180c3983b2SBen Gras.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
190c3983b2SBen Gras.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
200c3983b2SBen Gras.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
210c3983b2SBen Gras.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
220c3983b2SBen Gras.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
230c3983b2SBen Gras.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
240c3983b2SBen Gras.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
250c3983b2SBen Gras.\" POSSIBILITY OF SUCH DAMAGE.
260c3983b2SBen Gras.\"
27*84d9c625SLionel Sambuc.Dd January 15, 2013
280c3983b2SBen Gras.Dt TTYMSG 3
290c3983b2SBen Gras.Os
300c3983b2SBen Gras.Sh NAME
310c3983b2SBen Gras.Nm ttymsg
320c3983b2SBen Gras.Nd ttymsg utility function
330c3983b2SBen Gras.Sh LIBRARY
340c3983b2SBen Gras.Lb libutil
350c3983b2SBen Gras.Sh SYNOPSIS
360c3983b2SBen Gras.In util.h
370c3983b2SBen Gras.Ft char *
380c3983b2SBen Gras.Fn ttymsg "struct iovec *iov" "int iovlen" "const char *tty" "int tmout"
390c3983b2SBen Gras.Sh DESCRIPTION
400c3983b2SBen GrasThe
410c3983b2SBen Gras.Fn ttymsg
420c3983b2SBen Grasfunction is used by
430c3983b2SBen Grasprograms such as
440c3983b2SBen Gras.Xr talkd 8 ,
450c3983b2SBen Gras.Xr syslogd 8 ,
460c3983b2SBen Gras.Xr wall 1 ,
470c3983b2SBen Grasetc., to display the contents of a uio structure on a terminal.
480c3983b2SBen Gras.Fn ttymsg
490c3983b2SBen Grasforks and finishes in the child if the write would block after
500c3983b2SBen Graswaiting up to
510c3983b2SBen Gras.Fa tmout
520c3983b2SBen Grasseconds.
530c3983b2SBen Gras.Sh RETURN VALUES
540c3983b2SBen Gras.Fn ttymsg
550c3983b2SBen Grasreturns a pointer to an error string on unexpected
560c3983b2SBen Graserror; the string is not newline-terminated.
570c3983b2SBen GrasVarious "normal" errors are
580c3983b2SBen Grasignored (exclusive-use, lack of permission, etc.).
590c3983b2SBen Gras.Sh SEE ALSO
600c3983b2SBen Gras.Xr writev 2
61*84d9c625SLionel Sambuc.Sh BUGS
62*84d9c625SLionel Sambuc.Nm
63*84d9c625SLionel Sambuccould grow some flags and a username/uid who is the expected owner
64*84d9c625SLionel Sambucof the tty.
65*84d9c625SLionel SambucIf the flags say so then the owner should be checked against the tty
66*84d9c625SLionel Sambucowner, and the message should not be sent if there is a mismatch.
67*84d9c625SLionel SambucAlso another flag could say check against group writable, and don't
68*84d9c625SLionel Sambucsend a message.
69