diff options
Diffstat (limited to 'include/libbb.h')
-rw-r--r-- | include/libbb.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/include/libbb.h b/include/libbb.h index 08fed90..1231b31 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -302,6 +302,17 @@ extern char *bb_get_last_path_component_strip(char *path) FAST_FUNC; /* "abc/def/" -> "" and it never modifies 'path' */ extern char *bb_get_last_path_component_nostrip(const char *path) FAST_FUNC; +/* What's the best place for this? */ +#define ATLAS_HOME "/home/atlas" +#define ATLAS_CRONS ATLAS_HOME "/crons" +#define ATLAS_STATUS ATLAS_HOME "/status" +#define ATLAS_DATA_OUT ATLAS_HOME "/data/out" +#define ATLAS_DATA_OOQ_OUT ATLAS_HOME "/data/ooq.out" +#define ATLAS_DATA_NEW ATLAS_HOME "/data/new" +#define ATLAS_TIMESYNC_FILE ATLAS_STATUS "/timesync.vol" + +extern int validate_filename(const char *path, const char *prefix); + int ndelay_on(int fd) FAST_FUNC; int ndelay_off(int fd) FAST_FUNC; int close_on_exec_on(int fd) FAST_FUNC; @@ -319,6 +330,10 @@ char *xrealloc_getcwd_or_warn(char *cwd) FAST_FUNC; char *xmalloc_follow_symlinks(const char *path) FAST_FUNC; +extern size_t strlcat(char *__restrict dst, const char *__restrict src, + size_t n) __THROW __nonnull ((1, 2)); +extern size_t strlcpy(char *__restrict dst, const char *__restrict src, + size_t n) __THROW __nonnull ((1, 2)); enum { /* bb_signals(BB_FATAL_SIGS, handler) catches all signals which @@ -422,13 +437,20 @@ struct BUG_too_small { ) <= 127 ? 1 : -1]; }; - int xsocket(int domain, int type, int protocol) FAST_FUNC; void xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen) FAST_FUNC; +void xrbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen, + void (*reportf)(int err)) FAST_FUNC; void xlisten(int s, int backlog) FAST_FUNC; void xconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen) FAST_FUNC; +void xrconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen, + void (*reportf)(int err)) FAST_FUNC; ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to, socklen_t tolen) FAST_FUNC; +ssize_t xrsendto(int s, const void *buf, size_t len, const struct sockaddr *to, + socklen_t tolen, void (*reportf)(int err)) FAST_FUNC; +ssize_t rsendto(int s, const void *buf, size_t len, const struct sockaddr *to, + socklen_t tolen, void (*reportf)(int err)) FAST_FUNC; /* SO_REUSEADDR allows a server to rebind to an address that is already * "in use" by old connections to e.g. previous server instance which is * killed or crashed. Without it bind will fail until all such connections @@ -526,6 +548,8 @@ struct hostent *xgethostbyname(const char *name) FAST_FUNC; // Also mount.c and inetd.c are using gethostbyname(), // + inet_common.c has additional IPv4-only stuff +len_and_sockaddr* get_sock_lsa(int fd) FAST_FUNC; + void socket_want_pktinfo(int fd) FAST_FUNC; ssize_t send_to_from(int fd, void *buf, size_t len, int flags, @@ -1302,6 +1326,7 @@ procps_status_t* procps_scan(procps_status_t* sp, int flags) FAST_FUNC; /* Puts [comm] if cmdline is empty (-> process is a kernel thread) */ void read_cmdline(char *buf, int col, unsigned pid, const char *comm) FAST_FUNC; pid_t *find_pid_by_name(const char* procName) FAST_FUNC; +int comm_match(procps_status_t *p, const char *procName); pid_t *pidlist_reverse(pid_t *pidList) FAST_FUNC; |