diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index 2593c3ad2..3bec43233 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -289,6 +289,30 @@ void xpipe(int filedes[2]); | |||
289 | off_t xlseek(int fd, off_t offset, int whence); | 289 | off_t xlseek(int fd, off_t offset, int whence); |
290 | off_t fdlength(int fd); | 290 | off_t fdlength(int fd); |
291 | 291 | ||
292 | /* Useful for having small structure members/global variables */ | ||
293 | typedef int8_t socktype_t; | ||
294 | typedef int8_t family_t; | ||
295 | struct BUG_too_small { | ||
296 | char BUG_socktype_t_too_small[(0 | ||
297 | | SOCK_STREAM | ||
298 | | SOCK_DGRAM | ||
299 | | SOCK_RDM | ||
300 | | SOCK_SEQPACKET | ||
301 | | SOCK_RAW | ||
302 | ) <= 127 ? 1 : -1]; | ||
303 | char BUG_family_t_too_small[(0 | ||
304 | | AF_UNSPEC | ||
305 | | AF_INET | ||
306 | | AF_INET6 | ||
307 | | AF_UNIX | ||
308 | | AF_PACKET | ||
309 | | AF_NETLINK | ||
310 | /* | AF_DECnet */ | ||
311 | /* | AF_IPX */ | ||
312 | ) <= 127 ? 1 : -1]; | ||
313 | }; | ||
314 | |||
315 | |||
292 | int xsocket(int domain, int type, int protocol); | 316 | int xsocket(int domain, int type, int protocol); |
293 | void xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen); | 317 | void xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen); |
294 | void xlisten(int s, int backlog); | 318 | void xlisten(int s, int backlog); |