]> git.saurik.com Git - apple/libdispatch.git/blob - testing/mig/client.c
libdispatch-84.5.3.tar.gz
[apple/libdispatch.git] / testing / mig / client.c
1 #include <mach/mach.h>
2 #include <mach/mach_error.h>
3 #include <servers/bootstrap.h>
4 #include <unistd.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <stdbool.h>
8
9 #include "hello_logger.h"
10
11 int main(int argc, char *argv[])
12 {
13 kern_return_t kr;
14 mach_port_t mp;
15
16 if (argc != 2) {
17 fprintf(stderr, "I need a string to send!\n");
18 exit(EXIT_FAILURE);
19 }
20
21 kr = bootstrap_look_up(bootstrap_port, HELLO_LOGGER_BOOTSTRAP_NAME, &mp);
22 if (kr != KERN_SUCCESS) {
23 fprintf(stderr, "bootstrap_look_up(): %s\n", bootstrap_strerror(kr));
24 exit(EXIT_FAILURE);
25 }
26
27 kr = example(mp, argv[1]);
28 if (kr != KERN_SUCCESS) {
29 fprintf(stderr, "test_hello_logger(): %s\n", mach_error_string(kr));
30 exit(EXIT_FAILURE);
31 }
32
33 exit(EXIT_SUCCESS);
34 }