diff options
Diffstat (limited to 'newlib/libc/sys/linux/include')
-rw-r--r-- | newlib/libc/sys/linux/include/alloca.h | 13 | ||||
-rw-r--r-- | newlib/libc/sys/linux/include/getopt.h | 27 | ||||
-rw-r--r-- | newlib/libc/sys/linux/include/stdint.h | 18 | ||||
-rw-r--r-- | newlib/libc/sys/linux/include/unistd.h | 20 |
4 files changed, 78 insertions, 0 deletions
diff --git a/newlib/libc/sys/linux/include/alloca.h b/newlib/libc/sys/linux/include/alloca.h new file mode 100644 index 000000000..ba542627d --- /dev/null +++ b/newlib/libc/sys/linux/include/alloca.h @@ -0,0 +1,13 @@ +/* libc/sys/linux/include/alloca.h - Allocate memory on stack */ + +/* Written 2000 by Werner Almesberger */ + + +#ifndef _NEWLIB_ALLOCA_H +#define _NEWLIB_ALLOCA_H + +/* Simple, since we know that we use gcc */ + +#define alloca(size) __builtin_alloca(size) + +#endif diff --git a/newlib/libc/sys/linux/include/getopt.h b/newlib/libc/sys/linux/include/getopt.h new file mode 100644 index 000000000..994f86001 --- /dev/null +++ b/newlib/libc/sys/linux/include/getopt.h @@ -0,0 +1,27 @@ +/* libc/sys/linux/include/getopt.h - Extended command line parsing */ + +/* Written 2000 by Werner Almesberger */ + + +#ifndef _NEWLIB_GETOPT_H +#define _NEWLIB_GETOPT_H + +#include <unistd.h> + + +enum { no_argument, required_argument, optional_argument }; + +struct option { + const char *name; + int has_arg; + int *flag; + int val; +}; + +int getopt_long(int argc,char *const argv[],const char *optstring, + const struct option *longopts,int *longindex); + +int getopt_long_only(int argc,char *const argv[],const char *optstring, + const struct option *longopts,int *longindex); + +#endif diff --git a/newlib/libc/sys/linux/include/stdint.h b/newlib/libc/sys/linux/include/stdint.h new file mode 100644 index 000000000..5c89acd22 --- /dev/null +++ b/newlib/libc/sys/linux/include/stdint.h @@ -0,0 +1,18 @@ +/* libc/sys/linux/include/stdint.h - Standard integer types */ + +/* Written 2000 by Werner Almesberger */ + + +#ifndef _NEWLIB_STDINT_H +#define _NEWLIB_STDINT_H + +/* + * FIXME: linux/types.h defines various types that rightfully belong into + * stdint.h. So we have no choice but to include linux/types.h directly, even + * if this causes name space pollution. Note: we have to go via sys/types.h + * in order to resolve some other compatibility issues. + */ + +#include <sys/types.h> + +#endif diff --git a/newlib/libc/sys/linux/include/unistd.h b/newlib/libc/sys/linux/include/unistd.h new file mode 100644 index 000000000..e2f562a3a --- /dev/null +++ b/newlib/libc/sys/linux/include/unistd.h @@ -0,0 +1,20 @@ +/* libc/sys/linux/include/unistd.h - Various standard functions */ + +/* Written 2000 by Werner Almesberger */ + + +#ifndef _NEWLIB_UNISTD_H +#define _NEWLIB_UNISTD_H + +#include <sys/types.h> +#include <sys/unistd.h> + +/* Declare some missing goodies */ + +extern char *optarg; +extern int optind, opterr, optopt; + + +int readlink(const char *path, char *buf, size_t bufsiz); + +#endif |