Magellan Linux

Contents of /trunk/mkinitrd-magellan/klibc/usr/klibc/vfprintf.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (show annotations) (download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File MIME type: text/plain
File size: 393 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd

1 /*
2 * vfprintf.c
3 */
4
5 #include <stdio.h>
6 #include <string.h>
7 #include <stdarg.h>
8 #include <unistd.h>
9
10 #define BUFFER_SIZE 32768
11
12 int vfprintf(FILE * file, const char *format, va_list ap)
13 {
14 int rv;
15 char buffer[BUFFER_SIZE];
16
17 rv = vsnprintf(buffer, BUFFER_SIZE, format, ap);
18
19 if (rv < 0)
20 return rv;
21
22 if (rv > BUFFER_SIZE - 1)
23 rv = BUFFER_SIZE - 1;
24
25 return _fwrite(buffer, rv, file);
26 }