Changeset 7f9df7b9 in mainline for uspace/lib/posix/include
- Timestamp:
- 2018-01-22T22:42:57Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7a08c70
- Parents:
- e0f47f5
- Location:
- uspace/lib/posix/include/posix
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/include/posix/ctype.h
re0f47f5 r7f9df7b9 37 37 #define POSIX_CTYPE_H_ 38 38 39 #ifndef __POSIX_DEF__40 #define __POSIX_DEF__(x) x41 #endif42 43 39 #include "libc/ctype.h" 44 40 -
uspace/lib/posix/include/posix/dirent.h
re0f47f5 r7f9df7b9 36 36 #define POSIX_DIRENT_H_ 37 37 38 #ifndef __POSIX_DEF__39 #define __POSIX_DEF__(x) x40 #endif41 42 38 #include <libc/dirent.h> 43 39 -
uspace/lib/posix/include/posix/dlfcn.h
re0f47f5 r7f9df7b9 34 34 #define POSIX_DLFCN_H_ 35 35 36 #ifndef __POSIX_DEF__ 37 #define __POSIX_DEF__(x) x 38 #endif 36 #include "libc/dlfcn.h" 39 37 40 38 #define RTLD_LAZY 1 … … 43 41 #define RTLD_LOCAL 0 44 42 45 46 extern void *__POSIX_DEF__(dlopen)(const char *, int); 47 extern void *__POSIX_DEF__(dlsym)(void *, const char *); 48 extern int __POSIX_DEF__(dlclose)(void *); 49 extern char *__POSIX_DEF__(dlerror)(void); 50 43 extern void *dlopen(const char *, int); 44 extern void *dlsym(void *, const char *); 45 extern int dlclose(void *); 46 extern char *dlerror(void); 51 47 52 48 #endif -
uspace/lib/posix/include/posix/fcntl.h
re0f47f5 r7f9df7b9 35 35 #ifndef POSIX_FCNTL_H_ 36 36 #define POSIX_FCNTL_H_ 37 38 #ifndef __POSIX_DEF__39 #define __POSIX_DEF__(x) x40 #endif41 37 42 38 #include "sys/types.h" … … 93 89 #define FD_CLOEXEC 1 /* Close on exec. */ 94 90 95 extern int __POSIX_DEF__(open)(const char *pathname, int flags, ...); 96 extern int __POSIX_DEF__(fcntl)(int fd, int cmd, ...); 97 91 extern int open(const char *pathname, int flags, ...); 92 extern int fcntl(int fd, int cmd, ...); 98 93 99 94 #endif /* POSIX_FCNTL_H_ */ -
uspace/lib/posix/include/posix/fenv.h
re0f47f5 r7f9df7b9 37 37 #define POSIX_FENV_H_ 38 38 39 40 39 #define FE_DIVBYZERO 1 41 40 #define FE_INEXACT 2 -
uspace/lib/posix/include/posix/fnmatch.h
re0f47f5 r7f9df7b9 36 36 #define POSIX_FNMATCH_H_ 37 37 38 #ifndef __POSIX_DEF__39 #define __POSIX_DEF__(x) x40 #endif41 42 38 /* Error Values */ 43 39 #undef FNM_NOMATCH … … 60 56 #define FNM_CASEFOLD 16 61 57 62 extern int __POSIX_DEF__(fnmatch)(const char *pattern, const char *string, int flags);58 extern int fnmatch(const char *pattern, const char *string, int flags); 63 59 64 60 -
uspace/lib/posix/include/posix/getopt.h
re0f47f5 r7f9df7b9 35 35 #define POSIX_GETOPT_H 36 36 37 #ifndef __POSIX_DEF__38 #define __POSIX_DEF__(x) x39 #endif40 41 37 #include "unistd.h" 42 38 … … 55 51 #endif 56 52 57 extern int __POSIX_DEF__(getopt_long)(int, char * const [], const char *, const struct option *, int *);53 extern int getopt_long(int, char * const [], const char *, const struct option *, int *); 58 54 59 55 -
uspace/lib/posix/include/posix/inttypes.h
re0f47f5 r7f9df7b9 36 36 #define POSIX_INTTYPES_H_ 37 37 38 #ifndef __POSIX_DEF__39 #define __POSIX_DEF__(x) x40 #endif41 42 38 #include "stdint.h" 43 39 #include "libc/inttypes.h" -
uspace/lib/posix/include/posix/locale.h
re0f47f5 r7f9df7b9 36 36 #define POSIX_LOCALE_H_ 37 37 38 #ifndef __POSIX_DEF__39 #define __POSIX_DEF__(x) x40 #endif41 42 38 #include <_bits/NULL.h> 43 39 44 40 #ifndef __locale_t_defined 45 41 #define __locale_t_defined 46 typedef struct __posix_locale * __POSIX_DEF__(locale_t);42 typedef struct __posix_locale *locale_t; 47 43 #ifndef LIBPOSIX_INTERNAL 48 #define locale_t __POSIX_DEF__(locale_t)44 #define locale_t locale_t 49 45 #endif 50 46 #endif … … 84 80 #define LC_GLOBAL_LOCALE NULL 85 81 86 struct __POSIX_DEF__(lconv){82 struct lconv { 87 83 char *currency_symbol; 88 84 char *decimal_point; … … 111 107 }; 112 108 113 extern char * __POSIX_DEF__(setlocale)(int category, const char *locale);114 extern struct __POSIX_DEF__(lconv) *__POSIX_DEF__(localeconv)(void);109 extern char *setlocale(int category, const char *locale); 110 extern struct lconv *localeconv(void); 115 111 116 112 /* POSIX Extensions */ 117 extern __POSIX_DEF__(locale_t) __POSIX_DEF__(duplocale)(__POSIX_DEF__(locale_t)locobj);118 extern void __POSIX_DEF__(freelocale)(__POSIX_DEF__(locale_t)locobj);119 extern __POSIX_DEF__(locale_t) __POSIX_DEF__(newlocale)(int category_mask, const char *locale,120 __POSIX_DEF__(locale_t)base);121 extern __POSIX_DEF__(locale_t) __POSIX_DEF__(uselocale)(__POSIX_DEF__(locale_t)newloc);113 extern locale_t duplocale(locale_t locobj); 114 extern void freelocale(locale_t locobj); 115 extern locale_t newlocale(int category_mask, const char *locale, 116 locale_t base); 117 extern locale_t uselocale(locale_t newloc); 122 118 123 119 -
uspace/lib/posix/include/posix/pthread.h
re0f47f5 r7f9df7b9 32 32 #ifndef POSIX_PTHREAD_H_ 33 33 #define POSIX_PTHREAD_H_ 34 35 #ifndef __POSIX_DEF__36 #define __POSIX_DEF__(x) x37 #endif38 34 39 35 #include "libc/thread.h" … … 99 95 extern int pthread_cond_signal(pthread_cond_t *); 100 96 extern int pthread_cond_timedwait(pthread_cond_t *__restrict__, 101 pthread_mutex_t *__restrict__, const struct __POSIX_DEF__(timespec)*__restrict__);97 pthread_mutex_t *__restrict__, const struct timespec *__restrict__); 102 98 extern int pthread_cond_wait(pthread_cond_t *__restrict__, 103 99 pthread_mutex_t *__restrict__); -
uspace/lib/posix/include/posix/pwd.h
re0f47f5 r7f9df7b9 36 36 #define POSIX_PWD_H_ 37 37 38 #ifndef __POSIX_DEF__39 #define __POSIX_DEF__(x) x40 #endif41 42 38 #include "sys/types.h" 43 39 44 struct __POSIX_DEF__(passwd){40 struct passwd { 45 41 char *pw_name; 46 __POSIX_DEF__(uid_t)pw_uid;47 __POSIX_DEF__(gid_t)pw_gid;42 uid_t pw_uid; 43 gid_t pw_gid; 48 44 char *pw_dir; 49 45 char *pw_shell; 50 46 }; 51 47 52 extern struct __POSIX_DEF__(passwd) *__POSIX_DEF__(getpwent)(void);53 extern void __POSIX_DEF__(setpwent)(void);54 extern void __POSIX_DEF__(endpwent)(void);48 extern struct passwd *getpwent(void); 49 extern void setpwent(void); 50 extern void endpwent(void); 55 51 56 extern struct __POSIX_DEF__(passwd) *__POSIX_DEF__(getpwnam)(const char *name);57 extern int __POSIX_DEF__(getpwnam_r)(const char *name, struct __POSIX_DEF__(passwd)*pwd,58 char *buffer, size_t bufsize, struct __POSIX_DEF__(passwd)**result);52 extern struct passwd *getpwnam(const char *name); 53 extern int getpwnam_r(const char *name, struct passwd *pwd, 54 char *buffer, size_t bufsize, struct passwd **result); 59 55 60 extern struct __POSIX_DEF__(passwd) *__POSIX_DEF__(getpwuid)(__POSIX_DEF__(uid_t)uid);61 extern int __POSIX_DEF__(getpwuid_r)(__POSIX_DEF__(uid_t) uid, struct __POSIX_DEF__(passwd)*pwd,62 char *buffer, size_t bufsize, struct __POSIX_DEF__(passwd)**result);56 extern struct passwd *getpwuid(uid_t uid); 57 extern int getpwuid_r(uid_t uid, struct passwd *pwd, 58 char *buffer, size_t bufsize, struct passwd **result); 63 59 64 60 -
uspace/lib/posix/include/posix/signal.h
re0f47f5 r7f9df7b9 36 36 #define POSIX_SIGNAL_H_ 37 37 38 #ifndef __POSIX_DEF__39 #define __POSIX_DEF__(x) x40 #endif41 42 38 #include "sys/types.h" 43 39 #include <posix/ucontext.h> … … 63 59 int si_errno; 64 60 65 __POSIX_DEF__(pid_t)si_pid;66 __POSIX_DEF__(uid_t)si_uid;61 pid_t si_pid; 62 uid_t si_uid; 67 63 void *si_addr; 68 64 int si_status; … … 70 66 long si_band; 71 67 72 union __POSIX_DEF__(sigval)si_value;73 } __POSIX_DEF__(siginfo_t);74 75 struct __POSIX_DEF__(sigaction){68 union sigval si_value; 69 } siginfo_t; 70 71 struct sigaction { 76 72 void (*sa_handler)(int); 77 __POSIX_DEF__(sigset_t)sa_mask;73 sigset_t sa_mask; 78 74 int sa_flags; 79 void (*sa_sigaction)(int, __POSIX_DEF__(siginfo_t)*, void *);75 void (*sa_sigaction)(int, siginfo_t *, void *); 80 76 }; 81 77 82 78 83 /* Values of __POSIX_DEF__(sigevent)::sigev_notify */79 /* Values of sigevent::sigev_notify */ 84 80 #undef SIGEV_NONE 85 81 #undef SIGEV_SIGNAL … … 229 225 }; 230 226 231 extern int __POSIX_DEF__(sigaction)(int sig, const struct __POSIX_DEF__(sigaction)*__restrict__ act,232 struct __POSIX_DEF__(sigaction)*__restrict__ oact);233 234 extern void (* __POSIX_DEF__(signal)(int sig, void (*func)(int)))(int);235 extern int __POSIX_DEF__(raise)(int sig);236 extern int __POSIX_DEF__(kill)(__POSIX_DEF__(pid_t)pid, int sig);237 extern int __POSIX_DEF__(killpg)(__POSIX_DEF__(pid_t)pid, int sig);238 239 extern void __POSIX_DEF__(psiginfo)(const __POSIX_DEF__(siginfo_t)*pinfo, const char *message);240 extern void __POSIX_DEF__(psignal)(int signum, const char *message);241 242 extern int __POSIX_DEF__(sigemptyset)(__POSIX_DEF__(sigset_t)*set);243 extern int __POSIX_DEF__(sigfillset)(__POSIX_DEF__(sigset_t)*set);244 extern int __POSIX_DEF__(sigaddset)(__POSIX_DEF__(sigset_t)*set, int signo);245 extern int __POSIX_DEF__(sigdelset)(__POSIX_DEF__(sigset_t)*set, int signo);246 extern int __POSIX_DEF__(sigismember)(const __POSIX_DEF__(sigset_t)*set, int signo);247 248 extern int __POSIX_DEF__(thread_sigmask)(int how, const __POSIX_DEF__(sigset_t)*__restrict__ set,249 __POSIX_DEF__(sigset_t)*__restrict__ oset);250 extern int __POSIX_DEF__(sigprocmask)(int how, const __POSIX_DEF__(sigset_t)*__restrict__ set,251 __POSIX_DEF__(sigset_t)*__restrict__ oset);227 extern int sigaction(int sig, const struct sigaction *__restrict__ act, 228 struct sigaction *__restrict__ oact); 229 230 extern void (*signal(int sig, void (*func)(int)))(int); 231 extern int raise(int sig); 232 extern int kill(pid_t pid, int sig); 233 extern int killpg(pid_t pid, int sig); 234 235 extern void psiginfo(const siginfo_t *pinfo, const char *message); 236 extern void psignal(int signum, const char *message); 237 238 extern int sigemptyset(sigset_t *set); 239 extern int sigfillset(sigset_t *set); 240 extern int sigaddset(sigset_t *set, int signo); 241 extern int sigdelset(sigset_t *set, int signo); 242 extern int sigismember(const sigset_t *set, int signo); 243 244 extern int thread_sigmask(int how, const sigset_t *__restrict__ set, 245 sigset_t *__restrict__ oset); 246 extern int sigprocmask(int how, const sigset_t *__restrict__ set, 247 sigset_t *__restrict__ oset); 252 248 253 249 -
uspace/lib/posix/include/posix/stddef.h
re0f47f5 r7f9df7b9 36 36 #define POSIX_STDDEF_H_ 37 37 38 #ifndef __POSIX_DEF__39 #define __POSIX_DEF__(x) x40 #endif41 42 38 #include "sys/types.h" 43 39 -
uspace/lib/posix/include/posix/stdint.h
re0f47f5 r7f9df7b9 36 36 #define POSIX_STDINT_H_ 37 37 38 #ifndef __POSIX_DEF__39 #define __POSIX_DEF__(x) x40 #endif41 42 38 #include "libc/stdint.h" 43 39 -
uspace/lib/posix/include/posix/stdio.h
re0f47f5 r7f9df7b9 37 37 #define POSIX_STDIO_H_ 38 38 39 #ifndef __POSIX_DEF__ 40 #define __POSIX_DEF__(x) x 41 #endif 39 #include "libc/stdio.h" 42 40 43 41 #include "stddef.h" … … 67 65 typedef struct _IO_FILE FILE; 68 66 69 #ifndef LIBPOSIX_INTERNAL70 enum _buffer_type {71 /** No buffering */72 _IONBF,73 /** Line buffering */74 _IOLBF,75 /** Full buffering */76 _IOFBF77 };78 #endif79 80 67 extern FILE *stdin; 81 68 extern FILE *stdout; … … 130 117 #undef L_ctermid 131 118 #define L_ctermid PATH_MAX 132 extern char * __POSIX_DEF__(ctermid)(char *s);119 extern char *ctermid(char *s); 133 120 134 121 /* Error Recovery */ 135 extern void __POSIX_DEF__(clearerr)(FILE *stream);122 extern void clearerr(FILE *stream); 136 123 137 124 /* Input/Output */ 138 125 #undef putc 139 126 #define putc fputc 140 extern int __POSIX_DEF__(fputs)(const char *__restrict__ s, FILE *__restrict__ stream);127 extern int fputs(const char *__restrict__ s, FILE *__restrict__ stream); 141 128 #undef getc 142 129 #define getc fgetc 143 extern int __POSIX_DEF__(ungetc)(int c, FILE *stream);144 extern ssize_t __POSIX_DEF__(getdelim)(char **__restrict__ lineptr, size_t *__restrict__ n,130 extern int ungetc(int c, FILE *stream); 131 extern ssize_t getdelim(char **__restrict__ lineptr, size_t *__restrict__ n, 145 132 int delimiter, FILE *__restrict__ stream); 146 extern ssize_t __POSIX_DEF__(getline)(char **__restrict__ lineptr, size_t *__restrict__ n,133 extern ssize_t getline(char **__restrict__ lineptr, size_t *__restrict__ n, 147 134 FILE *__restrict__ stream); 148 135 149 136 /* Opening Streams */ 150 extern FILE * __POSIX_DEF__(freopen)(const char *__restrict__ filename,137 extern FILE *freopen(const char *__restrict__ filename, 151 138 const char *__restrict__ mode, FILE *__restrict__ stream); 152 139 153 140 /* Error Messages */ 154 extern void __POSIX_DEF__(perror)(const char *s);141 extern void perror(const char *s); 155 142 156 143 /* File Positioning */ 157 144 typedef struct { 158 145 off64_t offset; 159 } __POSIX_DEF__(fpos_t);160 161 extern int __POSIX_DEF__(fsetpos)(FILE *stream, const __POSIX_DEF__(fpos_t)*pos);162 extern int __POSIX_DEF__(fgetpos)(FILE *__restrict__ stream, __POSIX_DEF__(fpos_t)*__restrict__ pos);163 extern int __POSIX_DEF__(fseek)(FILE *stream, long offset, int whence);164 extern int __POSIX_DEF__(fseeko)(FILE *stream, __POSIX_DEF__(off_t)offset, int whence);165 extern long __POSIX_DEF__(ftell)(FILE *stream);166 extern __POSIX_DEF__(off_t) __POSIX_DEF__(ftello)(FILE *stream);146 } fpos_t; 147 148 extern int fsetpos(FILE *stream, const fpos_t *pos); 149 extern int fgetpos(FILE *__restrict__ stream, fpos_t *__restrict__ pos); 150 extern int fseek(FILE *stream, long offset, int whence); 151 extern int fseeko(FILE *stream, off_t offset, int whence); 152 extern long ftell(FILE *stream); 153 extern off_t ftello(FILE *stream); 167 154 168 155 /* Flushing Buffers */ 169 extern int __POSIX_DEF__(fflush)(FILE *stream);156 extern int fflush(FILE *stream); 170 157 171 158 /* Formatted Output */ 172 extern int __POSIX_DEF__(dprintf)(int fildes, const char *__restrict__ format, ...)159 extern int dprintf(int fildes, const char *__restrict__ format, ...) 173 160 _HELENOS_PRINTF_ATTRIBUTE(2, 3); 174 extern int __POSIX_DEF__(vdprintf)(int fildes, const char *__restrict__ format, va_list ap);175 extern int __POSIX_DEF__(sprintf)(char *__restrict__ s, const char *__restrict__ format, ...)161 extern int vdprintf(int fildes, const char *__restrict__ format, va_list ap); 162 extern int sprintf(char *__restrict__ s, const char *__restrict__ format, ...) 176 163 _HELENOS_PRINTF_ATTRIBUTE(2, 3); 177 extern int __POSIX_DEF__(vsprintf)(char *__restrict__ s, const char *__restrict__ format, va_list ap);164 extern int vsprintf(char *__restrict__ s, const char *__restrict__ format, va_list ap); 178 165 179 166 /* Formatted Input */ 180 extern int __POSIX_DEF__(fscanf)(167 extern int fscanf( 181 168 FILE *__restrict__ stream, const char *__restrict__ format, ...); 182 extern int __POSIX_DEF__(vfscanf)(169 extern int vfscanf( 183 170 FILE *__restrict__ stream, const char *__restrict__ format, va_list arg); 184 extern int __POSIX_DEF__(scanf)(const char *__restrict__ format, ...);185 extern int __POSIX_DEF__(vscanf)(const char *__restrict__ format, va_list arg);186 extern int __POSIX_DEF__(sscanf)(171 extern int scanf(const char *__restrict__ format, ...); 172 extern int vscanf(const char *__restrict__ format, va_list arg); 173 extern int sscanf( 187 174 const char *__restrict__ s, const char *__restrict__ format, ...); 188 extern int __POSIX_DEF__(vsscanf)(175 extern int vsscanf( 189 176 const char *__restrict__ s, const char *__restrict__ format, va_list arg); 190 177 191 178 /* File Locking */ 192 extern void __POSIX_DEF__(flockfile)(FILE *file);193 extern int __POSIX_DEF__(ftrylockfile)(FILE *file);194 extern void __POSIX_DEF__(funlockfile)(FILE *file);195 extern int __POSIX_DEF__(getc_unlocked)(FILE *stream);196 extern int __POSIX_DEF__(getchar_unlocked)(void);197 extern int __POSIX_DEF__(putc_unlocked)(int c, FILE *stream);198 extern int __POSIX_DEF__(putchar_unlocked)(int c);179 extern void flockfile(FILE *file); 180 extern int ftrylockfile(FILE *file); 181 extern void funlockfile(FILE *file); 182 extern int getc_unlocked(FILE *stream); 183 extern int getchar_unlocked(void); 184 extern int putc_unlocked(int c, FILE *stream); 185 extern int putchar_unlocked(int c); 199 186 200 187 /* Deleting Files */ 201 extern int __POSIX_DEF__(remove)(const char *path);188 extern int remove(const char *path); 202 189 203 190 /* Renaming Files */ 204 extern int __POSIX_DEF__(rename)(const char *oldname, const char *newname);191 extern int rename(const char *oldname, const char *newname); 205 192 206 193 /* Temporary Files */ 207 194 #undef L_tmpnam 208 195 #define L_tmpnam PATH_MAX 209 extern char * __POSIX_DEF__(tmpnam)(char *s);210 extern char * __POSIX_DEF__(tempnam)(const char *dir, const char *pfx);211 extern FILE * __POSIX_DEF__(tmpfile)(void);196 extern char *tmpnam(char *s); 197 extern char *tempnam(const char *dir, const char *pfx); 198 extern FILE *tmpfile(void); 212 199 213 200 -
uspace/lib/posix/include/posix/stdlib.h
re0f47f5 r7f9df7b9 37 37 #define POSIX_STDLIB_H_ 38 38 39 #ifndef __POSIX_DEF__40 #define __POSIX_DEF__(x) x41 #endif42 43 39 #include "sys/types.h" 44 40 … … 53 49 #define EXIT_SUCCESS 0 54 50 #define _Exit exit 55 extern int __POSIX_DEF__(atexit)(void (*func)(void));51 extern int atexit(void (*func)(void)); 56 52 extern void exit(int status) __attribute__((noreturn)); 57 53 extern void abort(void) __attribute__((noreturn)); 58 54 59 55 /* Absolute Value */ 60 extern int __POSIX_DEF__(abs)(int i);61 extern long __POSIX_DEF__(labs)(long i);62 extern long long __POSIX_DEF__(llabs)(long long i);56 extern int abs(int i); 57 extern long labs(long i); 58 extern long long llabs(long long i); 63 59 64 60 /* Integer Division */ … … 66 62 typedef struct { 67 63 int quot, rem; 68 } __POSIX_DEF__(div_t);64 } div_t; 69 65 70 66 typedef struct { 71 67 long quot, rem; 72 } __POSIX_DEF__(ldiv_t);68 } ldiv_t; 73 69 74 70 typedef struct { 75 71 long long quot, rem; 76 } __POSIX_DEF__(lldiv_t);72 } lldiv_t; 77 73 78 extern __POSIX_DEF__(div_t) __POSIX_DEF__(div)(int numer, int denom);79 extern __POSIX_DEF__(ldiv_t) __POSIX_DEF__(ldiv)(long numer, long denom);80 extern __POSIX_DEF__(lldiv_t) __POSIX_DEF__(lldiv)(long long numer, long long denom);74 extern div_t div(int numer, int denom); 75 extern ldiv_t ldiv(long numer, long denom); 76 extern lldiv_t lldiv(long long numer, long long denom); 81 77 82 78 /* Array Functions */ 83 extern void __POSIX_DEF__(qsort)(void *array, size_t count, size_t size,79 extern void qsort(void *array, size_t count, size_t size, 84 80 int (*compare)(const void *, const void *)); 85 extern void * __POSIX_DEF__(bsearch)(const void *key, const void *base,81 extern void *bsearch(const void *key, const void *base, 86 82 size_t nmemb, size_t size, int (*compar)(const void *, const void *)); 87 83 88 84 /* Environment Access */ 89 extern char * __POSIX_DEF__(getenv)(const char *name);90 extern int __POSIX_DEF__(putenv)(char *string);91 extern int __POSIX_DEF__(system)(const char *string);85 extern char *getenv(const char *name); 86 extern int putenv(char *string); 87 extern int system(const char *string); 92 88 93 89 /* Symbolic Links */ 94 extern char * __POSIX_DEF__(realpath)(const char *__restrict__ name, char *__restrict__ resolved);90 extern char *realpath(const char *__restrict__ name, char *__restrict__ resolved); 95 91 96 92 /* Floating Point Conversion */ 97 extern double __POSIX_DEF__(atof)(const char *nptr);98 extern float __POSIX_DEF__(strtof)(const char *__restrict__ nptr, char **__restrict__ endptr);99 extern double __POSIX_DEF__(strtod)(const char *__restrict__ nptr, char **__restrict__ endptr);100 extern long double __POSIX_DEF__(strtold)(const char *__restrict__ nptr, char **__restrict__ endptr);93 extern double atof(const char *nptr); 94 extern float strtof(const char *__restrict__ nptr, char **__restrict__ endptr); 95 extern double strtod(const char *__restrict__ nptr, char **__restrict__ endptr); 96 extern long double strtold(const char *__restrict__ nptr, char **__restrict__ endptr); 101 97 102 98 /* Integer Conversion */ … … 114 110 115 111 /* Memory Allocation */ 116 extern void * __POSIX_DEF__(malloc)(size_t size)112 extern void *malloc(size_t size) 117 113 __attribute__((malloc)); 118 extern void * __POSIX_DEF__(calloc)(size_t nelem, size_t elsize)114 extern void *calloc(size_t nelem, size_t elsize) 119 115 __attribute__((malloc)); 120 extern void * __POSIX_DEF__(realloc)(void *ptr, size_t size)116 extern void *realloc(void *ptr, size_t size) 121 117 __attribute__((warn_unused_result)); 122 extern void __POSIX_DEF__(free)(void *ptr);118 extern void free(void *ptr); 123 119 124 120 /* Temporary Files */ 125 extern int __POSIX_DEF__(mkstemp)(char *tmpl);121 extern int mkstemp(char *tmpl); 126 122 127 123 /* Pseudo-random number generator */ 128 extern int __POSIX_DEF__(rand)(void);129 extern void __POSIX_DEF__(srand)(unsigned int seed);124 extern int rand(void); 125 extern void srand(unsigned int seed); 130 126 131 127 /* Legacy Declarations */ 132 extern char * __POSIX_DEF__(mktemp)(char *tmpl);128 extern char *mktemp(char *tmpl); 133 129 extern int bsd_getloadavg(double loadavg[], int nelem); 134 130 -
uspace/lib/posix/include/posix/string.h
re0f47f5 r7f9df7b9 37 37 #define POSIX_STRING_H_ 38 38 39 #ifndef __POSIX_DEF__40 #define __POSIX_DEF__(x) x41 #endif42 43 39 #include "sys/types.h" 44 40 … … 74 70 75 71 /* Copying and Concatenation */ 76 extern char * __POSIX_DEF__(strcpy)(char *__restrict__ dest, const char *__restrict__ src);77 extern char * __POSIX_DEF__(strncpy)(char *__restrict__ dest, const char *__restrict__ src, size_t n);78 extern char * __POSIX_DEF__(stpcpy)(char *__restrict__ dest, const char *__restrict__ src);79 extern char * __POSIX_DEF__(stpncpy)(char *__restrict__ dest, const char *__restrict__ src, size_t n);80 extern char * __POSIX_DEF__(strcat)(char *__restrict__ dest, const char *__restrict__ src);81 extern char * __POSIX_DEF__(strncat)(char *__restrict__ dest, const char *__restrict__ src, size_t n);82 extern void * __POSIX_DEF__(memccpy)(void *__restrict__ dest, const void *__restrict__ src, int c, size_t n);83 extern char * __POSIX_DEF__(strdup)(const char *s);84 extern char * __POSIX_DEF__(strndup)(const char *s, size_t n);72 extern char *strcpy(char *__restrict__ dest, const char *__restrict__ src); 73 extern char *strncpy(char *__restrict__ dest, const char *__restrict__ src, size_t n); 74 extern char *stpcpy(char *__restrict__ dest, const char *__restrict__ src); 75 extern char *stpncpy(char *__restrict__ dest, const char *__restrict__ src, size_t n); 76 extern char *strcat(char *__restrict__ dest, const char *__restrict__ src); 77 extern char *strncat(char *__restrict__ dest, const char *__restrict__ src, size_t n); 78 extern void *memccpy(void *__restrict__ dest, const void *__restrict__ src, int c, size_t n); 79 extern char *strdup(const char *s); 80 extern char *strndup(const char *s, size_t n); 85 81 86 82 /* String/Array Comparison */ 87 extern int __POSIX_DEF__(memcmp)(const void *mem1, const void *mem2, size_t n);88 extern int __POSIX_DEF__(strcmp)(const char *s1, const char *s2);89 extern int __POSIX_DEF__(strncmp)(const char *s1, const char *s2, size_t n);83 extern int memcmp(const void *mem1, const void *mem2, size_t n); 84 extern int strcmp(const char *s1, const char *s2); 85 extern int strncmp(const char *s1, const char *s2, size_t n); 90 86 91 87 /* Search Functions */ 92 extern void * __POSIX_DEF__(memchr)(const void *mem, int c, size_t n);93 extern char * __POSIX_DEF__(strchr)(const char *s, int c);94 extern char * __POSIX_DEF__(strrchr)(const char *s, int c);88 extern void *memchr(const void *mem, int c, size_t n); 89 extern char *strchr(const char *s, int c); 90 extern char *strrchr(const char *s, int c); 95 91 extern char *gnu_strchrnul(const char *s, int c); 96 extern char * __POSIX_DEF__(strpbrk)(const char *s1, const char *s2);97 extern size_t __POSIX_DEF__(strcspn)(const char *s1, const char *s2);98 extern size_t __POSIX_DEF__(strspn)(const char *s1, const char *s2);99 extern char * __POSIX_DEF__(strstr)(const char *haystack, const char *needle);92 extern char *strpbrk(const char *s1, const char *s2); 93 extern size_t strcspn(const char *s1, const char *s2); 94 extern size_t strspn(const char *s1, const char *s2); 95 extern char *strstr(const char *haystack, const char *needle); 100 96 101 97 /* Tokenization functions. */ 102 extern char * __POSIX_DEF__(strtok_r)(char *, const char *, char **);103 extern char * __POSIX_DEF__(strtok)(char *, const char *);98 extern char *strtok_r(char *, const char *, char **); 99 extern char *strtok(char *, const char *); 104 100 105 101 106 102 /* Collation Functions */ 107 extern int __POSIX_DEF__(strcoll)(const char *s1, const char *s2);108 extern size_t __POSIX_DEF__(strxfrm)(char *__restrict__ s1, const char *__restrict__ s2, size_t n);103 extern int strcoll(const char *s1, const char *s2); 104 extern size_t strxfrm(char *__restrict__ s1, const char *__restrict__ s2, size_t n); 109 105 110 106 /* Error Messages */ 111 extern char * __POSIX_DEF__(strerror)(int errnum);112 extern int __POSIX_DEF__(strerror_r)(int errnum, char *buf, size_t bufsz);107 extern char *strerror(int errnum); 108 extern int strerror_r(int errnum, char *buf, size_t bufsz); 113 109 114 110 /* String Length */ 115 extern size_t __POSIX_DEF__(strlen)(const char *s);116 extern size_t __POSIX_DEF__(strnlen)(const char *s, size_t n);111 extern size_t strlen(const char *s); 112 extern size_t strnlen(const char *s, size_t n); 117 113 118 114 /* Signal Messages */ 119 extern char * __POSIX_DEF__(strsignal)(int signum);115 extern char *strsignal(int signum); 120 116 121 117 /* Legacy Declarations */ 122 118 #ifndef POSIX_STRINGS_H_ 123 extern int __POSIX_DEF__(ffs)(int i);124 extern int __POSIX_DEF__(strcasecmp)(const char *s1, const char *s2);125 extern int __POSIX_DEF__(strncasecmp)(const char *s1, const char *s2, size_t n);119 extern int ffs(int i); 120 extern int strcasecmp(const char *s1, const char *s2); 121 extern int strncasecmp(const char *s1, const char *s2, size_t n); 126 122 #endif 127 123 -
uspace/lib/posix/include/posix/strings.h
re0f47f5 r7f9df7b9 37 37 #define POSIX_STRINGS_H_ 38 38 39 #ifndef __POSIX_DEF__40 #define __POSIX_DEF__(x) x41 #endif42 43 44 39 #include "libc/types/common.h" 45 40 46 41 /* Search Functions */ 47 42 #ifndef POSIX_STRING_H_ 48 extern int __POSIX_DEF__(ffs)(int i);43 extern int ffs(int i); 49 44 #endif 50 45 51 46 /* String/Array Comparison */ 52 47 #ifndef POSIX_STRING_H_ 53 extern int __POSIX_DEF__(strcasecmp)(const char *s1, const char *s2);54 extern int __POSIX_DEF__(strncasecmp)(const char *s1, const char *s2, size_t n);48 extern int strcasecmp(const char *s1, const char *s2); 49 extern int strncasecmp(const char *s1, const char *s2, size_t n); 55 50 #endif 56 51 … … 62 57 63 58 /* Legacy Functions */ 64 extern int __POSIX_DEF__(bcmp)(const void *mem1, const void *mem2, size_t n);65 extern void __POSIX_DEF__(bcopy)(const void *src, void *dest, size_t n);66 extern void __POSIX_DEF__(bzero)(void *mem, size_t n);67 extern char * __POSIX_DEF__(index)(const char *s, int c);68 extern char * __POSIX_DEF__(rindex)(const char *s, int c);59 extern int bcmp(const void *mem1, const void *mem2, size_t n); 60 extern void bcopy(const void *src, void *dest, size_t n); 61 extern void bzero(void *mem, size_t n); 62 extern char *index(const char *s, int c); 63 extern char *rindex(const char *s, int c); 69 64 70 65 -
uspace/lib/posix/include/posix/sys/mman.h
re0f47f5 r7f9df7b9 36 36 #define POSIX_SYS_MMAN_H_ 37 37 38 #ifndef __POSIX_DEF__39 #define __POSIX_DEF__(x) x40 #endif41 42 38 #include "types.h" 43 39 #include <abi/mm/as.h> … … 61 57 62 58 extern void * 63 __POSIX_DEF__(mmap)(void *start, size_t length, int prot, int flags, int fd,64 __POSIX_DEF__(off_t)offset);65 extern int __POSIX_DEF__(munmap)(void *start, size_t length);59 mmap(void *start, size_t length, int prot, int flags, int fd, 60 off_t offset); 61 extern int munmap(void *start, size_t length); 66 62 67 63 -
uspace/lib/posix/include/posix/sys/stat.h
re0f47f5 r7f9df7b9 39 39 #include "types.h" 40 40 #include "../time.h" 41 42 #ifndef __POSIX_DEF__43 #define __POSIX_DEF__(x) x44 #endif45 41 46 42 /* values are the same as on Linux */ … … 112 108 #define S_ISSOCK(m) ((m & S_IFSOCK) != 0) /* socket? (Not in POSIX.1-1996.) */ 113 109 114 struct __POSIX_DEF__(stat){115 __POSIX_DEF__(dev_t)st_dev; /* ID of device containing file */116 __POSIX_DEF__(ino_t)st_ino; /* inode number */117 __POSIX_DEF__(mode_t)st_mode; /* protection */118 __POSIX_DEF__(nlink_t)st_nlink; /* number of hard links */119 __POSIX_DEF__(uid_t)st_uid; /* user ID of owner */120 __POSIX_DEF__(gid_t)st_gid; /* group ID of owner */121 __POSIX_DEF__(dev_t)st_rdev; /* device ID (if special file) */122 __POSIX_DEF__(off_t)st_size; /* total size, in bytes */123 __POSIX_DEF__(blksize_t)st_blksize; /* blocksize for file system I/O */124 __POSIX_DEF__(blkcnt_t)st_blocks; /* number of 512B blocks allocated */110 struct stat { 111 dev_t st_dev; /* ID of device containing file */ 112 ino_t st_ino; /* inode number */ 113 mode_t st_mode; /* protection */ 114 nlink_t st_nlink; /* number of hard links */ 115 uid_t st_uid; /* user ID of owner */ 116 gid_t st_gid; /* group ID of owner */ 117 dev_t st_rdev; /* device ID (if special file) */ 118 off_t st_size; /* total size, in bytes */ 119 blksize_t st_blksize; /* blocksize for file system I/O */ 120 blkcnt_t st_blocks; /* number of 512B blocks allocated */ 125 121 time_t st_atime; /* time of last access */ 126 122 time_t st_mtime; /* time of last modification */ … … 128 124 }; 129 125 130 extern int __POSIX_DEF__(fstat)(int fd, struct __POSIX_DEF__(stat)*st);131 extern int __POSIX_DEF__(lstat)(const char *__restrict__ path, struct __POSIX_DEF__(stat)*__restrict__ st);132 extern int __POSIX_DEF__(stat)(const char *__restrict__ path, struct __POSIX_DEF__(stat)*__restrict__ st);133 extern int __POSIX_DEF__(chmod)(const char *path, __POSIX_DEF__(mode_t)mode);134 extern __POSIX_DEF__(mode_t) __POSIX_DEF__(umask)(__POSIX_DEF__(mode_t)mask);135 extern int __POSIX_DEF__(mkdir)(const char *path, __POSIX_DEF__(mode_t)mode);126 extern int fstat(int fd, struct stat *st); 127 extern int lstat(const char *__restrict__ path, struct stat *__restrict__ st); 128 extern int stat(const char *__restrict__ path, struct stat *__restrict__ st); 129 extern int chmod(const char *path, mode_t mode); 130 extern mode_t umask(mode_t mask); 131 extern int mkdir(const char *path, mode_t mode); 136 132 137 133 -
uspace/lib/posix/include/posix/sys/time.h
re0f47f5 r7f9df7b9 34 34 #define POSIX_SYS_TIME_H_ 35 35 36 #ifndef __POSIX_DEF__37 #define __POSIX_DEF__(x) x38 #endif39 40 36 #include "libc/sys/time.h" 41 37 -
uspace/lib/posix/include/posix/sys/types.h
re0f47f5 r7f9df7b9 37 37 #define POSIX_SYS_TYPES_H_ 38 38 39 #ifndef __POSIX_DEF__40 #define __POSIX_DEF__(x) x41 #endif42 43 39 #include "libc/offset.h" 44 40 #include "libc/sys/time.h" 45 41 #include "libc/types/common.h" 46 42 47 typedef unsigned int __POSIX_DEF__(ino_t);48 typedef unsigned int __POSIX_DEF__(nlink_t);49 typedef unsigned int __POSIX_DEF__(uid_t);50 typedef unsigned int __POSIX_DEF__(gid_t);51 typedef off64_t __POSIX_DEF__(off_t);52 typedef long __POSIX_DEF__(blksize_t);53 typedef long __POSIX_DEF__(blkcnt_t);54 typedef int64_t __POSIX_DEF__(pid_t);55 typedef sysarg_t __POSIX_DEF__(dev_t);56 typedef unsigned int __POSIX_DEF__(mode_t);43 typedef unsigned int ino_t; 44 typedef unsigned int nlink_t; 45 typedef unsigned int uid_t; 46 typedef unsigned int gid_t; 47 typedef off64_t off_t; 48 typedef long blksize_t; 49 typedef long blkcnt_t; 50 typedef int64_t pid_t; 51 typedef sysarg_t dev_t; 52 typedef unsigned int mode_t; 57 53 58 54 /* PThread Types */ 59 typedef struct __POSIX_DEF__(thread_attr) __POSIX_DEF__(thread_attr_t);55 typedef struct thread_attr thread_attr_t; 60 56 61 57 /* Clock Types */ 62 typedef long __POSIX_DEF__(clock_t);63 typedef int __POSIX_DEF__(clockid_t);58 typedef long clock_t; 59 typedef int clockid_t; 64 60 65 61 -
uspace/lib/posix/include/posix/sys/wait.h
re0f47f5 r7f9df7b9 36 36 #define POSIX_SYS_WAIT_H_ 37 37 38 #ifndef __POSIX_DEF__39 #define __POSIX_DEF__(x) x40 #endif41 42 38 #include "types.h" 43 39 … … 56 52 extern int __posix_wtermsig(int status); 57 53 58 extern __POSIX_DEF__(pid_t) __POSIX_DEF__(wait)(int *stat_ptr);59 extern __POSIX_DEF__(pid_t) __POSIX_DEF__(waitpid)(__POSIX_DEF__(pid_t)pid, int *stat_ptr, int options);54 extern pid_t wait(int *stat_ptr); 55 extern pid_t waitpid(pid_t pid, int *stat_ptr, int options); 60 56 61 57 -
uspace/lib/posix/include/posix/time.h
re0f47f5 r7f9df7b9 37 37 #define POSIX_TIME_H_ 38 38 39 #ifndef __POSIX_DEF__40 #define __POSIX_DEF__(x) x41 #endif42 43 39 #include "sys/types.h" 44 40 … … 51 47 #ifndef __locale_t_defined 52 48 #define __locale_t_defined 53 typedef struct __posix_locale * __POSIX_DEF__(locale_t);49 typedef struct __posix_locale *locale_t; 54 50 #ifndef LIBPOSIX_INTERNAL 55 #define locale_t __POSIX_DEF__(locale_t)51 #define locale_t locale_t 56 52 #endif 57 53 #endif 58 54 59 55 #ifndef POSIX_SIGNAL_H_ 60 struct __POSIX_DEF__(sigevent);56 struct sigevent; 61 57 #ifndef LIBPOSIX_INTERNAL 62 #define sigevent __POSIX_DEF__(sigevent)58 #define sigevent sigevent 63 59 #endif 64 60 #endif 65 61 66 62 #undef CLOCK_REALTIME 67 #define CLOCK_REALTIME (( __POSIX_DEF__(clockid_t)) 0)63 #define CLOCK_REALTIME ((clockid_t) 0) 68 64 69 struct __POSIX_DEF__(timespec){65 struct timespec { 70 66 time_t tv_sec; /* Seconds. */ 71 67 long tv_nsec; /* Nanoseconds. */ 72 68 }; 73 69 74 struct __POSIX_DEF__(itimerspec){75 struct __POSIX_DEF__(timespec)it_interval; /* Timer period. */76 struct __POSIX_DEF__(timespec)it_value; /* Timer expiration. */70 struct itimerspec { 71 struct timespec it_interval; /* Timer period. */ 72 struct timespec it_value; /* Timer expiration. */ 77 73 }; 78 74 79 typedef struct __posix_timer * __POSIX_DEF__(timer_t);75 typedef struct __posix_timer *timer_t; 80 76 81 77 /* Timezones */ 82 extern int __POSIX_DEF__(daylight);83 extern long __POSIX_DEF__(timezone);84 extern char * __POSIX_DEF__(tzname)[2];85 extern void __POSIX_DEF__(tzset)(void);78 extern int daylight; 79 extern long timezone; 80 extern char *tzname[2]; 81 extern void tzset(void); 86 82 87 83 /* Time */ 88 extern time_t __POSIX_DEF__(time)(time_t *t);84 extern time_t time(time_t *t); 89 85 90 86 /* Broken-down Time */ 91 extern struct tm * __POSIX_DEF__(gmtime_r)(const time_t *__restrict__ timer,87 extern struct tm *gmtime_r(const time_t *__restrict__ timer, 92 88 struct tm *__restrict__ result); 93 extern struct tm * __POSIX_DEF__(gmtime)(const time_t *__restrict__ timep);94 extern struct tm * __POSIX_DEF__(localtime_r)(const time_t *__restrict__ timer,89 extern struct tm *gmtime(const time_t *__restrict__ timep); 90 extern struct tm *localtime_r(const time_t *__restrict__ timer, 95 91 struct tm *__restrict__ result); 96 extern struct tm * __POSIX_DEF__(localtime)(const time_t *__restrict__ timep);92 extern struct tm *localtime(const time_t *__restrict__ timep); 97 93 98 94 /* Formatting Calendar Time */ 99 extern char * __POSIX_DEF__(asctime_r)(const struct tm *__restrict__ timeptr,95 extern char *asctime_r(const struct tm *__restrict__ timeptr, 100 96 char *__restrict__ buf); 101 extern char * __POSIX_DEF__(asctime)(const struct tm *__restrict__ timeptr);102 extern char * __POSIX_DEF__(ctime_r)(const time_t *timer, char *buf);103 extern char * __POSIX_DEF__(ctime)(const time_t *timer);97 extern char *asctime(const struct tm *__restrict__ timeptr); 98 extern char *ctime_r(const time_t *timer, char *buf); 99 extern char *ctime(const time_t *timer); 104 100 extern time_t time(time_t *t); 105 101 106 102 /* Clocks */ 107 extern int __POSIX_DEF__(clock_getres)(__POSIX_DEF__(clockid_t)clock_id,108 struct __POSIX_DEF__(timespec)*res);109 extern int __POSIX_DEF__(clock_gettime)(__POSIX_DEF__(clockid_t)clock_id,110 struct __POSIX_DEF__(timespec)*tp);111 extern int __POSIX_DEF__(clock_settime)(__POSIX_DEF__(clockid_t)clock_id,112 const struct __POSIX_DEF__(timespec) *tp);113 extern int __POSIX_DEF__(clock_nanosleep)(__POSIX_DEF__(clockid_t)clock_id, int flags,114 const struct __POSIX_DEF__(timespec) *rqtp, struct __POSIX_DEF__(timespec)*rmtp);103 extern int clock_getres(clockid_t clock_id, 104 struct timespec *res); 105 extern int clock_gettime(clockid_t clock_id, 106 struct timespec *tp); 107 extern int clock_settime(clockid_t clock_id, 108 const struct timespec *tp); 109 extern int clock_nanosleep(clockid_t clock_id, int flags, 110 const struct timespec *rqtp, struct timespec *rmtp); 115 111 116 112 /* CPU Time */ 117 extern __POSIX_DEF__(clock_t) __POSIX_DEF__(clock)(void);113 extern clock_t clock(void); 118 114 119 115 -
uspace/lib/posix/include/posix/ucontext.h
re0f47f5 r7f9df7b9 36 36 #define POSIX_UCONTEXT_H_ 37 37 38 #ifndef __POSIX_DEF__39 #define __POSIX_DEF__(x) x40 #endif41 42 38 #include "sys/types.h" 43 39 44 typedef int __POSIX_DEF__(sig_atomic_t);45 typedef uint32_t __POSIX_DEF__(sigset_t);46 typedef struct __POSIX_DEF__(mcontext){40 typedef int sig_atomic_t; 41 typedef uint32_t sigset_t; 42 typedef struct mcontext { 47 43 /* must not be empty to avoid compiler warnings (-pedantic) */ 48 44 int dummy; 49 } __POSIX_DEF__(mcontext_t);45 } mcontext_t; 50 46 51 union __POSIX_DEF__(sigval){47 union sigval { 52 48 int sival_int; 53 49 void *sival_ptr; 54 50 }; 55 51 56 struct __POSIX_DEF__(sigevent){52 struct sigevent { 57 53 int sigev_notify; /* Notification type. */ 58 54 int sigev_signo; /* Signal number. */ 59 union __POSIX_DEF__(sigval)sigev_value; /* Signal value. */60 void (*sigev_notify_function)(union __POSIX_DEF__(sigval)); /* Notification function. */61 __POSIX_DEF__(thread_attr_t)*sigev_notify_attributes; /* Notification attributes. */55 union sigval sigev_value; /* Signal value. */ 56 void (*sigev_notify_function)(union sigval); /* Notification function. */ 57 thread_attr_t *sigev_notify_attributes; /* Notification attributes. */ 62 58 }; 63 59 … … 66 62 size_t ss_size; 67 63 int ss_flags; 68 } __POSIX_DEF__(stack_t);64 } stack_t; 69 65 70 typedef struct __POSIX_DEF__(ucontext){71 struct __POSIX_DEF__(ucontext)*uc_link;72 __POSIX_DEF__(sigset_t)uc_sigmask;73 __POSIX_DEF__(stack_t)uc_stack;74 __POSIX_DEF__(mcontext_t)uc_mcontext;75 } __POSIX_DEF__(ucontext_t);66 typedef struct ucontext { 67 struct ucontext *uc_link; 68 sigset_t uc_sigmask; 69 stack_t uc_stack; 70 mcontext_t uc_mcontext; 71 } ucontext_t; 76 72 77 73 -
uspace/lib/posix/include/posix/unistd.h
re0f47f5 r7f9df7b9 37 37 #define POSIX_UNISTD_H_ 38 38 39 #ifndef __POSIX_DEF__40 #define __POSIX_DEF__(x) x41 #endif42 43 39 #include "sys/types.h" 44 40 #include "stddef.h" … … 51 47 #define _exit exit 52 48 53 extern char * __POSIX_DEF__(optarg);49 extern char *optarg; 54 50 extern int optind, opterr, optopt; 55 extern int __POSIX_DEF__(getopt)(int, char * const [], const char *);51 extern int getopt(int, char * const [], const char *); 56 52 57 53 /* Environment */ 58 extern char ** __POSIX_DEF__(environ);54 extern char **environ; 59 55 60 56 /* Sleeping */ 61 extern unsigned int __POSIX_DEF__(sleep)(unsigned int);57 extern unsigned int sleep(unsigned int); 62 58 63 59 /* Login Information */ 64 extern char * __POSIX_DEF__(getlogin)(void);65 extern int __POSIX_DEF__(getlogin_r)(char *name, size_t namesize);60 extern char *getlogin(void); 61 extern int getlogin_r(char *name, size_t namesize); 66 62 67 63 /* Identifying Terminals */ 68 extern int __POSIX_DEF__(isatty)(int fd);64 extern int isatty(int fd); 69 65 70 66 /* Working Directory */ 71 extern char * __POSIX_DEF__(getcwd)(char *buf, size_t size);72 extern int __POSIX_DEF__(chdir)(const char *path);67 extern char *getcwd(char *buf, size_t size); 68 extern int chdir(const char *path); 73 69 74 70 /* Query Memory Parameters */ 75 extern int __POSIX_DEF__(getpagesize)(void);71 extern int getpagesize(void); 76 72 77 73 /* Process Identification */ 78 extern __POSIX_DEF__(pid_t) __POSIX_DEF__(getpid)(void);79 extern __POSIX_DEF__(uid_t) __POSIX_DEF__(getuid)(void);80 extern __POSIX_DEF__(gid_t) __POSIX_DEF__(getgid)(void);74 extern pid_t getpid(void); 75 extern uid_t getuid(void); 76 extern gid_t getgid(void); 81 77 82 78 /* File Manipulation */ 83 extern int __POSIX_DEF__(close)(int fildes);84 extern ssize_t __POSIX_DEF__(read)(int fildes, void *buf, size_t nbyte);85 extern ssize_t __POSIX_DEF__(write)(int fildes, const void *buf, size_t nbyte);86 extern __POSIX_DEF__(off_t) __POSIX_DEF__(lseek)(int fildes,87 __POSIX_DEF__(off_t)offset, int whence);88 extern int __POSIX_DEF__(fsync)(int fildes);89 extern int __POSIX_DEF__(ftruncate)(int fildes, __POSIX_DEF__(off_t)length);90 extern int __POSIX_DEF__(rmdir)(const char *path);91 extern int __POSIX_DEF__(unlink)(const char *path);92 extern int __POSIX_DEF__(dup)(int fildes);93 extern int __POSIX_DEF__(dup2)(int fildes, int fildes2);79 extern int close(int fildes); 80 extern ssize_t read(int fildes, void *buf, size_t nbyte); 81 extern ssize_t write(int fildes, const void *buf, size_t nbyte); 82 extern off_t lseek(int fildes, 83 off_t offset, int whence); 84 extern int fsync(int fildes); 85 extern int ftruncate(int fildes, off_t length); 86 extern int rmdir(const char *path); 87 extern int unlink(const char *path); 88 extern int dup(int fildes); 89 extern int dup2(int fildes, int fildes2); 94 90 95 91 /* Standard Streams */ … … 110 106 #define W_OK 2 /* Test for write permission. */ 111 107 #define R_OK 4 /* Test for read permission. */ 112 extern int __POSIX_DEF__(access)(const char *path, int amode);108 extern int access(const char *path, int amode); 113 109 114 110 /* System Parameters */ … … 119 115 _SC_CLK_TCK 120 116 }; 121 extern long __POSIX_DEF__(sysconf)(int name);117 extern long sysconf(int name); 122 118 123 119 /* Path Configuration Parameters */ … … 143 139 _PC_VDISABLE 144 140 }; 145 extern long __POSIX_DEF__(pathconf)(const char *path, int name);141 extern long pathconf(const char *path, int name); 146 142 147 143 /* Creating a Process */ 148 extern __POSIX_DEF__(pid_t) __POSIX_DEF__(fork)(void);144 extern pid_t fork(void); 149 145 150 146 /* Executing a File */ 151 extern int __POSIX_DEF__(execv)(const char *path, char *const argv[]);152 extern int __POSIX_DEF__(execvp)(const char *file, char *const argv[]);147 extern int execv(const char *path, char *const argv[]); 148 extern int execvp(const char *file, char *const argv[]); 153 149 154 150 /* Creating a Pipe */ 155 extern int __POSIX_DEF__(pipe)(int fildes[2]);151 extern int pipe(int fildes[2]); 156 152 157 153 /* Issue alarm signal. */ 158 extern unsigned int __POSIX_DEF__(alarm)(unsigned int);154 extern unsigned int alarm(unsigned int); 159 155 160 156 #endif /* POSIX_UNISTD_H_ */
Note:
See TracChangeset
for help on using the changeset viewer.