Changeset 7f9df7b9 in mainline for uspace/lib/posix/include


Ignore:
Timestamp:
2018-01-22T22:42:57Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7a08c70
Parents:
e0f47f5
Message:

Remove unnecessary symbol renaming from libposix.

Location:
uspace/lib/posix/include/posix
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/include/posix/ctype.h

    re0f47f5 r7f9df7b9  
    3737#define POSIX_CTYPE_H_
    3838
    39 #ifndef __POSIX_DEF__
    40 #define __POSIX_DEF__(x) x
    41 #endif
    42 
    4339#include "libc/ctype.h"
    4440
  • uspace/lib/posix/include/posix/dirent.h

    re0f47f5 r7f9df7b9  
    3636#define POSIX_DIRENT_H_
    3737
    38 #ifndef __POSIX_DEF__
    39 #define __POSIX_DEF__(x) x
    40 #endif
    41 
    4238#include <libc/dirent.h>
    4339
  • uspace/lib/posix/include/posix/dlfcn.h

    re0f47f5 r7f9df7b9  
    3434#define POSIX_DLFCN_H_
    3535
    36 #ifndef __POSIX_DEF__
    37 #define __POSIX_DEF__(x) x
    38 #endif
     36#include "libc/dlfcn.h"
    3937
    4038#define RTLD_LAZY 1
     
    4341#define RTLD_LOCAL 0
    4442
    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 
     43extern void *dlopen(const char *, int);
     44extern void *dlsym(void *, const char *);
     45extern int dlclose(void *);
     46extern char *dlerror(void);
    5147
    5248#endif
  • uspace/lib/posix/include/posix/fcntl.h

    re0f47f5 r7f9df7b9  
    3535#ifndef POSIX_FCNTL_H_
    3636#define POSIX_FCNTL_H_
    37 
    38 #ifndef __POSIX_DEF__
    39 #define __POSIX_DEF__(x) x
    40 #endif
    4137
    4238#include "sys/types.h"
     
    9389#define FD_CLOEXEC         1 /* Close on exec. */
    9490
    95 extern int __POSIX_DEF__(open)(const char *pathname, int flags, ...);
    96 extern int __POSIX_DEF__(fcntl)(int fd, int cmd, ...);
    97 
     91extern int open(const char *pathname, int flags, ...);
     92extern int fcntl(int fd, int cmd, ...);
    9893
    9994#endif /* POSIX_FCNTL_H_ */
  • uspace/lib/posix/include/posix/fenv.h

    re0f47f5 r7f9df7b9  
    3737#define POSIX_FENV_H_
    3838
    39 
    4039#define FE_DIVBYZERO 1
    4140#define FE_INEXACT 2
  • uspace/lib/posix/include/posix/fnmatch.h

    re0f47f5 r7f9df7b9  
    3636#define POSIX_FNMATCH_H_
    3737
    38 #ifndef __POSIX_DEF__
    39 #define __POSIX_DEF__(x) x
    40 #endif
    41 
    4238/* Error Values */
    4339#undef FNM_NOMATCH
     
    6056#define FNM_CASEFOLD 16
    6157
    62 extern int __POSIX_DEF__(fnmatch)(const char *pattern, const char *string, int flags);
     58extern int fnmatch(const char *pattern, const char *string, int flags);
    6359
    6460
  • uspace/lib/posix/include/posix/getopt.h

    re0f47f5 r7f9df7b9  
    3535#define POSIX_GETOPT_H
    3636
    37 #ifndef __POSIX_DEF__
    38 #define __POSIX_DEF__(x) x
    39 #endif
    40 
    4137#include "unistd.h"
    4238
     
    5551#endif
    5652
    57 extern int __POSIX_DEF__(getopt_long)(int, char * const [], const char *, const struct option *, int *);
     53extern int getopt_long(int, char * const [], const char *, const struct option *, int *);
    5854
    5955
  • uspace/lib/posix/include/posix/inttypes.h

    re0f47f5 r7f9df7b9  
    3636#define POSIX_INTTYPES_H_
    3737
    38 #ifndef __POSIX_DEF__
    39 #define __POSIX_DEF__(x) x
    40 #endif
    41 
    4238#include "stdint.h"
    4339#include "libc/inttypes.h"
  • uspace/lib/posix/include/posix/locale.h

    re0f47f5 r7f9df7b9  
    3636#define POSIX_LOCALE_H_
    3737
    38 #ifndef __POSIX_DEF__
    39 #define __POSIX_DEF__(x) x
    40 #endif
    41 
    4238#include <_bits/NULL.h>
    4339
    4440#ifndef __locale_t_defined
    4541        #define __locale_t_defined
    46         typedef struct __posix_locale *__POSIX_DEF__(locale_t);
     42        typedef struct __posix_locale *locale_t;
    4743        #ifndef LIBPOSIX_INTERNAL
    48                 #define locale_t __POSIX_DEF__(locale_t)
     44                #define locale_t locale_t
    4945        #endif
    5046#endif
     
    8480#define LC_GLOBAL_LOCALE NULL
    8581
    86 struct __POSIX_DEF__(lconv) {
     82struct lconv {
    8783        char *currency_symbol;
    8884        char *decimal_point;
     
    111107};
    112108
    113 extern char *__POSIX_DEF__(setlocale)(int category, const char *locale);
    114 extern struct __POSIX_DEF__(lconv) *__POSIX_DEF__(localeconv)(void);
     109extern char *setlocale(int category, const char *locale);
     110extern struct lconv *localeconv(void);
    115111
    116112/* 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);
     113extern locale_t duplocale(locale_t locobj);
     114extern void freelocale(locale_t locobj);
     115extern locale_t newlocale(int category_mask, const char *locale,
     116    locale_t base);
     117extern locale_t uselocale(locale_t newloc);
    122118
    123119
  • uspace/lib/posix/include/posix/pthread.h

    re0f47f5 r7f9df7b9  
    3232#ifndef POSIX_PTHREAD_H_
    3333#define POSIX_PTHREAD_H_
    34 
    35 #ifndef __POSIX_DEF__
    36 #define __POSIX_DEF__(x) x
    37 #endif
    3834
    3935#include "libc/thread.h"
     
    9995extern int pthread_cond_signal(pthread_cond_t *);
    10096extern 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__);
    10298extern int pthread_cond_wait(pthread_cond_t *__restrict__,
    10399    pthread_mutex_t *__restrict__);
  • uspace/lib/posix/include/posix/pwd.h

    re0f47f5 r7f9df7b9  
    3636#define POSIX_PWD_H_
    3737
    38 #ifndef __POSIX_DEF__
    39 #define __POSIX_DEF__(x) x
    40 #endif
    41 
    4238#include "sys/types.h"
    4339
    44 struct __POSIX_DEF__(passwd) {
     40struct passwd {
    4541        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;
    4844        char *pw_dir;
    4945        char *pw_shell;
    5046};
    5147
    52 extern struct __POSIX_DEF__(passwd) *__POSIX_DEF__(getpwent)(void);
    53 extern void __POSIX_DEF__(setpwent)(void);
    54 extern void __POSIX_DEF__(endpwent)(void);
     48extern struct passwd *getpwent(void);
     49extern void setpwent(void);
     50extern void endpwent(void);
    5551
    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);
     52extern struct passwd *getpwnam(const char *name);
     53extern int getpwnam_r(const char *name, struct passwd *pwd,
     54    char *buffer, size_t bufsize, struct passwd **result);
    5955
    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);
     56extern struct passwd *getpwuid(uid_t uid);
     57extern int getpwuid_r(uid_t uid, struct passwd *pwd,
     58    char *buffer, size_t bufsize, struct passwd **result);
    6359
    6460
  • uspace/lib/posix/include/posix/signal.h

    re0f47f5 r7f9df7b9  
    3636#define POSIX_SIGNAL_H_
    3737
    38 #ifndef __POSIX_DEF__
    39 #define __POSIX_DEF__(x) x
    40 #endif
    41 
    4238#include "sys/types.h"
    4339#include <posix/ucontext.h>
     
    6359        int si_errno;
    6460
    65         __POSIX_DEF__(pid_t) si_pid;
    66         __POSIX_DEF__(uid_t) si_uid;
     61        pid_t si_pid;
     62        uid_t si_uid;
    6763        void *si_addr;
    6864        int si_status;
     
    7066        long si_band;
    7167
    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
     71struct sigaction {
    7672        void (*sa_handler)(int);
    77         __POSIX_DEF__(sigset_t) sa_mask;
     73        sigset_t sa_mask;
    7874        int sa_flags;
    79         void (*sa_sigaction)(int, __POSIX_DEF__(siginfo_t) *, void *);
     75        void (*sa_sigaction)(int, siginfo_t *, void *);
    8076};
    8177
    8278
    83 /* Values of __POSIX_DEF__(sigevent)::sigev_notify */
     79/* Values of sigevent::sigev_notify */
    8480#undef SIGEV_NONE
    8581#undef SIGEV_SIGNAL
     
    229225};
    230226
    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);
     227extern int sigaction(int sig, const struct sigaction *__restrict__ act,
     228    struct sigaction *__restrict__ oact);
     229
     230extern void (*signal(int sig, void (*func)(int)))(int);
     231extern int raise(int sig);
     232extern int kill(pid_t pid, int sig);
     233extern int killpg(pid_t pid, int sig);
     234
     235extern void psiginfo(const siginfo_t *pinfo, const char *message);
     236extern void psignal(int signum, const char *message);
     237
     238extern int sigemptyset(sigset_t *set);
     239extern int sigfillset(sigset_t *set);
     240extern int sigaddset(sigset_t *set, int signo);
     241extern int sigdelset(sigset_t *set, int signo);
     242extern int sigismember(const sigset_t *set, int signo);
     243
     244extern int thread_sigmask(int how, const sigset_t *__restrict__ set,
     245    sigset_t *__restrict__ oset);
     246extern int sigprocmask(int how, const sigset_t *__restrict__ set,
     247    sigset_t *__restrict__ oset);
    252248
    253249
  • uspace/lib/posix/include/posix/stddef.h

    re0f47f5 r7f9df7b9  
    3636#define POSIX_STDDEF_H_
    3737
    38 #ifndef __POSIX_DEF__
    39 #define __POSIX_DEF__(x) x
    40 #endif
    41 
    4238#include "sys/types.h"
    4339
  • uspace/lib/posix/include/posix/stdint.h

    re0f47f5 r7f9df7b9  
    3636#define POSIX_STDINT_H_
    3737
    38 #ifndef __POSIX_DEF__
    39 #define __POSIX_DEF__(x) x
    40 #endif
    41 
    4238#include "libc/stdint.h"
    4339
  • uspace/lib/posix/include/posix/stdio.h

    re0f47f5 r7f9df7b9  
    3737#define POSIX_STDIO_H_
    3838
    39 #ifndef __POSIX_DEF__
    40 #define __POSIX_DEF__(x) x
    41 #endif
     39#include "libc/stdio.h"
    4240
    4341#include "stddef.h"
     
    6765typedef struct _IO_FILE FILE;
    6866
    69 #ifndef LIBPOSIX_INTERNAL
    70         enum _buffer_type {
    71                 /** No buffering */
    72                 _IONBF,
    73                 /** Line buffering */
    74                 _IOLBF,
    75                 /** Full buffering */
    76                 _IOFBF
    77         };
    78 #endif
    79 
    8067extern FILE *stdin;
    8168extern FILE *stdout;
     
    130117#undef L_ctermid
    131118#define L_ctermid PATH_MAX
    132 extern char *__POSIX_DEF__(ctermid)(char *s);
     119extern char *ctermid(char *s);
    133120
    134121/* Error Recovery */
    135 extern void __POSIX_DEF__(clearerr)(FILE *stream);
     122extern void clearerr(FILE *stream);
    136123
    137124/* Input/Output */
    138125#undef putc
    139126#define putc fputc
    140 extern int __POSIX_DEF__(fputs)(const char *__restrict__ s, FILE *__restrict__ stream);
     127extern int fputs(const char *__restrict__ s, FILE *__restrict__ stream);
    141128#undef getc
    142129#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,
     130extern int ungetc(int c, FILE *stream);
     131extern ssize_t getdelim(char **__restrict__ lineptr, size_t *__restrict__ n,
    145132    int delimiter, FILE *__restrict__ stream);
    146 extern ssize_t __POSIX_DEF__(getline)(char **__restrict__ lineptr, size_t *__restrict__ n,
     133extern ssize_t getline(char **__restrict__ lineptr, size_t *__restrict__ n,
    147134    FILE *__restrict__ stream);
    148135
    149136/* Opening Streams */
    150 extern FILE *__POSIX_DEF__(freopen)(const char *__restrict__ filename,
     137extern FILE *freopen(const char *__restrict__ filename,
    151138    const char *__restrict__ mode, FILE *__restrict__ stream);
    152139
    153140/* Error Messages */
    154 extern void __POSIX_DEF__(perror)(const char *s);
     141extern void perror(const char *s);
    155142
    156143/* File Positioning */
    157144typedef struct {
    158145        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
     148extern int fsetpos(FILE *stream, const fpos_t *pos);
     149extern int fgetpos(FILE *__restrict__ stream, fpos_t *__restrict__ pos);
     150extern int fseek(FILE *stream, long offset, int whence);
     151extern int fseeko(FILE *stream, off_t offset, int whence);
     152extern long ftell(FILE *stream);
     153extern off_t ftello(FILE *stream);
    167154
    168155/* Flushing Buffers */
    169 extern int __POSIX_DEF__(fflush)(FILE *stream);
     156extern int fflush(FILE *stream);
    170157
    171158/* Formatted Output */
    172 extern int __POSIX_DEF__(dprintf)(int fildes, const char *__restrict__ format, ...)
     159extern int dprintf(int fildes, const char *__restrict__ format, ...)
    173160    _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, ...)
     161extern int vdprintf(int fildes, const char *__restrict__ format, va_list ap);
     162extern int sprintf(char *__restrict__ s, const char *__restrict__ format, ...)
    176163    _HELENOS_PRINTF_ATTRIBUTE(2, 3);
    177 extern int __POSIX_DEF__(vsprintf)(char *__restrict__ s, const char *__restrict__ format, va_list ap);
     164extern int vsprintf(char *__restrict__ s, const char *__restrict__ format, va_list ap);
    178165
    179166/* Formatted Input */
    180 extern int __POSIX_DEF__(fscanf)(
     167extern int fscanf(
    181168    FILE *__restrict__ stream, const char *__restrict__ format, ...);
    182 extern int __POSIX_DEF__(vfscanf)(
     169extern int vfscanf(
    183170    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)(
     171extern int scanf(const char *__restrict__ format, ...);
     172extern int vscanf(const char *__restrict__ format, va_list arg);
     173extern int sscanf(
    187174    const char *__restrict__ s, const char *__restrict__ format, ...);
    188 extern int __POSIX_DEF__(vsscanf)(
     175extern int vsscanf(
    189176    const char *__restrict__ s, const char *__restrict__ format, va_list arg);
    190177
    191178/* 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);
     179extern void flockfile(FILE *file);
     180extern int ftrylockfile(FILE *file);
     181extern void funlockfile(FILE *file);
     182extern int getc_unlocked(FILE *stream);
     183extern int getchar_unlocked(void);
     184extern int putc_unlocked(int c, FILE *stream);
     185extern int putchar_unlocked(int c);
    199186
    200187/* Deleting Files */
    201 extern int __POSIX_DEF__(remove)(const char *path);
     188extern int remove(const char *path);
    202189
    203190/* Renaming Files */
    204 extern int __POSIX_DEF__(rename)(const char *oldname, const char *newname);
     191extern int rename(const char *oldname, const char *newname);
    205192
    206193/* Temporary Files */
    207194#undef L_tmpnam
    208195#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);
     196extern char *tmpnam(char *s);
     197extern char *tempnam(const char *dir, const char *pfx);
     198extern FILE *tmpfile(void);
    212199
    213200
  • uspace/lib/posix/include/posix/stdlib.h

    re0f47f5 r7f9df7b9  
    3737#define POSIX_STDLIB_H_
    3838
    39 #ifndef __POSIX_DEF__
    40 #define __POSIX_DEF__(x) x
    41 #endif
    42 
    4339#include "sys/types.h"
    4440
     
    5349#define EXIT_SUCCESS 0
    5450#define _Exit exit
    55 extern int __POSIX_DEF__(atexit)(void (*func)(void));
     51extern int atexit(void (*func)(void));
    5652extern void exit(int status) __attribute__((noreturn));
    5753extern void abort(void) __attribute__((noreturn));
    5854
    5955/* 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);
     56extern int abs(int i);
     57extern long labs(long i);
     58extern long long llabs(long long i);
    6359
    6460/* Integer Division */
     
    6662typedef struct {
    6763        int quot, rem;
    68 } __POSIX_DEF__(div_t);
     64} div_t;
    6965
    7066typedef struct {
    7167        long quot, rem;
    72 } __POSIX_DEF__(ldiv_t);
     68} ldiv_t;
    7369
    7470typedef struct {
    7571        long long quot, rem;
    76 } __POSIX_DEF__(lldiv_t);
     72} lldiv_t;
    7773
    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);
     74extern div_t div(int numer, int denom);
     75extern ldiv_t ldiv(long numer, long denom);
     76extern lldiv_t lldiv(long long numer, long long denom);
    8177
    8278/* Array Functions */
    83 extern void __POSIX_DEF__(qsort)(void *array, size_t count, size_t size,
     79extern void qsort(void *array, size_t count, size_t size,
    8480    int (*compare)(const void *, const void *));
    85 extern void *__POSIX_DEF__(bsearch)(const void *key, const void *base,
     81extern void *bsearch(const void *key, const void *base,
    8682    size_t nmemb, size_t size, int (*compar)(const void *, const void *));
    8783
    8884/* 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);
     85extern char *getenv(const char *name);
     86extern int putenv(char *string);
     87extern int system(const char *string);
    9288
    9389/* Symbolic Links */
    94 extern char *__POSIX_DEF__(realpath)(const char *__restrict__ name, char *__restrict__ resolved);
     90extern char *realpath(const char *__restrict__ name, char *__restrict__ resolved);
    9591
    9692/* 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);
     93extern double atof(const char *nptr);
     94extern float strtof(const char *__restrict__ nptr, char **__restrict__ endptr);
     95extern double strtod(const char *__restrict__ nptr, char **__restrict__ endptr);
     96extern long double strtold(const char *__restrict__ nptr, char **__restrict__ endptr);
    10197
    10298/* Integer Conversion */
     
    114110
    115111/* Memory Allocation */
    116 extern void *__POSIX_DEF__(malloc)(size_t size)
     112extern void *malloc(size_t size)
    117113    __attribute__((malloc));
    118 extern void *__POSIX_DEF__(calloc)(size_t nelem, size_t elsize)
     114extern void *calloc(size_t nelem, size_t elsize)
    119115    __attribute__((malloc));
    120 extern void *__POSIX_DEF__(realloc)(void *ptr, size_t size)
     116extern void *realloc(void *ptr, size_t size)
    121117    __attribute__((warn_unused_result));
    122 extern void __POSIX_DEF__(free)(void *ptr);
     118extern void free(void *ptr);
    123119
    124120/* Temporary Files */
    125 extern int __POSIX_DEF__(mkstemp)(char *tmpl);
     121extern int mkstemp(char *tmpl);
    126122
    127123/* Pseudo-random number generator */
    128 extern int __POSIX_DEF__(rand)(void);
    129 extern void __POSIX_DEF__(srand)(unsigned int seed);
     124extern int rand(void);
     125extern void srand(unsigned int seed);
    130126
    131127/* Legacy Declarations */
    132 extern char *__POSIX_DEF__(mktemp)(char *tmpl);
     128extern char *mktemp(char *tmpl);
    133129extern int bsd_getloadavg(double loadavg[], int nelem);
    134130
  • uspace/lib/posix/include/posix/string.h

    re0f47f5 r7f9df7b9  
    3737#define POSIX_STRING_H_
    3838
    39 #ifndef __POSIX_DEF__
    40 #define __POSIX_DEF__(x) x
    41 #endif
    42 
    4339#include "sys/types.h"
    4440
     
    7470
    7571/* 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);
     72extern char *strcpy(char *__restrict__ dest, const char *__restrict__ src);
     73extern char *strncpy(char *__restrict__ dest, const char *__restrict__ src, size_t n);
     74extern char *stpcpy(char *__restrict__ dest, const char *__restrict__ src);
     75extern char *stpncpy(char *__restrict__ dest, const char *__restrict__ src, size_t n);
     76extern char *strcat(char *__restrict__ dest, const char *__restrict__ src);
     77extern char *strncat(char *__restrict__ dest, const char *__restrict__ src, size_t n);
     78extern void *memccpy(void *__restrict__ dest, const void *__restrict__ src, int c, size_t n);
     79extern char *strdup(const char *s);
     80extern char *strndup(const char *s, size_t n);
    8581
    8682/* 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);
     83extern int memcmp(const void *mem1, const void *mem2, size_t n);
     84extern int strcmp(const char *s1, const char *s2);
     85extern int strncmp(const char *s1, const char *s2, size_t n);
    9086
    9187/* 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);
     88extern void *memchr(const void *mem, int c, size_t n);
     89extern char *strchr(const char *s, int c);
     90extern char *strrchr(const char *s, int c);
    9591extern 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);
     92extern char *strpbrk(const char *s1, const char *s2);
     93extern size_t strcspn(const char *s1, const char *s2);
     94extern size_t strspn(const char *s1, const char *s2);
     95extern char *strstr(const char *haystack, const char *needle);
    10096
    10197/* Tokenization functions. */
    102 extern char *__POSIX_DEF__(strtok_r)(char *, const char *, char **);
    103 extern char *__POSIX_DEF__(strtok)(char *, const char *);
     98extern char *strtok_r(char *, const char *, char **);
     99extern char *strtok(char *, const char *);
    104100
    105101
    106102/* 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);
     103extern int strcoll(const char *s1, const char *s2);
     104extern size_t strxfrm(char *__restrict__ s1, const char *__restrict__ s2, size_t n);
    109105
    110106/* Error Messages */
    111 extern char *__POSIX_DEF__(strerror)(int errnum);
    112 extern int __POSIX_DEF__(strerror_r)(int errnum, char *buf, size_t bufsz);
     107extern char *strerror(int errnum);
     108extern int strerror_r(int errnum, char *buf, size_t bufsz);
    113109
    114110/* 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);
     111extern size_t strlen(const char *s);
     112extern size_t strnlen(const char *s, size_t n);
    117113
    118114/* Signal Messages */
    119 extern char *__POSIX_DEF__(strsignal)(int signum);
     115extern char *strsignal(int signum);
    120116
    121117/* Legacy Declarations */
    122118#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);
     119extern int ffs(int i);
     120extern int strcasecmp(const char *s1, const char *s2);
     121extern int strncasecmp(const char *s1, const char *s2, size_t n);
    126122#endif
    127123
  • uspace/lib/posix/include/posix/strings.h

    re0f47f5 r7f9df7b9  
    3737#define POSIX_STRINGS_H_
    3838
    39 #ifndef __POSIX_DEF__
    40 #define __POSIX_DEF__(x) x
    41 #endif
    42 
    43 
    4439#include "libc/types/common.h"
    4540
    4641/* Search Functions */
    4742#ifndef POSIX_STRING_H_
    48 extern int __POSIX_DEF__(ffs)(int i);
     43extern int ffs(int i);
    4944#endif
    5045
    5146/* String/Array Comparison */
    5247#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);
     48extern int strcasecmp(const char *s1, const char *s2);
     49extern int strncasecmp(const char *s1, const char *s2, size_t n);
    5550#endif
    5651
     
    6257
    6358/* 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);
     59extern int bcmp(const void *mem1, const void *mem2, size_t n);
     60extern void bcopy(const void *src, void *dest, size_t n);
     61extern void bzero(void *mem, size_t n);
     62extern char *index(const char *s, int c);
     63extern char *rindex(const char *s, int c);
    6964
    7065
  • uspace/lib/posix/include/posix/sys/mman.h

    re0f47f5 r7f9df7b9  
    3636#define POSIX_SYS_MMAN_H_
    3737
    38 #ifndef __POSIX_DEF__
    39 #define __POSIX_DEF__(x) x
    40 #endif
    41 
    4238#include "types.h"
    4339#include <abi/mm/as.h>
     
    6157
    6258extern 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);
     59mmap(void *start, size_t length, int prot, int flags, int fd,
     60    off_t offset);
     61extern int munmap(void *start, size_t length);
    6662
    6763
  • uspace/lib/posix/include/posix/sys/stat.h

    re0f47f5 r7f9df7b9  
    3939#include "types.h"
    4040#include "../time.h"
    41 
    42 #ifndef __POSIX_DEF__
    43 #define __POSIX_DEF__(x) x
    44 #endif
    4541
    4642/* values are the same as on Linux */
     
    112108#define S_ISSOCK(m) ((m & S_IFSOCK) != 0) /* socket? (Not in POSIX.1-1996.) */
    113109
    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 */
     110struct 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 */
    125121        time_t          st_atime;   /* time of last access */
    126122        time_t          st_mtime;   /* time of last modification */
     
    128124};
    129125
    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);
     126extern int fstat(int fd, struct stat *st);
     127extern int lstat(const char *__restrict__ path, struct stat *__restrict__ st);
     128extern int stat(const char *__restrict__ path, struct stat *__restrict__ st);
     129extern int chmod(const char *path, mode_t mode);
     130extern mode_t umask(mode_t mask);
     131extern int mkdir(const char *path, mode_t mode);
    136132
    137133
  • uspace/lib/posix/include/posix/sys/time.h

    re0f47f5 r7f9df7b9  
    3434#define POSIX_SYS_TIME_H_
    3535
    36 #ifndef __POSIX_DEF__
    37 #define __POSIX_DEF__(x) x
    38 #endif
    39 
    4036#include "libc/sys/time.h"
    4137
  • uspace/lib/posix/include/posix/sys/types.h

    re0f47f5 r7f9df7b9  
    3737#define POSIX_SYS_TYPES_H_
    3838
    39 #ifndef __POSIX_DEF__
    40 #define __POSIX_DEF__(x) x
    41 #endif
    42 
    4339#include "libc/offset.h"
    4440#include "libc/sys/time.h"
    4541#include "libc/types/common.h"
    4642
    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);
     43typedef unsigned int ino_t;
     44typedef unsigned int nlink_t;
     45typedef unsigned int uid_t;
     46typedef unsigned int gid_t;
     47typedef off64_t off_t;
     48typedef long blksize_t;
     49typedef long blkcnt_t;
     50typedef int64_t pid_t;
     51typedef sysarg_t dev_t;
     52typedef unsigned int mode_t;
    5753
    5854/* PThread Types */
    59 typedef struct __POSIX_DEF__(thread_attr) __POSIX_DEF__(thread_attr_t);
     55typedef struct thread_attr thread_attr_t;
    6056
    6157/* Clock Types */
    62 typedef long __POSIX_DEF__(clock_t);
    63 typedef int __POSIX_DEF__(clockid_t);
     58typedef long clock_t;
     59typedef int clockid_t;
    6460
    6561
  • uspace/lib/posix/include/posix/sys/wait.h

    re0f47f5 r7f9df7b9  
    3636#define POSIX_SYS_WAIT_H_
    3737
    38 #ifndef __POSIX_DEF__
    39 #define __POSIX_DEF__(x) x
    40 #endif
    41 
    4238#include "types.h"
    4339
     
    5652extern int __posix_wtermsig(int status);
    5753
    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);
     54extern pid_t wait(int *stat_ptr);
     55extern pid_t waitpid(pid_t pid, int *stat_ptr, int options);
    6056
    6157
  • uspace/lib/posix/include/posix/time.h

    re0f47f5 r7f9df7b9  
    3737#define POSIX_TIME_H_
    3838
    39 #ifndef __POSIX_DEF__
    40 #define __POSIX_DEF__(x) x
    41 #endif
    42 
    4339#include "sys/types.h"
    4440
     
    5147#ifndef __locale_t_defined
    5248        #define __locale_t_defined
    53         typedef struct __posix_locale *__POSIX_DEF__(locale_t);
     49        typedef struct __posix_locale *locale_t;
    5450        #ifndef LIBPOSIX_INTERNAL
    55                 #define locale_t __POSIX_DEF__(locale_t)
     51                #define locale_t locale_t
    5652        #endif
    5753#endif
    5854
    5955#ifndef POSIX_SIGNAL_H_
    60         struct __POSIX_DEF__(sigevent);
     56        struct sigevent;
    6157        #ifndef LIBPOSIX_INTERNAL
    62                 #define sigevent __POSIX_DEF__(sigevent)
     58                #define sigevent sigevent
    6359        #endif
    6460#endif
    6561
    6662#undef CLOCK_REALTIME
    67 #define CLOCK_REALTIME ((__POSIX_DEF__(clockid_t)) 0)
     63#define CLOCK_REALTIME ((clockid_t) 0)
    6864
    69 struct __POSIX_DEF__(timespec) {
     65struct timespec {
    7066        time_t tv_sec; /* Seconds. */
    7167        long tv_nsec; /* Nanoseconds. */
    7268};
    7369
    74 struct __POSIX_DEF__(itimerspec) {
    75         struct __POSIX_DEF__(timespec) it_interval; /* Timer period. */
    76         struct __POSIX_DEF__(timespec) it_value; /* Timer expiration. */
     70struct itimerspec {
     71        struct timespec it_interval; /* Timer period. */
     72        struct timespec it_value; /* Timer expiration. */
    7773};
    7874
    79 typedef struct __posix_timer *__POSIX_DEF__(timer_t);
     75typedef struct __posix_timer *timer_t;
    8076
    8177/* 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);
     78extern int daylight;
     79extern long timezone;
     80extern char *tzname[2];
     81extern void tzset(void);
    8682
    8783/* Time */
    88 extern time_t __POSIX_DEF__(time)(time_t *t);
     84extern time_t time(time_t *t);
    8985
    9086/* Broken-down Time */
    91 extern struct tm *__POSIX_DEF__(gmtime_r)(const time_t *__restrict__ timer,
     87extern struct tm *gmtime_r(const time_t *__restrict__ timer,
    9288    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,
     89extern struct tm *gmtime(const time_t *__restrict__ timep);
     90extern struct tm *localtime_r(const time_t *__restrict__ timer,
    9591    struct tm *__restrict__ result);
    96 extern struct tm *__POSIX_DEF__(localtime)(const time_t *__restrict__ timep);
     92extern struct tm *localtime(const time_t *__restrict__ timep);
    9793
    9894/* Formatting Calendar Time */
    99 extern char *__POSIX_DEF__(asctime_r)(const struct tm *__restrict__ timeptr,
     95extern char *asctime_r(const struct tm *__restrict__ timeptr,
    10096    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);
     97extern char *asctime(const struct tm *__restrict__ timeptr);
     98extern char *ctime_r(const time_t *timer, char *buf);
     99extern char *ctime(const time_t *timer);
    104100extern time_t time(time_t *t);
    105101
    106102/* 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);
     103extern int clock_getres(clockid_t clock_id,
     104    struct timespec *res);
     105extern int clock_gettime(clockid_t clock_id,
     106    struct timespec *tp);
     107extern int clock_settime(clockid_t clock_id,
     108    const struct timespec *tp);
     109extern int clock_nanosleep(clockid_t clock_id, int flags,
     110    const struct timespec *rqtp, struct timespec *rmtp);
    115111
    116112/* CPU Time */
    117 extern __POSIX_DEF__(clock_t) __POSIX_DEF__(clock)(void);
     113extern clock_t clock(void);
    118114
    119115
  • uspace/lib/posix/include/posix/ucontext.h

    re0f47f5 r7f9df7b9  
    3636#define POSIX_UCONTEXT_H_
    3737
    38 #ifndef __POSIX_DEF__
    39 #define __POSIX_DEF__(x) x
    40 #endif
    41 
    4238#include "sys/types.h"
    4339
    44 typedef int __POSIX_DEF__(sig_atomic_t);
    45 typedef uint32_t __POSIX_DEF__(sigset_t);
    46 typedef struct __POSIX_DEF__(mcontext) {
     40typedef int sig_atomic_t;
     41typedef uint32_t sigset_t;
     42typedef struct mcontext {
    4743        /* must not be empty to avoid compiler warnings (-pedantic) */
    4844        int dummy;
    49 } __POSIX_DEF__(mcontext_t);
     45} mcontext_t;
    5046
    51 union __POSIX_DEF__(sigval) {
     47union sigval {
    5248        int sival_int;
    5349        void *sival_ptr;
    5450};
    5551
    56 struct __POSIX_DEF__(sigevent) {
     52struct sigevent {
    5753        int sigev_notify; /* Notification type. */
    5854        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. */
    6258};
    6359
     
    6662        size_t ss_size;
    6763        int ss_flags;
    68 } __POSIX_DEF__(stack_t);
     64} stack_t;
    6965
    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);
     66typedef 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;
    7672
    7773
  • uspace/lib/posix/include/posix/unistd.h

    re0f47f5 r7f9df7b9  
    3737#define POSIX_UNISTD_H_
    3838
    39 #ifndef __POSIX_DEF__
    40 #define __POSIX_DEF__(x) x
    41 #endif
    42 
    4339#include "sys/types.h"
    4440#include "stddef.h"
     
    5147#define _exit exit
    5248
    53 extern char *__POSIX_DEF__(optarg);
     49extern char *optarg;
    5450extern int optind, opterr, optopt;
    55 extern int __POSIX_DEF__(getopt)(int, char * const [], const char *);
     51extern int getopt(int, char * const [], const char *);
    5652
    5753/* Environment */
    58 extern char **__POSIX_DEF__(environ);
     54extern char **environ;
    5955
    6056/* Sleeping */
    61 extern unsigned int __POSIX_DEF__(sleep)(unsigned int);
     57extern unsigned int sleep(unsigned int);
    6258
    6359/* Login Information */
    64 extern char *__POSIX_DEF__(getlogin)(void);
    65 extern int __POSIX_DEF__(getlogin_r)(char *name, size_t namesize);
     60extern char *getlogin(void);
     61extern int getlogin_r(char *name, size_t namesize);
    6662
    6763/* Identifying Terminals */
    68 extern int __POSIX_DEF__(isatty)(int fd);
     64extern int isatty(int fd);
    6965
    7066/* Working Directory */
    71 extern char *__POSIX_DEF__(getcwd)(char *buf, size_t size);
    72 extern int __POSIX_DEF__(chdir)(const char *path);
     67extern char *getcwd(char *buf, size_t size);
     68extern int chdir(const char *path);
    7369
    7470/* Query Memory Parameters */
    75 extern int __POSIX_DEF__(getpagesize)(void);
     71extern int getpagesize(void);
    7672
    7773/* 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);
     74extern pid_t getpid(void);
     75extern uid_t getuid(void);
     76extern gid_t getgid(void);
    8177
    8278/* 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);
     79extern int close(int fildes);
     80extern ssize_t read(int fildes, void *buf, size_t nbyte);
     81extern ssize_t write(int fildes, const void *buf, size_t nbyte);
     82extern off_t lseek(int fildes,
     83    off_t offset, int whence);
     84extern int fsync(int fildes);
     85extern int ftruncate(int fildes, off_t length);
     86extern int rmdir(const char *path);
     87extern int unlink(const char *path);
     88extern int dup(int fildes);
     89extern int dup2(int fildes, int fildes2);
    9490
    9591/* Standard Streams */
     
    110106#define W_OK 2 /* Test for write permission. */
    111107#define R_OK 4 /* Test for read permission. */
    112 extern int __POSIX_DEF__(access)(const char *path, int amode);
     108extern int access(const char *path, int amode);
    113109
    114110/* System Parameters */
     
    119115        _SC_CLK_TCK
    120116};
    121 extern long __POSIX_DEF__(sysconf)(int name);
     117extern long sysconf(int name);
    122118
    123119/* Path Configuration Parameters */
     
    143139        _PC_VDISABLE
    144140};
    145 extern long __POSIX_DEF__(pathconf)(const char *path, int name);
     141extern long pathconf(const char *path, int name);
    146142
    147143/* Creating a Process */
    148 extern __POSIX_DEF__(pid_t) __POSIX_DEF__(fork)(void);
     144extern pid_t fork(void);
    149145
    150146/* 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[]);
     147extern int execv(const char *path, char *const argv[]);
     148extern int execvp(const char *file, char *const argv[]);
    153149
    154150/* Creating a Pipe */
    155 extern int __POSIX_DEF__(pipe)(int fildes[2]);
     151extern int pipe(int fildes[2]);
    156152
    157153/* Issue alarm signal. */
    158 extern unsigned int __POSIX_DEF__(alarm)(unsigned int);
     154extern unsigned int alarm(unsigned int);
    159155
    160156#endif /* POSIX_UNISTD_H_ */
Note: See TracChangeset for help on using the changeset viewer.