Changeset baeeee2 in mainline


Ignore:
Timestamp:
2012-09-04T12:44:40Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
32b3a12
Parents:
f8cbe2c
Message:

libposix: less includes from libc

Location:
uspace/lib/posix
Files:
2 added
12 edited

Legend:

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

    rf8cbe2c rbaeeee2  
    6666#undef errno
    6767#define errno (*__posix_errno())
    68 
    69 #include "unistd.h"
    7068
    7169extern int *__posix_errno(void);
  • uspace/lib/posix/include/posix/signal.h

    rf8cbe2c rbaeeee2  
    3636#define POSIX_SIGNAL_H_
    3737
    38 #include "libc/errno.h"
    3938#include "sys/types.h"
    4039
  • uspace/lib/posix/include/posix/stddef.h

    rf8cbe2c rbaeeee2  
    3636#define POSIX_STDDEF_H_
    3737
    38 #include "libc/stddef.h"
     38#include "sys/types.h"
    3939
    4040#ifndef NULL
  • uspace/lib/posix/include/posix/stdio.h

    rf8cbe2c rbaeeee2  
    4141#include "libc/stdio.h"
    4242#include "sys/types.h"
    43 #include "libc/stdarg.h"
     43#include "stdarg.h"
    4444#include "limits.h"
    4545
  • uspace/lib/posix/include/posix/stdlib.h

    rf8cbe2c rbaeeee2  
    3737#define POSIX_STDLIB_H_
    3838
    39 #include "libc/stdlib.h"
     39#include "sys/types.h"
    4040
    4141#ifndef NULL
     
    5151extern int posix_atexit(void (*func)(void));
    5252extern void exit(int status);
     53extern void abort(void) __attribute__((noreturn));
    5354
    5455/* Absolute Value */
  • uspace/lib/posix/include/posix/sys/mman.h

    rf8cbe2c rbaeeee2  
    3636#define POSIX_SYS_MMAN_H_
    3737
    38 #include "libc/sys/mman.h"
     38#include "sys/types.h"
     39#include <abi/mm/as.h>
     40
     41#define MAP_FAILED ((void *) -1)
     42
     43#define MAP_SHARED     (1 << 0)
     44#define MAP_PRIVATE    (1 << 1)
     45#define MAP_FIXED      (1 << 2)
     46#define MAP_ANONYMOUS  (1 << 3)
    3947
    4048#undef PROT_NONE
     
    4351#undef PROT_EXEC
    4452#define PROT_NONE  0
    45 #define PROT_READ  PROTO_READ
    46 #define PROT_WRITE PROTO_WRITE
    47 #define PROT_EXEC  PROTO_EXEC
     53#define PROT_READ  AS_AREA_READ
     54#define PROT_WRITE AS_AREA_WRITE
     55#define PROT_EXEC  AS_AREA_EXEC
     56
     57extern void *mmap(void *start, size_t length, int prot, int flags, int fd,
     58    posix_off_t offset);
     59extern int munmap(void *start, size_t length);
    4860
    4961#endif /* POSIX_SYS_MMAN_H_ */
  • uspace/lib/posix/include/posix/sys/stat.h

    rf8cbe2c rbaeeee2  
    3737#define POSIX_SYS_STAT_H_
    3838
    39 #include "libc/sys/stat.h"
    4039#include "types.h"
    4140#include "../time.h"
     
    130129extern int posix_chmod(const char *path, mode_t mode);
    131130extern mode_t posix_umask(mode_t mask);
     131extern int mkdir(const char *, mode_t);
    132132
    133133#ifndef LIBPOSIX_INTERNAL
  • uspace/lib/posix/include/posix/sys/types.h

    rf8cbe2c rbaeeee2  
    3838
    3939#include "libc/sys/types.h"
     40#include "libc/sys/time.h"
    4041
    4142typedef unsigned int posix_ino_t;
  • uspace/lib/posix/include/posix/time.h

    rf8cbe2c rbaeeee2  
    3737#define POSIX_TIME_H_
    3838
    39 #include "libc/time.h"
    4039#include "sys/types.h"
    4140
  • uspace/lib/posix/include/posix/unistd.h

    rf8cbe2c rbaeeee2  
    3737#define POSIX_UNISTD_H_
    3838
    39 #include "libc/unistd.h"
    4039#include "sys/types.h"
     40#include "stddef.h"
    4141
    4242/* Process Termination */
  • uspace/lib/posix/source/fnmatch.c

    rf8cbe2c rbaeeee2  
    4242 */
    4343
     44#define LIBPOSIX_INTERNAL
     45
    4446#include "posix/stdbool.h"
    4547#include "posix/ctype.h"
     
    4749#include "posix/stdlib.h"
    4850#include "posix/assert.h"
    49 
    50 #define LIBPOSIX_INTERNAL
    5151
    5252#include "internal/common.h"
     
    182182        { "alnum", isalnum },
    183183        { "alpha", isalpha },
    184         { "blank", isblank },
    185         { "cntrl", iscntrl },
     184        { "blank", posix_isblank },
     185        { "cntrl", posix_iscntrl },
    186186        { "digit", isdigit },
    187         { "graph", isgraph },
     187        { "graph", posix_isgraph },
    188188        { "lower", islower },
    189         { "print", isprint },
    190         { "punct", ispunct },
     189        { "print", posix_isprint },
     190        { "punct", posix_ispunct },
    191191        { "space", isspace },
    192192        { "upper", isupper },
    193         { "xdigit", isxdigit }
     193        { "xdigit", posix_isxdigit }
    194194};
    195195
     
    204204{
    205205        const struct _char_class *class = elem;
    206         return strcmp((const char *) key, class->name);
     206        return posix_strcmp((const char *) key, class->name);
    207207}
    208208
     
    217217{
    218218        /* Search for class in the array of supported character classes. */
    219         const struct _char_class *class = bsearch(cname, _char_classes,
     219        const struct _char_class *class = posix_bsearch(cname, _char_classes,
    220220            sizeof(_char_classes) / sizeof(struct _char_class),
    221221            sizeof(struct _char_class), _class_compare);
     
    549549                        end = string;
    550550                } else {
    551                         end = strchrnul(string, pathname ? '/' : '\0');
     551                        end = gnu_strchrnul(string, pathname ? '/' : '\0');
    552552                }
    553553
     
    581581{
    582582        assert(s != NULL);
    583         char *result = strdup(s);
     583        char *result = posix_strdup(s);
    584584        for (char *i = result; *i != '\0'; ++i) {
    585585                *i = tolower(*i);
  • uspace/lib/posix/source/sys/stat.c

    rf8cbe2c rbaeeee2  
    3838#include "../internal/common.h"
    3939#include "posix/sys/stat.h"
     40#include "libc/sys/stat.h"
    4041
    4142#include "posix/errno.h"
Note: See TracChangeset for help on using the changeset viewer.