2 * nonstd.h - A collection of trivial wrappers to allow typical libraries
3 * to work within the yaboot environment.
5 * Copyright 2011 Tony Breeds, IBM Corporation
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 /* Copied from asm-generic/errno-base.h */
26 #define EPERM 1 /* Operation not permitted */
27 #define EBADF 9 /* Bad file number */
28 #define EACCES 13 /* Permission denied */
29 #define EFAULT 14 /* Bad address */
33 typedef unsigned int uid_t;
35 typedef unsigned int mode_t;
37 typedef long long off64_t;
50 int printf(const char *format, ...);
51 int fprintf(FILE *stream, const char *format, ...);
52 int fputs(const char *s, FILE *stream);
53 int fflush(FILE *stream);
54 char *getenv(const char *name);
55 int gethostname(char *name, size_t len);
56 int gettimeofday(struct timeval *tv, struct timezone *tz);
57 int * __errno_location(void);
58 unsigned int sleep(unsigned int seconds);
60 void srand(unsigned int seed);
61 long int random(void);
62 void srandom(unsigned int seed);
66 int stat(const char *path, struct stat *buf);
67 int stat64(const char *path, struct stat *buf);
68 int fstat(int fd, struct stat *buf);
69 int fstat64(int fd, struct stat *buf);
70 int open(const char *pathname, int flags, mode_t mode);
71 int open64(const char *pathname, int flags, mode_t mode);
72 off_t lseek(int fd, off_t offset, int whence);
73 off64_t lseek64(int fd, off64_t offset, int whence);
74 ssize_t read(int fildes, void *buf, size_t nbyte);
76 void *calloc(size_t nmemb, size_t size);
77 void perror(const char *s);
78 void exit(int status);
79 int ioctl(int d, int request, ...);
80 size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
81 long sysconf(int name);
82 int getpagesize(void);
83 void qsort(void *base, size_t nmemb, size_t size,
84 int(*compar)(const void *, const void *));
85 ssize_t write(int fd, const void *buf, size_t count);
86 int fallocate(int fd, int mode, off_t offset, off_t len);
87 unsigned long long int strtoull(const char *nptr, char **endptr, int base);
89 int __open64_2(const char *pathname, int flags);
90 int __xstat64(int vers, const char *name, struct stat64 *buf);
91 int uname(struct utsname *buf);
92 int getrlimit(int resource, struct rlimit *rlim);
93 int setrlimit(int resource, const struct rlimit *rlim);
94 int __fxstat64(int vers, int fd, struct stat64 *buf);