blob: 4463635d42bb90b14590543d36626c2709ce97c6 [file] [log] [blame]
Tanguy Pruvot8aeb3712011-06-30 08:59:26 +02001/* vi: set sw=4 ts=4: */
2/*
3 Copyright 2010, Dylan Simon
4
5 Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
6*/
7
8#ifndef BB_ANDROID_H
9#define BB_ANDROID_H 1
10
11/* for dirname, basename */
12#include <libgen.h>
13
14#if ENABLE_FEATURE_DC_LIBM
15# include <math.h>
16#endif
17
18#define killpg_busybox(P, S) kill(-(P), S)
19
20#define setmntent fopen
21#define endmntent fclose
22
23/* defined in bionic/utmp.c */
24void endutent(void);
25
26/* defined in bionic/mktemp.c */
27char *mkdtemp(char *);
28
29/* defined in bionic/stubs.c */
30char *ttyname(int);
31
Tanguy Pruvot301d3112012-07-14 01:49:18 +020032/* SYSCALLS */
Tanguy Pruvot6fef6a32012-05-05 15:26:43 +020033int stime(time_t *);
34int swapon(const char *, int);
35int swapoff(const char *);
36int getsid(pid_t);
Tanguy Pruvot8aeb3712011-06-30 08:59:26 +020037
Tanguy Pruvot301d3112012-07-14 01:49:18 +020038#ifndef SYS_ioprio_set
39#define SYS_ioprio_set __NR_ioprio_set
40#define SYS_ioprio_get __NR_ioprio_get
41#endif
42
Tanguy Pruvot8aeb3712011-06-30 08:59:26 +020043/* local definition in libbb/xfuncs_printf.c */
44int fdprintf(int fd, const char *format, ...);
45
46/* local definitions in libbb/android.c */
47int ttyname_r(int, char *, size_t);
48
49char *getusershell(void);
50void setusershell(void);
51void endusershell(void);
52
53struct mntent;
54struct __sFILE;
55int addmntent(struct __sFILE *, const struct mntent *);
56struct mntent *getmntent_r(struct __sFILE *fp, struct mntent *mnt, char *buf, int buflen);
57const char *hasmntopt(const struct mntent *, const char *);
58
59#define MNTOPT_NOAUTO "noauto"
60
61/* bionic's vfork is rather broken; for now a terrible bandaid: */
62#define vfork fork
63
Tanguy Pruvot8a6c2c22012-04-28 00:24:09 +020064#define _SOCKLEN_T_DECLARED
65typedef int socklen_t;
66
Tanguy Pruvot8aeb3712011-06-30 08:59:26 +020067#endif