Blame


1 12042ad7 2021-01-21 op /*
2 12042ad7 2021-01-21 op * Copyright (c) 2021 Omar Polo <op@omarpolo.com>
3 12042ad7 2021-01-21 op *
4 12042ad7 2021-01-21 op * Permission to use, copy, modify, and distribute this software for any
5 12042ad7 2021-01-21 op * purpose with or without fee is hereby granted, provided that the above
6 12042ad7 2021-01-21 op * copyright notice and this permission notice appear in all copies.
7 12042ad7 2021-01-21 op *
8 12042ad7 2021-01-21 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 12042ad7 2021-01-21 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 12042ad7 2021-01-21 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 12042ad7 2021-01-21 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 12042ad7 2021-01-21 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 12042ad7 2021-01-21 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 12042ad7 2021-01-21 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 12042ad7 2021-01-21 op */
16 12042ad7 2021-01-21 op
17 7e262563 2021-01-22 op #include "../config.h"
18 7e262563 2021-01-22 op
19 a72cc6be 2021-02-11 op #ifdef HAVE_PROGRAM_INVOCATION_SHORT_NAME
20 a72cc6be 2021-02-11 op
21 a72cc6be 2021-02-11 op #include <errno.h>
22 a72cc6be 2021-02-11 op
23 a72cc6be 2021-02-11 op extern char *program_invocation_short_name;
24 a72cc6be 2021-02-11 op
25 12042ad7 2021-01-21 op const char *
26 12042ad7 2021-01-21 op getprogname(void)
27 12042ad7 2021-01-21 op {
28 a72cc6be 2021-02-11 op return program_invocation_short_name;
29 a72cc6be 2021-02-11 op }
30 a72cc6be 2021-02-11 op
31 a72cc6be 2021-02-11 op #else
32 a72cc6be 2021-02-11 op
33 a72cc6be 2021-02-11 op const char *
34 a72cc6be 2021-02-11 op getprogname(void)
35 a72cc6be 2021-02-11 op {
36 12042ad7 2021-01-21 op return "gmid";
37 12042ad7 2021-01-21 op }
38 a72cc6be 2021-02-11 op
39 a72cc6be 2021-02-11 op #endif