Changeset View
Changeset View
Standalone View
Standalone View
head/usr.bin/wall/ttymsg.c
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
* syslogd(8), and talkd(8). Forks and finishes in child if write would block, | * syslogd(8), and talkd(8). Forks and finishes in child if write would block, | ||||
* waiting up to tmout seconds. Returns pointer to error string on unexpected | * waiting up to tmout seconds. Returns pointer to error string on unexpected | ||||
* error; string is not newline-terminated. Various "normal" errors are | * error; string is not newline-terminated. Various "normal" errors are | ||||
* ignored (exclusive-use, lack of permission, etc.). | * ignored (exclusive-use, lack of permission, etc.). | ||||
*/ | */ | ||||
const char * | const char * | ||||
ttymsg(struct iovec *iov, int iovcnt, const char *line, int tmout) | ttymsg(struct iovec *iov, int iovcnt, const char *line, int tmout) | ||||
{ | { | ||||
struct iovec localiov[7]; | struct iovec localiov[TTYMSG_IOV_MAX]; | ||||
ssize_t left, wret; | ssize_t left, wret; | ||||
int cnt, fd; | int cnt, fd; | ||||
char device[MAXNAMLEN] = _PATH_DEV; | char device[MAXNAMLEN] = _PATH_DEV; | ||||
static char errbuf[1024]; | static char errbuf[1024]; | ||||
char *p; | char *p; | ||||
int forked; | int forked; | ||||
forked = 0; | forked = 0; | ||||
▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines |