Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
532 B

  1. #include <stdarg.h>
  2. #include <sys/uio.h>
  3. #include "errmsg.h"
  4. #include "str.h"
  5. #include <string.h>
  6. #include <errno.h>
  7. extern int errmsg_cvt(struct iovec* x,const char* message, va_list a);
  8. void errmsg_warnsys(const char* message, ...) {
  9. struct iovec x[25];
  10. va_list a;
  11. int i;
  12. va_start(a,message);
  13. i=errmsg_cvt(x,message,a);
  14. x[i-1].iov_base=": ";
  15. x[i-1].iov_len=2;
  16. x[i].iov_base=strerror(errno);
  17. x[i].iov_len=str_len(x[i].iov_base);
  18. x[i+1].iov_base="\n";
  19. x[i+1].iov_len=1;
  20. writev(2,x,i+2);
  21. va_end(a);
  22. }