Blame


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