1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. */
5 #include "nacl_io/log.h"
7 #include "nacl_io/kernel_wrap_real.h"
14 void nacl_io_log(const char* format
, ...) {
20 /* TODO(sbc): vsnprintf on win32 does not return the
21 * size of the buffer needed. This can be implemented
22 * on win32 in terms of _vscprintf; */
23 #error "not implemented for win32"
26 va_start(args
, format
);
27 int len
= vsnprintf(NULL
, 0, format
, args
);
29 output
= alloca(len
+ 1);
31 va_start(args
, format
);
32 vsnprintf(output
, len
+ 1, format
, args
);
35 _real_write(2, output
, strlen(output
), &wrote
);