Changes in / [52acfab:af5037d] in mainline


Ignore:
Files:
2 deleted
78 edited

Legend:

Unmodified
Added
Removed
  • abi/include/_bits/errno.h

    r52acfab raf5037d  
    4141#define _BITS_ERRNO_H_
    4242
    43 #include <_bits/native.h>
    44 #include <_bits/decls.h>
    45 
    4643#ifdef __OPAQUE_ERRNO__
    4744#include <_bits/__opaque_handle.h>
    4845
    49 __HELENOS_DECLS_BEGIN;
    5046__opaque_handle(errno_t);
    5147typedef errno_t sys_errno_t;
    52 __HELENOS_DECLS_END;
    53 
    5448#define __errno_t(val) ((errno_t) val)
    5549
    5650#else
    5751
    58 __HELENOS_DECLS_BEGIN;
     52#include <_bits/native.h>
    5953
    6054/**
     
    7165typedef sysarg_t sys_errno_t;
    7266
    73 __HELENOS_DECLS_END;
    74 
    7567/**
    7668 * A C++-style "cast" to `errno_t`.
  • abi/include/_bits/native.h

    r52acfab raf5037d  
    4747
    4848#include <inttypes.h>
    49 #include <_bits/decls.h>
    50 
    51 __HELENOS_DECLS_BEGIN;
    5249
    5350typedef uintptr_t pfn_t;
     
    5653typedef intptr_t  native_t;
    5754
    58 __HELENOS_DECLS_END;
     55#define PRIdn  PRIdPTR  /**< Format for native_t. */
     56#define PRIun  PRIuPTR  /**< Format for sysarg_t. */
     57#define PRIxn  PRIxPTR  /**< Format for hexadecimal sysarg_t. */
    5958
    6059#endif
  • abi/include/_bits/ssize_t.h

    r52acfab raf5037d  
    4242
    4343#include <stdint.h>
    44 #include <_bits/decls.h>
    4544
    46 __C_DECLS_BEGIN;
    4745typedef intptr_t ssize_t;
    48 __C_DECLS_END;
     46
     47#define SSIZE_MIN  INTPTR_MIN
     48#define SSIZE_MAX  INTPTR_MAX
    4949
    5050#endif
  • abi/include/inttypes.h

    r52acfab raf5037d  
    4343#include <stdint.h>
    4444#include <_bits/wchar_t.h>
    45 #include <_bits/decls.h>
    4645
    4746/*
     
    312311#endif
    313312
     313#ifdef _HELENOS_SOURCE
     314#define UINT8_MIN   0
     315#define UINT16_MIN  0
     316#define UINT32_MIN  0
     317#define UINT64_MIN  0
     318#endif
     319
    314320#define PRIdMAX  "lld"
    315321#define PRIiMAX  "lli"
     
    324330#define SCNxMAX  "llx"
    325331
    326 #if defined(_HELENOS_SOURCE) && !defined(__cplusplus)
    327 #define PRIdn  PRIdPTR  /**< Format for native_t. */
    328 #define PRIun  PRIuPTR  /**< Format for sysarg_t. */
    329 #define PRIxn  PRIxPTR  /**< Format for hexadecimal sysarg_t. */
    330 #endif
    331 
    332 __C_DECLS_BEGIN;
     332#ifdef __cplusplus
     333extern "C" {
     334#endif
    333335
    334336typedef struct {
     
    341343intmax_t strtoimax(const char *__restrict__, char **__restrict__, int);
    342344uintmax_t strtoumax(const char *__restrict__, char **__restrict__, int);
    343 intmax_t wcstoimax(const wchar_t *__restrict__, wchar_t **__restrict__, int);
    344 uintmax_t wcstoumax(const wchar_t *__restrict__, wchar_t **__restrict__, int);
    345 
    346 __C_DECLS_END;
     345
     346#ifdef __cplusplus
     347}
     348#endif
    347349
    348350#endif
  • abi/include/limits.h

    r52acfab raf5037d  
    8484#define MB_LEN_MAX 4
    8585
    86 #ifdef _HELENOS_SOURCE
    8786#define UCHAR_MIN   0
    8887#define USHRT_MIN   0
     
    9089#define ULONG_MIN   (0ul)
    9190#define ULLONG_MIN  (0ull)
    92 #define SSIZE_MIN   INTPTR_MIN
    93 #define UINT8_MIN   0
    94 #define UINT16_MIN  0
    95 #define UINT32_MIN  0
    96 #define UINT64_MIN  0
    97 #endif
    98 
    99 #if defined(_HELENOS_SOURCE) || defined(_POSIX_SOURCE) || \
    100     defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
    101     defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
    102 
    103 #define SSIZE_MAX  INTPTR_MAX
    104 #define NAME_MAX   255
    105 
    106 #endif
    10791
    10892/* GCC's <limits.h> doesn't define these for C++11, even though it should. */
  • kernel/Makefile

    r52acfab raf5037d  
    8787INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES))
    8888
    89 DEFS = -D_HELENOS_SOURCE -DKERNEL -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
     89DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
    9090
    9191COMMON_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
  • uspace/lib/c/generic/dirent.c

    r52acfab raf5037d  
    3939#include <errno.h>
    4040#include <assert.h>
    41 #include <string.h>
    4241
    4342struct __dirstream {
     
    9392        ssize_t len = 0;
    9493
    95         rc = vfs_read_short(dirp->fd, dirp->pos, dirp->res.d_name,
    96             sizeof(dirp->res.d_name), &len);
     94        rc = vfs_read_short(dirp->fd, dirp->pos, &dirp->res.d_name[0],
     95            NAME_MAX + 1, &len);
    9796        if (rc != EOK) {
    9897                errno = rc;
    9998                return NULL;
    10099        }
    101 
    102         assert(strnlen(dirp->res.d_name, sizeof(dirp->res.d_name)) < sizeof(dirp->res.d_name));
    103100
    104101        dirp->pos += len;
  • uspace/lib/c/generic/private/stdio.h

    r52acfab raf5037d  
    4040#include <async.h>
    4141#include <stddef.h>
    42 #include <offset.h>
    4342
    4443/** Maximum characters that can be pushed back by ungetc() */
     
    5554        int (*flush)(FILE *stream);
    5655} __stream_ops_t;
    57 
    58 enum __buffer_state {
    59         /** Buffer is empty */
    60         _bs_empty,
    61 
    62         /** Buffer contains data to be written */
    63         _bs_write,
    64 
    65         /** Buffer contains prefetched data for reading */
    66         _bs_read
    67 };
    6856
    6957struct _IO_FILE {
     
    9987
    10088        /** Buffering type */
    101         enum __buffer_type btype;
     89        enum _buffer_type btype;
    10290
    10391        /** Buffer */
     
    10896
    10997        /** Buffer state */
    110         enum __buffer_state buf_state;
     98        enum _buffer_state buf_state;
    11199
    112100        /** Buffer I/O pointer */
  • uspace/lib/c/include/adt/list.h

    r52acfab raf5037d  
    4242#include <stdint.h>
    4343#include <trace.h>
    44 #include <_bits/decls.h>
    45 
    46 #ifndef __cplusplus
    47 
    48 /**
    49  * We don't define the macros in C++ to avoid polluting headers with
    50  * namespaceless names. We don't actually need them, so this is fine.
    51  * We still allow including the rest of the file (in `helenos` namespace)
    52  * so that we can expose publicly visible types that have list_t members.
    53  */
     44
     45/** Doubly linked list link. */
     46typedef struct link {
     47        struct link *prev;  /**< Pointer to the previous item in the list. */
     48        struct link *next;  /**< Pointer to the next item in the list. */
     49} link_t;
     50
     51/** Doubly linked list. */
     52typedef struct list {
     53        link_t head;  /**< List head. Does not have any data. */
     54} list_t;
     55
     56extern bool list_member(const link_t *, const list_t *);
     57extern void list_splice(list_t *, link_t *);
     58extern unsigned long list_count(const list_t *);
    5459
    5560/** Declare and initialize statically allocated list.
     
    133138        assert(!link_used(link))
    134139
    135 #define list_pop(list, type, member) \
    136         ((type *) list_pop_internal(list, \
    137             (list_link_to_void(&(((type *) NULL)->member)) - NULL)))
    138 
    139 #endif  /* !__cplusplus */
    140 
    141 __HELENOS_DECLS_BEGIN;
    142 
    143 /** Doubly linked list link. */
    144 typedef struct __adt_list_link {
    145         struct __adt_list_link *prev;  /**< Pointer to the previous item in the list. */
    146         struct __adt_list_link *next;  /**< Pointer to the next item in the list. */
    147 } link_t;
    148 
    149 /** Doubly linked list. */
    150 typedef struct {
    151         link_t head;  /**< List head. Does not have any data. */
    152 } list_t;
    153 
    154 extern bool list_member(const link_t *, const list_t *);
    155 extern void list_splice(list_t *, link_t *);
    156 extern unsigned long list_count(const list_t *);
    157 
    158140/** Returns true if the link is definitely part of a list. False if not sure. */
    159141static inline bool link_in_use(const link_t *link)
     
    443425}
    444426
    445 __HELENOS_DECLS_END;
     427#define list_pop(list, type, member) \
     428        ((type *) list_pop_internal(list, \
     429            (list_link_to_void(&(((type *) NULL)->member)) - NULL)))
    446430
    447431#endif
  • uspace/lib/c/include/assert.h

    r52acfab raf5037d  
    4141#define _LIBC_ASSERT_H_
    4242
    43 #include <_bits/decls.h>
    44 
    4543#ifndef __cplusplus
    4644#define static_assert _Static_assert
    4745#endif
    48 
    49 __C_DECLS_BEGIN;
    5046
    5147extern void __helenos_assert_abort(const char *, const char *, unsigned int)
     
    5450extern void __helenos_assert_quick_abort(const char *, const char *, unsigned int)
    5551    __attribute__((noreturn));
    56 
    57 __C_DECLS_END;
    5852
    5953#endif
  • uspace/lib/c/include/bsearch.h

    r52acfab raf5037d  
    3737
    3838#include <stddef.h>
    39 #include <_bits/decls.h>
    40 
    41 __C_DECLS_BEGIN;
    4239
    4340extern void *bsearch(const void *, const void *, size_t, size_t,
    4441    int (*)(const void *, const void *));
    45 
    46 __C_DECLS_END;
    4742
    4843#endif
  • uspace/lib/c/include/ctype.h

    r52acfab raf5037d  
    3030#define _LIBC_CTYPE_H_
    3131
    32 #include <_bits/decls.h>
    33 
    34 __C_DECLS_BEGIN;
    3532int islower(int);
    3633int isupper(int);
     
    4744int tolower(int);
    4845int toupper(int);
    49 __C_DECLS_END;
    5046
    5147#endif
  • uspace/lib/c/include/dirent.h

    r52acfab raf5037d  
    3636#define _LIBC_DIRENT_H_
    3737
    38 #include <_bits/decls.h>
    39 
    40 __C_DECLS_BEGIN;
     38#define NAME_MAX  256
    4139
    4240struct dirent {
    43         char d_name[256];
     41        char d_name[NAME_MAX + 1];
    4442};
    4543
     
    5149extern int closedir(DIR *);
    5250
    53 __C_DECLS_END;
    54 
    5551#endif
    5652
  • uspace/lib/c/include/dlfcn.h

    r52acfab raf5037d  
    3737#define _LIBC_DLFCN_H_
    3838
    39 #include <_bits/decls.h>
    40 
    41 __C_DECLS_BEGIN;
    42 
    4339void *dlopen(const char *, int);
    4440void *dlsym(void *, const char *);
    45 
    46 __C_DECLS_END;
    4741
    4842#endif
  • uspace/lib/c/include/errno.h

    r52acfab raf5037d  
    3838#include <_bits/errno.h>
    3939#include <abi/errno.h>
    40 #include <_bits/decls.h>
    4140
    42 __HELENOS_DECLS_BEGIN;
     41#define errno  (*(__errno()))
    4342
    4443extern errno_t *__errno(void) __attribute__((const));
    45 
    46 __HELENOS_DECLS_END;
    47 
    48 #ifdef __cplusplus
    49 #define errno  (*(::helenos::__errno()))
    50 #else
    51 #define errno  (*(__errno()))
    52 #endif
    5344
    5445#endif
  • uspace/lib/c/include/fibril.h

    r52acfab raf5037d  
    3636#define _LIBC_FIBRIL_H_
    3737
     38#include <types/common.h>
    3839#include <time.h>
    39 #include <_bits/errno.h>
    4040#include <_bits/__noreturn.h>
    41 #include <_bits/decls.h>
    42 
    43 __HELENOS_DECLS_BEGIN;
    4441
    4542typedef struct fibril fibril_t;
     
    7471extern __noreturn void fibril_exit(long);
    7572
    76 __HELENOS_DECLS_END;
    77 
    7873#endif
    7974
  • uspace/lib/c/include/fibril_synch.h

    r52acfab raf5037d  
    4040#include <time.h>
    4141#include <stdbool.h>
    42 #include <_bits/decls.h>
    4342
    44 #ifndef __cplusplus
     43typedef struct {
     44        fibril_owner_info_t oi;  /**< Keep this the first thing. */
     45        int counter;
     46        list_t waiters;
     47} fibril_mutex_t;
    4548
    4649#define FIBRIL_MUTEX_INITIALIZER(name) \
     
    5558#define FIBRIL_MUTEX_INITIALIZE(name) \
    5659        fibril_mutex_t name = FIBRIL_MUTEX_INITIALIZER(name)
     60
     61typedef struct {
     62        fibril_owner_info_t oi;  /**< Keep this the first thing. */
     63        unsigned int writers;
     64        unsigned int readers;
     65        list_t waiters;
     66} fibril_rwlock_t;
    5767
    5868#define FIBRIL_RWLOCK_INITIALIZER(name) \
     
    6979        fibril_rwlock_t name = FIBRIL_RWLOCK_INITIALIZER(name)
    7080
     81typedef struct {
     82        list_t waiters;
     83} fibril_condvar_t;
     84
    7185#define FIBRIL_CONDVAR_INITIALIZER(name) \
    7286        { \
     
    7690#define FIBRIL_CONDVAR_INITIALIZE(name) \
    7791        fibril_condvar_t name = FIBRIL_CONDVAR_INITIALIZER(name)
    78 
    79 #define FIBRIL_SEMAPHORE_INITIALIZER(name, cnt) \
    80         { \
    81                 .count = (cnt), \
    82                 .waiters = LIST_INITIALIZER((name).waiters), \
    83         }
    84 
    85 #define FIBRIL_SEMAPHORE_INITIALIZE(name, cnt) \
    86         fibril_semaphore_t name = FIBRIL_SEMAPHORE_INITIALIZER(name, cnt)
    87 
    88 #endif
    89 
    90 __HELENOS_DECLS_BEGIN;
    91 
    92 typedef struct {
    93         fibril_owner_info_t oi;  /**< Keep this the first thing. */
    94         int counter;
    95         list_t waiters;
    96 } fibril_mutex_t;
    97 
    98 typedef struct {
    99         fibril_owner_info_t oi;  /**< Keep this the first thing. */
    100         unsigned int writers;
    101         unsigned int readers;
    102         list_t waiters;
    103 } fibril_rwlock_t;
    104 
    105 typedef struct {
    106         list_t waiters;
    107 } fibril_condvar_t;
    10892
    10993typedef void (*fibril_timer_fun_t)(void *);
     
    149133        bool closed;
    150134} fibril_semaphore_t;
     135
     136#define FIBRIL_SEMAPHORE_INITIALIZER(name, cnt) \
     137        { \
     138                .count = (cnt), \
     139                .waiters = LIST_INITIALIZER((name).waiters), \
     140        }
     141
     142#define FIBRIL_SEMAPHORE_INITIALIZE(name, cnt) \
     143        fibril_semaphore_t name = FIBRIL_SEMAPHORE_INITIALIZER(name, cnt)
    151144
    152145extern void __fibril_synch_init(void);
     
    197190extern void mpsc_close(mpsc_t *);
    198191
    199 __HELENOS_DECLS_END;
    200 
    201192#endif
    202193
  • uspace/lib/c/include/malloc.h

    r52acfab raf5037d  
    3737
    3838#include <stddef.h>
    39 #include <_bits/decls.h>
    40 
    41 __C_DECLS_BEGIN;
    4239
    4340extern void *malloc(size_t size)
     
    4542extern void *calloc(size_t nmemb, size_t size)
    4643    __attribute__((malloc));
     44extern void *memalign(size_t align, size_t size)
     45    __attribute__((malloc));
    4746extern void *realloc(void *addr, size_t size)
    4847    __attribute__((warn_unused_result));
    4948extern void free(void *addr);
    50 
    51 __C_DECLS_END;
    52 
    53 #ifdef _HELENOS_SOURCE
    54 __HELENOS_DECLS_BEGIN;
    55 
    56 extern void *memalign(size_t align, size_t size)
    57     __attribute__((malloc));
    5849extern void *heap_check(void);
    59 
    60 __HELENOS_DECLS_END;
    61 #endif
    6250
    6351#endif
  • uspace/lib/c/include/mem.h

    r52acfab raf5037d  
    3838
    3939#include <stddef.h>
    40 #include <_bits/decls.h>
    41 
    42 __C_DECLS_BEGIN;
    4340
    4441extern void *memset(void *, int, size_t)
     
    5350    __attribute__((nonnull(1)));
    5451
    55 __C_DECLS_END;
    56 
    5752#endif
    5853
  • uspace/lib/c/include/offset.h

    r52acfab raf5037d  
    3636#define _LIBC_OFFSET_H_
    3737
    38 #ifndef _HELENOS_SOURCE
    39 #error This file should only be included from HelenOS sources
    40 #endif
    41 
    4238#include <stdint.h>
    43 #include <_bits/decls.h>
    44 #include <_bits/off64_t.h>
    4539
    4640/* off64_t */
     
    5852#define PRIXOFF64 PRIX64
    5953
    60 __HELENOS_DECLS_BEGIN;
     54/** Relative offset */
     55typedef int64_t off64_t;
    6156
    6257/** Absolute offset */
    6358typedef uint64_t aoff64_t;
    64 
    65 __HELENOS_DECLS_END;
    6659
    6760#endif
  • uspace/lib/c/include/qsort.h

    r52acfab raf5037d  
    3737
    3838#include <stddef.h>
    39 #include <_bits/decls.h>
    4039
    41 __C_DECLS_BEGIN;
    4240extern void qsort(void *, size_t, size_t, int (*)(const void *,
    4341    const void *));
    44 __C_DECLS_END;
    45 
    46 #ifdef _HELENOS_SOURCE
    47 __HELENOS_DECLS_BEGIN;
    4842extern void qsort_r(void *, size_t, size_t, int (*)(const void *,
    4943    const void *, void *), void *);
    50 __HELENOS_DECLS_END;
    51 #endif
    5244
    5345#endif
  • uspace/lib/c/include/setjmp.h

    r52acfab raf5037d  
    3434#define _LIBC_SETJMP_H_
    3535
     36#ifdef __cplusplus
     37extern "C" {
     38#endif
     39
    3640#include <libarch/fibril_context.h>
    3741#include <_bits/__noreturn.h>
    38 #include <_bits/decls.h>
    39 
    40 __C_DECLS_BEGIN;
    4142
    4243typedef __context_t jmp_buf[1];
     
    4546extern __noreturn void __context_restore(__context_t *, int);
    4647
     48#define setjmp __context_save
    4749extern __noreturn void longjmp(jmp_buf, int);
    4850
    49 __C_DECLS_END;
    50 
    51 #define setjmp __context_save
     51#ifdef __cplusplus
     52}
     53#endif
    5254
    5355#endif
  • uspace/lib/c/include/stdio.h

    r52acfab raf5037d  
    3737#define _LIBC_STDIO_H_
    3838
     39#ifdef __cplusplus
     40extern "C" {
     41#endif
     42
     43#include <offset.h>
    3944#include <stdarg.h>
    4045#include <io/verify.h>
     
    4348#include <_bits/wchar_t.h>
    4449#include <_bits/wint_t.h>
    45 #include <_bits/decls.h>
     50
     51/** Forward declaration */
     52struct _IO_FILE;
     53typedef struct _IO_FILE FILE;
     54
     55/** File position */
     56typedef struct {
     57        off64_t pos;
     58} fpos_t;
    4659
    4760#ifndef _HELENOS_SOURCE
     
    5770
    5871/** Max number of files that is guaranteed to be able to open at the same time */
    59 #define FOPEN_MAX 16
     72#define FOPEN_MAX VFS_MAX_OPEN_FILES
    6073
    6174/** Recommended size of fixed-size array for holding file names. */
     
    7992/** Minimum number of unique temporary file names */
    8093#define TMP_MAX 1000000
    81 
    82 __C_DECLS_BEGIN;
    83 
    84 /** Forward declaration */
    85 struct _IO_FILE;
    86 typedef struct _IO_FILE FILE;
    87 
    88 /** File position */
    89 typedef struct {
    90         long long pos;
    91 } fpos_t;
    9294
    9395extern FILE *stdin;
     
    9698
    9799/* Character and string input functions */
     100#define getc fgetc
    98101extern int fgetc(FILE *);
    99102extern char *fgets(char *, int, FILE *);
    100103extern char *gets(char *, size_t) __attribute__((deprecated));
    101104
    102 static inline int getc(FILE *f)
    103 {
    104         return fgetc(f);
    105 }
    106 
    107105extern int getchar(void);
    108106
    109107/* Character and string output functions */
     108#define putc fputc
    110109extern int fputc(int, FILE *);
    111110extern int fputs(const char *, FILE *);
    112 
    113 static inline int putc(int i, FILE *f)
    114 {
    115         return fputc(i, f);
    116 }
    117111
    118112extern int putchar(int);
     
    186180extern char *tmpnam(char *s);
    187181
    188 __C_DECLS_END;
    189 
    190182#ifdef _HELENOS_SOURCE
    191183
    192 #include <_bits/off64_t.h>
    193 
    194 __HELENOS_DECLS_BEGIN;
    195 
    196184/* Nonstandard extensions. */
    197185
    198 enum __buffer_type {
     186enum _buffer_type {
    199187        /** No buffering */
    200188        _IONBF,
     
    205193};
    206194
     195enum _buffer_state {
     196        /** Buffer is empty */
     197        _bs_empty,
     198
     199        /** Buffer contains data to be written */
     200        _bs_write,
     201
     202        /** Buffer contains prefetched data for reading */
     203        _bs_read
     204};
     205
    207206extern int vprintf_length(const char *, va_list);
    208207extern int printf_length(const char *, ...)
     
    211210extern int fileno(FILE *);
    212211
     212#include <offset.h>
     213
    213214extern int fseek64(FILE *, off64_t, int);
    214215extern off64_t ftell64(FILE *);
    215216
    216 __HELENOS_DECLS_END;
     217#endif
     218
     219#ifdef __cplusplus
     220}
    217221#endif
    218222
  • uspace/lib/c/include/stdlib.h

    r52acfab raf5037d  
    3636#define _LIBC_STDLIB_H_
    3737
     38#ifdef __cplusplus
     39extern "C" {
     40#endif
     41
    3842#include <_bits/size_t.h>
    3943#include <_bits/wchar_t.h>
    40 #include <_bits/decls.h>
    4144#include <bsearch.h>
    4245#include <malloc.h>
    4346#include <qsort.h>
    44 
    45 #define EXIT_SUCCESS 0
    46 #define EXIT_FAILURE 1
    47 
    48 #define RAND_MAX  714025
    49 
    50 #define MB_CUR_MAX 4
    51 
    52 __C_DECLS_BEGIN;
    5347
    5448/** Type returned by the div function */
     
    7569        long long rem;
    7670} lldiv_t;
     71
     72#define EXIT_FAILURE 1
     73#define EXIT_SUCCESS 0
     74
     75#define RAND_MAX  714025
     76
     77#define MB_CUR_MAX 4
    7778
    7879extern long double strtold(const char *, char **);
     
    108109extern lldiv_t lldiv(long long, long long);
    109110
    110 __C_DECLS_END;
     111#ifdef __cplusplus
     112}
     113#endif
    111114
    112115#endif
  • uspace/lib/c/include/str.h

    r52acfab raf5037d  
    3838#define _LIBC_STR_H_
    3939
     40#ifdef __cplusplus
     41extern "C" {
     42#endif
     43
    4044#include <errno.h>
    4145#include <stdbool.h>
     
    4448
    4549#include <mem.h>
    46 #include <_bits/decls.h>
    47 
    48 #ifndef __cplusplus
    4950
    5051/* Common Unicode characters */
     
    6263 */
    6364#define SPASCII_STR_BUFSIZE(spa_size) ((spa_size) + 1)
    64 
    65 #endif
    66 
    67 __HELENOS_DECLS_BEGIN;
    6865
    6966extern wchar_t str_decode(const char *str, size_t *offset, size_t sz);
     
    150147extern unsigned long strtoul(const char *, char **, int);
    151148
    152 __HELENOS_DECLS_END;
     149#ifdef __cplusplus
     150}
     151#endif
    153152
    154153#endif
  • uspace/lib/c/include/string.h

    r52acfab raf5037d  
    4141#endif
    4242
    43 #include <_bits/decls.h>
    4443#include <_bits/size_t.h>
    4544#include <_bits/NULL.h>
    4645#include <mem.h>
    47 
    48 __C_DECLS_BEGIN;
    4946
    5047extern char *strcpy(char *, const char *);
     
    7370#endif
    7471
    75 __C_DECLS_END;
    76 
    7772#endif
    7873
  • uspace/lib/c/include/time.h

    r52acfab raf5037d  
    3636#define _LIBC_TIME_H_
    3737
    38 #include <_bits/decls.h>
     38#ifdef __cplusplus
     39extern "C" {
     40#endif
    3941
    4042/* ISO/IEC 9899:2011 7.27.1 (2) */
     
    4951
    5052#include <_bits/size_t.h>
    51 
    52 __C_DECLS_BEGIN;
    5353
    5454/* ISO/IEC 9899:2011 7.27.1 (3), (4) */
     
    106106    const struct tm *__restrict__);
    107107
    108 __C_DECLS_END;
    109 
    110108#ifdef _HELENOS_SOURCE
    111109
     
    116114#include <stdbool.h>
    117115#include <_bits/errno.h>
    118 
    119 __HELENOS_DECLS_BEGIN;
    120116
    121117typedef long long sec_t;
     
    159155extern void udelay(sysarg_t);
    160156
    161 __HELENOS_DECLS_END;
     157#endif /* _HELENOS_SOURCE */
    162158
    163 #endif /* _HELENOS_SOURCE */
     159#ifdef __cplusplus
     160}
     161#endif
    164162
    165163#endif
  • uspace/lib/c/include/vfs/vfs.h

    r52acfab raf5037d  
    4444#include <async.h>
    4545#include <offset.h>
     46
     47#define VFS_MAX_OPEN_FILES  128
    4648
    4749enum vfs_change_state_type {
  • uspace/lib/cpp/include/__bits/chrono.hpp

    r52acfab raf5037d  
    611611            static time_point now()
    612612            {
    613                 ::std::timespec ts{};
    614                 ::helenos::getrealtime(&ts);
     613                hel::timespec ts{};
     614                hel::getrealtime(&ts);
    615615
    616616                rep time = NSEC2USEC(ts.tv_nsec);
     
    654654            static time_point now()
    655655            {
    656                 ::std::timespec ts{};
    657                 ::helenos::getuptime(&ts);
     656                hel::timespec ts{};
     657                hel::getuptime(&ts);
    658658
    659659                rep time = NSEC2USEC(ts.tv_nsec);
  • uspace/lib/cpp/include/__bits/io/ios.hpp

    r52acfab raf5037d  
    4141{
    4242    using streamoff = long long;
    43     using streamsize = ::ssize_t;
     43    using streamsize = hel::ssize_t;
    4444
    4545    /**
  • uspace/lib/cpp/include/__bits/limits.hpp

    r52acfab raf5037d  
    528528            static constexpr unsigned short min()
    529529            {
    530                 return 0;
     530                return USHRT_MIN;
    531531            }
    532532
     
    552552            static constexpr unsigned int min()
    553553            {
    554                 return 0;
     554                return UINT_MIN;
    555555            }
    556556
     
    576576            static constexpr unsigned long min()
    577577            {
    578                 return 0;
     578                return ULONG_MIN;
    579579            }
    580580
     
    600600            static constexpr unsigned long long min()
    601601            {
    602                 return 0;
     602                return ULLONG_MIN;
    603603            }
    604604
  • uspace/lib/cpp/include/__bits/locale/num_get.hpp

    r52acfab raf5037d  
    301301                if (size > 0)
    302302                {
    303                     int olderrno{errno};
    304                     errno = EOK;
    305                     char *endptr = NULL;
    306 
     303                    int ret{};
    307304                    if constexpr (is_signed<BaseType>::value)
    308                         res = ::strtoll(base.buffer_, &endptr, num_base);
    309                     else
    310                         res = ::strtoull(base.buffer_, &endptr, num_base);
    311 
    312                     if (errno != EOK || endptr == base.buffer_)
     305                        ret = std::hel::str_int64_t(base.buffer_, nullptr, num_base, false, &res);
     306                    else
     307                        ret = std::hel::str_uint64_t(base.buffer_, nullptr, num_base, false, &res);
     308
     309                    if (ret != EOK)
     310                    {
    313311                        err |= ios_base::failbit;
    314 
    315                     errno = olderrno;
    316 
    317                     if (res > static_cast<BaseType>(numeric_limits<T>::max()))
     312                        v = 0;
     313                    }
     314                    else if (res > static_cast<BaseType>(numeric_limits<T>::max()))
    318315                    {
    319316                        err |= ios_base::failbit;
  • uspace/lib/cpp/include/__bits/random.hpp

    r52acfab raf5037d  
    10301030             *       something better.
    10311031             */
    1032             ::srand(::time(nullptr));
     1032            hel::srand(hel::time(nullptr));
    10331033        }
    10341034
    10351035        result_type operator()()
    10361036        {
    1037             return ::rand();
     1037            return hel::rand();
    10381038        }
    10391039
  • uspace/lib/cpp/include/__bits/string/string.hpp

    r52acfab raf5037d  
    8282        static int compare(const char_type* s1, const char_type* s2, size_t n)
    8383        {
    84             return ::strncmp(s1, s2, n);
     84            return hel::str_lcmp(s1, s2, n);
    8585        }
    8686
    8787        static size_t length(const char_type* s)
    8888        {
    89             return ::strlen(s);
     89            return hel::str_size(s);
    9090        }
    9191
     
    367367            // TODO: This function does not exits...
    368368            __unimplemented();
     369            //return hel::wstr_lcmp(s1, s2, n);
    369370            return 0;
    370371        }
     
    372373        static size_t length(const char_type* s)
    373374        {
    374             size_t i = 0;
    375             while (s[i] != 0)
    376                 i++;
    377             return i;
     375            return hel::wstr_size(s);
    378376        }
    379377
  • uspace/lib/cpp/include/__bits/thread/condition_variable.hpp

    r52acfab raf5037d  
    3535namespace std
    3636{
     37    extern "C" {
     38        #include <fibril.h>
     39        #include <fibril_synch.h>
     40    }
     41
    3742    enum class cv_status
    3843    {
  • uspace/lib/cpp/include/__bits/thread/threading.hpp

    r52acfab raf5037d  
    3030#define LIBCPP_BITS_THREAD_THREADING
    3131
     32namespace std::hel
     33{
     34    extern "C" {
     35        #include <fibril.h>
     36        #include <fibril_synch.h>
     37    }
     38}
     39
    3240#include <chrono>
    33 
    34 #include <fibril.h>
    35 #include <fibril_synch.h>
    3641
    3742namespace std::aux
     
    4954    struct threading_policy<fibril_tag>
    5055    {
    51         using mutex_type        = ::helenos::fibril_mutex_t;
    52         using thread_type       = ::helenos::fid_t;
    53         using condvar_type      = ::helenos::fibril_condvar_t;
    54         using time_unit         = ::helenos::usec_t;
    55         using shared_mutex_type = ::helenos::fibril_rwlock_t;
     56        using mutex_type        = hel::fibril_mutex_t;
     57        using thread_type       = hel::fid_t;
     58        using condvar_type      = hel::fibril_condvar_t;
     59        using time_unit         = hel::usec_t;
     60        using shared_mutex_type = hel::fibril_rwlock_t;
    5661
    5762        struct thread
     
    6065            static thread_type create(Callable clbl, Payload& pld)
    6166            {
    62                 return ::helenos::fibril_create(clbl, (void*)&pld);
     67                return hel::fibril_create(clbl, (void*)&pld);
    6368            }
    6469
    6570            static void start(thread_type thr)
    6671            {
    67                 ::helenos::fibril_add_ready(thr);
     72                hel::fibril_add_ready(thr);
    6873            }
    6974
    7075            static thread_type this_thread()
    7176            {
    72                 return ::helenos::fibril_get_id();
     77                return hel::fibril_get_id();
    7378            }
    7479
    7580            static void yield()
    7681            {
    77                 ::helenos::fibril_yield();
     82                hel::fibril_yield();
    7883            }
    7984
     
    8994            static void init(mutex_type& mtx)
    9095            {
    91                 ::helenos::fibril_mutex_initialize(&mtx);
     96                hel::fibril_mutex_initialize(&mtx);
    9297            }
    9398
    9499            static void lock(mutex_type& mtx)
    95100            {
    96                 ::helenos::fibril_mutex_lock(&mtx);
     101                hel::fibril_mutex_lock(&mtx);
    97102            }
    98103
    99104            static void unlock(mutex_type& mtx)
    100105            {
    101                 ::helenos::fibril_mutex_unlock(&mtx);
     106                hel::fibril_mutex_unlock(&mtx);
    102107            }
    103108
    104109            static bool try_lock(mutex_type& mtx)
    105110            {
    106                 return ::helenos::fibril_mutex_trylock(&mtx);
     111                return hel::fibril_mutex_trylock(&mtx);
    107112            }
    108113
     
    118123            static void init(condvar_type& cv)
    119124            {
    120                 ::helenos::fibril_condvar_initialize(&cv);
     125                hel::fibril_condvar_initialize(&cv);
    121126            }
    122127
    123128            static void wait(condvar_type& cv, mutex_type& mtx)
    124129            {
    125                 ::helenos::fibril_condvar_wait(&cv, &mtx);
     130                hel::fibril_condvar_wait(&cv, &mtx);
    126131            }
    127132
    128133            static int wait_for(condvar_type& cv, mutex_type& mtx, time_unit timeout)
    129134            {
    130                 return ::helenos::fibril_condvar_wait_timeout(&cv, &mtx, timeout);
     135                return hel::fibril_condvar_wait_timeout(&cv, &mtx, timeout);
    131136            }
    132137
    133138            static void signal(condvar_type& cv)
    134139            {
    135                 ::helenos::fibril_condvar_signal(&cv);
     140                hel::fibril_condvar_signal(&cv);
    136141            }
    137142
    138143            static void broadcast(condvar_type& cv)
    139144            {
    140                 ::helenos::fibril_condvar_broadcast(&cv);
     145                hel::fibril_condvar_broadcast(&cv);
    141146            }
    142147        };
     
    152157            static void sleep(time_unit time)
    153158            {
    154                 ::helenos::fibril_usleep(time);
     159                hel::fibril_usleep(time);
    155160            }
    156161        };
     
    160165            static void init(shared_mutex_type& mtx)
    161166            {
    162                 ::helenos::fibril_rwlock_initialize(&mtx);
     167                hel::fibril_rwlock_initialize(&mtx);
    163168            }
    164169
    165170            static void lock(shared_mutex_type& mtx)
    166171            {
    167                 ::helenos::fibril_rwlock_write_lock(&mtx);
     172                hel::fibril_rwlock_write_lock(&mtx);
    168173            }
    169174
    170175            static void unlock(shared_mutex_type& mtx)
    171176            {
    172                 ::helenos::fibril_rwlock_write_unlock(&mtx);
     177                hel::fibril_rwlock_write_unlock(&mtx);
    173178            }
    174179
    175180            static void lock_shared(shared_mutex_type& mtx)
    176181            {
    177                 ::helenos::fibril_rwlock_read_lock(&mtx);
     182                hel::fibril_rwlock_read_lock(&mtx);
    178183            }
    179184
    180185            static void unlock_shared(shared_mutex_type& mtx)
    181186            {
    182                 ::helenos::fibril_rwlock_read_unlock(&mtx);
     187                hel::fibril_rwlock_read_unlock(&mtx);
    183188            }
    184189
  • uspace/lib/cpp/include/cassert

    r52acfab raf5037d  
    3030#define LIBCPP_CASSERT
    3131
    32 #include <assert.h>
     32
     33extern "C" {
     34    #include <assert.h>
     35}
     36
     37// TODO: For some reason, this function isn't visible (maybe the
     38//       noreturn attribute?), adding a redeclaration here for the
     39//       time being.
     40
     41extern void __helenos_assert_abort(const char *, const char *, unsigned int);
    3342
    3443#define __unimplemented() assert(!"Not implemented!")
  • uspace/lib/cpp/include/cctype

    r52acfab raf5037d  
    3030#define LIBCPP_CCTYPE
    3131
    32 #include <ctype.h>
     32
     33namespace std::hel
     34{
     35    extern "C" {
     36        #include <ctype.h>
     37    }
     38}
    3339
    3440namespace std
    3541{
    36     using ::isalnum;
    37     using ::isalpha;
    38     using ::islower;
    39     using ::isupper;
    40     using ::isdigit;
    41     using ::isxdigit;
    42     using ::iscntrl;
    43     using ::isgraph;
    44     using ::isspace;
    45     using ::isblank;
    46     using ::isprint;
    47     using ::ispunct;
    48     using ::tolower;
    49     using ::toupper;
     42    using std::hel::isalnum;
     43    using std::hel::isalpha;
     44    using std::hel::islower;
     45    using std::hel::isupper;
     46    using std::hel::isdigit;
     47    /* using std::hel::isxdigit; */
     48    /* using std::hel::iscntrl; */
     49    /* using std::hel::isgraph; */
     50    using std::hel::isspace;
     51    /* using std::hel::isblank; */
     52    /* using std::hel::isprint; */
     53    /* using std::hel::ispunct; */
     54    using std::hel::tolower;
     55    using std::hel::toupper;
    5056}
    5157
  • uspace/lib/cpp/include/cerrno

    r52acfab raf5037d  
    3030#define LIBCPP_CERRNO
    3131
    32 #include <errno.h>
     32
     33namespace std::hel
     34{
     35    extern "C" {
     36        #include <errno.h>
     37    }
     38}
     39
     40namespace std
     41{
     42    // Note: Only macros are imported here.
     43}
    3344
    3445#endif
  • uspace/lib/cpp/include/cinttypes

    r52acfab raf5037d  
    3030#define LIBCPP_CINTTYPES
    3131
    32 #include <cstdint>
    33 #include <inttypes.h>
     32
     33namespace std::hel
     34{
     35    extern "C" {
     36        #include <inttypes.h>
     37    }
     38}
    3439
    3540namespace std
    3641{
    37     using ::imaxdiv_t;
    38     using ::imaxabs;
    39     using ::imaxdiv;
    40     using ::strtoimax;
    41     using ::strtoumax;
    42     using ::wcstoimax;
    43     using ::wcstoumax;
     42    using std::hel::imaxdiv_t;
     43    /* using std::hel::abs; */
     44    /* using std::hel::div; */
     45    /* using std::hel::imaxabs; */
     46    /* using std::hel::imaxdiv; */
     47    /* using std::hel::strtoimax; */
     48    /* using std::hel::strtoumax; */
     49    /* using std::hel::wcstoimax; */
     50    /* using std::hel::wcstoumax; */
    4451}
    4552
     53using std::hel::imaxdiv_t;
     54/* using std::hel::abs; */
     55/* using std::hel::div; */
     56/* using std::hel::imaxabs; */
     57/* using std::hel::imaxdiv; */
     58/* using std::hel::strtoimax; */
     59/* using std::hel::strtoumax; */
     60/* using std::hel::wcstoimax; */
     61/* using std::hel::wcstoumax; */
     62
     63#include <cstdint>
     64
    4665#endif
  • uspace/lib/cpp/include/climits

    r52acfab raf5037d  
    3030#define LIBCPP_CLIMITS
    3131
    32 #include <limits.h>
     32
     33namespace std::hel
     34{
     35    extern "C" {
     36        #include <limits.h>
     37    }
     38}
     39
     40namespace std
     41{
     42    // Note: Only macros imported here.
     43}
    3344
    3445#endif
  • uspace/lib/cpp/include/csetjmp

    r52acfab raf5037d  
    3030#define LIBCPP_CSETJMP
    3131
    32 #include <setjmp.h>
     32
     33/**
     34 * TODO: Currently the <setjmp.h> header uses
     35 *       _Noreturn, which is not available in C++.
     36 */
     37
     38namespace std::hel
     39{
     40    extern "C" {
     41        //#include <setjmp.h>
     42    }
     43}
    3344
    3445namespace std
    3546{
    36     using ::jmp_buf;
    37     using ::longjmp;
     47    /* using std::hel::jmp_buf; */
     48    /* using std::hel::longjmp; */
    3849}
    3950
     51/* using std::hel::jmp_buf; */
     52/* using std::hel::longjmp; */
     53
    4054#endif
  • uspace/lib/cpp/include/cstdarg

    r52acfab raf5037d  
    3030#define LIBCPP_CSTDARG
    3131
    32 #include <stdarg.h>
     32
     33namespace std::hel
     34{
     35    extern "C" {
     36        #include <stdarg.h>
     37    }
     38}
    3339
    3440namespace std
    3541{
    36     using ::va_list;
     42    using std::hel::va_list;
    3743}
    3844
     45using std::hel::va_list;
     46
    3947#endif
  • uspace/lib/cpp/include/cstddef

    r52acfab raf5037d  
    3030#define LIBCPP_CSTDDEF
    3131
    32 #include <stddef.h>
     32
     33namespace std::hel
     34{
     35    extern "C" {
     36        #include <stddef.h>
     37    }
     38}
     39
    3340
    3441namespace std
    3542{
    36     using ::nullptr_t;
    37     using ::size_t;
    38     using ::ptrdiff_t;
    39     using ::max_align_t;
     43    using nullptr_t = decltype(nullptr);
     44
     45    using std::hel::size_t;
     46    using std::hel::ptrdiff_t;
     47    /* using std::hel::max_align_t; */
    4048}
    4149
     50using std::nullptr_t;
     51using std::hel::size_t;
     52using std::hel::ptrdiff_t;
     53/* using std::hel::max_align_t; */
     54
    4255#endif
  • uspace/lib/cpp/include/cstdint

    r52acfab raf5037d  
    3030#define LIBCPP_CSTDINT
    3131
    32 #include <stdint.h>
     32
     33namespace std::hel
     34{
     35    extern "C" {
     36        #include <stdint.h>
     37    }
     38}
    3339
    3440namespace std
    3541{
    36     using ::int8_t;
    37     using ::int16_t;
    38     using ::int32_t;
    39     using ::int64_t;
     42    using int8_t  = std::hel::int8_t;
     43    using int16_t = std::hel::int16_t;
     44    using int32_t = std::hel::int32_t;
     45    using int64_t = std::hel::int64_t;
    4046
    41     using ::intmax_t;
    42     using ::intptr_t;
     47    using intmax_t = std::hel::intmax_t;
     48    using intptr_t = std::hel::intptr_t;
    4349
    44     using ::int_fast8_t;
    45     using ::int_fast16_t;
    46     using ::int_fast32_t;
    47     using ::int_fast64_t;
     50    using int_fast8_t  = std::hel::int_fast8_t;
     51    using int_fast16_t = std::hel::int_fast16_t;
     52    using int_fast32_t = std::hel::int_fast32_t;
     53    using int_fast64_t = std::hel::int_fast64_t;
    4854
    49     using ::int_least8_t;
    50     using ::int_least16_t;
    51     using ::int_least32_t;
    52     using ::int_least64_t;
     55    using int_least8_t  = std::hel::int_least8_t;
     56    using int_least16_t = std::hel::int_least16_t;
     57    using int_least32_t = std::hel::int_least32_t;
     58    using int_least64_t = std::hel::int_least64_t;
    5359
    54     using ::uint8_t;
    55     using ::uint16_t;
    56     using ::uint32_t;
    57     using ::uint64_t;
     60    using uint8_t  = std::hel::uint8_t;
     61    using uint16_t = std::hel::uint16_t;
     62    using uint32_t = std::hel::uint32_t;
     63    using uint64_t = std::hel::uint64_t;
    5864
    59     using ::uintmax_t;
    60     using ::uintptr_t;
     65    using uintmax_t = std::hel::uintmax_t;
     66    using uintptr_t = std::hel::uintptr_t;
    6167
    62     using ::uint_fast8_t;
    63     using ::uint_fast16_t;
    64     using ::uint_fast32_t;
    65     using ::uint_fast64_t;
     68    using uint_fast8_t  = std::hel::uint_fast8_t;
     69    using uint_fast16_t = std::hel::uint_fast16_t;
     70    using uint_fast32_t = std::hel::uint_fast32_t;
     71    using uint_fast64_t = std::hel::uint_fast64_t;
    6672
    67     using ::uint_least8_t;
    68     using ::uint_least16_t;
    69     using ::uint_least32_t;
    70     using ::uint_least64_t;
     73    using uint_least8_t  = std::hel::uint_least8_t;
     74    using uint_least16_t = std::hel::uint_least16_t;
     75    using uint_least32_t = std::hel::uint_least32_t;
     76    using uint_least64_t = std::hel::uint_least64_t;
    7177}
    7278
     79using int8_t  = std::hel::int8_t;
     80using int16_t = std::hel::int16_t;
     81using int32_t = std::hel::int32_t;
     82using int64_t = std::hel::int64_t;
     83
     84using intmax_t = std::hel::intmax_t;
     85using intptr_t = std::hel::intptr_t;
     86
     87using int_fast8_t  = std::hel::int_fast8_t;
     88using int_fast16_t = std::hel::int_fast16_t;
     89using int_fast32_t = std::hel::int_fast32_t;
     90using int_fast64_t = std::hel::int_fast64_t;
     91
     92using int_least8_t  = std::hel::int_least8_t;
     93using int_least16_t = std::hel::int_least16_t;
     94using int_least32_t = std::hel::int_least32_t;
     95using int_least64_t = std::hel::int_least64_t;
     96
     97using uint8_t  = std::hel::uint8_t;
     98using uint16_t = std::hel::uint16_t;
     99using uint32_t = std::hel::uint32_t;
     100using uint64_t = std::hel::uint64_t;
     101
     102using uintmax_t = std::hel::uintmax_t;
     103using uintptr_t = std::hel::uintptr_t;
     104
     105using uint_fast8_t  = std::hel::uint_fast8_t;
     106using uint_fast16_t = std::hel::uint_fast16_t;
     107using uint_fast32_t = std::hel::uint_fast32_t;
     108using uint_fast64_t = std::hel::uint_fast64_t;
     109
     110using uint_least8_t  = std::hel::uint_least8_t;
     111using uint_least16_t = std::hel::uint_least16_t;
     112using uint_least32_t = std::hel::uint_least32_t;
     113using uint_least64_t = std::hel::uint_least64_t;
     114
    73115#endif
  • uspace/lib/cpp/include/cstdio

    r52acfab raf5037d  
    3030#define LIBCPP_CSTDIO
    3131
    32 #include <stdio.h>
     32
     33namespace std::hel
     34{
     35    extern "C" {
     36        #include <stdio.h>
     37    }
     38}
    3339
    3440namespace std
    3541{
    36     using ::FILE;
    37     using ::stdin;
    38     using ::stdout;
    39     using ::stderr;
    40     using ::fpos_t;
    41     using ::size_t;
     42    using std::hel::FILE;
     43    using std::hel::stdin;
     44    using std::hel::stdout;
     45    using std::hel::stderr;
     46    /* using std::hel::fpos_t */
     47    using std::hel::size_t;
    4248
    43     using ::clearerr;
    44     using ::fclose;
    45     using ::feof;
    46     using ::ferror;
    47     using ::fflush;
    48     using ::fgetc;
    49     using ::fgetpos;
    50     using ::fgets;
    51     using ::fopen;
    52     using ::fprintf;
    53     using ::fputc;
    54     using ::fputs;
    55     using ::fread;
    56     using ::freopen;
    57     using ::fscanf;
    58     using ::fseek;
    59     using ::fsetpos;
    60     using ::ftell;
    61     using ::fwrite;
    62     using ::getc;
    63     using ::getchar;
    64     using ::perror;
    65     using ::printf;
    66     using ::putc;
    67     using ::putchar;
    68     using ::puts;
    69     using ::remove;
    70     using ::rename;
    71     using ::rewind;
    72     using ::scanf;
    73     using ::setbuf;
    74     using ::setvbuf;
    75     using ::snprintf;
    76     /* using ::sprintf; */
    77     /* using ::sscanf; */
    78     /* using ::tmpfile; */
    79     /* using ::tmpnam; */
    80     using ::ungetc;
    81     using ::vfprintf;
    82     using ::vprintf;
    83     /* using ::vscanf; */
    84     using ::vsnprintf;
    85     /* using ::vsprintf; */
    86     /* using ::vsscanf; */
     49    using std::hel::clearerr;
     50    using std::hel::fclose;
     51    using std::hel::feof;
     52    using std::hel::ferror;
     53    using std::hel::fflush;
     54    using std::hel::fgetc;
     55    /* using std::hel::fgetpos; */
     56    using std::hel::fgets;
     57    using std::hel::fopen;
     58    using std::hel::fprintf;
     59    using std::hel::fputc;
     60    using std::hel::fputs;
     61    using std::hel::fread;
     62    using std::hel::freopen;
     63    /* using std::hel::fscanf; */
     64    using std::hel::fseek;
     65    /* using std::hel::fsetpos; */
     66    using std::hel::ftell;
     67    using std::hel::fwrite;
     68    /* using std::hel::getc; */
     69    using std::hel::getchar;
     70    /* using std::hel::perror; */
     71    using std::hel::printf;
     72    /* using std::hel::putc; */
     73    using std::hel::putchar;
     74    using std::hel::puts;
     75    using std::hel::remove;
     76    using std::hel::rename;
     77    using std::hel::rewind;
     78    /* using std::hel::scanf; */
     79    using std::hel::setbuf;
     80    using std::hel::setvbuf;
     81    using std::hel::snprintf;
     82    /* using std::hel::sprintf; */
     83    /* using std::hel::sscanf; */
     84    /* using std::hel::tmpfile; */
     85    /* using std::hel::tmpnam; */
     86    using std::hel::ungetc;
     87    using std::hel::vfprintf;
     88    using std::hel::vprintf;
     89    /* using std::hel::vscanf; */
     90    using std::hel::vsnprintf;
     91    /* using std::hel::vsprintf; */
     92    /* using std::hel::vsscanf; */
    8793}
    8894
     95using std::hel::FILE;
     96/* using std::hel::fpos_t */
     97using std::hel::size_t;
     98
     99using std::hel::clearerr;
     100using std::hel::fclose;
     101using std::hel::feof;
     102using std::hel::ferror;
     103using std::hel::fflush;
     104using std::hel::fgetc;
     105/* using std::hel::fgetpos; */
     106using std::hel::fgets;
     107using std::hel::fopen;
     108using std::hel::fprintf;
     109using std::hel::fputc;
     110using std::hel::fputs;
     111using std::hel::fread;
     112using std::hel::freopen;
     113/* using std::hel::fscanf; */
     114using std::hel::fseek;
     115/* using std::hel::fsetpos; */
     116using std::hel::ftell;
     117using std::hel::fwrite;
     118/* using std::hel::getc; */
     119using std::hel::getchar;
     120/* using std::hel::perror; */
     121using std::hel::printf;
     122/* using std::hel::putc; */
     123using std::hel::putchar;
     124using std::hel::puts;
     125using std::hel::remove;
     126using std::hel::rename;
     127using std::hel::rewind;
     128/* using std::hel::scanf; */
     129using std::hel::setbuf;
     130using std::hel::setvbuf;
     131using std::hel::snprintf;
     132/* using std::hel::sprintf; */
     133/* using std::hel::sscanf; */
     134/* using std::hel::tmpfile; */
     135/* using std::hel::tmpnam; */
     136using std::hel::ungetc;
     137using std::hel::vfprintf;
     138using std::hel::vprintf;
     139/* using std::hel::vscanf; */
     140using std::hel::vsnprintf;
     141/* using std::hel::vsprintf; */
     142/* using std::hel::vsscanf; */
     143
    89144#endif
  • uspace/lib/cpp/include/cstdlib

    r52acfab raf5037d  
    3030#define LIBCPP_CSTDLIB
    3131
    32 #include <stdlib.h>
    33 #include <_bits/ssize_t.h>
     32
     33namespace std::hel
     34{
     35    extern "C" {
     36        #include <stdlib.h>
     37        #include <_bits/ssize_t.h>
     38    }
     39}
    3440
    3541namespace std
    3642{
    37     /* using ::div_t; */
    38     /* using ::ldiv_t; */
    39     /* using ::lldiv_t; */
    40     using ::size_t;
     43    /* using std::hel::div_t; */
     44    /* using std::hel::ldiv_t; */
     45    /* using std::hel::lldiv_t; */
     46    using std::hel::size_t;
    4147
    42     using ::abort;
    43     using ::exit;
    44     /* using ::quick_exit; */
    45     /* using ::_Exit; */
    46     using ::atexit;
    47     /* using ::at_quick_exit; */
    48     /* using ::system; */
    49     /* using ::getenv; */
     48    using std::hel::abort;
     49    using std::hel::exit;
     50    /* using std::hel::quick_exit; */
     51    /* using std::hel::_Exit; */
     52    using std::hel::atexit;
     53    /* using std::hel::at_quick_exit; */
     54    /* using std::hel::system; */
     55    /* using std::hel::getenv; */
    5056
    51     using ::malloc;
    52     using ::calloc;
    53     using ::realloc;
    54     using ::free;
     57    using std::hel::malloc;
     58    using std::hel::calloc;
     59    using std::hel::realloc;
     60    using std::hel::free;
    5561
    56     /* using ::atof; */
    57     /* using ::atoi; */
    58     /* using ::atol; */
    59     /* using ::atoll; */
    60     /* using ::strtol; */
    61     /* using ::strtoll; */
    62     /* using ::strtoul; */
    63     /* using ::strtoull; */
    64     /* using ::strtof; */
    65     /* using ::strtod; */
    66     /* using ::strtold; */
     62    /* using std::hel::atof; */
     63    /* using std::hel::atoi; */
     64    /* using std::hel::atol; */
     65    /* using std::hel::atoll; */
     66    /* using std::hel::strtol; */
     67    /* using std::hel::strtoll; */
     68    /* using std::hel::strtoul; */
     69    /* using std::hel::strtoull; */
     70    /* using std::hel::strtof; */
     71    /* using std::hel::strtod; */
     72    /* using std::hel::strtold; */
    6773
    68     /* using ::mblen; */
    69     /* using ::mbtowc; */
    70     /* using ::wctomb; */
    71     /* using ::mbstowcs; */
    72     /* using ::wcstombs; */
     74    /* using std::hel::mblen; */
     75    /* using std::hel::mbtowc; */
     76    /* using std::hel::wctomb; */
     77    /* using std::hel::mbstowcs; */
     78    /* using std::hel::wcstombs; */
    7379
    74     using ::rand;
    75     using ::srand;
    76     using ::qsort;
    77     /* using ::bsearch; */
    78     /* using ::abs; */
    79     /* using ::labs; */
    80     /* using ::llabs; */
    81     /* using ::div; */
    82     /* using ::ldiv; */
    83     /* using ::lldiv; */
     80    using std::hel::rand;
     81    using std::hel::srand;
     82    using std::hel::qsort;
     83    /* using std::hel::bsearch; */
     84    /* using std::hel::abs; */
     85    /* using std::hel::labs; */
     86    /* using std::hel::llabs; */
     87    /* using std::hel::div; */
     88    /* using std::hel::ldiv; */
     89    /* using std::hel::lldiv; */
    8490}
    8591
     92/* using std::hel::div_t; */
     93/* using std::hel::ldiv_t; */
     94/* using std::hel::lldiv_t; */
     95using std::hel::size_t;
     96
     97using std::hel::abort;
     98using std::hel::exit;
     99/* using std::hel::quick_exit; */
     100/* using std::hel::_Exit; */
     101using std::hel::atexit;
     102/* using std::hel::at_quick_exit; */
     103/* using std::hel::system; */
     104/* using std::hel::getenv; */
     105
     106using std::hel::malloc;
     107using std::hel::calloc;
     108using std::hel::realloc;
     109using std::hel::free;
     110
     111/* using std::hel::atof; */
     112/* using std::hel::atoi; */
     113/* using std::hel::atol; */
     114/* using std::hel::atoll; */
     115/* using std::hel::strtol; */
     116/* using std::hel::strtoll; */
     117/* using std::hel::strtoul; */
     118/* using std::hel::strtoull; */
     119/* using std::hel::strtof; */
     120/* using std::hel::strtod; */
     121/* using std::hel::strtold; */
     122
     123/* using std::hel::mblen; */
     124/* using std::hel::mbtowc; */
     125/* using std::hel::wctomb; */
     126/* using std::hel::mbstowcs; */
     127/* using std::hel::wcstombs; */
     128
     129using std::hel::rand;
     130using std::hel::srand;
     131using std::hel::qsort;
     132/* using std::hel::bsearch; */
     133/* using std::hel::abs; */
     134/* using std::hel::labs; */
     135/* using std::hel::llabs; */
     136/* using std::hel::div; */
     137/* using std::hel::ldiv; */
     138/* using std::hel::lldiv; */
     139
    86140#endif
  • uspace/lib/cpp/include/cstring

    r52acfab raf5037d  
    3030#define LIBCPP_CSTRING
    3131
    32 #define _REALLY_WANT_STRING_H
    33 #include <string.h>
     32
     33namespace std::hel
     34{
     35    extern "C" {
     36        #include <str.h>
     37    }
     38}
    3439
    3540namespace std
    3641{
    37     using ::size_t;
     42    using std::hel::size_t;
    3843
    39     using ::strcpy;
    40     using ::strncpy;
    41     using ::strcat;
    42     using ::strncat;
    43     using ::strxfrm;
     44    /* using std::hel::strcpy; */
     45    /* using std::hel::strncpy; */
     46    /* using std::hel::strcat; */
     47    /* using std::hel::strncat; */
     48    /* using std::hel::strxfrm; */
    4449
    45     using ::strlen;
    46     using ::strcmp;
    47     using ::strncmp;
    48     using ::strcoll;
    49     using ::strchr;
    50     using ::strrchr;
    51     using ::strspn;
    52     using ::strcspn;
    53     using ::strpbrk;
    54     using ::strstr;
    55     using ::strtok;
     50    /* using std::hel::strlen; */
     51    /* using std::hel::strcmp; */
     52    /* using std::hel::strncmp; */
     53    /* using std::hel::strcoll; */
     54    /* using std::hel::strchr; */
     55    /* using std::hel::strrchr; */
     56    /* using std::hel::strspn; */
     57    /* using std::hel::strcspn; */
     58    /* using std::hel::strpbrk; */
     59    /* using std::hel::strstr; */
     60    /* using std::hel::strok; */
    5661
    57     using ::memchr;
    58     using ::memcmp;
    59     using ::memset;
    60     using ::memcpy;
    61     using ::memmove;
     62    /* using std::hel::memchr; */
     63    using std::hel::memcmp;
     64    using std::hel::memset;
     65    using std::hel::memcpy;
     66    using std::hel::memmove;
    6267
    63     using ::strerror;
     68    /* using std::hel::strerror; */
    6469}
    6570
     71using std::hel::size_t;
     72
     73/* using std::hel::strcpy; */
     74/* using std::hel::strncpy; */
     75/* using std::hel::strcat; */
     76/* using std::hel::strncat; */
     77/* using std::hel::strxfrm; */
     78
     79/* using std::hel::strlen; */
     80/* using std::hel::strcmp; */
     81/* using std::hel::strncmp; */
     82/* using std::hel::strcoll; */
     83/* using std::hel::strchr; */
     84/* using std::hel::strrchr; */
     85/* using std::hel::strspn; */
     86/* using std::hel::strcspn; */
     87/* using std::hel::strpbrk; */
     88/* using std::hel::strstr; */
     89/* using std::hel::strok; */
     90
     91/* using std::hel::memchr; */
     92using std::hel::memcmp;
     93using std::hel::memset;
     94using std::hel::memcpy;
     95using std::hel::memmove;
     96
     97/* using std::hel::strerror; */
     98
    6699#endif
  • uspace/lib/cpp/include/ctime

    r52acfab raf5037d  
    3030#define LIBCPP_CTIME
    3131
    32 #include <time.h>
     32
     33namespace std::hel
     34{
     35    extern "C" {
     36        #include <time.h>
     37    }
     38}
    3339
    3440namespace std
    3541{
    36     using ::clock_t;
    37     using ::size_t;
    38     using ::time_t;
    39     using ::tm;
    40     using ::timespec;
     42    /* using std::hel::clock_t; */
     43    using std::hel::size_t;
     44    using std::hel::time_t;
     45    using std::hel::tm;
     46    /* using std::hel::timespec; */
    4147
    42     using ::clock;
    43     using ::time;
    44     using ::difftime;
     48    /* using std::hel::clock; */
     49    using std::hel::time;
     50    using std::hel::difftime;
    4551
    46     using ::ctime;
    47     using ::asctime;
    48     using ::strftime;
    49     /* using ::wcsftime; */
    50     /* using ::gmtime; */
    51     /* using ::localtime; */
    52     using ::mktime;
     52    /* using std::hel::ctime; */
     53    /* using std::hel::asctime; */
     54    using std::hel::strftime;
     55    /* using std::hel::wcsftime; */
     56    /* using std::hel::gmtime; */
     57    /* using std::hel::localtime; */
     58    using std::hel::mktime;
    5359}
    5460
     61/* using std::hel::clock_t; */
     62using std::hel::size_t;
     63using std::hel::time_t;
     64using std::hel::tm;
     65/* using std::hel::timespec; */
     66
     67/* using std::hel::clock; */
     68using std::hel::time;
     69using std::hel::difftime;
     70
     71/* using std::hel::ctime; */
     72/* using std::hel::asctime; */
     73using std::hel::strftime;
     74/* using std::hel::wcsftime; */
     75/* using std::hel::gmtime; */
     76/* using std::hel::localtime; */
     77using std::hel::mktime;
     78
    5579#endif
  • uspace/lib/cpp/include/cwchar

    r52acfab raf5037d  
    3030#define LIBCPP_WCHAR
    3131
    32 #include <wchar.h>
    33 #include <time.h>
     32
     33namespace std::hel
     34{
     35    extern "C" {
     36        #include <wchar.h>
     37        #include <time.h>
     38    }
     39}
    3440
    3541namespace std
    3642{
    37     /* using ::mbstate_t; */
    38     using ::size_t;
    39     using ::wint_t;
    40     using ::tm;
     43    /* using std::hel::mbstate_t; */
     44    using std::hel::size_t;
     45    using std::hel::wint_t;
     46    using std::hel::tm;
    4147
    42     /* using ::wcscpy; */
    43     /* using ::wcsncpy; */
    44     /* using ::wcscat; */
    45     /* using ::wcsncat; */
    46     /* using ::wcsnxfrm; */
     48    /* using std::hel::wcscpy; */
     49    /* using std::hel::wcsncpy; */
     50    /* using std::hel::wcscat; */
     51    /* using std::hel::wcsncat; */
     52    /* using std::hel::wcsnxfrm; */
    4753
    48     /* using ::wcslen; */
    49     /* using ::wcscmp; */
    50     /* using ::wcsncmp; */
    51     /* using ::wcscoll; */
    52     /* using ::wcschr; */
    53     /* using ::wcsrchr; */
    54     /* using ::wcsspn; */
    55     /* using ::wcscspn; */
    56     /* using ::wcspbrk; */
    57     /* using ::wcsstr; */
    58     /* using ::wcstok; */
     54    /* using std::hel::wcslen; */
     55    /* using std::hel::wcscmp; */
     56    /* using std::hel::wcsncmp; */
     57    /* using std::hel::wcscoll; */
     58    /* using std::hel::wcschr; */
     59    /* using std::hel::wcsrchr; */
     60    /* using std::hel::wcsspn; */
     61    /* using std::hel::wcscspn; */
     62    /* using std::hel::wcspbrk; */
     63    /* using std::hel::wcsstr; */
     64    /* using std::hel::wcstok; */
    5965
    60     /* using ::wmemcpy; */
    61     /* using ::wmemmove; */
    62     /* using ::wmemcmp; */
    63     /* using ::wmemchr; */
    64     /* using ::wmemset; */
     66    /* using std::hel::wmemcpy; */
     67    /* using std::hel::wmemmove; */
     68    /* using std::hel::wmemcmp; */
     69    /* using std::hel::wmemchr; */
     70    /* using std::hel::wmemset; */
    6571
    66     /* using ::msbinit; */
    67     /* using ::btowc; */
    68     /* using ::wctob; */
    69     /* using ::mbrlen; */
    70     /* using ::mbrtowc; */
    71     /* using ::wctomb; */
    72     /* using ::mbsrtowcs; */
    73     /* using ::wcsrtombs; */
     72    /* using std::hel::msbinit; */
     73    /* using std::hel::btowc; */
     74    /* using std::hel::wctob; */
     75    /* using std::hel::mbrlen; */
     76    /* using std::hel::mbrtowc; */
     77    /* using std::hel::wctomb; */
     78    /* using std::hel::mbsrtowcs; */
     79    /* using std::hel::wcsrtombs; */
    7480
    75     /* using ::fgetwc; */
    76     /* using ::getwc; */
    77     /* using ::fgetws; */
    78     /* using ::fputwc; */
    79     /* using ::putwc; */
    80     /* using ::fputws; */
    81     /* using ::getwchar; */
    82     /* using ::putwchar; */
    83     /* using ::ungetwc; */
    84     /* using ::fwide; */
    85     /* using ::wscanf; */
    86     /* using ::fwscanf; */
    87     /* using ::swscanf; */
    88     /* using ::vwscanf; */
    89     /* using ::vfwscanf; */
    90     /* using ::vswscanf; */
    91     /* using ::wprintf; */
    92     /* using ::fwprintf; */
    93     /* using ::swprintf; */
     81    /* using std::hel::fgetwc; */
     82    /* using std::hel::getwc; */
     83    /* using std::hel::fgetws; */
     84    /* using std::hel::fputwc; */
     85    /* using std::hel::putwc; */
     86    /* using std::hel::fputws; */
     87    /* using std::hel::getwchar; */
     88    /* using std::hel::putwchar; */
     89    /* using std::hel::ungetwc; */
     90    /* using std::hel::fwide; */
     91    /* using std::hel::wscanf; */
     92    /* using std::hel::fwscanf; */
     93    /* using std::hel::swscanf; */
     94    /* using std::hel::vwscanf; */
     95    /* using std::hel::vfwscanf; */
     96    /* using std::hel::vswscanf; */
     97    /* using std::hel::wprintf; */
     98    /* using std::hel::fwprintf; */
     99    /* using std::hel::swprintf; */
    94100
    95     /* using ::wcsftime; */
    96     /* using ::wcstol; */
    97     /* using ::wcstoll; */
    98     /* using ::wcstoul; */
    99     /* using ::wcstoull; */
    100     /* using ::wcstof; */
    101     /* using ::wcstod; */
    102     /* using ::wcstold; */
     101    /* using std::hel::wcsftime; */
     102    /* using std::hel::wcstol; */
     103    /* using std::hel::wcstoll; */
     104    /* using std::hel::wcstoul; */
     105    /* using std::hel::wcstoull; */
     106    /* using std::hel::wcstof; */
     107    /* using std::hel::wcstod; */
     108    /* using std::hel::wcstold; */
    103109}
    104110
     111/* using std::hel::mbstate_t; */
     112using std::hel::size_t;
     113using std::hel::wint_t;
     114using std::hel::tm;
     115
     116/* using std::hel::wcscpy; */
     117/* using std::hel::wcsncpy; */
     118/* using std::hel::wcscat; */
     119/* using std::hel::wcsncat; */
     120/* using std::hel::wcsnxfrm; */
     121
     122/* using std::hel::wcslen; */
     123/* using std::hel::wcscmp; */
     124/* using std::hel::wcsncmp; */
     125/* using std::hel::wcscoll; */
     126/* using std::hel::wcschr; */
     127/* using std::hel::wcsrchr; */
     128/* using std::hel::wcsspn; */
     129/* using std::hel::wcscspn; */
     130/* using std::hel::wcspbrk; */
     131/* using std::hel::wcsstr; */
     132/* using std::hel::wcstok; */
     133
     134/* using std::hel::wmemcpy; */
     135/* using std::hel::wmemmove; */
     136/* using std::hel::wmemcmp; */
     137/* using std::hel::wmemchr; */
     138/* using std::hel::wmemset; */
     139
     140/* using std::hel::msbinit; */
     141/* using std::hel::btowc; */
     142/* using std::hel::wctob; */
     143/* using std::hel::mbrlen; */
     144/* using std::hel::mbrtowc; */
     145/* using std::hel::wctomb; */
     146/* using std::hel::mbsrtowcs; */
     147/* using std::hel::wcsrtombs; */
     148
     149/* using std::hel::fgetwc; */
     150/* using std::hel::getwc; */
     151/* using std::hel::fgetws; */
     152/* using std::hel::fputwc; */
     153/* using std::hel::putwc; */
     154/* using std::hel::fputws; */
     155/* using std::hel::getwchar; */
     156/* using std::hel::putwchar; */
     157/* using std::hel::ungetwc; */
     158/* using std::hel::fwide; */
     159/* using std::hel::wscanf; */
     160/* using std::hel::fwscanf; */
     161/* using std::hel::swscanf; */
     162/* using std::hel::vwscanf; */
     163/* using std::hel::vfwscanf; */
     164/* using std::hel::vswscanf; */
     165/* using std::hel::wprintf; */
     166/* using std::hel::fwprintf; */
     167/* using std::hel::swprintf; */
     168
     169/* using std::hel::wcsftime; */
     170/* using std::hel::wcstol; */
     171/* using std::hel::wcstoll; */
     172/* using std::hel::wcstoul; */
     173/* using std::hel::wcstoull; */
     174/* using std::hel::wcstof; */
     175/* using std::hel::wcstod; */
     176/* using std::hel::wcstold; */
     177
    105178#endif
  • uspace/lib/cpp/src/stdexcept.cpp

    r52acfab raf5037d  
    3131#include <stdexcept>
    3232#include <string>
    33 #include <str.h>
    3433
    3534namespace std
    3635{
    3736    logic_error::logic_error(const string& what)
    38         : what_{::helenos::str_dup(what.c_str())}
     37        : what_{hel::str_dup(what.c_str())}
    3938    { /* DUMMY BODY */ }
    4039
    4140    logic_error::logic_error(const char* what)
    42         : what_{::helenos::str_dup(what)}
     41        : what_{hel::str_dup(what)}
    4342    { /* DUMMY BODY */ }
    4443
    4544    logic_error::logic_error(const logic_error& other) noexcept
    46         : exception{other}, what_{::helenos::str_dup(other.what_)}
     45        : exception{other}, what_{hel::str_dup(other.what_)}
    4746    { /* DUMMY BODY */ }
    4847
     
    5150        if (what_)
    5251            free(what_);
    53         what_ = ::helenos::str_dup(other.what_);
     52        what_ = hel::str_dup(other.what_);
    5453
    5554        return *this;
     
    115114
    116115    runtime_error::runtime_error(const string& what)
    117         : what_{::helenos::str_dup(what.c_str())}
     116        : what_{hel::str_dup(what.c_str())}
    118117    { /* DUMMY BODY */ }
    119118
    120119    runtime_error::runtime_error(const char* what)
    121         : what_{::helenos::str_dup(what)}
     120        : what_{hel::str_dup(what)}
    122121    { /* DUMMY BODY */ }
    123122
    124123    runtime_error::runtime_error(const runtime_error& other) noexcept
    125         : exception{other}, what_{::helenos::str_dup(other.what_)}
     124        : exception{other}, what_{hel::str_dup(other.what_)}
    126125    { /* DUMMY BODY */ }
    127126
     
    130129        if (what_)
    131130            free(what_);
    132         what_ = ::helenos::str_dup(other.what_);
     131        what_ = hel::str_dup(other.what_);
    133132
    134133        return *this;
  • uspace/lib/cpp/src/string.cpp

    r52acfab raf5037d  
    4242    {
    4343        char* end;
    44         long result = ::strtol(str.c_str(), &end, base);
     44        long result = hel::strtol(str.c_str(), &end, base);
    4545
    4646        if (end != str.c_str())
     
    5858    {
    5959        char* end;
    60         unsigned long result = ::strtoul(str.c_str(), &end, base);
     60        unsigned long result = hel::strtoul(str.c_str(), &end, base);
    6161
    6262        if (end != str.c_str())
     
    106106    }
    107107
     108    namespace hel
     109    {
     110        extern "C" int asprintf(char**, const char*, ...);
     111    }
     112
    108113    string to_string(int val)
    109114    {
    110115        char* tmp;
    111         ::asprintf(&tmp, "%d", val);
     116        hel::asprintf(&tmp, "%d", val);
    112117
    113118        std::string res{tmp};
     
    120125    {
    121126        char* tmp;
    122         ::asprintf(&tmp, "%u", val);
     127        hel::asprintf(&tmp, "%u", val);
    123128
    124129        std::string res{tmp};
     
    131136    {
    132137        char* tmp;
    133         ::asprintf(&tmp, "%ld", val);
     138        hel::asprintf(&tmp, "%ld", val);
    134139
    135140        std::string res{tmp};
     
    142147    {
    143148        char* tmp;
    144         ::asprintf(&tmp, "%lu", val);
     149        hel::asprintf(&tmp, "%lu", val);
    145150
    146151        std::string res{tmp};
     
    153158    {
    154159        char* tmp;
    155         ::asprintf(&tmp, "%lld", val);
     160        hel::asprintf(&tmp, "%lld", val);
    156161
    157162        std::string res{tmp};
     
    164169    {
    165170        char* tmp;
    166         ::asprintf(&tmp, "%llu", val);
     171        hel::asprintf(&tmp, "%llu", val);
    167172
    168173        std::string res{tmp};
     
    175180    {
    176181        char* tmp;
    177         ::asprintf(&tmp, "%f", val);
     182        hel::asprintf(&tmp, "%f", val);
    178183
    179184        std::string res{tmp};
     
    186191    {
    187192        char* tmp;
    188         ::asprintf(&tmp, "%f", val);
     193        hel::asprintf(&tmp, "%f", val);
    189194
    190195        std::string res{tmp};
     
    197202    {
    198203        char* tmp;
    199         ::asprintf(&tmp, "%Lf", val);
     204        hel::asprintf(&tmp, "%Lf", val);
    200205
    201206        std::string res{tmp};
  • uspace/lib/cpp/src/typeinfo.cpp

    r52acfab raf5037d  
    3838    bool type_info::operator==(const type_info& other) const noexcept
    3939    {
    40         return (this == &other) || ::strcmp(name(), other.name()) == 0;
     40        return (this == &other) ||
     41               std::hel::str_cmp(name(), other.name());
    4142    }
    4243
  • uspace/lib/pcm/src/format.c

    r52acfab raf5037d  
    4040#include <stdio.h>
    4141#include <inttypes.h>
    42 #include <limits.h>
    4342
    4443#include "format.h"
  • uspace/lib/posix/Makefile

    r52acfab raf5037d  
    4141        ../hound/libhound.a \
    4242        ../pcm/libpcm.a \
    43         ../cpp/libcpp.a \
    4443        $(LIBC_PREFIX)/libc.a \
    4544        $(LIBC_PREFIX)/crt0.o \
     
    9796        $(COMMON_CFLAGS)
    9897
    99 EXPORT_CXXFLAGS = \
    100         $(COMMON_CXXFLAGS)
    101 
    10298include $(USPACE_PREFIX)/Makefile.common
    10399
     
    113109        echo 'HELENOS_CPPFLAGS="$(EXPORT_CPPFLAGS)"' >> $@.new
    114110        echo 'HELENOS_CFLAGS="$(EXPORT_CFLAGS)"' >> $@.new
    115         echo 'HELENOS_CXXFLAGS="$(EXPORT_CXXFLAGS)"' >> $@.new
     111        echo 'HELENOS_CXXFLAGS="$(EXPORT_CFLAGS)"' >> $@.new
    116112        echo 'HELENOS_LDFLAGS="$(EXPORT_LDFLAGS)"' >> $@.new
    117113        echo 'HELENOS_LDLIBS="$(EXPORT_LDLIBS)"' >> $@.new
     
    150146        mkdir -p $(EXPORT_DIR)/include.new/libpcm
    151147        cp -r -L -t $(EXPORT_DIR)/include.new/libpcm ../pcm/include/*
    152         mkdir -p $(EXPORT_DIR)/include.new/libcpp
    153         cp -r -L -t $(EXPORT_DIR)/include.new/libcpp ../cpp/include/*
    154148        mv $(EXPORT_DIR)/include.new $(EXPORT_DIR)/include
  • uspace/lib/posix/include/posix/ctype.h

    r52acfab raf5037d  
    3939#include <libc/ctype.h>
    4040
    41 __C_DECLS_BEGIN;
    42 
    4341/* Obsolete Functions and Macros */
    4442extern int isascii(int c);
     
    4846#define _toupper(c) ((c) - 'a' + 'A')
    4947
    50 __C_DECLS_END;
    51 
    5248#endif /* POSIX_CTYPE_H_ */
    5349
  • uspace/lib/posix/include/posix/dlfcn.h

    r52acfab raf5037d  
    4141#define RTLD_LOCAL 0
    4242
    43 __C_DECLS_BEGIN;
    44 
    4543extern void *dlopen(const char *, int);
    4644extern void *dlsym(void *, const char *);
    4745extern int dlclose(void *);
    4846extern char *dlerror(void);
    49 
    50 __C_DECLS_END;
    5147
    5248#endif
  • uspace/lib/posix/include/posix/fcntl.h

    r52acfab raf5037d  
    3838#include <sys/types.h>
    3939
     40#undef O_CREAT
     41#undef O_EXCL
     42#undef O_TRUNC
     43#undef O_APPEND
     44#undef O_RDONLY
     45#undef O_RDWR
     46#undef O_WRONLY
    4047#define O_CREAT   1
    4148#define O_EXCL    2
     
    4754
    4855/* Mask for file access modes. */
     56#undef O_ACCMODE
    4957#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
    5058
    5159/* Dummy compatibility flag */
     60#undef O_NOCTTY
    5261#define O_NOCTTY 0
    5362
    5463/* fcntl commands */
     64#undef F_DUPFD
     65#undef F_DUPFD_CLOEXEC
     66#undef F_GETFD
     67#undef F_SETFD
     68#undef F_GETFL
     69#undef F_SETFL
     70#undef F_GETOWN
     71#undef F_SETOWN
     72#undef F_GETLK
     73#undef F_SETLK
     74#undef F_SETLKW
    5575#define F_DUPFD            0 /* Duplicate file descriptor. */
    5676#define F_DUPFD_CLOEXEC    1 /* Same as F_DUPFD but with FD_CLOEXEC flag set. */
     
    6686
    6787/* File descriptor flags used with F_GETFD and F_SETFD. */
     88#undef FD_CLOEXEC
    6889#define FD_CLOEXEC         1 /* Close on exec. */
    69 
    70 __C_DECLS_BEGIN;
    7190
    7291extern int open(const char *pathname, int flags, ...);
    7392extern int fcntl(int fd, int cmd, ...);
    74 
    75 __C_DECLS_END;
    7693
    7794#endif /* POSIX_FCNTL_H_ */
  • uspace/lib/posix/include/posix/fnmatch.h

    r52acfab raf5037d  
    3636#define POSIX_FNMATCH_H_
    3737
    38 #include <_bits/decls.h>
    39 
    4038/* Error Values */
     39#undef FNM_NOMATCH
    4140#define FNM_NOMATCH 1
    4241
    4342/* Flags */
     43#undef FNM_PATHNAME
     44#undef FNM_PERIOD
     45#undef FNM_NOESCAPE
    4446#define FNM_PATHNAME 1
    4547#define FNM_PERIOD 2
     
    4749
    4850/* GNU Extensions */
     51#undef FNM_FILE_NAME
     52#undef FNM_LEADING_DIR
     53#undef FNM_CASEFOLD
    4954#define FNM_FILE_NAME FNM_PATHNAME
    5055#define FNM_LEADING_DIR 8
    5156#define FNM_CASEFOLD 16
    5257
    53 __C_DECLS_BEGIN;
    54 
    5558extern int fnmatch(const char *pattern, const char *string, int flags);
    56 
    57 __C_DECLS_END;
    5859
    5960#endif /* POSIX_FNMATCH_H_ */
  • uspace/lib/posix/include/posix/locale.h

    r52acfab raf5037d  
    3737
    3838#include <stddef.h>
    39 #include <_bits/decls.h>
    4039
     40#ifndef __locale_t_defined
     41#define __locale_t_defined
     42typedef struct __posix_locale *locale_t;
     43#endif
     44
     45#undef LC_ALL
     46#undef LC_COLLATE
     47#undef LC_CTYPE
     48#undef LC_MESSAGES
     49#undef LC_MONETARY
     50#undef LC_NUMERIC
     51#undef LC_TIME
    4152#define LC_ALL 0
    4253#define LC_COLLATE 1
     
    4758#define LC_TIME 6
    4859
     60#undef LC_COLLATE_MASK
     61#undef LC_CTYPE_MASK
     62#undef LC_MESSAGES_MASK
     63#undef LC_MONETARY_MASK
     64#undef LC_NUMERIC_MASK
     65#undef LC_TIME_MASK
     66#undef LC_ALL_MASK
    4967#define LC_COLLATE_MASK (1 << 0)
    5068#define LC_CTYPE_MASK (1 << 1)
     
    5674    LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK)
    5775
     76#undef LC_GLOBAL_LOCALE
    5877#define LC_GLOBAL_LOCALE NULL
    59 
    60 __C_DECLS_BEGIN;
    61 
    62 #ifndef __locale_t_defined
    63 #define __locale_t_defined
    64 typedef struct __posix_locale *locale_t;
    65 #endif
    6678
    6779struct lconv {
     
    102114extern locale_t uselocale(locale_t newloc);
    103115
    104 __C_DECLS_END;
    105 
    106116#endif /* POSIX_LOCALE_H_ */
    107117
  • uspace/lib/posix/include/posix/pthread.h

    r52acfab raf5037d  
    3434
    3535#include <time.h>
    36 #include <_bits/decls.h>
    37 
    38 #define PTHREAD_MUTEX_RECURSIVE 1
    39 
    40 #define PTHREAD_MUTEX_INITIALIZER { 0 }
    41 
    42 #define PTHREAD_COND_INITIALIZER { 0 }
    43 
    44 __C_DECLS_BEGIN;
    4536
    4637typedef void *pthread_t;
     
    5243typedef int pthread_key_t;
    5344
     45#define PTHREAD_MUTEX_RECURSIVE 1
     46
    5447typedef struct pthread_mutex {
    5548        int dummy;
    5649} pthread_mutex_t;
     50
     51#define PTHREAD_MUTEX_INITIALIZER { 0 }
    5752
    5853typedef struct {
     
    6762        int dummy;
    6863} pthread_cond_t;
     64
     65#define PTHREAD_COND_INITIALIZER { 0 }
    6966
    7067extern pthread_t pthread_self(void);
     
    109106extern int pthread_key_create(pthread_key_t *, void (*)(void *));
    110107
    111 __C_DECLS_END;
    112 
    113108#endif
    114109
  • uspace/lib/posix/include/posix/pwd.h

    r52acfab raf5037d  
    3737
    3838#include <sys/types.h>
    39 #include <_bits/decls.h>
    40 
    41 __C_DECLS_BEGIN;
    4239
    4340struct passwd {
     
    6158    char *buffer, size_t bufsize, struct passwd **result);
    6259
    63 __C_DECLS_END;
    64 
    6560#endif /* POSIX_PWD_H_ */
    6661
  • uspace/lib/posix/include/posix/signal.h

    r52acfab raf5037d  
    3939#include <ucontext.h>
    4040
     41extern void __posix_default_signal_handler(int signo);
     42extern void __posix_hold_signal_handler(int signo);
     43extern void __posix_ignore_signal_handler(int signo);
     44
     45#undef SIG_DFL
    4146#define SIG_DFL ((void (*)(int)) __posix_default_signal_handler)
     47#undef SIG_ERR
    4248#define SIG_ERR ((void (*)(int)) NULL)
     49#undef SIG_HOLD
    4350#define SIG_HOLD ((void (*)(int)) __posix_hold_signal_handler)
     51#undef SIG_IGN
    4452#define SIG_IGN ((void (*)(int)) __posix_ignore_signal_handler)
    4553
     54typedef struct {
     55        int si_signo;
     56        int si_code;
     57
     58        int si_errno;
     59
     60        pid_t si_pid;
     61        uid_t si_uid;
     62        void *si_addr;
     63        int si_status;
     64
     65        long si_band;
     66
     67        union sigval si_value;
     68} siginfo_t;
     69
     70struct sigaction {
     71        void (*sa_handler)(int);
     72        sigset_t sa_mask;
     73        int sa_flags;
     74        void (*sa_sigaction)(int, siginfo_t *, void *);
     75};
     76
    4677/* Values of sigevent::sigev_notify */
     78#undef SIGEV_NONE
     79#undef SIGEV_SIGNAL
     80#undef SIGEV_THREAD
    4781#define SIGEV_NONE 0
    4882#define SIGEV_SIGNAL 0
    4983#define SIGEV_THREAD 0
    5084
     85#undef SIGRT_MIN
     86#undef SIGRT_MAX
    5187#define SIGRT_MIN 0
    5288#define SIGRT_MAX 0
    5389
     90#undef SIG_BLOCK
     91#undef SIG_UNBLOCK
     92#undef SIG_SETMASK
    5493#define SIG_BLOCK 0
    5594#define SIG_UNBLOCK 1
    5695#define SIG_SETMASK 2
    5796
     97#undef SA_NOCLDSTOP
     98#undef SA_ONSTACK
     99#undef SA_RESETHAND
     100#undef SA_RESTART
     101#undef SA_SIGINFO
     102#undef SA_NOCLDWAIT
     103#undef SA_NODEFER
    58104#define SA_NOCLDSTOP (1 << 0)
    59105#define SA_ONSTACK (1 << 1)
     
    64110#define SA_NODEFER (1 << 6)
    65111
     112#undef SS_ONSTACK
     113#undef SS_DISABLE
    66114#define SS_ONSTACK 0
    67115#define SS_DISABLE 0
    68116
     117#undef MINSIGSTKSZ
     118#undef SIGSTKSZ
    69119#define MINSIGSTKSZ 0
    70120#define SIGSTKSZ 0
    71 
    72 __C_DECLS_BEGIN;
    73 
    74 extern void __posix_default_signal_handler(int signo);
    75 extern void __posix_hold_signal_handler(int signo);
    76 extern void __posix_ignore_signal_handler(int signo);
    77 
    78 typedef struct {
    79         int si_signo;
    80         int si_code;
    81 
    82         int si_errno;
    83 
    84         pid_t si_pid;
    85         uid_t si_uid;
    86         void *si_addr;
    87         int si_status;
    88 
    89         long si_band;
    90 
    91         union sigval si_value;
    92 } siginfo_t;
    93 
    94 struct sigaction {
    95         void (*sa_handler)(int);
    96         sigset_t sa_mask;
    97         int sa_flags;
    98         void (*sa_sigaction)(int, siginfo_t *, void *);
    99 };
    100121
    101122/* Full POSIX set */
     
    224245    sigset_t *__restrict__ oset);
    225246
    226 __C_DECLS_END;
    227 
    228247#endif /* POSIX_SIGNAL_H_ */
    229248
  • uspace/lib/posix/include/posix/stdio.h

    r52acfab raf5037d  
    4545#include <limits.h>
    4646
    47 #define P_tmpdir "/tmp"
    48 
    49 #define L_ctermid PATH_MAX
    50 
    51 __C_DECLS_BEGIN;
    52 
    5347extern FILE *fdopen(int, const char *);
    5448extern int fileno(FILE *);
    5549
     50#define P_tmpdir "/tmp"
     51
    5652/* Identifying the Terminal */
     53#undef L_ctermid
     54#define L_ctermid PATH_MAX
    5755extern char *ctermid(char *s);
    5856
     
    10098extern char *tempnam(const char *dir, const char *pfx);
    10199
    102 __C_DECLS_END;
    103 
    104100#endif /* POSIX_STDIO_H_ */
    105101
  • uspace/lib/posix/include/posix/stdlib.h

    r52acfab raf5037d  
    4242#include <stddef.h>
    4343
    44 __C_DECLS_BEGIN;
    45 
    4644/* Environment Access */
    4745extern int putenv(char *string);
     
    6260extern int bsd_getloadavg(double loadavg[], int nelem);
    6361
    64 __C_DECLS_END;
    65 
    6662#endif  // POSIX_STDLIB_H_
    6763
  • uspace/lib/posix/include/posix/string.h

    r52acfab raf5037d  
    4747
    4848#include <libc/mem.h>
    49 
    50 #define _REALLY_WANT_STRING_H
     49#ifdef _HELENOS_SOURCE
     50#undef _HELENOS_SOURCE
    5151#include <libc/string.h>
    52 
    53 __C_DECLS_BEGIN;
     52#define _HELENOS_SOURCE
     53#else
     54#include <libc/string.h>
     55#endif
    5456
    5557/* Copying and Concatenation */
     
    7173
    7274/* Legacy Declarations */
     75#ifndef POSIX_STRINGS_H_
    7376extern int ffs(int i);
    7477extern int strcasecmp(const char *s1, const char *s2);
    7578extern int strncasecmp(const char *s1, const char *s2, size_t n);
    76 
    77 __C_DECLS_END;
     79#endif
    7880
    7981#endif  // POSIX_STRING_H_
  • uspace/lib/posix/include/posix/strings.h

    r52acfab raf5037d  
    3939#include <types/common.h>
    4040
    41 __C_DECLS_BEGIN;
    42 
    4341/* Search Functions */
     42#ifndef POSIX_STRING_H_
    4443extern int ffs(int i);
     44#endif
    4545
    4646/* String/Array Comparison */
     47#ifndef POSIX_STRING_H_
    4748extern int strcasecmp(const char *s1, const char *s2);
    4849extern int strncasecmp(const char *s1, const char *s2, size_t n);
     50#endif
    4951
    5052/*
     
    6264extern char *rindex(const char *s, int c);
    6365
    64 __C_DECLS_END;
    65 
    6666#endif  // POSIX_STRINGS_H_
    6767
  • uspace/lib/posix/include/posix/sys/mman.h

    r52acfab raf5037d  
    3737
    3838#include <sys/types.h>
    39 #include <_bits/decls.h>
     39#include <abi/mm/as.h>
    4040
    41 #define MAP_FAILED  ((void *) -1)
     41#define MAP_FAILED ((void *) -1)
    4242
    4343#define MAP_SHARED     (1 << 0)
     
    4545#define MAP_FIXED      (1 << 2)
    4646#define MAP_ANONYMOUS  (1 << 3)
    47 #define MAP_ANON       MAP_ANONYMOUS
     47#define MAP_ANON MAP_ANONYMOUS
    4848
    49 #define PROT_NONE   0
    50 #define PROT_READ   1
    51 #define PROT_WRITE  2
    52 #define PROT_EXEC   4
    53 
    54 __C_DECLS_BEGIN;
     49#undef PROT_NONE
     50#undef PROT_READ
     51#undef PROT_WRITE
     52#undef PROT_EXEC
     53#define PROT_NONE  0
     54#define PROT_READ  AS_AREA_READ
     55#define PROT_WRITE AS_AREA_WRITE
     56#define PROT_EXEC  AS_AREA_EXEC
    5557
    5658extern void *mmap(void *start, size_t length, int prot, int flags, int fd,
     
    5860extern int munmap(void *start, size_t length);
    5961
    60 __C_DECLS_END;
    61 
    6262#endif /* POSIX_SYS_MMAN_H_ */
    6363
  • uspace/lib/posix/include/posix/sys/stat.h

    r52acfab raf5037d  
    3939#include <sys/types.h>
    4040#include <time.h>
    41 #include <_bits/decls.h>
    4241
    4342/* values are the same as on Linux */
    4443
     44#undef S_IFMT
     45#undef S_IFSOCK
     46#undef S_IFLNK
     47#undef S_IFREG
     48#undef S_IFBLK
     49#undef S_IFDIR
     50#undef S_IFCHR
     51#undef S_IFIFO
    4552#define S_IFMT     0170000   /* all file types */
    4653#define S_IFSOCK   0140000   /* socket */
     
    5259#define S_IFIFO    0010000   /* FIFO */
    5360
     61#undef S_ISUID
     62#undef S_ISGID
     63#undef S_ISVTX
    5464#define S_ISUID    0004000   /* SUID */
    5565#define S_ISGID    0002000   /* SGID */
    5666#define S_ISVTX    0001000   /* sticky */
    5767
     68#undef S_IRWXU
     69#undef S_IRUSR
     70#undef S_IWUSR
     71#undef S_IXUSR
    5872#define S_IRWXU    00700     /* owner permissions */
    5973#define S_IRUSR    00400
     
    6175#define S_IXUSR    00100
    6276
     77#undef S_IRWXG
     78#undef S_IRGRP
     79#undef S_IWGRP
     80#undef S_IXGRP
    6381#define S_IRWXG    00070     /* group permissions */
    6482#define S_IRGRP    00040
     
    6684#define S_IXGRP    00010
    6785
     86#undef S_IRWXO
     87#undef S_IROTH
     88#undef S_IWOTH
     89#undef S_IXOTH
    6890#define S_IRWXO    00007     /* other permissions */
    6991#define S_IROTH    00004
     
    7193#define S_IXOTH    00001
    7294
     95#undef S_ISREG
     96#undef S_ISDIR
     97#undef S_ISCHR
     98#undef S_ISBLK
     99#undef S_ISFIFO
     100#undef S_ISLNK
     101#undef S_ISSOCK
    73102#define S_ISREG(m) ((m & S_IFREG) != 0)
    74103#define S_ISDIR(m) ((m & S_IFDIR) != 0)
     
    78107#define S_ISLNK(m) ((m & S_IFLNK) != 0) /* symbolic link? (Not in POSIX.1-1996.) */
    79108#define S_ISSOCK(m) ((m & S_IFSOCK) != 0) /* socket? (Not in POSIX.1-1996.) */
    80 
    81 __C_DECLS_BEGIN;
    82109
    83110struct stat {
     
    104131extern int mkdir(const char *path, mode_t mode);
    105132
    106 __C_DECLS_END;
    107 
    108133#endif /* POSIX_SYS_STAT_H */
    109134
  • uspace/lib/posix/include/posix/sys/time.h

    r52acfab raf5037d  
    3535
    3636#include <time.h>
    37 #include <_bits/decls.h>
    38 
    39 __C_DECLS_BEGIN;
    4037
    4138struct timeval {
     
    4643extern int gettimeofday(struct timeval *, void *);
    4744
    48 __C_DECLS_END;
    49 
    5045#endif
    5146
  • uspace/lib/posix/include/posix/sys/types.h

    r52acfab raf5037d  
    3737#define POSIX_SYS_TYPES_H_
    3838
    39 #include <stddef.h>
    40 #include <stdint.h>
    41 #include <_bits/ssize_t.h>
    42 #include <_bits/decls.h>
    43 
    44 __C_DECLS_BEGIN;
     39#include <types/common.h>
    4540
    4641typedef unsigned int ino_t;
     
    5146typedef long blkcnt_t;
    5247typedef int pid_t;
    53 typedef unsigned long dev_t;
     48typedef sysarg_t dev_t;
    5449typedef unsigned int mode_t;
    5550
     
    7267typedef long suseconds_t;
    7368
    74 __C_DECLS_END;
    75 
    7669#endif /* POSIX_SYS_TYPES_H_ */
    7770
  • uspace/lib/posix/include/posix/sys/wait.h

    r52acfab raf5037d  
    3737
    3838#include <sys/types.h>
    39 #include <_bits/decls.h>
    4039
     40#undef WIFEXITED
     41#undef WEXITSTATUS
     42#undef WIFSIGNALED
     43#undef WTERMSIG
    4144#define WIFEXITED(status) __posix_wifexited(status)
    4245#define WEXITSTATUS(status) __posix_wexitstatus(status)
    4346#define WIFSIGNALED(status) __posix_wifsignaled(status)
    4447#define WTERMSIG(status) __posix_wtermsig(status)
    45 
    46 __C_DECLS_BEGIN;
    4748
    4849extern int __posix_wifexited(int status);
     
    5455extern pid_t waitpid(pid_t pid, int *stat_ptr, int options);
    5556
    56 __C_DECLS_END;
    57 
    5857#endif /* POSIX_SYS_WAIT_H_ */
    5958
  • uspace/lib/posix/include/posix/time.h

    r52acfab raf5037d  
    4141#include <libc/time.h>
    4242
    43 #define CLOCK_REALTIME ((clockid_t) 0)
    44 
    45 #define ASCTIME_BUF_LEN  26
    46 
    47 __C_DECLS_BEGIN;
    48 
    4943#ifndef __locale_t_defined
    5044#define __locale_t_defined
     
    5246#endif
    5347
     48#ifndef POSIX_SIGNAL_H_
    5449struct sigevent;
     50#endif
     51
     52#undef CLOCK_REALTIME
     53#define CLOCK_REALTIME ((clockid_t) 0)
     54
     55#define ASCTIME_BUF_LEN  26
    5556
    5657struct itimerspec {
     
    9697    const struct timespec *rqtp, struct timespec *rmtp);
    9798
    98 __C_DECLS_END;
    99 
    10099#endif  // POSIX_TIME_H_
    101100
  • uspace/lib/posix/include/posix/ucontext.h

    r52acfab raf5037d  
    3737
    3838#include <sys/types.h>
    39 #include <_bits/decls.h>
    40 
    41 __C_DECLS_BEGIN;
    4239
    4340typedef int sig_atomic_t;
     
    7471} ucontext_t;
    7572
    76 __C_DECLS_END;
    77 
    7873#endif
    7974
  • uspace/lib/posix/include/posix/unistd.h

    r52acfab raf5037d  
    4646/* Process Termination */
    4747#define _exit exit
    48 
    49 /* Standard Streams */
    50 #define STDIN_FILENO (fileno(stdin))
    51 #define STDOUT_FILENO (fileno(stdout))
    52 #define STDERR_FILENO (fileno(stderr))
    53 
    54 #define F_OK 0 /* Test for existence. */
    55 #define X_OK 1 /* Test for execute permission. */
    56 #define W_OK 2 /* Test for write permission. */
    57 #define R_OK 4 /* Test for read permission. */
    58 
    59 __C_DECLS_BEGIN;
    6048
    6149extern char *optarg;
     
    118106#endif
    119107
     108/* Standard Streams */
     109#undef STDIN_FILENO
     110#define STDIN_FILENO (fileno(stdin))
     111#undef STDOUT_FILENO
     112#define STDOUT_FILENO (fileno(stdout))
     113#undef STDERR_FILENO
     114#define STDERR_FILENO (fileno(stderr))
     115
    120116/* File Accessibility */
     117#undef F_OK
     118#undef X_OK
     119#undef W_OK
     120#undef R_OK
     121#define F_OK 0 /* Test for existence. */
     122#define X_OK 1 /* Test for execute permission. */
     123#define W_OK 2 /* Test for write permission. */
     124#define R_OK 4 /* Test for read permission. */
    121125extern int access(const char *path, int amode);
    122126
     
    167171extern unsigned int alarm(unsigned int);
    168172
    169 __C_DECLS_END;
    170 
    171173#endif /* POSIX_UNISTD_H_ */
    172174
  • uspace/lib/posix/src/internal/common.h

    r52acfab raf5037d  
    6767}
    6868
    69 // TODO: Remove this arbitrary limit.
    70 #define VFS_MAX_OPEN_FILES 128
    71 
    7269extern aoff64_t posix_pos[VFS_MAX_OPEN_FILES];
    7370
  • uspace/lib/posix/src/sys/mman.c

    r52acfab raf5037d  
    3939#include <unistd.h>
    4040
    41 static int _prot_to_as(int prot)
    42 {
    43         int ret = 0;
    44 
    45         if (prot & PROT_READ)
    46                 ret |= AS_AREA_READ;
    47 
    48         if (prot & PROT_WRITE)
    49                 ret |= AS_AREA_WRITE;
    50 
    51         if (prot & PROT_EXEC)
    52                 ret |= AS_AREA_EXEC;
    53 
    54         return ret;
    55 }
    56 
    5741void *mmap(void *start, size_t length, int prot, int flags, int fd,
    5842    off_t offset)
     
    6953                return MAP_FAILED;
    7054
    71         return as_area_create(start, length, _prot_to_as(prot), AS_AREA_UNPAGED);
     55        return as_area_create(start, length, prot, AS_AREA_UNPAGED);
    7256}
    7357
  • uspace/srv/vfs/vfs.h

    r52acfab raf5037d  
    4949#define dprintf(...)
    5050#endif
    51 
    52 // TODO: Remove this arbitrary limit.
    53 /** Maximum number of open files per client. */
    54 #define VFS_MAX_OPEN_FILES  128
    5551
    5652/**
Note: See TracChangeset for help on using the changeset viewer.