From: Antti Kantee Date: Wed, 15 Apr 2015 09:27:14 +0000 (+0000) Subject: print stub warnings to stderr X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=46d6bd0ee0c2cadd90f48136ec1b4db4cbca00be;p=people%2Fliuw%2Frumprun.git print stub warnings to stderr --- diff --git a/lib/librumprun_base/libc_stubs.c b/lib/librumprun_base/libc_stubs.c index 9890e55..6dbdace 100644 --- a/lib/librumprun_base/libc_stubs.c +++ b/lib/librumprun_base/libc_stubs.c @@ -26,12 +26,12 @@ #include #include -#define STUB(name) \ - int name(void); int name(void) { \ - static int done = 0; \ - errno = ENOTSUP; \ - if (done) return ENOTSUP; done = 1; \ - printf("STUB ``%s'' called\n", #name); \ +#define STUB(name) \ + int name(void); int name(void) { \ + static int done = 0; \ + errno = ENOTSUP; \ + if (done) return ENOTSUP; done = 1; \ + fprintf(stderr, "STUB ``%s'' called\n", #name); \ return ENOTSUP;} STUB(__sigaction14); @@ -60,12 +60,13 @@ STUB(_sys___msync13); STUB(_sys___wait450); STUB(_sys___sigsuspend14); +/* execve is open-coded to match the prototype to avoid a compiler warning */ int execve(const char *, char *const[], char *const[]); int execve(const char *file, char *const argv[], char *const envp[]) { - printf("execve not implemented\n"); + fprintf(stderr, "execve not implemented\n"); errno = ENOTSUP; return -1; }