diff options
author | Chris Johns <chrisj@rtems.org> | 2015-06-16 13:16:37 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2015-06-16 13:16:37 +1000 |
commit | b5aca585949aa94d8d254ab4c4e5b4b2f7b1f1d9 (patch) | |
tree | 7159a7f44d3817bd9654046fd68fc6a7894e4424 /rtemsbsd/include/machine/rtems-bsd-program.h | |
parent | Fix KVM symbol generator to remove warnings. (diff) | |
download | rtems-libbsd-b5aca585949aa94d8d254ab4c4e5b4b2f7b1f1d9.tar.bz2 |
Add error() to the BSD program support.
Diffstat (limited to 'rtemsbsd/include/machine/rtems-bsd-program.h')
-rw-r--r-- | rtemsbsd/include/machine/rtems-bsd-program.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/rtemsbsd/include/machine/rtems-bsd-program.h b/rtemsbsd/include/machine/rtems-bsd-program.h index b2e542e0..7c2837e7 100644 --- a/rtemsbsd/include/machine/rtems-bsd-program.h +++ b/rtemsbsd/include/machine/rtems-bsd-program.h @@ -56,6 +56,9 @@ rtems_bsd_program_call_main(const char *name, int (*main)(int, char **), void rtems_bsd_program_exit(int exit_code) __dead2; +void +rtems_bsd_program_error(const char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); + const char * rtems_bsd_program_get_name(void); @@ -69,14 +72,22 @@ void rtems_bsd_program_unlock(void); #ifndef RTEMS_BSD_PROGRAM_NO_EXIT_WRAP + #undef exit #define exit(code) rtems_bsd_program_exit(code) #endif +#ifndef RTEMS_BSD_PROGRAM_NO_ERROR_WRAP + #undef error + #define error(fmt, ...) rtems_bsd_program_error(fmt, ## __VA_ARGS__) +#endif + #ifndef RTEMS_BSD_PROGRAM_NO_GETPROGNAME_WRAP + #undef getprogname #define getprogname() rtems_bsd_program_get_name() #endif #ifndef RTEMS_BSD_PROGRAM_NO_PRINTF_WRAP + #undef printf #define printf(...) fprintf(stdout, __VA_ARGS__) #endif |