Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 9b8be79 in mainline


Ignore:
Timestamp:
2018-09-18T14:50:22Z (3 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master
Children:
460ea7e
Parents:
7570a95f
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-09-14 17:49:49)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-09-18 14:50:22)
Message:

libposix: Change header organization and remove passthrough headers

Posix headers now function like an overlay. The system include directories
are searched after posix directories. The headers don't need to be patched
for export now. libposix files now include headers using bracket notation
instead of quoted notation.

Files:
1 added
12 deleted
46 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r7570a95f r9b8be79  
    378378uspace/lib/math/test-libmath
    379379uspace/lib/pcut/test-libpcut-*
    380 uspace/lib/posix/gcc.specs
    381 uspace/lib/posix/include/libc
    382 uspace/lib/posix/link.ld
    383 uspace/lib/posix/redefs-hide-libc-symbols.list
    384380uspace/lib/posix/test-libposix
    385381uspace/lib/sif/test-libsif
  • uspace/lib/posix/Makefile

    r7570a95f r9b8be79  
    3131LIBRARY = libposix
    3232
    33 EXTRA_CFLAGS = -Iinclude/
    34 
    35 INCLUDE_LIBC = ./include/libc
     33EXTRA_CFLAGS = -Iinclude/posix
    3634
    3735EXPORT_FILES = \
     
    7775
    7876EXPORT_CPPFLAGS = \
    79         -isystem $$(HELENOS_EXPORT_ROOT)/include \
     77        -isystem $$(HELENOS_EXPORT_ROOT)/include/posix \
     78        -isystem $$(HELENOS_EXPORT_ROOT)/include/libc \
     79        -idirafter $$(HELENOS_EXPORT_ROOT)/include \
    8080        $(COMMON_CPPFLAGS)
    8181
     
    9292
    9393include $(USPACE_PREFIX)/Makefile.common
    94 
    95 $(INCLUDE_LIBC): $(shell find ../c/include -name '*.h')
    96         cp -r -L --remove-destination -T ../c/include $@
    97         find ../c/include -type f -and -not -name '*.h' -delete
    9894
    9995export: $(EXPORT_DIR)/config.mk $(EXPORT_DIR)/config.rc
     
    122118        mkdir -p $(EXPORT_DIR)/include
    123119        rm -rf $(EXPORT_DIR)/include.new
    124         cp -r -L -T ./include/posix $(EXPORT_DIR)/include.new
    125         cp -r -L -T ./include/libc $(EXPORT_DIR)/include.new/libc
    126         cp -r -L ../c/arch/$(UARCH)/include/* $(EXPORT_DIR)/include.new/libc
     120        cp -r -L -T ./include $(EXPORT_DIR)/include.new
     121        cp -r -L ../c/arch/$(UARCH)/include/libarch $(EXPORT_DIR)/include.new/libc
    127122        cp -r -L $(ROOT_PATH)/abi/include/* $(EXPORT_DIR)/include.new
    128123        mkdir -p $(EXPORT_DIR)/include.new/libclui
    129124        cp -L ../clui/tinput.h $(EXPORT_DIR)/include.new/libclui
    130 
    131         find "$(EXPORT_DIR)/include.new/libc" "$(EXPORT_DIR)/include.new/libclui" -name '*.h' -exec sed \
    132                 -e 's:#include <:#include <libc/:' \
    133                 -e 's:#include <libc/abi/:#include <abi/:' \
    134                 -e 's:#include <libc/_bits/:#include <_bits/:' \
    135                 -e 's:#include <libc/libc/:#include <libc/:' \
    136                 -i {} \;
    137         find "$(EXPORT_DIR)/include.new" -name '*.h' -exec sed \
    138                 -e 's:#include "posix/:#include ":' \
    139                 -e 's:#include <posix/:#include <:' \
    140                 -i {} \;
    141 
    142125        rm -rf $(EXPORT_DIR)/include
    143126        mv $(EXPORT_DIR)/include.new $(EXPORT_DIR)/include
  • uspace/lib/posix/include/posix/ctype.h

    r7570a95f r9b8be79  
    3737#define POSIX_CTYPE_H_
    3838
    39 #include "libc/ctype.h"
     39#include <libc/ctype.h>
    4040
    4141/* Obsolete Functions and Macros */
  • uspace/lib/posix/include/posix/dlfcn.h

    r7570a95f r9b8be79  
    3434#define POSIX_DLFCN_H_
    3535
    36 #include "libc/dlfcn.h"
     36#include <libc/dlfcn.h>
    3737
    3838#define RTLD_LAZY 1
  • uspace/lib/posix/include/posix/fcntl.h

    r7570a95f r9b8be79  
    3636#define POSIX_FCNTL_H_
    3737
    38 #include "sys/types.h"
     38#include <sys/types.h>
    3939
    4040#undef O_CREAT
  • uspace/lib/posix/include/posix/getopt.h

    r7570a95f r9b8be79  
    3535#define POSIX_GETOPT_H
    3636
    37 #include "unistd.h"
    38 #include "libc/getopt.h"
     37#include <unistd.h>
     38#include <libc/getopt.h>
    3939
    4040#endif
  • uspace/lib/posix/include/posix/limits.h

    r7570a95f r9b8be79  
    3636#define POSIX_LIMITS_H_
    3737
    38 #include "libc/limits.h"
     38#include <libc/limits.h>
    3939
    4040#undef PATH_MAX
  • uspace/lib/posix/include/posix/locale.h

    r7570a95f r9b8be79  
    3636#define POSIX_LOCALE_H_
    3737
    38 #include <_bits/NULL.h>
     38#include <stddef.h>
    3939
    4040#ifndef __locale_t_defined
  • uspace/lib/posix/include/posix/pthread.h

    r7570a95f r9b8be79  
    3333#define POSIX_PTHREAD_H_
    3434
    35 #include "time.h"
     35#include <time.h>
    3636
    3737typedef void *pthread_t;
  • uspace/lib/posix/include/posix/pwd.h

    r7570a95f r9b8be79  
    3636#define POSIX_PWD_H_
    3737
    38 #include "sys/types.h"
     38#include <sys/types.h>
    3939
    4040struct passwd {
  • uspace/lib/posix/include/posix/signal.h

    r7570a95f r9b8be79  
    3636#define POSIX_SIGNAL_H_
    3737
    38 #include "sys/types.h"
    39 #include <posix/ucontext.h>
     38#include <sys/types.h>
     39#include <ucontext.h>
    4040
    4141extern void __posix_default_signal_handler(int signo);
  • uspace/lib/posix/include/posix/stdio.h

    r7570a95f r9b8be79  
    3737#define POSIX_STDIO_H_
    3838
    39 #include "libc/stdio.h"
     39#include <libc/stdio.h>
    4040
    41 #include "stddef.h"
    42 #include "libc/io/verify.h"
    43 #include "sys/types.h"
    44 #include "stdarg.h"
    45 #include "limits.h"
     41#include <stddef.h>
     42#include <io/verify.h>
     43#include <sys/types.h>
     44#include <stdarg.h>
     45#include <limits.h>
    4646
    4747extern FILE *fdopen(int, const char *);
  • uspace/lib/posix/include/posix/stdlib.h

    r7570a95f r9b8be79  
    3737#define POSIX_STDLIB_H_
    3838
    39 #include "libc/stdlib.h"
    40 #include "sys/types.h"
     39#include <libc/stdlib.h>
     40#include <sys/types.h>
    4141
    42 #include <_bits/NULL.h>
     42#include <stddef.h>
    4343
    4444/* Environment Access */
  • uspace/lib/posix/include/posix/string.h

    r7570a95f r9b8be79  
    4444 */
    4545
    46 #include <_bits/NULL.h>
    47 #include <_bits/size_t.h>
     46#include <stddef.h>
    4847
    49 #include "libc/mem.h"
     48#include <libc/mem.h>
    5049#ifdef _HELENOS_SOURCE
    5150#undef _HELENOS_SOURCE
    52 #include "libc/string.h"
     51#include <libc/string.h>
    5352#define _HELENOS_SOURCE
    5453#else
    55 #include "libc/string.h"
     54#include <libc/string.h>
    5655#endif
    5756
  • uspace/lib/posix/include/posix/strings.h

    r7570a95f r9b8be79  
    3737#define POSIX_STRINGS_H_
    3838
    39 #include "libc/types/common.h"
     39#include <types/common.h>
    4040
    4141/* Search Functions */
  • uspace/lib/posix/include/posix/sys/mman.h

    r7570a95f r9b8be79  
    3636#define POSIX_SYS_MMAN_H_
    3737
    38 #include "types.h"
     38#include <sys/types.h>
    3939#include <abi/mm/as.h>
    4040
  • uspace/lib/posix/include/posix/sys/stat.h

    r7570a95f r9b8be79  
    3737#define POSIX_SYS_STAT_H_
    3838
    39 #include "types.h"
    40 #include "../time.h"
     39#include <sys/types.h>
     40#include <time.h>
    4141
    4242/* values are the same as on Linux */
  • uspace/lib/posix/include/posix/sys/time.h

    r7570a95f r9b8be79  
    3434#define POSIX_SYS_TIME_H_
    3535
    36 #include "libc/time.h"
     36#include <time.h>
    3737
    3838struct timeval {
  • uspace/lib/posix/include/posix/sys/types.h

    r7570a95f r9b8be79  
    3737#define POSIX_SYS_TYPES_H_
    3838
    39 #include "libc/offset.h"
    40 #include "libc/types/common.h"
     39#include <offset.h>
     40#include <types/common.h>
    4141
    4242typedef unsigned int ino_t;
  • uspace/lib/posix/include/posix/sys/wait.h

    r7570a95f r9b8be79  
    3636#define POSIX_SYS_WAIT_H_
    3737
    38 #include "types.h"
     38#include <sys/types.h>
    3939
    4040#undef WIFEXITED
  • uspace/lib/posix/include/posix/time.h

    r7570a95f r9b8be79  
    3737#define POSIX_TIME_H_
    3838
    39 #include "sys/types.h"
    40 
    41 #include <_bits/NULL.h>
    42 
    43 #include "libc/time.h"
     39#include <stddef.h>
     40#include <sys/types.h>
     41#include <libc/time.h>
    4442
    4543#ifndef __locale_t_defined
  • uspace/lib/posix/include/posix/ucontext.h

    r7570a95f r9b8be79  
    3636#define POSIX_UCONTEXT_H_
    3737
    38 #include "sys/types.h"
     38#include <sys/types.h>
    3939
    4040typedef int sig_atomic_t;
  • uspace/lib/posix/include/posix/unistd.h

    r7570a95f r9b8be79  
    3737#define POSIX_UNISTD_H_
    3838
    39 #include "sys/types.h"
    40 #include "stddef.h"
     39#include <stddef.h>
     40#include <sys/types.h>
    4141
    4242#define SEEK_SET  0
  • uspace/lib/posix/src/ctype.c

    r7570a95f r9b8be79  
    3434 */
    3535
    36 #include "posix/ctype.h"
     36#include <ctype.h>
    3737
    3838/**
  • uspace/lib/posix/src/dlfcn.c

    r7570a95f r9b8be79  
    3232
    3333#include "internal/common.h"
    34 #include "posix/dlfcn.h"
     34#include <dlfcn.h>
    3535
    3636int dlclose(void *handle)
  • uspace/lib/posix/src/fcntl.c

    r7570a95f r9b8be79  
    3434
    3535#include "internal/common.h"
    36 #include "posix/fcntl.h"
    37 
    38 #include "libc/vfs/vfs.h"
    39 
     36#include <fcntl.h>
     37#include <vfs/vfs.h>
    4038#include <errno.h>
    4139
  • uspace/lib/posix/src/fnmatch.c

    r7570a95f r9b8be79  
    4343 */
    4444
    45 #include "libc/stdbool.h"
    46 #include "posix/ctype.h"
    47 #include "posix/string.h"
    48 #include "posix/stdlib.h"
     45#include <stdbool.h>
     46#include <ctype.h>
     47#include <string.h>
     48#include <stdlib.h>
    4949#include <assert.h>
    5050
    5151#include "internal/common.h"
    52 #include "posix/fnmatch.h"
     52#include <fnmatch.h>
    5353
    5454/* Returned by _match... functions. */
  • uspace/lib/posix/src/locale.c

    r7570a95f r9b8be79  
    3434
    3535#include "internal/common.h"
    36 #include "posix/locale.h"
     36#include <locale.h>
    3737
    3838#include <errno.h>
    3939
    40 #include "posix/limits.h"
    41 #include "posix/string.h"
     40#include <limits.h>
     41#include <string.h>
    4242
    4343/*
  • uspace/lib/posix/src/pthread/condvar.c

    r7570a95f r9b8be79  
    3333 */
    3434
    35 #include "posix/pthread.h"
    36 #include "errno.h"
     35#include <pthread.h>
     36#include <errno.h>
    3737#include "../internal/common.h"
    3838
  • uspace/lib/posix/src/pthread/keys.c

    r7570a95f r9b8be79  
    3333 */
    3434
    35 #include "posix/stdlib.h"
    36 #include "posix/pthread.h"
     35#include <stdlib.h>
     36#include <pthread.h>
    3737#include <errno.h>
    3838#include "../internal/common.h"
  • uspace/lib/posix/src/pthread/mutex.c

    r7570a95f r9b8be79  
    3333 */
    3434
    35 #include "posix/pthread.h"
     35#include <pthread.h>
    3636#include <errno.h>
    3737#include "../internal/common.h"
  • uspace/lib/posix/src/pthread/threads.c

    r7570a95f r9b8be79  
    3333 */
    3434
    35 #include "posix/pthread.h"
    36 #include "errno.h"
    37 #include "posix/stdlib.h"
     35#include <pthread.h>
     36#include <errno.h>
     37#include <stdlib.h>
    3838#include <fibril.h>
    3939#include "../internal/common.h"
  • uspace/lib/posix/src/pwd.c

    r7570a95f r9b8be79  
    3333 */
    3434
    35 #include "libc/stdbool.h"
    36 #include "posix/pwd.h"
    37 #include "posix/string.h"
     35#include <stdbool.h>
     36#include <pwd.h>
     37#include <string.h>
    3838#include <errno.h>
    3939#include <assert.h>
  • uspace/lib/posix/src/signal.c

    r7570a95f r9b8be79  
    3333 */
    3434
    35 #include "posix/signal.h"
     35#include <signal.h>
    3636#include "internal/common.h"
    37 #include "posix/limits.h"
    38 #include "posix/stdlib.h"
    39 #include "posix/string.h"
     37#include <limits.h>
     38#include <stdlib.h>
     39#include <string.h>
    4040
    4141#include <errno.h>
    4242
    43 #include "libc/fibril_synch.h"
    44 #include "libc/task.h"
     43#include <fibril_synch.h>
     44#include <task.h>
    4545
    4646/*
  • uspace/lib/posix/src/stdio.c

    r7570a95f r9b8be79  
    3636
    3737#include "internal/common.h"
    38 #include "posix/stdio.h"
     38#include <stdio.h>
    3939
    4040#include <assert.h>
     
    4343#include <tmpfile.h>
    4444
    45 #include "posix/fcntl.h"
    46 #include "posix/stdlib.h"
    47 #include "posix/string.h"
    48 #include "posix/sys/stat.h"
    49 #include "posix/sys/types.h"
    50 #include "posix/unistd.h"
    51 
    52 #include "libc/stdio.h"
    53 #include "libc/io/printf_core.h"
    54 #include "libc/str.h"
    55 #include "libc/malloc.h"
    56 #include "libc/adt/list.h"
     45#include <fcntl.h>
     46#include <stdlib.h>
     47#include <string.h>
     48#include <sys/stat.h>
     49#include <sys/types.h>
     50#include <unistd.h>
     51
     52#include <io/printf_core.h>
     53#include <str.h>
     54#include <malloc.h>
     55#include <adt/list.h>
    5756
    5857/**
  • uspace/lib/posix/src/stdlib.c

    r7570a95f r9b8be79  
    3535
    3636#include "internal/common.h"
    37 #include "posix/stdlib.h"
     37#include <stdlib.h>
    3838
    3939#include <errno.h>
    4040#include <tmpfile.h>
    4141
    42 #include "posix/fcntl.h"
    43 #include "posix/limits.h"
    44 #include "posix/string.h"
    45 #include "posix/sys/stat.h"
    46 #include "posix/unistd.h"
    47 
    48 #include "libc/qsort.h"
    49 #include "libc/str.h"
    50 #include "libc/vfs/vfs.h"
    51 #include "libc/stats.h"
     42#include <fcntl.h>
     43#include <limits.h>
     44#include <string.h>
     45#include <sys/stat.h>
     46#include <unistd.h>
     47
     48#include <qsort.h>
     49#include <str.h>
     50#include <vfs/vfs.h>
     51#include <stats.h>
    5252
    5353/**
  • uspace/lib/posix/src/string.c

    r7570a95f r9b8be79  
    3636
    3737#include "internal/common.h"
    38 #include "posix/string.h"
     38#include <string.h>
    3939
    4040#include <assert.h>
     
    4242#include <errno.h>
    4343
    44 #include "posix/limits.h"
    45 #include "posix/stdlib.h"
    46 #include "posix/signal.h"
    47 
    48 #include "libc/str.h"
    49 #include "libc/str_error.h"
     44#include <limits.h>
     45#include <stdlib.h>
     46#include <signal.h>
     47#include <str.h>
     48#include <str_error.h>
    5049
    5150/**
  • uspace/lib/posix/src/strings.c

    r7570a95f r9b8be79  
    3535
    3636#include "internal/common.h"
    37 #include "posix/strings.h"
     37#include <strings.h>
    3838
    39 #include "posix/string.h"
    40 #include "posix/ctype.h"
     39#include <string.h>
     40#include <ctype.h>
    4141
    42 #include "libc/mem.h"
    43 #include "libc/str.h"
     42#include <mem.h>
     43#include <str.h>
    4444
    4545/**
  • uspace/lib/posix/src/sys/mman.c

    r7570a95f r9b8be79  
    3434
    3535#include "../internal/common.h"
    36 #include <posix/sys/mman.h>
    37 #include <posix/sys/types.h>
    38 #include <libc/as.h>
    39 #include <posix/unistd.h>
     36#include <sys/mman.h>
     37#include <sys/types.h>
     38#include <as.h>
     39#include <unistd.h>
    4040
    4141void *mmap(void *start, size_t length, int prot, int flags, int fd,
  • uspace/lib/posix/src/sys/stat.c

    r7570a95f r9b8be79  
    3535
    3636#include "../internal/common.h"
    37 #include "posix/sys/stat.h"
    38 #include "libc/vfs/vfs.h"
     37#include <sys/stat.h>
     38#include <vfs/vfs.h>
    3939
    4040#include <errno.h>
    41 #include "libc/mem.h"
     41#include <mem.h>
    4242
    4343/**
  • uspace/lib/posix/src/sys/wait.c

    r7570a95f r9b8be79  
    3535
    3636#include "../internal/common.h"
    37 #include "posix/sys/wait.h"
     37#include <sys/wait.h>
    3838
    39 #include "libc/task.h"
     39#include <task.h>
    4040#include <assert.h>
    4141
    4242#include <errno.h>
    4343
    44 #include "posix/limits.h"
    45 #include "posix/signal.h"
     44#include <limits.h>
     45#include <signal.h>
    4646
    4747int __posix_wifexited(int status)
  • uspace/lib/posix/src/time.c

    r7570a95f r9b8be79  
    3535
    3636#include "internal/common.h"
    37 #include "posix/sys/types.h"
    38 #include "posix/sys/time.h"
    39 #include "posix/time.h"
    40 
    41 #include "posix/ctype.h"
     37#include <sys/types.h>
     38#include <sys/time.h>
     39#include <time.h>
     40
     41#include <ctype.h>
    4242
    4343#include <errno.h>
    4444
    45 #include "posix/signal.h"
     45#include <signal.h>
    4646#include <assert.h>
    4747
    48 #include "libc/async.h"
    49 #include "libc/malloc.h"
    50 #include "libc/task.h"
    51 #include "libc/stddef.h"
    52 #include "libc/time.h"
     48#include <async.h>
     49#include <malloc.h>
     50#include <task.h>
     51#include <stddef.h>
    5352
    5453// TODO: test everything in this file
  • uspace/lib/posix/src/unistd.c

    r7570a95f r9b8be79  
    3535
    3636#include "internal/common.h"
    37 #include "posix/unistd.h"
     37#include <unistd.h>
    3838
    3939#include <errno.h>
    4040
    41 #include "posix/dirent.h"
    42 #include "posix/string.h"
    43 #include "posix/sys/types.h"
    44 #include "posix/fcntl.h"
    45 
    46 #include "libc/task.h"
    47 #include "libc/stats.h"
    48 #include "libc/malloc.h"
    49 #include "libc/vfs/vfs.h"
     41#include <dirent.h>
     42#include <string.h>
     43#include <sys/types.h>
     44#include <fcntl.h>
     45
     46#include <task.h>
     47#include <stats.h>
     48#include <malloc.h>
     49#include <vfs/vfs.h>
    5050
    5151#include <libarch/config.h>
  • uspace/lib/posix/test/stdio.c

    r7570a95f r9b8be79  
    2929#include <pcut/pcut.h>
    3030#include <str.h>
    31 #include "posix/stdio.h"
     31#include <stdio.h>
    3232
    3333PCUT_INIT;
  • uspace/lib/posix/test/stdlib.c

    r7570a95f r9b8be79  
    2929#include <pcut/pcut.h>
    3030#include <str.h>
    31 #include "posix/fcntl.h"
    32 #include "posix/stdio.h"
    33 #include "posix/stdlib.h"
    34 #include "posix/unistd.h"
     31#include <fcntl.h>
     32#include <stdio.h>
     33#include <stdlib.h>
     34#include <unistd.h>
    3535
    3636PCUT_INIT;
  • uspace/lib/posix/test/unistd.c

    r7570a95f r9b8be79  
    2929#include <stdio.h>
    3030#include <pcut/pcut.h>
    31 #include "posix/fcntl.h"
    32 #include "posix/stdlib.h"
    33 #include "posix/unistd.h"
     31#include <fcntl.h>
     32#include <stdlib.h>
     33#include <unistd.h>
    3434
    3535PCUT_INIT;
Note: See TracChangeset for help on using the changeset viewer.