* Copyright (c) 1987 Regents of the University of California.
* %sccs.include.redist.c%
"@(#) Copyright (c) 1987 Regents of the University of California.\n\
static char sccsid
[] = "@(#)mesg.c 4.7 (Berkeley) %G%";
* mesg -- set current tty to accept or
* forbid write permission.
if (!(tty
= ttyname(2))) {
fputs("mesg: not a device in /dev.\n", stderr
);
if (stat(tty
, &sbuf
) < 0) {
if (sbuf
.st_mode
& 020) {
newmode(sbuf
.st_mode
| OTHER_WRITE
);
newmode(sbuf
.st_mode
&~ OTHER_WRITE
);
fputs("usage: mesg [y] [n]\n", stderr
);