Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(554)

Side by Side Diff: libraries/nacl-mounts/util/DebugPrint.h

Issue 10556007: changes in memory mount and socket subsystem to port thttpd (Closed) Base URL: http://naclports.googlecode.com/svn/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 #ifndef PACKAGES_LIBRARIES_NACL_MOUNTS_UTIL_DEBUGPRINT_H_ 6 #ifndef PACKAGES_LIBRARIES_NACL_MOUNTS_UTIL_DEBUGPRINT_H_
7 #define PACKAGES_LIBRARIES_NACL_MOUNTS_UTIL_DEBUGPRINT_H_ 7 #define PACKAGES_LIBRARIES_NACL_MOUNTS_UTIL_DEBUGPRINT_H_
8 8
9 #include <stdio.h> 9 #include <stdio.h>
10 #include <stdarg.h> 10 #include <stdarg.h>
11 #include <sys/types.h> 11 #include <sys/types.h>
12 12
13 #ifdef __cplusplus
13 extern "C" { 14 extern "C" {
15 #endif
14 ssize_t __real_write(int fd, const void *buf, size_t count); 16 ssize_t __real_write(int fd, const void *buf, size_t count);
17 #ifdef __cplusplus
15 } 18 }
19 #endif
16 20
17 static int dbgprintf(const char* format, ...) { 21 static int dbgprintf(const char* format, ...) {
18 const int buf_size = 1000; 22 const int buf_size = 1000;
19 char buf[buf_size]; 23 char buf[buf_size];
20 va_list args; 24 va_list args;
21 va_start(args, format); 25 va_start(args, format);
22 ssize_t r = vsnprintf(buf, buf_size, format, args); 26 ssize_t r = vsnprintf(buf, buf_size, format, args);
23 if (r > 0) 27 if (r > 0)
24 __real_write(2, buf, r); 28 __real_write(2, buf, r);
25 va_end(args); 29 va_end(args);
26 return r; 30 return r;
27 } 31 }
28 32
29 #endif // PACKAGES_LIBRARIES_NACL_MOUNTS_UTIL_DEBUGPRINT_H_ 33 #endif // PACKAGES_LIBRARIES_NACL_MOUNTS_UTIL_DEBUGPRINT_H_
OLDNEW
« libraries/nacl-mounts/base/KernelProxy.cc ('K') | « libraries/nacl-mounts/pepper/PepperMount.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698