1*0d601874SDavid du Colombier /* 2*0d601874SDavid du Colombier * The authors of this software are Rob Pike and Ken Thompson. 3*0d601874SDavid du Colombier * Copyright (c) 2002 by Lucent Technologies. 4*0d601874SDavid du Colombier * Permission to use, copy, modify, and distribute this software for any 5*0d601874SDavid du Colombier * purpose without fee is hereby granted, provided that this entire notice 6*0d601874SDavid du Colombier * is included in all copies of any software which is or includes a copy 7*0d601874SDavid du Colombier * or modification of this software and in all copies of the supporting 8*0d601874SDavid du Colombier * documentation for such software. 9*0d601874SDavid du Colombier * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10*0d601874SDavid du Colombier * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11*0d601874SDavid du Colombier * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12*0d601874SDavid du Colombier * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13*0d601874SDavid du Colombier */ 148ccd4a63SDavid du Colombier #include <u.h> 158ccd4a63SDavid du Colombier #include <libc.h> 168ccd4a63SDavid du Colombier #include "fmtdef.h" 178ccd4a63SDavid du Colombier 188ccd4a63SDavid du Colombier int 198ccd4a63SDavid du Colombier vfprint(int fd, char *fmt, va_list args) 208ccd4a63SDavid du Colombier { 218ccd4a63SDavid du Colombier Fmt f; 228ccd4a63SDavid du Colombier char buf[256]; 238ccd4a63SDavid du Colombier int n; 248ccd4a63SDavid du Colombier 258ccd4a63SDavid du Colombier fmtfdinit(&f, fd, buf, sizeof(buf)); 26*0d601874SDavid du Colombier VA_COPY(f.args,args); 278ccd4a63SDavid du Colombier n = dofmt(&f, fmt); 28*0d601874SDavid du Colombier VA_END(f.args); 29*0d601874SDavid du Colombier if(n > 0 && __fmtFdFlush(&f) == 0) 308ccd4a63SDavid du Colombier return -1; 318ccd4a63SDavid du Colombier return n; 328ccd4a63SDavid du Colombier } 33