* 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 5.3 (Berkeley) %G%";
void err
__P((const char *fmt
, ...));
while ((ch
= getopt(argc
, argv
, "")) != EOF
)
if ((tty
= ttyname(STDERR_FILENO
)) == NULL
)
err("ttyname: %s", strerror(errno
));
err("%s: %s", strerror(errno
));
if (sb
.st_mode
& S_IWGRP
) {
(void)fprintf(stderr
, "is y\n");
(void)fprintf(stderr
, "is n\n");
if (chmod(tty
, sb
.st_mode
| S_IWGRP
) < 0)
err("%s: %s", strerror(errno
));
if (chmod(tty
, sb
.st_mode
& ~S_IWGRP
) < 0)
err("%s: %s", strerror(errno
));
(void)fprintf(stderr
, "usage: mesg [y | n]\n");
err(const char *fmt
, ...)
(void)fprintf(stderr
, "mesg: ");
(void)vfprintf(stderr
, fmt
, ap
);
(void)fprintf(stderr
, "\n");