diff --git a/newlib/Makefile.in b/newlib/Makefile.in index 5ccd76278f..9a1ae4d10b 100644 --- a/newlib/Makefile.in +++ b/newlib/Makefile.in @@ -586,43 +586,27 @@ check_PROGRAMS = @HAVE_LIBC_SYS_W65_DIR_TRUE@am__append_63 = libc/sys/w65/syscalls.c libc/sys/w65/trap.c @HAVE_LIBC_SYS_Z8KSIM_DIR_TRUE@am__append_64 = libc/sys/z8ksim/glue.c @HAVE_LIBC_SYS_HERMIT_DIR_TRUE@am__append_65 = \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/chown.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/clock_getres.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/clock_gettime.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/clock_nanosleep.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/clock_settime.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/close.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/environ.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/errno.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/execve.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/_exit.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/fork.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/fstat.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/getpagesize.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/getpid.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/gettod.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/isatty.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/kill.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/link.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/lseek.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/nanosleep.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/open.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/read.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/readlink.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/signal/kill.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/signal/sigaction.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/signal/sigprocmask.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/signal/sigtimedwait.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/stdio/rename.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/conf.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/dirent.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/env.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/fcntl.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/ldso.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/malloc.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/misc.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/mman.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/network.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/process.c \ @HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/sbrk.c \ @HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/sched.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/setitimer.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/signal.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/select.c \ @HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/stat.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/symlink.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/sysconf.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/times.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/unlink.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/wait.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/write.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/context.S \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/makecontext.c \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/inet_ntoa.c +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/time.c \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/unistd.c @HAVE_LIBC_MACHINE_AARCH64_TRUE@am__append_66 = \ @HAVE_LIBC_MACHINE_AARCH64_TRUE@ libc/machine/aarch64/memchr-stub.c \ @@ -1837,43 +1821,27 @@ am__objects_51 = libc/ssp/a-chk_fail.$(OBJEXT) \ @HAVE_LIBC_SYS_W65_DIR_TRUE@ libc/sys/w65/a-syscalls.$(OBJEXT) \ @HAVE_LIBC_SYS_W65_DIR_TRUE@ libc/sys/w65/a-trap.$(OBJEXT) @HAVE_LIBC_SYS_Z8KSIM_DIR_TRUE@am__objects_75 = libc/sys/z8ksim/a-glue.$(OBJEXT) -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@am__objects_76 = libc/sys/hermit/a-chown.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-clock_getres.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-clock_gettime.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-clock_nanosleep.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-clock_settime.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-close.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-environ.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-errno.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-execve.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-_exit.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-fork.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-fstat.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-getpagesize.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-getpid.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-gettod.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-isatty.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-kill.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-link.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-lseek.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-nanosleep.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-open.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-read.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-readlink.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@am__objects_76 = libc/sys/hermit/signal/a-kill.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/signal/a-sigaction.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/signal/a-sigprocmask.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/signal/a-sigtimedwait.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/stdio/a-rename.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-conf.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-dirent.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-env.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-fcntl.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-ldso.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-malloc.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-misc.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-mman.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-network.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-process.$(OBJEXT) \ @HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-sbrk.$(OBJEXT) \ @HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-sched.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-setitimer.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-signal.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-select.$(OBJEXT) \ @HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-stat.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-symlink.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-sysconf.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-times.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-unlink.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-wait.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-write.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-context.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-makecontext.$(OBJEXT) \ -@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-inet_ntoa.$(OBJEXT) +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-time.$(OBJEXT) \ +@HAVE_LIBC_SYS_HERMIT_DIR_TRUE@ libc/sys/hermit/a-unistd.$(OBJEXT) @HAVE_LIBC_MACHINE_AARCH64_TRUE@am__objects_77 = libc/machine/aarch64/a-memchr-stub.$(OBJEXT) \ @HAVE_LIBC_MACHINE_AARCH64_TRUE@ libc/machine/aarch64/a-memchr.$(OBJEXT) \ @HAVE_LIBC_MACHINE_AARCH64_TRUE@ libc/machine/aarch64/a-memcmp-stub.$(OBJEXT) \ @@ -4688,43 +4656,27 @@ am__depfiles_remade = libc/argz/$(DEPDIR)/a-argz_add.Po \ libc/sys/h8300hms/$(DEPDIR)/a-write.Po \ libc/sys/h8500hms/$(DEPDIR)/a-misc.Po \ libc/sys/h8500hms/$(DEPDIR)/a-syscalls.Po \ - libc/sys/hermit/$(DEPDIR)/a-_exit.Po \ - libc/sys/hermit/$(DEPDIR)/a-chown.Po \ - libc/sys/hermit/$(DEPDIR)/a-clock_getres.Po \ - libc/sys/hermit/$(DEPDIR)/a-clock_gettime.Po \ - libc/sys/hermit/$(DEPDIR)/a-clock_nanosleep.Po \ - libc/sys/hermit/$(DEPDIR)/a-clock_settime.Po \ - libc/sys/hermit/$(DEPDIR)/a-close.Po \ - libc/sys/hermit/$(DEPDIR)/a-context.Po \ - libc/sys/hermit/$(DEPDIR)/a-environ.Po \ - libc/sys/hermit/$(DEPDIR)/a-errno.Po \ - libc/sys/hermit/$(DEPDIR)/a-execve.Po \ - libc/sys/hermit/$(DEPDIR)/a-fork.Po \ - libc/sys/hermit/$(DEPDIR)/a-fstat.Po \ - libc/sys/hermit/$(DEPDIR)/a-getpagesize.Po \ - libc/sys/hermit/$(DEPDIR)/a-getpid.Po \ - libc/sys/hermit/$(DEPDIR)/a-gettod.Po \ - libc/sys/hermit/$(DEPDIR)/a-inet_ntoa.Po \ - libc/sys/hermit/$(DEPDIR)/a-isatty.Po \ - libc/sys/hermit/$(DEPDIR)/a-kill.Po \ - libc/sys/hermit/$(DEPDIR)/a-link.Po \ - libc/sys/hermit/$(DEPDIR)/a-lseek.Po \ - libc/sys/hermit/$(DEPDIR)/a-makecontext.Po \ - libc/sys/hermit/$(DEPDIR)/a-nanosleep.Po \ - libc/sys/hermit/$(DEPDIR)/a-open.Po \ - libc/sys/hermit/$(DEPDIR)/a-read.Po \ - libc/sys/hermit/$(DEPDIR)/a-readlink.Po \ + libc/sys/hermit/$(DEPDIR)/a-conf.Po \ + libc/sys/hermit/$(DEPDIR)/a-dirent.Po \ + libc/sys/hermit/$(DEPDIR)/a-env.Po \ + libc/sys/hermit/$(DEPDIR)/a-fcntl.Po \ + libc/sys/hermit/$(DEPDIR)/a-ldso.Po \ + libc/sys/hermit/$(DEPDIR)/a-malloc.Po \ + libc/sys/hermit/$(DEPDIR)/a-misc.Po \ + libc/sys/hermit/$(DEPDIR)/a-mman.Po \ + libc/sys/hermit/$(DEPDIR)/a-network.Po \ + libc/sys/hermit/$(DEPDIR)/a-process.Po \ libc/sys/hermit/$(DEPDIR)/a-sbrk.Po \ libc/sys/hermit/$(DEPDIR)/a-sched.Po \ - libc/sys/hermit/$(DEPDIR)/a-setitimer.Po \ - libc/sys/hermit/$(DEPDIR)/a-signal.Po \ + libc/sys/hermit/$(DEPDIR)/a-select.Po \ libc/sys/hermit/$(DEPDIR)/a-stat.Po \ - libc/sys/hermit/$(DEPDIR)/a-symlink.Po \ - libc/sys/hermit/$(DEPDIR)/a-sysconf.Po \ - libc/sys/hermit/$(DEPDIR)/a-times.Po \ - libc/sys/hermit/$(DEPDIR)/a-unlink.Po \ - libc/sys/hermit/$(DEPDIR)/a-wait.Po \ - libc/sys/hermit/$(DEPDIR)/a-write.Po \ + libc/sys/hermit/$(DEPDIR)/a-time.Po \ + libc/sys/hermit/$(DEPDIR)/a-unistd.Po \ + libc/sys/hermit/signal/$(DEPDIR)/a-kill.Po \ + libc/sys/hermit/signal/$(DEPDIR)/a-sigaction.Po \ + libc/sys/hermit/signal/$(DEPDIR)/a-sigprocmask.Po \ + libc/sys/hermit/signal/$(DEPDIR)/a-sigtimedwait.Po \ + libc/sys/hermit/stdio/$(DEPDIR)/a-rename.Po \ libc/sys/m88kbug/$(DEPDIR)/a-syscalls.Po \ libc/sys/mmixware/$(DEPDIR)/a-_exit.Po \ libc/sys/mmixware/$(DEPDIR)/a-access.Po \ @@ -9951,94 +9903,70 @@ libc/sys/z8ksim/$(DEPDIR)/$(am__dirstamp): @: > libc/sys/z8ksim/$(DEPDIR)/$(am__dirstamp) libc/sys/z8ksim/a-glue.$(OBJEXT): libc/sys/z8ksim/$(am__dirstamp) \ libc/sys/z8ksim/$(DEPDIR)/$(am__dirstamp) +libc/sys/hermit/signal/$(am__dirstamp): + @$(MKDIR_P) libc/sys/hermit/signal + @: > libc/sys/hermit/signal/$(am__dirstamp) +libc/sys/hermit/signal/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) libc/sys/hermit/signal/$(DEPDIR) + @: > libc/sys/hermit/signal/$(DEPDIR)/$(am__dirstamp) +libc/sys/hermit/signal/a-kill.$(OBJEXT): \ + libc/sys/hermit/signal/$(am__dirstamp) \ + libc/sys/hermit/signal/$(DEPDIR)/$(am__dirstamp) +libc/sys/hermit/signal/a-sigaction.$(OBJEXT): \ + libc/sys/hermit/signal/$(am__dirstamp) \ + libc/sys/hermit/signal/$(DEPDIR)/$(am__dirstamp) +libc/sys/hermit/signal/a-sigprocmask.$(OBJEXT): \ + libc/sys/hermit/signal/$(am__dirstamp) \ + libc/sys/hermit/signal/$(DEPDIR)/$(am__dirstamp) +libc/sys/hermit/signal/a-sigtimedwait.$(OBJEXT): \ + libc/sys/hermit/signal/$(am__dirstamp) \ + libc/sys/hermit/signal/$(DEPDIR)/$(am__dirstamp) +libc/sys/hermit/stdio/$(am__dirstamp): + @$(MKDIR_P) libc/sys/hermit/stdio + @: > libc/sys/hermit/stdio/$(am__dirstamp) +libc/sys/hermit/stdio/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) libc/sys/hermit/stdio/$(DEPDIR) + @: > libc/sys/hermit/stdio/$(DEPDIR)/$(am__dirstamp) +libc/sys/hermit/stdio/a-rename.$(OBJEXT): \ + libc/sys/hermit/stdio/$(am__dirstamp) \ + libc/sys/hermit/stdio/$(DEPDIR)/$(am__dirstamp) libc/sys/hermit/$(am__dirstamp): @$(MKDIR_P) libc/sys/hermit @: > libc/sys/hermit/$(am__dirstamp) libc/sys/hermit/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) libc/sys/hermit/$(DEPDIR) @: > libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-chown.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ +libc/sys/hermit/a-conf.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-clock_getres.$(OBJEXT): \ - libc/sys/hermit/$(am__dirstamp) \ +libc/sys/hermit/a-dirent.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-clock_gettime.$(OBJEXT): \ - libc/sys/hermit/$(am__dirstamp) \ +libc/sys/hermit/a-env.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-clock_nanosleep.$(OBJEXT): \ - libc/sys/hermit/$(am__dirstamp) \ +libc/sys/hermit/a-fcntl.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-clock_settime.$(OBJEXT): \ - libc/sys/hermit/$(am__dirstamp) \ +libc/sys/hermit/a-ldso.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-close.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ +libc/sys/hermit/a-malloc.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-environ.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ +libc/sys/hermit/a-misc.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-errno.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ +libc/sys/hermit/a-mman.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-execve.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ +libc/sys/hermit/a-network.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-_exit.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-fork.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-fstat.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-getpagesize.$(OBJEXT): \ - libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-getpid.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-gettod.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-isatty.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-kill.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-link.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-lseek.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-nanosleep.$(OBJEXT): \ - libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-open.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-read.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-readlink.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ +libc/sys/hermit/a-process.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) libc/sys/hermit/a-sbrk.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) libc/sys/hermit/a-sched.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-setitimer.$(OBJEXT): \ - libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-signal.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ +libc/sys/hermit/a-select.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) libc/sys/hermit/a-stat.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-symlink.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-sysconf.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-times.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-unlink.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ +libc/sys/hermit/a-time.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-wait.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-write.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-context.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-makecontext.$(OBJEXT): \ - libc/sys/hermit/$(am__dirstamp) \ - libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -libc/sys/hermit/a-inet_ntoa.$(OBJEXT): \ - libc/sys/hermit/$(am__dirstamp) \ +libc/sys/hermit/a-unistd.$(OBJEXT): libc/sys/hermit/$(am__dirstamp) \ libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) libc/machine/aarch64/$(am__dirstamp): @$(MKDIR_P) libc/machine/aarch64 @@ -14188,6 +14116,8 @@ mostlyclean-compile: -rm -f libc/sys/h8300hms/*.$(OBJEXT) -rm -f libc/sys/h8500hms/*.$(OBJEXT) -rm -f libc/sys/hermit/*.$(OBJEXT) + -rm -f libc/sys/hermit/signal/*.$(OBJEXT) + -rm -f libc/sys/hermit/stdio/*.$(OBJEXT) -rm -f libc/sys/m88kbug/*.$(OBJEXT) -rm -f libc/sys/mmixware/*.$(OBJEXT) -rm -f libc/sys/netware/*.$(OBJEXT) @@ -15443,43 +15373,27 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@libc/sys/h8300hms/$(DEPDIR)/a-write.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@libc/sys/h8500hms/$(DEPDIR)/a-misc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@libc/sys/h8500hms/$(DEPDIR)/a-syscalls.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-_exit.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-chown.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-clock_getres.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-clock_gettime.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-clock_nanosleep.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-clock_settime.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-close.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-context.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-environ.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-errno.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-execve.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-fork.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-fstat.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-getpagesize.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-getpid.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-gettod.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-inet_ntoa.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-isatty.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-kill.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-link.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-lseek.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-makecontext.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-nanosleep.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-open.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-read.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-readlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-conf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-dirent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-env.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-fcntl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-ldso.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-malloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-misc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-mman.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-network.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-process.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-sbrk.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-sched.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-setitimer.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-select.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-stat.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-symlink.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-sysconf.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-times.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-unlink.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-wait.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-write.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/$(DEPDIR)/a-unistd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/signal/$(DEPDIR)/a-kill.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/signal/$(DEPDIR)/a-sigaction.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/signal/$(DEPDIR)/a-sigprocmask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/signal/$(DEPDIR)/a-sigtimedwait.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@libc/sys/hermit/stdio/$(DEPDIR)/a-rename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@libc/sys/m88kbug/$(DEPDIR)/a-syscalls.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@libc/sys/mmixware/$(DEPDIR)/a-_exit.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@libc/sys/mmixware/$(DEPDIR)/a-access.Po@am__quote@ # am--include-marker @@ -18276,20 +18190,6 @@ libc/sys/sysvnecv70/a-open.obj: libc/sys/sysvnecv70/open.S @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -c -o libc/sys/sysvnecv70/a-open.obj `if test -f 'libc/sys/sysvnecv70/open.S'; then $(CYGPATH_W) 'libc/sys/sysvnecv70/open.S'; else $(CYGPATH_W) '$(srcdir)/libc/sys/sysvnecv70/open.S'; fi` -libc/sys/hermit/a-context.o: libc/sys/hermit/context.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -MT libc/sys/hermit/a-context.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-context.Tpo -c -o libc/sys/hermit/a-context.o `test -f 'libc/sys/hermit/context.S' || echo '$(srcdir)/'`libc/sys/hermit/context.S -@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-context.Tpo libc/sys/hermit/$(DEPDIR)/a-context.Po -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='libc/sys/hermit/context.S' object='libc/sys/hermit/a-context.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -c -o libc/sys/hermit/a-context.o `test -f 'libc/sys/hermit/context.S' || echo '$(srcdir)/'`libc/sys/hermit/context.S - -libc/sys/hermit/a-context.obj: libc/sys/hermit/context.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -MT libc/sys/hermit/a-context.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-context.Tpo -c -o libc/sys/hermit/a-context.obj `if test -f 'libc/sys/hermit/context.S'; then $(CYGPATH_W) 'libc/sys/hermit/context.S'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/context.S'; fi` -@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-context.Tpo libc/sys/hermit/$(DEPDIR)/a-context.Po -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='libc/sys/hermit/context.S' object='libc/sys/hermit/a-context.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -c -o libc/sys/hermit/a-context.obj `if test -f 'libc/sys/hermit/context.S'; then $(CYGPATH_W) 'libc/sys/hermit/context.S'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/context.S'; fi` - libc/machine/aarch64/a-memchr.o: libc/machine/aarch64/memchr.S @am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -MT libc/machine/aarch64/a-memchr.o -MD -MP -MF libc/machine/aarch64/$(DEPDIR)/a-memchr.Tpo -c -o libc/machine/aarch64/a-memchr.o `test -f 'libc/machine/aarch64/memchr.S' || echo '$(srcdir)/'`libc/machine/aarch64/memchr.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) libc/machine/aarch64/$(DEPDIR)/a-memchr.Tpo libc/machine/aarch64/$(DEPDIR)/a-memchr.Po @@ -34406,327 +34306,215 @@ libc/sys/z8ksim/a-glue.obj: libc/sys/z8ksim/glue.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/z8ksim/a-glue.obj `if test -f 'libc/sys/z8ksim/glue.c'; then $(CYGPATH_W) 'libc/sys/z8ksim/glue.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/z8ksim/glue.c'; fi` -libc/sys/hermit/a-chown.o: libc/sys/hermit/chown.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-chown.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-chown.Tpo -c -o libc/sys/hermit/a-chown.o `test -f 'libc/sys/hermit/chown.c' || echo '$(srcdir)/'`libc/sys/hermit/chown.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-chown.Tpo libc/sys/hermit/$(DEPDIR)/a-chown.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/chown.c' object='libc/sys/hermit/a-chown.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-chown.o `test -f 'libc/sys/hermit/chown.c' || echo '$(srcdir)/'`libc/sys/hermit/chown.c - -libc/sys/hermit/a-chown.obj: libc/sys/hermit/chown.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-chown.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-chown.Tpo -c -o libc/sys/hermit/a-chown.obj `if test -f 'libc/sys/hermit/chown.c'; then $(CYGPATH_W) 'libc/sys/hermit/chown.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/chown.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-chown.Tpo libc/sys/hermit/$(DEPDIR)/a-chown.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/chown.c' object='libc/sys/hermit/a-chown.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-chown.obj `if test -f 'libc/sys/hermit/chown.c'; then $(CYGPATH_W) 'libc/sys/hermit/chown.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/chown.c'; fi` - -libc/sys/hermit/a-clock_getres.o: libc/sys/hermit/clock_getres.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-clock_getres.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-clock_getres.Tpo -c -o libc/sys/hermit/a-clock_getres.o `test -f 'libc/sys/hermit/clock_getres.c' || echo '$(srcdir)/'`libc/sys/hermit/clock_getres.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-clock_getres.Tpo libc/sys/hermit/$(DEPDIR)/a-clock_getres.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/clock_getres.c' object='libc/sys/hermit/a-clock_getres.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-clock_getres.o `test -f 'libc/sys/hermit/clock_getres.c' || echo '$(srcdir)/'`libc/sys/hermit/clock_getres.c - -libc/sys/hermit/a-clock_getres.obj: libc/sys/hermit/clock_getres.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-clock_getres.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-clock_getres.Tpo -c -o libc/sys/hermit/a-clock_getres.obj `if test -f 'libc/sys/hermit/clock_getres.c'; then $(CYGPATH_W) 'libc/sys/hermit/clock_getres.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/clock_getres.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-clock_getres.Tpo libc/sys/hermit/$(DEPDIR)/a-clock_getres.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/clock_getres.c' object='libc/sys/hermit/a-clock_getres.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-clock_getres.obj `if test -f 'libc/sys/hermit/clock_getres.c'; then $(CYGPATH_W) 'libc/sys/hermit/clock_getres.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/clock_getres.c'; fi` - -libc/sys/hermit/a-clock_gettime.o: libc/sys/hermit/clock_gettime.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-clock_gettime.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-clock_gettime.Tpo -c -o libc/sys/hermit/a-clock_gettime.o `test -f 'libc/sys/hermit/clock_gettime.c' || echo '$(srcdir)/'`libc/sys/hermit/clock_gettime.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-clock_gettime.Tpo libc/sys/hermit/$(DEPDIR)/a-clock_gettime.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/clock_gettime.c' object='libc/sys/hermit/a-clock_gettime.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-clock_gettime.o `test -f 'libc/sys/hermit/clock_gettime.c' || echo '$(srcdir)/'`libc/sys/hermit/clock_gettime.c - -libc/sys/hermit/a-clock_gettime.obj: libc/sys/hermit/clock_gettime.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-clock_gettime.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-clock_gettime.Tpo -c -o libc/sys/hermit/a-clock_gettime.obj `if test -f 'libc/sys/hermit/clock_gettime.c'; then $(CYGPATH_W) 'libc/sys/hermit/clock_gettime.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/clock_gettime.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-clock_gettime.Tpo libc/sys/hermit/$(DEPDIR)/a-clock_gettime.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/clock_gettime.c' object='libc/sys/hermit/a-clock_gettime.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-clock_gettime.obj `if test -f 'libc/sys/hermit/clock_gettime.c'; then $(CYGPATH_W) 'libc/sys/hermit/clock_gettime.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/clock_gettime.c'; fi` - -libc/sys/hermit/a-clock_nanosleep.o: libc/sys/hermit/clock_nanosleep.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-clock_nanosleep.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-clock_nanosleep.Tpo -c -o libc/sys/hermit/a-clock_nanosleep.o `test -f 'libc/sys/hermit/clock_nanosleep.c' || echo '$(srcdir)/'`libc/sys/hermit/clock_nanosleep.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-clock_nanosleep.Tpo libc/sys/hermit/$(DEPDIR)/a-clock_nanosleep.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/clock_nanosleep.c' object='libc/sys/hermit/a-clock_nanosleep.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-clock_nanosleep.o `test -f 'libc/sys/hermit/clock_nanosleep.c' || echo '$(srcdir)/'`libc/sys/hermit/clock_nanosleep.c - -libc/sys/hermit/a-clock_nanosleep.obj: libc/sys/hermit/clock_nanosleep.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-clock_nanosleep.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-clock_nanosleep.Tpo -c -o libc/sys/hermit/a-clock_nanosleep.obj `if test -f 'libc/sys/hermit/clock_nanosleep.c'; then $(CYGPATH_W) 'libc/sys/hermit/clock_nanosleep.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/clock_nanosleep.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-clock_nanosleep.Tpo libc/sys/hermit/$(DEPDIR)/a-clock_nanosleep.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/clock_nanosleep.c' object='libc/sys/hermit/a-clock_nanosleep.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-clock_nanosleep.obj `if test -f 'libc/sys/hermit/clock_nanosleep.c'; then $(CYGPATH_W) 'libc/sys/hermit/clock_nanosleep.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/clock_nanosleep.c'; fi` - -libc/sys/hermit/a-clock_settime.o: libc/sys/hermit/clock_settime.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-clock_settime.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-clock_settime.Tpo -c -o libc/sys/hermit/a-clock_settime.o `test -f 'libc/sys/hermit/clock_settime.c' || echo '$(srcdir)/'`libc/sys/hermit/clock_settime.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-clock_settime.Tpo libc/sys/hermit/$(DEPDIR)/a-clock_settime.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/clock_settime.c' object='libc/sys/hermit/a-clock_settime.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-clock_settime.o `test -f 'libc/sys/hermit/clock_settime.c' || echo '$(srcdir)/'`libc/sys/hermit/clock_settime.c - -libc/sys/hermit/a-clock_settime.obj: libc/sys/hermit/clock_settime.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-clock_settime.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-clock_settime.Tpo -c -o libc/sys/hermit/a-clock_settime.obj `if test -f 'libc/sys/hermit/clock_settime.c'; then $(CYGPATH_W) 'libc/sys/hermit/clock_settime.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/clock_settime.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-clock_settime.Tpo libc/sys/hermit/$(DEPDIR)/a-clock_settime.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/clock_settime.c' object='libc/sys/hermit/a-clock_settime.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/signal/a-kill.o: libc/sys/hermit/signal/kill.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/signal/a-kill.o -MD -MP -MF libc/sys/hermit/signal/$(DEPDIR)/a-kill.Tpo -c -o libc/sys/hermit/signal/a-kill.o `test -f 'libc/sys/hermit/signal/kill.c' || echo '$(srcdir)/'`libc/sys/hermit/signal/kill.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/signal/$(DEPDIR)/a-kill.Tpo libc/sys/hermit/signal/$(DEPDIR)/a-kill.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/signal/kill.c' object='libc/sys/hermit/signal/a-kill.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-clock_settime.obj `if test -f 'libc/sys/hermit/clock_settime.c'; then $(CYGPATH_W) 'libc/sys/hermit/clock_settime.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/clock_settime.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/signal/a-kill.o `test -f 'libc/sys/hermit/signal/kill.c' || echo '$(srcdir)/'`libc/sys/hermit/signal/kill.c -libc/sys/hermit/a-close.o: libc/sys/hermit/close.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-close.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-close.Tpo -c -o libc/sys/hermit/a-close.o `test -f 'libc/sys/hermit/close.c' || echo '$(srcdir)/'`libc/sys/hermit/close.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-close.Tpo libc/sys/hermit/$(DEPDIR)/a-close.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/close.c' object='libc/sys/hermit/a-close.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/signal/a-kill.obj: libc/sys/hermit/signal/kill.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/signal/a-kill.obj -MD -MP -MF libc/sys/hermit/signal/$(DEPDIR)/a-kill.Tpo -c -o libc/sys/hermit/signal/a-kill.obj `if test -f 'libc/sys/hermit/signal/kill.c'; then $(CYGPATH_W) 'libc/sys/hermit/signal/kill.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/signal/kill.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/signal/$(DEPDIR)/a-kill.Tpo libc/sys/hermit/signal/$(DEPDIR)/a-kill.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/signal/kill.c' object='libc/sys/hermit/signal/a-kill.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-close.o `test -f 'libc/sys/hermit/close.c' || echo '$(srcdir)/'`libc/sys/hermit/close.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/signal/a-kill.obj `if test -f 'libc/sys/hermit/signal/kill.c'; then $(CYGPATH_W) 'libc/sys/hermit/signal/kill.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/signal/kill.c'; fi` -libc/sys/hermit/a-close.obj: libc/sys/hermit/close.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-close.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-close.Tpo -c -o libc/sys/hermit/a-close.obj `if test -f 'libc/sys/hermit/close.c'; then $(CYGPATH_W) 'libc/sys/hermit/close.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/close.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-close.Tpo libc/sys/hermit/$(DEPDIR)/a-close.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/close.c' object='libc/sys/hermit/a-close.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/signal/a-sigaction.o: libc/sys/hermit/signal/sigaction.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/signal/a-sigaction.o -MD -MP -MF libc/sys/hermit/signal/$(DEPDIR)/a-sigaction.Tpo -c -o libc/sys/hermit/signal/a-sigaction.o `test -f 'libc/sys/hermit/signal/sigaction.c' || echo '$(srcdir)/'`libc/sys/hermit/signal/sigaction.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/signal/$(DEPDIR)/a-sigaction.Tpo libc/sys/hermit/signal/$(DEPDIR)/a-sigaction.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/signal/sigaction.c' object='libc/sys/hermit/signal/a-sigaction.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-close.obj `if test -f 'libc/sys/hermit/close.c'; then $(CYGPATH_W) 'libc/sys/hermit/close.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/close.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/signal/a-sigaction.o `test -f 'libc/sys/hermit/signal/sigaction.c' || echo '$(srcdir)/'`libc/sys/hermit/signal/sigaction.c -libc/sys/hermit/a-environ.o: libc/sys/hermit/environ.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-environ.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-environ.Tpo -c -o libc/sys/hermit/a-environ.o `test -f 'libc/sys/hermit/environ.c' || echo '$(srcdir)/'`libc/sys/hermit/environ.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-environ.Tpo libc/sys/hermit/$(DEPDIR)/a-environ.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/environ.c' object='libc/sys/hermit/a-environ.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/signal/a-sigaction.obj: libc/sys/hermit/signal/sigaction.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/signal/a-sigaction.obj -MD -MP -MF libc/sys/hermit/signal/$(DEPDIR)/a-sigaction.Tpo -c -o libc/sys/hermit/signal/a-sigaction.obj `if test -f 'libc/sys/hermit/signal/sigaction.c'; then $(CYGPATH_W) 'libc/sys/hermit/signal/sigaction.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/signal/sigaction.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/signal/$(DEPDIR)/a-sigaction.Tpo libc/sys/hermit/signal/$(DEPDIR)/a-sigaction.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/signal/sigaction.c' object='libc/sys/hermit/signal/a-sigaction.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-environ.o `test -f 'libc/sys/hermit/environ.c' || echo '$(srcdir)/'`libc/sys/hermit/environ.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/signal/a-sigaction.obj `if test -f 'libc/sys/hermit/signal/sigaction.c'; then $(CYGPATH_W) 'libc/sys/hermit/signal/sigaction.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/signal/sigaction.c'; fi` -libc/sys/hermit/a-environ.obj: libc/sys/hermit/environ.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-environ.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-environ.Tpo -c -o libc/sys/hermit/a-environ.obj `if test -f 'libc/sys/hermit/environ.c'; then $(CYGPATH_W) 'libc/sys/hermit/environ.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/environ.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-environ.Tpo libc/sys/hermit/$(DEPDIR)/a-environ.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/environ.c' object='libc/sys/hermit/a-environ.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/signal/a-sigprocmask.o: libc/sys/hermit/signal/sigprocmask.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/signal/a-sigprocmask.o -MD -MP -MF libc/sys/hermit/signal/$(DEPDIR)/a-sigprocmask.Tpo -c -o libc/sys/hermit/signal/a-sigprocmask.o `test -f 'libc/sys/hermit/signal/sigprocmask.c' || echo '$(srcdir)/'`libc/sys/hermit/signal/sigprocmask.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/signal/$(DEPDIR)/a-sigprocmask.Tpo libc/sys/hermit/signal/$(DEPDIR)/a-sigprocmask.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/signal/sigprocmask.c' object='libc/sys/hermit/signal/a-sigprocmask.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-environ.obj `if test -f 'libc/sys/hermit/environ.c'; then $(CYGPATH_W) 'libc/sys/hermit/environ.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/environ.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/signal/a-sigprocmask.o `test -f 'libc/sys/hermit/signal/sigprocmask.c' || echo '$(srcdir)/'`libc/sys/hermit/signal/sigprocmask.c -libc/sys/hermit/a-errno.o: libc/sys/hermit/errno.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-errno.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-errno.Tpo -c -o libc/sys/hermit/a-errno.o `test -f 'libc/sys/hermit/errno.c' || echo '$(srcdir)/'`libc/sys/hermit/errno.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-errno.Tpo libc/sys/hermit/$(DEPDIR)/a-errno.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/errno.c' object='libc/sys/hermit/a-errno.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/signal/a-sigprocmask.obj: libc/sys/hermit/signal/sigprocmask.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/signal/a-sigprocmask.obj -MD -MP -MF libc/sys/hermit/signal/$(DEPDIR)/a-sigprocmask.Tpo -c -o libc/sys/hermit/signal/a-sigprocmask.obj `if test -f 'libc/sys/hermit/signal/sigprocmask.c'; then $(CYGPATH_W) 'libc/sys/hermit/signal/sigprocmask.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/signal/sigprocmask.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/signal/$(DEPDIR)/a-sigprocmask.Tpo libc/sys/hermit/signal/$(DEPDIR)/a-sigprocmask.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/signal/sigprocmask.c' object='libc/sys/hermit/signal/a-sigprocmask.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-errno.o `test -f 'libc/sys/hermit/errno.c' || echo '$(srcdir)/'`libc/sys/hermit/errno.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/signal/a-sigprocmask.obj `if test -f 'libc/sys/hermit/signal/sigprocmask.c'; then $(CYGPATH_W) 'libc/sys/hermit/signal/sigprocmask.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/signal/sigprocmask.c'; fi` -libc/sys/hermit/a-errno.obj: libc/sys/hermit/errno.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-errno.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-errno.Tpo -c -o libc/sys/hermit/a-errno.obj `if test -f 'libc/sys/hermit/errno.c'; then $(CYGPATH_W) 'libc/sys/hermit/errno.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/errno.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-errno.Tpo libc/sys/hermit/$(DEPDIR)/a-errno.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/errno.c' object='libc/sys/hermit/a-errno.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/signal/a-sigtimedwait.o: libc/sys/hermit/signal/sigtimedwait.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/signal/a-sigtimedwait.o -MD -MP -MF libc/sys/hermit/signal/$(DEPDIR)/a-sigtimedwait.Tpo -c -o libc/sys/hermit/signal/a-sigtimedwait.o `test -f 'libc/sys/hermit/signal/sigtimedwait.c' || echo '$(srcdir)/'`libc/sys/hermit/signal/sigtimedwait.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/signal/$(DEPDIR)/a-sigtimedwait.Tpo libc/sys/hermit/signal/$(DEPDIR)/a-sigtimedwait.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/signal/sigtimedwait.c' object='libc/sys/hermit/signal/a-sigtimedwait.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-errno.obj `if test -f 'libc/sys/hermit/errno.c'; then $(CYGPATH_W) 'libc/sys/hermit/errno.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/errno.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/signal/a-sigtimedwait.o `test -f 'libc/sys/hermit/signal/sigtimedwait.c' || echo '$(srcdir)/'`libc/sys/hermit/signal/sigtimedwait.c -libc/sys/hermit/a-execve.o: libc/sys/hermit/execve.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-execve.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-execve.Tpo -c -o libc/sys/hermit/a-execve.o `test -f 'libc/sys/hermit/execve.c' || echo '$(srcdir)/'`libc/sys/hermit/execve.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-execve.Tpo libc/sys/hermit/$(DEPDIR)/a-execve.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/execve.c' object='libc/sys/hermit/a-execve.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/signal/a-sigtimedwait.obj: libc/sys/hermit/signal/sigtimedwait.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/signal/a-sigtimedwait.obj -MD -MP -MF libc/sys/hermit/signal/$(DEPDIR)/a-sigtimedwait.Tpo -c -o libc/sys/hermit/signal/a-sigtimedwait.obj `if test -f 'libc/sys/hermit/signal/sigtimedwait.c'; then $(CYGPATH_W) 'libc/sys/hermit/signal/sigtimedwait.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/signal/sigtimedwait.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/signal/$(DEPDIR)/a-sigtimedwait.Tpo libc/sys/hermit/signal/$(DEPDIR)/a-sigtimedwait.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/signal/sigtimedwait.c' object='libc/sys/hermit/signal/a-sigtimedwait.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-execve.o `test -f 'libc/sys/hermit/execve.c' || echo '$(srcdir)/'`libc/sys/hermit/execve.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/signal/a-sigtimedwait.obj `if test -f 'libc/sys/hermit/signal/sigtimedwait.c'; then $(CYGPATH_W) 'libc/sys/hermit/signal/sigtimedwait.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/signal/sigtimedwait.c'; fi` -libc/sys/hermit/a-execve.obj: libc/sys/hermit/execve.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-execve.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-execve.Tpo -c -o libc/sys/hermit/a-execve.obj `if test -f 'libc/sys/hermit/execve.c'; then $(CYGPATH_W) 'libc/sys/hermit/execve.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/execve.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-execve.Tpo libc/sys/hermit/$(DEPDIR)/a-execve.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/execve.c' object='libc/sys/hermit/a-execve.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/stdio/a-rename.o: libc/sys/hermit/stdio/rename.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/stdio/a-rename.o -MD -MP -MF libc/sys/hermit/stdio/$(DEPDIR)/a-rename.Tpo -c -o libc/sys/hermit/stdio/a-rename.o `test -f 'libc/sys/hermit/stdio/rename.c' || echo '$(srcdir)/'`libc/sys/hermit/stdio/rename.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/stdio/$(DEPDIR)/a-rename.Tpo libc/sys/hermit/stdio/$(DEPDIR)/a-rename.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/stdio/rename.c' object='libc/sys/hermit/stdio/a-rename.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-execve.obj `if test -f 'libc/sys/hermit/execve.c'; then $(CYGPATH_W) 'libc/sys/hermit/execve.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/execve.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/stdio/a-rename.o `test -f 'libc/sys/hermit/stdio/rename.c' || echo '$(srcdir)/'`libc/sys/hermit/stdio/rename.c -libc/sys/hermit/a-_exit.o: libc/sys/hermit/_exit.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-_exit.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-_exit.Tpo -c -o libc/sys/hermit/a-_exit.o `test -f 'libc/sys/hermit/_exit.c' || echo '$(srcdir)/'`libc/sys/hermit/_exit.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-_exit.Tpo libc/sys/hermit/$(DEPDIR)/a-_exit.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/_exit.c' object='libc/sys/hermit/a-_exit.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/stdio/a-rename.obj: libc/sys/hermit/stdio/rename.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/stdio/a-rename.obj -MD -MP -MF libc/sys/hermit/stdio/$(DEPDIR)/a-rename.Tpo -c -o libc/sys/hermit/stdio/a-rename.obj `if test -f 'libc/sys/hermit/stdio/rename.c'; then $(CYGPATH_W) 'libc/sys/hermit/stdio/rename.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/stdio/rename.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/stdio/$(DEPDIR)/a-rename.Tpo libc/sys/hermit/stdio/$(DEPDIR)/a-rename.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/stdio/rename.c' object='libc/sys/hermit/stdio/a-rename.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-_exit.o `test -f 'libc/sys/hermit/_exit.c' || echo '$(srcdir)/'`libc/sys/hermit/_exit.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/stdio/a-rename.obj `if test -f 'libc/sys/hermit/stdio/rename.c'; then $(CYGPATH_W) 'libc/sys/hermit/stdio/rename.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/stdio/rename.c'; fi` -libc/sys/hermit/a-_exit.obj: libc/sys/hermit/_exit.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-_exit.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-_exit.Tpo -c -o libc/sys/hermit/a-_exit.obj `if test -f 'libc/sys/hermit/_exit.c'; then $(CYGPATH_W) 'libc/sys/hermit/_exit.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/_exit.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-_exit.Tpo libc/sys/hermit/$(DEPDIR)/a-_exit.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/_exit.c' object='libc/sys/hermit/a-_exit.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-conf.o: libc/sys/hermit/conf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-conf.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-conf.Tpo -c -o libc/sys/hermit/a-conf.o `test -f 'libc/sys/hermit/conf.c' || echo '$(srcdir)/'`libc/sys/hermit/conf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-conf.Tpo libc/sys/hermit/$(DEPDIR)/a-conf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/conf.c' object='libc/sys/hermit/a-conf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-_exit.obj `if test -f 'libc/sys/hermit/_exit.c'; then $(CYGPATH_W) 'libc/sys/hermit/_exit.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/_exit.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-conf.o `test -f 'libc/sys/hermit/conf.c' || echo '$(srcdir)/'`libc/sys/hermit/conf.c -libc/sys/hermit/a-fork.o: libc/sys/hermit/fork.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-fork.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-fork.Tpo -c -o libc/sys/hermit/a-fork.o `test -f 'libc/sys/hermit/fork.c' || echo '$(srcdir)/'`libc/sys/hermit/fork.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-fork.Tpo libc/sys/hermit/$(DEPDIR)/a-fork.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/fork.c' object='libc/sys/hermit/a-fork.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-conf.obj: libc/sys/hermit/conf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-conf.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-conf.Tpo -c -o libc/sys/hermit/a-conf.obj `if test -f 'libc/sys/hermit/conf.c'; then $(CYGPATH_W) 'libc/sys/hermit/conf.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/conf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-conf.Tpo libc/sys/hermit/$(DEPDIR)/a-conf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/conf.c' object='libc/sys/hermit/a-conf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-fork.o `test -f 'libc/sys/hermit/fork.c' || echo '$(srcdir)/'`libc/sys/hermit/fork.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-conf.obj `if test -f 'libc/sys/hermit/conf.c'; then $(CYGPATH_W) 'libc/sys/hermit/conf.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/conf.c'; fi` -libc/sys/hermit/a-fork.obj: libc/sys/hermit/fork.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-fork.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-fork.Tpo -c -o libc/sys/hermit/a-fork.obj `if test -f 'libc/sys/hermit/fork.c'; then $(CYGPATH_W) 'libc/sys/hermit/fork.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/fork.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-fork.Tpo libc/sys/hermit/$(DEPDIR)/a-fork.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/fork.c' object='libc/sys/hermit/a-fork.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-dirent.o: libc/sys/hermit/dirent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-dirent.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-dirent.Tpo -c -o libc/sys/hermit/a-dirent.o `test -f 'libc/sys/hermit/dirent.c' || echo '$(srcdir)/'`libc/sys/hermit/dirent.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-dirent.Tpo libc/sys/hermit/$(DEPDIR)/a-dirent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/dirent.c' object='libc/sys/hermit/a-dirent.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-fork.obj `if test -f 'libc/sys/hermit/fork.c'; then $(CYGPATH_W) 'libc/sys/hermit/fork.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/fork.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-dirent.o `test -f 'libc/sys/hermit/dirent.c' || echo '$(srcdir)/'`libc/sys/hermit/dirent.c -libc/sys/hermit/a-fstat.o: libc/sys/hermit/fstat.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-fstat.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-fstat.Tpo -c -o libc/sys/hermit/a-fstat.o `test -f 'libc/sys/hermit/fstat.c' || echo '$(srcdir)/'`libc/sys/hermit/fstat.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-fstat.Tpo libc/sys/hermit/$(DEPDIR)/a-fstat.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/fstat.c' object='libc/sys/hermit/a-fstat.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-dirent.obj: libc/sys/hermit/dirent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-dirent.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-dirent.Tpo -c -o libc/sys/hermit/a-dirent.obj `if test -f 'libc/sys/hermit/dirent.c'; then $(CYGPATH_W) 'libc/sys/hermit/dirent.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/dirent.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-dirent.Tpo libc/sys/hermit/$(DEPDIR)/a-dirent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/dirent.c' object='libc/sys/hermit/a-dirent.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-fstat.o `test -f 'libc/sys/hermit/fstat.c' || echo '$(srcdir)/'`libc/sys/hermit/fstat.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-dirent.obj `if test -f 'libc/sys/hermit/dirent.c'; then $(CYGPATH_W) 'libc/sys/hermit/dirent.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/dirent.c'; fi` -libc/sys/hermit/a-fstat.obj: libc/sys/hermit/fstat.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-fstat.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-fstat.Tpo -c -o libc/sys/hermit/a-fstat.obj `if test -f 'libc/sys/hermit/fstat.c'; then $(CYGPATH_W) 'libc/sys/hermit/fstat.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/fstat.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-fstat.Tpo libc/sys/hermit/$(DEPDIR)/a-fstat.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/fstat.c' object='libc/sys/hermit/a-fstat.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-env.o: libc/sys/hermit/env.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-env.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-env.Tpo -c -o libc/sys/hermit/a-env.o `test -f 'libc/sys/hermit/env.c' || echo '$(srcdir)/'`libc/sys/hermit/env.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-env.Tpo libc/sys/hermit/$(DEPDIR)/a-env.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/env.c' object='libc/sys/hermit/a-env.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-fstat.obj `if test -f 'libc/sys/hermit/fstat.c'; then $(CYGPATH_W) 'libc/sys/hermit/fstat.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/fstat.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-env.o `test -f 'libc/sys/hermit/env.c' || echo '$(srcdir)/'`libc/sys/hermit/env.c -libc/sys/hermit/a-getpagesize.o: libc/sys/hermit/getpagesize.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-getpagesize.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-getpagesize.Tpo -c -o libc/sys/hermit/a-getpagesize.o `test -f 'libc/sys/hermit/getpagesize.c' || echo '$(srcdir)/'`libc/sys/hermit/getpagesize.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-getpagesize.Tpo libc/sys/hermit/$(DEPDIR)/a-getpagesize.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/getpagesize.c' object='libc/sys/hermit/a-getpagesize.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-env.obj: libc/sys/hermit/env.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-env.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-env.Tpo -c -o libc/sys/hermit/a-env.obj `if test -f 'libc/sys/hermit/env.c'; then $(CYGPATH_W) 'libc/sys/hermit/env.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/env.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-env.Tpo libc/sys/hermit/$(DEPDIR)/a-env.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/env.c' object='libc/sys/hermit/a-env.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-getpagesize.o `test -f 'libc/sys/hermit/getpagesize.c' || echo '$(srcdir)/'`libc/sys/hermit/getpagesize.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-env.obj `if test -f 'libc/sys/hermit/env.c'; then $(CYGPATH_W) 'libc/sys/hermit/env.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/env.c'; fi` -libc/sys/hermit/a-getpagesize.obj: libc/sys/hermit/getpagesize.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-getpagesize.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-getpagesize.Tpo -c -o libc/sys/hermit/a-getpagesize.obj `if test -f 'libc/sys/hermit/getpagesize.c'; then $(CYGPATH_W) 'libc/sys/hermit/getpagesize.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/getpagesize.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-getpagesize.Tpo libc/sys/hermit/$(DEPDIR)/a-getpagesize.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/getpagesize.c' object='libc/sys/hermit/a-getpagesize.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-fcntl.o: libc/sys/hermit/fcntl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-fcntl.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-fcntl.Tpo -c -o libc/sys/hermit/a-fcntl.o `test -f 'libc/sys/hermit/fcntl.c' || echo '$(srcdir)/'`libc/sys/hermit/fcntl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-fcntl.Tpo libc/sys/hermit/$(DEPDIR)/a-fcntl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/fcntl.c' object='libc/sys/hermit/a-fcntl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-getpagesize.obj `if test -f 'libc/sys/hermit/getpagesize.c'; then $(CYGPATH_W) 'libc/sys/hermit/getpagesize.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/getpagesize.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-fcntl.o `test -f 'libc/sys/hermit/fcntl.c' || echo '$(srcdir)/'`libc/sys/hermit/fcntl.c -libc/sys/hermit/a-getpid.o: libc/sys/hermit/getpid.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-getpid.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-getpid.Tpo -c -o libc/sys/hermit/a-getpid.o `test -f 'libc/sys/hermit/getpid.c' || echo '$(srcdir)/'`libc/sys/hermit/getpid.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-getpid.Tpo libc/sys/hermit/$(DEPDIR)/a-getpid.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/getpid.c' object='libc/sys/hermit/a-getpid.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-fcntl.obj: libc/sys/hermit/fcntl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-fcntl.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-fcntl.Tpo -c -o libc/sys/hermit/a-fcntl.obj `if test -f 'libc/sys/hermit/fcntl.c'; then $(CYGPATH_W) 'libc/sys/hermit/fcntl.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/fcntl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-fcntl.Tpo libc/sys/hermit/$(DEPDIR)/a-fcntl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/fcntl.c' object='libc/sys/hermit/a-fcntl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-getpid.o `test -f 'libc/sys/hermit/getpid.c' || echo '$(srcdir)/'`libc/sys/hermit/getpid.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-fcntl.obj `if test -f 'libc/sys/hermit/fcntl.c'; then $(CYGPATH_W) 'libc/sys/hermit/fcntl.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/fcntl.c'; fi` -libc/sys/hermit/a-getpid.obj: libc/sys/hermit/getpid.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-getpid.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-getpid.Tpo -c -o libc/sys/hermit/a-getpid.obj `if test -f 'libc/sys/hermit/getpid.c'; then $(CYGPATH_W) 'libc/sys/hermit/getpid.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/getpid.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-getpid.Tpo libc/sys/hermit/$(DEPDIR)/a-getpid.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/getpid.c' object='libc/sys/hermit/a-getpid.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-ldso.o: libc/sys/hermit/ldso.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-ldso.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-ldso.Tpo -c -o libc/sys/hermit/a-ldso.o `test -f 'libc/sys/hermit/ldso.c' || echo '$(srcdir)/'`libc/sys/hermit/ldso.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-ldso.Tpo libc/sys/hermit/$(DEPDIR)/a-ldso.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/ldso.c' object='libc/sys/hermit/a-ldso.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-getpid.obj `if test -f 'libc/sys/hermit/getpid.c'; then $(CYGPATH_W) 'libc/sys/hermit/getpid.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/getpid.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-ldso.o `test -f 'libc/sys/hermit/ldso.c' || echo '$(srcdir)/'`libc/sys/hermit/ldso.c -libc/sys/hermit/a-gettod.o: libc/sys/hermit/gettod.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-gettod.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-gettod.Tpo -c -o libc/sys/hermit/a-gettod.o `test -f 'libc/sys/hermit/gettod.c' || echo '$(srcdir)/'`libc/sys/hermit/gettod.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-gettod.Tpo libc/sys/hermit/$(DEPDIR)/a-gettod.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/gettod.c' object='libc/sys/hermit/a-gettod.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-ldso.obj: libc/sys/hermit/ldso.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-ldso.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-ldso.Tpo -c -o libc/sys/hermit/a-ldso.obj `if test -f 'libc/sys/hermit/ldso.c'; then $(CYGPATH_W) 'libc/sys/hermit/ldso.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/ldso.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-ldso.Tpo libc/sys/hermit/$(DEPDIR)/a-ldso.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/ldso.c' object='libc/sys/hermit/a-ldso.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-gettod.o `test -f 'libc/sys/hermit/gettod.c' || echo '$(srcdir)/'`libc/sys/hermit/gettod.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-ldso.obj `if test -f 'libc/sys/hermit/ldso.c'; then $(CYGPATH_W) 'libc/sys/hermit/ldso.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/ldso.c'; fi` -libc/sys/hermit/a-gettod.obj: libc/sys/hermit/gettod.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-gettod.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-gettod.Tpo -c -o libc/sys/hermit/a-gettod.obj `if test -f 'libc/sys/hermit/gettod.c'; then $(CYGPATH_W) 'libc/sys/hermit/gettod.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/gettod.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-gettod.Tpo libc/sys/hermit/$(DEPDIR)/a-gettod.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/gettod.c' object='libc/sys/hermit/a-gettod.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-malloc.o: libc/sys/hermit/malloc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-malloc.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-malloc.Tpo -c -o libc/sys/hermit/a-malloc.o `test -f 'libc/sys/hermit/malloc.c' || echo '$(srcdir)/'`libc/sys/hermit/malloc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-malloc.Tpo libc/sys/hermit/$(DEPDIR)/a-malloc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/malloc.c' object='libc/sys/hermit/a-malloc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-gettod.obj `if test -f 'libc/sys/hermit/gettod.c'; then $(CYGPATH_W) 'libc/sys/hermit/gettod.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/gettod.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-malloc.o `test -f 'libc/sys/hermit/malloc.c' || echo '$(srcdir)/'`libc/sys/hermit/malloc.c -libc/sys/hermit/a-isatty.o: libc/sys/hermit/isatty.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-isatty.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-isatty.Tpo -c -o libc/sys/hermit/a-isatty.o `test -f 'libc/sys/hermit/isatty.c' || echo '$(srcdir)/'`libc/sys/hermit/isatty.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-isatty.Tpo libc/sys/hermit/$(DEPDIR)/a-isatty.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/isatty.c' object='libc/sys/hermit/a-isatty.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-malloc.obj: libc/sys/hermit/malloc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-malloc.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-malloc.Tpo -c -o libc/sys/hermit/a-malloc.obj `if test -f 'libc/sys/hermit/malloc.c'; then $(CYGPATH_W) 'libc/sys/hermit/malloc.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/malloc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-malloc.Tpo libc/sys/hermit/$(DEPDIR)/a-malloc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/malloc.c' object='libc/sys/hermit/a-malloc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-isatty.o `test -f 'libc/sys/hermit/isatty.c' || echo '$(srcdir)/'`libc/sys/hermit/isatty.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-malloc.obj `if test -f 'libc/sys/hermit/malloc.c'; then $(CYGPATH_W) 'libc/sys/hermit/malloc.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/malloc.c'; fi` -libc/sys/hermit/a-isatty.obj: libc/sys/hermit/isatty.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-isatty.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-isatty.Tpo -c -o libc/sys/hermit/a-isatty.obj `if test -f 'libc/sys/hermit/isatty.c'; then $(CYGPATH_W) 'libc/sys/hermit/isatty.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/isatty.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-isatty.Tpo libc/sys/hermit/$(DEPDIR)/a-isatty.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/isatty.c' object='libc/sys/hermit/a-isatty.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-misc.o: libc/sys/hermit/misc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-misc.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-misc.Tpo -c -o libc/sys/hermit/a-misc.o `test -f 'libc/sys/hermit/misc.c' || echo '$(srcdir)/'`libc/sys/hermit/misc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-misc.Tpo libc/sys/hermit/$(DEPDIR)/a-misc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/misc.c' object='libc/sys/hermit/a-misc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-isatty.obj `if test -f 'libc/sys/hermit/isatty.c'; then $(CYGPATH_W) 'libc/sys/hermit/isatty.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/isatty.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-misc.o `test -f 'libc/sys/hermit/misc.c' || echo '$(srcdir)/'`libc/sys/hermit/misc.c -libc/sys/hermit/a-kill.o: libc/sys/hermit/kill.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-kill.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-kill.Tpo -c -o libc/sys/hermit/a-kill.o `test -f 'libc/sys/hermit/kill.c' || echo '$(srcdir)/'`libc/sys/hermit/kill.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-kill.Tpo libc/sys/hermit/$(DEPDIR)/a-kill.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/kill.c' object='libc/sys/hermit/a-kill.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-misc.obj: libc/sys/hermit/misc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-misc.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-misc.Tpo -c -o libc/sys/hermit/a-misc.obj `if test -f 'libc/sys/hermit/misc.c'; then $(CYGPATH_W) 'libc/sys/hermit/misc.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/misc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-misc.Tpo libc/sys/hermit/$(DEPDIR)/a-misc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/misc.c' object='libc/sys/hermit/a-misc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-kill.o `test -f 'libc/sys/hermit/kill.c' || echo '$(srcdir)/'`libc/sys/hermit/kill.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-misc.obj `if test -f 'libc/sys/hermit/misc.c'; then $(CYGPATH_W) 'libc/sys/hermit/misc.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/misc.c'; fi` -libc/sys/hermit/a-kill.obj: libc/sys/hermit/kill.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-kill.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-kill.Tpo -c -o libc/sys/hermit/a-kill.obj `if test -f 'libc/sys/hermit/kill.c'; then $(CYGPATH_W) 'libc/sys/hermit/kill.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/kill.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-kill.Tpo libc/sys/hermit/$(DEPDIR)/a-kill.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/kill.c' object='libc/sys/hermit/a-kill.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-mman.o: libc/sys/hermit/mman.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-mman.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-mman.Tpo -c -o libc/sys/hermit/a-mman.o `test -f 'libc/sys/hermit/mman.c' || echo '$(srcdir)/'`libc/sys/hermit/mman.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-mman.Tpo libc/sys/hermit/$(DEPDIR)/a-mman.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/mman.c' object='libc/sys/hermit/a-mman.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-kill.obj `if test -f 'libc/sys/hermit/kill.c'; then $(CYGPATH_W) 'libc/sys/hermit/kill.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/kill.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-mman.o `test -f 'libc/sys/hermit/mman.c' || echo '$(srcdir)/'`libc/sys/hermit/mman.c -libc/sys/hermit/a-link.o: libc/sys/hermit/link.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-link.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-link.Tpo -c -o libc/sys/hermit/a-link.o `test -f 'libc/sys/hermit/link.c' || echo '$(srcdir)/'`libc/sys/hermit/link.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-link.Tpo libc/sys/hermit/$(DEPDIR)/a-link.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/link.c' object='libc/sys/hermit/a-link.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-mman.obj: libc/sys/hermit/mman.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-mman.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-mman.Tpo -c -o libc/sys/hermit/a-mman.obj `if test -f 'libc/sys/hermit/mman.c'; then $(CYGPATH_W) 'libc/sys/hermit/mman.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/mman.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-mman.Tpo libc/sys/hermit/$(DEPDIR)/a-mman.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/mman.c' object='libc/sys/hermit/a-mman.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-link.o `test -f 'libc/sys/hermit/link.c' || echo '$(srcdir)/'`libc/sys/hermit/link.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-mman.obj `if test -f 'libc/sys/hermit/mman.c'; then $(CYGPATH_W) 'libc/sys/hermit/mman.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/mman.c'; fi` -libc/sys/hermit/a-link.obj: libc/sys/hermit/link.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-link.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-link.Tpo -c -o libc/sys/hermit/a-link.obj `if test -f 'libc/sys/hermit/link.c'; then $(CYGPATH_W) 'libc/sys/hermit/link.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/link.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-link.Tpo libc/sys/hermit/$(DEPDIR)/a-link.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/link.c' object='libc/sys/hermit/a-link.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-network.o: libc/sys/hermit/network.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-network.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-network.Tpo -c -o libc/sys/hermit/a-network.o `test -f 'libc/sys/hermit/network.c' || echo '$(srcdir)/'`libc/sys/hermit/network.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-network.Tpo libc/sys/hermit/$(DEPDIR)/a-network.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/network.c' object='libc/sys/hermit/a-network.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-link.obj `if test -f 'libc/sys/hermit/link.c'; then $(CYGPATH_W) 'libc/sys/hermit/link.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/link.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-network.o `test -f 'libc/sys/hermit/network.c' || echo '$(srcdir)/'`libc/sys/hermit/network.c -libc/sys/hermit/a-lseek.o: libc/sys/hermit/lseek.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-lseek.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-lseek.Tpo -c -o libc/sys/hermit/a-lseek.o `test -f 'libc/sys/hermit/lseek.c' || echo '$(srcdir)/'`libc/sys/hermit/lseek.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-lseek.Tpo libc/sys/hermit/$(DEPDIR)/a-lseek.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/lseek.c' object='libc/sys/hermit/a-lseek.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-network.obj: libc/sys/hermit/network.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-network.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-network.Tpo -c -o libc/sys/hermit/a-network.obj `if test -f 'libc/sys/hermit/network.c'; then $(CYGPATH_W) 'libc/sys/hermit/network.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/network.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-network.Tpo libc/sys/hermit/$(DEPDIR)/a-network.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/network.c' object='libc/sys/hermit/a-network.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-lseek.o `test -f 'libc/sys/hermit/lseek.c' || echo '$(srcdir)/'`libc/sys/hermit/lseek.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-network.obj `if test -f 'libc/sys/hermit/network.c'; then $(CYGPATH_W) 'libc/sys/hermit/network.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/network.c'; fi` -libc/sys/hermit/a-lseek.obj: libc/sys/hermit/lseek.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-lseek.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-lseek.Tpo -c -o libc/sys/hermit/a-lseek.obj `if test -f 'libc/sys/hermit/lseek.c'; then $(CYGPATH_W) 'libc/sys/hermit/lseek.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/lseek.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-lseek.Tpo libc/sys/hermit/$(DEPDIR)/a-lseek.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/lseek.c' object='libc/sys/hermit/a-lseek.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-process.o: libc/sys/hermit/process.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-process.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-process.Tpo -c -o libc/sys/hermit/a-process.o `test -f 'libc/sys/hermit/process.c' || echo '$(srcdir)/'`libc/sys/hermit/process.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-process.Tpo libc/sys/hermit/$(DEPDIR)/a-process.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/process.c' object='libc/sys/hermit/a-process.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-lseek.obj `if test -f 'libc/sys/hermit/lseek.c'; then $(CYGPATH_W) 'libc/sys/hermit/lseek.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/lseek.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-process.o `test -f 'libc/sys/hermit/process.c' || echo '$(srcdir)/'`libc/sys/hermit/process.c -libc/sys/hermit/a-nanosleep.o: libc/sys/hermit/nanosleep.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-nanosleep.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-nanosleep.Tpo -c -o libc/sys/hermit/a-nanosleep.o `test -f 'libc/sys/hermit/nanosleep.c' || echo '$(srcdir)/'`libc/sys/hermit/nanosleep.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-nanosleep.Tpo libc/sys/hermit/$(DEPDIR)/a-nanosleep.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/nanosleep.c' object='libc/sys/hermit/a-nanosleep.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-process.obj: libc/sys/hermit/process.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-process.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-process.Tpo -c -o libc/sys/hermit/a-process.obj `if test -f 'libc/sys/hermit/process.c'; then $(CYGPATH_W) 'libc/sys/hermit/process.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/process.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-process.Tpo libc/sys/hermit/$(DEPDIR)/a-process.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/process.c' object='libc/sys/hermit/a-process.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-nanosleep.o `test -f 'libc/sys/hermit/nanosleep.c' || echo '$(srcdir)/'`libc/sys/hermit/nanosleep.c - -libc/sys/hermit/a-nanosleep.obj: libc/sys/hermit/nanosleep.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-nanosleep.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-nanosleep.Tpo -c -o libc/sys/hermit/a-nanosleep.obj `if test -f 'libc/sys/hermit/nanosleep.c'; then $(CYGPATH_W) 'libc/sys/hermit/nanosleep.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/nanosleep.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-nanosleep.Tpo libc/sys/hermit/$(DEPDIR)/a-nanosleep.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/nanosleep.c' object='libc/sys/hermit/a-nanosleep.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-nanosleep.obj `if test -f 'libc/sys/hermit/nanosleep.c'; then $(CYGPATH_W) 'libc/sys/hermit/nanosleep.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/nanosleep.c'; fi` - -libc/sys/hermit/a-open.o: libc/sys/hermit/open.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-open.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-open.Tpo -c -o libc/sys/hermit/a-open.o `test -f 'libc/sys/hermit/open.c' || echo '$(srcdir)/'`libc/sys/hermit/open.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-open.Tpo libc/sys/hermit/$(DEPDIR)/a-open.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/open.c' object='libc/sys/hermit/a-open.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-open.o `test -f 'libc/sys/hermit/open.c' || echo '$(srcdir)/'`libc/sys/hermit/open.c - -libc/sys/hermit/a-open.obj: libc/sys/hermit/open.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-open.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-open.Tpo -c -o libc/sys/hermit/a-open.obj `if test -f 'libc/sys/hermit/open.c'; then $(CYGPATH_W) 'libc/sys/hermit/open.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/open.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-open.Tpo libc/sys/hermit/$(DEPDIR)/a-open.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/open.c' object='libc/sys/hermit/a-open.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-open.obj `if test -f 'libc/sys/hermit/open.c'; then $(CYGPATH_W) 'libc/sys/hermit/open.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/open.c'; fi` - -libc/sys/hermit/a-read.o: libc/sys/hermit/read.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-read.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-read.Tpo -c -o libc/sys/hermit/a-read.o `test -f 'libc/sys/hermit/read.c' || echo '$(srcdir)/'`libc/sys/hermit/read.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-read.Tpo libc/sys/hermit/$(DEPDIR)/a-read.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/read.c' object='libc/sys/hermit/a-read.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-read.o `test -f 'libc/sys/hermit/read.c' || echo '$(srcdir)/'`libc/sys/hermit/read.c - -libc/sys/hermit/a-read.obj: libc/sys/hermit/read.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-read.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-read.Tpo -c -o libc/sys/hermit/a-read.obj `if test -f 'libc/sys/hermit/read.c'; then $(CYGPATH_W) 'libc/sys/hermit/read.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/read.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-read.Tpo libc/sys/hermit/$(DEPDIR)/a-read.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/read.c' object='libc/sys/hermit/a-read.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-read.obj `if test -f 'libc/sys/hermit/read.c'; then $(CYGPATH_W) 'libc/sys/hermit/read.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/read.c'; fi` - -libc/sys/hermit/a-readlink.o: libc/sys/hermit/readlink.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-readlink.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-readlink.Tpo -c -o libc/sys/hermit/a-readlink.o `test -f 'libc/sys/hermit/readlink.c' || echo '$(srcdir)/'`libc/sys/hermit/readlink.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-readlink.Tpo libc/sys/hermit/$(DEPDIR)/a-readlink.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/readlink.c' object='libc/sys/hermit/a-readlink.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-readlink.o `test -f 'libc/sys/hermit/readlink.c' || echo '$(srcdir)/'`libc/sys/hermit/readlink.c - -libc/sys/hermit/a-readlink.obj: libc/sys/hermit/readlink.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-readlink.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-readlink.Tpo -c -o libc/sys/hermit/a-readlink.obj `if test -f 'libc/sys/hermit/readlink.c'; then $(CYGPATH_W) 'libc/sys/hermit/readlink.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/readlink.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-readlink.Tpo libc/sys/hermit/$(DEPDIR)/a-readlink.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/readlink.c' object='libc/sys/hermit/a-readlink.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-readlink.obj `if test -f 'libc/sys/hermit/readlink.c'; then $(CYGPATH_W) 'libc/sys/hermit/readlink.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/readlink.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-process.obj `if test -f 'libc/sys/hermit/process.c'; then $(CYGPATH_W) 'libc/sys/hermit/process.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/process.c'; fi` libc/sys/hermit/a-sbrk.o: libc/sys/hermit/sbrk.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-sbrk.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-sbrk.Tpo -c -o libc/sys/hermit/a-sbrk.o `test -f 'libc/sys/hermit/sbrk.c' || echo '$(srcdir)/'`libc/sys/hermit/sbrk.c @@ -34756,33 +34544,19 @@ libc/sys/hermit/a-sched.obj: libc/sys/hermit/sched.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-sched.obj `if test -f 'libc/sys/hermit/sched.c'; then $(CYGPATH_W) 'libc/sys/hermit/sched.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/sched.c'; fi` -libc/sys/hermit/a-setitimer.o: libc/sys/hermit/setitimer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-setitimer.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-setitimer.Tpo -c -o libc/sys/hermit/a-setitimer.o `test -f 'libc/sys/hermit/setitimer.c' || echo '$(srcdir)/'`libc/sys/hermit/setitimer.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-setitimer.Tpo libc/sys/hermit/$(DEPDIR)/a-setitimer.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/setitimer.c' object='libc/sys/hermit/a-setitimer.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-setitimer.o `test -f 'libc/sys/hermit/setitimer.c' || echo '$(srcdir)/'`libc/sys/hermit/setitimer.c - -libc/sys/hermit/a-setitimer.obj: libc/sys/hermit/setitimer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-setitimer.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-setitimer.Tpo -c -o libc/sys/hermit/a-setitimer.obj `if test -f 'libc/sys/hermit/setitimer.c'; then $(CYGPATH_W) 'libc/sys/hermit/setitimer.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/setitimer.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-setitimer.Tpo libc/sys/hermit/$(DEPDIR)/a-setitimer.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/setitimer.c' object='libc/sys/hermit/a-setitimer.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-select.o: libc/sys/hermit/select.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-select.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-select.Tpo -c -o libc/sys/hermit/a-select.o `test -f 'libc/sys/hermit/select.c' || echo '$(srcdir)/'`libc/sys/hermit/select.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-select.Tpo libc/sys/hermit/$(DEPDIR)/a-select.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/select.c' object='libc/sys/hermit/a-select.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-setitimer.obj `if test -f 'libc/sys/hermit/setitimer.c'; then $(CYGPATH_W) 'libc/sys/hermit/setitimer.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/setitimer.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-select.o `test -f 'libc/sys/hermit/select.c' || echo '$(srcdir)/'`libc/sys/hermit/select.c -libc/sys/hermit/a-signal.o: libc/sys/hermit/signal.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-signal.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-signal.Tpo -c -o libc/sys/hermit/a-signal.o `test -f 'libc/sys/hermit/signal.c' || echo '$(srcdir)/'`libc/sys/hermit/signal.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-signal.Tpo libc/sys/hermit/$(DEPDIR)/a-signal.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/signal.c' object='libc/sys/hermit/a-signal.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-select.obj: libc/sys/hermit/select.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-select.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-select.Tpo -c -o libc/sys/hermit/a-select.obj `if test -f 'libc/sys/hermit/select.c'; then $(CYGPATH_W) 'libc/sys/hermit/select.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/select.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-select.Tpo libc/sys/hermit/$(DEPDIR)/a-select.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/select.c' object='libc/sys/hermit/a-select.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-signal.o `test -f 'libc/sys/hermit/signal.c' || echo '$(srcdir)/'`libc/sys/hermit/signal.c - -libc/sys/hermit/a-signal.obj: libc/sys/hermit/signal.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-signal.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-signal.Tpo -c -o libc/sys/hermit/a-signal.obj `if test -f 'libc/sys/hermit/signal.c'; then $(CYGPATH_W) 'libc/sys/hermit/signal.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/signal.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-signal.Tpo libc/sys/hermit/$(DEPDIR)/a-signal.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/signal.c' object='libc/sys/hermit/a-signal.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-signal.obj `if test -f 'libc/sys/hermit/signal.c'; then $(CYGPATH_W) 'libc/sys/hermit/signal.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/signal.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-select.obj `if test -f 'libc/sys/hermit/select.c'; then $(CYGPATH_W) 'libc/sys/hermit/select.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/select.c'; fi` libc/sys/hermit/a-stat.o: libc/sys/hermit/stat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-stat.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-stat.Tpo -c -o libc/sys/hermit/a-stat.o `test -f 'libc/sys/hermit/stat.c' || echo '$(srcdir)/'`libc/sys/hermit/stat.c @@ -34798,117 +34572,33 @@ libc/sys/hermit/a-stat.obj: libc/sys/hermit/stat.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-stat.obj `if test -f 'libc/sys/hermit/stat.c'; then $(CYGPATH_W) 'libc/sys/hermit/stat.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/stat.c'; fi` -libc/sys/hermit/a-symlink.o: libc/sys/hermit/symlink.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-symlink.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-symlink.Tpo -c -o libc/sys/hermit/a-symlink.o `test -f 'libc/sys/hermit/symlink.c' || echo '$(srcdir)/'`libc/sys/hermit/symlink.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-symlink.Tpo libc/sys/hermit/$(DEPDIR)/a-symlink.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/symlink.c' object='libc/sys/hermit/a-symlink.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-symlink.o `test -f 'libc/sys/hermit/symlink.c' || echo '$(srcdir)/'`libc/sys/hermit/symlink.c - -libc/sys/hermit/a-symlink.obj: libc/sys/hermit/symlink.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-symlink.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-symlink.Tpo -c -o libc/sys/hermit/a-symlink.obj `if test -f 'libc/sys/hermit/symlink.c'; then $(CYGPATH_W) 'libc/sys/hermit/symlink.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/symlink.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-symlink.Tpo libc/sys/hermit/$(DEPDIR)/a-symlink.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/symlink.c' object='libc/sys/hermit/a-symlink.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-symlink.obj `if test -f 'libc/sys/hermit/symlink.c'; then $(CYGPATH_W) 'libc/sys/hermit/symlink.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/symlink.c'; fi` - -libc/sys/hermit/a-sysconf.o: libc/sys/hermit/sysconf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-sysconf.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-sysconf.Tpo -c -o libc/sys/hermit/a-sysconf.o `test -f 'libc/sys/hermit/sysconf.c' || echo '$(srcdir)/'`libc/sys/hermit/sysconf.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-sysconf.Tpo libc/sys/hermit/$(DEPDIR)/a-sysconf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/sysconf.c' object='libc/sys/hermit/a-sysconf.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-sysconf.o `test -f 'libc/sys/hermit/sysconf.c' || echo '$(srcdir)/'`libc/sys/hermit/sysconf.c - -libc/sys/hermit/a-sysconf.obj: libc/sys/hermit/sysconf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-sysconf.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-sysconf.Tpo -c -o libc/sys/hermit/a-sysconf.obj `if test -f 'libc/sys/hermit/sysconf.c'; then $(CYGPATH_W) 'libc/sys/hermit/sysconf.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/sysconf.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-sysconf.Tpo libc/sys/hermit/$(DEPDIR)/a-sysconf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/sysconf.c' object='libc/sys/hermit/a-sysconf.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-sysconf.obj `if test -f 'libc/sys/hermit/sysconf.c'; then $(CYGPATH_W) 'libc/sys/hermit/sysconf.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/sysconf.c'; fi` - -libc/sys/hermit/a-times.o: libc/sys/hermit/times.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-times.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-times.Tpo -c -o libc/sys/hermit/a-times.o `test -f 'libc/sys/hermit/times.c' || echo '$(srcdir)/'`libc/sys/hermit/times.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-times.Tpo libc/sys/hermit/$(DEPDIR)/a-times.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/times.c' object='libc/sys/hermit/a-times.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-times.o `test -f 'libc/sys/hermit/times.c' || echo '$(srcdir)/'`libc/sys/hermit/times.c - -libc/sys/hermit/a-times.obj: libc/sys/hermit/times.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-times.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-times.Tpo -c -o libc/sys/hermit/a-times.obj `if test -f 'libc/sys/hermit/times.c'; then $(CYGPATH_W) 'libc/sys/hermit/times.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/times.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-times.Tpo libc/sys/hermit/$(DEPDIR)/a-times.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/times.c' object='libc/sys/hermit/a-times.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-times.obj `if test -f 'libc/sys/hermit/times.c'; then $(CYGPATH_W) 'libc/sys/hermit/times.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/times.c'; fi` - -libc/sys/hermit/a-unlink.o: libc/sys/hermit/unlink.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-unlink.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-unlink.Tpo -c -o libc/sys/hermit/a-unlink.o `test -f 'libc/sys/hermit/unlink.c' || echo '$(srcdir)/'`libc/sys/hermit/unlink.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-unlink.Tpo libc/sys/hermit/$(DEPDIR)/a-unlink.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/unlink.c' object='libc/sys/hermit/a-unlink.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-unlink.o `test -f 'libc/sys/hermit/unlink.c' || echo '$(srcdir)/'`libc/sys/hermit/unlink.c - -libc/sys/hermit/a-unlink.obj: libc/sys/hermit/unlink.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-unlink.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-unlink.Tpo -c -o libc/sys/hermit/a-unlink.obj `if test -f 'libc/sys/hermit/unlink.c'; then $(CYGPATH_W) 'libc/sys/hermit/unlink.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/unlink.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-unlink.Tpo libc/sys/hermit/$(DEPDIR)/a-unlink.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/unlink.c' object='libc/sys/hermit/a-unlink.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-unlink.obj `if test -f 'libc/sys/hermit/unlink.c'; then $(CYGPATH_W) 'libc/sys/hermit/unlink.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/unlink.c'; fi` - -libc/sys/hermit/a-wait.o: libc/sys/hermit/wait.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-wait.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-wait.Tpo -c -o libc/sys/hermit/a-wait.o `test -f 'libc/sys/hermit/wait.c' || echo '$(srcdir)/'`libc/sys/hermit/wait.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-wait.Tpo libc/sys/hermit/$(DEPDIR)/a-wait.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/wait.c' object='libc/sys/hermit/a-wait.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-wait.o `test -f 'libc/sys/hermit/wait.c' || echo '$(srcdir)/'`libc/sys/hermit/wait.c - -libc/sys/hermit/a-wait.obj: libc/sys/hermit/wait.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-wait.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-wait.Tpo -c -o libc/sys/hermit/a-wait.obj `if test -f 'libc/sys/hermit/wait.c'; then $(CYGPATH_W) 'libc/sys/hermit/wait.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/wait.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-wait.Tpo libc/sys/hermit/$(DEPDIR)/a-wait.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/wait.c' object='libc/sys/hermit/a-wait.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-wait.obj `if test -f 'libc/sys/hermit/wait.c'; then $(CYGPATH_W) 'libc/sys/hermit/wait.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/wait.c'; fi` - -libc/sys/hermit/a-write.o: libc/sys/hermit/write.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-write.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-write.Tpo -c -o libc/sys/hermit/a-write.o `test -f 'libc/sys/hermit/write.c' || echo '$(srcdir)/'`libc/sys/hermit/write.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-write.Tpo libc/sys/hermit/$(DEPDIR)/a-write.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/write.c' object='libc/sys/hermit/a-write.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-write.o `test -f 'libc/sys/hermit/write.c' || echo '$(srcdir)/'`libc/sys/hermit/write.c - -libc/sys/hermit/a-write.obj: libc/sys/hermit/write.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-write.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-write.Tpo -c -o libc/sys/hermit/a-write.obj `if test -f 'libc/sys/hermit/write.c'; then $(CYGPATH_W) 'libc/sys/hermit/write.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/write.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-write.Tpo libc/sys/hermit/$(DEPDIR)/a-write.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/write.c' object='libc/sys/hermit/a-write.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-write.obj `if test -f 'libc/sys/hermit/write.c'; then $(CYGPATH_W) 'libc/sys/hermit/write.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/write.c'; fi` - -libc/sys/hermit/a-makecontext.o: libc/sys/hermit/makecontext.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-makecontext.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-makecontext.Tpo -c -o libc/sys/hermit/a-makecontext.o `test -f 'libc/sys/hermit/makecontext.c' || echo '$(srcdir)/'`libc/sys/hermit/makecontext.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-makecontext.Tpo libc/sys/hermit/$(DEPDIR)/a-makecontext.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/makecontext.c' object='libc/sys/hermit/a-makecontext.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-time.o: libc/sys/hermit/time.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-time.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-time.Tpo -c -o libc/sys/hermit/a-time.o `test -f 'libc/sys/hermit/time.c' || echo '$(srcdir)/'`libc/sys/hermit/time.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-time.Tpo libc/sys/hermit/$(DEPDIR)/a-time.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/time.c' object='libc/sys/hermit/a-time.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-makecontext.o `test -f 'libc/sys/hermit/makecontext.c' || echo '$(srcdir)/'`libc/sys/hermit/makecontext.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-time.o `test -f 'libc/sys/hermit/time.c' || echo '$(srcdir)/'`libc/sys/hermit/time.c -libc/sys/hermit/a-makecontext.obj: libc/sys/hermit/makecontext.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-makecontext.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-makecontext.Tpo -c -o libc/sys/hermit/a-makecontext.obj `if test -f 'libc/sys/hermit/makecontext.c'; then $(CYGPATH_W) 'libc/sys/hermit/makecontext.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/makecontext.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-makecontext.Tpo libc/sys/hermit/$(DEPDIR)/a-makecontext.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/makecontext.c' object='libc/sys/hermit/a-makecontext.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-time.obj: libc/sys/hermit/time.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-time.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-time.Tpo -c -o libc/sys/hermit/a-time.obj `if test -f 'libc/sys/hermit/time.c'; then $(CYGPATH_W) 'libc/sys/hermit/time.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/time.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-time.Tpo libc/sys/hermit/$(DEPDIR)/a-time.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/time.c' object='libc/sys/hermit/a-time.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-makecontext.obj `if test -f 'libc/sys/hermit/makecontext.c'; then $(CYGPATH_W) 'libc/sys/hermit/makecontext.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/makecontext.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-time.obj `if test -f 'libc/sys/hermit/time.c'; then $(CYGPATH_W) 'libc/sys/hermit/time.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/time.c'; fi` -libc/sys/hermit/a-inet_ntoa.o: libc/sys/hermit/inet_ntoa.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-inet_ntoa.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-inet_ntoa.Tpo -c -o libc/sys/hermit/a-inet_ntoa.o `test -f 'libc/sys/hermit/inet_ntoa.c' || echo '$(srcdir)/'`libc/sys/hermit/inet_ntoa.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-inet_ntoa.Tpo libc/sys/hermit/$(DEPDIR)/a-inet_ntoa.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/inet_ntoa.c' object='libc/sys/hermit/a-inet_ntoa.o' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-unistd.o: libc/sys/hermit/unistd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-unistd.o -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-unistd.Tpo -c -o libc/sys/hermit/a-unistd.o `test -f 'libc/sys/hermit/unistd.c' || echo '$(srcdir)/'`libc/sys/hermit/unistd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-unistd.Tpo libc/sys/hermit/$(DEPDIR)/a-unistd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/unistd.c' object='libc/sys/hermit/a-unistd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-inet_ntoa.o `test -f 'libc/sys/hermit/inet_ntoa.c' || echo '$(srcdir)/'`libc/sys/hermit/inet_ntoa.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-unistd.o `test -f 'libc/sys/hermit/unistd.c' || echo '$(srcdir)/'`libc/sys/hermit/unistd.c -libc/sys/hermit/a-inet_ntoa.obj: libc/sys/hermit/inet_ntoa.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-inet_ntoa.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-inet_ntoa.Tpo -c -o libc/sys/hermit/a-inet_ntoa.obj `if test -f 'libc/sys/hermit/inet_ntoa.c'; then $(CYGPATH_W) 'libc/sys/hermit/inet_ntoa.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/inet_ntoa.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-inet_ntoa.Tpo libc/sys/hermit/$(DEPDIR)/a-inet_ntoa.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/inet_ntoa.c' object='libc/sys/hermit/a-inet_ntoa.obj' libtool=no @AMDEPBACKSLASH@ +libc/sys/hermit/a-unistd.obj: libc/sys/hermit/unistd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/sys/hermit/a-unistd.obj -MD -MP -MF libc/sys/hermit/$(DEPDIR)/a-unistd.Tpo -c -o libc/sys/hermit/a-unistd.obj `if test -f 'libc/sys/hermit/unistd.c'; then $(CYGPATH_W) 'libc/sys/hermit/unistd.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/unistd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/sys/hermit/$(DEPDIR)/a-unistd.Tpo libc/sys/hermit/$(DEPDIR)/a-unistd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/sys/hermit/unistd.c' object='libc/sys/hermit/a-unistd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-inet_ntoa.obj `if test -f 'libc/sys/hermit/inet_ntoa.c'; then $(CYGPATH_W) 'libc/sys/hermit/inet_ntoa.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/inet_ntoa.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/sys/hermit/a-unistd.obj `if test -f 'libc/sys/hermit/unistd.c'; then $(CYGPATH_W) 'libc/sys/hermit/unistd.c'; else $(CYGPATH_W) '$(srcdir)/libc/sys/hermit/unistd.c'; fi` libc/machine/aarch64/a-memchr-stub.o: libc/machine/aarch64/memchr-stub.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/aarch64/a-memchr-stub.o -MD -MP -MF libc/machine/aarch64/$(DEPDIR)/a-memchr-stub.Tpo -c -o libc/machine/aarch64/a-memchr-stub.o `test -f 'libc/machine/aarch64/memchr-stub.c' || echo '$(srcdir)/'`libc/machine/aarch64/memchr-stub.c @@ -50941,6 +50631,10 @@ distclean-generic: -rm -f libc/sys/h8500hms/$(am__dirstamp) -rm -f libc/sys/hermit/$(DEPDIR)/$(am__dirstamp) -rm -f libc/sys/hermit/$(am__dirstamp) + -rm -f libc/sys/hermit/signal/$(DEPDIR)/$(am__dirstamp) + -rm -f libc/sys/hermit/signal/$(am__dirstamp) + -rm -f libc/sys/hermit/stdio/$(DEPDIR)/$(am__dirstamp) + -rm -f libc/sys/hermit/stdio/$(am__dirstamp) -rm -f libc/sys/m88kbug/$(DEPDIR)/$(am__dirstamp) -rm -f libc/sys/m88kbug/$(am__dirstamp) -rm -f libc/sys/mmixware/$(DEPDIR)/$(am__dirstamp) @@ -52241,43 +51935,27 @@ distclean: distclean-am -rm -f libc/sys/h8300hms/$(DEPDIR)/a-write.Po -rm -f libc/sys/h8500hms/$(DEPDIR)/a-misc.Po -rm -f libc/sys/h8500hms/$(DEPDIR)/a-syscalls.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-_exit.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-chown.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-clock_getres.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-clock_gettime.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-clock_nanosleep.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-clock_settime.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-close.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-context.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-environ.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-errno.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-execve.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-fork.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-fstat.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-getpagesize.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-getpid.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-gettod.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-inet_ntoa.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-isatty.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-kill.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-link.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-lseek.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-makecontext.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-nanosleep.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-open.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-read.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-readlink.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-conf.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-dirent.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-env.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-fcntl.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-ldso.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-malloc.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-misc.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-mman.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-network.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-process.Po -rm -f libc/sys/hermit/$(DEPDIR)/a-sbrk.Po -rm -f libc/sys/hermit/$(DEPDIR)/a-sched.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-setitimer.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-signal.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-select.Po -rm -f libc/sys/hermit/$(DEPDIR)/a-stat.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-symlink.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-sysconf.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-times.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-unlink.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-wait.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-write.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-time.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-unistd.Po + -rm -f libc/sys/hermit/signal/$(DEPDIR)/a-kill.Po + -rm -f libc/sys/hermit/signal/$(DEPDIR)/a-sigaction.Po + -rm -f libc/sys/hermit/signal/$(DEPDIR)/a-sigprocmask.Po + -rm -f libc/sys/hermit/signal/$(DEPDIR)/a-sigtimedwait.Po + -rm -f libc/sys/hermit/stdio/$(DEPDIR)/a-rename.Po -rm -f libc/sys/m88kbug/$(DEPDIR)/a-syscalls.Po -rm -f libc/sys/mmixware/$(DEPDIR)/a-_exit.Po -rm -f libc/sys/mmixware/$(DEPDIR)/a-access.Po @@ -54862,43 +54540,27 @@ maintainer-clean: maintainer-clean-am -rm -f libc/sys/h8300hms/$(DEPDIR)/a-write.Po -rm -f libc/sys/h8500hms/$(DEPDIR)/a-misc.Po -rm -f libc/sys/h8500hms/$(DEPDIR)/a-syscalls.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-_exit.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-chown.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-clock_getres.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-clock_gettime.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-clock_nanosleep.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-clock_settime.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-close.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-context.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-environ.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-errno.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-execve.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-fork.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-fstat.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-getpagesize.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-getpid.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-gettod.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-inet_ntoa.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-isatty.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-kill.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-link.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-lseek.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-makecontext.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-nanosleep.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-open.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-read.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-readlink.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-conf.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-dirent.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-env.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-fcntl.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-ldso.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-malloc.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-misc.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-mman.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-network.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-process.Po -rm -f libc/sys/hermit/$(DEPDIR)/a-sbrk.Po -rm -f libc/sys/hermit/$(DEPDIR)/a-sched.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-setitimer.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-signal.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-select.Po -rm -f libc/sys/hermit/$(DEPDIR)/a-stat.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-symlink.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-sysconf.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-times.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-unlink.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-wait.Po - -rm -f libc/sys/hermit/$(DEPDIR)/a-write.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-time.Po + -rm -f libc/sys/hermit/$(DEPDIR)/a-unistd.Po + -rm -f libc/sys/hermit/signal/$(DEPDIR)/a-kill.Po + -rm -f libc/sys/hermit/signal/$(DEPDIR)/a-sigaction.Po + -rm -f libc/sys/hermit/signal/$(DEPDIR)/a-sigprocmask.Po + -rm -f libc/sys/hermit/signal/$(DEPDIR)/a-sigtimedwait.Po + -rm -f libc/sys/hermit/stdio/$(DEPDIR)/a-rename.Po -rm -f libc/sys/m88kbug/$(DEPDIR)/a-syscalls.Po -rm -f libc/sys/mmixware/$(DEPDIR)/a-_exit.Po -rm -f libc/sys/mmixware/$(DEPDIR)/a-access.Po diff --git a/newlib/configure.host b/newlib/configure.host index ed176c197b..7b02616e46 100644 --- a/newlib/configure.host +++ b/newlib/configure.host @@ -595,8 +595,8 @@ case "${host}" in syscall_dir=syscalls ;; *-*-hermit*) - newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED -D__DYNAMIC_REENT__ -DSIGNAL_PROVIDED -DHAVE_NANOSLEEP -DMALLOC_PROVIDED" -+ ;; + newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED -D__DYNAMIC_REENT__ -DHAVE_NANOSLEEP -DMALLOC_PROVIDED" + ;; # RTEMS supplies its own versions of some routines: # malloc() (reentrant version) # exit() RTEMS has a "global" reent to flush diff --git a/newlib/libc/include/sys/_timespec.h b/newlib/libc/include/sys/_timespec.h index f810b008fd..1167c6b9ec 100644 --- a/newlib/libc/include/sys/_timespec.h +++ b/newlib/libc/include/sys/_timespec.h @@ -44,9 +44,12 @@ typedef _TIME_T_ time_t; #define _TIME_T_DECLARED #endif +#if !defined(_TIMESPEC_DECLARED) struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* and nanoseconds */ }; +#define _TIMESPEC_DECLARED +#endif #endif /* !_SYS__TIMESPEC_H_ */ diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h index d1112d5d10..63ac2bd9b2 100644 --- a/newlib/libc/include/sys/_types.h +++ b/newlib/libc/include/sys/_types.h @@ -189,8 +189,12 @@ typedef _CLOCK_T_ __clock_t; typedef _TIME_T_ __time_t; #ifndef __machine_clockid_t_defined +#if defined(__hermit__) +#define _CLOCKID_T_ int +#else #define _CLOCKID_T_ unsigned long #endif +#endif typedef _CLOCKID_T_ __clockid_t; diff --git a/newlib/libc/include/sys/select.h b/newlib/libc/include/sys/select.h index cf7e51eb25..93d0b79bf2 100644 --- a/newlib/libc/include/sys/select.h +++ b/newlib/libc/include/sys/select.h @@ -8,7 +8,7 @@ includes the W32api winsock[2].h header must know what it is doing; it must not call the Cygwin select function. */ -# if !(defined (_WINSOCK_H) || defined(__hermit__) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) +# if !(defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) #include #include diff --git a/newlib/libc/include/sys/signal.h b/newlib/libc/include/sys/signal.h index 16f5ea25aa..354773eded 100644 --- a/newlib/libc/include/sys/signal.h +++ b/newlib/libc/include/sys/signal.h @@ -210,6 +210,8 @@ int sigwait (const sigset_t *, int *); #define sigemptyset(what) (*(what) = 0, 0) #define sigfillset(what) (*(what) = ~(0), 0) #define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0) +#define sigorset(dst, sig1, sig2) (*(dst) = (*(sig1) | *(sig2)), 0) +#define sigandset(dst, sig1, sig2) (*(dst) = (*(sig1) & *(sig2)), 0) #endif /* !__CYGWIN__ && !__rtems__ */ #endif /* __POSIX_VISIBLE */ diff --git a/newlib/libc/include/sys/stat.h b/newlib/libc/include/sys/stat.h index 98f5addb43..f22c549410 100644 --- a/newlib/libc/include/sys/stat.h +++ b/newlib/libc/include/sys/stat.h @@ -23,6 +23,8 @@ extern "C" { #ifdef _LIBC #define stat64 stat #endif +#elif defined(__hermit__) +#include #else struct stat { @@ -142,7 +144,7 @@ int mkfifo (const char *__path, mode_t __mode ); int stat (const char *__restrict __path, struct stat *__restrict __sbuf ); mode_t umask (mode_t __mask ); -#if defined (__SPU__) || defined(__rtems__) || defined(__CYGWIN__) +#if defined (__SPU__) || defined(__rtems__) || defined(__CYGWIN__) || defined(__hermit__) int lstat (const char *__restrict __path, struct stat *__restrict __buf ); int mknod (const char *__path, mode_t __mode, dev_t __dev ); #endif diff --git a/newlib/libc/sys/hermit/Makefile.inc b/newlib/libc/sys/hermit/Makefile.inc index 58d199aa26..5faffd138d 100644 --- a/newlib/libc/sys/hermit/Makefile.inc +++ b/newlib/libc/sys/hermit/Makefile.inc @@ -1,38 +1,22 @@ libc_a_SOURCES += \ - %D%/chown.c \ - %D%/clock_getres.c \ - %D%/clock_gettime.c \ - %D%/clock_nanosleep.c \ - %D%/clock_settime.c \ - %D%/close.c \ - %D%/environ.c \ - %D%/errno.c \ - %D%/execve.c \ - %D%/_exit.c \ - %D%/fork.c \ - %D%/fstat.c \ - %D%/getpagesize.c \ - %D%/getpid.c \ - %D%/gettod.c \ - %D%/isatty.c \ - %D%/kill.c \ - %D%/link.c \ - %D%/lseek.c \ - %D%/nanosleep.c \ - %D%/open.c \ - %D%/read.c \ - %D%/readlink.c \ + %D%/signal/kill.c \ + %D%/signal/sigaction.c \ + %D%/signal/sigprocmask.c \ + %D%/signal/sigtimedwait.c \ + %D%/stdio/rename.c \ + %D%/conf.c \ + %D%/dirent.c \ + %D%/env.c \ + %D%/fcntl.c \ + %D%/ldso.c \ + %D%/malloc.c \ + %D%/misc.c \ + %D%/mman.c \ + %D%/network.c \ + %D%/process.c \ %D%/sbrk.c \ %D%/sched.c \ - %D%/setitimer.c \ - %D%/signal.c \ + %D%/select.c \ %D%/stat.c \ - %D%/symlink.c \ - %D%/sysconf.c \ - %D%/times.c \ - %D%/unlink.c \ - %D%/wait.c \ - %D%/write.c \ - %D%/context.S \ - %D%/makecontext.c \ - %D%/inet_ntoa.c + %D%/time.c \ + %D%/unistd.c diff --git a/newlib/libc/sys/hermit/README.md b/newlib/libc/sys/hermit/README.md new file mode 100644 index 0000000000..bebff08ca0 --- /dev/null +++ b/newlib/libc/sys/hermit/README.md @@ -0,0 +1,9 @@ +# Hermit Newlib Port + +This directory contains all the system dependent code for the Hermit Newlib port. + +For the syscalls, see `syscall.h` in `include/hermit`. + +The port is based on some of Musl's libc files. The files are copied from the Musl libc +repository and modified to work with Newlib. All original files are referenced in the header +of the file. diff --git a/newlib/libc/sys/hermit/_exit.c b/newlib/libc/sys/hermit/_exit.c deleted file mode 100644 index c2a5c930f7..0000000000 --- a/newlib/libc/sys/hermit/_exit.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include "syscall.h" - -void -_exit (int rc) -{ - /* task exit */ - sys_exit(rc); - - /* Convince GCC that this function never returns. */ - for (;;) - ; -} diff --git a/newlib/libc/sys/hermit/chown.c b/newlib/libc/sys/hermit/chown.c deleted file mode 100644 index 36d37cf480..0000000000 --- a/newlib/libc/sys/hermit/chown.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include -#include "syscall.h" -#include "warning.h" - - -#if 0 -int -chown (const char* path, uid_t owner, gid_t group) -{ - return _chown_r(_REENT, path, owner, group); -} -#endif - -int -_chown_r (struct _reent* ptr, const char* path, uid_t owner, gid_t group) -{ - ptr->_errno = ENOSYS; - return -1; -} diff --git a/newlib/libc/sys/hermit/clock_getres.c b/newlib/libc/sys/hermit/clock_getres.c deleted file mode 100644 index 1dbe90a97c..0000000000 --- a/newlib/libc/sys/hermit/clock_getres.c +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2018 Colin Finck, RWTH Aachen University -// -// MIT License -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -#include -#include -#include "syscall.h" - -int -clock_getres (clockid_t clock_id, struct timespec* res) -{ - int ret = sys_clock_getres(clock_id, (HermitTimespec*)res); - if (ret < 0) - { - *__errno() = -ret; - return -1; - } - - return ret; -} diff --git a/newlib/libc/sys/hermit/clock_gettime.c b/newlib/libc/sys/hermit/clock_gettime.c deleted file mode 100644 index ee184c6703..0000000000 --- a/newlib/libc/sys/hermit/clock_gettime.c +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2018 Colin Finck, RWTH Aachen University -// -// MIT License -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -#include -#include -#include "syscall.h" - -int -clock_gettime (clockid_t clock_id, struct timespec* tp) -{ - int ret = sys_clock_gettime(clock_id, (HermitTimespec*)tp); - if (ret < 0) - { - *__errno() = -ret; - return -1; - } - - return ret; -} diff --git a/newlib/libc/sys/hermit/clock_nanosleep.c b/newlib/libc/sys/hermit/clock_nanosleep.c deleted file mode 100644 index 1e914045de..0000000000 --- a/newlib/libc/sys/hermit/clock_nanosleep.c +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2018 Colin Finck, RWTH Aachen University -// -// MIT License -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -#include -#include -#include "syscall.h" - -int -clock_nanosleep (clockid_t clock_id, int flags, const struct timespec* rqtp, struct timespec* rmtp) -{ - int ret = sys_clock_nanosleep(clock_id, flags, (const HermitTimespec*)rqtp, (HermitTimespec*)rmtp); - if (ret < 0) - { - *__errno() = -ret; - return -1; - } - - return ret; -} diff --git a/newlib/libc/sys/hermit/clock_settime.c b/newlib/libc/sys/hermit/clock_settime.c deleted file mode 100644 index 9ec9e7f3fd..0000000000 --- a/newlib/libc/sys/hermit/clock_settime.c +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2018 Colin Finck, RWTH Aachen University -// -// MIT License -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -#include -#include -#include "syscall.h" - -int -clock_settime (clockid_t clock_id, const struct timespec* tp) -{ - int ret = sys_clock_settime(clock_id, (const HermitTimespec*)tp); - if (ret < 0) - { - *__errno() = -ret; - return -1; - } - - return ret; -} diff --git a/newlib/libc/sys/hermit/close.c b/newlib/libc/sys/hermit/close.c deleted file mode 100644 index 5f34989582..0000000000 --- a/newlib/libc/sys/hermit/close.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include "syscall.h" -#include "warning.h" - -int -close (int fildes) -{ - return _close_r(_REENT, fildes); -} - -int -_close_r (struct _reent* ptr, int fildes) -{ - int ret; - - ret = sys_close(fildes); - if (ret < 0) { - ptr->_errno = -ret; - ret = -1; - } - - return ret; -} diff --git a/newlib/libc/sys/hermit/conf.c b/newlib/libc/sys/hermit/conf.c new file mode 100644 index 0000000000..1bcd6ab771 --- /dev/null +++ b/newlib/libc/sys/hermit/conf.c @@ -0,0 +1,100 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include + +long sysconf(int name) +{ + + switch (name) + { + case _SC_ARG_MAX: + return ARG_MAX; + case _SC_CLK_TCK: + return CLK_TCK; + case _SC_NPROCESSORS_CONF: + return sys_available_parallelism(); + case _SC_NPROCESSORS_ONLN: + return sys_available_parallelism(); + case _SC_PAGESIZE: + return sys_getpagesize(); + case _SC_PRIORITY_SCHEDULING: + return 1; + case _SC_TIMERS: + return 1; +#if defined(_POSIX_THREADS) + case _SC_THREAD_DESTRUCTOR_ITERATIONS: + return PTHREAD_DESTRUCTOR_ITERATIONS; + case _SC_THREAD_KEYS_MAX: + return PTHREAD_KEYS_MAX; + case _SC_THREAD_STACK_MIN: + return PTHREAD_STACK_MIN; + case _SC_THREAD_THREADS_MAX: + return PTHREAD_THREADS_MAX; + case _SC_THREADS: + return 1; + case _SC_THREAD_ATTR_STACKADDR: + return -1; + case _SC_THREAD_ATTR_STACKSIZE: + return 1; + case _SC_THREAD_PRIORITY_SCHEDULING: + return -1; + case _SC_THREAD_PRIO_INHERIT: + return -1; + case _SC_THREAD_PRIO_PROTECT: + return -1; + case _SC_THREAD_PROCESS_SHARED: + return -1; + case _SC_THREAD_SAFE_FUNCTIONS: + return 1; +#endif + case _SC_VERSION: + return _POSIX_VERSION; + default: + errno = EINVAL; + return -1; + } +} + +long fpathconf(int fd, int name) +{ + static const short values[] = { + [_PC_LINK_MAX] = _POSIX_LINK_MAX, + [_PC_MAX_CANON] = _POSIX_MAX_CANON, + [_PC_MAX_INPUT] = _POSIX_MAX_INPUT, + [_PC_NAME_MAX] = NAME_MAX, + [_PC_PATH_MAX] = PATH_MAX, + [_PC_PIPE_BUF] = PIPE_BUF, + [_PC_CHOWN_RESTRICTED] = 1, + [_PC_NO_TRUNC] = 1, + [_PC_VDISABLE] = 0, + [_PC_SYNC_IO] = 1, + [_PC_ASYNC_IO] = -1, + [_PC_PRIO_IO] = -1, + [_PC_FILESIZEBITS] = 64, + [_PC_REC_INCR_XFER_SIZE] = 4096, + [_PC_REC_MAX_XFER_SIZE] = 4096, + [_PC_REC_MIN_XFER_SIZE] = 4096, + [_PC_REC_XFER_ALIGN] = 4096, + [_PC_ALLOC_SIZE_MIN] = 4096, + [_PC_SYMLINK_MAX] = -1, + [_PC_2_SYMLINKS] = 1}; + if (name >= sizeof(values) / sizeof(values[0])) + { + errno = EINVAL; + return -1; + } + return values[name]; +} + +long pathconf(const char *path, int name) +{ + return fpathconf(-1, name); +} \ No newline at end of file diff --git a/newlib/libc/sys/hermit/config.h b/newlib/libc/sys/hermit/config.h index 70a7156d84..b048f350ef 100644 --- a/newlib/libc/sys/hermit/config.h +++ b/newlib/libc/sys/hermit/config.h @@ -1,23 +1,23 @@ /* Name of package. */ -#define PACKAGE hermitGloss +#define PACKAGE hermit /* Version of package. */ -#define VERSION 0.1 +#define VERSION 0.1 /* Using ELF format */ -#define HAVE_ELF 1 +#define HAVE_ELF 1 /* Using GNU LD */ -#define HAVE_GNU_LD 1 +#define HAVE_GNU_LD 1 /* .previous directive allowed */ -#define HAVE_ASM_PREVIOUS_DIRECTIVE 1 +#define HAVE_ASM_PREVIOUS_DIRECTIVE 1 /* .pushsection/.popsection directives allowed */ -#define HAVE_ASM_POPSECTION_DIRECTIVE 1 +#define HAVE_ASM_POPSECTION_DIRECTIVE 1 /* support for section attributes */ -#define HAVE_SECTION_ATTRIBUTES 1 +#define HAVE_SECTION_ATTRIBUTES 1 /* symbol prefix */ -#define __SYMBOL_PREFIX "" \ No newline at end of file +#define __SYMBOL_PREFIX "" \ No newline at end of file diff --git a/newlib/libc/sys/hermit/context.S b/newlib/libc/sys/hermit/context.S deleted file mode 100644 index 5bf47f34ed..0000000000 --- a/newlib/libc/sys/hermit/context.S +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2016-2018, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef __x86_64__ - -// Required for Go applications -.globl getcontext -getcontext: - cli - // save general purpose regsiters - mov %r15, 0x00(%rdi) - mov %r14, 0x08(%rdi) - mov %r13, 0x10(%rdi) - mov %r12, 0x18(%rdi) - mov %r9, 0x20(%rdi) - mov %r8, 0x28(%rdi) - mov %rdi, 0x30(%rdi) - mov %rsi, 0x38(%rdi) - mov %rbp, 0x40(%rdi) - mov %rbx, 0x48(%rdi) - mov %rdx, 0x50(%rdi) - mov %rcx, 0x58(%rdi) - lea 0x08(%rsp), %rax - mov %rax, 0x60(%rdi) - mov (%rsp), %rax - mov %rax, 0x68(%rdi) - // save FPU state - fnstenv 0x74(%rdi) - lea 0x70(%rdi), %rax - stmxcsr (%rax) - xor %rax, %rax - sti - retq - -// Required for Go applications -.globl setcontext -setcontext: - cli - // restore FPU state - fldenv 0x74(%rdi) - lea 0x70(%rdi), %rax - ldmxcsr (%rax) - // restore general purpose registers - mov 0x00(%rdi), %r15 - mov 0x08(%rdi), %r14 - mov 0x10(%rdi), %r13 - mov 0x18(%rdi), %r12 - mov 0x20(%rdi), %r9 - mov 0x28(%rdi), %r8 - mov 0x30(%rdi), %rdi - mov 0x38(%rdi), %rsi - mov 0x40(%rdi), %rbp - mov 0x48(%rdi), %rbx - mov 0x50(%rdi), %rdx - mov 0x58(%rdi), %rcx - mov 0x60(%rdi), %rsp - pushq 0x68(%rdi) - xor %rax, %rax - sti - retq - -// Required for Go applications -.globl __startcontext -__startcontext: - mov %rbx, %rsp - pop %rdi - cmp $0, %rdi - je Lno_context - - callq setcontext - -Lno_context: - callq exit -Lendless: - jmp Lendless - -#endif - -#if defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif diff --git a/newlib/libc/sys/hermit/crt0.c b/newlib/libc/sys/hermit/crt0.c index 1402c51cec..0ee81bdc19 100644 --- a/newlib/libc/sys/hermit/crt0.c +++ b/newlib/libc/sys/hermit/crt0.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + /* * Copyright (c) 2016, Stefan Lankes, RWTH Aachen University * All rights reserved. @@ -27,123 +30,14 @@ #include #include -#include -#include -#include -#include "syscall.h" - -extern int main(int argc, char** argv); +extern int main(int argc, char **argv); extern void __libc_init_array(void); -extern void __libc_fini_array (void); +extern void __libc_fini_array(void); +extern char **environ; extern int _init_signal(void); -extern char** environ; -extern void __sinit (struct _reent *); -extern struct _glue __sglue; -extern __FILE __sf[3]; - -typedef struct layout { - size_t size; -} layout_t; - -#define HERMIT_MALLOC_ALIGN ((size_t)8) - -void* malloc(size_t s) { - return _malloc_r(_REENT, s); -} - -void* _malloc_r(struct _reent* _r, size_t size) { - uint8_t *ptr = sys_malloc(size + sizeof(layout_t), HERMIT_MALLOC_ALIGN); - if (!ptr) - return NULL; - - ((layout_t*)ptr)->size = size; - return (void*)(ptr + sizeof(layout_t)); -} - -void* calloc(size_t nmemb, size_t size) { - return _calloc_r(_REENT, nmemb, size); -} - -void* _calloc_r(struct _reent* r, size_t nmemb, size_t size) { - return NULL; -} - -void* realloc(void* ptr, size_t size) { - return _realloc_r(_REENT, ptr, size); -} - -void* _realloc_r(struct _reent* r, void* ptr, size_t size) { - return NULL; -} - -void free(void* ptr) { - _free_r(_REENT, ptr); -} - -void _free_r(struct _reent* r, void* ptr) { - if (ptr) { - uint8_t* p = (uint8_t*)ptr - sizeof(layout_t); - sys_free(p, ((layout_t*)p)->size + sizeof(layout_t), HERMIT_MALLOC_ALIGN); - } -} - -int getentropy(void *ptr, __size_t n) { return -1; }; - -int32_t mkdir(const char *name, uint32_t mode) { - return sys_mkdir(name, mode); -} - -int chdir(const char *path) { - return -1; -} -int fchdir(int fd) { - return -1; -} - -int chmod(const char *path, mode_t mode) { - return -1; -} - -int fchmod(int fd, mode_t mode) { - return -1; -} - -int chown(const char *path, uid_t owner, gid_t group) { - return -1; -} - -int fchown(int fd, uid_t owner, gid_t group) { - return -1; -} - -int truncate(const char *path, off_t length) { - return -1; -} -int ftruncate(int fd, off_t length) { - return -1; -} - -long fpathconf (int fd, int name) { - return -1; -} - -long pathconf (const char *path, int name) { - return -1; -} - -char *getcwd (char *__buf, size_t __size) { - return NULL; -} - -int getdents(int fd, void *dp, int count) { return -1; } - -int _rename_r (struct _reent *r, const char *a, const char *b) { return -1; } - - - -void runtime_entry(int argc, char** argv, char** env) +void runtime_entry(int argc, char **argv, char **env) { int ret; @@ -153,22 +47,24 @@ void runtime_entry(int argc, char** argv, char** env) /* register a function to be called at normal process termination */ atexit(__libc_fini_array); + // Initialise the (synchronous) signal handling + _init_signal(); + /* optind is the index of the next element to be processed in argv */ optind = 0; if (env) environ = env; - /* initialize simple signal handling */ - //_init_signal(); - ret = main(argc, argv); /* call exit from the C library so atexit gets called, and the - C++ destructors get run. This calls our exit routine below + C++ destructors get run. This calls our exit routine below when it's done. */ exit(ret); /* we should never reach this point */ - while(1) {} + while (1) + { + } } diff --git a/newlib/libc/sys/hermit/dirent.c b/newlib/libc/sys/hermit/dirent.c new file mode 100644 index 0000000000..5724c1c9ec --- /dev/null +++ b/newlib/libc/sys/hermit/dirent.c @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#include +#include +#include +#include +#include + +int getdents(int fd, struct dirent *dp, size_t len) +{ + if (len > SIZE_MAX) + len = SIZE_MAX; + int ret = sys_getdents64(fd, dp, len); + + if (ret < 0) + { + errno = -ret; + return -1; + } + + return ret; +} \ No newline at end of file diff --git a/newlib/libc/sys/hermit/env.c b/newlib/libc/sys/hermit/env.c new file mode 100644 index 0000000000..101f7816d7 --- /dev/null +++ b/newlib/libc/sys/hermit/env.c @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +char* __env[] = {"USER=root", "PATH=/bin:/sbin:/usr/bin", "GOTRACEBACK=none", "PWD=/", (char*) 0}; +char **environ = __env; \ No newline at end of file diff --git a/newlib/libc/sys/hermit/environ.c b/newlib/libc/sys/hermit/environ.c deleted file mode 100644 index 697d8cf5b8..0000000000 --- a/newlib/libc/sys/hermit/environ.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* default environment */ -char* __env[] = {"USER=root", "PATH=/bin:/sbin:/usr/bin", "GOTRACEBACK=none", "PWD=/", (char*) 0}; -char **environ = __env; diff --git a/newlib/libc/sys/hermit/errno.c b/newlib/libc/sys/hermit/errno.c deleted file mode 100644 index 315474fdf1..0000000000 --- a/newlib/libc/sys/hermit/errno.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include "warning.h" - -int * __errno(void) -{ - return &_REENT->_errno; -} diff --git a/newlib/libc/sys/hermit/execve.c b/newlib/libc/sys/hermit/execve.c deleted file mode 100644 index b3c970ad5e..0000000000 --- a/newlib/libc/sys/hermit/execve.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include "syscall.h" -#include "warning.h" - -int -execve (const char* name, char* const* argv, char* const* env) -{ - return _execve_r(_REENT, name, argv, env); -} - -int -_execve_r (struct _reent* ptr, const char* name, char* const* argv, char* const* env) -{ - int ret; - - ret = sys_execve(name, argv, env); - if (ret < 0) { - ptr->_errno = -ret; - ret = -1; - } - - return ret; -} diff --git a/newlib/libc/sys/hermit/fcntl.c b/newlib/libc/sys/hermit/fcntl.c new file mode 100644 index 0000000000..3c51cec588 --- /dev/null +++ b/newlib/libc/sys/hermit/fcntl.c @@ -0,0 +1,62 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#include +#include +#include +#include +#include + +int creat(const char *filename, mode_t mode) +{ + return open(filename, O_WRONLY | O_CREAT | O_TRUNC, mode); +} + +int fcntl(int fd, int cmd, ...) +{ + unsigned long arg; + va_list ap; + arg = va_arg(ap, unsigned long); + va_end(ap); + + int ret = sys_fcntl(fd, cmd, arg); + if (ret < 0) + { + errno = -ret; + return -1; + } + + return ret; +} + +int open(const char *filename, int flags, ...) +{ + int mode = 0; + if (flags & O_CREAT) + { + va_list ap; + va_start(ap, flags); + mode = va_arg(ap, int); + va_end(ap); + } + + return _open_r(_REENT, filename, flags, mode); +} + +int _open_r(struct _reent *reent, const char *filename, int flags, int mode) +{ + int fd = sys_open(filename, flags, mode); + if (fd < 0) + { + reent->_errno = -fd; + return -1; + } + + return fd; +} + +int openat(int fd, const char *filename, int flags, ...) +{ + errno = ENOSYS; + return -1; +} diff --git a/newlib/libc/sys/hermit/fork.c b/newlib/libc/sys/hermit/fork.c deleted file mode 100644 index f258225dcf..0000000000 --- a/newlib/libc/sys/hermit/fork.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include "syscall.h" -#include "warning.h" - -int -_fork_r (struct _reent *ptr) -{ - int ret; - - /* create a child process */ - ret = sys_fork(); - if (ret < 0) { - ptr->_errno = -ret; - ret = -1; - } - - return ret; -} diff --git a/newlib/libc/sys/hermit/fstat.c b/newlib/libc/sys/hermit/fstat.c deleted file mode 100644 index 649fa04dfc..0000000000 --- a/newlib/libc/sys/hermit/fstat.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include -#include -#include "warning.h" - -int -fstat (int fildes, struct stat* st) -{ - return _fstat_r(_REENT, fildes, st); -} - -int -_fstat_r (struct _reent* ptr, int fildes, struct stat* st) -{ - st->st_mode = S_IFCHR; - return 0; -} diff --git a/newlib/libc/sys/hermit/getpagesize.c b/newlib/libc/sys/hermit/getpagesize.c deleted file mode 100644 index 61a5a12571..0000000000 --- a/newlib/libc/sys/hermit/getpagesize.c +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2018 Colin Finck, RWTH Aachen University -// -// MIT License -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -#include "syscall.h" - -int -getpagesize(void) -{ - return sys_getpagesize(); -} diff --git a/newlib/libc/sys/hermit/getpid.c b/newlib/libc/sys/hermit/getpid.c deleted file mode 100644 index 2c5a6ee6ae..0000000000 --- a/newlib/libc/sys/hermit/getpid.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include "syscall.h" -#include "warning.h" - -int -getpid (void) -{ - return _getpid_r(_REENT); -} - -int -_getpid_r (struct _reent* ptr) -{ - int ret; - - ret = sys_getpid(); - if (ret < 0) { - ptr->_errno = -ret; - ret = -1; - } - - return ret; -} diff --git a/newlib/libc/sys/hermit/gettod.c b/newlib/libc/sys/hermit/gettod.c deleted file mode 100644 index 68cbc241f9..0000000000 --- a/newlib/libc/sys/hermit/gettod.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include -#include -#include "syscall.h" - -int -gettimeofday (struct timeval* ptimeval, void* ptimezone) -{ - return _gettimeofday_r(_REENT, ptimeval, ptimezone); -} - -int -_gettimeofday_r (struct _reent* ptr, struct timeval* ptimeval, void* ptimezone) -{ - int ret = sys_gettimeofday((HermitTimeval*)ptimeval, ptimezone); - if (ret < 0) - { - ptr->_errno = -ret; - return -1; - } - - return ret; -} diff --git a/newlib/libc/sys/hermit/include/arpa/inet.h b/newlib/libc/sys/hermit/include/arpa/inet.h index 01f3083c3d..71df9fbe53 100644 --- a/newlib/libc/sys/hermit/include/arpa/inet.h +++ b/newlib/libc/sys/hermit/include/arpa/inet.h @@ -1,159 +1,31 @@ -/*- - * SPDX-License-Identifier: (BSD-3-Clause AND ISC) - * - * ++Copyright++ 1983, 1993 - * - - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies, and that - * the name of Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the document or software without - * specific, written prior permission. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT - * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * - - * --Copyright-- - */ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-FileCopyrightText: 2005-2014 Rich Felker, et al. +// SPDX-License-Identifier: MIT -/*% - * @(#)inet.h 8.1 (Berkeley) 6/2/93 - * $Id: inet.h,v 1.3 2005/04/27 04:56:16 sra Exp $ - * $FreeBSD$ - */ +#ifndef _ARPA_INET_H +#define _ARPA_INET_H -#ifndef _ARPA_INET_H_ -#define _ARPA_INET_H_ - -/* External definitions for functions in inet(3). */ - -#include -#include - -/* Required for byteorder(3) functions. */ -#include - -#define INET_ADDRSTRLEN 16 -#define INET6_ADDRSTRLEN 46 - -#ifndef _UINT16_T_DECLARED -typedef __uint16_t uint16_t; -#define _UINT16_T_DECLARED +#ifdef __cplusplus +extern "C" { #endif -#ifndef _UINT32_T_DECLARED -typedef __uint32_t uint32_t; -#define _UINT32_T_DECLARED -#endif +#include -#ifndef _IN_ADDR_T_DECLARED -typedef uint32_t in_addr_t; -#define _IN_ADDR_T_DECLARED -#endif +uint32_t htonl(uint32_t); +uint16_t htons(uint16_t); +uint32_t ntohl(uint32_t); +uint16_t ntohs(uint16_t); -#ifndef _IN_PORT_T_DECLARED -typedef uint16_t in_port_t; -#define _IN_PORT_T_DECLARED -#endif +in_addr_t inet_addr (const char *); +in_addr_t inet_network (const char *); +char *inet_ntoa (struct in_addr); +int inet_pton (int, const char *__restrict, void *__restrict); +const char *inet_ntop (int, const void *__restrict, char *__restrict, socklen_t); -#if __BSD_VISIBLE -#ifndef _SIZE_T_DECLARED -typedef __size_t size_t; -#define _SIZE_T_DECLARED -#endif -#endif +int inet_aton (const char *, struct in_addr *); -/* - * XXX socklen_t is used by a POSIX.1-2001 interface, but not required by - * POSIX.1-2001. - */ -#ifndef _SOCKLEN_T_DECLARED -typedef __socklen_t socklen_t; -#define _SOCKLEN_T_DECLARED +#ifdef __cplusplus +} #endif -#ifndef _STRUCT_IN_ADDR_DECLARED -struct in_addr { - in_addr_t s_addr; -}; -#define _STRUCT_IN_ADDR_DECLARED -#endif - -__BEGIN_DECLS -#ifndef _BYTEORDER_PROTOTYPED -#define _BYTEORDER_PROTOTYPED -uint32_t htonl(uint32_t); -uint16_t htons(uint16_t); -uint32_t ntohl(uint32_t); -uint16_t ntohs(uint16_t); -#endif - -in_addr_t inet_addr(const char *); -/*const*/ char *inet_ntoa(struct in_addr); -const char *inet_ntop(int, const void * __restrict, char * __restrict, - socklen_t); -int inet_pton(int, const char * __restrict, void * __restrict); - -#if __BSD_VISIBLE -int inet_aton(const char *, struct in_addr *); -in_addr_t inet_lnaof(struct in_addr); -struct in_addr inet_makeaddr(in_addr_t, in_addr_t); -char * inet_neta(in_addr_t, char *, size_t); -in_addr_t inet_netof(struct in_addr); -in_addr_t inet_network(const char *); -char *inet_net_ntop(int, const void *, int, char *, size_t); -int inet_net_pton(int, const char *, void *, size_t); -char *inet_ntoa_r(struct in_addr, char *buf, socklen_t size); -char *inet_cidr_ntop(int, const void *, int, char *, size_t); -int inet_cidr_pton(int, const char *, void *, int *); -unsigned inet_nsap_addr(const char *, unsigned char *, int); -char *inet_nsap_ntoa(int, const unsigned char *, char *); -#endif /* __BSD_VISIBLE */ -__END_DECLS - -#ifndef _BYTEORDER_FUNC_DEFINED -#define _BYTEORDER_FUNC_DEFINED -#define htonl(x) __htonl(x) -#define htons(x) __htons(x) -#define ntohl(x) __ntohl(x) -#define ntohs(x) __ntohs(x) -#endif - -#endif /* !_ARPA_INET_H_ */ - -/*! \file */ +#endif \ No newline at end of file diff --git a/newlib/libc/sys/hermit/include/bits/byteswap.h b/newlib/libc/sys/hermit/include/bits/byteswap.h new file mode 100644 index 0000000000..37ccf16636 --- /dev/null +++ b/newlib/libc/sys/hermit/include/bits/byteswap.h @@ -0,0 +1,34 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +// This file is to be kept in sync with winsup/cygwin/include/bits/byteswap.h + +#ifndef _BITS_BYTESWAP_H +#define _BITS_BYTESWAP_H + +#ifdef __cplusplus +extern "C" { +#endif + +static __inline unsigned short +__bswap_16 (unsigned short __x) +{ + return (__x >> 8) | (__x << 8); +} + +static __inline unsigned int +__bswap_32 (unsigned int __x) +{ + return (__bswap_16 (__x & 0xffff) << 16) | (__bswap_16 (__x >> 16)); +} + +static __inline unsigned long long +__bswap_64 (unsigned long long __x) +{ + return (((unsigned long long) __bswap_32 (__x & 0xffffffffull)) << 32) | (__bswap_32 (__x >> 32)); +} + +#ifdef __cplusplus +} +#endif +#endif /* _BITS_BYTESWAP_H */ diff --git a/newlib/libc/sys/hermit/include/byteswap.h b/newlib/libc/sys/hermit/include/byteswap.h new file mode 100644 index 0000000000..eda4113999 --- /dev/null +++ b/newlib/libc/sys/hermit/include/byteswap.h @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +// This file is to be kept in sync with winsup/cygwin/include/byteswap.h + +#ifndef _BYTESWAP_H +#define _BYTESWAP_H + +#include + +#define bswap_16(x) __bswap_16(x) +#define bswap_32(x) __bswap_32(x) +#define bswap_64(x) __bswap_64(x) + +#endif /* _BYTESWAP_H */ \ No newline at end of file diff --git a/newlib/libc/sys/hermit/include/dlfcn.h b/newlib/libc/sys/hermit/include/dlfcn.h new file mode 100644 index 0000000000..63c6152adf --- /dev/null +++ b/newlib/libc/sys/hermit/include/dlfcn.h @@ -0,0 +1,49 @@ +// SPDX-FileCopyrightText: 2005-2014 Rich Felker, et al. +// SPDX-License-Identifier: MIT + +#ifndef _DLFCN_H +#define _DLFCN_H + +// This file is to be kept in sync with https://github.com/bminor/musl/blob/master/include/dlfcn.h + +#ifdef __cplusplus +extern "C" { +#endif + +#define RTLD_LAZY 1 +#define RTLD_NOW 2 +#define RTLD_NOLOAD 4 +#define RTLD_NODELETE 4096 +#define RTLD_GLOBAL 256 +#define RTLD_LOCAL 0 + +#define RTLD_NEXT ((void *)-1) +#define RTLD_DEFAULT ((void *)0) + +#define RTLD_DI_LINKMAP 2 + +int dlclose(void *); +char *dlerror(void); +void *dlopen(const char *, int); +void *dlsym(void *__restrict, const char *__restrict); + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +typedef struct { + const char *dli_fname; + void *dli_fbase; + const char *dli_sname; + void *dli_saddr; +} Dl_info; +int dladdr(const void *, Dl_info *); +int dlinfo(void *, int, void *); +#endif + +#if _REDIR_TIME64 +__REDIR(dlsym, __dlsym_time64); +#endif + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/newlib/libc/sys/hermit/include/hermit.h b/newlib/libc/sys/hermit/include/hermit.h new file mode 100644 index 0000000000..61e5e27d46 --- /dev/null +++ b/newlib/libc/sys/hermit/include/hermit.h @@ -0,0 +1,79 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#ifndef _HERMIT_H +#define _HERMIT_H + +#include +#include + +#define ARG_TYPES(...) __VA_ARGS__ +#define ARG_NAMES(...) __VA_ARGS__ + +#define HERMIT_STUB_WITH_ERRNO(return_type, name, arg_types, errno_value, fail_value) \ + return_type name(ARG_TYPES arg_types) \ + { \ + errno = errno_value; \ + return fail_value; \ + } + +#define HERMIT_STUB(return_type, name, arg_types, fail_value) \ + HERMIT_STUB_WITH_ERRNO(return_type, name, arg_types, ENOSYS, fail_value) + +#define HERMIT_STUB_REENT_WITH_ERRNO(return_type, name, arg_types, arg_names, errno_value, fail_value) \ + return_type _##name##_r(struct _reent *r, ARG_TYPES arg_types) \ + { \ + r->_errno = errno_value; \ + return fail_value; \ + } \ + return_type name(ARG_TYPES arg_types) \ + { \ + return _##name##_r(_REENT, ARG_NAMES arg_names); \ + } + +#define HERMIT_STUB_REENT(return_type, name, arg_types, arg_names, fail_value) \ + HERMIT_STUB_REENT_WITH_ERRNO(return_type, name, arg_types, arg_names, ENOSYS, fail_value) + +#define HERMIT_STUB_REENT0_WITH_ERRNO(return_type, name, errno_value, fail_value) \ + return_type _##name##_r(struct _reent *r) \ + { \ + r->_errno = errno_value; \ + return fail_value; \ + } \ + return_type name() \ + { \ + return _##name##_r(_REENT); \ + } + +#define HERMIT_STUB_REENT0(return_type, name, fail_value) \ + HERMIT_STUB_REENT0_WITH_ERRNO(return_type, name, ENOSYS, fail_value) + +#define HERMIT_SYSCALL(return_type, name, arg_types, arg_names) \ + return_type name(ARG_TYPES arg_types) \ + { \ + return_type ret = sys_##name(ARG_NAMES arg_names); \ + if (ret < 0) \ + { \ + errno = -ret; \ + return -1; \ + } \ + return ret; \ + } + +#define HERMIT_SYSCALL_REENT(return_type, name, arg_types, arg_names) \ + return_type _##name##_r(struct _reent *reent, ARG_TYPES arg_types) \ + { \ + return_type ret = sys_##name(ARG_NAMES arg_names); \ + if (ret < 0) \ + { \ + reent->_errno = -ret; \ + return -1; \ + } \ + return ret; \ + } \ + return_type name(ARG_TYPES arg_types) \ + { \ + return _##name##_r(_REENT, ARG_NAMES arg_names); \ + } + +#endif // _HERMIT_H \ No newline at end of file diff --git a/newlib/libc/sys/hermit/include/hermit/config.h b/newlib/libc/sys/hermit/include/hermit/config.h new file mode 100644 index 0000000000..66f7606af4 --- /dev/null +++ b/newlib/libc/sys/hermit/include/hermit/config.h @@ -0,0 +1,27 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#ifndef _HERMIT_CONFIG_H +#define _HERMIT_CONFIG_H + +#define HERMIT_SBRK_HEAP (8 * 1024 * 4096) + +// Hermit lacks a proper notion of processes, users and groups. +// +// We assume (for simplicity) that there is: +// - one process (init, pid(1)) +// - one user (root, uid(0)) +// - one group (root, gid(0)) +// +// All threads belong to init. +// The process group id of init is 0. + +#define HERMIT_UID 0 +#define HERMIT_GID 0 +#define HERMIT_NGROUPS_MAX 1 +#define HERMIT_NGROUPS 1 +#define HERMIT_PGID 0 +#define HERMIT_INIT_PID 1 +#define HERMIT_INIT_PPID 0 + +#endif // _HERMIT_CONFIG_H \ No newline at end of file diff --git a/newlib/libc/sys/hermit/include/hermit/stat.h b/newlib/libc/sys/hermit/include/hermit/stat.h new file mode 100644 index 0000000000..a061713960 --- /dev/null +++ b/newlib/libc/sys/hermit/include/hermit/stat.h @@ -0,0 +1,66 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#ifndef _HERMIT_STAT_H +#define _HERMIT_STAT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +struct stat +{ + uint64_t st_dev; + uint64_t st_ino; + uint64_t st_nlink; + /** + * access permissions + */ + uint32_t st_mode; + /** + * user id + */ + uint32_t st_uid; + /** + * group id + */ + uint32_t st_gid; + /** + * device id + */ + uint64_t st_rdev; + /** + * size in bytes + */ + uint64_t st_size; + /** + * block size + */ + int64_t st_blksize; + /** + * size in blocks + */ + int64_t st_blocks; + /** + * time of last access + */ + struct timespec st_atim; + /** + * time of last modification + */ + struct timespec st_mtim; + /** + * time of last status change + */ + struct timespec st_ctim; +}; + + +#ifdef __cplusplus +} +#endif + +#endif // _HERMIT_STAT_H \ No newline at end of file diff --git a/newlib/libc/sys/hermit/include/hermit/syscall.h b/newlib/libc/sys/hermit/include/hermit/syscall.h new file mode 100644 index 0000000000..106055c908 --- /dev/null +++ b/newlib/libc/sys/hermit/include/hermit/syscall.h @@ -0,0 +1,755 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#ifndef _HERMIT_ABI_H +#define _HERMIT_ABI_H + +#include +#include +#include +#include + +#include // for `ssize_t`, `pid_t, `clock_t` +#include // for `time_t`, `timespec` +#include // for `stat` +#include // for `dirent` +#include // for `iovec` +#include // for `pollfd` +#include // for `addrinfo` + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +/** + * Maximum number of priorities + */ +#define NO_PRIORITIES 31 + +#define FUTEX_RELATIVE_TIMEOUT 1 + +// FIXME: +// Some of these flags don't match those in _default_fcntl.h +#define O_RDONLY 0 + +#define O_WRONLY 1 + +#define O_RDWR 2 + +#define O_CREAT 64 + +#define O_EXCL 128 + +#define O_TRUNC 512 + +#define O_APPEND 1024 + +#define O_NONBLOCK 2048 + +#define O_DIRECTORY 65536 + +#define F_DUPFD 0 + +#define F_GETFD 1 + +#define F_SETFD 2 + +#define F_GETFL 3 + +#define F_SETFL 4 + +#define FD_CLOEXEC 1f + +#define AF_INET 0 + +#define AF_INET6 1 + +#define IPPROTO_IP 0 + +#define IPPROTO_IPV6 41 + +#define IPPROTO_UDP 17 + +#define IPPROTO_TCP 6 + +#define IPV6_ADD_MEMBERSHIP 12 + +#define IPV6_DROP_MEMBERSHIP 13 + +#define IPV6_MULTICAST_LOOP 19 + +#define IPV6_V6ONLY 27 + +#define IP_TOS 1 + +#define IP_TTL 2 + +#define IP_MULTICAST_TTL 5 + +#define IP_MULTICAST_LOOP 7 + +#define IP_ADD_MEMBERSHIP 3 + +#define IP_DROP_MEMBERSHIP 4 + +#define SHUT_RD 0 + +#define SHUT_WR 1 + +#define SHUT_RDWR 2 + +#define SOCK_DGRAM 2 + +#define SOCK_STREAM 1 + +#define SOCK_NONBLOCK 2048 + +#define SOCK_CLOEXEC 16384 + +#define SOL_SOCKET 4095 + +#define SO_REUSEADDR 4 + +#define SO_KEEPALIVE 8 + +#define SO_BROADCAST 32 + +#define SO_LINGER 128 + +#define SO_SNDBUF 4097 + +#define SO_RCVBUF 4098 + +#define SO_SNDTIMEO 4101 + +#define SO_RCVTIMEO 4102 + +#define SO_ERROR 4103 + +#define TCP_NODELAY 1 + +#define MSG_PEEK 1 + +#define FIONBIO (int32_t)2148034174u + +#define EFD_SEMAPHORE 1 + +#define EFD_NONBLOCK 2048 + +#define EFD_CLOEXEC 16384 + +#define IOV_MAX 1024 + +#define S_IFIFO 4096 + +#define S_IFCHR 8192 + +#define S_IFBLK 24576 + +#define S_IFDIR 16384 + +#define S_IFREG 32768 + +#define S_IFLNK 40960 + +#define S_IFSOCK 49152 + +#define S_IFMT 61440 + +/** + * Pages may not be accessed. + */ +#define PROT_NONE 0 + +/** + * Indicates that the memory region should be readable. + */ +#define PROT_READ (1 << 0) + +/** + * Indicates that the memory region should be writable. + */ +#define PROT_WRITE (1 << 1) + +/** + * Indicates that the memory region should be executable. + */ +#define PROT_EXEC (1 << 2) + +/** + * The file offset is set to offset bytes. + */ +#define SEEK_SET 0 + +/** + * The file offset is set to its current location plus offset bytes. + */ +#define SEEK_CUR 1 + +/** + * The file offset is set to the size of the file plus offset bytes. + */ +#define SEEK_END 2 + + typedef const void *sem_t; + + /** + * A thread handle type + */ + typedef uint32_t tid_t; + +#define CLOCK_REALTIME 1 + +#define CLOCK_PROCESS_CPUTIME_ID 2 + +#define CLOCK_THREAD_CPUTIME_ID 3 + +#define CLOCK_MONOTONIC 4 + + /** + * Get the last error number from the thread local storage + */ + extern int32_t sys_get_errno(void); + + /** + * Get the last error number from the thread local storage + */ + extern int32_t sys_errno(void); + + /** + * Get memory page size + */ + extern int32_t sys_getpagesize(void); + + /** + * Creates a new virtual memory mapping of the `size` specified with + * protection bits specified in `prot_flags`. + */ + extern int32_t sys_mmap(size_t size, uint32_t prot_flags, void **ret); + + /** + * Unmaps memory at the specified `ptr` for `size` bytes. + */ + extern int32_t sys_munmap(void *ptr, size_t size); + + /** + * Configures the protections associated with a region of virtual memory + * starting at `ptr` and going to `size`. + * + * Returns 0 on success and an error code on failure. + */ + extern int32_t sys_mprotect(void *ptr, size_t size, uint32_t prot_flags); + + /** + * If the value at address matches the expected value, park the current thread until it is either + * woken up with [`futex_wake`] (returns 0) or an optional timeout elapses (returns -ETIMEDOUT). + * + * Setting `timeout` to null means the function will only return if [`futex_wake`] is called. + * Otherwise, `timeout` is interpreted as an absolute time measured with [`CLOCK_MONOTONIC`]. + * If [`FUTEX_RELATIVE_TIMEOUT`] is set in `flags` the timeout is understood to be relative + * to the current time. + * + * Returns -EINVAL if `address` is null, the timeout is negative or `flags` contains unknown values. + */ + extern int32_t sys_futex_wait(uint32_t *address, + uint32_t expected, + const struct timespec *timeout, + uint32_t flags); + + /** + * Wake `count` threads waiting on the futex at `address`. Returns the number of threads + * woken up (saturates to `i32::MAX`). If `count` is `i32::MAX`, wake up all matching + * waiting threads. If `count` is negative or `address` is null, returns -EINVAL. + */ + extern int32_t sys_futex_wake(uint32_t *address, int32_t count); + + /** + * sem_init() initializes the unnamed semaphore at the address + * pointed to by `sem`. The `value` argument specifies the + * initial value for the semaphore. If `pshared` is nonzero, + * then the semaphore is shared between processes (currently + * not supported). + */ + extern int32_t sys_sem_init(sem_t *sem, int32_t pshared, uint32_t value); + + /** + * sem_destroy() frees the unnamed semaphore at the address + * pointed to by `sem`. + */ + extern int32_t sys_sem_destroy(sem_t *sem); + + /** + * sem_post() increments the semaphore pointed to by `sem`. + * If the semaphore's value consequently becomes greater + * than zero, then another thread blocked in a sem_wait call + * will be woken up and proceed to lock the semaphore. + */ + extern int32_t sys_sem_post(sem_t *sem); + + /** + * try to decrement a semaphore + * + * sem_trywait() is the same as sem_timedwait(), except that + * if the decrement cannot be immediately performed, then call + * returns a negative value instead of blocking. + */ + extern int32_t sys_sem_trywait(sem_t *sem); + + /** + * decrement a semaphore + * + * sem_timedwait() decrements the semaphore pointed to by `sem`. + * If the semaphore's value is greater than zero, then the + * the function returns immediately. If the semaphore currently + * has the value zero, then the call blocks until either + * it becomes possible to perform the decrement of the time limit + * to wait for the semaphore is expired. A time limit `ms` of + * means infinity waiting time. + */ + extern int32_t sys_sem_timedwait(sem_t *sem, const struct timespec *abs_timeout); + + /** + * Determines the id of the current thread + */ + extern pid_t sys_getpid(void); + + /** + * cause normal termination and return `status` + * to the host system + */ + extern void sys_exit(int32_t status) _ATTRIBUTE((__noreturn__)); + + /** + * cause abnormal termination + */ + extern void sys_abort(void) _ATTRIBUTE((__noreturn__)); + + /** + * suspend execution for microsecond intervals + * + * The usleep() function suspends execution of the calling + * thread for (at least) `usecs` microseconds. + */ + extern void sys_usleep(uint64_t usecs); + + /** + * suspend thread execution for an interval measured in nanoseconds + */ + extern int32_t sys_nanosleep(const struct timespec *req); + + /** + * spawn a new thread + * + * spawn() starts a new thread. The new thread starts execution + * by invoking `func(usize)`; `arg` is passed as the argument + * to `func`. `prio` defines the priority of the new thread, + * which can be between `LOW_PRIO` and `HIGH_PRIO`. + * `core_id` defines the core, where the thread is located. + * A negative value give the operating system the possibility + * to select the core by its own. + */ + extern int32_t sys_spawn(tid_t *id, + void (*func)(void *), + void *arg, + uint8_t prio, + ssize_t core_id); + + /** + * spawn a new thread with user-specified stack size + * + * spawn2() starts a new thread. The new thread starts execution + * by invoking `func(usize)`; `arg` is passed as the argument + * to `func`. `prio` defines the priority of the new thread, + * which can be between `LOW_PRIO` and `HIGH_PRIO`. + * `core_id` defines the core, where the thread is located. + * A negative value give the operating system the possibility + * to select the core by its own. + * In contrast to spawn(), spawn2() is able to define the + * stack size. + */ + extern tid_t sys_spawn2(void (*func)(void *), + void *arg, + uint8_t prio, + size_t stack_size, + ssize_t core_id); + + /** + * join with a terminated thread + * + * The join() function waits for the thread specified by `id` + * to terminate. + */ + extern int32_t sys_join(tid_t id); + + /** + * yield the processor + * + * causes the calling thread to relinquish the CPU. The thread + * is moved to the end of the queue for its static priority. + */ + extern void sys_yield(void); + + /** + * Finds the resolution (or precision) of a clock. + * + * This function gets the clock resolution of a clock with `clockid` and stores it in the parameter `tp`. + * Returns `0` on success, `-EINVAL` otherwise. + * + * Supported clocks: + * - `CLOCK_REALTIME` + * - `CLOCK_MONOTONIC` + * - `CLOCK_PROCESS_CPUTIME_ID` + * - `CLOCK_THREAD_CPUTIME_ID` + */ + extern int32_t sys_clock_getres(clockid_t clockid, struct timespec *tp); + + /** + * get current time + * + * The clock_gettime() functions allow the calling thread + * to retrieve the value used by a clock which is specified + * by `clockid`. + * + * `CLOCK_REALTIME`: the system's real time clock, + * expressed as the amount of time since the Epoch. + * + * `CLOCK_MONOTONIC`: clock that increments monotonically, + * tracking the time since an arbitrary point + */ + extern int32_t sys_clock_gettime(clockid_t clockid, struct timespec *tp); + + /** + * Sleep a clock for a specified number of nanoseconds + * + * The requested time (in nanoseconds) must be greater than 0 and less than 1,000,000. + * + * Returns `0` on success, `-EINVAL` otherwise. + * + * Supported clocks: + * - `CLOCK_REALTIME` + * - `CLOCK_MONOTONIC` + */ + extern int32_t sys_clock_nanosleep(clockid_t clockid, int flags, const struct timespec *rqtp, struct timespec *rmtp); + + /** + * Set the current time + * + * This function is currently not supported, and always returns `-EINVAL`. + */ + extern int32_t sys_clock_settime(clockid_t clockid, const struct timespec *tp); + + /** + * Get the system's clock time. + * + * This function gets the current time based on the wallclock time when booted up, plus current timer ticks. + * Returns `0` on success, `-EINVAL` otherwise. + * + * Note: `tz` should be set to `NULL` since Hermit does not support timezones. + */ + extern int32_t sys_gettimeofday(struct timeval *tp, void *tz); + + /** + * open and possibly create a file + * + * The open() system call opens the file specified by `name`. + * If the specified file does not exist, it may optionally + * be created by open(). + */ + extern int32_t sys_open(const char *name, int32_t flags, int32_t mode); + + /** + * open a directory + * + * The opendir() system call opens the directory specified by `name`. + */ + extern int32_t sys_opendir(const char *name); + + /** + * delete the file it refers to `name` + */ + extern int32_t sys_unlink(const char *name); + + /** + * remove directory it refers to `name` + */ + extern int32_t sys_rmdir(const char *name); + + /** + * stat + */ + extern int32_t sys_stat(const char *name, struct stat *stat); + + /** + * lstat + */ + extern int32_t sys_lstat(const char *name, struct stat *stat); + + /** + * fstat + */ + extern int32_t sys_fstat(int32_t fd, struct stat *stat); + + /** + * Returns an estimate of the default amount of parallelism + * a program should use. This number often corresponds to the + * amount of CPUs a computer has, but it may diverge in + * various cases. + */ + extern size_t sys_available_parallelism(void); + + extern void *sys_malloc(size_t size, size_t align); + + extern void *sys_alloc(size_t size, size_t align); + + extern void *sys_alloc_zeroed(size_t size, size_t align); + + extern void *sys_realloc(void *ptr, size_t size, size_t align, size_t new_size); + + extern void sys_free(void *ptr, size_t size, size_t align); + + extern void sys_dealloc(void *ptr, size_t size, size_t align); + + extern int32_t sys_notify(uintptr_t id, int32_t count); + + extern int32_t sys_add_queue(uintptr_t id, int64_t timeout_ns); + + extern int32_t sys_wait(uintptr_t id); + + extern int32_t sys_init_queue(uintptr_t id); + + extern int32_t sys_destroy_queue(uintptr_t id); + + /** + * initialize the network stack + */ + extern int32_t sys_network_init(void); + + /** + * Add current task to the queue of blocked tasks. After calling `block_current_task`, + * call `yield_now` to switch to another task. + */ + extern void sys_block_current_task(void); + + /** + * Add current task to the queue of blocked tasks, but wake it when `timeout` milliseconds + * have elapsed. + * + * After calling `block_current_task`, call `yield_now` to switch to another task. + */ + extern void sys_block_current_task_with_timeout(uint64_t timeout); + + /** + * Wakeup task with the thread id `tid` + * + * FIXME: This function has a spelling mistake in the linkage attribute + * in lib.rs. It should be `sys_wakeup_task`, not `sys_wakeup_taskt`. + */ + extern void sys_wakeup_taskt(tid_t tid); + + /** + * The system call `getaddrbyname` determine the network host entry. + * It expects an array of u8 with a size of in_addr or of in6_addr. + * The result of the DNS request will be stored in this array. + */ + extern int32_t sys_getaddrbyname(const char *name, uint8_t *inaddr, size_t len); + + extern int32_t sys_accept(int32_t s, struct sockaddr *addr, socklen_t *addrlen); + + /** + * bind a name to a socket + */ + extern int32_t sys_bind(int32_t s, const struct sockaddr *name, socklen_t namelen); + + extern int32_t sys_connect(int32_t s, const struct sockaddr *name, socklen_t namelen); + + /** + * read from a file descriptor + * + * read() attempts to read `len` bytes of data from the object + * referenced by the descriptor `fd` into the buffer pointed + * to by `buf`. + */ + extern ssize_t sys_read(int32_t fd, uint8_t *buf, size_t len); + + /** + * `read()` attempts to read `nbyte` of data to the object referenced by the + * descriptor `fd` from a buffer. `read()` performs the same + * action, but scatters the input data from the `iovcnt` buffers specified by the + * members of the iov array: `iov[0], iov[1], ..., iov[iovcnt-1]`. + * + * Each `iovec` entry specifies the base address and length of an area in memory from + * which data should be written. `readv()` will always fill an completely + * before proceeding to the next. + */ + extern ssize_t sys_readv(int32_t fd, const struct iovec *iov, size_t iovcnt); + + /** + * `getdents64` reads directory entries from the directory referenced + * by the file descriptor `fd` into the buffer pointed to by `buf`. + */ + extern int64_t sys_getdents64(int32_t fd, struct dirent *dirp, size_t count); + + /** + * 'mkdir' attempts to create a directory, + * it returns 0 on success and -1 on error + */ + extern int32_t sys_mkdir(const int8_t *name, uint32_t mode); + + /** + * Fill `len` bytes in `buf` with cryptographically secure random data. + * + * Returns either the number of bytes written to buf (a positive value) or + * * `-EINVAL` if `flags` contains unknown flags. + * * `-ENOSYS` if the system does not support random data generation. + */ + extern ssize_t sys_read_entropy(uint8_t *buf, size_t len, uint32_t flags); + + /** + * receive() a message from a socket + */ + extern ssize_t sys_recv(int32_t socket, uint8_t *buf, size_t len, int32_t flags); + + /** + * receive() a message from a socket + */ + extern ssize_t sys_recvfrom(int32_t socket, + uint8_t *buf, + size_t len, + int32_t flags, + struct sockaddr *addr, + socklen_t *addrlen); + + /** + * The fseek() function sets the file position indicator for the stream pointed to by stream. + * The new position, measured in bytes, is obtained by adding offset bytes to the position + * specified by whence. If whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is + * relative to the start of the file, the current position indicator, or end-of-file, + * respectively. + */ + extern ssize_t sys_lseek(int32_t fd, intptr_t offset, int32_t whence); + + /** + * write to a file descriptor + * + * write() attempts to write `len` of data to the object + * referenced by the descriptor `fd` from the + * buffer pointed to by `buf`. + */ + extern ssize_t sys_write(int32_t fd, const uint8_t *buf, size_t len); + + /** + * `write()` attempts to write `nbyte` of data to the object referenced by the + * descriptor `fd` from a buffer. `writev()` performs the same + * action, but gathers the output data from the `iovcnt` buffers specified by the + * members of the iov array: `iov[0], iov[1], ..., iov[iovcnt-1]`. + * + * Each `iovec` entry specifies the base address and length of an area in memory from + * which data should be written. `writev()` will always write a + * complete area before proceeding to the next. + */ + extern ssize_t sys_writev(int32_t fd, const struct iovec *iov, size_t iovcnt); + + /** + * close a file descriptor + * + * The close() call deletes a file descriptor `fd` from the object + * reference table. + */ + extern int32_t sys_close(int32_t fd); + + /** + * duplicate an existing file descriptor + */ + extern int32_t sys_dup(int32_t fd); + + extern int32_t sys_getpeername(int32_t s, struct sockaddr *name, socklen_t *namelen); + + extern int32_t sys_getsockname(int32_t s, struct sockaddr *name, socklen_t *namelen); + + extern int32_t sys_getsockopt(int32_t s, + int32_t level, + int32_t optname, + void *optval, + socklen_t *optlen); + + extern int32_t sys_setsockopt(int32_t s, + int32_t level, + int32_t optname, + const void *optval, + socklen_t optlen); + + extern int32_t sys_ioctl(int32_t s, int32_t cmd, void *argp); + + extern int32_t sys_fcntl(int32_t fd, int32_t cmd, int32_t arg); + + /** + * `eventfd` creates an linux-like "eventfd object" that can be used + * as an event wait/notify mechanism by user-space applications, and by + * the kernel to notify user-space applications of events. The + * object contains an unsigned 64-bit integer counter + * that is maintained by the kernel. This counter is initialized + * with the value specified in the argument `initval`. + * + * As its return value, `eventfd` returns a new file descriptor that + * can be used to refer to the eventfd object. + * + * The following values may be bitwise set in flags to change the + * behavior of `eventfd`: + * + * `EFD_NONBLOCK`: Set the file descriptor in non-blocking mode + * `EFD_SEMAPHORE`: Provide semaphore-like semantics for reads + * from the new file descriptor. + */ + extern int32_t sys_eventfd(uint64_t initval, int16_t flags); + + /** + * The unix-like `poll` waits for one of a set of file descriptors + * to become ready to perform I/O. The set of file descriptors to be + * monitored is specified in the `fds` argument, which is an array + * of structures of `pollfd`. + */ + extern int32_t sys_poll(struct pollfd *fds, nfds_t nfds, int32_t timeout); + + /** + * listen for connections on a socket + * + * The `backlog` parameter defines the maximum length for the queue of pending + * connections. Currently, the `backlog` must be one. + */ + extern int32_t sys_listen(int32_t s, int32_t backlog); + + extern ssize_t sys_send(int32_t s, const void *mem, size_t len, int32_t flags); + + extern ssize_t sys_sendto(int32_t s, + const void *mem, + size_t len, + int32_t flags, + const struct sockaddr *to, + socklen_t tolen); + + /** + * shut down part of a full-duplex connection + */ + extern int32_t sys_shutdown(int32_t sockfd, int32_t how); + + extern int32_t sys_shutdown_socket(int32_t s, int32_t how); + + extern int32_t sys_socket(int32_t domain, int32_t type_, int32_t protocol); + + extern void sys_freeaddrinfo(struct addrinfo *ai); + + extern int32_t sys_getaddrinfo(const char *nodename, + const char *servname, + const struct addrinfo *hints, + struct addrinfo **res); + + extern uint8_t sys_get_priority(void); + + extern void sys_set_priority(tid_t tid, uint8_t prio); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus + +#endif // _HERMIT_ABI_H diff --git a/newlib/libc/sys/hermit/include/netdb.h b/newlib/libc/sys/hermit/include/netdb.h index 1ff1751d1b..ac55904fbe 100644 --- a/newlib/libc/sys/hermit/include/netdb.h +++ b/newlib/libc/sys/hermit/include/netdb.h @@ -1,38 +1,161 @@ -#ifndef NETDB_H -#define NETDB_H +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-FileCopyrightText: 2005-2014 Rich Felker, et al. +// SPDX-License-Identifier: MIT -#include +#ifndef _NETDB_H +#define _NETDB_H #ifdef __cplusplus extern "C" { #endif -#define socklen_t __socklen_t - -typedef struct addrinfo_t { - int32_t ai_flags; - int32_t ai_family; - int32_t ai_socktype; - int32_t ai_protocol; - socklen_t ai_addrlen; - struct sockaddr *ai_addr; - uint8_t *ai_canonname; - struct addrinfo_t *ai_next; -} addrinfo; - -struct in_addr { - unsigned long s_addr; // load with inet_aton() +#include + +struct addrinfo { + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + socklen_t ai_addrlen; + char *ai_canonname; + struct sockaddr *ai_addr; + struct addrinfo *ai_next; +}; + +#define AI_PASSIVE 0x01 +#define AI_CANONNAME 0x02 +#define AI_NUMERICHOST 0x04 +#define AI_V4MAPPED 0x08 +#define AI_ALL 0x10 +#define AI_ADDRCONFIG 0x20 +#define AI_NUMERICSERV 0x400 + + +#define NI_NUMERICHOST 0x01 +#define NI_NUMERICSERV 0x02 +#define NI_NOFQDN 0x04 +#define NI_NAMEREQD 0x08 +#define NI_DGRAM 0x10 +#define NI_NUMERICSCOPE 0x100 + +#define EAI_AGAIN -2 +#define EAI_BADFLAGS -3 +#define EAI_FAIL -4 +#define EAI_FAMILY -5 +#define EAI_MEMORY -6 +#define EAI_NODATA -7 +#define EAI_NONAME -8 +#define EAI_SERVICE -9 +#define EAI_SOCKTYPE -10 +#define EAI_SYSTEM -11 +#define EAI_OVERFLOW -14 + +#define HOST_NOT_FOUND 1 +#define TRY_AGAIN 2 +#define NO_RECOVERY 3 +#define NO_DATA 4 +#define NO_ADDRESS NO_DATA + +int getaddrinfo (const char *__restrict, const char *__restrict, const struct addrinfo *__restrict, struct addrinfo **__restrict); +void freeaddrinfo (struct addrinfo *); +int getnameinfo (const struct sockaddr *__restrict, socklen_t, char *__restrict, socklen_t, char *__restrict, socklen_t, int); +const char *gai_strerror(int); + + +/* Legacy functions follow (marked OBsolete in SUS) */ + +struct netent { + char *n_name; + char **n_aliases; + int n_addrtype; + uint32_t n_net; +}; + +struct hostent { + char *h_name; + char **h_aliases; + int h_addrtype; + int h_length; + char **h_addr_list; }; +#define h_addr h_addr_list[0] -struct sockaddr_in { - short sin_family; // e.g. AF_INET - unsigned short sin_port; // e.g. htons(3490) - struct in_addr sin_addr; // see struct in_addr, below - char sin_zero[8]; // zero this if you want to +struct servent { + char *s_name; + char **s_aliases; + int s_port; + char *s_proto; }; +struct protoent { + char *p_name; + char **p_aliases; + int p_proto; +}; + +void sethostent (int); +void endhostent (void); +struct hostent *gethostent (void); + +void setnetent (int); +void endnetent (void); +struct netent *getnetent (void); +struct netent *getnetbyaddr (uint32_t, int); +struct netent *getnetbyname (const char *); + +void setservent (int); +void endservent (void); +struct servent *getservent (void); +struct servent *getservbyname (const char *, const char *); +struct servent *getservbyport (int, const char *); + +void setprotoent (int); +void endprotoent (void); +struct protoent *getprotoent (void); +struct protoent *getprotobyname (const char *); +struct protoent *getprotobynumber (int); + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_POSIX_SOURCE) \ + || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE+0 < 200809L) \ + || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700) +struct hostent *gethostbyname (const char *); +struct hostent *gethostbyaddr (const void *, socklen_t, int); +#ifdef __GNUC__ +__attribute__((const)) +#endif +int *__h_errno_location(void); +#define h_errno (*__h_errno_location()) +#define HOST_NOT_FOUND 1 +#define TRY_AGAIN 2 +#define NO_RECOVERY 3 +#define NO_DATA 4 +#define NO_ADDRESS NO_DATA +#endif + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +void herror(const char *); +const char *hstrerror(int); +int gethostbyname_r(const char *, struct hostent *, char *, size_t, struct hostent **, int *); +int gethostbyname2_r(const char *, int, struct hostent *, char *, size_t, struct hostent **, int *); +struct hostent *gethostbyname2(const char *, int); +int gethostbyaddr_r(const void *, socklen_t, int, struct hostent *, char *, size_t, struct hostent **, int *); +int getservbyport_r(int, const char *, struct servent *, char *, size_t, struct servent **); +int getservbyname_r(const char *, const char *, struct servent *, char *, size_t, struct servent **); +#define EAI_NODATA -5 +#define EAI_ADDRFAMILY -9 +#define EAI_INPROGRESS -100 +#define EAI_CANCELED -101 +#define EAI_NOTCANCELED -102 +#define EAI_ALLDONE -103 +#define EAI_INTR -104 +#define EAI_IDN_ENCODE -105 +#define NI_MAXHOST 255 +#define NI_MAXSERV 32 +#endif + + #ifdef __cplusplus } #endif -#endif /* NETDB_H */ \ No newline at end of file +#endif \ No newline at end of file diff --git a/newlib/libc/sys/hermit/include/netinet/in.h b/newlib/libc/sys/hermit/include/netinet/in.h index ebbfc5c26b..a786e26ef4 100644 --- a/newlib/libc/sys/hermit/include/netinet/in.h +++ b/newlib/libc/sys/hermit/include/netinet/in.h @@ -1,65 +1,452 @@ -/* - * Written by the Chair for Operating Systems, RWTH Aachen University - * - * NO Copyright (C) 2010-2011, Stefan Lankes - * consider these trivial macros to be public domain. - * - * These functions are distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - */ - -#ifndef __NETINET_IN_H__ -#define __NETINET_IN_H__ - -#include -#include -#include -#include +// SPDX-FileCopyrightText: 2005-2014 Rich Felker, et al. +// SPDX-License-Identifier: MIT + +#ifndef _NETINET_IN_H +#define _NETINET_IN_H + +// This file is to be kept in sync with https://github.com/bminor/musl/blob/master/include/netinet/in.h #ifdef __cplusplus +extern "C" { #endif -// Functions for converting between string and network addresses -int inet_pton(int af, const char *src, void *dst); -const char *inet_ntop(int af, const void *src, char *dst, __socklen_t size); -char *inet_ntoa(struct in_addr in); -in_addr_t inet_addr(const char *cp); - -typedef uint16_t in_port_t; -#define htons __htons -#define htonl __htonl -#define ntohl __ntohl -#define nthos __ntohs - -// Functions for converting between host and network byte order -uint32_t htonl(uint32_t hostlong); -uint16_t htons(uint16_t hostshort); -uint32_t ntohl(uint32_t netlong); -uint16_t ntohs(uint16_t netshort); - -int inet_pton(int af, const char *src, void *dst); - -/** 255.255.255.255 */ -#define IPADDR_NONE ((uint32_t)0xffffffffUL) -/** 127.0.0.1 */ -#define IPADDR_LOOPBACK ((uint32_t)0x7f000001UL) -/** 0.0.0.0 */ -#define IPADDR_ANY ((uint32_t)0x00000000UL) -/** 255.255.255.255 */ -#define IPADDR_BROADCAST ((uint32_t)0xffffffffUL) - -/** 255.255.255.255 */ -#define INADDR_NONE IPADDR_NONE -/** 127.0.0.1 */ -#define INADDR_LOOPBACK IPADDR_LOOPBACK -/** 0.0.0.0 */ -#define INADDR_ANY IPADDR_ANY -/** 255.255.255.255 */ -#define INADDR_BROADCAST IPADDR_BROADCAST +#include +#include + + typedef uint16_t in_port_t; + typedef uint32_t in_addr_t; + struct in_addr + { + in_addr_t s_addr; + }; + + struct sockaddr_in + { + sa_family_t sin_family; + in_port_t sin_port; + struct in_addr sin_addr; + uint8_t sin_zero[8]; + }; + + struct in6_addr + { + union + { + uint8_t __s6_addr[16]; + uint16_t __s6_addr16[8]; + uint32_t __s6_addr32[4]; + } __in6_union; + }; +#define s6_addr __in6_union.__s6_addr +#define s6_addr16 __in6_union.__s6_addr16 +#define s6_addr32 __in6_union.__s6_addr32 + + struct sockaddr_in6 + { + sa_family_t sin6_family; + in_port_t sin6_port; + uint32_t sin6_flowinfo; + struct in6_addr sin6_addr; + uint32_t sin6_scope_id; + }; + + struct ipv6_mreq + { + struct in6_addr ipv6mr_multiaddr; + unsigned ipv6mr_interface; + }; + +#define INADDR_ANY ((in_addr_t)0x00000000) +#define INADDR_BROADCAST ((in_addr_t)0xffffffff) +#define INADDR_NONE ((in_addr_t)0xffffffff) +#define INADDR_LOOPBACK ((in_addr_t)0x7f000001) +#define INADDR_DUMMY ((in_addr_t)0xc0000008) + +#define INADDR_UNSPEC_GROUP ((in_addr_t)0xe0000000) +#define INADDR_ALLHOSTS_GROUP ((in_addr_t)0xe0000001) +#define INADDR_ALLRTRS_GROUP ((in_addr_t)0xe0000002) +#define INADDR_ALLSNOOPERS_GROUP ((in_addr_t)0xe000006a) +#define INADDR_MAX_LOCAL_GROUP ((in_addr_t)0xe00000ff) + +#define IN6ADDR_ANY_INIT \ + { \ + { \ + { \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 \ + } \ + } \ + } +#define IN6ADDR_LOOPBACK_INIT \ + { \ + { \ + { \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 \ + } \ + } \ + } + + extern const struct in6_addr in6addr_any, in6addr_loopback; + +#define INET_ADDRSTRLEN 16 +#define INET6_ADDRSTRLEN 46 + + uint32_t htonl(uint32_t); + uint16_t htons(uint16_t); + uint32_t ntohl(uint32_t); + uint16_t ntohs(uint16_t); + +#define IPPORT_RESERVED 1024 + +#define IPPROTO_IP 0 +#define IPPROTO_HOPOPTS 0 +#define IPPROTO_ICMP 1 +#define IPPROTO_IGMP 2 +#define IPPROTO_IPIP 4 +#define IPPROTO_TCP 6 +#define IPPROTO_EGP 8 +#define IPPROTO_PUP 12 +#define IPPROTO_UDP 17 +#define IPPROTO_IDP 22 +#define IPPROTO_TP 29 +#define IPPROTO_DCCP 33 +#define IPPROTO_IPV6 41 +#define IPPROTO_ROUTING 43 +#define IPPROTO_FRAGMENT 44 +#define IPPROTO_RSVP 46 +#define IPPROTO_GRE 47 +#define IPPROTO_ESP 50 +#define IPPROTO_AH 51 +#define IPPROTO_ICMPV6 58 +#define IPPROTO_NONE 59 +#define IPPROTO_DSTOPTS 60 +#define IPPROTO_MTP 92 +#define IPPROTO_BEETPH 94 +#define IPPROTO_ENCAP 98 +#define IPPROTO_PIM 103 +#define IPPROTO_COMP 108 +#define IPPROTO_SCTP 132 +#define IPPROTO_MH 135 +#define IPPROTO_UDPLITE 136 +#define IPPROTO_MPLS 137 +#define IPPROTO_ETHERNET 143 +#define IPPROTO_RAW 255 +#define IPPROTO_MPTCP 262 +#define IPPROTO_MAX 263 + +#define IN6_IS_ADDR_UNSPECIFIED(a) \ + (((uint32_t *)(a))[0] == 0 && ((uint32_t *)(a))[1] == 0 && \ + ((uint32_t *)(a))[2] == 0 && ((uint32_t *)(a))[3] == 0) + +#define IN6_IS_ADDR_LOOPBACK(a) \ + (((uint32_t *)(a))[0] == 0 && ((uint32_t *)(a))[1] == 0 && \ + ((uint32_t *)(a))[2] == 0 && \ + ((uint8_t *)(a))[12] == 0 && ((uint8_t *)(a))[13] == 0 && \ + ((uint8_t *)(a))[14] == 0 && ((uint8_t *)(a))[15] == 1) + +#define IN6_IS_ADDR_MULTICAST(a) (((uint8_t *)(a))[0] == 0xff) + +#define IN6_IS_ADDR_LINKLOCAL(a) \ + ((((uint8_t *)(a))[0]) == 0xfe && (((uint8_t *)(a))[1] & 0xc0) == 0x80) + +#define IN6_IS_ADDR_SITELOCAL(a) \ + ((((uint8_t *)(a))[0]) == 0xfe && (((uint8_t *)(a))[1] & 0xc0) == 0xc0) + +#define IN6_IS_ADDR_V4MAPPED(a) \ + (((uint32_t *)(a))[0] == 0 && ((uint32_t *)(a))[1] == 0 && \ + ((uint8_t *)(a))[8] == 0 && ((uint8_t *)(a))[9] == 0 && \ + ((uint8_t *)(a))[10] == 0xff && ((uint8_t *)(a))[11] == 0xff) + +#define IN6_IS_ADDR_V4COMPAT(a) \ + (((uint32_t *)(a))[0] == 0 && ((uint32_t *)(a))[1] == 0 && \ + ((uint32_t *)(a))[2] == 0 && ((uint8_t *)(a))[15] > 1) + +#define IN6_IS_ADDR_MC_NODELOCAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *)(a))[1] & 0xf) == 0x1)) + +#define IN6_IS_ADDR_MC_LINKLOCAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *)(a))[1] & 0xf) == 0x2)) + +#define IN6_IS_ADDR_MC_SITELOCAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *)(a))[1] & 0xf) == 0x5)) + +#define IN6_IS_ADDR_MC_ORGLOCAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *)(a))[1] & 0xf) == 0x8)) + +#define IN6_IS_ADDR_MC_GLOBAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *)(a))[1] & 0xf) == 0xe)) + +#define __ARE_4_EQUAL(a, b) \ + (!((0 [a] - 0 [b]) | (1 [a] - 1 [b]) | (2 [a] - 2 [b]) | (3 [a] - 3 [b]))) +#define IN6_ARE_ADDR_EQUAL(a, b) \ + __ARE_4_EQUAL((const uint32_t *)(a), (const uint32_t *)(b)) + +#define IN_CLASSA(a) ((((in_addr_t)(a)) & 0x80000000) == 0) +#define IN_CLASSA_NET 0xff000000 +#define IN_CLASSA_NSHIFT 24 +#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET) +#define IN_CLASSA_MAX 128 +#define IN_CLASSB(a) ((((in_addr_t)(a)) & 0xc0000000) == 0x80000000) +#define IN_CLASSB_NET 0xffff0000 +#define IN_CLASSB_NSHIFT 16 +#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET) +#define IN_CLASSB_MAX 65536 +#define IN_CLASSC(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xc0000000) +#define IN_CLASSC_NET 0xffffff00 +#define IN_CLASSC_NSHIFT 8 +#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET) +#define IN_CLASSD(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000) +#define IN_MULTICAST(a) IN_CLASSD(a) +#define IN_EXPERIMENTAL(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xe0000000) +#define IN_BADCLASS(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xf0000000) + +#define IN_LOOPBACKNET 127 + +#define IP_TOS 1 +#define IP_TTL 2 +#define IP_HDRINCL 3 +#define IP_OPTIONS 4 +#define IP_ROUTER_ALERT 5 +#define IP_RECVOPTS 6 +#define IP_RETOPTS 7 +#define IP_PKTINFO 8 +#define IP_PKTOPTIONS 9 +#define IP_PMTUDISC 10 +#define IP_MTU_DISCOVER 10 +#define IP_RECVERR 11 +#define IP_RECVTTL 12 +#define IP_RECVTOS 13 +#define IP_MTU 14 +#define IP_FREEBIND 15 +#define IP_IPSEC_POLICY 16 +#define IP_XFRM_POLICY 17 +#define IP_PASSSEC 18 +#define IP_TRANSPARENT 19 +#define IP_ORIGDSTADDR 20 +#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR +#define IP_MINTTL 21 +#define IP_NODEFRAG 22 +#define IP_CHECKSUM 23 +#define IP_BIND_ADDRESS_NO_PORT 24 +#define IP_RECVFRAGSIZE 25 +#define IP_RECVERR_RFC4884 26 +#define IP_MULTICAST_IF 32 +#define IP_MULTICAST_TTL 33 +#define IP_MULTICAST_LOOP 34 +#define IP_ADD_MEMBERSHIP 35 +#define IP_DROP_MEMBERSHIP 36 +#define IP_UNBLOCK_SOURCE 37 +#define IP_BLOCK_SOURCE 38 +#define IP_ADD_SOURCE_MEMBERSHIP 39 +#define IP_DROP_SOURCE_MEMBERSHIP 40 +#define IP_MSFILTER 41 +#define IP_MULTICAST_ALL 49 +#define IP_UNICAST_IF 50 + +#define IP_RECVRETOPTS IP_RETOPTS + +#define IP_PMTUDISC_DONT 0 +#define IP_PMTUDISC_WANT 1 +#define IP_PMTUDISC_DO 2 +#define IP_PMTUDISC_PROBE 3 +#define IP_PMTUDISC_INTERFACE 4 +#define IP_PMTUDISC_OMIT 5 + +#define IP_DEFAULT_MULTICAST_TTL 1 +#define IP_DEFAULT_MULTICAST_LOOP 1 +#define IP_MAX_MEMBERSHIPS 20 + + struct ip_opts + { + struct in_addr ip_dst; + char ip_opts[40]; + }; + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) + +#define MCAST_JOIN_GROUP 42 +#define MCAST_BLOCK_SOURCE 43 +#define MCAST_UNBLOCK_SOURCE 44 +#define MCAST_LEAVE_GROUP 45 +#define MCAST_JOIN_SOURCE_GROUP 46 +#define MCAST_LEAVE_SOURCE_GROUP 47 +#define MCAST_MSFILTER 48 + +#define MCAST_EXCLUDE 0 +#define MCAST_INCLUDE 1 + + struct ip_mreq + { + struct in_addr imr_multiaddr; + struct in_addr imr_interface; + }; + + struct ip_mreqn + { + struct in_addr imr_multiaddr; + struct in_addr imr_address; + int imr_ifindex; + }; + + struct ip_mreq_source + { + struct in_addr imr_multiaddr; + struct in_addr imr_interface; + struct in_addr imr_sourceaddr; + }; + + struct ip_msfilter + { + struct in_addr imsf_multiaddr; + struct in_addr imsf_interface; + uint32_t imsf_fmode; + uint32_t imsf_numsrc; + struct in_addr imsf_slist[1]; + }; +#define IP_MSFILTER_SIZE(numsrc) \ + (sizeof(struct ip_msfilter) - sizeof(struct in_addr) + (numsrc) * sizeof(struct in_addr)) + + struct group_req + { + uint32_t gr_interface; + struct sockaddr_storage gr_group; + }; + + struct group_source_req + { + uint32_t gsr_interface; + struct sockaddr_storage gsr_group; + struct sockaddr_storage gsr_source; + }; + + struct group_filter + { + uint32_t gf_interface; + struct sockaddr_storage gf_group; + uint32_t gf_fmode; + uint32_t gf_numsrc; + struct sockaddr_storage gf_slist[1]; + }; +#define GROUP_FILTER_SIZE(numsrc) \ + (sizeof(struct group_filter) - sizeof(struct sockaddr_storage) + (numsrc) * sizeof(struct sockaddr_storage)) + + struct in_pktinfo + { + int ipi_ifindex; + struct in_addr ipi_spec_dst; + struct in_addr ipi_addr; + }; + + struct in6_pktinfo + { + struct in6_addr ipi6_addr; + unsigned ipi6_ifindex; + }; + + struct ip6_mtuinfo + { + struct sockaddr_in6 ip6m_addr; + uint32_t ip6m_mtu; + }; +#endif + +#define IPV6_ADDRFORM 1 +#define IPV6_2292PKTINFO 2 +#define IPV6_2292HOPOPTS 3 +#define IPV6_2292DSTOPTS 4 +#define IPV6_2292RTHDR 5 +#define IPV6_2292PKTOPTIONS 6 +#define IPV6_CHECKSUM 7 +#define IPV6_2292HOPLIMIT 8 +#define IPV6_NEXTHOP 9 +#define IPV6_AUTHHDR 10 +#define IPV6_UNICAST_HOPS 16 +#define IPV6_MULTICAST_IF 17 +#define IPV6_MULTICAST_HOPS 18 +#define IPV6_MULTICAST_LOOP 19 +#define IPV6_JOIN_GROUP 20 +#define IPV6_LEAVE_GROUP 21 +#define IPV6_ROUTER_ALERT 22 +#define IPV6_MTU_DISCOVER 23 +#define IPV6_MTU 24 +#define IPV6_RECVERR 25 +#define IPV6_V6ONLY 26 +#define IPV6_JOIN_ANYCAST 27 +#define IPV6_LEAVE_ANYCAST 28 +#define IPV6_MULTICAST_ALL 29 +#define IPV6_ROUTER_ALERT_ISOLATE 30 +#define IPV6_IPSEC_POLICY 34 +#define IPV6_XFRM_POLICY 35 +#define IPV6_HDRINCL 36 + +#define IPV6_RECVPKTINFO 49 +#define IPV6_PKTINFO 50 +#define IPV6_RECVHOPLIMIT 51 +#define IPV6_HOPLIMIT 52 +#define IPV6_RECVHOPOPTS 53 +#define IPV6_HOPOPTS 54 +#define IPV6_RTHDRDSTOPTS 55 +#define IPV6_RECVRTHDR 56 +#define IPV6_RTHDR 57 +#define IPV6_RECVDSTOPTS 58 +#define IPV6_DSTOPTS 59 +#define IPV6_RECVPATHMTU 60 +#define IPV6_PATHMTU 61 +#define IPV6_DONTFRAG 62 +#define IPV6_RECVTCLASS 66 +#define IPV6_TCLASS 67 +#define IPV6_AUTOFLOWLABEL 70 +#define IPV6_ADDR_PREFERENCES 72 +#define IPV6_MINHOPCOUNT 73 +#define IPV6_ORIGDSTADDR 74 +#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR +#define IPV6_TRANSPARENT 75 +#define IPV6_UNICAST_IF 76 +#define IPV6_RECVFRAGSIZE 77 +#define IPV6_FREEBIND 78 + +#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP +#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP +#define IPV6_RXHOPOPTS IPV6_HOPOPTS +#define IPV6_RXDSTOPTS IPV6_DSTOPTS + +#define IPV6_PMTUDISC_DONT 0 +#define IPV6_PMTUDISC_WANT 1 +#define IPV6_PMTUDISC_DO 2 +#define IPV6_PMTUDISC_PROBE 3 +#define IPV6_PMTUDISC_INTERFACE 4 +#define IPV6_PMTUDISC_OMIT 5 + +#define IPV6_PREFER_SRC_TMP 0x0001 +#define IPV6_PREFER_SRC_PUBLIC 0x0002 +#define IPV6_PREFER_SRC_PUBTMP_DEFAULT 0x0100 +#define IPV6_PREFER_SRC_COA 0x0004 +#define IPV6_PREFER_SRC_HOME 0x0400 +#define IPV6_PREFER_SRC_CGA 0x0008 +#define IPV6_PREFER_SRC_NONCGA 0x0800 + +#define IPV6_RTHDR_LOOSE 0 +#define IPV6_RTHDR_STRICT 1 + +#define IPV6_RTHDR_TYPE_0 0 + +#define __UAPI_DEF_IN_ADDR 0 +#define __UAPI_DEF_IN_IPPROTO 0 +#define __UAPI_DEF_IN_PKTINFO 0 +#define __UAPI_DEF_IP_MREQ 0 +#define __UAPI_DEF_SOCKADDR_IN 0 +#define __UAPI_DEF_IN_CLASS 0 +#define __UAPI_DEF_IN6_ADDR 0 +#define __UAPI_DEF_IN6_ADDR_ALT 0 +#define __UAPI_DEF_SOCKADDR_IN6 0 +#define __UAPI_DEF_IPV6_MREQ 0 +#define __UAPI_DEF_IPPROTO_V6 0 +#define __UAPI_DEF_IPV6_OPTIONS 0 +#define __UAPI_DEF_IN6_PKTINFO 0 +#define __UAPI_DEF_IP6_MTUINFO 0 #ifdef __cplusplus } #endif -#endif /* __NETINET_IN_H__ */ +#endif \ No newline at end of file diff --git a/newlib/libc/sys/hermit/include/netinet/tcp.h b/newlib/libc/sys/hermit/include/netinet/tcp.h new file mode 100644 index 0000000000..e2233f6e5a --- /dev/null +++ b/newlib/libc/sys/hermit/include/netinet/tcp.h @@ -0,0 +1,308 @@ +// SPDX-FileCopyrightText: 2005-2014 Rich Felker, et al. +// SPDX-License-Identifier: MIT + +#ifndef _NETINET_TCP_H +#define _NETINET_TCP_H + +// This file is to be kept in sync with https://github.com/bminor/musl/blob/master/include/netinet/tcp.h + +#define TCP_NODELAY 1 +#define TCP_MAXSEG 2 +#define TCP_CORK 3 +#define TCP_KEEPIDLE 4 +#define TCP_KEEPINTVL 5 +#define TCP_KEEPCNT 6 +#define TCP_SYNCNT 7 +#define TCP_LINGER2 8 +#define TCP_DEFER_ACCEPT 9 +#define TCP_WINDOW_CLAMP 10 +#define TCP_INFO 11 +#define TCP_QUICKACK 12 +#define TCP_CONGESTION 13 +#define TCP_MD5SIG 14 +#define TCP_THIN_LINEAR_TIMEOUTS 16 +#define TCP_THIN_DUPACK 17 +#define TCP_USER_TIMEOUT 18 +#define TCP_REPAIR 19 +#define TCP_REPAIR_QUEUE 20 +#define TCP_QUEUE_SEQ 21 +#define TCP_REPAIR_OPTIONS 22 +#define TCP_FASTOPEN 23 +#define TCP_TIMESTAMP 24 +#define TCP_NOTSENT_LOWAT 25 +#define TCP_CC_INFO 26 +#define TCP_SAVE_SYN 27 +#define TCP_SAVED_SYN 28 +#define TCP_REPAIR_WINDOW 29 +#define TCP_FASTOPEN_CONNECT 30 +#define TCP_ULP 31 +#define TCP_MD5SIG_EXT 32 +#define TCP_FASTOPEN_KEY 33 +#define TCP_FASTOPEN_NO_COOKIE 34 +#define TCP_ZEROCOPY_RECEIVE 35 +#define TCP_INQ 36 +#define TCP_TX_DELAY 37 + +#define TCP_CM_INQ TCP_INQ + +#define TCP_ESTABLISHED 1 +#define TCP_SYN_SENT 2 +#define TCP_SYN_RECV 3 +#define TCP_FIN_WAIT1 4 +#define TCP_FIN_WAIT2 5 +#define TCP_TIME_WAIT 6 +#define TCP_CLOSE 7 +#define TCP_CLOSE_WAIT 8 +#define TCP_LAST_ACK 9 +#define TCP_LISTEN 10 +#define TCP_CLOSING 11 + +enum { + TCP_NLA_PAD, + TCP_NLA_BUSY, + TCP_NLA_RWND_LIMITED, + TCP_NLA_SNDBUF_LIMITED, + TCP_NLA_DATA_SEGS_OUT, + TCP_NLA_TOTAL_RETRANS, + TCP_NLA_PACING_RATE, + TCP_NLA_DELIVERY_RATE, + TCP_NLA_SND_CWND, + TCP_NLA_REORDERING, + TCP_NLA_MIN_RTT, + TCP_NLA_RECUR_RETRANS, + TCP_NLA_DELIVERY_RATE_APP_LMT, + TCP_NLA_SNDQ_SIZE, + TCP_NLA_CA_STATE, + TCP_NLA_SND_SSTHRESH, + TCP_NLA_DELIVERED, + TCP_NLA_DELIVERED_CE, + TCP_NLA_BYTES_SENT, + TCP_NLA_BYTES_RETRANS, + TCP_NLA_DSACK_DUPS, + TCP_NLA_REORD_SEEN, + TCP_NLA_SRTT, + TCP_NLA_TIMEOUT_REHASH, + TCP_NLA_BYTES_NOTSENT, + TCP_NLA_EDT, + TCP_NLA_TTL, +}; + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define TCPOPT_EOL 0 +#define TCPOPT_NOP 1 +#define TCPOPT_MAXSEG 2 +#define TCPOPT_WINDOW 3 +#define TCPOPT_SACK_PERMITTED 4 +#define TCPOPT_SACK 5 +#define TCPOPT_TIMESTAMP 8 +#define TCPOLEN_SACK_PERMITTED 2 +#define TCPOLEN_WINDOW 3 +#define TCPOLEN_MAXSEG 4 +#define TCPOLEN_TIMESTAMP 10 + +#define SOL_TCP 6 + +#include +#include +#include + +typedef uint32_t tcp_seq; + +#define TH_FIN 0x01 +#define TH_SYN 0x02 +#define TH_RST 0x04 +#define TH_PUSH 0x08 +#define TH_ACK 0x10 +#define TH_URG 0x20 + +struct tcphdr { +#ifdef _GNU_SOURCE +#ifdef __GNUC__ + __extension__ +#endif + union { struct { + + uint16_t source; + uint16_t dest; + uint32_t seq; + uint32_t ack_seq; +#if __BYTE_ORDER == __LITTLE_ENDIAN + uint16_t res1:4; + uint16_t doff:4; + uint16_t fin:1; + uint16_t syn:1; + uint16_t rst:1; + uint16_t psh:1; + uint16_t ack:1; + uint16_t urg:1; + uint16_t res2:2; +#else + uint16_t doff:4; + uint16_t res1:4; + uint16_t res2:2; + uint16_t urg:1; + uint16_t ack:1; + uint16_t psh:1; + uint16_t rst:1; + uint16_t syn:1; + uint16_t fin:1; +#endif + uint16_t window; + uint16_t check; + uint16_t urg_ptr; + + }; struct { +#endif + + uint16_t th_sport; + uint16_t th_dport; + uint32_t th_seq; + uint32_t th_ack; +#if __BYTE_ORDER == __LITTLE_ENDIAN + uint8_t th_x2:4; + uint8_t th_off:4; +#else + uint8_t th_off:4; + uint8_t th_x2:4; +#endif + uint8_t th_flags; + uint16_t th_win; + uint16_t th_sum; + uint16_t th_urp; + +#ifdef _GNU_SOURCE + }; }; +#endif +}; +#endif + +#ifdef _GNU_SOURCE +#define TCPI_OPT_TIMESTAMPS 1 +#define TCPI_OPT_SACK 2 +#define TCPI_OPT_WSCALE 4 +#define TCPI_OPT_ECN 8 + +#define TCP_CA_Open 0 +#define TCP_CA_Disorder 1 +#define TCP_CA_CWR 2 +#define TCP_CA_Recovery 3 +#define TCP_CA_Loss 4 + +enum tcp_fastopen_client_fail { + TFO_STATUS_UNSPEC, + TFO_COOKIE_UNAVAILABLE, + TFO_DATA_NOT_ACKED, + TFO_SYN_RETRANSMITTED, +}; + +struct tcp_info { + uint8_t tcpi_state; + uint8_t tcpi_ca_state; + uint8_t tcpi_retransmits; + uint8_t tcpi_probes; + uint8_t tcpi_backoff; + uint8_t tcpi_options; + uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4; + uint8_t tcpi_delivery_rate_app_limited : 1, tcpi_fastopen_client_fail : 2; + uint32_t tcpi_rto; + uint32_t tcpi_ato; + uint32_t tcpi_snd_mss; + uint32_t tcpi_rcv_mss; + uint32_t tcpi_unacked; + uint32_t tcpi_sacked; + uint32_t tcpi_lost; + uint32_t tcpi_retrans; + uint32_t tcpi_fackets; + uint32_t tcpi_last_data_sent; + uint32_t tcpi_last_ack_sent; + uint32_t tcpi_last_data_recv; + uint32_t tcpi_last_ack_recv; + uint32_t tcpi_pmtu; + uint32_t tcpi_rcv_ssthresh; + uint32_t tcpi_rtt; + uint32_t tcpi_rttvar; + uint32_t tcpi_snd_ssthresh; + uint32_t tcpi_snd_cwnd; + uint32_t tcpi_advmss; + uint32_t tcpi_reordering; + uint32_t tcpi_rcv_rtt; + uint32_t tcpi_rcv_space; + uint32_t tcpi_total_retrans; + uint64_t tcpi_pacing_rate; + uint64_t tcpi_max_pacing_rate; + uint64_t tcpi_bytes_acked; + uint64_t tcpi_bytes_received; + uint32_t tcpi_segs_out; + uint32_t tcpi_segs_in; + uint32_t tcpi_notsent_bytes; + uint32_t tcpi_min_rtt; + uint32_t tcpi_data_segs_in; + uint32_t tcpi_data_segs_out; + uint64_t tcpi_delivery_rate; + uint64_t tcpi_busy_time; + uint64_t tcpi_rwnd_limited; + uint64_t tcpi_sndbuf_limited; + uint32_t tcpi_delivered; + uint32_t tcpi_delivered_ce; + uint64_t tcpi_bytes_sent; + uint64_t tcpi_bytes_retrans; + uint32_t tcpi_dsack_dups; + uint32_t tcpi_reord_seen; + uint32_t tcpi_rcv_ooopack; + uint32_t tcpi_snd_wnd; +}; + +#define TCP_MD5SIG_MAXKEYLEN 80 + +#define TCP_MD5SIG_FLAG_PREFIX 0x1 +#define TCP_MD5SIG_FLAG_IFINDEX 0x2 + +struct tcp_md5sig { + struct sockaddr_storage tcpm_addr; + uint8_t tcpm_flags; + uint8_t tcpm_prefixlen; + uint16_t tcpm_keylen; + int tcpm_ifindex; + uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; +}; + +struct tcp_diag_md5sig { + uint8_t tcpm_family; + uint8_t tcpm_prefixlen; + uint16_t tcpm_keylen; + uint32_t tcpm_addr[4]; + uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; +}; + +#define TCP_REPAIR_ON 1 +#define TCP_REPAIR_OFF 0 +#define TCP_REPAIR_OFF_NO_WP -1 + +struct tcp_repair_window { + uint32_t snd_wl1; + uint32_t snd_wnd; + uint32_t max_window; + uint32_t rcv_wnd; + uint32_t rcv_wup; +}; + +#define TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT 0x1 + +struct tcp_zerocopy_receive { + uint64_t address; + uint32_t length; + uint32_t recv_skip_hint; + uint32_t inq; + int32_t err; + uint64_t copybuf_address; + int32_t copybuf_len; + uint32_t flags; + uint64_t msg_control; + uint64_t msg_controllen; + uint32_t msg_flags; + uint32_t reserved; +}; + +#endif + +#endif \ No newline at end of file diff --git a/newlib/libc/sys/hermit/include/poll.h b/newlib/libc/sys/hermit/include/poll.h new file mode 100644 index 0000000000..7a465fc87c --- /dev/null +++ b/newlib/libc/sys/hermit/include/poll.h @@ -0,0 +1,4 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#include \ No newline at end of file diff --git a/newlib/libc/sys/hermit/include/pthread.h b/newlib/libc/sys/hermit/include/pthread.h index 2cf2c50de7..cb5a043e37 100644 --- a/newlib/libc/sys/hermit/include/pthread.h +++ b/newlib/libc/sys/hermit/include/pthread.h @@ -1,1032 +1,4 @@ -/* This is an implementation of the threads API of POSIX 1003.1-2001. - * - * -------------------------------------------------------------------------- - * - * Pthreads-embedded (PTE) - POSIX Threads Library for embedded systems - * Copyright(C) 2008 Jason Schmidlapp - * - * Contact Email: jschmidlapp@users.sourceforge.net - * - * - * Pthreads-embedded (PTE) - POSIX Threads Library for embedded systems - * Copyright(C) 2008 Jason Schmidlapp - * - * Contact Email: jschmidlapp@users.sourceforge.net - * - * - * Based upon Pthreads-win32 - POSIX Threads Library for Win32 - * Copyright(C) 1998 John E. Bossom - * Copyright(C) 1999,2005 Pthreads-win32 contributors - * - * Contact Email: rpj@callisto.canberra.edu.au - * - * The original list of contributors to the Pthreads-win32 project - * is contained in the file CONTRIBUTORS.ptw32 included with the - * source code distribution. The list can also be seen at the - * following World Wide Web location: - * http://sources.redhat.com/pthreads-win32/contributors.html - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library in the file COPYING.LIB; - * if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ -#if !defined( PTHREAD_H ) -#define PTHREAD_H +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT -#include - -#define PTE_VERSION 2,8,0,0 -#define PTE_VERSION_STRING "2, 8, 0, 0\0" - -/* There are two implementations of cancel cleanup. - * Note that pthread.h is included in both application - * compilation units and also internally for the library. - * The code here and within the library aims to work - * for all reasonable combinations of environments. - * - * The two implementations are: - * - * C - * C++ - * - */ - -/* - * Define defaults for cleanup code. - * Note: Unless the build explicitly defines one of the following, then - * we default to standard C style cleanup. This style uses setjmp/longjmp - * in the cancelation and thread exit implementations and therefore won't - * do stack unwinding if linked to applications that have it (e.g. - * C++ apps). This is currently consistent with most/all commercial Unix - * POSIX threads implementations. - */ -#if !defined( PTE_CLEANUP_CXX ) && !defined( PTE_CLEANUP_C ) -# define PTE_CLEANUP_C -#endif - -#undef PTE_LEVEL - -#if defined(_POSIX_SOURCE) -#define PTE_LEVEL 0 -/* Early POSIX */ -#endif - -#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309 -#undef PTE_LEVEL -#define PTE_LEVEL 1 -/* Include 1b, 1c and 1d */ -#endif - -#if defined(INCLUDE_NP) -#undef PTE_LEVEL -#define PTE_LEVEL 2 -/* Include Non-Portable extensions */ -#endif - -#define PTE_LEVEL_MAX 3 - -#if !defined(PTE_LEVEL) -#define PTE_LEVEL PTE_LEVEL_MAX -/* Include everything */ -#endif - -/* - * ------------------------------------------------------------- - * - * - * Module: pthread.h - * - * Purpose: - * Provides an implementation of PThreads based upon the - * standard: - * - * POSIX 1003.1-2001 - * and - * The Single Unix Specification version 3 - * - * (these two are equivalent) - * - * in order to enhance code portability between Windows, - * various commercial Unix implementations, and Linux. - * - * See the ANNOUNCE file for a full list of conforming - * routines and defined constants, and a list of missing - * routines and constants not defined in this implementation. - * - * Authors: - * There have been many contributors to this library. - * The initial implementation was contributed by - * John Bossom, and several others have provided major - * sections or revisions of parts of the implementation. - * Often significant effort has been contributed to - * find and fix important bugs and other problems to - * improve the reliability of the library, which sometimes - * is not reflected in the amount of code which changed as - * result. - * As much as possible, the contributors are acknowledged - * in the ChangeLog file in the source code distribution - * where their changes are noted in detail. - * - * Contributors are listed in the CONTRIBUTORS file. - * - * As usual, all bouquets go to the contributors, and all - * brickbats go to the project maintainer. - * - * Maintainer: - * The code base for this project is coordinated and - * eventually pre-tested, packaged, and made available by - * - * Ross Johnson - * - * QA Testers: - * Ultimately, the library is tested in the real world by - * a host of competent and demanding scientists and - * engineers who report bugs and/or provide solutions - * which are then fixed or incorporated into subsequent - * versions of the library. Each time a bug is fixed, a - * test case is written to prove the fix and ensure - * that later changes to the code don't reintroduce the - * same error. The number of test cases is slowly growing - * and therefore so is the code reliability. - * - * Compliance: - * See the file ANNOUNCE for the list of implemented - * and not-implemented routines and defined options. - * Of course, these are all defined is this file as well. - * - * Web site: - * The source code and other information about this library - * are available from - * - * http://sources.redhat.com/pthreads-win32/ - * - * ------------------------------------------------------------- - */ - -#include - -#include -#include - -/* - * Boolean values to make us independent of system includes. - */ -enum -{ - PTE_FALSE = 0, - PTE_TRUE = (! PTE_FALSE) -}; - - - /* - * ------------------------------------------------------------- - * - * POSIX 1003.1-2001 Options - * ========================= - * - * Options are normally set in , which is not provided - * with pthreads-embedded. - * - * For conformance with the Single Unix Specification (version 3), all of the - * options below are defined, and have a value of either -1 (not supported) - * or 200112L (supported). - * - * These options can neither be left undefined nor have a value of 0, because - * either indicates that sysconf(), which is not implemented, may be used at - * runtime to check the status of the option. - * - * _POSIX_THREADS (== 200112L) - * If == 200112L, you can use threads - * - * _POSIX_THREAD_ATTR_STACKSIZE (== 200112L) - * If == 200112L, you can control the size of a thread's - * stack - * pthread_attr_getstacksize - * pthread_attr_setstacksize - * - * _POSIX_THREAD_ATTR_STACKADDR (== -1) - * If == 200112L, you can allocate and control a thread's - * stack. If not supported, the following functions - * will return ENOSYS, indicating they are not - * supported: - * pthread_attr_getstackaddr - * pthread_attr_setstackaddr - * - * _POSIX_THREAD_PRIORITY_SCHEDULING (== -1) - * If == 200112L, you can use realtime scheduling. - * This option indicates that the behaviour of some - * implemented functions conforms to the additional TPS - * requirements in the standard. E.g. rwlocks favour - * writers over readers when threads have equal priority. - * - * _POSIX_THREAD_PRIO_INHERIT (== -1) - * If == 200112L, you can create priority inheritance - * mutexes. - * pthread_mutexattr_getprotocol + - * pthread_mutexattr_setprotocol + - * - * _POSIX_THREAD_PRIO_PROTECT (== -1) - * If == 200112L, you can create priority ceiling mutexes - * Indicates the availability of: - * pthread_mutex_getprioceiling - * pthread_mutex_setprioceiling - * pthread_mutexattr_getprioceiling - * pthread_mutexattr_getprotocol + - * pthread_mutexattr_setprioceiling - * pthread_mutexattr_setprotocol + - * - * _POSIX_THREAD_PROCESS_SHARED (== -1) - * If set, you can create mutexes and condition - * variables that can be shared with another - * process.If set, indicates the availability - * of: - * pthread_mutexattr_getpshared - * pthread_mutexattr_setpshared - * pthread_condattr_getpshared - * pthread_condattr_setpshared - * - * _POSIX_THREAD_SAFE_FUNCTIONS (== 200112L) - * If == 200112L you can use the special *_r library - * functions that provide thread-safe behaviour - * - * _POSIX_READER_WRITER_LOCKS (== 200112L) - * If == 200112L, you can use read/write locks - * - * _POSIX_SPIN_LOCKS (== 200112L) - * If == 200112L, you can use spin locks - * - * _POSIX_BARRIERS (== 200112L) - * If == 200112L, you can use barriers - * - * + These functions provide both 'inherit' and/or - * 'protect' protocol, based upon these macro - * settings. - * - * ------------------------------------------------------------- - */ - - /* - * POSIX Options - */ -#undef _POSIX_THREADS -#define _POSIX_THREADS 200112L - -#undef _POSIX_READER_WRITER_LOCKS -#define _POSIX_READER_WRITER_LOCKS 200112L - -#undef _POSIX_SPIN_LOCKS -#define _POSIX_SPIN_LOCKS 200112L - -#undef _POSIX_BARRIERS -#define _POSIX_BARRIERS 200112L - -#undef _POSIX_THREAD_SAFE_FUNCTIONS -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L - -#undef _POSIX_THREAD_ATTR_STACKSIZE -#define _POSIX_THREAD_ATTR_STACKSIZE 200112L - - /* - * The following options are not supported - */ -#undef _POSIX_THREAD_ATTR_STACKADDR -#define _POSIX_THREAD_ATTR_STACKADDR -1 - -#undef _POSIX_THREAD_PRIO_INHERIT -#define _POSIX_THREAD_PRIO_INHERIT -1 - -#undef _POSIX_THREAD_PRIO_PROTECT -#define _POSIX_THREAD_PRIO_PROTECT -1 - - /* TPS is not fully supported. */ -#undef _POSIX_THREAD_PRIORITY_SCHEDULING -#define _POSIX_THREAD_PRIORITY_SCHEDULING -1 - -#undef _POSIX_THREAD_PROCESS_SHARED -#define _POSIX_THREAD_PROCESS_SHARED -1 - - - /* - * POSIX 1003.1-2001 Limits - * =========================== - * - * These limits are normally set in , which is not provided with - * pthreads-embedded. - * - * PTHREAD_DESTRUCTOR_ITERATIONS - * Maximum number of attempts to destroy - * a thread's thread-specific data on - * termination (must be at least 4) - * - * PTHREAD_KEYS_MAX - * Maximum number of thread-specific data keys - * available per process (must be at least 128) - * - * PTHREAD_STACK_MIN - * Minimum supported stack size for a thread - * - * PTHREAD_THREADS_MAX - * Maximum number of threads supported per - * process (must be at least 64). - * - * SEM_NSEMS_MAX - * The maximum number of semaphores a process can have. - * (must be at least 256) - * - * SEM_VALUE_MAX - * The maximum value a semaphore can have. - * (must be at least 32767) - * - */ -#undef _POSIX_THREAD_DESTRUCTOR_ITERATIONS -#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 - -#undef PTHREAD_DESTRUCTOR_ITERATIONS -#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS - -#undef _POSIX_THREAD_KEYS_MAX -#define _POSIX_THREAD_KEYS_MAX 128 - -#undef PTHREAD_KEYS_MAX -#define PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX - -#undef PTHREAD_STACK_MIN -#define PTHREAD_STACK_MIN 0 - -#undef _POSIX_THREAD_THREADS_MAX -#define _POSIX_THREAD_THREADS_MAX 64 - - /* Arbitrary value */ -#undef PTHREAD_THREADS_MAX -#define PTHREAD_THREADS_MAX 2019 - -#undef _POSIX_SEM_NSEMS_MAX -#define _POSIX_SEM_NSEMS_MAX 256 - - /* Arbitrary value */ -#undef SEM_NSEMS_MAX -#define SEM_NSEMS_MAX 1024 - -#undef _POSIX_SEM_VALUE_MAX -#define _POSIX_SEM_VALUE_MAX 32767 - -#undef SEM_VALUE_MAX -#define SEM_VALUE_MAX INT_MAX - -#include - - /* - * Generic handle type - intended to extend uniqueness beyond - * that available with a simple pointer. It should scale for either - * IA-32 or IA-64. - */ - typedef struct - { - void * p; /* Pointer to actual object */ - unsigned int x; /* Extra information - reuse count etc */ - } pte_handle_t; - - typedef pte_handle_t pthread_t; - typedef struct pthread_attr_t_ * pthread_attr_t; - typedef struct pthread_once_t_ pthread_once_t; - typedef struct pthread_key_t_ * pthread_key_t; - typedef struct pthread_mutex_t_ * pthread_mutex_t; - typedef struct pthread_mutexattr_t_ * pthread_mutexattr_t; - typedef struct pthread_cond_t_ * pthread_cond_t; - typedef struct pthread_condattr_t_ * pthread_condattr_t; - typedef struct pthread_rwlock_t_ * pthread_rwlock_t; - typedef struct pthread_rwlockattr_t_ * pthread_rwlockattr_t; - typedef struct pthread_spinlock_t_ * pthread_spinlock_t; - typedef struct pthread_barrier_t_ * pthread_barrier_t; - typedef struct pthread_barrierattr_t_ * pthread_barrierattr_t; - - /* - * ==================== - * ==================== - * POSIX Threads - * ==================== - * ==================== - */ - - enum - { - /* - * pthread_attr_{get,set}detachstate - */ - PTHREAD_CREATE_JOINABLE = 0, /* Default */ - PTHREAD_CREATE_DETACHED = 1, - - /* - * pthread_attr_{get,set}inheritsched - */ - PTHREAD_INHERIT_SCHED = 0, - PTHREAD_EXPLICIT_SCHED = 1, /* Default */ - - /* - * pthread_{get,set}scope - */ - PTHREAD_SCOPE_PROCESS = 0, - PTHREAD_SCOPE_SYSTEM = 1, /* Default */ - PTHREAD_SCOPE_PROCESS_VFPU = 2, /* PSP specific */ - - /* - * pthread_setcancelstate paramters - */ - PTHREAD_CANCEL_ENABLE = 0, /* Default */ - PTHREAD_CANCEL_DISABLE = 1, - - /* - * pthread_setcanceltype parameters - */ - PTHREAD_CANCEL_ASYNCHRONOUS = 0, - PTHREAD_CANCEL_DEFERRED = 1, /* Default */ - - /* - * pthread_mutexattr_{get,set}pshared - * pthread_condattr_{get,set}pshared - */ - PTHREAD_PROCESS_PRIVATE = 0, - PTHREAD_PROCESS_SHARED = 1, - - /* - * pthread_barrier_wait - */ - PTHREAD_BARRIER_SERIAL_THREAD = -1 - }; - - /* - * ==================== - * ==================== - * Cancelation - * ==================== - * ==================== - */ -#define PTHREAD_CANCELED ((void *) -1) - - - /* - * ==================== - * ==================== - * Once Key - * ==================== - * ==================== - */ -#define PTHREAD_ONCE_INIT { PTE_FALSE, 0, 0, 0} - - struct pthread_once_t_ - { - int state; - void * semaphore; - int numSemaphoreUsers; - int done; /* indicates if user function has been executed */ -// void * lock; -// int reserved1; -// int reserved2; - }; - - - /* - * ==================== - * ==================== - * Object initialisers - * ==================== - * ==================== - */ -#define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) -1) -#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER ((pthread_mutex_t) -2) -#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER ((pthread_mutex_t) -3) - - /* - * Compatibility with LinuxThreads - */ -#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP PTHREAD_RECURSIVE_MUTEX_INITIALIZER -#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP PTHREAD_ERRORCHECK_MUTEX_INITIALIZER - -#define PTHREAD_COND_INITIALIZER ((pthread_cond_t) -1) - -#define PTHREAD_RWLOCK_INITIALIZER ((pthread_rwlock_t) -1) - -#define PTHREAD_SPINLOCK_INITIALIZER ((pthread_spinlock_t) -1) - - - /* - * Mutex types. - */ - enum - { - /* Compatibility with LinuxThreads */ - PTHREAD_MUTEX_FAST_NP, - PTHREAD_MUTEX_RECURSIVE_NP, - PTHREAD_MUTEX_ERRORCHECK_NP, - PTHREAD_MUTEX_TIMED_NP = PTHREAD_MUTEX_FAST_NP, - PTHREAD_MUTEX_ADAPTIVE_NP = PTHREAD_MUTEX_FAST_NP, - /* For compatibility with POSIX */ - PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_FAST_NP, - PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, - PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, - PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL - }; - - - typedef struct pte_cleanup_t pte_cleanup_t; - - typedef void (* pte_cleanup_callback_t)(void *); - - struct pte_cleanup_t - { - pte_cleanup_callback_t routine; - void *arg; - struct pte_cleanup_t *prev; - }; - -#ifdef PTE_CLEANUP_C - - /* - * C implementation of PThreads cancel cleanup - */ - -#define pthread_cleanup_push( _rout, _arg ) \ - { \ - pte_cleanup_t _cleanup; \ - \ - pte_push_cleanup( &_cleanup, (pte_cleanup_callback_t) (_rout), (_arg) ); \ - -#define pthread_cleanup_pop( _execute ) \ - (void) pte_pop_cleanup( _execute ); \ - } - -#else /* PTE_CLEANUP_C */ - -#ifdef PTE_CLEANUP_CXX - - /* - * C++ version of cancel cleanup. - * - John E. Bossom. - */ - - class PThreadCleanup - { - /* - * PThreadCleanup - * - * Purpose - * This class is a C++ helper class that is - * used to implement pthread_cleanup_push/ - * pthread_cleanup_pop. - * The destructor of this class automatically - * pops the pushed cleanup routine regardless - * of how the code exits the scope - * (i.e. such as by an exception) - */ - pte_cleanup_callback_t cleanUpRout; - void * obj; - int executeIt; - - public: - PThreadCleanup() : - cleanUpRout( 0 ), - obj( 0 ), - executeIt( 0 ) - /* - * No cleanup performed - */ - { - } - - PThreadCleanup( - pte_cleanup_callback_t routine, - void * arg ) : - cleanUpRout( routine ), - obj( arg ), - executeIt( 1 ) - /* - * Registers a cleanup routine for 'arg' - */ - { - } - - ~PThreadCleanup() - { - if ( executeIt ) - { - (void) (*cleanUpRout)( obj ); - } - } - - void execute( int exec ) - { - executeIt = exec; - } - }; - - /* - * C++ implementation of PThreads cancel cleanup; - * This implementation takes advantage of a helper - * class who's destructor automatically calls the - * cleanup routine if we exit our scope weirdly - */ -#define pthread_cleanup_push( _rout, _arg ) \ - { \ - PThreadCleanup cleanup((pte_cleanup_callback_t)(_rout), \ - (void *) (_arg) ); - -#define pthread_cleanup_pop( _execute ) \ - cleanup.execute( _execute ); \ - } - -#else - -#error ERROR [__FILE__, line __LINE__]: Cleanup type undefined. - -#endif /* PTE_CLEANUP_CXX */ - -#endif /* PTE_CLEANUP_C */ - - /* - * =============== - * =============== - * Methods - * =============== - * =============== - */ - -#ifdef __cplusplus -extern "C" { -#endif - - int pthread_init (void); - void pthread_terminate (void); - - /* - * PThread Attribute Functions - */ - int pthread_attr_init (pthread_attr_t * attr); - - int pthread_attr_destroy (pthread_attr_t * attr); - - int pthread_attr_getdetachstate (const pthread_attr_t * attr, - int *detachstate); - - int pthread_attr_getstackaddr (const pthread_attr_t * attr, - void **stackaddr); - - int pthread_attr_getstacksize (const pthread_attr_t * attr, - size_t * stacksize); - - int pthread_attr_setdetachstate (pthread_attr_t * attr, - int detachstate); - - int pthread_attr_setstackaddr (pthread_attr_t * attr, - void *stackaddr); - - int pthread_attr_setstacksize (pthread_attr_t * attr, - size_t stacksize); - - int pthread_attr_getschedparam (const pthread_attr_t *attr, - struct sched_param *param); - - int pthread_attr_setschedparam (pthread_attr_t *attr, - const struct sched_param *param); - - int pthread_attr_setschedpolicy (pthread_attr_t *, - int); - - int pthread_attr_getschedpolicy (pthread_attr_t *, - int *); - - int pthread_attr_setinheritsched(pthread_attr_t * attr, - int inheritsched); - - int pthread_attr_getinheritsched(pthread_attr_t * attr, - int * inheritsched); - - int pthread_attr_setscope (pthread_attr_t *, - int); - - int pthread_attr_getscope (const pthread_attr_t *, - int *); - - /* - * PThread Functions - */ - int pthread_create (pthread_t * tid, - const pthread_attr_t * attr, - void *(*start) (void *), - void *arg); - - int pthread_detach (pthread_t tid); - - int pthread_equal (pthread_t t1, - pthread_t t2); - - void pthread_exit (void *value_ptr); - - int pthread_join (pthread_t thread, - void **value_ptr); - - pthread_t pthread_self (void); - - int pthread_cancel (pthread_t thread); - - int pthread_setcancelstate (int state, - int *oldstate); - - int pthread_setcanceltype (int type, - int *oldtype); - - void pthread_testcancel (void); - - int pthread_once (pthread_once_t * once_control, - void (*init_routine) (void)); - -#if PTE_LEVEL >= PTE_LEVEL_MAX - pte_cleanup_t * pte_pop_cleanup (int execute); - - void pte_push_cleanup (pte_cleanup_t * cleanup, - void (*routine) (void *), - void *arg); -#endif /* PTE_LEVEL >= PTE_LEVEL_MAX */ - - /* - * Thread Specific Data Functions - */ - int pthread_key_create (pthread_key_t * key, - void (*destructor) (void *)); - - int pthread_key_delete (pthread_key_t key); - - int pthread_setspecific (pthread_key_t key, - const void *value); - - void * pthread_getspecific (pthread_key_t key); - - - /* - * Mutex Attribute Functions - */ - int pthread_mutexattr_init (pthread_mutexattr_t * attr); - - int pthread_mutexattr_destroy (pthread_mutexattr_t * attr); - - int pthread_mutexattr_getpshared (const pthread_mutexattr_t - * attr, - int *pshared); - - int pthread_mutexattr_setpshared (pthread_mutexattr_t * attr, - int pshared); - - int pthread_mutexattr_settype (pthread_mutexattr_t * attr, int kind); - int pthread_mutexattr_gettype (pthread_mutexattr_t * attr, int *kind); - - /* - * Barrier Attribute Functions - */ - int pthread_barrierattr_init (pthread_barrierattr_t * attr); - - int pthread_barrierattr_destroy (pthread_barrierattr_t * attr); - - int pthread_barrierattr_getpshared (const pthread_barrierattr_t - * attr, - int *pshared); - - int pthread_barrierattr_setpshared (pthread_barrierattr_t * attr, - int pshared); - - /* - * Mutex Functions - */ - int pthread_mutex_init (pthread_mutex_t * mutex, - const pthread_mutexattr_t * attr); - - int pthread_mutex_destroy (pthread_mutex_t * mutex); - - int pthread_mutex_lock (pthread_mutex_t * mutex); - - int pthread_mutex_timedlock(pthread_mutex_t *mutex, - const struct timespec *abstime); - - int pthread_mutex_trylock (pthread_mutex_t * mutex); - - int pthread_mutex_unlock (pthread_mutex_t * mutex); - - /* - * Spinlock Functions - */ - int pthread_spin_init (pthread_spinlock_t * lock, int pshared); - - int pthread_spin_destroy (pthread_spinlock_t * lock); - - int pthread_spin_lock (pthread_spinlock_t * lock); - - int pthread_spin_trylock (pthread_spinlock_t * lock); - - int pthread_spin_unlock (pthread_spinlock_t * lock); - - /* - * Barrier Functions - */ - int pthread_barrier_init (pthread_barrier_t * barrier, - const pthread_barrierattr_t * attr, - unsigned int count); - - int pthread_barrier_destroy (pthread_barrier_t * barrier); - - int pthread_barrier_wait (pthread_barrier_t * barrier); - - /* - * Condition Variable Attribute Functions - */ - int pthread_condattr_init (pthread_condattr_t * attr); - - int pthread_condattr_destroy (pthread_condattr_t * attr); - - int pthread_condattr_getpshared (const pthread_condattr_t * attr, - int *pshared); - - int pthread_condattr_setpshared (pthread_condattr_t * attr, - int pshared); - - /* - * Condition Variable Functions - */ - int pthread_cond_init (pthread_cond_t * cond, - const pthread_condattr_t * attr); - - int pthread_cond_destroy (pthread_cond_t * cond); - - int pthread_cond_wait (pthread_cond_t * cond, - pthread_mutex_t * mutex); - - int pthread_cond_timedwait (pthread_cond_t * cond, - pthread_mutex_t * mutex, - const struct timespec *abstime); - - int pthread_cond_signal (pthread_cond_t * cond); - - int pthread_cond_broadcast (pthread_cond_t * cond); - - /* - * Scheduling - */ - int pthread_setschedparam (pthread_t thread, - int policy, - const struct sched_param *param); - - int pthread_getschedparam (pthread_t thread, - int *policy, - struct sched_param *param); - - int pthread_setconcurrency (int); - - int pthread_getconcurrency (void); - - /* - * Read-Write Lock Functions - */ - int pthread_rwlock_init(pthread_rwlock_t *lock, - const pthread_rwlockattr_t *attr); - - int pthread_rwlock_destroy(pthread_rwlock_t *lock); - - int pthread_rwlock_tryrdlock(pthread_rwlock_t *); - - int pthread_rwlock_trywrlock(pthread_rwlock_t *); - - int pthread_rwlock_rdlock(pthread_rwlock_t *lock); - - int pthread_rwlock_timedrdlock(pthread_rwlock_t *lock, - const struct timespec *abstime); - - int pthread_rwlock_wrlock(pthread_rwlock_t *lock); - - int pthread_rwlock_timedwrlock(pthread_rwlock_t *lock, - const struct timespec *abstime); - - int pthread_rwlock_unlock(pthread_rwlock_t *lock); - - int pthread_rwlockattr_init (pthread_rwlockattr_t * attr); - - int pthread_rwlockattr_destroy (pthread_rwlockattr_t * attr); - - int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * attr, - int *pshared); - - int pthread_rwlockattr_setpshared (pthread_rwlockattr_t * attr, - int pshared); - -#if (PTE_LEVEL >= PTE_LEVEL_MAX - 1) || defined(__hermit__) - - /* - * Signal Functions. Should be defined in but we might - * already have signal.h that don't define these. - */ - int pthread_kill(pthread_t thread, int sig); -#endif - -#if PTE_LEVEL >= PTE_LEVEL_MAX - 1 - /* - * Non-portable functions - */ - - /* - * Compatibility with Linux. - */ - int pthread_mutexattr_setkind_np(pthread_mutexattr_t * attr, - int kind); - int pthread_mutexattr_getkind_np(pthread_mutexattr_t * attr, - int *kind); - - /* - * Possibly supported by other POSIX threads implementations - */ - int pthread_delay_np (struct timespec * interval); - int pthread_num_processors_np(void); - - /* - * Register a system time change with the library. - * Causes the library to perform various functions - * in response to the change. Should be called whenever - * the application's top level window receives a - * WM_TIMECHANGE message. It can be passed directly to - * pthread_create() as a new thread if desired. - */ - void * pthread_timechange_handler_np(void *); - -#endif /*PTE_LEVEL >= PTE_LEVEL_MAX - 1 */ - -#ifdef __cplusplus -} -#endif - -#if PTE_LEVEL >= PTE_LEVEL_MAX - - - -#endif /* PTE_LEVEL >= PTE_LEVEL_MAX */ - - /* - * Some compiler environments don't define some things. - */ -# define _ftime ftime -# define _timeb timeb - -#ifdef __cplusplus - - /* - * Internal exceptions - */ - class pte_exception {}; - class pte_exception_cancel : public pte_exception {}; - class pte_exception_exit : public pte_exception {}; - - /* Operator to be compatible to libstd++ */ - inline bool operator<(pte_handle_t const& l, pte_handle_t const& r) - { - return ((size_t) l.p) < ((size_t) r.p); - } - - /* Operator to be compatible to libstd++ */ - inline bool operator==(pte_handle_t const& l, pte_handle_t const& r) - { - return ((size_t) l.p) == ((size_t) r.p); - } - - // Operator to be compatible to libstd++ - #if __cplusplus > 201703L - #include - - inline std::strong_ordering operator<=>(pte_handle_t const& l, pte_handle_t const& r) - { - return ((size_t) l.p) <=> ((size_t) r.p); - } - #endif -#endif - - -#ifdef PTE_CXX_EXCEPTIONS - - /* - * Redefine the C++ catch keyword to ensure that applications - * propagate our internal exceptions up to the library's internal handlers. - */ -#define catch( E ) \ - catch( pte_exception & ) { throw; } \ - catch( E ) - -#endif /* ! PTE_CXX_EXCEPTIONS */ - -#undef PTE_LEVEL -#undef PTE_LEVEL_MAX - -#endif /* PTHREAD_H */ +#include diff --git a/newlib/libc/sys/hermit/include/pte_types.h b/newlib/libc/sys/hermit/include/pthread/pte_types.h similarity index 100% rename from newlib/libc/sys/hermit/include/pte_types.h rename to newlib/libc/sys/hermit/include/pthread/pte_types.h diff --git a/newlib/libc/sys/hermit/include/pthread/pthread.h b/newlib/libc/sys/hermit/include/pthread/pthread.h new file mode 100644 index 0000000000..eecb2ec3bb --- /dev/null +++ b/newlib/libc/sys/hermit/include/pthread/pthread.h @@ -0,0 +1,1032 @@ +/* This is an implementation of the threads API of POSIX 1003.1-2001. + * + * -------------------------------------------------------------------------- + * + * Pthreads-embedded (PTE) - POSIX Threads Library for embedded systems + * Copyright(C) 2008 Jason Schmidlapp + * + * Contact Email: jschmidlapp@users.sourceforge.net + * + * + * Pthreads-embedded (PTE) - POSIX Threads Library for embedded systems + * Copyright(C) 2008 Jason Schmidlapp + * + * Contact Email: jschmidlapp@users.sourceforge.net + * + * + * Based upon Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2005 Pthreads-win32 contributors + * + * Contact Email: rpj@callisto.canberra.edu.au + * + * The original list of contributors to the Pthreads-win32 project + * is contained in the file CONTRIBUTORS.ptw32 included with the + * source code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ +#if !defined( PTHREAD_H ) +#define PTHREAD_H + +#include "pte_types.h" + +#define PTE_VERSION 2,8,0,0 +#define PTE_VERSION_STRING "2, 8, 0, 0\0" + +/* There are two implementations of cancel cleanup. + * Note that pthread.h is included in both application + * compilation units and also internally for the library. + * The code here and within the library aims to work + * for all reasonable combinations of environments. + * + * The two implementations are: + * + * C + * C++ + * + */ + +/* + * Define defaults for cleanup code. + * Note: Unless the build explicitly defines one of the following, then + * we default to standard C style cleanup. This style uses setjmp/longjmp + * in the cancelation and thread exit implementations and therefore won't + * do stack unwinding if linked to applications that have it (e.g. + * C++ apps). This is currently consistent with most/all commercial Unix + * POSIX threads implementations. + */ +#if !defined( PTE_CLEANUP_CXX ) && !defined( PTE_CLEANUP_C ) +# define PTE_CLEANUP_C +#endif + +#undef PTE_LEVEL + +#if defined(_POSIX_SOURCE) +#define PTE_LEVEL 0 +/* Early POSIX */ +#endif + +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309 +#undef PTE_LEVEL +#define PTE_LEVEL 1 +/* Include 1b, 1c and 1d */ +#endif + +#if defined(INCLUDE_NP) +#undef PTE_LEVEL +#define PTE_LEVEL 2 +/* Include Non-Portable extensions */ +#endif + +#define PTE_LEVEL_MAX 3 + +#if !defined(PTE_LEVEL) +#define PTE_LEVEL PTE_LEVEL_MAX +/* Include everything */ +#endif + +/* + * ------------------------------------------------------------- + * + * + * Module: pthread.h + * + * Purpose: + * Provides an implementation of PThreads based upon the + * standard: + * + * POSIX 1003.1-2001 + * and + * The Single Unix Specification version 3 + * + * (these two are equivalent) + * + * in order to enhance code portability between Windows, + * various commercial Unix implementations, and Linux. + * + * See the ANNOUNCE file for a full list of conforming + * routines and defined constants, and a list of missing + * routines and constants not defined in this implementation. + * + * Authors: + * There have been many contributors to this library. + * The initial implementation was contributed by + * John Bossom, and several others have provided major + * sections or revisions of parts of the implementation. + * Often significant effort has been contributed to + * find and fix important bugs and other problems to + * improve the reliability of the library, which sometimes + * is not reflected in the amount of code which changed as + * result. + * As much as possible, the contributors are acknowledged + * in the ChangeLog file in the source code distribution + * where their changes are noted in detail. + * + * Contributors are listed in the CONTRIBUTORS file. + * + * As usual, all bouquets go to the contributors, and all + * brickbats go to the project maintainer. + * + * Maintainer: + * The code base for this project is coordinated and + * eventually pre-tested, packaged, and made available by + * + * Ross Johnson + * + * QA Testers: + * Ultimately, the library is tested in the real world by + * a host of competent and demanding scientists and + * engineers who report bugs and/or provide solutions + * which are then fixed or incorporated into subsequent + * versions of the library. Each time a bug is fixed, a + * test case is written to prove the fix and ensure + * that later changes to the code don't reintroduce the + * same error. The number of test cases is slowly growing + * and therefore so is the code reliability. + * + * Compliance: + * See the file ANNOUNCE for the list of implemented + * and not-implemented routines and defined options. + * Of course, these are all defined is this file as well. + * + * Web site: + * The source code and other information about this library + * are available from + * + * http://sources.redhat.com/pthreads-win32/ + * + * ------------------------------------------------------------- + */ + +#include + +#include +#include + +/* + * Boolean values to make us independent of system includes. + */ +enum +{ + PTE_FALSE = 0, + PTE_TRUE = (! PTE_FALSE) +}; + + + /* + * ------------------------------------------------------------- + * + * POSIX 1003.1-2001 Options + * ========================= + * + * Options are normally set in , which is not provided + * with pthreads-embedded. + * + * For conformance with the Single Unix Specification (version 3), all of the + * options below are defined, and have a value of either -1 (not supported) + * or 200112L (supported). + * + * These options can neither be left undefined nor have a value of 0, because + * either indicates that sysconf(), which is not implemented, may be used at + * runtime to check the status of the option. + * + * _POSIX_THREADS (== 200112L) + * If == 200112L, you can use threads + * + * _POSIX_THREAD_ATTR_STACKSIZE (== 200112L) + * If == 200112L, you can control the size of a thread's + * stack + * pthread_attr_getstacksize + * pthread_attr_setstacksize + * + * _POSIX_THREAD_ATTR_STACKADDR (== -1) + * If == 200112L, you can allocate and control a thread's + * stack. If not supported, the following functions + * will return ENOSYS, indicating they are not + * supported: + * pthread_attr_getstackaddr + * pthread_attr_setstackaddr + * + * _POSIX_THREAD_PRIORITY_SCHEDULING (== -1) + * If == 200112L, you can use realtime scheduling. + * This option indicates that the behaviour of some + * implemented functions conforms to the additional TPS + * requirements in the standard. E.g. rwlocks favour + * writers over readers when threads have equal priority. + * + * _POSIX_THREAD_PRIO_INHERIT (== -1) + * If == 200112L, you can create priority inheritance + * mutexes. + * pthread_mutexattr_getprotocol + + * pthread_mutexattr_setprotocol + + * + * _POSIX_THREAD_PRIO_PROTECT (== -1) + * If == 200112L, you can create priority ceiling mutexes + * Indicates the availability of: + * pthread_mutex_getprioceiling + * pthread_mutex_setprioceiling + * pthread_mutexattr_getprioceiling + * pthread_mutexattr_getprotocol + + * pthread_mutexattr_setprioceiling + * pthread_mutexattr_setprotocol + + * + * _POSIX_THREAD_PROCESS_SHARED (== -1) + * If set, you can create mutexes and condition + * variables that can be shared with another + * process.If set, indicates the availability + * of: + * pthread_mutexattr_getpshared + * pthread_mutexattr_setpshared + * pthread_condattr_getpshared + * pthread_condattr_setpshared + * + * _POSIX_THREAD_SAFE_FUNCTIONS (== 200112L) + * If == 200112L you can use the special *_r library + * functions that provide thread-safe behaviour + * + * _POSIX_READER_WRITER_LOCKS (== 200112L) + * If == 200112L, you can use read/write locks + * + * _POSIX_SPIN_LOCKS (== 200112L) + * If == 200112L, you can use spin locks + * + * _POSIX_BARRIERS (== 200112L) + * If == 200112L, you can use barriers + * + * + These functions provide both 'inherit' and/or + * 'protect' protocol, based upon these macro + * settings. + * + * ------------------------------------------------------------- + */ + + /* + * POSIX Options + */ +#undef _POSIX_THREADS +#define _POSIX_THREADS 200112L + +#undef _POSIX_READER_WRITER_LOCKS +#define _POSIX_READER_WRITER_LOCKS 200112L + +#undef _POSIX_SPIN_LOCKS +#define _POSIX_SPIN_LOCKS 200112L + +#undef _POSIX_BARRIERS +#define _POSIX_BARRIERS 200112L + +#undef _POSIX_THREAD_SAFE_FUNCTIONS +#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L + +#undef _POSIX_THREAD_ATTR_STACKSIZE +#define _POSIX_THREAD_ATTR_STACKSIZE 200112L + + /* + * The following options are not supported + */ +#undef _POSIX_THREAD_ATTR_STACKADDR +#define _POSIX_THREAD_ATTR_STACKADDR -1 + +#undef _POSIX_THREAD_PRIO_INHERIT +#define _POSIX_THREAD_PRIO_INHERIT -1 + +#undef _POSIX_THREAD_PRIO_PROTECT +#define _POSIX_THREAD_PRIO_PROTECT -1 + + /* TPS is not fully supported. */ +#undef _POSIX_THREAD_PRIORITY_SCHEDULING +#define _POSIX_THREAD_PRIORITY_SCHEDULING -1 + +#undef _POSIX_THREAD_PROCESS_SHARED +#define _POSIX_THREAD_PROCESS_SHARED -1 + + + /* + * POSIX 1003.1-2001 Limits + * =========================== + * + * These limits are normally set in , which is not provided with + * pthreads-embedded. + * + * PTHREAD_DESTRUCTOR_ITERATIONS + * Maximum number of attempts to destroy + * a thread's thread-specific data on + * termination (must be at least 4) + * + * PTHREAD_KEYS_MAX + * Maximum number of thread-specific data keys + * available per process (must be at least 128) + * + * PTHREAD_STACK_MIN + * Minimum supported stack size for a thread + * + * PTHREAD_THREADS_MAX + * Maximum number of threads supported per + * process (must be at least 64). + * + * SEM_NSEMS_MAX + * The maximum number of semaphores a process can have. + * (must be at least 256) + * + * SEM_VALUE_MAX + * The maximum value a semaphore can have. + * (must be at least 32767) + * + */ +#undef _POSIX_THREAD_DESTRUCTOR_ITERATIONS +#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 + +#undef PTHREAD_DESTRUCTOR_ITERATIONS +#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS + +#undef _POSIX_THREAD_KEYS_MAX +#define _POSIX_THREAD_KEYS_MAX 128 + +#undef PTHREAD_KEYS_MAX +#define PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX + +#undef PTHREAD_STACK_MIN +#define PTHREAD_STACK_MIN 0 + +#undef _POSIX_THREAD_THREADS_MAX +#define _POSIX_THREAD_THREADS_MAX 64 + + /* Arbitrary value */ +#undef PTHREAD_THREADS_MAX +#define PTHREAD_THREADS_MAX 2019 + +#undef _POSIX_SEM_NSEMS_MAX +#define _POSIX_SEM_NSEMS_MAX 256 + + /* Arbitrary value */ +#undef SEM_NSEMS_MAX +#define SEM_NSEMS_MAX 1024 + +#undef _POSIX_SEM_VALUE_MAX +#define _POSIX_SEM_VALUE_MAX 32767 + +#undef SEM_VALUE_MAX +#define SEM_VALUE_MAX INT_MAX + +#include + + /* + * Generic handle type - intended to extend uniqueness beyond + * that available with a simple pointer. It should scale for either + * IA-32 or IA-64. + */ + typedef struct + { + void * p; /* Pointer to actual object */ + unsigned int x; /* Extra information - reuse count etc */ + } pte_handle_t; + + typedef pte_handle_t pthread_t; + typedef struct pthread_attr_t_ * pthread_attr_t; + typedef struct pthread_once_t_ pthread_once_t; + typedef struct pthread_key_t_ * pthread_key_t; + typedef struct pthread_mutex_t_ * pthread_mutex_t; + typedef struct pthread_mutexattr_t_ * pthread_mutexattr_t; + typedef struct pthread_cond_t_ * pthread_cond_t; + typedef struct pthread_condattr_t_ * pthread_condattr_t; + typedef struct pthread_rwlock_t_ * pthread_rwlock_t; + typedef struct pthread_rwlockattr_t_ * pthread_rwlockattr_t; + typedef struct pthread_spinlock_t_ * pthread_spinlock_t; + typedef struct pthread_barrier_t_ * pthread_barrier_t; + typedef struct pthread_barrierattr_t_ * pthread_barrierattr_t; + + /* + * ==================== + * ==================== + * POSIX Threads + * ==================== + * ==================== + */ + + enum + { + /* + * pthread_attr_{get,set}detachstate + */ + PTHREAD_CREATE_JOINABLE = 0, /* Default */ + PTHREAD_CREATE_DETACHED = 1, + + /* + * pthread_attr_{get,set}inheritsched + */ + PTHREAD_INHERIT_SCHED = 0, + PTHREAD_EXPLICIT_SCHED = 1, /* Default */ + + /* + * pthread_{get,set}scope + */ + PTHREAD_SCOPE_PROCESS = 0, + PTHREAD_SCOPE_SYSTEM = 1, /* Default */ + PTHREAD_SCOPE_PROCESS_VFPU = 2, /* PSP specific */ + + /* + * pthread_setcancelstate paramters + */ + PTHREAD_CANCEL_ENABLE = 0, /* Default */ + PTHREAD_CANCEL_DISABLE = 1, + + /* + * pthread_setcanceltype parameters + */ + PTHREAD_CANCEL_ASYNCHRONOUS = 0, + PTHREAD_CANCEL_DEFERRED = 1, /* Default */ + + /* + * pthread_mutexattr_{get,set}pshared + * pthread_condattr_{get,set}pshared + */ + PTHREAD_PROCESS_PRIVATE = 0, + PTHREAD_PROCESS_SHARED = 1, + + /* + * pthread_barrier_wait + */ + PTHREAD_BARRIER_SERIAL_THREAD = -1 + }; + + /* + * ==================== + * ==================== + * Cancelation + * ==================== + * ==================== + */ +#define PTHREAD_CANCELED ((void *) -1) + + + /* + * ==================== + * ==================== + * Once Key + * ==================== + * ==================== + */ +#define PTHREAD_ONCE_INIT { PTE_FALSE, 0, 0, 0} + + struct pthread_once_t_ + { + int state; + void * semaphore; + int numSemaphoreUsers; + int done; /* indicates if user function has been executed */ +// void * lock; +// int reserved1; +// int reserved2; + }; + + + /* + * ==================== + * ==================== + * Object initialisers + * ==================== + * ==================== + */ +#define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) -1) +#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER ((pthread_mutex_t) -2) +#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER ((pthread_mutex_t) -3) + + /* + * Compatibility with LinuxThreads + */ +#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP PTHREAD_RECURSIVE_MUTEX_INITIALIZER +#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP PTHREAD_ERRORCHECK_MUTEX_INITIALIZER + +#define PTHREAD_COND_INITIALIZER ((pthread_cond_t) -1) + +#define PTHREAD_RWLOCK_INITIALIZER ((pthread_rwlock_t) -1) + +#define PTHREAD_SPINLOCK_INITIALIZER ((pthread_spinlock_t) -1) + + + /* + * Mutex types. + */ + enum + { + /* Compatibility with LinuxThreads */ + PTHREAD_MUTEX_FAST_NP, + PTHREAD_MUTEX_RECURSIVE_NP, + PTHREAD_MUTEX_ERRORCHECK_NP, + PTHREAD_MUTEX_TIMED_NP = PTHREAD_MUTEX_FAST_NP, + PTHREAD_MUTEX_ADAPTIVE_NP = PTHREAD_MUTEX_FAST_NP, + /* For compatibility with POSIX */ + PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_FAST_NP, + PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, + PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, + PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL + }; + + + typedef struct pte_cleanup_t pte_cleanup_t; + + typedef void (* pte_cleanup_callback_t)(void *); + + struct pte_cleanup_t + { + pte_cleanup_callback_t routine; + void *arg; + struct pte_cleanup_t *prev; + }; + +#ifdef PTE_CLEANUP_C + + /* + * C implementation of PThreads cancel cleanup + */ + +#define pthread_cleanup_push( _rout, _arg ) \ + { \ + pte_cleanup_t _cleanup; \ + \ + pte_push_cleanup( &_cleanup, (pte_cleanup_callback_t) (_rout), (_arg) ); \ + +#define pthread_cleanup_pop( _execute ) \ + (void) pte_pop_cleanup( _execute ); \ + } + +#else /* PTE_CLEANUP_C */ + +#ifdef PTE_CLEANUP_CXX + + /* + * C++ version of cancel cleanup. + * - John E. Bossom. + */ + + class PThreadCleanup + { + /* + * PThreadCleanup + * + * Purpose + * This class is a C++ helper class that is + * used to implement pthread_cleanup_push/ + * pthread_cleanup_pop. + * The destructor of this class automatically + * pops the pushed cleanup routine regardless + * of how the code exits the scope + * (i.e. such as by an exception) + */ + pte_cleanup_callback_t cleanUpRout; + void * obj; + int executeIt; + + public: + PThreadCleanup() : + cleanUpRout( 0 ), + obj( 0 ), + executeIt( 0 ) + /* + * No cleanup performed + */ + { + } + + PThreadCleanup( + pte_cleanup_callback_t routine, + void * arg ) : + cleanUpRout( routine ), + obj( arg ), + executeIt( 1 ) + /* + * Registers a cleanup routine for 'arg' + */ + { + } + + ~PThreadCleanup() + { + if ( executeIt ) + { + (void) (*cleanUpRout)( obj ); + } + } + + void execute( int exec ) + { + executeIt = exec; + } + }; + + /* + * C++ implementation of PThreads cancel cleanup; + * This implementation takes advantage of a helper + * class who's destructor automatically calls the + * cleanup routine if we exit our scope weirdly + */ +#define pthread_cleanup_push( _rout, _arg ) \ + { \ + PThreadCleanup cleanup((pte_cleanup_callback_t)(_rout), \ + (void *) (_arg) ); + +#define pthread_cleanup_pop( _execute ) \ + cleanup.execute( _execute ); \ + } + +#else + +#error ERROR [__FILE__, line __LINE__]: Cleanup type undefined. + +#endif /* PTE_CLEANUP_CXX */ + +#endif /* PTE_CLEANUP_C */ + + /* + * =============== + * =============== + * Methods + * =============== + * =============== + */ + +#ifdef __cplusplus +extern "C" { +#endif + + int pthread_init (void); + void pthread_terminate (void); + + /* + * PThread Attribute Functions + */ + int pthread_attr_init (pthread_attr_t * attr); + + int pthread_attr_destroy (pthread_attr_t * attr); + + int pthread_attr_getdetachstate (const pthread_attr_t * attr, + int *detachstate); + + int pthread_attr_getstackaddr (const pthread_attr_t * attr, + void **stackaddr); + + int pthread_attr_getstacksize (const pthread_attr_t * attr, + size_t * stacksize); + + int pthread_attr_setdetachstate (pthread_attr_t * attr, + int detachstate); + + int pthread_attr_setstackaddr (pthread_attr_t * attr, + void *stackaddr); + + int pthread_attr_setstacksize (pthread_attr_t * attr, + size_t stacksize); + + int pthread_attr_getschedparam (const pthread_attr_t *attr, + struct sched_param *param); + + int pthread_attr_setschedparam (pthread_attr_t *attr, + const struct sched_param *param); + + int pthread_attr_setschedpolicy (pthread_attr_t *, + int); + + int pthread_attr_getschedpolicy (pthread_attr_t *, + int *); + + int pthread_attr_setinheritsched(pthread_attr_t * attr, + int inheritsched); + + int pthread_attr_getinheritsched(pthread_attr_t * attr, + int * inheritsched); + + int pthread_attr_setscope (pthread_attr_t *, + int); + + int pthread_attr_getscope (const pthread_attr_t *, + int *); + + /* + * PThread Functions + */ + int pthread_create (pthread_t * tid, + const pthread_attr_t * attr, + void *(*start) (void *), + void *arg); + + int pthread_detach (pthread_t tid); + + int pthread_equal (pthread_t t1, + pthread_t t2); + + void pthread_exit (void *value_ptr); + + int pthread_join (pthread_t thread, + void **value_ptr); + + pthread_t pthread_self (void); + + int pthread_cancel (pthread_t thread); + + int pthread_setcancelstate (int state, + int *oldstate); + + int pthread_setcanceltype (int type, + int *oldtype); + + void pthread_testcancel (void); + + int pthread_once (pthread_once_t * once_control, + void (*init_routine) (void)); + +#if PTE_LEVEL >= PTE_LEVEL_MAX + pte_cleanup_t * pte_pop_cleanup (int execute); + + void pte_push_cleanup (pte_cleanup_t * cleanup, + void (*routine) (void *), + void *arg); +#endif /* PTE_LEVEL >= PTE_LEVEL_MAX */ + + /* + * Thread Specific Data Functions + */ + int pthread_key_create (pthread_key_t * key, + void (*destructor) (void *)); + + int pthread_key_delete (pthread_key_t key); + + int pthread_setspecific (pthread_key_t key, + const void *value); + + void * pthread_getspecific (pthread_key_t key); + + + /* + * Mutex Attribute Functions + */ + int pthread_mutexattr_init (pthread_mutexattr_t * attr); + + int pthread_mutexattr_destroy (pthread_mutexattr_t * attr); + + int pthread_mutexattr_getpshared (const pthread_mutexattr_t + * attr, + int *pshared); + + int pthread_mutexattr_setpshared (pthread_mutexattr_t * attr, + int pshared); + + int pthread_mutexattr_settype (pthread_mutexattr_t * attr, int kind); + int pthread_mutexattr_gettype (pthread_mutexattr_t * attr, int *kind); + + /* + * Barrier Attribute Functions + */ + int pthread_barrierattr_init (pthread_barrierattr_t * attr); + + int pthread_barrierattr_destroy (pthread_barrierattr_t * attr); + + int pthread_barrierattr_getpshared (const pthread_barrierattr_t + * attr, + int *pshared); + + int pthread_barrierattr_setpshared (pthread_barrierattr_t * attr, + int pshared); + + /* + * Mutex Functions + */ + int pthread_mutex_init (pthread_mutex_t * mutex, + const pthread_mutexattr_t * attr); + + int pthread_mutex_destroy (pthread_mutex_t * mutex); + + int pthread_mutex_lock (pthread_mutex_t * mutex); + + int pthread_mutex_timedlock(pthread_mutex_t *mutex, + const struct timespec *abstime); + + int pthread_mutex_trylock (pthread_mutex_t * mutex); + + int pthread_mutex_unlock (pthread_mutex_t * mutex); + + /* + * Spinlock Functions + */ + int pthread_spin_init (pthread_spinlock_t * lock, int pshared); + + int pthread_spin_destroy (pthread_spinlock_t * lock); + + int pthread_spin_lock (pthread_spinlock_t * lock); + + int pthread_spin_trylock (pthread_spinlock_t * lock); + + int pthread_spin_unlock (pthread_spinlock_t * lock); + + /* + * Barrier Functions + */ + int pthread_barrier_init (pthread_barrier_t * barrier, + const pthread_barrierattr_t * attr, + unsigned int count); + + int pthread_barrier_destroy (pthread_barrier_t * barrier); + + int pthread_barrier_wait (pthread_barrier_t * barrier); + + /* + * Condition Variable Attribute Functions + */ + int pthread_condattr_init (pthread_condattr_t * attr); + + int pthread_condattr_destroy (pthread_condattr_t * attr); + + int pthread_condattr_getpshared (const pthread_condattr_t * attr, + int *pshared); + + int pthread_condattr_setpshared (pthread_condattr_t * attr, + int pshared); + + /* + * Condition Variable Functions + */ + int pthread_cond_init (pthread_cond_t * cond, + const pthread_condattr_t * attr); + + int pthread_cond_destroy (pthread_cond_t * cond); + + int pthread_cond_wait (pthread_cond_t * cond, + pthread_mutex_t * mutex); + + int pthread_cond_timedwait (pthread_cond_t * cond, + pthread_mutex_t * mutex, + const struct timespec *abstime); + + int pthread_cond_signal (pthread_cond_t * cond); + + int pthread_cond_broadcast (pthread_cond_t * cond); + + /* + * Scheduling + */ + int pthread_setschedparam (pthread_t thread, + int policy, + const struct sched_param *param); + + int pthread_getschedparam (pthread_t thread, + int *policy, + struct sched_param *param); + + int pthread_setconcurrency (int); + + int pthread_getconcurrency (void); + + /* + * Read-Write Lock Functions + */ + int pthread_rwlock_init(pthread_rwlock_t *lock, + const pthread_rwlockattr_t *attr); + + int pthread_rwlock_destroy(pthread_rwlock_t *lock); + + int pthread_rwlock_tryrdlock(pthread_rwlock_t *); + + int pthread_rwlock_trywrlock(pthread_rwlock_t *); + + int pthread_rwlock_rdlock(pthread_rwlock_t *lock); + + int pthread_rwlock_timedrdlock(pthread_rwlock_t *lock, + const struct timespec *abstime); + + int pthread_rwlock_wrlock(pthread_rwlock_t *lock); + + int pthread_rwlock_timedwrlock(pthread_rwlock_t *lock, + const struct timespec *abstime); + + int pthread_rwlock_unlock(pthread_rwlock_t *lock); + + int pthread_rwlockattr_init (pthread_rwlockattr_t * attr); + + int pthread_rwlockattr_destroy (pthread_rwlockattr_t * attr); + + int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * attr, + int *pshared); + + int pthread_rwlockattr_setpshared (pthread_rwlockattr_t * attr, + int pshared); + +#if (PTE_LEVEL >= PTE_LEVEL_MAX - 1) || defined(__hermit__) + + /* + * Signal Functions. Should be defined in but we might + * already have signal.h that don't define these. + */ + int pthread_kill(pthread_t thread, int sig); +#endif + +#if PTE_LEVEL >= PTE_LEVEL_MAX - 1 + /* + * Non-portable functions + */ + + /* + * Compatibility with Linux. + */ + int pthread_mutexattr_setkind_np(pthread_mutexattr_t * attr, + int kind); + int pthread_mutexattr_getkind_np(pthread_mutexattr_t * attr, + int *kind); + + /* + * Possibly supported by other POSIX threads implementations + */ + int pthread_delay_np (struct timespec * interval); + int pthread_num_processors_np(void); + + /* + * Register a system time change with the library. + * Causes the library to perform various functions + * in response to the change. Should be called whenever + * the application's top level window receives a + * WM_TIMECHANGE message. It can be passed directly to + * pthread_create() as a new thread if desired. + */ + void * pthread_timechange_handler_np(void *); + +#endif /*PTE_LEVEL >= PTE_LEVEL_MAX - 1 */ + +#ifdef __cplusplus +} +#endif + +#if PTE_LEVEL >= PTE_LEVEL_MAX + + + +#endif /* PTE_LEVEL >= PTE_LEVEL_MAX */ + + /* + * Some compiler environments don't define some things. + */ +# define _ftime ftime +# define _timeb timeb + +#ifdef __cplusplus + + /* + * Internal exceptions + */ + class pte_exception {}; + class pte_exception_cancel : public pte_exception {}; + class pte_exception_exit : public pte_exception {}; + + /* Operator to be compatible to libstd++ */ + inline bool operator<(pte_handle_t const& l, pte_handle_t const& r) + { + return ((size_t) l.p) < ((size_t) r.p); + } + + /* Operator to be compatible to libstd++ */ + inline bool operator==(pte_handle_t const& l, pte_handle_t const& r) + { + return ((size_t) l.p) == ((size_t) r.p); + } + + // Operator to be compatible to libstd++ + #if __cplusplus > 201703L + #include + + inline std::strong_ordering operator<=>(pte_handle_t const& l, pte_handle_t const& r) + { + return ((size_t) l.p) <=> ((size_t) r.p); + } + #endif +#endif + + +#ifdef PTE_CXX_EXCEPTIONS + + /* + * Redefine the C++ catch keyword to ensure that applications + * propagate our internal exceptions up to the library's internal handlers. + */ +#define catch( E ) \ + catch( pte_exception & ) { throw; } \ + catch( E ) + +#endif /* ! PTE_CXX_EXCEPTIONS */ + +#undef PTE_LEVEL +#undef PTE_LEVEL_MAX + +#endif /* PTHREAD_H */ diff --git a/newlib/libc/sys/hermit/include/sys/dirent.h b/newlib/libc/sys/hermit/include/sys/dirent.h index bc71dd55d3..5f5460196b 100644 --- a/newlib/libc/sys/hermit/include/sys/dirent.h +++ b/newlib/libc/sys/hermit/include/sys/dirent.h @@ -1,36 +1,45 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + #ifndef _SYS_DIRENT_H -# define _SYS_DIRENT_H - -/* - * This file was written to be compatible with the BSD directory - * routines, so it looks like it. But it was written from scratch. - * Sean Eric Fagan, sef@Kithrup.COM - */ - -typedef struct _dirdesc { - int dd_fd; - long dd_loc; - long dd_size; - char *dd_buf; - int dd_len; - long dd_seek; -} DIR; +#define _SYS_DIRENT_H -# define __dirfd(dp) ((dp)->dd_fd) +#include -DIR *opendir (const char *); -struct dirent *readdir (DIR *); -void rewinddir (DIR *); -int closedir (DIR *); +#define DT_UNKNOWN 0 +#define DT_FIFO 1 +#define DT_CHR 2 +#define DT_DIR 4 +#define DT_BLK 6 +#define DT_REG 8 +#define DT_LNK 10 +#define DT_SOCK 12 +#define DT_WHT 14 -#include +typedef struct _dirdesc +{ + int dd_fd; + long dd_loc; + long dd_size; + char *dd_buf; + int dd_len; + long dd_seek; +} DIR; + +#define __dirfd(dp) ((dp)->dd_fd) + +DIR *opendir(const char *); +struct dirent *readdir(DIR *); +void rewinddir(DIR *); +int closedir(DIR *); -typedef struct dirent { - long d_ino; - off_t d_off; - unsigned short d_reclen; - /* we need better syntax for variable-sized arrays */ - char d_name[256]; +typedef struct dirent +{ + uint64_t d_ino; + int64_t d_off; + uint16_t d_reclen; + uint8_t d_type; + char d_name[256]; } dirent_t; #endif diff --git a/newlib/libc/sys/hermit/include/sys/errno.h b/newlib/libc/sys/hermit/include/sys/errno.h index fc27561a39..e39024e499 100644 --- a/newlib/libc/sys/hermit/include/sys/errno.h +++ b/newlib/libc/sys/hermit/include/sys/errno.h @@ -1,17 +1,17 @@ -/* libc/sys/hermitsys/errno.h - Errno variable and codes */ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT -/* Written 2015 by Stefan Lankes */ - -#ifndef _SYS_ERRNO_H -#define _SYS_ERRNO_H - -/* --- from newlib's sys/errno.h --- */ - -#include +// This file is to be kept in sync with newlib/libc/include/sys/errno.h +// on which it is based. The error codes are taken from hermit-abi/src/errno.rs +#ifndef _SYS_ERRNO_H_ +#define _SYS_ERRNO_H_ #ifdef __cplusplus extern "C" { #endif +#define _SYS_ERRNO_H_ + +#include #ifndef _REENT_ONLY #define errno (*__errno()) @@ -21,156 +21,673 @@ extern int *__errno (void); extern __IMPORT const char* const _sys_errlist[]; extern __IMPORT int _sys_nerr; -#define __errno_r(ptr) ((ptr)->_errno) - -/* --- end of slight redundancy (the use of struct _reent->_errno is - * hard-coded in perror.c so why pretend anything else could work too ? */ - -#define EPERM 1 /* Operation not permitted */ -#define ENOENT 2 /* No such file or directory */ -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted system call */ -#define EIO 5 /* I/O error */ -#define ENXIO 6 /* No such device or address */ -#define E2BIG 7 /* Argument list too long */ -#define ENOEXEC 8 /* Exec format error */ -#define EBADF 9 /* Bad file number */ -#define ECHILD 10 /* No child processes */ -#define EAGAIN 11 /* Try again */ -#define ENOMEM 12 /* Out of memory */ -#define EACCES 13 /* Permission denied */ -#define EFAULT 14 /* Bad address */ -#define ENOTBLK 15 /* Block device required */ -#define EBUSY 16 /* Device or resource busy */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Cross-device link */ -#define ENODEV 19 /* No such device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENFILE 23 /* File table overflow */ -#define EMFILE 24 /* Too many open files */ -#define ENOTTY 25 /* Not a typewriter */ -#define ETXTBSY 26 /* Text file busy */ -#define EFBIG 27 /* File too large */ -#define ENOSPC 28 /* No space left on device */ -#define ESPIPE 29 /* Illegal seek */ -#define EROFS 30 /* Read-only file system */ -#define EMLINK 31 /* Too many links */ -#define EPIPE 32 /* Broken pipe */ -#define EDOM 33 /* Math argument out of domain of func */ -#define ERANGE 34 /* Math result not representable */ - -#define EDEADLK 35 /* Resource deadlock would occur */ -#define ENAMETOOLONG 36 /* File name too long */ -#define ENOLCK 37 /* No record locks available */ -#define ENOSYS 38 /* Function not implemented */ -#define ENOTEMPTY 39 /* Directory not empty */ -#define ELOOP 40 /* Too many symbolic links encountered */ -#define EWOULDBLOCK EAGAIN /* Operation would block */ -#define ENOMSG 42 /* No message of desired type */ -#define EIDRM 43 /* Identifier removed */ -#define ECHRNG 44 /* Channel number out of range */ -#define EL2NSYNC 45 /* Level 2 not synchronized */ -#define EL3HLT 46 /* Level 3 halted */ -#define EL3RST 47 /* Level 3 reset */ -#define ELNRNG 48 /* Link number out of range */ -#define EUNATCH 49 /* Protocol driver not attached */ -#define ENOCSI 50 /* No CSI structure available */ -#define EL2HLT 51 /* Level 2 halted */ -#define EBADE 52 /* Invalid exchange */ -#define EBADR 53 /* Invalid request descriptor */ -#define EXFULL 54 /* Exchange full */ -#define ENOANO 55 /* No anode */ -#define EBADRQC 56 /* Invalid request code */ -#define EBADSLT 57 /* Invalid slot */ - -#define EDEADLOCK EDEADLK - -#define EBFONT 59 /* Bad font file format */ -#define ENOSTR 60 /* Device not a stream */ -#define ENODATA 61 /* No data available */ -#define ETIME 62 /* Timer expired */ -#define ENOSR 63 /* Out of streams resources */ -#define ENONET 64 /* Machine is not on the network */ -#define ENOPKG 65 /* Package not installed */ -#define EREMOTE 66 /* Object is remote */ -#define ENOLINK 67 /* Link has been severed */ -#define EADV 68 /* Advertise error */ -#define ESRMNT 69 /* Srmount error */ -#define ECOMM 70 /* Communication error on send */ -#define EPROTO 71 /* Protocol error */ -#define EMULTIHOP 72 /* Multihop attempted */ -#define EDOTDOT 73 /* RFS specific error */ -#define EBADMSG 74 /* Not a data message */ -#define EOVERFLOW 75 /* Value too large for defined data type */ -#define ENOTUNIQ 76 /* Name not unique on network */ -#define EBADFD 77 /* File descriptor in bad state */ -#define EREMCHG 78 /* Remote address changed */ -#define ELIBACC 79 /* Can not access a needed shared library */ -#define ELIBBAD 80 /* Accessing a corrupted shared library */ -#define ELIBSCN 81 /* .lib section in a.out corrupted */ -#define ELIBMAX 82 /* Attempting to link in too many shared libraries */ -#define ELIBEXEC 83 /* Cannot exec a shared library directly */ -#define EILSEQ 84 /* Illegal byte sequence */ -#define ERESTART 85 /* Interrupted system call should be restarted */ -#define ESTRPIPE 86 /* Streams pipe error */ -#define EUSERS 87 /* Too many users */ -#define ENOTSOCK 88 /* Socket operation on non-socket */ -#define EDESTADDRREQ 89 /* Destination address required */ -#define EMSGSIZE 90 /* Message too long */ -#define EPROTOTYPE 91 /* Protocol wrong type for socket */ -#define ENOPROTOOPT 92 /* Protocol not available */ -#define EPROTONOSUPPORT 93 /* Protocol not supported */ -#define ESOCKTNOSUPPORT 94 /* Socket type not supported */ -#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -#define EPFNOSUPPORT 96 /* Protocol family not supported */ -#define EAFNOSUPPORT 97 /* Address family not supported by protocol */ -#define EADDRINUSE 98 /* Address already in use */ -#define EADDRNOTAVAIL 99 /* Cannot assign requested address */ -#define ENETDOWN 100 /* Network is down */ -#define ENETUNREACH 101 /* Network is unreachable */ -#define ENETRESET 102 /* Network dropped connection because of reset */ -#define ECONNABORTED 103 /* Software caused connection abort */ -#define ECONNRESET 104 /* Connection reset by peer */ -#define ENOBUFS 105 /* No buffer space available */ -#define EISCONN 106 /* Transport endpoint is already connected */ -#define ENOTCONN 107 /* Transport endpoint is not connected */ -#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ -#define ETOOMANYREFS 109 /* Too many references: cannot splice */ -#define ETIMEDOUT 110 /* Connection timed out */ -#define ECONNREFUSED 111 /* Connection refused */ -#define EHOSTDOWN 112 /* Host is down */ -#define EHOSTUNREACH 113 /* No route to host */ -#define EALREADY 114 /* Operation already in progress */ -#define EINPROGRESS 115 /* Operation now in progress */ -#define ESTALE 116 /* Stale file handle */ -#define EUCLEAN 117 /* Structure needs cleaning */ -#define ENOTNAM 118 /* Not a XENIX named type file */ -#define ENAVAIL 119 /* No XENIX semaphores available */ -#define EISNAM 120 /* Is a named type file */ -#define EREMOTEIO 121 /* Remote I/O error */ -#define EDQUOT 122 /* Quota exceeded */ - -#define ENOMEDIUM 123 /* No medium found */ -#define EMEDIUMTYPE 124 /* Wrong medium type */ -#define ECANCELED 125 /* Operation Canceled */ -#define ENOKEY 126 /* Required key not available */ -#define EKEYEXPIRED 127 /* Key has expired */ -#define EKEYREVOKED 128 /* Key has been revoked */ -#define EKEYREJECTED 129 /* Key was rejected by service */ - -/* for robust mutexes */ -#define EOWNERDEAD 130 /* Owner died */ -#define ENOTRECOVERABLE 131 /* State not recoverable */ - -#define ERFKILL 132 /* Operation not possible due to RF-kill */ - -#define EHWPOISON 133 /* Memory page has hardware error */ - -#define ENOTSUP EOPNOTSUPP -#define EFTYPE 79 /* Inappropriate file type or format */ -#define EILSEQ 84 +#define __errno_r(ptr) _REENT_ERRNO(ptr) + +/** + * Operation not permitted + */ +#define EPERM 1 + +/** + * No such file or directory + */ +#define ENOENT 2 + +/** + * No such process + */ +#define ESRCH 3 + +/** + * Interrupted system call + */ +#define EINTR 4 + +/** + * I/O error + */ +#define EIO 5 + +/** + * No such device or address + */ +#define ENXIO 6 + +/** + * Argument list too long + */ +#define E2BIG 7 + +/** + * Exec format error + */ +#define ENOEXEC 8 + +/** + * Bad file number + */ +#define EBADF 9 + +/** + * No child processes + */ +#define ECHILD 10 + +/** + * Try again + */ +#define EAGAIN 11 + +/** + * Out of memory + */ +#define ENOMEM 12 + +/** + * Permission denied + */ +#define EACCES 13 + +/** + * Bad address + */ +#define EFAULT 14 + +/** + * Block device required + */ +#define ENOTBLK 15 + +/** + * Device or resource busy + */ +#define EBUSY 16 + +/** + * File exists + */ +#define EEXIST 17 + +/** + * Cross-device link + */ +#define EXDEV 18 + +/** + * No such device + */ +#define ENODEV 19 + +/** + * Not a directory + */ +#define ENOTDIR 20 + +/** + * Is a directory + */ +#define EISDIR 21 + +/** + * Invalid argument + */ +#define EINVAL 22 + +/** + * File table overflow + */ +#define ENFILE 23 + +/** + * Too many open files + */ +#define EMFILE 24 + +/** + * Not a typewriter + */ +#define ENOTTY 25 + +/** + * Text file busy + */ +#define ETXTBSY 26 + +/** + * File too large + */ +#define EFBIG 27 + +/** + * No space left on device + */ +#define ENOSPC 28 + +/** + * Illegal seek + */ +#define ESPIPE 29 + +/** + * Read-only file system + */ +#define EROFS 30 + +/** + * Too many links + */ +#define EMLINK 31 + +/** + * Broken pipe + */ +#define EPIPE 32 + +/** + * Math argument out of domain of func + */ +#define EDOM 33 + +/** + * Math result not representable + */ +#define ERANGE 34 + +/** + * Resource deadlock would occur + */ +#define EDEADLK 35 + +/** + * File name too long + */ +#define ENAMETOOLONG 36 + +/** + * No record locks available + */ +#define ENOLCK 37 + +/** + * Function not implemented + */ +#define ENOSYS 38 + +/** + * Directory not empty + */ +#define ENOTEMPTY 39 + +/** + * Too many symbolic links encountered + */ +#define ELOOP 40 + +/** + * Operation would block + */ +#define EWOULDBLOCK EAGAIN + +/** + * No message of desired type + */ +#define ENOMSG 42 + +/** + * Identifier removed + */ +#define EIDRM 43 + +/** + * Channel number out of range + */ +#define ECHRNG 44 + +/** + * Level 2 not synchronized + */ +#define EL2NSYNC 45 + +/** + * Level 3 halted + */ +#define EL3HLT 46 + +/** + * Level 3 reset + */ +#define EL3RST 47 + +/** + * Link number out of range + */ +#define ELNRNG 48 + +/** + * Protocol driver not attached + */ +#define EUNATCH 49 + +/** + * No CSI structure available + */ +#define ENOCSI 50 + +/** + * Level 2 halted + */ +#define EL2HLT 51 + +/** + * Invalid exchange + */ +#define EBADE 52 + +/** + * Invalid request descriptor + */ +#define EBADR 53 + +/** + * Exchange full + */ +#define EXFULL 54 + +/** + * No anode + */ +#define ENOANO 55 + +/** + * Invalid request code + */ +#define EBADRQC 56 + +/** + * Invalid slot + */ +#define EBADSLT 57 + +#define EDEADLOCK EDEADLK + +/** + * Bad font file format + */ +#define EBFONT 59 + +/** + * Device not a stream + */ +#define ENOSTR 60 + +/** + * No data available + */ +#define ENODATA 61 + +/** + * Timer expired + */ +#define ETIME 62 + +/** + * Out of streams resources + */ +#define ENOSR 63 + +/** + * Machine is not on the network + */ +#define ENONET 64 + +/** + * Package not installed + */ +#define ENOPKG 65 + +/** + * Object is remote + */ +#define EREMOTE 66 + +/** + * Link has been severed + */ +#define ENOLINK 67 + +/** + * Advertise error + */ +#define EADV 68 + +/** + * Srmount error + */ +#define ESRMNT 69 + +/** + * Communication error on send + */ +#define ECOMM 70 + +/** + * Protocol error + */ +#define EPROTO 71 + +/** + * Multihop attempted + */ +#define EMULTIHOP 72 + +/** + * RFS specific error + */ +#define EDOTDOT 73 + +/** + * Not a data message + */ +#define EBADMSG 74 + +/** + * Value too large for defined data type + */ +#define EOVERFLOW 75 + +/** + * Name not unique on network + */ +#define ENOTUNIQ 76 + +/** + * File descriptor in bad state + */ +#define EBADFD 77 + +/** + * Remote address changed + */ +#define EREMCHG 78 + +/** + * Can not access a needed shared library + */ +#define ELIBACC 79 + +/** + * Accessing a corrupted shared library + */ +#define ELIBBAD 80 + +/** + * .lib section in a.out corrupted + */ +#define ELIBSCN 81 + +/** + * Attempting to link in too many shared libraries + */ +#define ELIBMAX 82 + +/** + * Cannot exec a shared library directly + */ +#define ELIBEXEC 83 + +/** + * Illegal byte sequence + */ +#define EILSEQ 84 + +/** + * Interrupted system call should be restarted + */ +#define ERESTART 85 + +/** + * Streams pipe error + */ +#define ESTRPIPE 86 + +/** + * Too many users + */ +#define EUSERS 87 + +/** + * Socket operation on non-socket + */ +#define ENOTSOCK 88 + +/** + * Destination address required + */ +#define EDESTADDRREQ 89 + +/** + * Message too long + */ +#define EMSGSIZE 90 + +/** + * Protocol wrong type for socket + */ +#define EPROTOTYPE 91 + +/** + * Protocol not available + */ +#define ENOPROTOOPT 92 + +/** + * Protocol not supported + */ +#define EPROTONOSUPPORT 93 + +/** + * Socket type not supported + */ +#define ESOCKTNOSUPPORT 94 + +/** + * Operation not supported on transport endpoint + */ +#define EOPNOTSUPP 95 + +/** + * Protocol family not supported + */ +#define EPFNOSUPPORT 96 + +/** + * Address family not supported by protocol + */ +#define EAFNOSUPPORT 97 + +/** + * Address already in use + */ +#define EADDRINUSE 98 + +/** + * Cannot assign requested address + */ +#define EADDRNOTAVAIL 99 + +/** + * Network is down + */ +#define ENETDOWN 100 + +/** + * Network is unreachable + */ +#define ENETUNREACH 101 + +/** + * Network dropped connection because of reset + */ +#define ENETRESET 102 + +/** + * Software caused connection abort + */ +#define ECONNABORTED 103 + +/** + * Connection reset by peer + */ +#define ECONNRESET 104 + +/** + * No buffer space available + */ +#define ENOBUFS 105 + +/** + * Transport endpoint is already connected + */ +#define EISCONN 106 + +/** + * Transport endpoint is not connected + */ +#define ENOTCONN 107 + +/** + * Cannot send after transport endpoint shutdown + */ +#define ESHUTDOWN 108 + +/** + * Too many references: cannot splice + */ +#define ETOOMANYREFS 109 + +/** + * Connection timed out + */ +#define ETIMEDOUT 110 + +/** + * Connection refused + */ +#define ECONNREFUSED 111 + +/** + * Host is down + */ +#define EHOSTDOWN 112 + +/** + * No route to host + */ +#define EHOSTUNREACH 113 + +/** + * Operation already in progress + */ +#define EALREADY 114 + +/** + * Operation now in progress + */ +#define EINPROGRESS 115 + +/** + * Stale file handle + */ +#define ESTALE 116 + +/** + * Structure needs cleaning + */ +#define EUCLEAN 117 + +/** + * Not a XENIX named type file + */ +#define ENOTNAM 118 + +/** + * No XENIX semaphores available + */ +#define ENAVAIL 119 + +/** + * Is a named type file + */ +#define EISNAM 120 + +/** + * Remote I/O error + */ +#define EREMOTEIO 121 + +/** + * Quota exceeded + */ +#define EDQUOT 122 + +/** + * No medium found + */ +#define ENOMEDIUM 123 + +/** + * Wrong medium type + */ +#define EMEDIUMTYPE 124 + +/** + * Operation Canceled + */ +#define ECANCELED 125 + +/** + * Required key not available + */ +#define ENOKEY 126 + +/** + * Key has expired + */ +#define EKEYEXPIRED 127 + +/** + * Key has been revoked + */ +#define EKEYREVOKED 128 + +/** + * Key was rejected by service + */ +#define EKEYREJECTED 129 + +/** + * Robust mutexes: Owner died + */ +#define EOWNERDEAD 130 + +/** + * Robust mutexes: State not recoverable + */ +#define ENOTRECOVERABLE 131 + +/** + * Robust mutexes: Operation not possible due to RF-kill + */ +#define ERFKILL 132 + +/** + * Robust mutexes: Memory page has hardware error + */ +#define EHWPOISON 133 + +#define ENOTSUP 134 /* Not supported */ + +#define EFTYPE 135 /* Inappropriate file type or format */ #ifdef __cplusplus } diff --git a/newlib/libc/sys/hermit/include/sys/eventfd.h b/newlib/libc/sys/hermit/include/sys/eventfd.h new file mode 100644 index 0000000000..dcb97c7975 --- /dev/null +++ b/newlib/libc/sys/hermit/include/sys/eventfd.h @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#ifndef _SYS_EVENTFD_H +#define _SYS_EVENTFD_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +typedef uint64_t eventfd_t; + +#define EFD_SEMAPHORE 1 +#define EFD_CLOEXEC O_CLOEXEC +#define EFD_NONBLOCK O_NONBLOCK + +int eventfd(unsigned int, int); +int eventfd_read(int, eventfd_t *); +int eventfd_write(int, eventfd_t); + + +#ifdef __cplusplus +} +#endif + +#endif /* sys/eventfd.h */ \ No newline at end of file diff --git a/newlib/libc/sys/hermit/include/sys/ioctl.h b/newlib/libc/sys/hermit/include/sys/ioctl.h new file mode 100644 index 0000000000..98a27ed15b --- /dev/null +++ b/newlib/libc/sys/hermit/include/sys/ioctl.h @@ -0,0 +1,236 @@ +// SPDX-FileCopyrightText: 2005-2014 Rich Felker, et al. +// SPDX-License-Identifier: MIT + +#ifndef _SYS_IOCTL_H +#define _SYS_IOCTL_H +#ifdef __cplusplus +extern "C" +{ +#endif + +#define _IOC(a, b, c, d) (((a) << 30) | ((b) << 8) | (c) | ((d) << 16)) +#define _IOC_NONE 0U +#define _IOC_WRITE 1U +#define _IOC_READ 2U + +#define _IO(a, b) _IOC(_IOC_NONE, (a), (b), 0) +#define _IOW(a, b, c) _IOC(_IOC_WRITE, (a), (b), sizeof(c)) +#define _IOR(a, b, c) _IOC(_IOC_READ, (a), (b), sizeof(c)) +#define _IOWR(a, b, c) _IOC(_IOC_READ | _IOC_WRITE, (a), (b), sizeof(c)) + +#define TCGETS 0x5401 +#define TCSETS 0x5402 +#define TCSETSW 0x5403 +#define TCSETSF 0x5404 +#define TCGETA 0x5405 +#define TCSETA 0x5406 +#define TCSETAW 0x5407 +#define TCSETAF 0x5408 +#define TCSBRK 0x5409 +#define TCXONC 0x540A +#define TCFLSH 0x540B +#define TIOCEXCL 0x540C +#define TIOCNXCL 0x540D +#define TIOCSCTTY 0x540E +#define TIOCGPGRP 0x540F +#define TIOCSPGRP 0x5410 +#define TIOCOUTQ 0x5411 +#define TIOCSTI 0x5412 +#define TIOCGWINSZ 0x5413 +#define TIOCSWINSZ 0x5414 +#define TIOCMGET 0x5415 +#define TIOCMBIS 0x5416 +#define TIOCMBIC 0x5417 +#define TIOCMSET 0x5418 +#define TIOCGSOFTCAR 0x5419 +#define TIOCSSOFTCAR 0x541A +#define FIONREAD 0x541B +#define TIOCINQ FIONREAD +#define TIOCLINUX 0x541C +#define TIOCCONS 0x541D +#define TIOCGSERIAL 0x541E +#define TIOCSSERIAL 0x541F +#define TIOCPKT 0x5420 +#define FIONBIO 0x5421 +#define TIOCNOTTY 0x5422 +#define TIOCSETD 0x5423 +#define TIOCGETD 0x5424 +#define TCSBRKP 0x5425 +#define TIOCSBRK 0x5427 +#define TIOCCBRK 0x5428 +#define TIOCGSID 0x5429 +#define TIOCGRS485 0x542E +#define TIOCSRS485 0x542F +#define TIOCGPTN 0x80045430 +#define TIOCSPTLCK 0x40045431 +#define TIOCGDEV 0x80045432 +#define TCGETX 0x5432 +#define TCSETX 0x5433 +#define TCSETXF 0x5434 +#define TCSETXW 0x5435 +#define TIOCSIG 0x40045436 +#define TIOCVHANGUP 0x5437 +#define TIOCGPKT 0x80045438 +#define TIOCGPTLCK 0x80045439 +#define TIOCGEXCL 0x80045440 +#define TIOCGPTPEER 0x5441 +#define TIOCGISO7816 0x80285442 +#define TIOCSISO7816 0xc0285443 + +#define FIONCLEX 0x5450 +#define FIOCLEX 0x5451 +#define FIOASYNC 0x5452 +#define TIOCSERCONFIG 0x5453 +#define TIOCSERGWILD 0x5454 +#define TIOCSERSWILD 0x5455 +#define TIOCGLCKTRMIOS 0x5456 +#define TIOCSLCKTRMIOS 0x5457 +#define TIOCSERGSTRUCT 0x5458 +#define TIOCSERGETLSR 0x5459 +#define TIOCSERGETMULTI 0x545A +#define TIOCSERSETMULTI 0x545B + +#define TIOCMIWAIT 0x545C +#define TIOCGICOUNT 0x545D +#define FIOQSIZE 0x5460 + +#define TIOCM_LE 0x001 +#define TIOCM_DTR 0x002 +#define TIOCM_RTS 0x004 +#define TIOCM_ST 0x008 +#define TIOCM_SR 0x010 +#define TIOCM_CTS 0x020 +#define TIOCM_CAR 0x040 +#define TIOCM_RNG 0x080 +#define TIOCM_DSR 0x100 +#define TIOCM_CD TIOCM_CAR +#define TIOCM_RI TIOCM_RNG +#define TIOCM_OUT1 0x2000 +#define TIOCM_OUT2 0x4000 +#define TIOCM_LOOP 0x8000 + +#define FIOSETOWN 0x8901 +#define SIOCSPGRP 0x8902 +#define FIOGETOWN 0x8903 +#define SIOCGPGRP 0x8904 +#define SIOCATMARK 0x8905 +#define SIOCGSTAMP 0x8906 +#define SIOCGSTAMPNS 0x8907 + +#define N_TTY 0 +#define N_SLIP 1 +#define N_MOUSE 2 +#define N_PPP 3 +#define N_STRIP 4 +#define N_AX25 5 +#define N_X25 6 +#define N_6PACK 7 +#define N_MASC 8 +#define N_R3964 9 +#define N_PROFIBUS_FDL 10 +#define N_IRDA 11 +#define N_SMSBLOCK 12 +#define N_HDLC 13 +#define N_SYNC_PPP 14 +#define N_HCI 15 +#define N_GIGASET_M101 16 +#define N_SLCAN 17 +#define N_PPS 18 +#define N_V253 19 +#define N_CAIF 20 +#define N_GSM0710 21 +#define N_TI_WL 22 +#define N_TRACESINK 23 +#define N_TRACEROUTER 24 +#define N_NCI 25 +#define N_SPEAKUP 26 +#define N_NULL 27 + +#define TIOCPKT_DATA 0 +#define TIOCPKT_FLUSHREAD 1 +#define TIOCPKT_FLUSHWRITE 2 +#define TIOCPKT_STOP 4 +#define TIOCPKT_START 8 +#define TIOCPKT_NOSTOP 16 +#define TIOCPKT_DOSTOP 32 +#define TIOCPKT_IOCTL 64 + +#define TIOCSER_TEMT 1 + + struct winsize + { + unsigned short ws_row; + unsigned short ws_col; + unsigned short ws_xpixel; + unsigned short ws_ypixel; + }; + +#define SIOCADDRT 0x890B +#define SIOCDELRT 0x890C +#define SIOCRTMSG 0x890D + +#define SIOCGIFNAME 0x8910 +#define SIOCSIFLINK 0x8911 +#define SIOCGIFCONF 0x8912 +#define SIOCGIFFLAGS 0x8913 +#define SIOCSIFFLAGS 0x8914 +#define SIOCGIFADDR 0x8915 +#define SIOCSIFADDR 0x8916 +#define SIOCGIFDSTADDR 0x8917 +#define SIOCSIFDSTADDR 0x8918 +#define SIOCGIFBRDADDR 0x8919 +#define SIOCSIFBRDADDR 0x891a +#define SIOCGIFNETMASK 0x891b +#define SIOCSIFNETMASK 0x891c +#define SIOCGIFMETRIC 0x891d +#define SIOCSIFMETRIC 0x891e +#define SIOCGIFMEM 0x891f +#define SIOCSIFMEM 0x8920 +#define SIOCGIFMTU 0x8921 +#define SIOCSIFMTU 0x8922 +#define SIOCSIFNAME 0x8923 +#define SIOCSIFHWADDR 0x8924 +#define SIOCGIFENCAP 0x8925 +#define SIOCSIFENCAP 0x8926 +#define SIOCGIFHWADDR 0x8927 +#define SIOCGIFSLAVE 0x8929 +#define SIOCSIFSLAVE 0x8930 +#define SIOCADDMULTI 0x8931 +#define SIOCDELMULTI 0x8932 +#define SIOCGIFINDEX 0x8933 +#define SIOGIFINDEX SIOCGIFINDEX +#define SIOCSIFPFLAGS 0x8934 +#define SIOCGIFPFLAGS 0x8935 +#define SIOCDIFADDR 0x8936 +#define SIOCSIFHWBROADCAST 0x8937 +#define SIOCGIFCOUNT 0x8938 + +#define SIOCGIFBR 0x8940 +#define SIOCSIFBR 0x8941 + +#define SIOCGIFTXQLEN 0x8942 +#define SIOCSIFTXQLEN 0x8943 + +#define SIOCDARP 0x8953 +#define SIOCGARP 0x8954 +#define SIOCSARP 0x8955 + +#define SIOCDRARP 0x8960 +#define SIOCGRARP 0x8961 +#define SIOCSRARP 0x8962 + +#define SIOCGIFMAP 0x8970 +#define SIOCSIFMAP 0x8971 + +#define SIOCADDDLCI 0x8980 +#define SIOCDELDLCI 0x8981 + +#define SIOCDEVPRIVATE 0x89F0 +#define SIOCPROTOPRIVATE 0x89E0 + + int ioctl(int, unsigned long int, ...); + +#ifdef __cplusplus +} +#endif +#endif \ No newline at end of file diff --git a/newlib/libc/sys/hermit/include/sys/ipc.h b/newlib/libc/sys/hermit/include/sys/ipc.h deleted file mode 100644 index 9dc8aff699..0000000000 --- a/newlib/libc/sys/hermit/include/sys/ipc.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2015, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __SYS_IPC_H__ -#define __SYS_IPC_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __KERNEL__ -typedef long key_t; -#endif - -#define IPC_PRIVATE ((key_t) 0) - -/* Obsolete, used only for backwards compatibility and libc5 compiles */ -struct ipc_perm -{ - key_t key; -#if 0 - __kernel_uid_t uid; - __kernel_gid_t gid; - __kernel_uid_t cuid; - __kernel_gid_t cgid; - __kernel_mode_t mode; - unsigned short seq; -#endif -}; - -/* resource get request flags */ -#define IPC_CREAT 00001000 /* create if key is nonexistent */ -#define IPC_EXCL 00002000 /* fail if key exists */ -#define IPC_NOWAIT 00004000 /* return error on wait */ - -/* - * Control commands used with semctl, msgctl and shmctl - * see also specific commands in shm.h - */ -#define IPC_RMID 0 /* remove resource */ -#define IPC_SET 1 /* set ipc_perm options */ -#define IPC_STAT 2 /* get ipc_perm options */ -#define IPC_INFO 3 /* see ipcs */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/newlib/libc/sys/hermit/include/sys/mman.h b/newlib/libc/sys/hermit/include/sys/mman.h index d726a80d64..21bdcac1eb 100644 --- a/newlib/libc/sys/hermit/include/sys/mman.h +++ b/newlib/libc/sys/hermit/include/sys/mman.h @@ -1,303 +1,148 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1982, 1986, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)mman.h 8.2 (Berkeley) 1/9/95 - * $FreeBSD$ - */ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-FileCopyrightText: 2005-2020 Rich Felker, et al. +// SPDX-License-Identifier: MIT -#ifndef _SYS_MMAN_H_ -#define _SYS_MMAN_H_ +#ifndef _SYS_MMAN_H +#define _SYS_MMAN_H -#include -#include +// This file is to be kept in sync with https://github.com/bminor/musl/blob/master/include/sys/mman.h -#if __BSD_VISIBLE -/* - * Inheritance for minherit() - */ -#define INHERIT_SHARE 0 -#define INHERIT_COPY 1 -#define INHERIT_NONE 2 -#define INHERIT_ZERO 3 +#ifdef __cplusplus +extern "C" { #endif -/* - * Protections are chosen from these bits, or-ed together - */ -#define PROT_NONE 0x00 /* no permissions */ -#define PROT_READ 0x01 /* pages can be read */ -#define PROT_WRITE 0x02 /* pages can be written */ -#define PROT_EXEC 0x04 /* pages can be executed */ -#if __BSD_VISIBLE -#define _PROT_ALL (PROT_READ | PROT_WRITE | PROT_EXEC) -#define PROT_EXTRACT(prot) ((prot) & _PROT_ALL) - -#define _PROT_MAX_SHIFT 16 -#define PROT_MAX(prot) ((prot) << _PROT_MAX_SHIFT) -#define PROT_MAX_EXTRACT(prot) (((prot) >> _PROT_MAX_SHIFT) & _PROT_ALL) -#endif - -/* - * Flags contain sharing type and options. - * Sharing types; choose one. - */ -#define MAP_SHARED 0x0001 /* share changes */ -#define MAP_PRIVATE 0x0002 /* changes are private */ -#if __BSD_VISIBLE -#define MAP_COPY MAP_PRIVATE /* Obsolete */ -#endif - -/* - * Other flags - */ -#define MAP_FIXED 0x0010 /* map addr must be exactly as requested */ - -#if __BSD_VISIBLE -#define MAP_RESERVED0020 0x0020 /* previously unimplemented MAP_RENAME */ -#define MAP_RESERVED0040 0x0040 /* previously unimplemented MAP_NORESERVE */ -#define MAP_RESERVED0080 0x0080 /* previously misimplemented MAP_INHERIT */ -#define MAP_RESERVED0100 0x0100 /* previously unimplemented MAP_NOEXTEND */ -#define MAP_HASSEMAPHORE 0x0200 /* region may contain semaphores */ -#define MAP_STACK 0x0400 /* region grows down, like a stack */ -#define MAP_NOSYNC 0x0800 /* page to but do not sync underlying file */ - -/* - * Mapping type - */ -#define MAP_FILE 0x0000 /* map from file (default) */ -#define MAP_ANON 0x1000 /* allocated from memory, swap space */ -#ifndef _KERNEL -#define MAP_ANONYMOUS MAP_ANON /* For compatibility. */ -#endif /* !_KERNEL */ - -/* - * Extended flags - */ -#define MAP_GUARD 0x00002000 /* reserve but don't map address range */ -#define MAP_EXCL 0x00004000 /* for MAP_FIXED, fail if address is used */ -#define MAP_NOCORE 0x00020000 /* dont include these pages in a coredump */ -#define MAP_PREFAULT_READ 0x00040000 /* prefault mapping for reading */ -#ifdef __LP64__ -#define MAP_32BIT 0x00080000 /* map in the low 2GB of address space */ +#include +#include + +#define MAP_FAILED ((void *) -1) + +#define MAP_SHARED 0x01 +#define MAP_PRIVATE 0x02 +#define MAP_SHARED_VALIDATE 0x03 +#define MAP_TYPE 0x0f +#define MAP_FIXED 0x10 +#define MAP_ANON 0x20 +#define MAP_ANONYMOUS MAP_ANON +#define MAP_NORESERVE 0x4000 +#define MAP_GROWSDOWN 0x0100 +#define MAP_DENYWRITE 0x0800 +#define MAP_EXECUTABLE 0x1000 +#define MAP_LOCKED 0x2000 +#define MAP_POPULATE 0x8000 +#define MAP_NONBLOCK 0x10000 +#define MAP_STACK 0x20000 +#define MAP_HUGETLB 0x40000 +#define MAP_SYNC 0x80000 +#define MAP_FIXED_NOREPLACE 0x100000 +#define MAP_FILE 0 + +#define MAP_HUGE_SHIFT 26 +#define MAP_HUGE_MASK 0x3f +#define MAP_HUGE_16KB (14 << 26) +#define MAP_HUGE_64KB (16 << 26) +#define MAP_HUGE_512KB (19 << 26) +#define MAP_HUGE_1MB (20 << 26) +#define MAP_HUGE_2MB (21 << 26) +#define MAP_HUGE_8MB (23 << 26) +#define MAP_HUGE_16MB (24 << 26) +#define MAP_HUGE_32MB (25 << 26) +#define MAP_HUGE_256MB (28 << 26) +#define MAP_HUGE_512MB (29 << 26) +#define MAP_HUGE_1GB (30 << 26) +#define MAP_HUGE_2GB (31 << 26) +#define MAP_HUGE_16GB (34U << 26) + +#define PROT_NONE 0 +#define PROT_READ 1 +#define PROT_WRITE 2 +#define PROT_EXEC 4 +#define PROT_GROWSDOWN 0x01000000 +#define PROT_GROWSUP 0x02000000 + +#define MS_ASYNC 1 +#define MS_INVALIDATE 2 +#define MS_SYNC 4 + +#define MCL_CURRENT 1 +#define MCL_FUTURE 2 +#define MCL_ONFAULT 4 + +#define POSIX_MADV_NORMAL 0 +#define POSIX_MADV_RANDOM 1 +#define POSIX_MADV_SEQUENTIAL 2 +#define POSIX_MADV_WILLNEED 3 +#define POSIX_MADV_DONTNEED 4 + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define MADV_NORMAL 0 +#define MADV_RANDOM 1 +#define MADV_SEQUENTIAL 2 +#define MADV_WILLNEED 3 +#define MADV_DONTNEED 4 +#define MADV_FREE 8 +#define MADV_REMOVE 9 +#define MADV_DONTFORK 10 +#define MADV_DOFORK 11 +#define MADV_MERGEABLE 12 +#define MADV_UNMERGEABLE 13 +#define MADV_HUGEPAGE 14 +#define MADV_NOHUGEPAGE 15 +#define MADV_DONTDUMP 16 +#define MADV_DODUMP 17 +#define MADV_WIPEONFORK 18 +#define MADV_KEEPONFORK 19 +#define MADV_COLD 20 +#define MADV_PAGEOUT 21 +#define MADV_HWPOISON 100 +#define MADV_SOFT_OFFLINE 101 #endif -/* - * Request specific alignment (n == log2 of the desired alignment). - * - * MAP_ALIGNED_SUPER requests optimal superpage alignment, but does - * not enforce a specific alignment. - */ -#define MAP_ALIGNED(n) ((n) << MAP_ALIGNMENT_SHIFT) -#define MAP_ALIGNMENT_SHIFT 24 -#define MAP_ALIGNMENT_MASK MAP_ALIGNED(0xff) -#define MAP_ALIGNED_SUPER MAP_ALIGNED(1) /* align on a superpage */ - -/* - * Flags provided to shm_rename - */ -/* Don't overwrite dest, if it exists */ -#define SHM_RENAME_NOREPLACE (1 << 0) -/* Atomically swap src and dest */ -#define SHM_RENAME_EXCHANGE (1 << 1) +#ifdef _GNU_SOURCE +#define MREMAP_MAYMOVE 1 +#define MREMAP_FIXED 2 +#define MREMAP_DONTUNMAP 4 -#endif /* __BSD_VISIBLE */ +#define MLOCK_ONFAULT 0x01 -#if __POSIX_VISIBLE >= 199309 -/* - * Process memory locking - */ -#define MCL_CURRENT 0x0001 /* Lock only current memory */ -#define MCL_FUTURE 0x0002 /* Lock all future memory as well */ +#define MFD_CLOEXEC 0x0001U +#define MFD_ALLOW_SEALING 0x0002U +#define MFD_HUGETLB 0x0004U #endif -/* - * Error return from mmap() - */ -#define MAP_FAILED ((void *)-1) - -/* - * msync() flags - */ -#define MS_SYNC 0x0000 /* msync synchronously */ -#define MS_ASYNC 0x0001 /* return immediately */ -#define MS_INVALIDATE 0x0002 /* invalidate all cached data */ - -/* - * Advice to madvise - */ -#define _MADV_NORMAL 0 /* no further special treatment */ -#define _MADV_RANDOM 1 /* expect random page references */ -#define _MADV_SEQUENTIAL 2 /* expect sequential page references */ -#define _MADV_WILLNEED 3 /* will need these pages */ -#define _MADV_DONTNEED 4 /* dont need these pages */ - -#if __BSD_VISIBLE -#define MADV_NORMAL _MADV_NORMAL -#define MADV_RANDOM _MADV_RANDOM -#define MADV_SEQUENTIAL _MADV_SEQUENTIAL -#define MADV_WILLNEED _MADV_WILLNEED -#define MADV_DONTNEED _MADV_DONTNEED -#define MADV_FREE 5 /* dont need these pages, and junk contents */ -#define MADV_NOSYNC 6 /* try to avoid flushes to physical media */ -#define MADV_AUTOSYNC 7 /* revert to default flushing strategy */ -#define MADV_NOCORE 8 /* do not include these pages in a core file */ -#define MADV_CORE 9 /* revert to including pages in a core file */ -#define MADV_PROTECT 10 /* protect process from pageout kill */ - -/* - * Return bits from mincore - */ -#define MINCORE_INCORE 0x1 /* Page is incore */ -#define MINCORE_REFERENCED 0x2 /* Page has been referenced by us */ -#define MINCORE_MODIFIED 0x4 /* Page has been modified by us */ -#define MINCORE_REFERENCED_OTHER 0x8 /* Page has been referenced */ -#define MINCORE_MODIFIED_OTHER 0x10 /* Page has been modified */ -#define MINCORE_SUPER 0x60 /* Page is a "super" page */ -#define MINCORE_PSIND(i) (((i) << 5) & MINCORE_SUPER) /* Page size */ - -/* - * Anonymous object constant for shm_open(). - */ -#define SHM_ANON ((char *)1) +void *mmap (void *, size_t, int, int, int, off_t); +int munmap (void *, size_t); -/* - * shmflags for shm_open2() - */ -#define SHM_ALLOW_SEALING 0x00000001 -#define SHM_GROW_ON_WRITE 0x00000002 -#define SHM_LARGEPAGE 0x00000004 +int mprotect (void *, size_t, int); +int msync (void *, size_t, int); -#define SHM_LARGEPAGE_ALLOC_DEFAULT 0 -#define SHM_LARGEPAGE_ALLOC_NOWAIT 1 -#define SHM_LARGEPAGE_ALLOC_HARD 2 +int posix_madvise (void *, size_t, int); -struct shm_largepage_conf { - int psind; - int alloc_policy; - int pad[10]; -}; +int mlock (const void *, size_t); +int munlock (const void *, size_t); +int mlockall (int); +int munlockall (void); -/* - * Flags for memfd_create(). - */ -#define MFD_CLOEXEC 0x00000001 -#define MFD_ALLOW_SEALING 0x00000002 - -#define MFD_HUGETLB 0x00000004 - -#define MFD_HUGE_MASK 0xFC000000 -#define MFD_HUGE_SHIFT 26 -#define MFD_HUGE_64KB (16 << MFD_HUGE_SHIFT) -#define MFD_HUGE_512KB (19 << MFD_HUGE_SHIFT) -#define MFD_HUGE_1MB (20 << MFD_HUGE_SHIFT) -#define MFD_HUGE_2MB (21 << MFD_HUGE_SHIFT) -#define MFD_HUGE_8MB (23 << MFD_HUGE_SHIFT) -#define MFD_HUGE_16MB (24 << MFD_HUGE_SHIFT) -#define MFD_HUGE_32MB (25 << MFD_HUGE_SHIFT) -#define MFD_HUGE_256MB (28 << MFD_HUGE_SHIFT) -#define MFD_HUGE_512MB (29 << MFD_HUGE_SHIFT) -#define MFD_HUGE_1GB (30 << MFD_HUGE_SHIFT) -#define MFD_HUGE_2GB (31 << MFD_HUGE_SHIFT) -#define MFD_HUGE_16GB (34 << MFD_HUGE_SHIFT) - -#endif /* __BSD_VISIBLE */ - -/* - * XXX missing POSIX_TYPED_MEM_* macros and - * posix_typed_mem_info structure. - */ -#if __POSIX_VISIBLE >= 200112 -#define POSIX_MADV_NORMAL _MADV_NORMAL -#define POSIX_MADV_RANDOM _MADV_RANDOM -#define POSIX_MADV_SEQUENTIAL _MADV_SEQUENTIAL -#define POSIX_MADV_WILLNEED _MADV_WILLNEED -#define POSIX_MADV_DONTNEED _MADV_DONTNEED +#ifdef _GNU_SOURCE +void *mremap (void *, size_t, size_t, int, ...); +int remap_file_pages (void *, size_t, int, size_t, int); +int memfd_create (const char *, unsigned); +int mlock2 (const void *, size_t, unsigned); #endif -#ifndef _MODE_T_DECLARED -typedef __mode_t mode_t; -#define _MODE_T_DECLARED +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +int madvise (void *, size_t, int); +int mincore (void *, size_t, unsigned char *); #endif -#ifndef _OFF_T_DECLARED -typedef __off_t off_t; -#define _OFF_T_DECLARED -#endif +int shm_open (const char *, int, mode_t); +int shm_unlink (const char *); -#ifndef _SIZE_T_DECLARED -typedef __size_t size_t; -#define _SIZE_T_DECLARED +#if defined(_LARGEFILE64_SOURCE) +#define mmap64 mmap +#define off64_t off_t #endif -#ifndef _KERNEL - -__BEGIN_DECLS -/* - * XXX not yet implemented: posix_mem_offset(), posix_typed_mem_get_info(), - * posix_typed_mem_open(). - */ -#if __BSD_VISIBLE -int getpagesizes(size_t *, int); -int madvise(void *, size_t, int); -int mincore(const void *, size_t, char *); -int minherit(void *, size_t, int); -#endif -int mlock(const void *, size_t); -#ifndef _MMAP_DECLARED -#define _MMAP_DECLARED -void * mmap(void *, size_t, int, int, int, off_t); -#endif -int mprotect(void *, size_t, int); -int msync(void *, size_t, int); -int munlock(const void *, size_t); -int munmap(void *, size_t); -#if __POSIX_VISIBLE >= 200112 -int posix_madvise(void *, size_t, int); -#endif -#if __POSIX_VISIBLE >= 199309 -int mlockall(int); -int munlockall(void); -int shm_open(const char *, int, mode_t); -int shm_unlink(const char *); -#endif -#if __BSD_VISIBLE -int memfd_create(const char *, unsigned int); -int shm_create_largepage(const char *, int, int, int, mode_t); -int shm_rename(const char *, const char *, int); -#endif -__END_DECLS - -#endif /* !_KERNEL */ - -#ifdef _KERNEL -/* Header file provided outside of Newlib */ -#include +#ifdef __cplusplus +} #endif -#endif /* !_SYS_MMAN_H_ */ +#endif \ No newline at end of file diff --git a/newlib/libc/sys/hermit/include/sys/poll.h b/newlib/libc/sys/hermit/include/sys/poll.h index 32619b5a8f..2906fe15d7 100644 --- a/newlib/libc/sys/hermit/include/sys/poll.h +++ b/newlib/libc/sys/hermit/include/sys/poll.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + /* * Copyright (c) 2015, Stefan Lankes, RWTH Aachen University * All rights reserved. @@ -35,31 +38,19 @@ extern "C" { #endif /* These are specified by iBCS2 */ -#define POLLIN 0x0001 -#define POLLPRI 0x0002 -#define POLLOUT 0x0004 -#define POLLERR 0x0008 -#define POLLHUP 0x0010 -#define POLLNVAL 0x0020 +#define POLLIN 1 +#define POLLPRI 2 +#define POLLOUT 4 +#define POLLERR 8 +#define POLLHUP 16 +#define POLLNVAL 32 -/* The rest seem to be more-or-less nonstandard. Check them! */ -#define POLLRDNORM 0x0040 -#define POLLRDBAND 0x0080 -#ifndef POLLWRNORM -#define POLLWRNORM 0x0100 -#endif -#ifndef POLLWRBAND -#define POLLWRBAND 0x0200 -#endif -#ifndef POLLMSG -#define POLLMSG 0x0400 -#endif -#ifndef POLLREMOVE -#define POLLREMOVE 0x1000 -#endif -#ifndef POLLRDHUP -#define POLLRDHUP 0x2000 -#endif + +#define POLLRDNORM 64 +#define POLLRDBAND 128 +#define POLLWRNORM 256 +#define POLLWRBAND 512 +#define POLLRDHUP 8192 #define POLLFREE 0x4000 /* currently only for epoll */ @@ -71,7 +62,7 @@ struct pollfd { short revents; }; -typedef unsigned long int nfds_t; +typedef unsigned long nfds_t; int poll(struct pollfd *fds, nfds_t nfds, int timeout); diff --git a/newlib/libc/sys/hermit/include/sys/shm.h b/newlib/libc/sys/hermit/include/sys/shm.h deleted file mode 100644 index df3d456e78..0000000000 --- a/newlib/libc/sys/hermit/include/sys/shm.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2015, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __SYS_SHM_H__ -#define __SYS_SHM_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct shmid_ds { - struct ipc_perm shm_perm; /* operation perms */ -#if 0 - int shm_segsz; /* size of segment (bytes) */ - __kernel_time_t shm_atime; /* last attach time */ - __kernel_time_t shm_dtime; /* last detach time */ - __kernel_time_t shm_ctime; /* last change time */ - __kernel_ipc_pid_t shm_cpid; /* pid of creator */ - __kernel_ipc_pid_t shm_lpid; /* pid of last operator */ - unsigned short shm_nattch; /* no. of current attaches */ - unsigned short shm_unused; /* compatibility */ - void *shm_unused2; /* ditto - used by DIPC */ - void *shm_unused3; /* unused */ -#endif -}; - -int shmget(key_t key, size_t size, int shmflg); -void *shmat(int shmid, const void *shmaddr, int shmflg); -int shmdt(const void *shmaddr); -int shmctl(int shmid, int cmd, struct shmid_ds *buf); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/newlib/libc/sys/hermit/include/sys/socket.h b/newlib/libc/sys/hermit/include/sys/socket.h index 3bf0dea57e..d348fae002 100644 --- a/newlib/libc/sys/hermit/include/sys/socket.h +++ b/newlib/libc/sys/hermit/include/sys/socket.h @@ -1,146 +1,362 @@ -#ifndef SOCKET_H -#define SOCKET_H +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#ifndef _SYS_SOCKET_H +#define _SYS_SOCKET_H + +#include + +#ifndef socklen_t +typedef __socklen_t socklen_t; +#define socklen_t socklen_t +#endif + +typedef __sa_family_t sa_family_t; #ifdef __cplusplus extern "C" { #endif -#include -#include -#include -#include +/* from bits/socket.h */ +struct msghdr { + void *msg_name; + socklen_t msg_namelen; + struct iovec *msg_iov; + int msg_iovlen, __pad1; + void *msg_control; + socklen_t msg_controllen, __pad2; + int msg_flags; +}; -/* Protocol families, same as address families. */ -#define PF_INET AF_INET +/* from bits/socket.h */ +struct cmsghdr { + socklen_t cmsg_len; + int __pad1; + int cmsg_level; + int cmsg_type; +}; -// Define socket address structure -#define sa_family_t __sa_family_t +#ifdef _GNU_SOURCE +struct ucred { + pid_t pid; + uid_t uid; + gid_t gid; +}; -typedef struct sockaddr { - uint8_t sa_len; - uint8_t sa_family; - uint8_t sa_data[14]; +struct mmsghdr { + struct msghdr msg_hdr; + unsigned int msg_len; }; -// Define POSIX function names -#define socket sys_socket -#define accept sys_accept -#define listen sys_listen -#define bind sys_bind -#define connect sys_connect -#define getsockname sys_getsockname -#define setsockopt sys_setsockopt -#define getpeername sys_getpeername -#define freeaddrinfo sys_freeaddrinfo -#define getaddrinfo sys_getaddrinfo -#define send sys_send -#define shutdown sys_shutdown -#define recv sys_recv -#define sendto sys_sendto -#define recvfrom sys_recvfrom - -#define SockType uint32_t - - -// Define socket API functions -int32_t sys_socket(int32_t domain, SockType type_, int32_t protocol); -int32_t sys_accept(int32_t s, struct sockaddr *addr, socklen_t *addrlen); -int32_t sys_listen(int32_t s, int32_t backlog); -int32_t sys_bind(int32_t s, const struct sockaddr *name, socklen_t namelen); -int32_t sys_connect(int32_t s, const struct sockaddr *name, socklen_t namelen); -int32_t sys_getsockname(int32_t s, struct sockaddr *name, socklen_t *namelen); -int32_t sys_setsockopt(int32_t s, - int32_t level, - int32_t optname, - const void *optval, - socklen_t optlen); -int32_t getsockopt(int32_t s, int32_t level, int32_t optname, void *optval, socklen_t *optlen); -int32_t sys_getpeername(int32_t s, struct sockaddr *name, socklen_t *namelen); -void sys_freeaddrinfo(addrinfo *ai); -int32_t sys_getaddrinfo(const uint8_t *nodename, - const uint8_t *servname, - const addrinfo *hints, - addrinfo **res); -intptr_t sys_send(int32_t s, const void *mem, uintptr_t len, int32_t _flags); -int32_t sys_shutdown(int32_t s, int32_t how); -intptr_t sys_recv(int32_t fd, uint8_t *buf, uintptr_t len, int32_t flags); -intptr_t sys_sendto(int32_t socket, - const uint8_t *buf, - uintptr_t len, - int32_t flags, - const struct sockaddr *addr, - socklen_t addrlen); -intptr_t sys_recvfrom(int32_t socket, - uint8_t *buf, - uintptr_t len, - int32_t flags, - struct sockaddr *addr, - socklen_t *addrlen); - -// Defines from librs -#define AF_INET 0 -#define AF_INET6 1 - -#define IPPROTO_IP 0 -#define IPPROTO_IPV6 41 -#define IPPROTO_TCP 6 -#define IPPROTO_UDP 17 - -#define IPV6_ADD_MEMBERSHIP 12 -#define IPV6_DROP_MEMBERSHIP 13 -#define IPV6_MULTICAST_LOOP 19 -#define IPV6_V6ONLY 27 - -#define IP_TTL 2 -#define IP_MULTICAST_TTL 5 -#define IP_MULTICAST_LOOP 7 -#define IP_ADD_MEMBERSHIP 3 -#define IP_DROP_MEMBERSHIP 4 +struct timespec; + +int sendmmsg (int, struct mmsghdr *, unsigned int, unsigned int); +int recvmmsg (int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *); +#endif + +struct linger { + int l_onoff; + int l_linger; +}; #define SHUT_RD 0 #define SHUT_WR 1 #define SHUT_RDWR 2 -#define SOCK_DGRAM 2 -#define SOCK_STREAM 1 +#ifndef SOCK_STREAM +#define SOCK_STREAM 1 +#define SOCK_DGRAM 2 +#endif + +#define SOCK_RAW 3 +#define SOCK_RDM 4 +#define SOCK_SEQPACKET 5 +#define SOCK_DCCP 6 +#define SOCK_PACKET 10 + +#ifndef SOCK_CLOEXEC +#define SOCK_CLOEXEC 02000000 +#define SOCK_NONBLOCK 04000 +#endif + +#define PF_UNSPEC 0 +#define PF_LOCAL 1 +#define PF_UNIX PF_LOCAL +#define PF_FILE PF_LOCAL +#define PF_INET 2 +#define PF_AX25 3 +#define PF_IPX 4 +#define PF_APPLETALK 5 +#define PF_NETROM 6 +#define PF_BRIDGE 7 +#define PF_ATMPVC 8 +#define PF_X25 9 +#define PF_INET6 10 +#define PF_ROSE 11 +#define PF_DECnet 12 +#define PF_NETBEUI 13 +#define PF_SECURITY 14 +#define PF_KEY 15 +#define PF_NETLINK 16 +#define PF_ROUTE PF_NETLINK +#define PF_PACKET 17 +#define PF_ASH 18 +#define PF_ECONET 19 +#define PF_ATMSVC 20 +#define PF_RDS 21 +#define PF_SNA 22 +#define PF_IRDA 23 +#define PF_PPPOX 24 +#define PF_WANPIPE 25 +#define PF_LLC 26 +#define PF_IB 27 +#define PF_MPLS 28 +#define PF_CAN 29 +#define PF_TIPC 30 +#define PF_BLUETOOTH 31 +#define PF_IUCV 32 +#define PF_RXRPC 33 +#define PF_ISDN 34 +#define PF_PHONET 35 +#define PF_IEEE802154 36 +#define PF_CAIF 37 +#define PF_ALG 38 +#define PF_NFC 39 +#define PF_VSOCK 40 +#define PF_KCM 41 +#define PF_QIPCRTR 42 +#define PF_MAX 43 -#define SOL_SOCKET 4095 +#define AF_UNSPEC PF_UNSPEC +#define AF_LOCAL PF_LOCAL +#define AF_UNIX AF_LOCAL +#define AF_FILE AF_LOCAL +#define AF_INET PF_INET +#define AF_AX25 PF_AX25 +#define AF_IPX PF_IPX +#define AF_APPLETALK PF_APPLETALK +#define AF_NETROM PF_NETROM +#define AF_BRIDGE PF_BRIDGE +#define AF_ATMPVC PF_ATMPVC +#define AF_X25 PF_X25 +#define AF_INET6 PF_INET6 +#define AF_ROSE PF_ROSE +#define AF_DECnet PF_DECnet +#define AF_NETBEUI PF_NETBEUI +#define AF_SECURITY PF_SECURITY +#define AF_KEY PF_KEY +#define AF_NETLINK PF_NETLINK +#define AF_ROUTE PF_ROUTE +#define AF_PACKET PF_PACKET +#define AF_ASH PF_ASH +#define AF_ECONET PF_ECONET +#define AF_ATMSVC PF_ATMSVC +#define AF_RDS PF_RDS +#define AF_SNA PF_SNA +#define AF_IRDA PF_IRDA +#define AF_PPPOX PF_PPPOX +#define AF_WANPIPE PF_WANPIPE +#define AF_LLC PF_LLC +#define AF_IB PF_IB +#define AF_MPLS PF_MPLS +#define AF_CAN PF_CAN +#define AF_TIPC PF_TIPC +#define AF_BLUETOOTH PF_BLUETOOTH +#define AF_IUCV PF_IUCV +#define AF_RXRPC PF_RXRPC +#define AF_ISDN PF_ISDN +#define AF_PHONET PF_PHONET +#define AF_IEEE802154 PF_IEEE802154 +#define AF_CAIF PF_CAIF +#define AF_ALG PF_ALG +#define AF_NFC PF_NFC +#define AF_VSOCK PF_VSOCK +#define AF_KCM PF_KCM +#define AF_QIPCRTR PF_QIPCRTR +#define AF_MAX PF_MAX -#define SO_BROADCAST 32 -#define SO_ERROR 4103 -#define SO_RCVTIMEO 4102 -#define SO_REUSEADDR 4 -#define SO_SNDTIMEO 4101 -#define SO_LINGER 128 +#ifndef SO_DEBUG +#define SO_DEBUG 1 +#define SO_REUSEADDR 2 +#define SO_TYPE 3 +#define SO_ERROR 4 +#define SO_DONTROUTE 5 +#define SO_BROADCAST 6 +#define SO_SNDBUF 7 +#define SO_RCVBUF 8 +#define SO_KEEPALIVE 9 +#define SO_OOBINLINE 10 +#define SO_NO_CHECK 11 +#define SO_PRIORITY 12 +#define SO_LINGER 13 +#define SO_BSDCOMPAT 14 +#define SO_REUSEPORT 15 +#define SO_PASSCRED 16 +#define SO_PEERCRED 17 +#define SO_RCVLOWAT 18 +#define SO_SNDLOWAT 19 +#define SO_RCVTIMEO 20 +#define SO_SNDTIMEO 21 +#define SO_ACCEPTCONN 30 +#define SO_SNDBUFFORCE 32 +#define SO_RCVBUFFORCE 33 +#define SO_PROTOCOL 38 +#define SO_DOMAIN 39 +#endif -#define TCP_NODELAY 1 -#define MSG_PEEK 1 -#define FIONBIO (int32_t)2148034174u +#define SO_SECURITY_AUTHENTICATION 22 +#define SO_SECURITY_ENCRYPTION_TRANSPORT 23 +#define SO_SECURITY_ENCRYPTION_NETWORK 24 -#define EAI_NONAME -2200 -#define EAI_SERVICE -2201 -#define EAI_FAIL -2202 -#define EAI_MEMORY -2203 -#define EAI_FAMILY -2204 +#define SO_BINDTODEVICE 25 -// Seperate defines -#define SO_SNDBUF 0x1001 -#define SO_RCVBUF 0x1002 +#define SO_ATTACH_FILTER 26 +#define SO_DETACH_FILTER 27 +#define SO_GET_FILTER SO_ATTACH_FILTER +#define SO_PEERNAME 28 +#define SO_TIMESTAMP 29 +#define SCM_TIMESTAMP SO_TIMESTAMP -#define FD_BIT (1 << 30) -#define FD_SETSIZE 32 -#define FD_SET(n, p) ((p)->fd_bits[((n) & ~FD_BIT)/8] |= (1 << (((n) & ~FD_BIT) & 7))) -#define FD_CLR(n, p) ((p)->fd_bits[((n) & ~FD_BIT)/8] &= ~(1 << (((n) & ~FD_BIT) & 7))) -#define FD_ISSET(n,p) ((p)->fd_bits[((n) & ~FD_BIT)/8] & (1 << (((n) & ~FD_BIT) & 7))) -#define FD_ZERO(p) memset((void*)(p),0,sizeof(*(p))) +#define SO_PEERSEC 31 +#define SO_PASSSEC 34 +#define SO_TIMESTAMPNS 35 +#define SCM_TIMESTAMPNS SO_TIMESTAMPNS +#define SO_MARK 36 +#define SO_TIMESTAMPING 37 +#define SCM_TIMESTAMPING SO_TIMESTAMPING +#define SO_RXQ_OVFL 40 +#define SO_WIFI_STATUS 41 +#define SCM_WIFI_STATUS SO_WIFI_STATUS +#define SO_PEEK_OFF 42 +#define SO_NOFCS 43 +#define SO_LOCK_FILTER 44 +#define SO_SELECT_ERR_QUEUE 45 +#define SO_BUSY_POLL 46 +#define SO_MAX_PACING_RATE 47 +#define SO_BPF_EXTENSIONS 48 +#define SO_INCOMING_CPU 49 +#define SO_ATTACH_BPF 50 +#define SO_DETACH_BPF SO_DETACH_FILTER +#define SO_ATTACH_REUSEPORT_CBPF 51 +#define SO_ATTACH_REUSEPORT_EBPF 52 +#define SO_CNX_ADVICE 53 +#define SCM_TIMESTAMPING_OPT_STATS 54 +#define SO_MEMINFO 55 +#define SO_INCOMING_NAPI_ID 56 +#define SO_COOKIE 57 +#define SCM_TIMESTAMPING_PKTINFO 58 +#define SO_PEERGROUPS 59 + +#ifndef SOL_SOCKET +#define SOL_SOCKET 1 +#endif -typedef struct fd_set { - unsigned char fd_bits [(FD_SETSIZE+7)/8]; -} fd_set; +#define SOL_IP 0 +#define SOL_IPV6 41 +#define SOL_ICMPV6 58 + +#define SOL_RAW 255 +#define SOL_DECNET 261 +#define SOL_X25 262 +#define SOL_PACKET 263 +#define SOL_ATM 264 +#define SOL_AAL 265 +#define SOL_IRDA 266 +#define SOL_NETBEUI 267 +#define SOL_LLC 268 +#define SOL_DCCP 269 +#define SOL_NETLINK 270 +#define SOL_TIPC 271 +#define SOL_RXRPC 272 +#define SOL_PPPOL2TP 273 +#define SOL_BLUETOOTH 274 +#define SOL_PNPIPE 275 +#define SOL_RDS 276 +#define SOL_IUCV 277 +#define SOL_CAIF 278 +#define SOL_ALG 279 +#define SOL_NFC 280 +#define SOL_KCM 281 + +#define SOMAXCONN 128 + +#define MSG_OOB 0x0001 +#define MSG_PEEK 0x0002 +#define MSG_DONTROUTE 0x0004 +#define MSG_CTRUNC 0x0008 +#define MSG_PROXY 0x0010 +#define MSG_TRUNC 0x0020 +#define MSG_DONTWAIT 0x0040 +#define MSG_EOR 0x0080 +#define MSG_WAITALL 0x0100 +#define MSG_FIN 0x0200 +#define MSG_SYN 0x0400 +#define MSG_CONFIRM 0x0800 +#define MSG_RST 0x1000 +#define MSG_ERRQUEUE 0x2000 +#define MSG_NOSIGNAL 0x4000 +#define MSG_MORE 0x8000 +#define MSG_WAITFORONE 0x10000 +#define MSG_BATCH 0x40000 +#define MSG_FASTOPEN 0x20000000 +#define MSG_CMSG_CLOEXEC 0x40000000 + +#define __CMSG_LEN(cmsg) (((cmsg)->cmsg_len + sizeof(long) - 1) & ~(long)(sizeof(long) - 1)) +#define __CMSG_NEXT(cmsg) ((unsigned char *)(cmsg) + __CMSG_LEN(cmsg)) +#define __MHDR_END(mhdr) ((unsigned char *)(mhdr)->msg_control + (mhdr)->msg_controllen) + +#define CMSG_DATA(cmsg) ((unsigned char *) (((struct cmsghdr *)(cmsg)) + 1)) +#define CMSG_NXTHDR(mhdr, cmsg) ((cmsg)->cmsg_len < sizeof (struct cmsghdr) || \ + __CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \ + ? 0 : (struct cmsghdr *)__CMSG_NEXT(cmsg)) +#define CMSG_FIRSTHDR(mhdr) ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0) + +#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1)) +#define CMSG_SPACE(len) (CMSG_ALIGN (len) + CMSG_ALIGN (sizeof (struct cmsghdr))) +#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len)) + +#define SCM_RIGHTS 0x01 +#define SCM_CREDENTIALS 0x02 + +struct sockaddr { + sa_family_t sa_family; + char sa_data[14]; +}; + +struct sockaddr_storage { + sa_family_t ss_family; + char __ss_padding[128-sizeof(long)-sizeof(sa_family_t)]; + unsigned long __ss_align; +}; + +int socket (int, int, int); +int socketpair (int, int, int, int [2]); + +int shutdown (int, int); + +int bind (int, const struct sockaddr *, socklen_t); +int connect (int, const struct sockaddr *, socklen_t); +int listen (int, int); +int accept (int, struct sockaddr *__restrict, socklen_t *__restrict); +int accept4(int, struct sockaddr *__restrict, socklen_t *__restrict, int); + +int getsockname (int, struct sockaddr *__restrict, socklen_t *__restrict); +int getpeername (int, struct sockaddr *__restrict, socklen_t *__restrict); + +ssize_t send (int, const void *, size_t, int); +ssize_t recv (int, void *, size_t, int); +ssize_t sendto (int, const void *, size_t, int, const struct sockaddr *, socklen_t); +ssize_t recvfrom (int, void *__restrict, size_t, int, struct sockaddr *__restrict, socklen_t *__restrict); +ssize_t sendmsg (int, const struct msghdr *, int); +ssize_t recvmsg (int, struct msghdr *, int); + +int getsockopt (int, int, int, void *__restrict, socklen_t *__restrict); +int setsockopt (int, int, int, const void *, socklen_t); + +int sockatmark (int); #ifdef __cplusplus } #endif - -#endif /* SOCKET_H */ \ No newline at end of file +#endif /* _SYS_SOCKET_H */ \ No newline at end of file diff --git a/newlib/libc/sys/hermit/include/sys/syslimits.h b/newlib/libc/sys/hermit/include/sys/syslimits.h new file mode 100644 index 0000000000..fd5fd55521 --- /dev/null +++ b/newlib/libc/sys/hermit/include/sys/syslimits.h @@ -0,0 +1,36 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#ifndef _SYS_SYSLIMITS_H_ +#define _SYS_SYSLIMITS_H_ + +#define _POSIX_LINK_MAX 8 +#define _POSIX_MAX_CANON 255 +#define _POSIX_MAX_INPUT 255 + +#define ARG_MAX 65536 /* max bytes for an exec function */ +#ifndef CHILD_MAX +#define CHILD_MAX 40 /* max simultaneous processes */ +#endif +#define LINK_MAX 32767 /* max file link count */ +#define MAX_CANON 255 /* max bytes in term canon input line */ +#define MAX_INPUT 255 /* max bytes in terminal input */ +#define NAME_MAX 255 /* max bytes in a file name */ +#define NGROUPS_MAX 16 /* max supplemental group id's */ +#ifndef OPEN_MAX +#define OPEN_MAX 64 /* max open files per process */ +#endif +#define PATH_MAX 1024 /* max bytes in pathname */ +#define PIPE_BUF 512 /* max bytes for atomic pipe writes */ +#define IOV_MAX 1024 /* max elements in i/o vector */ + +#define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */ +#define BC_DIM_MAX 2048 /* max array elements in bc(1) */ +#define BC_SCALE_MAX 99 /* max scale value in bc(1) */ +#define BC_STRING_MAX 1000 /* max const string length in bc(1) */ +#define COLL_WEIGHTS_MAX 0 /* max weights for order keyword */ +#define EXPR_NEST_MAX 32 /* max expressions nested in expr(1) */ +#define LINE_MAX 2048 /* max bytes in an input line */ +#define RE_DUP_MAX 255 /* max RE's in interval notation */ + +#endif diff --git a/newlib/libc/sys/hermit/include/sys/uio.h b/newlib/libc/sys/hermit/include/sys/uio.h index 83b5e66bdc..ca0938d655 100644 --- a/newlib/libc/sys/hermit/include/sys/uio.h +++ b/newlib/libc/sys/hermit/include/sys/uio.h @@ -1,15 +1,35 @@ -/* - * Just an empty dummy handler to be POSIX compliant. - */ -#ifndef __SYS_UIO_H__ -#define __SYS_UIO_H__ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-FileCopyrightText: 2005-2014 Rich Felker, et al. +// SPDX-License-Identifier: MIT -#include +#ifndef _SYS_UIO_H +#define _SYS_UIO_H #ifdef __cplusplus extern "C" { #endif +#include + +#define UIO_MAXIOV 1024 + +struct iovec { + void *iov_base; + size_t iov_len; +}; + +ssize_t readv(int fd, const struct iovec *iov, int iovcnt); +ssize_t writev(int fd, const struct iovec *iov, int iovcnt); + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +ssize_t preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset); +ssize_t pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset); +#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) +#define preadv64 preadv +#define pwritev64 pwritev +#define off64_t off_t +#endif +#endif #ifdef __cplusplus } diff --git a/newlib/libc/sys/hermit/include/sys/utsname.h b/newlib/libc/sys/hermit/include/sys/utsname.h new file mode 100644 index 0000000000..7658b067db --- /dev/null +++ b/newlib/libc/sys/hermit/include/sys/utsname.h @@ -0,0 +1,31 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-FileCopyrightText: 2005-2014 Rich Felker, et al. +// SPDX-License-Identifier: MIT + +#ifndef _SYS_UTSNAME_H +#define _SYS_UTSNAME_H + +#ifdef __cplusplus +extern "C" { +#endif + +struct utsname { + char sysname[65]; + char nodename[65]; + char release[65]; + char version[65]; + char machine[65]; +#ifdef _GNU_SOURCE + char domainname[65]; +#else + char __domainname[65]; +#endif +}; + +int uname (struct utsname *); + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/newlib/libc/sys/hermit/inet_ntoa.c b/newlib/libc/sys/hermit/inet_ntoa.c deleted file mode 100644 index 3f9913e290..0000000000 --- a/newlib/libc/sys/hermit/inet_ntoa.c +++ /dev/null @@ -1,39 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ -/* From https://sourceware.org/git/?p=glibc.git;a=blob;f=inet/inet_ntoa.c;h=341d8591c30b88d4415898d93ae0dcbd7bf4e3d6;hb=46b5e98ef6f1b9f4b53851f152ecb8209064b26c */ - -/* Convert Inet number to ASCII representation. - Copyright (C) 1997-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - -/* The interface of this function is completely stupid, it requires a - static buffer. We relax this a bit in that we allow one buffer for - each thread. */ -static __thread char buffer[18]; - -char *inet_ntoa(struct in_addr in) -{ - unsigned char *bytes = (unsigned char *) ∈ - snprintf (buffer, sizeof (buffer), "%d.%d.%d.%d", - bytes[0], bytes[1], bytes[2], bytes[3]); - - return buffer; -} \ No newline at end of file diff --git a/newlib/libc/sys/hermit/isatty.c b/newlib/libc/sys/hermit/isatty.c deleted file mode 100644 index 1fd4f59396..0000000000 --- a/newlib/libc/sys/hermit/isatty.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include "warning.h" - -int -isatty (int file) -{ - return _isatty_r(_REENT, file); -} - -int -_isatty_r (struct _reent *ptr, int file) -{ - return (file < 3); -} diff --git a/newlib/libc/sys/hermit/kill.c b/newlib/libc/sys/hermit/kill.c deleted file mode 100644 index 3b4b8996b6..0000000000 --- a/newlib/libc/sys/hermit/kill.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include "warning.h" -#include "syscall.h" - -int -kill (int pid, int sig) -{ - return _kill_r(_REENT, pid, sig); -} - -int kputs(char*); -int kprintf(char*, ...); - -int -_kill_r (struct _reent *ptr, int pid, int sig) -{ - if (sig < 0 || sig >= NSIG) - { - ptr->_errno = EINVAL; - return -1; - } - - int ret = sys_kill(pid, sig); - if(ret) { - ptr->_errno = ret; - } - return ret; -} diff --git a/newlib/libc/sys/hermit/ldso.c b/newlib/libc/sys/hermit/ldso.c new file mode 100644 index 0000000000..aa49872e65 --- /dev/null +++ b/newlib/libc/sys/hermit/ldso.c @@ -0,0 +1,11 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#include +#include +#include + +HERMIT_STUB(int, dlclose, (void *handle), -1) +HERMIT_STUB(char*, dlerror, (void), NULL) +HERMIT_STUB(void*, dlopen, (const char *filename, int flags), NULL) +HERMIT_STUB(void*, dlsym, (void *handle, const char *symbol), NULL) diff --git a/newlib/libc/sys/hermit/link.c b/newlib/libc/sys/hermit/link.c deleted file mode 100644 index b6458b10b7..0000000000 --- a/newlib/libc/sys/hermit/link.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include "warning.h" - -int -link (const char* existing, const char* new) -{ - return _link_r(_REENT, existing, new); -} - -int -_link_r (struct _reent *ptr, const char* existing, const char* new) -{ - ptr->_errno = EMLINK; - return -1; -} diff --git a/newlib/libc/sys/hermit/lseek.c b/newlib/libc/sys/hermit/lseek.c deleted file mode 100644 index 0b902f73c1..0000000000 --- a/newlib/libc/sys/hermit/lseek.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include "syscall.h" -#include "warning.h" - -_off_t -lseek (int file, _off_t ptr, int dir) -{ - return _lseek_r(_REENT, file, ptr, dir); -} - -_off_t -_lseek_r (struct _reent* p, int file, _off_t ptr, int dir) -{ - int ret; - - ret = sys_lseek(file, ptr, dir); - if (ret < 0) { - p->_errno = -ret; - ret = -1; - } - - return ret; -} diff --git a/newlib/libc/sys/hermit/makecontext.c b/newlib/libc/sys/hermit/makecontext.c deleted file mode 100644 index 8687d243ef..0000000000 --- a/newlib/libc/sys/hermit/makecontext.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2016-2018, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include - -#ifdef __x86_64__ - -typedef struct mregs { - /// R15 register - uint64_t r15; - /// R14 register - uint64_t r14; - /// R13 register - uint64_t r13; - /// R12 register - uint64_t r12; - /// R9 register - uint64_t r9; - /// R8 register - uint64_t r8; - /// RDI register - uint64_t rdi; - /// RSI register - uint64_t rsi; - /// RBP register - uint64_t rbp; - /// RBX register - uint64_t rbx; - /// RDX register - uint64_t rdx; - /// RCX register - uint64_t rcx; - /// RSP register - uint64_t rsp; - /// RIP - uint64_t rip; - /// MXCSR - uint32_t mxcsr; -} mregs_t; - -typedef struct { - void *ss_sp; /* Stack base or pointer. */ - int ss_flags; /* Flags. */ - size_t ss_size; /* Stack size. */ -} stack_t; - -typedef struct { - uint16_t control_word; - uint16_t unused1; - uint16_t status_word; - uint16_t unused2; - uint16_t tags; - uint16_t unused3; - uint32_t eip; - uint16_t cs_selector; - uint32_t opcode:11; - uint32_t unused4:5; - uint32_t data_offset; - uint16_t data_selector; - uint16_t unused5; -} fenv_t; - -typedef struct ucontext { - mregs_t uc_mregs; - fenv_t uc_fenv; - struct ucontext *uc_link; - stack_t uc_stack; -} ucontext_t; - -void __startcontext(void); - -void makecontext(ucontext_t *ucp, void (*func)(), int argc, ...) -{ - va_list ap; - - if (!ucp, 0) - return; - - size_t* stack = (size_t*) ((size_t)ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size); - stack -= (argc > 6 ? argc - 6 : 0) + 1; - uint32_t idx = (argc > 6 ? argc - 6 : 0) + 1; - - /* Align stack and reserve space for trampoline address. */ - stack = (size_t*) ((((size_t) stack) & ~0xFULL) - 0x8); - - /* Setup context */ - ucp->uc_mregs.rip = (size_t) func; - ucp->uc_mregs.rbx = (size_t) &stack[idx]; - ucp->uc_mregs.rsp = (size_t) stack; - - stack[0] = (size_t) &__startcontext; - stack[idx] = (size_t) ucp->uc_link; // link to the next context - - va_start(ap, argc); - for (int i = 0; i < argc; i++) - { - switch (i) - { - case 0: - ucp->uc_mregs.rdi = va_arg(ap, size_t); - break; - case 1: - ucp->uc_mregs.rsi = va_arg(ap, size_t); - break; - case 2: - ucp->uc_mregs.rdx = va_arg(ap, size_t); - break; - case 3: - ucp->uc_mregs.rcx = va_arg(ap, size_t); - break; - case 4: - ucp->uc_mregs.r8 = va_arg(ap, size_t); - break; - case 5: - ucp->uc_mregs.r9 = va_arg(ap, size_t); - break; - default: - /* copy value on stack */ - stack[i - 5] = va_arg(ap, size_t); - break; - } - } - va_end(ap); -} - -#endif diff --git a/newlib/libc/sys/hermit/malloc.c b/newlib/libc/sys/hermit/malloc.c new file mode 100644 index 0000000000..e5aac4d392 --- /dev/null +++ b/newlib/libc/sys/hermit/malloc.c @@ -0,0 +1,161 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#include +#include +#include +#include +#include +#include +#include + +// Alignment is the number of bytes between successive addresses at which a given +// object can be allocated. +// +// Pointers returned by allocation functions, such as `malloc`, must be suitably +// aligned for any object, which means they are aligned at least as strictly as +// `max_align_t`. + +// ALIGN_UP rounds `x` up to the nearest multiple of `align`, assuming `align` is +// a power of 2. +#define ALIGN_UP(x, align) (((x) + (align) - 1) & ~((align) - 1)) + +#define MAX_ALIGN_UP(x) ALIGN_UP(x, alignof(max_align_t)) +#define MAX_ALIGN alignof(max_align_t) + +#define IS_POWER_OF_TWO(x) (((x) & ((x) - 1)) == 0) + +// The `block_t` structure is used to store the size of the allocated memory block. +// The size is aligned to `MAX_ALIGN` bytes to ensure that the pointer returned by +// the allocation functions is suitably aligned for any object. +typedef struct block +{ + alignas(MAX_ALIGN) size_t size; +} block_t; + +void *_malloc_r(struct _reent *reent, size_t size) +{ + size_t mem_size = MAX_ALIGN_UP(size); + block_t *mem = sys_alloc(mem_size, MAX_ALIGN); + + if (mem == NULL) + { + return NULL; + } + + mem->size = mem_size; + return mem + 1; +} + +void *_calloc_r(struct _reent *reent, size_t num, size_t size) +{ + size_t mem_size = MAX_ALIGN_UP(num * size); + block_t *mem = sys_alloc_zeroed(mem_size, MAX_ALIGN); + + if (mem == NULL) + { + return NULL; + } + + mem->size = mem_size; + return mem + 1; +} + +void *_realloc_r(struct _reent *reent, void *ptr, size_t new_size) +{ + size_t mem_size = MAX_ALIGN_UP(new_size); + + if (ptr == NULL) + { + return _malloc_r(reent, mem_size); + } + + block_t *mem = (block_t *)ptr - 1; + block_t *new_mem = sys_realloc(mem, mem->size, MAX_ALIGN, mem_size); + + if (new_mem == NULL) + { + return NULL; + } + + new_mem->size = mem_size; + return new_mem + 1; +} + +// The `memalign` function is deprecated. Use `aligned_alloc` instead. +// This `memalign` implementation is solely for `posix_memalign` and `aligned_alloc`. +void *_memalign_r(struct _reent *_r, size_t align, size_t size) { + if (!IS_POWER_OF_TWO(align)) { + return NULL; + } + + size_t mem_align = MAX(align, alignof(block_t)); + size_t mem_size = ALIGN_UP(size, mem_align); + block_t *mem = sys_alloc(mem_size, mem_align); + + if (mem == NULL) + { + return NULL; + } + + mem->size = mem_size; + return mem + 1; +} + +void _free_r(struct _reent *reent, void *ptr) +{ + if (ptr == NULL) + { + return; + } + + block_t *mem = (block_t *)ptr - 1; + + sys_dealloc(mem, mem->size, MAX_ALIGN); +} + + +void *malloc(size_t size) +{ + return _malloc_r(_REENT, size); +} + +void *calloc(size_t num, size_t size) +{ + return _calloc_r(_REENT, num, size); +} + +void *memalign(size_t align, size_t size) +{ + return _memalign_r(_REENT, align, size); +} + +void *realloc(void *ptr, size_t new_size) +{ + return _realloc_r(_REENT, ptr, new_size); +} + +void free(void *ptr) +{ + _free_r(_REENT, ptr); +} + +int32_t posix_memalign(void **memptr, size_t align, size_t size) +{ + // The alignment must be a power of 2 and a multiple of `sizeof(void *)` + if (align % sizeof(void *) != 0 || !IS_POWER_OF_TWO(align)) + { + return EINVAL; + } + + void *mem = memalign(align, size); + if (mem == NULL) + { + return ENOMEM; + } + + *memptr = mem; + return 0; +} + +// TODO: stub mallinfo, malloc_stats, mallopt, malloc_usable_size, valloc, pvalloc, malloc_trim, mstats \ No newline at end of file diff --git a/newlib/libc/sys/hermit/misc.c b/newlib/libc/sys/hermit/misc.c new file mode 100644 index 0000000000..6c3c8180de --- /dev/null +++ b/newlib/libc/sys/hermit/misc.c @@ -0,0 +1,71 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#include +#include +#include +#include +#include +#include + +int getpagesize(void) +{ + return sys_getpagesize(); +} + +int ioctl(int fd, int cmd, ...) +{ + void *arg; + va_list ap; + va_start(ap, cmd); + arg = va_arg(ap, void *); + va_end(ap); + + int ret = sys_ioctl(fd, cmd, arg); + if (ret < 0) + { + errno = -ret; + return -1; + } + + return ret; +} + +HERMIT_SYSCALL(ssize_t, getrandom, (void *buf, size_t size, unsigned flags), (buf, size, flags)) + +int getentropy(void *buf, size_t size) +{ + int ret = 0; + char *pos = buf; + + if (size > 256) + { + errno = EIO; + return -1; + } + + while (size) + { + ret = getrandom(pos, size, 0); + if (ret < 0) + break; + pos += ret; + size -= ret; + ret = 0; + } + + return ret; +} + +HERMIT_SYSCALL(int, eventfd, (unsigned int initval, int flags), (initval, flags)) +int eventfd_read(int fd, eventfd_t *value) +{ + return (sizeof(*value) == read(fd, value, sizeof(*value))) ? 0 : -1; +} + +int eventfd_write(int fd, eventfd_t value) +{ + return (sizeof(value) == write(fd, &value, sizeof(value))) ? 0 : -1; +} + +HERMIT_STUB(int, uname, (struct utsname * uts), -1) \ No newline at end of file diff --git a/newlib/libc/sys/hermit/mman.c b/newlib/libc/sys/hermit/mman.c new file mode 100644 index 0000000000..b57c4afc02 --- /dev/null +++ b/newlib/libc/sys/hermit/mman.c @@ -0,0 +1,61 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#include +#include +#include +#include + +// Hermit's `mmap` doesn't support mapping of files, so we only support `MAP_PRIVATE | MAP_ANONYMOUS` +void *mmap(void *addr, size_t len, int32_t prot, int32_t flags, int32_t fd, off_t offset) +{ + if (addr != NULL || flags != (MAP_PRIVATE | MAP_ANONYMOUS) || fd != -1 || offset != 0) + { + errno = ENOSYS; + return NULL; + } + + void *ret; + int32_t status = sys_mmap(len, prot, &ret); + if (status < 0) + { + errno = -status; + return MAP_FAILED; + } + + return ret; +} + +int32_t munmap(void *addr, size_t len) +{ + int32_t status = sys_munmap(addr, len); + if (status < 0) + { + errno = -status; + return -1; + } + + return status; +} + +int32_t mprotect(void *addr, size_t len, int32_t prot) +{ + int32_t status = sys_mprotect(addr, len, prot); + if (status < 0) + { + errno = -status; + return -1; + } + + return status; +} + +HERMIT_STUB(int, msync, (void *addr, size_t len, int flags), -1) + +HERMIT_STUB(int, posix_madvise, (void *addr, size_t len, int advice), -1) +HERMIT_STUB(int, mlock, (const void *addr, size_t len), -1) +HERMIT_STUB(int, munlock, (const void *addr, size_t len), -1) +HERMIT_STUB(int, mlockall, (int flags), -1) +HERMIT_STUB(int, munlockall, (void), -1) +HERMIT_STUB(int, shm_open, (const char *name, int oflag, mode_t mode), -1) +HERMIT_STUB(int, shm_unlink, (const char *name), -1) \ No newline at end of file diff --git a/newlib/libc/sys/hermit/nanosleep.c b/newlib/libc/sys/hermit/nanosleep.c deleted file mode 100644 index 9cdf46b83a..0000000000 --- a/newlib/libc/sys/hermit/nanosleep.c +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2018 Colin Finck, RWTH Aachen University -// -// MIT License -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -#include -#include -#include "syscall.h" - -int -nanosleep (const struct timespec* rqtp, struct timespec* rmtp) -{ - int ret = sys_nanosleep((const HermitTimespec*)rqtp, (HermitTimespec*)rmtp); - if (ret < 0) - { - *__errno() = -ret; - return -1; - } - - return ret; -} diff --git a/newlib/libc/sys/hermit/network.c b/newlib/libc/sys/hermit/network.c new file mode 100644 index 0000000000..e6622a27f5 --- /dev/null +++ b/newlib/libc/sys/hermit/network.c @@ -0,0 +1,585 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-FileCopyrightText: 2005-2014 Rich Felker, et al. +// SPDX-License-Identifier: MIT + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Note: This file has alot missing from it, but it is a good starting point for networking support + +HERMIT_SYSCALL(int, socket, (int domain, int type, int protocol), (domain, type, protocol)) +HERMIT_STUB(int, socketpair, (int domain, int type, int protocol, int fd[2]), -1) + +HERMIT_SYSCALL(int, listen, (int fd, int backlog), (fd, backlog)) +HERMIT_SYSCALL(int, bind, (int fd, const struct sockaddr *addr, socklen_t len), (fd, addr, len)) +HERMIT_SYSCALL(int, connect, (int fd, const struct sockaddr *addr, socklen_t len), (fd, addr, len)) + +HERMIT_SYSCALL(int, shutdown, (int fd, int how), (fd, how)) + +HERMIT_SYSCALL(int, accept, (int fd, struct sockaddr *addr, socklen_t *len), (fd, addr, len)) +HERMIT_STUB(int, accept4, (int fd, struct sockaddr *addr, socklen_t *len, int flags), -1) + +HERMIT_STUB(int, sendmmsg, (int fd, struct mmsghdr *msgvec, unsigned int vlen, unsigned int flags), -1) +HERMIT_STUB(int, recvmmsg, (int fd, struct mmsghdr *msgvec, unsigned int vlen, unsigned int flags, struct timespec *timeout), -1) + +HERMIT_SYSCALL(int, getsockname, (int fd, struct sockaddr *addr, socklen_t *len), (fd, addr, len)) +HERMIT_SYSCALL(int, getpeername, (int fd, struct sockaddr *addr, socklen_t *len), (fd, addr, len)) + +HERMIT_SYSCALL(ssize_t, send, (int fd, const void *buf, size_t len, int flags), (fd, buf, len, flags)) +HERMIT_SYSCALL(ssize_t, sendto, (int fd, const void *buf, size_t len, int flags, const struct sockaddr *addr, socklen_t alen), (fd, buf, len, flags, addr, alen)) + +HERMIT_SYSCALL(ssize_t, recv, (int fd, void *buf, size_t len, int flags), (fd, buf, len, flags)) +HERMIT_SYSCALL(ssize_t, recvfrom, (int fd, void *buf, size_t len, int flags, struct sockaddr *addr, socklen_t *alen), (fd, buf, len, flags, addr, alen)) + +HERMIT_STUB(ssize_t, sendmsg, (int fd, const struct msghdr *msg, int flags), -1) +HERMIT_STUB(ssize_t, recvmsg, (int fd, struct msghdr *msg, int flags), -1) + +HERMIT_SYSCALL(int, getsockopt, (int fd, int level, int optname, void *optval, socklen_t *optlen), (fd, level, optname, optval, optlen)) +HERMIT_SYSCALL(int, setsockopt, (int fd, int level, int optname, const void *optval, socklen_t optlen), (fd, level, optname, optval, optlen)) + +HERMIT_STUB(int, sockatmark, (int fd), -1) + +int getnameinfo(const struct sockaddr *restrict sa, socklen_t sl, + char *restrict node, socklen_t nodelen, + char *restrict serv, socklen_t servlen, + int flags) +{ + char buf[256]; + /*unsigned char reply[512]; TODO used in DNS reply */ + int af = sa->sa_family; + char line[512]; + FILE *f; + unsigned char *a; + + switch (af) + { + case AF_INET: + a = (void *)&((struct sockaddr_in *)sa)->sin_addr; + if (sl != sizeof(struct sockaddr_in)) + return EAI_FAMILY; + break; +#if CONFIG_LWIP_IPV6 + case AF_INET6: + a = (void *)&((struct sockaddr_in6 *)sa)->sin6_addr; + if (sl != sizeof(struct sockaddr_in6)) + return EAI_FAMILY; + break; +#endif + default: + return EAI_FAMILY; + } + + /* Try to find ip within /etc/hosts */ + if ((node && nodelen) && (af == AF_INET)) + { + const char *ipstr; + size_t l; + + ipstr = inet_ntoa(((struct sockaddr_in *)sa)->sin_addr); + l = strlen(ipstr); + f = fopen("/etc/hosts", "r"); + if (f) + while (fgets(line, sizeof(line), f)) + { + char *domain; + + if (strncmp(line, ipstr, l) != 0) + continue; + + domain = strtok(line, " "); + if (!domain) + continue; + domain = strtok(NULL, " "); + if (!domain) + continue; + + if (strlen(domain) >= nodelen) + return EAI_OVERFLOW; + strcpy(node, domain); + fclose(f); + return 0; + } + if (f) + fclose(f); + } + + if (node && nodelen) + { + if ((flags & NI_NUMERICHOST) +#if 0 + /* TODO, Hermit doesn't currently don't support name requests */ + || __dns_query(reply, a, af, 1) <= 0 + || __dns_get_rr(buf, 0, 256, 1, reply, RR_PTR, 1) <= 0) { +#else + || 1) + { +#endif + if (flags & NI_NAMEREQD) + return EAI_NONAME; + inet_ntop(af, a, buf, sizeof(buf)); + } + if (strlen(buf) >= nodelen) + return EAI_OVERFLOW; + strcpy(node, buf); + } + + if (serv && servlen) + { + if (snprintf(buf, sizeof(buf), "%d", + ntohs(((struct sockaddr_in *)sa)->sin_port)) >= (int)servlen) + return EAI_OVERFLOW; + strcpy(serv, buf); + } + + return 0; +} + +HERMIT_STUB(struct hostent *, gethostbyaddr, (const void *addr, socklen_t len, int type), NULL) + +HERMIT_SYSCALL(int, getaddrinfo, (const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res), (node, service, hints, res)) + +void freeaddrinfo(struct addrinfo *res) +{ + return sys_freeaddrinfo(res); +} + +const char *gai_strerror(int errcode) +{ + switch (errcode) + { + default: + return "Error on getaddrinfo."; + } +} + +void sethostent(int x) +{ +} + +struct hostent *gethostent() +{ + return 0; +} + +void endhostent(void) +{ +} + +HERMIT_STUB(int, gethostname, (char *name, size_t len), -1) +HERMIT_STUB(int, sethostname, (const char *name, size_t len), -1) + +int h_errno; + +int *__h_errno_location(void) +{ + return __errno(); +} + +HERMIT_STUB(struct hostent *, gethostbyname, (const char *name), NULL) +HERMIT_STUB(struct hostent *, gethostbyname2, (const char *name, int af), NULL) + +void setnetent(int x) +{ +} + +struct netent *getnetent() +{ + return 0; +} + +void endnetent(void) +{ +} + +struct netent *getnetbyaddr(uint32_t net, int type) +{ + return 0; +} + +struct netent *getnetbyname(const char *name) +{ + return 0; +} + +void setservent(int x) +{ +} + +void endservent(void) +{ +} + +struct servent *getservent(void) +{ + return NULL; +} + +struct servent *getservbyname(const char *name __unused, + const char *proto __unused) +{ + return NULL; +} + +struct servent *getservbyport(int port __unused, + const char *proto __unused) +{ + return NULL; +} + +int getservbyport_r(int port __unused, const char *prots __unused, + struct servent *se __unused, char *buf __unused, + size_t buflen __unused, struct servent **res __unused) +{ + errno = ENOSYS; + return EAI_SYSTEM; +} + +static size_t idx; +static const unsigned char protos[] = { + "\000ip\0" + "\001icmp\0" + "\002igmp\0" + "\003ggp\0" + "\004ipencap\0" + "\005st\0" + "\006tcp\0" + "\010egp\0" + "\014pup\0" + "\021udp\0" + "\024hmp\0" + "\026xns-idp\0" + "\033rdp\0" + "\035iso-tp4\0" + "\044xtp\0" + "\045ddp\0" + "\046idpr-cmtp\0" + "\051ipv6\0" + "\053ipv6-route\0" + "\054ipv6-frag\0" + "\055idrp\0" + "\056rsvp\0" + "\057gre\0" + "\062esp\0" + "\063ah\0" + "\071skip\0" + "\072ipv6-icmp\0" + "\073ipv6-nonxt\0" + "\074ipv6-opts\0" + "\111rspf\0" + "\121vmtp\0" + "\131ospf\0" + "\136ipip\0" + "\142encap\0" + "\147pim\0" + "\377raw"}; + +void endprotoent(void) +{ + idx = 0; +} + +void setprotoent(int stayopen) +{ + idx = 0; +} + +struct protoent *getprotoent(void) +{ + static struct protoent p; + static const char *aliases; + + if (idx >= sizeof(protos)) + return NULL; + p.p_proto = protos[idx]; + p.p_name = (char *)&protos[idx + 1]; + p.p_aliases = (char **)&aliases; + idx += strlen(p.p_name) + 2; + return &p; +} + +struct protoent *getprotobyname(const char *name) +{ + struct protoent *p; + + endprotoent(); + do + p = getprotoent(); + while (p && strcmp(name, p->p_name)); + return p; +} + +struct protoent *getprotobynumber(int num) +{ + struct protoent *p; + + endprotoent(); + do + p = getprotoent(); + while (p && p->p_proto != num); + return p; +} + +// arpa/inet.h + +uint32_t htonl(uint32_t n) +{ + union + { + int i; + char c; + } u = {1}; + return u.c ? bswap_32(n) : n; +} + +uint16_t htons(uint16_t n) +{ + union + { + int i; + char c; + } u = {1}; + return u.c ? bswap_16(n) : n; +} + +uint32_t ntohl(uint32_t n) +{ + union + { + int i; + char c; + } u = {1}; + return u.c ? bswap_32(n) : n; +} + +uint16_t ntohs(uint16_t n) +{ + union + { + int i; + char c; + } u = {1}; + return u.c ? bswap_16(n) : n; +} + +in_addr_t inet_addr(const char *p) +{ + struct in_addr a; + if (!inet_aton(p, &a)) + return -1; + return a.s_addr; +} + +in_addr_t inet_network(const char *p) +{ + return ntohl(inet_addr(p)); +} + +char *inet_ntoa(struct in_addr in) +{ + static char buf[16]; + unsigned char *a = (void *)∈ + + snprintf(buf, sizeof(buf), "%d.%d.%d.%d", a[0], a[1], a[2], a[3]); + + return buf; +} + +int inet_aton(const char *s0, struct in_addr *dest) +{ + const char *s = s0; + unsigned char *d = (void *)dest; + unsigned long a[4] = {0}; + char *z; + int i; + + for (i = 0; i < 4; i++) + { + a[i] = strtoul(s, &z, 0); + if (z == s || (*z && *z != '.') || !isdigit(*s)) + return 0; + if (!*z) + break; + s = z + 1; + } + if (i == 4) + return 0; + switch (i) + { + case 0: + a[1] = a[0] & 0xffffff; + a[0] >>= 24; + case 1: + a[2] = a[1] & 0xffff; + a[1] >>= 16; + case 2: + a[3] = a[2] & 0xff; + a[2] >>= 8; + } + for (i = 0; i < 4; i++) + { + if (a[i] > 255) + return 0; + d[i] = a[i]; + } + return 1; +} + +const char *inet_ntop(int af, const void *restrict a0, char *restrict s, socklen_t l) +{ + const unsigned char *a = a0; + int i, j, max, best; + char buf[100]; + + switch (af) + { + case AF_INET: + if (snprintf(s, l, "%d.%d.%d.%d", a[0], a[1], a[2], a[3]) < l) + return s; + break; + case AF_INET6: + if (memcmp(a, "\0\0\0\0\0\0\0\0\0\0\377\377", 12)) + snprintf(buf, sizeof buf, + "%x:%x:%x:%x:%x:%x:%x:%x", + 256 * a[0] + a[1], 256 * a[2] + a[3], + 256 * a[4] + a[5], 256 * a[6] + a[7], + 256 * a[8] + a[9], 256 * a[10] + a[11], + 256 * a[12] + a[13], 256 * a[14] + a[15]); + else + snprintf(buf, sizeof buf, + "%x:%x:%x:%x:%x:%x:%d.%d.%d.%d", + 256 * a[0] + a[1], 256 * a[2] + a[3], + 256 * a[4] + a[5], 256 * a[6] + a[7], + 256 * a[8] + a[9], 256 * a[10] + a[11], + a[12], a[13], a[14], a[15]); + /* Replace longest /(^0|:)[:0]{2,}/ with "::" */ + for (i = best = 0, max = 2; buf[i]; i++) + { + if (i && buf[i] != ':') + continue; + j = strspn(buf + i, ":0"); + /* The leading sequence of zeros (best==0) is + * disadvantaged compared to sequences elsewhere + * as it doesn't have a leading colon. One extra + * character is required for another sequence to + * beat it fairly. */ + if (j > max + (best == 0)) + best = i, max = j; + } + if (max > 3) + { + buf[best] = buf[best + 1] = ':'; + memmove(buf + best + 2, buf + best + max, i - best - max + 1); + } + if (strlen(buf) < l) + { + strcpy(s, buf); + return s; + } + break; + default: + errno = EAFNOSUPPORT; + return 0; + } + errno = ENOSPC; + return 0; +} + +static int hexval(unsigned c) +{ + if (c - '0' < 10) + return c - '0'; + c |= 32; + if (c - 'a' < 6) + return c - 'a' + 10; + return -1; +} + +int inet_pton(int af, const char *restrict s, void *restrict a0) +{ + uint16_t ip[8]; + unsigned char *a = a0; + int i, j, v, d, brk = -1, need_v4 = 0; + + if (af == AF_INET) + { + for (i = 0; i < 4; i++) + { + for (v = j = 0; j < 3 && isdigit(s[j]); j++) + v = 10 * v + s[j] - '0'; + if (j == 0 || (j > 1 && s[0] == '0') || v > 255) + return 0; + a[i] = v; + if (s[j] == 0 && i == 3) + return 1; + if (s[j] != '.') + return 0; + s += j + 1; + } + return 0; + } + else if (af != AF_INET6) + { + errno = EAFNOSUPPORT; + return -1; + } + + if (*s == ':' && *++s != ':') + return 0; + + for (i = 0;; i++) + { + if (s[0] == ':' && brk < 0) + { + brk = i; + ip[i & 7] = 0; + if (!*++s) + break; + if (i == 7) + return 0; + continue; + } + for (v = j = 0; j < 4 && (d = hexval(s[j])) >= 0; j++) + v = 16 * v + d; + if (j == 0) + return 0; + ip[i & 7] = v; + if (!s[j] && (brk >= 0 || i == 7)) + break; + if (i == 7) + return 0; + if (s[j] != ':') + { + if (s[j] != '.' || (i < 6 && brk < 0)) + return 0; + need_v4 = 1; + i++; + ip[i & 7] = 0; + break; + } + s += j + 1; + } + if (brk >= 0) + { + memmove(ip + brk + 7 - i, ip + brk, 2 * (i + 1 - brk)); + for (j = 0; j < 7 - i; j++) + ip[brk + j] = 0; + } + for (j = 0; j < 8; j++) + { + *a++ = ip[j] >> 8; + *a++ = ip[j]; + } + if (need_v4 && inet_pton(AF_INET, (void *)s, a - 4) <= 0) + return 0; + return 1; +} diff --git a/newlib/libc/sys/hermit/open.c b/newlib/libc/sys/hermit/open.c deleted file mode 100644 index ee134b0cc2..0000000000 --- a/newlib/libc/sys/hermit/open.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include "syscall.h" -#include "warning.h" - -int -open (const char *file, int flags, int mode) -{ - return _open_r(_REENT, file, flags, mode); -} - -int -_open_r (struct _reent *ptr, const char *file, int flags, int mode) -{ - int ret; - - ret = sys_open(file, flags, mode); - if (ret < 0) { - ptr->_errno = -ret; - ret = -1; - } - - return ret; -} diff --git a/newlib/libc/sys/hermit/process.c b/newlib/libc/sys/hermit/process.c new file mode 100644 index 0000000000..4311b3d47d --- /dev/null +++ b/newlib/libc/sys/hermit/process.c @@ -0,0 +1,14 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#include +#include +#include +#include + +HERMIT_STUB_REENT0(int, fork, -1) +HERMIT_STUB(int, vfork, (void), -1) +HERMIT_STUB(int, fexecve, (int fd, char *const argv[], char *const envp[]), -1) +HERMIT_STUB(int, _execve, (const char *path, char *const argv[], char *const envp[]), -1) +HERMIT_STUB_REENT(int, wait, (int *status), (status), -1) +HERMIT_STUB(int, waitpid, (pid_t pid, int *status, int options), -1) diff --git a/newlib/libc/sys/hermit/read.c b/newlib/libc/sys/hermit/read.c deleted file mode 100644 index 2307f10bb5..0000000000 --- a/newlib/libc/sys/hermit/read.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include "syscall.h" -#include "warning.h" - -_ssize_t -read (int file, void* ptr, size_t len) -{ - return _read_r(_REENT, file, ptr, len); -} - -_ssize_t -_read_r (struct _reent *p, int file, void* ptr, size_t len) -{ - int ret; - - ret = sys_read(file, ptr, len); - if (ret < 0) { - p->_errno = -ret; - ret = -1; - } - - return ret; -} diff --git a/newlib/libc/sys/hermit/readlink.c b/newlib/libc/sys/hermit/readlink.c deleted file mode 100644 index 475bf77ce7..0000000000 --- a/newlib/libc/sys/hermit/readlink.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include -#include "warning.h" - -int -readlink (const char* path, char* buf, size_t bufsize) -{ - return _readlink_r(_REENT, path, buf, bufsize); -} - -int -_readlink_r (struct _reent* ptr, const char* path, char* buf, size_t bufsize) -{ - ptr->_errno = ENOSYS; - return -1; -} diff --git a/newlib/libc/sys/hermit/sbrk.c b/newlib/libc/sys/hermit/sbrk.c index 8f1355ca69..8b4f6292c6 100644 --- a/newlib/libc/sys/hermit/sbrk.c +++ b/newlib/libc/sys/hermit/sbrk.c @@ -1,51 +1,48 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + #include -#include <_syslist.h> #include -#include "syscall.h" -#include "warning.h" +#include +#include -void* -sbrk (ptrdiff_t incr) -{ - return _sbrk_r(_REENT, incr); +// Fixed length of 8 KB pages +// TODO: Make this configurable in +#define SBRK_HEAP 8*1024*4096 + +uint8_t *heap; +uint8_t *brkp = NULL; +uint8_t *endp = NULL; + +static void init() { + heap = (uint8_t *)mmap(0, SBRK_HEAP, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + brkp = heap; + endp = heap + SBRK_HEAP; } -void* -_sbrk_r (struct _reent* ptr, ptrdiff_t incr) +void* _sbrk_r(struct _reent *reent, ptrdiff_t incr) { - ssize_t ret = sys_sbrk(incr); - if (ret <= 0) { - ptr->_errno = ENOMEM; - ret = 0; + if (brkp == NULL) { + // Initialise the sbrk heap + init(); + } + + if (incr == 0) { + return (void*)brkp; } - return (void*) ret; + void *free = (void*)brkp; + + brkp += incr; + if (brkp > endp) { + reent->_errno = ENOMEM; + return NULL; + } + + return free; +} + +void* sbrk (ptrdiff_t incr) +{ + return _sbrk_r(_REENT, incr); } diff --git a/newlib/libc/sys/hermit/sched.c b/newlib/libc/sys/hermit/sched.c index 75c2d4e6b7..db8c03be7e 100644 --- a/newlib/libc/sys/hermit/sched.c +++ b/newlib/libc/sys/hermit/sched.c @@ -1,31 +1,25 @@ -// Copyright (c) 2018 Colin Finck, RWTH Aachen University -// -// MIT License -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT -#include "syscall.h" +#include +#include +#include +#include -int -sched_yield (void) -{ - sys_yield(); - return 0; -} +// TODO: +// Stub sched_{set/get}affinity +// Stub sched_cpucount + +HERMIT_STUB(int, sched_get_priority_max, (int policy), -1) +HERMIT_STUB(int, sched_get_priority_min, (int policy), -1) + +HERMIT_STUB(int, sched_getcpu, (void), -1) +HERMIT_STUB(int, sched_rr_get_interval, (pid_t pid, struct timespec *interval), -1) + +HERMIT_STUB(int, sched_getparam, (pid_t pid, struct sched_param *param), -1) +HERMIT_STUB(int, sched_setparam, (pid_t pid, const struct sched_param *param), -1) + +HERMIT_STUB(int, sched_getscheduler, (pid_t pid), -1) +HERMIT_STUB(int, sched_setscheduler, (pid_t pid, int policy, const struct sched_param *param), -1) + +HERMIT_SYSCALL(int, sched_yield, (void), ()) diff --git a/newlib/libc/sys/hermit/select.c b/newlib/libc/sys/hermit/select.c new file mode 100644 index 0000000000..e3b08a564f --- /dev/null +++ b/newlib/libc/sys/hermit/select.c @@ -0,0 +1,10 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#include +#include +#include +#include + +HERMIT_STUB(int, select, (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout), -1) +HERMIT_SYSCALL(int, poll, (struct pollfd * fds, nfds_t nfds, int timeout), (fds, nfds, timeout)) \ No newline at end of file diff --git a/newlib/libc/sys/hermit/setitimer.c b/newlib/libc/sys/hermit/setitimer.c deleted file mode 100644 index 893c7300b7..0000000000 --- a/newlib/libc/sys/hermit/setitimer.c +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2018 Colin Finck, RWTH Aachen University -// -// MIT License -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -#include -#include -#include "syscall.h" - -int -setitimer (int which, const struct itimerval* value, struct itimerval* ovalue) -{ - int ret = sys_setitimer(which, (const HermitItimerval*)value, (HermitItimerval*)ovalue); - if (ret < 0) - { - *__errno() = -ret; - return -1; - } - - return ret; -} diff --git a/newlib/libc/sys/hermit/signal.c b/newlib/libc/sys/hermit/signal.c deleted file mode 100644 index f043337186..0000000000 --- a/newlib/libc/sys/hermit/signal.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - * signal.c - * Original Author: G. Haley - * - * signal associates the function pointed to by func with the signal sig. When - * a signal occurs, the value of func determines the action taken as follows: - * if func is SIG_DFL, the default handling for that signal will occur; if func - * is SIG_IGN, the signal will be ignored; otherwise, the default handling for - * the signal is restored (SIG_DFL), and the function func is called with sig - * as its argument. Returns the value of func for the previous call to signal - * for the signal sig, or SIG_ERR if the request fails. - */ - -/* _init_signal initialises the signal handlers for each signal. This function - is called by crt0 at program startup. */ - - -/* - * Adapted for HermitCore by: - * - S. Lankes, RWTH Aachen University - * - Daniel Krebs, RWTH Aachen University - */ - -#include -#include -#include -#include -#include -#include -#include -#include <_syslist.h> -#include "syscall.h" - -/* - * Notes: - * - man 2 sigreturn - * - man 7 signal -*/ - -#if 0 -static void -newlib_signal_dispatcher(int signum) -{ - // assume to be called in user context - struct _reent* reent = _REENT; - - if (signum < 0 || signum >= NSIG) { - reent->_errno = EINVAL; - return; - } - - if(reent->_sig_func == NULL) { - reent->_errno = ENOENT; - return; - } - - _sig_func_ptr func = reent->_sig_func[signum]; - - if(func == SIG_DFL) { - fprintf(stderr, "Caught unhandled signal %d, terminating\n", signum); - // terminate if no signal handler registered - sys_exit(128 + signum); - } else if(func == SIG_IGN) { - // ignore - } else if(func == SIG_ERR) { - reent->_errno = EINVAL; - } else { - // finally call user code - func(signum); - } -} -#endif - -int -pthread_sigmask (int how, const sigset_t* set, sigset_t* oset) -{ - return ENOSYS; -} - -int -sigaltstack (const stack_t* ss, stack_t* oss) -{ - return ENOSYS; -} - -int -_init_signal_r (struct _reent* ptr) -{ -#if 0 - int i; - - if (ptr->_sig_func == NULL) { - ptr->_sig_func = (_sig_func_ptr *)_malloc_r (ptr, sizeof (_sig_func_ptr) * NSIG); - - if (ptr->_sig_func == NULL) { - return -1; - } - - for (i = 0; i < NSIG; i++) { - ptr->_sig_func[i] = SIG_DFL; - } - - sys_signal(newlib_signal_dispatcher); - } - - return 0; -#else - return ENOSYS; -#endif -} - -_sig_func_ptr -_signal_r (struct _reent* ptr, int sig, _sig_func_ptr func) -{ -#if 0 - _sig_func_ptr old_func; - - if (sig < 0 || sig >= NSIG) { - ptr->_errno = EINVAL; - return SIG_ERR; - } - - if (ptr->_sig_func == NULL && _init_signal_r (ptr) != 0) { - return SIG_ERR; - } - - old_func = ptr->_sig_func[sig]; - ptr->_sig_func[sig] = func; - - return old_func; -#else - return ENOSYS; -#endif -} - -int -_sigaction_r (struct _reent* ptr, int sig, const struct sigaction* act, struct sigaction* oact) -{ - return 0; -} - -#ifndef _REENT_ONLY - -int -sigaction (int sig, const struct sigaction* act, struct sigaction* oact) -{ - return _sigaction_r (_REENT, sig, act, oact); -} - -_sig_func_ptr -signal (int sig, _sig_func_ptr func) -{ - return _signal_r (_REENT, sig, func); -} - -#if 0 -int -_init_signal (void) -{ - return _init_signal_r (_REENT); -} -#endif - -#endif diff --git a/newlib/libc/sys/hermit/signal/kill.c b/newlib/libc/sys/hermit/signal/kill.c new file mode 100644 index 0000000000..27cce1c5af --- /dev/null +++ b/newlib/libc/sys/hermit/signal/kill.c @@ -0,0 +1,24 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#include +#include +#include +#include + +int kill(int pid, int sig) +{ + return _kill_r(_REENT, pid, sig); +} + +int _kill_r(struct _reent *reent, int pid, int sig) +{ + + if (pid == _getpid_r(reent)) + { + return _raise_r(reent, sig); + } + + reent->_errno = EPERM; + return -1; +} diff --git a/newlib/libc/sys/hermit/signal/sigaction.c b/newlib/libc/sys/hermit/signal/sigaction.c new file mode 100644 index 0000000000..ac7715df67 --- /dev/null +++ b/newlib/libc/sys/hermit/signal/sigaction.c @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#include +#include +#include + +struct sigaction __sig_actions[NSIG]; + +int sigaction(int sig, const struct sigaction *restrict sa, struct sigaction *restrict old) +{ + if (sig < 0 || sig >= NSIG) + { + errno = EINVAL; + return -1; + } + + if (old) + { + *old = __sig_actions[sig]; + } + + if (sa) + { + __sig_actions[sig] = *sa; + } + + return 0; +} diff --git a/newlib/libc/sys/hermit/signal/sigprocmask.c b/newlib/libc/sys/hermit/signal/sigprocmask.c new file mode 100644 index 0000000000..72a2567f0a --- /dev/null +++ b/newlib/libc/sys/hermit/signal/sigprocmask.c @@ -0,0 +1,67 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#define _GNU_SOURCE // for sigorset/sigandset +#include +#include +#include +#include + +#define siginvertset(dst, src) (*(dst) = ~(*(src)), 0) + +static sigset_t __sig_mask; +sigset_t __sig_pending; + +bool __sig_is_blocked(int sig) +{ + return sigismember(&__sig_mask, sig); +} + +int sigprocmask(int how, const sigset_t *restrict set, sigset_t *restrict old) +{ + if (old) + { + *old = __sig_mask; + } + + switch (how) + { + case SIG_SETMASK: + __sig_mask = *set; + break; + case SIG_BLOCK: + sigorset(&__sig_mask, &__sig_mask, set); + break; + case SIG_UNBLOCK: + { + sigset_t tmp; + siginvertset(&tmp, set); + sigandset(&__sig_mask, &__sig_mask, &tmp); + break; + } + default: + return EINVAL; + } + + // These two signals can never be blocked. + sigdelset(&__sig_mask, SIGKILL); + sigdelset(&__sig_mask, SIGSTOP); + + // Raise any pending signals that are now unblocked. + for (int sig = 0; sig < NSIG; sig++) + { + if (sigismember(&__sig_pending, sig) && !sigismember(&__sig_mask, sig)) + { + sigdelset(&__sig_pending, sig); + raise(sig); + } + } + + return 0; +} + +int sigpending(sigset_t *set) +{ + *set = __sig_pending; + return 0; +} \ No newline at end of file diff --git a/newlib/libc/sys/hermit/signal/sigtimedwait.c b/newlib/libc/sys/hermit/signal/sigtimedwait.c new file mode 100644 index 0000000000..a1c8725d10 --- /dev/null +++ b/newlib/libc/sys/hermit/signal/sigtimedwait.c @@ -0,0 +1,27 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#include +#include + +extern sigset_t __sig_pending; + +int sigtimedwait(const sigset_t *restrict mask, siginfo_t *restrict si, const struct timespec *restrict timeout) +{ + for (int sig = 0; sig < NSIG; sig++) + { + if (sigismember(mask, sig) && sigismember(&__sig_pending, sig)) + { + if (si) + { + siginfo_t t = {0}; + *si = t; + } + sigdelset(&__sig_pending, sig); + return sig; + } + } + + errno = EINVAL; + return -1; +} \ No newline at end of file diff --git a/newlib/libc/sys/hermit/stat.c b/newlib/libc/sys/hermit/stat.c index f417a77087..10c36eaf3a 100644 --- a/newlib/libc/sys/hermit/stat.c +++ b/newlib/libc/sys/hermit/stat.c @@ -1,65 +1,59 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT -/* - * Stub version of stat. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include #include +#include #include -#include "syscall.h" -#include "warning.h" +#include + +HERMIT_STUB(int, chmod, (const char *path, mode_t mode), -1) +HERMIT_STUB(int, fchmod, (int fd, mode_t mode), -1) +HERMIT_STUB(int, fchmodat, (int fd, const char *path, mode_t mode, int flag), -1) -int -stat (const char* file, struct stat* st) +int fstat(int fd, struct stat *st) { - return _stat_r(_REENT, file, st); + return _fstat_r(_REENT, fd, st); } -int -_stat_r (struct _reent* ptr, const char* file, struct stat* st) +int _fstat_r(struct _reent *reent, int fd, struct stat *st) { - int ret; - - if (!file && ! st) { - ptr->_errno = EINVAL; + if (fd < 0) + { + reent->_errno = EBADF; return -1; } - ret = sys_stat(file, st); - if (ret < 0) { - ptr->_errno = -ret; + int ret = sys_fstat(fd, st); + if (ret < 0) + { + reent->_errno = -ret; return -1; } - return 0; + return ret; } + +HERMIT_STUB(int, fstatat, (int fd, const char *path, struct stat *st, int flag), -1) + +HERMIT_STUB(int, futimens, (int fd, const struct timespec times[2]), -1) +HERMIT_STUB(int, futimesat, (int dirfd, const char *pathname, const struct timeval times[2]), -1) + +HERMIT_STUB(int, lchmod, (const char *path, mode_t mode), -1) +HERMIT_SYSCALL(int, lstat, (const char *path, struct stat *st), (path, st)) + +HERMIT_SYSCALL(int, mkdir, (const char *path, mode_t mode), (path, mode)) +HERMIT_STUB(int, mkdirat, (int fd, const char *path, mode_t mode), -1) + +HERMIT_STUB(int, mkfifo, (const char *path, mode_t mode), -1) +HERMIT_STUB(int, mkfifoat, (int fd, const char *path, mode_t mode), -1) + +HERMIT_STUB(int, mknod, (const char *path, mode_t mode, dev_t dev), -1) +HERMIT_STUB(int, mknodat, (int fd, const char *path, mode_t mode, dev_t dev), -1) + +HERMIT_SYSCALL(int, stat, (const char *path, struct stat *st), (path, st)) + +HERMIT_STUB(mode_t, umask, (mode_t mask), -1) + +HERMIT_STUB(int, utimensat, (int fd, const char *path, const struct timespec times[2], int flag), -1) +HERMIT_STUB(int, futimes, (int fd, const struct timeval times[2]), -1) +HERMIT_STUB(int, lutimes, (const char *path, const struct timeval times[2]), -1) diff --git a/newlib/libc/sys/hermit/stdio/rename.c b/newlib/libc/sys/hermit/stdio/rename.c new file mode 100644 index 0000000000..bd93d1168e --- /dev/null +++ b/newlib/libc/sys/hermit/stdio/rename.c @@ -0,0 +1,8 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#include +#include +#include + +HERMIT_STUB_REENT(int, rename, (const char *old, const char *new), (old, new), -1) \ No newline at end of file diff --git a/newlib/libc/sys/hermit/symlink.c b/newlib/libc/sys/hermit/symlink.c deleted file mode 100644 index e0caecc0b4..0000000000 --- a/newlib/libc/sys/hermit/symlink.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include "warning.h" - -int -symlink (const char* path1, const char* path2) -{ - return _symlink_r(_REENT, path1, path2); -} - -int -_symlink_r (struct _reent* ptr, const char* path1, const char* path2) -{ - ptr->_errno = ENOSYS; - return -1; -} diff --git a/newlib/libc/sys/hermit/sys/fcntl.h b/newlib/libc/sys/hermit/sys/fcntl.h deleted file mode 100644 index 009e24484c..0000000000 --- a/newlib/libc/sys/hermit/sys/fcntl.h +++ /dev/null @@ -1,101 +0,0 @@ -/* libc/sys/hermit/sys/fcntl.h - File access */ - -/* - * Written 2016 by Stefan Lankes - * - * derived from libc/sys/linux/sys/fcntl.h - */ - - -#ifndef _SYS_FCNTL_H -#define _SYS_FCNTL_H - -#include -//#include - -#define _FREAD 0x0001 /* read enabled */ -#define _FWRITE 0x0002 /* write enabled */ - -/* - * When introducing new O_* bits, please check its uniqueness in fcntl_init(). - */ - -#define O_ACCMODE 00000003 -#define O_RDONLY 00000000 -#define O_WRONLY 00000001 -#define O_RDWR 00000002 -#ifndef O_CREAT -#define O_CREAT 00000100 /* not fcntl */ -#endif -#ifndef O_EXCL -#define O_EXCL 00000200 /* not fcntl */ -#endif -#ifndef O_NOCTTY -#define O_NOCTTY 00000400 /* not fcntl */ -#endif -#ifndef O_TRUNC -#define O_TRUNC 00001000 /* not fcntl */ -#endif -#ifndef O_APPEND -#define O_APPEND 00002000 -#endif -#ifndef O_NONBLOCK -#define O_NONBLOCK 00004000 -#endif -#ifndef O_DSYNC -#define O_DSYNC 00010000 /* used to be O_SYNC, see below */ -#endif -#ifndef FASYNC -#define FASYNC 00020000 /* fcntl, for BSD compatibility */ -#endif -#ifndef O_DIRECT -#define O_DIRECT 00040000 /* direct disk access hint */ -#endif -#ifndef O_LARGEFILE -#define O_LARGEFILE 00100000 -#endif -#ifndef O_DIRECTORY -#define O_DIRECTORY 00200000 /* must be a directory */ -#endif -#ifndef O_NOFOLLOW -#define O_NOFOLLOW 00400000 /* don't follow links */ -#endif -#ifndef O_NOATIME -#define O_NOATIME 01000000 -#endif -#ifndef O_CLOEXEC -#define O_CLOEXEC 02000000 /* set close_on_exec */ -#endif - -#define FD_CLOEXEC 1 /* posix */ -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ -#ifndef F_GETLK -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 -#endif - -/* --- redundant stuff below --- */ - -#include <_ansi.h> - -extern int creat (const char*, mode_t); -extern int _open (const char*, int, ...); - -#ifdef __KERNEL_PROTOTYPES -extern int open(const char* pathname, int flags, mode_t mode); -extern int fcntl(int fd, int cmd, long arg); -#else -extern int open (const char*, int, ...); -extern int fcntl (int, int, ...); -#endif - -extern int _fcntl (int, int, ...); - -#define fcntl sys_fcntl - -#endif diff --git a/newlib/libc/sys/hermit/sys/ucontext.h b/newlib/libc/sys/hermit/sys/ucontext.h deleted file mode 100644 index 350a4448dd..0000000000 --- a/newlib/libc/sys/hermit/sys/ucontext.h +++ /dev/null @@ -1,71 +0,0 @@ -/* libc/sys/hermit/sys/ucontext.h - get and set user thread context */ - -/* - * Written 2016 by Stefan Lankes - * - * derived from libc/sys/linux/sys/ucontext.h - */ - - -#ifndef _SYS_UCONTEXT_H -#define _SYS_UCONTEXT_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct mregs { - uint64_t r15; - uint64_t r14; - uint64_t r13; - uint64_t r12; - uint64_t r9; - uint64_t r8; - uint64_t rdi; - uint64_t rsi; - uint64_t rbp; - uint64_t rbx; - uint64_t rdx; - uint64_t rcx; - uint64_t rsp; - uint64_t rip; - uint32_t mxcsr; -} mregs_t; - -typedef struct { - uint16_t control_word; - uint16_t unused1; - uint16_t status_word; - uint16_t unused2; - uint16_t tags; - uint16_t unused3; - uint32_t eip; - uint16_t cs_selector; - uint32_t opcode:11; - uint32_t unused4:5; - uint32_t data_offset; - uint16_t data_selector; - uint16_t unused5; -} fenv_t; - -typedef struct ucontext { - mregs_t uc_mregs; - fenv_t uc_fenv; - struct ucontext *uc_link; - stack_t uc_stack; -} ucontext_t; - -int getcontext(ucontext_t *ucp); -int setcontext(const ucontext_t *ucp); -void makecontext(ucontext_t *ucp, void (*func)(), int argc, ...); -int swapcontext(ucontext_t *oucp, const ucontext_t *ucp); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/newlib/libc/sys/hermit/syscall.h b/newlib/libc/sys/hermit/syscall.h deleted file mode 100644 index 70805a5716..0000000000 --- a/newlib/libc/sys/hermit/syscall.h +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @author Stefan Lankes - * @file include/hermit/syscall.h - * @brief System call number definitions - * - * This file contains define constants for every syscall's number. - */ - -#ifndef __SYSCALL_H__ -#define __SYSCALL_H__ - -#ifdef __KERNEL__ -#include -#else -#include -#include -#include - -#ifndef NORETURN -#define NORETURN __attribute__((noreturn)) -#endif - -typedef unsigned int tid_t; -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Opaque structures (may point to Rust structures or be used to not clash with types defined by the C library) */ -struct _HermitItimerval; -typedef struct _HermitItimerval HermitItimerval; - -struct _HermitRecursiveMutex; -typedef struct _HermitRecursiveMutex HermitRecursiveMutex; - -typedef void* HermitSemaphore; - -struct _HermitSpinlock; -typedef struct _HermitSpinlock HermitSpinlock; - -struct _HermitSpinlockIrqSave; -typedef struct _HermitSpinlockIrqSave HermitSpinlockIrqSave; - -struct _HermitTimespec; -typedef struct _HermitTimespec HermitTimespec; - -struct _HermitTimeval; -typedef struct _HermitTimeval HermitTimeval; - - -typedef void (*entry_point_t)(void*); -typedef void (*signal_handler_t)(int); - - -/* Task priorities */ -#define HIGH_PRIO 3 -#define NORMAL_PRIO 2 -#define LOW_PRIO 1 -#define IDLE_PRIO 0 - - -/* - * HermitCore is a libOS. - * => classical system calls are realized as normal function - * => forward declaration of system calls as function - */ -tid_t sys_getpid(void); -int sys_fork(void); -int sys_wait(int* status); -int sys_execve(const char* name, char * const * argv, char * const * env); -int sys_getprio(tid_t* id); -int sys_setprio(tid_t* id, int prio); -void NORETURN sys_exit(int arg); -ssize_t sys_read(int fd, char* buf, size_t len); -ssize_t sys_write(int fd, const char* buf, size_t len); -ssize_t sys_sbrk(ssize_t incr); -int sys_open(const char* name, int flags, int mode); -int sys_close(int fd); -void sys_acquire_putchar_lock(void); -void sys_putchar(const unsigned char character); -void sys_release_putchar_lock(void); -void sys_usleep(unsigned long usecs); -int sys_nanosleep(const HermitTimespec* rqtp, HermitTimespec* rmtp); -void sys_msleep(unsigned int ms); -int sys_recmutex_init(HermitRecursiveMutex** recmutex); -int sys_recmutex_destroy(HermitRecursiveMutex* recmutex); -int sys_recmutex_lock(HermitRecursiveMutex* recmutex); -int sys_recmutex_unlock(HermitRecursiveMutex* recmutex); -int sys_sem_init(HermitSemaphore* sem, unsigned int pshared, unsigned int value); -int sys_sem_destroy(HermitSemaphore* sem); -int sys_sem_post(HermitSemaphore* sem); -int sys_sem_trywait(HermitSemaphore* sem); -int sys_sem_timedwait(HermitSemaphore *sem, unsigned int ms); -#define sys_sem_wait(sem) sys_sem_timedwait(sem, 0) -int sys_sem_cancelablewait(HermitSemaphore* sem, unsigned int ms); -int sys_spinlock_init(HermitSpinlock** lock); -int sys_spinlock_destroy(HermitSpinlock* lock); -int sys_spinlock_lock(HermitSpinlock* lock); -int sys_spinlock_unlock(HermitSpinlock* lock); -int sys_spinlock_irqsave_init(HermitSpinlockIrqSave** lock); -int sys_spinlock_irqsave_destroy(HermitSpinlockIrqSave* lock); -int sys_spinlock_irqsave_lock(HermitSpinlockIrqSave* lock); -int sys_spinlock_irqsave_unlock(HermitSpinlockIrqSave* lock); -int sys_spawn(tid_t* id, entry_point_t func, void* arg, unsigned char prio, unsigned int core_id); -int sys_clock_getres(unsigned long clock_id, HermitTimespec* res); -int sys_clock_gettime(unsigned long clock_id, HermitTimespec* tp); -int sys_clock_nanosleep(unsigned long clock_id, int flags, const HermitTimespec* rqtp, HermitTimespec* rmtp); -int sys_clock_settime(unsigned long clock_id, const HermitTimespec* tp); -int sys_clone(tid_t* id, void* ep, void* argv); -int sys_getpagesize(void); -int sys_gettimeofday(HermitTimeval* tp, void* tz); -size_t sys_get_processor_count(void); -unsigned short sys_get_processor_frequency(void); -off_t sys_lseek(int fd, off_t offset, int whence); -int sys_setitimer(int which, const HermitItimerval* value, HermitItimerval* ovalue); -void sys_yield(void); -int sys_kill(tid_t dest, int signum); -int sys_signal(signal_handler_t handler); -unsigned int sys_rand(); - -uint8_t *sys_malloc(size_t size, size_t align); -uint8_t *sys_alloc(size_t size, size_t align); -uint8_t *sys_realloc(uint8_t *ptr, size_t size, size_t align, size_t new_size); -void sys_free(uint8_t *ptr, size_t size, size_t align); - -struct ucontext; -typedef struct ucontext ucontext_t; - -void makecontext(ucontext_t *ucp, void (*func)(), int argc, ...); -int swapcontext(ucontext_t *oucp, const ucontext_t *ucp); -int getcontext(ucontext_t *ucp); -int setcontext(ucontext_t *ucp); - -int32_t sys_mkdir(const char *name, uint32_t mode); - -#define __NR_exit 0 -#define __NR_write 1 -#define __NR_open 2 -#define __NR_close 3 -#define __NR_read 4 -#define __NR_lseek 5 -#define __NR_unlink 6 -#define __NR_getpid 7 -#define __NR_kill 8 -#define __NR_fstat 9 -#define __NR_sbrk 10 -#define __NR_fork 11 -#define __NR_wait 12 -#define __NR_execve 13 -#define __NR_times 14 -#define __NR_stat 15 -#define __NR_dup 16 -#define __NR_dup2 17 -#define __NR_msleep 18 -#define __NR_yield 19 -#define __NR_sem_init 20 -#define __NR_sem_destroy 21 -#define __NR_sem_wait 22 -#define __NR_sem_post 23 -#define __NR_sem_timedwait 24 -#define __NR_getprio 25 -#define __NR_setprio 26 -#define __NR_clone 27 -#define __NR_sem_cancelablewait 28 -#define __NR_get_ticks 29 - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/newlib/libc/sys/hermit/sysconf.c b/newlib/libc/sys/hermit/sysconf.c deleted file mode 100644 index e9e77dfea2..0000000000 --- a/newlib/libc/sys/hermit/sysconf.c +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2018 Colin Finck, RWTH Aachen University -// -// MIT License -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -#include -#include -#include -#include -#include -#include "syscall.h" - -long -sysconf (int name) -{ - switch (name) - { - case _SC_ARG_MAX: return ARG_MAX; - case _SC_CLK_TCK: return CLK_TCK; - case _SC_NPROCESSORS_CONF: return sys_get_processor_count(); - case _SC_NPROCESSORS_ONLN: return sys_get_processor_count(); - case _SC_PAGESIZE: return sys_getpagesize(); - case _SC_PRIORITY_SCHEDULING: return 1; - case _SC_THREAD_DESTRUCTOR_ITERATIONS: return PTHREAD_DESTRUCTOR_ITERATIONS; - case _SC_THREAD_KEYS_MAX: return PTHREAD_KEYS_MAX; - case _SC_THREAD_STACK_MIN: return PTHREAD_STACK_MIN; - case _SC_THREAD_THREADS_MAX: return PTHREAD_THREADS_MAX; - case _SC_THREADS: return 1; - case _SC_TIMERS: return 1; - case _SC_THREAD_ATTR_STACKADDR: return -1; - case _SC_THREAD_ATTR_STACKSIZE: return 1; - case _SC_THREAD_PRIORITY_SCHEDULING: return -1; - case _SC_THREAD_PRIO_INHERIT: return -1; - case _SC_THREAD_PRIO_PROTECT: return -1; - case _SC_THREAD_PROCESS_SHARED: return -1; - case _SC_THREAD_SAFE_FUNCTIONS: return 1; - case _SC_VERSION: return _POSIX_VERSION; - default: - *__errno() = EINVAL; - return -1; - } -} diff --git a/newlib/libc/sys/hermit/time.c b/newlib/libc/sys/hermit/time.c new file mode 100644 index 0000000000..121c5483b3 --- /dev/null +++ b/newlib/libc/sys/hermit/time.c @@ -0,0 +1,85 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#include +#include +#include +#include +#include +#include +#include + +HERMIT_STUB(int, adjtime, (const struct timeval *delta, struct timeval *olddelta), -1) + +int clock_getcpuclockid(pid_t pid, clockid_t *clockid) +{ + if (pid < 0) + { + errno = ESRCH; + return -1; + } + + if (pid != 0 && pid != getpid()) + { + errno = ENOSYS; + return -1; + } + + if (clockid) + { + *clockid = CLOCK_PROCESS_CPUTIME_ID; + } + + return 0; +} + +HERMIT_SYSCALL(int, clock_getres, (clockid_t clockid, struct timespec *ts), (clockid, ts)) +HERMIT_SYSCALL(int, clock_gettime, (clockid_t clockid, struct timespec *ts), (clockid, ts)) +HERMIT_SYSCALL(int, clock_nanosleep, (clockid_t clockid, int flags, const struct timespec *rqtp, struct timespec *rmtp), (clockid, flags, rqtp, rmtp)) +HERMIT_STUB(int, clock_settime, (clockid_t clockid, const struct timespec *ts), -1) + +int ftime(struct timeb *tp) +{ + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + tp->time = ts.tv_sec; + tp->millitm = ts.tv_nsec / 1000000; + tp->timezone = tp->dstflag = 0; + return 0; +} + +HERMIT_STUB_REENT(struct tm *, getdate, (const char *string), (string), NULL) + +HERMIT_SYSCALL_REENT(int, gettimeofday, (struct timeval * tv, void *tz), (tv, tz)) + +int settimeofday(const struct timeval *tv, const struct timezone *tz) +{ + if (!tv) + return 0; + if (tv->tv_usec >= 1000000ULL) + { + errno = EINVAL; + return -1; + } + return clock_settime(CLOCK_REALTIME, &((struct timespec){ + .tv_sec = tv->tv_sec, .tv_nsec = tv->tv_usec * 1000})); +} + +int nanosleep(const struct timespec *req, struct timespec *rem) +{ + return clock_nanosleep(CLOCK_REALTIME, 0, req, rem); +} + +HERMIT_STUB_REENT(clock_t, times, (struct tms * ptms), (ptms), -1) + +#define TIME_UTC 1 + +int timespec_get(struct timespec *ts, int base) +{ + if (base != TIME_UTC) + return 0; + int ret = clock_gettime(CLOCK_REALTIME, ts); + return ret < 0 ? 0 : base; +} + +HERMIT_STUB(int, utimes, (const char *path, const struct timeval times[2]), -1) diff --git a/newlib/libc/sys/hermit/times.c b/newlib/libc/sys/hermit/times.c deleted file mode 100644 index 528c572b51..0000000000 --- a/newlib/libc/sys/hermit/times.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include - -clock_t -times (struct tms *buf) -{ - return _times_r(_REENT, buf); -} - -clock_t -_times_r (struct _reent *ptr, struct tms *buf) -{ - ptr->_errno = EACCES; - return -1; -} diff --git a/newlib/libc/sys/hermit/unistd.c b/newlib/libc/sys/hermit/unistd.c new file mode 100644 index 0000000000..67872a29c6 --- /dev/null +++ b/newlib/libc/sys/hermit/unistd.c @@ -0,0 +1,321 @@ +// SPDX-FileCopyrightText: 2024 TriliTech +// SPDX-License-Identifier: MIT + +#define __MISC_VISIBLE 1 +#include +#include +#include +#include +#include +#include +#include +#include + +void _exit(int32_t status) +{ + sys_exit(status); +} + +int access(const char *pathname, int mode) +{ + // Open a file descriptor, do not create a file if it doesn't exist + int fd = open(pathname, 0); + + if (fd < 0) + { + return -1; + } + + if (mode == F_OK) + goto ok; + + struct stat st; + if (fstat(fd, &st) < 0) + goto err; + + int uid = getuid(); + if (uid < 0) + goto err; + + int gid = getgid(); + if (gid < 0) + goto err; + + // Last 3 octets of `st.st_mode` are the permissions + // The first (left) is user, the second is group, the last is others + int permidx = st.st_uid == uid ? 2 : st.st_gid == gid ? 1 + : 0; + int perms = st.st_mode >> (permidx * 3) & 07; + + if ((mode & R_OK == R_OK && perms & R_OK != R_OK) || (mode & W_OK == W_OK && perms & W_OK != W_OK) || (mode & X_OK == X_OK && perms & X_OK != X_OK)) + { + errno = EINVAL; + goto err; + } + + goto ok; + +err: + close(fd); + return -1; + +ok: + close(fd); + return 0; +} + +// Process accounting is disabled for hermit +HERMIT_STUB(int, acct, (const char *file), -1); + +unsigned int alarm(unsigned int seconds) +{ + // Hermit doesn't support alarms + // If no alarm is currently set, the function returns 0 + return 0; +} + +HERMIT_STUB(int, chdir, (const char *path), -1) + +HERMIT_STUB(int, chown, (const char *path, uid_t owner, gid_t group), -1) + +HERMIT_SYSCALL_REENT(int, close, (int fd), (fd)) + +char *ctermid(char *s) +{ + // Hermit doesn't support controlling terminals + return NULL; +} + +HERMIT_SYSCALL(int, dup, (int fd), (fd)) +HERMIT_STUB(int, dup2, (int oldfd, int newfd), -1) +HERMIT_STUB(int, dup3, (int oldfd, int newfd, int flags), -1) + +HERMIT_STUB(int, faccessat, (int dirfd, const char *path, int mode, int flags), -1) +HERMIT_STUB(int, fchdir, (int fd), -1) +HERMIT_STUB(int, fchown, (int fd, uid_t owner, gid_t group), -1) +HERMIT_STUB(int, fchownat, (int dirfd, const char *path, uid_t owner, gid_t group, int flags), -1) +HERMIT_STUB(int, fdatasync, (int fd), -1) +HERMIT_STUB(int, fsync, (int fd), -1) +HERMIT_STUB(int, ftruncate, (int fd, off_t length), -1) + +// TODO: +// We could emulate this by having a global variable that stores the current working directory +// and then return that value when getcwd is called + +HERMIT_STUB(char *, getcwd, (char *buf, size_t size), NULL) +HERMIT_STUB(char *, getwd, (char *buf), NULL) + +gid_t getegid(void) +{ + // See getgid + return HERMIT_GID; +} + +uid_t geteuid(void) +{ + // See getuid + return HERMIT_UID; +} + +gid_t getgid(void) +{ + return HERMIT_GID; +} + +int getgroups(int gidsetsize, gid_t grouplist[]) +{ + // If the gidsetsize is 0, we return number of + // *supplementary* groups of the process + if (gidsetsize == 0) + { + return 0; + } + + if (grouplist == NULL) + { + errno = EFAULT; + return -1; + } + + // assert(gidsetsize > 0 || gidsetsize < 0) + + // EINVAL if `gidsetsize is less than the number of supplementary group IDs, + // but is not zero. + errno = EINVAL; + return -1; +} + +char *getlogin(void) +{ + // In hermit, we don't have the concept of login + // So, we return the username of the user (which will be root) + return getenv("USER"); +} + +pid_t getpgid(pid_t pid) +{ + if (pid == 0) + { + return HERMIT_PGID; + } + + if (pid != 1) + { + errno = ESRCH; + return -1; + } + + return HERMIT_PGID; +} + +pid_t getpgrp(void) +{ + return getpgid(0); +} + +int _getpid_r(struct _reent *reent) +{ + return HERMIT_INIT_PID; +} + +int getpid(void) +{ + return _getpid_r(_REENT); +} + +pid_t getppid(void) +{ + return HERMIT_INIT_PPID; +} + +uid_t getuid(void) +{ + return HERMIT_UID; +} + +// This function is to be kept in sync with the implementation from hermit-abi/src/lib.rs + +int _isatty_r(struct _reent *reent, int file) +{ + return 0; +} + +int isatty(int file) +{ + return _isatty_r(_REENT, file); +} + +HERMIT_STUB(int, lchown, (const char *path, uid_t uid, gid_t gid), -1) +HERMIT_STUB_REENT(int, link, (const char *path1, const char *path2), (path1, path2), -1) +HERMIT_STUB(int, linkat, (int fd, const char *existing, int fd2, const char *new, int flag), -1) + +HERMIT_SYSCALL_REENT(off_t, lseek, (int fd, off_t offset, int whence), (fd, offset, whence)) + +HERMIT_STUB(int, nice, (int inc), -1) +HERMIT_STUB(int, pause, (void), -1) + +HERMIT_STUB(int, pipe, (int fd[2]), -1) +HERMIT_STUB(int, pipe2, (int fd[2], int flag), -1) + +int posix_close(int fd, int flags) +{ + return close(fd); +} + +HERMIT_STUB(ssize_t, pread, (int fd, void *buf, size_t count, off_t offset), -1) +HERMIT_STUB(ssize_t, preadv, (int fd, const struct iovec *iov, int iovcnt, off_t offset), -1) + +HERMIT_SYSCALL_REENT(ssize_t, read, (int fd, void *buf, size_t len), (fd, buf, len)) + +HERMIT_STUB(ssize_t, readlink, (const char *path, char *buf, size_t len), -1) +HERMIT_STUB(ssize_t, readlinkat, (int fd, const char *path, char *buf, size_t len), -1) + +HERMIT_SYSCALL(ssize_t, readv, (int fd, const struct iovec *iov, int count), (fd, iov, count)) + +HERMIT_STUB(int, renameat, (int fromfd, const char *from, int tofd, const char *to), -1) + +HERMIT_SYSCALL(int, rmdir, (const char *path), (path)) + +HERMIT_STUB_WITH_ERRNO(int, setegid, (gid_t egid), EPERM, -1) +HERMIT_STUB_WITH_ERRNO(int, seteuid, (uid_t euid), EPERM, -1) +HERMIT_STUB_WITH_ERRNO(int, setgid, (gid_t gid), EPERM, -1) +HERMIT_STUB_WITH_ERRNO(int, setpgid, (pid_t pid, pid_t pgid), EPERM, -1) +HERMIT_STUB_WITH_ERRNO(int, setpgrp, (void), EPERM, -1) +HERMIT_STUB_WITH_ERRNO(int, setregid, (gid_t rgid, gid_t egid), EPERM, -1) +HERMIT_STUB_WITH_ERRNO(int, setresgid, (gid_t rgid, gid_t egid, gid_t sgid), EPERM, -1) +HERMIT_STUB_WITH_ERRNO(int, setresuid, (uid_t ruid, uid_t euid, uid_t suid), EPERM, -1) +HERMIT_STUB_WITH_ERRNO(int, setreuid, (uid_t ruid, uid_t euid), EPERM, -1) +HERMIT_STUB_WITH_ERRNO(pid_t, setsid, (void), EPERM, -1) +HERMIT_STUB_WITH_ERRNO(int, setuid, (uid_t uid), EPERM, -1) + +unsigned sleep(unsigned seconds) +{ + struct timespec tv = {.tv_sec = seconds, .tv_nsec = 0}; + if (nanosleep(&tv, &tv)) + return tv.tv_sec; + return 0; +} + +HERMIT_STUB(int, symlink, (const char *existing, const char *new), -1) +HERMIT_STUB(int, symlinkat, (const char *existing, int fd, const char *new), -1) + +void sync(void) +{ + // Hermit either uses a virtiofs or a memfs, either of which doesn't require syncing +} + +HERMIT_STUB(int, truncate, (const char *path, off_t length), -1) + +HERMIT_STUB(int, ttyname_r, (int fd, char *buf, size_t buflen), -1) +HERMIT_STUB(char *, ttyname, (int fd), NULL) + +useconds_t ualarm(useconds_t usecs, useconds_t interval) +{ + // Hermit doesn't support alarms (see alarm(1)) + return 0; +} + +HERMIT_SYSCALL_REENT(int, unlink, (const char *path), (path)) + +HERMIT_STUB(int, unlinkat, (int fd, const char *path, int flag), -1) + +int usleep(useconds_t useconds) +{ + struct timespec tv = + { + .tv_sec = useconds / 1000000, + .tv_nsec = (useconds % 1000000) * 1000}; + + return nanosleep(&tv, &tv); +} + +HERMIT_SYSCALL_REENT(ssize_t, write, (int fd, const void *buf, size_t count), (fd, buf, count)) +HERMIT_SYSCALL(ssize_t, writev, (int fd, const struct iovec *iov, int iovcnt), (fd, iov, iovcnt)) + +int lockf(int fd, int op, off_t size) +{ + struct flock l = { + .l_type = F_WRLCK, + .l_whence = SEEK_CUR, + .l_len = size, + }; + switch (op) + { + case F_TEST: + l.l_type = F_RDLCK; + if (fcntl(fd, F_GETLK, &l) < 0) + return -1; + if (l.l_type == F_UNLCK || l.l_pid == getpid()) + return 0; + errno = EACCES; + return -1; + case F_ULOCK: + l.l_type = F_UNLCK; + case F_TLOCK: + return fcntl(fd, F_SETLK, &l); + case F_LOCK: + return fcntl(fd, F_SETLKW, &l); + } + errno = EINVAL; + return -1; +} \ No newline at end of file diff --git a/newlib/libc/sys/hermit/unlink.c b/newlib/libc/sys/hermit/unlink.c deleted file mode 100644 index a1501bf2af..0000000000 --- a/newlib/libc/sys/hermit/unlink.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include "warning.h" - -int -unlink (const char *name) -{ - return _unlink_r(_REENT, name); -} - -int -_unlink_r (struct _reent *ptr, const char *name) -{ - ptr->_errno = ENOENT; - return -1; -} diff --git a/newlib/libc/sys/hermit/wait.c b/newlib/libc/sys/hermit/wait.c deleted file mode 100644 index ddc1915bdf..0000000000 --- a/newlib/libc/sys/hermit/wait.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include "syscall.h" -#include "warning.h" - -int -wait (int* status) -{ - return _wait_r(_REENT, status); -} - -int -_wait_r (struct _reent* ptr, int* status) -{ - int ret; - - /* create a child process */ - ret = sys_wait(status); - if (ret < 0) { - ptr->_errno = -ret; - ret = -1; - } - - return ret; -} diff --git a/newlib/libc/sys/hermit/warning.h b/newlib/libc/sys/hermit/warning.h deleted file mode 100644 index 9232a92446..0000000000 --- a/newlib/libc/sys/hermit/warning.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef __WARNING_H__ -#define __WARNING_H__ - -#ifdef HAVE_GNU_LD -# ifdef HAVE_ELF - -/* We want the .gnu.warning.SYMBOL section to be unallocated. */ -# ifdef HAVE_ASM_PREVIOUS_DIRECTIVE -# define __make_section_unallocated(section_string) \ - asm(".section " section_string "\n .previous"); -# elif defined (HAVE_ASM_POPSECTION_DIRECTIVE) -# define __make_section_unallocated(section_string) \ - asm(".pushsection " section_string "\n .popsection"); -# else -# define __make_section_unallocated(section_string) -# endif - -# ifdef HAVE_SECTION_ATTRIBUTES -# define link_warning(symbol, msg) \ - static const char __evoke_link_warning_##symbol[] \ - __attribute__ ((section (".gnu.warning." __SYMBOL_PREFIX #symbol), \ - __used__)) = msg; -# else -# define link_warning(symbol, msg) -# endif - -#else /* !ELF */ - -# define link_warning(symbol, msg) \ - asm(".stabs \"" msg "\",30,0,0,0\n" \ - ".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0\n"); -# endif -#else /* !GNULD */ -/* We will never be heard; they will all die horribly. */ -# define link_warning(symbol, msg) -#endif - -/* A canned warning for sysdeps/stub functions. - The GNU linker prepends a "warning: " string. */ -#define stub_warning(name) \ - link_warning (name, \ - #name " is not implemented and will always fail") - -#endif /* __WARNING_H__ */ diff --git a/newlib/libc/sys/hermit/write.c b/newlib/libc/sys/hermit/write.c deleted file mode 100644 index 7fc6a11503..0000000000 --- a/newlib/libc/sys/hermit/write.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2011, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include -#include <_ansi.h> -#include <_syslist.h> -#include -#include "syscall.h" -#include "warning.h" - -_ssize_t -write (int file, const void* ptr, size_t len) -{ - return _write_r(_REENT, file, ptr, len); -} - -_ssize_t -_write_r (struct _reent* r, int file, const void* ptr, size_t len) -{ - int ret; - - ret = sys_write(file, ptr, len); - if (ret < 0) { - r->_errno = -ret; - ret = -1; - } - - return ret; -}