about summary refs log tree commit diff
path: root/compat/getprogname_linux.c
blob: 1850e8666b1f84c0ef0e6738ef689ae14d2738d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdlib.h>

#include <errno.h>

const char *
getprogname(void)
{
#if defined(__ANDROID_API__) && __ANDROID_API__ < 21
	/*
	 * Android added getprogname with API 21, so we should not end up here
	 * with APIs newer than 21.
	 * https://github.com/aosp-mirror/platform_bionic/blob/1eb6d3/libc/include/stdlib.h#L160
	 *
	 * Since Android is using portions of OpenBSD libc, it should have
	 * a symbol called __progname.
	 * https://github.com/aosp-mirror/platform_bionic/commit/692207
	 */
	extern const char *__progname;
	return __progname;
#else
	return program_invocation_short_name;
#endif
}
itten bio. 2022-06-05FIRST SHOW IN 2.5 YEARS BABEY!!!June McEnroe 2022-06-03Set line number on File linesJune McEnroe 2022-06-03Stop polling stdin after EOFJune McEnroe 2022-06-02Set TABSIZE=4June McEnroe Absolutely indiscriminately. 2022-06-02Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe For some reason I haven't been able to figure out, trying to poll /dev/tty returns POLLNVAL (and this was using 100% CPU looping), but using stderr instead works fine. 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe