/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1989-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* mesg.c
* Written by David Korn
* Thu Aug 15 15:25:29 EDT 1996
*/
static const char usage[] =
"[-?\n@(#)$Id: mesg (AT&T Research) 1999-04-28 $\n]"
"[+NAME?mesg - permit or deny messages to the terminal]"
"[+DESCRIPTION?\bmesg\b controls whether other users are allowed to send"
" messages via \bwrite\b(1), \btalk\b(1) or other commands to the"
" terminal device. The terminal device affected is determined by"
" searching for the first terminal in the sequence of devices"
" associated with standard input, standard output and standard error,"
" respectively. With no arguments, \bmesg\b reports the current state"
" without changing it. Processes with appropriate privileges may be"
" able to send messages to the terminal independent of the"
" current state.]"
"\n"
"\n[ y | n ]\n"
"\n"
"[+OPERANDS?The following operands are supported:]{"
" [+y?Grant permission to other users to send messages to the terminal.]"
" [+n?Deny permission to other users to send messages to the terminal.]"
"}"
"[+SEE ALSO?\btalk\b(1), \bwrite\b(1)]"
;
#include <cmd.h>
#include <ls.h>
{
if(!tty)
if(!tty)
if(!tty)
switch(mode)
{
case 'n':
case 'y':
if(mode=='y')
else
break;
case 0:
}
}
int
{
register int n;
for (;;)
{
{
case ':':
break;
case '?':
break;
}
break;
}
n = 0;
return mesg(n);
}