diff options
| -rw-r--r-- | src/main.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -1,6 +1,25 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> + +#include <sys/syslog.h> +#include <syslog.h> int main(int argc, char **argv) { + char *str = NULL; + size_t n = 0; + + openlog(NULL, LOG_PID, LOG_LOCAL0); + + for (int i = 0; i < argc; i++) + n += strlen(*argv+i); + + if ((str = malloc(n + 1)) == NULL) { + perror("main: malloc failed"); + exit(EXIT_FAILURE); + } + + syslog(LOG_DEBUG, "args: %s\n", str); + return 0; } |
