-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlibinfo.h
45 lines (36 loc) · 966 Bytes
/
libinfo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*!
* interfaces to display library parameters
*/
#include <unistd.h>
#ifdef __GNUC__
# ifdef __linux__
# ifdef __x86_64__
const char _lib_interp[] __attribute__((section(".interp"))) = "/lib64/ld-linux-x86-64.so.2";
# elif __i386
const char _lib_interp[] __attribute__((section(".interp"))) = "/lib/ld-linux.so.2";
# endif /* <architecture> */
# endif /* <system> */
#endif /* <compiler> */
static void _library_ident(const char *ident)
{
int len = 0;
while (ident[len]) len++;
(void) write(STDOUT_FILENO, ident, len);
#ifdef SHLIB_INFO
ident = " ("SHLIB_INFO")\0";
len = 0;
while (ident[len]) len++;
(void) write(STDOUT_FILENO, ident, len);
#endif
(void) write(STDOUT_FILENO, "\n", 1);
}
static void _library_task(const char *task)
{
static const char txt[] = " - \n";
int len;
(void) write(STDOUT_FILENO, txt, 4);
len = 0;
while (task[len]) len++;
(void) write(STDOUT_FILENO, task, len);
(void) write(STDOUT_FILENO, txt+4, 1);
}