summaryrefslogtreecommitdiff
path: root/microkernel/mach/gnumach/interface/syscall/mach_print/main.c
blob: 23b9fc88c466aa520a2ec3f76647c473fc5f4516 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>

void mach_print(char *);

int
main(int argc, char *argv[])
{
    int size;
    char *s;

    size = snprintf(NULL, 0, "%s\n", argv[1]);
    assert(size > 0);
    s = malloc(size);
    assert(s != NULL);
    sprintf(s, "%s\n", argv[1]);
    mach_print(s);
    free(s);
    return EXIT_SUCCESS;
}