| From | Sent On | Attachments |
|---|---|---|
| Alfred Perlstein | Jul 10, 2000 3:05 pm | |
| Brian Fundakowski Feldman | Jul 10, 2000 5:16 pm | |
| Alfred Perlstein | Jul 10, 2000 5:35 pm | |
| Matthew Jacob | Jul 10, 2000 5:50 pm | |
| Mike Smith | Jul 10, 2000 5:57 pm | |
| Alfred Perlstein | Jul 10, 2000 6:15 pm | |
| Greg Lehey | Jul 10, 2000 6:41 pm | |
| Assar Westerlund | Jul 10, 2000 8:04 pm | |
| Sheldon Hearn | Jul 11, 2000 1:20 am | |
| Alfred Perlstein | Jul 11, 2000 1:32 am | |
| Mike Pritchard | Jul 11, 2000 2:13 am | |
| Bruce Evans | Jul 11, 2000 3:03 am | |
| Alfred Perlstein | Jul 11, 2000 3:18 am | |
| Bruce Evans | Jul 11, 2000 9:32 am | |
| Marius Bendiksen | Jul 11, 2000 1:30 pm | |
| Dag-Erling Smorgrav | Jul 12, 2000 12:29 am | |
| Thomas M. Sommers | Jul 12, 2000 2:59 pm | |
| Thomas M. Sommers | Jul 12, 2000 4:08 pm | |
| John-Mark Gurney | Jul 12, 2000 8:53 pm | |
| Alexander Langer | Jul 17, 2000 1:24 am | |
| Alfred Perlstein | Jul 17, 2000 2:40 am | |
| Alexander Langer | Jul 17, 2000 2:43 am | |
| Bruce Evans | Jul 18, 2000 3:29 am | |
| Alexander Langer | Jul 18, 2000 3:32 am |
| Subject: | Re: kernel printf %i? | |
|---|---|---|
| From: | Thomas M. Sommers (tm...@mail.ptd.net) | |
| Date: | Jul 12, 2000 4:08:29 pm | |
| List: | org.freebsd.freebsd-arch | |
"Thomas M. Sommers" wrote:
Dag-Erling Smorgrav wrote:
Speaking of printf(), there are two things I'd like to see added:
- in libc, a *dprintf() family similar to *fprintf() except that they write to a file descriptor instead of a FILE *.
How about something like this:
<bad code snipped>
Or better yet, this:
#include <errno.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h>
int dprintf(int fd, const char *format, ...) { char *buf; int err = -1; int len; va_list args;
va_start(args, format); len = vasprintf(&buf, format, args); va_end(args);
if ( len != -1 ) { err = write(fd, buf, len); free(buf); } else { errno = ENOMEM; }
return err; }
Thanks to Steve Kargl <sg...@troutmask.apl.washington.edu> for pointing out my error.
To Unsubscribe: send mail to majo...@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message





