10 date 93.08.25.17.18.31; author jromine; state Exp;
15 date 92.12.15.00.20.22; author jromine; state Exp;
20 date 92.12.14.17.47.34; author jromine; state Exp;
25 date 92.12.14.17.44.38; author jromine; state Exp;
36 @off_t fixes for BSD44
39 @/* advertise.c - the heart of adios */
41 static char ident[] = "@@(#)$Id: advertise.c,v 1.3 1992/12/15 00:20:22 jromine Exp jromine $";
47 #include <sys/types.h>
51 /* For 4.2BSD systems, use writev() for slightly better performance. Why?
52 Well, there are a couple of reasons. Primarily, it gives a smoother
53 output... More importantly though, it's a sexy syscall()...
57 #ifndef BSD44 /* in <stdio.h> */
59 extern char *sys_errlist[];
66 void advertise (what, tail, fmt, a, b, c, d, e, f)
82 register struct iovec *iov = iob;
85 (void) fflush (stdout);
88 if (invo_name && *invo_name)
89 fprintf (stderr, "%s: ", invo_name);
90 fprintf (stderr, fmt, a, b, c, d, e, f);
93 fprintf (stderr, " %s: ", what);
94 if (eindex > 0 && eindex < sys_nerr)
95 fprintf (stderr, "%s", sys_errlist[eindex]);
97 fprintf (stderr, "Error %d", eindex);
100 fprintf (stderr, ", %s", tail);
101 (void) fputc ('\n', stderr);
103 (void) fflush (stderr);
105 if (invo_name && *invo_name) {
106 iov -> iov_len = strlen (iov -> iov_base = invo_name);
108 iov -> iov_len = strlen (iov -> iov_base = ": ");
112 (void) sprintf (buffer, fmt, a, b, c, d, e, f);
113 iov -> iov_len = strlen (iov -> iov_base = buffer);
117 iov -> iov_len = strlen (iov -> iov_base = " ");
119 iov -> iov_len = strlen (iov -> iov_base = what);
121 iov -> iov_len = strlen (iov -> iov_base = ": ");
124 if (eindex > 0 && eindex < sys_nerr)
125 iov -> iov_len = strlen (iov -> iov_base = sys_errlist[eindex]);
127 (void) sprintf (err, "Error %d", eindex);
128 iov -> iov_len = strlen (iov -> iov_base = err);
133 iov -> iov_len = strlen (iov -> iov_base = ", ");
135 iov -> iov_len = strlen (iov -> iov_base = tail);
138 iov -> iov_len = strlen (iov -> iov_base = "\n");
140 (void) writev (fileno (stderr), iob, iov - iob);
153 static char ident[] = "@@(#)$Id: advertise.c,v 1.2 1992/12/14 17:47:34 jromine Exp jromine $";
166 static char ident[] = "@@(#)$Id: pidwait.c,v 1.9 1992/12/14 17:10:58 jromine Exp $";