wok-6.x view busybox/stuff/busybox-1.32-diet.u @ rev 25493
Add libgnt
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Nov 19 17:37:48 2022 +0000 (2022-11-19) |
parents | |
children |
line source
1 --- busybox-1.32/include/platform.h
2 +++ busybox-1.32/include/platform.h
3 @@ -537,6 +537,25 @@
4 # undef HAVE_PRINTF_PERCENTM
5 #endif
7 +#if defined(__dietlibc__)
8 +# define __aligned_u64 __u64 __attribute__((aligned(8)))
9 +# define LOOP_SET_STATUS64 0x4C04
10 +# define LOOP_GET_STATUS64 0x4C05
11 +# define MAXSYMLINKS 20
12 +# define S_TYPEISMQ(x) 0
13 +# define S_TYPEISSEM(x) 0
14 +# define S_TYPEISSHM(x) 0
15 +# define O_CLOEXEC 0
16 +# undef HAVE_STRVERSCMP
17 +# undef HAVE_DPRINTF
18 +# undef HAVE_STRCASESTR
19 +#undef ALWAYS_INLINE
20 +#define ALWAYS_INLINE inline
21 +#undef NOINLINE
22 +#define NOINLINE
23 +# define ttyname_r(a,b,c) (strlcpy(b, ttyname(a), c) == 0)
24 +#endif
25 +
26 /*
27 * Now, define prototypes for all the functions defined in platform.c
28 * These must come after all the HAVE_* macros are defined (or not)
29 --- busybox-1.31/networking/ping.c
30 +++ busybox-1.31/networking/ping.c
31 @@ -123,6 +124,84 @@
32 #include "libbb.h"
33 #include "common_bufsiz.h"
35 +#ifdef __dietlibc__
36 +/* Dietlibc is missing the BSD definition 'struct icmp' */
37 +/*
38 + * Internal of an ICMP Router Advertisement
39 + */
40 +struct icmp_ra_addr
41 +{
42 + uint32_t ira_addr;
43 + uint32_t ira_preference;
44 +};
45 +
46 +struct icmp
47 +{
48 + uint8_t icmp_type; /* type of message, see below */
49 + uint8_t icmp_code; /* type sub code */
50 + uint16_t icmp_cksum; /* ones complement checksum of struct */
51 + union
52 + {
53 + uint8_t ih_pptr; /* ICMP_PARAMPROB */
54 + struct in_addr ih_gwaddr; /* gateway address */
55 + struct ih_idseq /* echo datagram */
56 + {
57 + uint16_t icd_id;
58 + uint16_t icd_seq;
59 + } ih_idseq;
60 + uint32_t ih_void;
61 +
62 + /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
63 + struct ih_pmtu
64 + {
65 + uint16_t ipm_void;
66 + uint16_t ipm_nextmtu;
67 + } ih_pmtu;
68 +
69 + struct ih_rtradv
70 + {
71 + uint8_t irt_num_addrs;
72 + uint8_t irt_wpa;
73 + uint16_t irt_lifetime;
74 + } ih_rtradv;
75 + } icmp_hun;
76 +#define icmp_pptr icmp_hun.ih_pptr
77 +#define icmp_gwaddr icmp_hun.ih_gwaddr
78 +#define icmp_id icmp_hun.ih_idseq.icd_id
79 +#define icmp_seq icmp_hun.ih_idseq.icd_seq
80 +#define icmp_void icmp_hun.ih_void
81 +#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
82 +#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
83 +#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
84 +#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
85 +#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
86 + union
87 + {
88 + struct
89 + {
90 + uint32_t its_otime;
91 + uint32_t its_rtime;
92 + uint32_t its_ttime;
93 + } id_ts;
94 + struct
95 + {
96 + struct ip idi_ip;
97 + /* options and then 64 bits of data */
98 + } id_ip;
99 + struct icmp_ra_addr id_radv;
100 + uint32_t id_mask;
101 + uint8_t id_data[1];
102 + } icmp_dun;
103 +#define icmp_otime icmp_dun.id_ts.its_otime
104 +#define icmp_rtime icmp_dun.id_ts.its_rtime
105 +#define icmp_ttime icmp_dun.id_ts.its_ttime
106 +#define icmp_ip icmp_dun.id_ip.idi_ip
107 +#define icmp_radv icmp_dun.id_radv
108 +#define icmp_mask icmp_dun.id_mask
109 +#define icmp_data icmp_dun.id_data
110 +};
111 +#endif /* __dietlibc__ */
112 +
113 #ifdef __BIONIC__
114 /* should be in netinet/ip_icmp.h */
115 # define ICMP_DEST_UNREACH 3 /* Destination Unreachable */