Migrate glibc stuff to 'akaros' as well
authorKevin Klues <klueska@cs.berkeley.edu>
Fri, 17 Oct 2014 05:21:52 +0000 (22:21 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 31 Dec 2014 18:03:07 +0000 (13:03 -0500)
315 files changed:
tools/compilers/gcc-glibc/glibc-2.14.1-ros/abi-tags
tools/compilers/gcc-glibc/glibc-2.14.1-ros/configure
tools/compilers/gcc-glibc/glibc-2.14.1-ros/configure.in
tools/compilers/gcc-glibc/glibc-2.14.1-ros/include/errno.h
tools/compilers/gcc-glibc/glibc-2.14.1-ros/nptl/shlib-versions
tools/compilers/gcc-glibc/glibc-2.14.1-ros/scripts/config.sub
tools/compilers/gcc-glibc/glibc-2.14.1-ros/shlib-versions
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/Implies [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/Makefile [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/Subdirs [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/Versions [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/_G_config.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/____longjmp_chk.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/_exit.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/abort.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/access.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/dirent.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/errno.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/fcntl.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/ioctls.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/libc-lock.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/local_lim.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/mman.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/semaphore.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/sigaction.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/sigcontext.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/signum.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/socket.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/stat.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/stdio-lock.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/termios.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/typesizes.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/utmp.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/brk.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/chdir.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/check_fds.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/check_native.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/chmod.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/close.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/closedir.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/configure [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/convD2M.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/convM2D.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/convM2S.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/convS2M.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/dirfd.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/dirstream.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/dl-execstack.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/dl-sysdep.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/errlist.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/errno.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/execve.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fcall.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fchdir.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fchmod.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fcntl.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/flockfile.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fork.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/ftruncate.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/ftruncate64.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/ftrylockfile.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/funlockfile.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/futimens.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/futimes.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/futimesat.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fxstat.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fxstat64.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/getaddrinfo.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/getcwd.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/getdents.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/getpagesize.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/getpeername.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/getpid.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/getrlimit64.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/getsysstats.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/gettimeofday.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/glob64.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/i386/sysdep.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/i386/tls.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/init-first.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/isatty.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/kernel-features.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/kill.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/ldsodefs.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/link.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/lowlevellock.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/lseek.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/lseek64.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/lxstat.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/lxstat64.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/machine/trap.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/madvise.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/malloc-machine.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/mkdir.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/mmap.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/mprotect.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/munmap.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/net/if.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/netpacket/packet.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/open.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/opendir.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/perror.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/pipe.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/pipe2.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/poll.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/ptsname.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/read.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/readdir.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/readdir_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/readlink.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/rename.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/rewinddir.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/riscv/sysdep.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/riscv/tls.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/rmdir.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/sa_len.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/sbrk.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/sched_cpualloc.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/sched_yield.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/setgid.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/setrlimit.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/setuid.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/sleep.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/sparc/sparc32/sysdep.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/sparc/sparc32/tls.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/start.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/symlink.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/sys/param.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/sys/procfs.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/sys/queue.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/sys/syscall.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/sys/vcore-tls.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/syscall.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/sysconf.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/sysdep-cancel.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/tcgetattr.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/tcsetattr.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/time.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/times.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/truncate.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/truncate64.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/umask.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/unlink.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/utime.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/utimensat.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/utimes.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/vcore-tls.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/wait.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/waitpid.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/write.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/writev.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/x86_64/Makefile [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/x86_64/____longjmp_chk.S [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/x86_64/bits/sigcontext.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/x86_64/profil-counter.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/x86_64/sys/ucontext.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/x86_64/sysdep.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/x86_64/tcb-offsets.sym [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/x86_64/tls.h [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/xstat.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/xstat64.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/Implies [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/Makefile [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/Subdirs [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/Versions [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/_G_config.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/____longjmp_chk.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/_exit.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/abort.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/access.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/dirent.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/errno.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/fcntl.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/ioctls.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/libc-lock.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/local_lim.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/mman.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/semaphore.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/sigaction.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/sigcontext.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/signum.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/socket.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/stat.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/stdio-lock.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/termios.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/typesizes.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/bits/utmp.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/brk.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/chdir.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/check_fds.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/check_native.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/chmod.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/close.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/closedir.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/configure [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/convD2M.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/convM2D.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/convM2S.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/convS2M.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/dirfd.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/dirstream.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/dl-execstack.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/dl-sysdep.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/errlist.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/errno.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/execve.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/fcall.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/fchdir.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/fchmod.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/fcntl.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/flockfile.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/fork.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/ftruncate.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/ftruncate64.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/ftrylockfile.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/funlockfile.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/futimens.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/futimes.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/futimesat.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/fxstat.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/fxstat64.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/getaddrinfo.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/getcwd.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/getdents.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/getpagesize.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/getpeername.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/getpid.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/getrlimit64.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/getsysstats.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/gettimeofday.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/glob64.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/i386/sysdep.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/i386/tls.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/init-first.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/isatty.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/kernel-features.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/kill.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/ldsodefs.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/link.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/lowlevellock.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/lseek.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/lseek64.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/lxstat.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/lxstat64.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/machine/trap.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/madvise.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/malloc-machine.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/mkdir.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/mmap.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/mprotect.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/munmap.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/net/if.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/netpacket/packet.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/open.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/opendir.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/perror.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/pipe.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/pipe2.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/poll.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/ptsname.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/read.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/readdir.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/readdir_r.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/readlink.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/rename.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/rewinddir.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/riscv/sysdep.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/riscv/tls.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/rmdir.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/sa_len.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/sbrk.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/sched_cpualloc.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/sched_yield.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/setgid.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/setrlimit.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/setuid.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/sleep.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/sparc/sparc32/sysdep.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/sparc/sparc32/tls.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/start.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/symlink.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/sys/param.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/sys/procfs.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/sys/queue.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/sys/syscall.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/sys/vcore-tls.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/syscall.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/sysconf.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/sysdep-cancel.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/tcgetattr.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/tcsetattr.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/time.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/times.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/truncate.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/truncate64.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/umask.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/unlink.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/utime.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/utimensat.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/utimes.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/vcore-tls.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/wait.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/waitpid.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/write.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/writev.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/x86_64/Makefile [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/x86_64/____longjmp_chk.S [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/x86_64/bits/sigcontext.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/x86_64/profil-counter.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/x86_64/sys/ucontext.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/x86_64/sysdep.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/x86_64/tcb-offsets.sym [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/x86_64/tls.h [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/xstat.c [deleted file]
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/xstat64.c [deleted file]

index f87131a..2cf9591 100644 (file)
@@ -28,7 +28,7 @@
 
 .*-.*-syllable.*       5       2.0.0   # just an arbitrary value
 
-.*-.*-ros.*                    6       1.0.0   # just an arbitrary value
+.*-.*-akaros.*         6       1.0.0   # just an arbitrary value
 
 # There is no catch-all default here because every supported OS that uses
 # ELF must have its own unique ABI tag.
index 98030e2..845466e 100755 (executable)
@@ -4306,11 +4306,11 @@ while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do
   tail="$2"
 done
 
-# For ros, we don't have a base OS, which messes things up. Change this for the
-# purpose of sysdeps detection.
+# For akaros, we don't have a base OS, which messes things up. Change this for
+# the purpose of sysdeps detection.
 test "x$base_os" != x || case "$os" in
-ros*)
-  base=/ros
+akaros*)
+  base=/akaros
   vendor=
   ostry=
   ;;
index 56df4eb..53db7d7 100644 (file)
@@ -755,11 +755,11 @@ while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; test -n "$m"; do
   tail="$2"
 done
 
-# For ros, we don't have a base OS, which messes things up. Change this for the
-# purpose of sysdeps detection.
+# For akaros, we don't have a base OS, which messes things up. Change this for
+# the purpose of sysdeps detection.
 test "x$base_os" != x || case "$os" in
-ros*)
-  base=/ros
+akaros*)
+  base=/akaros
   vendor=
   ostry=
   ;;
index b46d0b3..d3afcd1 100644 (file)
@@ -23,8 +23,8 @@ extern int rtld_errno attribute_hidden;
 
 #  include <tls.h>
 
-/* ROS doesn't want the redef of errno */
-#  ifndef __ros__
+/* AKAROS doesn't want the redef of errno */
+#  ifndef __akaros__
 #   if USE___THREAD
 #    undef  errno
 #    ifndef NOT_IN_libc
index 19db652..9b9ce54 100644 (file)
@@ -6,7 +6,7 @@ hppa.*-.*-linux.*       libpthread=0            GLIBC_2.2
 s390x-.*-linux.*       libpthread=0            GLIBC_2.2
 cris-.*-linux.*                libpthread=0            GLIBC_2.2
 x86_64-.*-linux.*      libpthread=0            GLIBC_2.2.5
-x86_64-.*-ros.*                libpthread=0            GLIBC_2.2.5
+x86_64-.*-akaros.*             libpthread=0            GLIBC_2.2.5
 powerpc64-.*-linux.*   libpthread=0            GLIBC_2.3
 .*-.*-linux.*          libpthread=0
-.*-.*-ros.*                    libpthread=0
+.*-.*-akaros.*         libpthread=0
index 96467b6..ba795e1 100755 (executable)
@@ -126,7 +126,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
   linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | akaros*-gnu* | \
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
@@ -1305,7 +1305,7 @@ case $os in
              | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
              | -sym* | -kopensolaris* \
              | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-             | -aos* | -aros* | -ros* \
+             | -aos* | -aros* | -akaros* \
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
              | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
index 901c9b5..e835607 100644 (file)
@@ -29,7 +29,7 @@
 s390x-.*-linux.*        DEFAULT                        GLIBC_2.2
 cris-.*-linux.*                DEFAULT                 GLIBC_2.2
 x86_64-.*-linux.*       DEFAULT                        GLIBC_2.2.5
-x86_64-.*-ros.*       DEFAULT                  GLIBC_2.2.5
+x86_64-.*-akaros.*      DEFAULT                        GLIBC_2.2.5
 powerpc64-.*-linux.*   DEFAULT                 GLIBC_2.3
 .*-.*-gnu-gnu.*                DEFAULT                 GLIBC_2.2.6
 
@@ -66,7 +66,7 @@ ia64-.*-linux.*               libc=6.1                GLIBC_2.2
 sh.*-.*-linux.*                libc=6                  GLIBC_2.2
 sparc64.*-.*-linux.*   libc=6                  GLIBC_2.2
 .*-.*-linux.*          libc=6
-.*-.*-ros.*            libc=6
+.*-.*-akaros.*         libc=6
 
 # libmachuser.so.1 corresponds to mach/*.defs as of Utah's UK22 release.
 .*-.*-gnu-gnu.*                libmachuser=1
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/Implies b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/Implies
new file mode 100644 (file)
index 0000000..b3188f7
--- /dev/null
@@ -0,0 +1 @@
+posix
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/Makefile b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/Makefile
new file mode 100644 (file)
index 0000000..1bbf3af
--- /dev/null
@@ -0,0 +1,21 @@
+CPPFLAGS += -DHAVE_MMAP=1
+CPPFLAGS += -DHAVE_MUNMAP=1
+CPPFLAGS += -D_LIBC_REENTRANT=1
+
+# Any sysdep .c file you want needs to be added here, if it's not somewhere
+# else already.  Many posix-ish .c files already are taken care of.  We also
+# need to be careful to only include some of them for specific subdirs.
+ifeq ($(subdir),socket)
+sysdep_routines += sa_len
+endif
+sysdep_headers += sys/syscall.h sys/vcore-tls.h
+
+# plan 9 conversion routines.  all C files need to be in exactly one directory.
+# stdlib seems like a reasonable place. */
+ifeq ($(subdir),stdlib)
+sysdep_routines += convD2M
+sysdep_routines += convM2D
+sysdep_routines += convM2S
+sysdep_routines += convS2M
+endif
+sysdep_headers += fcall.h
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/Subdirs b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/Subdirs
new file mode 100644 (file)
index 0000000..3c439a6
--- /dev/null
@@ -0,0 +1,8 @@
+nss
+inet
+resolv
+sunrpc
+nis
+nscd
+streams
+login
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/Versions b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/Versions
new file mode 100644 (file)
index 0000000..58de426
--- /dev/null
@@ -0,0 +1,31 @@
+libc {
+  GLIBC_2.0 {
+    __errno_location_tls;
+    __errstr_location_tls;
+    ros_errno_loc;
+    ros_errstr_loc;
+    __errno_location;
+    errstr;
+    ros_syscall_blockon;
+    ros_syscall_sync;
+    __ros_scp_syscall_blockon;
+    __ros_scp_simple_evq;
+    __ros_syscall_noerrno;
+    __ros_syscall_errno;
+
+    set_tls_desc;
+    get_tls_desc;
+    allocate_tls;
+    free_tls;
+    reinit_tls;
+
+    init_empty_dir;
+    convM2S;
+    convS2M;
+    sizeS2M;
+    statcheck;
+    convM2D;
+    convD2M;
+    sizeD2M;
+  }
+}
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/_G_config.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/_G_config.h
new file mode 100644 (file)
index 0000000..4a636e8
--- /dev/null
@@ -0,0 +1,103 @@
+/* This file is needed by libio to define various configuration parameters.
+   These are always the same in the GNU C library.  */
+
+#ifndef _G_config_h
+#define _G_config_h 1
+
+/* this is the same as the GNU version, unless marked 'AKAROS' */
+
+/* Define types for libio in terms of the standard internal type names.  */
+
+#include <bits/types.h>
+#define __need_size_t
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+# define __need_wchar_t
+#endif
+#define __need_NULL
+#include <stddef.h>
+#define __need_mbstate_t
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+# define __need_wint_t
+#endif
+#include <wchar.h>
+#define _G_size_t      size_t
+typedef struct
+{
+  __off_t __pos;
+  __mbstate_t __state;
+} _G_fpos_t;
+typedef struct
+{
+  __off64_t __pos;
+  __mbstate_t __state;
+} _G_fpos64_t;
+#define _G_ssize_t     __ssize_t
+#define _G_off_t       __off_t
+#define _G_off64_t     __off64_t
+#define        _G_pid_t        __pid_t
+#define        _G_uid_t        __uid_t
+#define _G_wchar_t     wchar_t
+#define _G_wint_t      wint_t
+#define _G_stat64      stat64
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+# include <gconv.h>
+typedef union
+{
+  struct __gconv_info __cd;
+  struct
+  {
+    struct __gconv_info __cd;
+    struct __gconv_step_data __data;
+  } __combined;
+} _G_iconv_t;
+#endif
+
+typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
+typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
+typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
+typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
+
+#define _G_HAVE_BOOL 1
+
+
+/* These library features are always available in the GNU C library.  */
+#define _G_HAVE_ATEXIT 1
+#define _G_HAVE_SYS_CDEFS 1
+#define _G_HAVE_SYS_WAIT 1
+#define _G_NEED_STDARG_H 1
+#define _G_va_list __gnuc_va_list
+
+#define _G_HAVE_PRINTF_FP 1
+#define _G_HAVE_MMAP 1
+//#define _G_HAVE_MREMAP 1 /* AKAROS: turning off mremap */
+#define _G_HAVE_LONG_DOUBLE_IO 1
+#define _G_HAVE_IO_FILE_OPEN 1
+#define _G_HAVE_IO_GETLINE_INFO 1
+
+#define _G_IO_IO_FILE_VERSION 0x20001
+
+#define _G_OPEN64      __open64
+#define _G_LSEEK64     __lseek64
+#define _G_MMAP64      __mmap64
+#define _G_FSTAT64(fd,buf) __fxstat64 (_STAT_VER, fd, buf)
+
+/* This is defined by <bits/stat.h> if `st_blksize' exists.  */
+#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)
+
+#define _G_BUFSIZ 8192
+
+/* These are the vtbl details for ELF.  */
+#define _G_NAMES_HAVE_UNDERSCORE 0
+#define _G_VTABLE_LABEL_HAS_LENGTH 1
+#define _G_USING_THUNKS        1
+#define _G_VTABLE_LABEL_PREFIX "__vt_"
+#define _G_VTABLE_LABEL_PREFIX_ID __vt_
+
+
+#if defined __cplusplus || defined __STDC__
+# define _G_ARGS(ARGLIST) ARGLIST
+#else
+# define _G_ARGS(ARGLIST) ()
+#endif
+
+#endif /* _G_config.h */
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/____longjmp_chk.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/____longjmp_chk.c
new file mode 100644 (file)
index 0000000..669fa3e
--- /dev/null
@@ -0,0 +1,6 @@
+#include <setjmp/setjmp.h>
+
+void ____longjmp_chk(struct __jmp_buf_tag __env[1], int __val)
+{
+  return __longjmp(__env,__val);
+}
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/_exit.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/_exit.c
new file mode 100644 (file)
index 0000000..bfc9f02
--- /dev/null
@@ -0,0 +1,37 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sysdep.h>
+#include <abort-instr.h>
+#include <ros/syscall.h>
+
+void
+_exit (status)
+     int status;
+{
+  ros_syscall(SYS_proc_destroy, getpid(), status, 0, 0, 0, 0);
+  #ifdef ABORT_INSTRUCTION
+  ABORT_INSTRUCTION;
+  #endif
+  while(1);
+}
+libc_hidden_def (_exit)
+weak_alias (_exit, _Exit)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/abort.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/abort.c
new file mode 100644 (file)
index 0000000..45693a5
--- /dev/null
@@ -0,0 +1,58 @@
+/* Copyright (C) 1991,93,1995-1998,2001,02,2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <bits/libc-lock.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+/* AKAROS: grossly limited version of abort, so we at least get a non-zero exit
+ * code.  Previously, the program seemed to exit properly (unlike on Linux). */
+
+/* Try to get a machine dependent instruction which will make the
+   program crash.  This is used in case everything else fails.  */
+#include <abort-instr.h>
+#ifndef ABORT_INSTRUCTION
+/* No such instruction is available.  */
+# define ABORT_INSTRUCTION
+#endif
+
+#ifdef USE_IN_LIBIO
+# include <libio/libioP.h>
+# define fflush(s) _IO_flush_all_lockp (0)
+#endif
+
+/* Exported variable to locate abort message in core files etc.  */
+struct abort_msg_s *__abort_msg __attribute__ ((nocommon));
+libc_hidden_def (__abort_msg)
+
+
+void
+abort (void)
+{
+      _exit (127);
+
+  /* If even this fails try to use the provided instruction to crash
+     or otherwise make sure we never return.  */
+  while (1)
+    /* Try for ever and ever.  */
+    ABORT_INSTRUCTION;
+}
+libc_hidden_def (abort)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/access.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/access.c
new file mode 100644 (file)
index 0000000..5daf419
--- /dev/null
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <string.h>
+#include <ros/syscall.h>
+
+/* Test for access to FILE.  */
+int
+__access (const char* file, int type)
+{
+  if (file == NULL || (type & ~(R_OK|W_OK|X_OK|F_OK)) != 0)
+  {
+    __set_errno (EINVAL);
+    return -1;
+  }
+
+  return ros_syscall(SYS_access, file, strlen(file), type, 0, 0, 0);
+}
+weak_alias (__access, access)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/dirent.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/dirent.h
new file mode 100644 (file)
index 0000000..9597566
--- /dev/null
@@ -0,0 +1,12 @@
+/* Keep this in sync with the kernel */
+struct dirent
+{
+  __ino64_t          d_ino;
+  __off64_t          d_off;
+  unsigned short     d_reclen;
+  unsigned char      d_type;
+  char               d_name[256];
+} __attribute__((aligned(8)));
+
+#define d_fileno d_ino
+#define dirent64 dirent
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/errno.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/errno.h
new file mode 100644 (file)
index 0000000..7b61c73
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef _BITS_ERRNO_H
+#define _BITS_ERRNO_H
+
+#ifndef __ASSEMBLER__
+
+int *__errno_location_tls(void);
+char *__errstr_location_tls(void);
+extern int *(*ros_errno_loc)(void);
+extern char *(*ros_errstr_loc)(void);
+int *__errno_location(void);
+#define errno (*__errno_location())
+char *errstr(void);    /* can't macro, errstr is used internally in libc */
+
+# ifdef libc_hidden_proto
+libc_hidden_proto(__errno_location_tls)
+libc_hidden_proto(__errstr_location_tls)
+libc_hidden_proto(errstr)
+# endif
+
+#endif
+
+#include <ros/errno.h>
+
+#endif
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/fcntl.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/fcntl.h
new file mode 100644 (file)
index 0000000..ce650f5
--- /dev/null
@@ -0,0 +1,96 @@
+/* O_*, F_*, FD_* bit values for stub configuration.
+   Copyright (C) 1991, 1992, 1997, 2000, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* These values should be changed as appropriate for your system.  */
+
+#ifndef        _FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+/* we don't support this shit */
+#define O_LARGEFILE    0
+#define O_DIRECTORY    0
+
+/* File access modes for `open' and `fcntl'.  */
+#define        O_RDONLY        0       /* Open read-only.  */
+#define        O_WRONLY        1       /* Open write-only.  */
+#define        O_RDWR          2       /* Open read/write.  */
+#define        O_ACCMODE       (O_RDONLY|O_WRONLY|O_RDWR)
+
+/* Bits OR'd into the second argument to open.  */
+#define O_CREAT        0100 /* not fcntl */
+#define O_EXCL         0200 /* not fcntl */
+#define O_NOCTTY       0400 /* not fcntl */
+#define O_TRUNC       01000 /* not fcntl */
+#define O_APPEND      02000
+#define O_NONBLOCK    04000
+#define O_SYNC       010000
+#define O_FSYNC      O_SYNC
+#define O_ASYNC      020000
+#define O_CLOEXEC  02000000
+
+#ifdef __USE_BSD
+# define O_NDELAY      O_NONBLOCK
+#endif
+
+/* Values for the second argument to `fcntl'.  */
+#define        F_DUPFD         0       /* Duplicate file descriptor.  */
+#define        F_GETFD         1       /* Get file descriptor flags.  */
+#define        F_SETFD         2       /* Set file descriptor flags.  */
+#define        F_GETFL         3       /* Get file status flags.  */
+#define        F_SETFL         4       /* Set file status flags.  */
+#if defined __USE_BSD || defined __USE_UNIX98
+# define F_GETOWN      5       /* Get owner (receiver of SIGIO).  */
+# define F_SETOWN      6       /* Set owner (receiver of SIGIO).  */
+#endif
+#define        F_GETLK         7       /* Get record locking info.  */
+#define        F_SETLK         8       /* Set record locking info.  */
+#define        F_SETLKW        9       /* Set record locking info, wait.  */
+
+/* File descriptor flags used with F_GETFD and F_SETFD.  */
+#define        FD_CLOEXEC      1       /* Close on exec.  */
+
+
+#include <sys/types.h>
+
+/* The structure describing an advisory lock.  This is the type of the third
+   argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests.  */
+struct flock
+  {
+    short int l_type;  /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
+    short int l_whence;        /* Where `l_start' is relative to (like `lseek').  */
+    __off_t l_start;   /* Offset where the lock begins.  */
+    __off_t l_len;     /* Size of the locked area; zero means until EOF.  */
+    __pid_t l_pid;     /* Process holding the lock.  */
+  };
+
+/* Values for the `l_type' field of a `struct flock'.  */
+#define        F_RDLCK 1       /* Read lock.  */
+#define        F_WRLCK 2       /* Write lock.  */
+#define        F_UNLCK 3       /* Remove lock.  */
+
+/* Advise to `posix_fadvise'.  */
+#ifdef __USE_XOPEN2K
+# define POSIX_FADV_NORMAL     0 /* No further special treatment.  */
+# define POSIX_FADV_RANDOM     1 /* Expect random page references.  */
+# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references.  */
+# define POSIX_FADV_WILLNEED   3 /* Will need these pages.  */
+# define POSIX_FADV_DONTNEED   4 /* Don't need these pages.  */
+# define POSIX_FADV_NOREUSE    5 /* Data will be accessed once.  */
+#endif
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/ioctls.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/ioctls.h
new file mode 100644 (file)
index 0000000..9beaeb9
--- /dev/null
@@ -0,0 +1,112 @@
+/* Copyright (C) 1996, 1997, 1998, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* AKAROS note: we're including this file from the linux port.  We changed the
+ * asm include to ros/glibc-asm. */
+
+/* Use the definitions from the kernel header files.  */
+#include <ros/glibc-asm/ioctls.h>
+
+/* Routing table calls.  */
+#define SIOCADDRT      0x890B          /* add routing table entry      */
+#define SIOCDELRT      0x890C          /* delete routing table entry   */
+#define SIOCRTMSG      0x890D          /* call to routing system       */
+
+/* Socket configuration controls. */
+#define SIOCGIFNAME    0x8910          /* get iface name               */
+#define SIOCSIFLINK    0x8911          /* set iface channel            */
+#define SIOCGIFCONF    0x8912          /* get iface list               */
+#define SIOCGIFFLAGS   0x8913          /* get flags                    */
+#define SIOCSIFFLAGS   0x8914          /* set flags                    */
+#define SIOCGIFADDR    0x8915          /* get PA address               */
+#define SIOCSIFADDR    0x8916          /* set PA address               */
+#define SIOCGIFDSTADDR 0x8917          /* get remote PA address        */
+#define SIOCSIFDSTADDR 0x8918          /* set remote PA address        */
+#define SIOCGIFBRDADDR 0x8919          /* get broadcast PA address     */
+#define SIOCSIFBRDADDR 0x891a          /* set broadcast PA address     */
+#define SIOCGIFNETMASK 0x891b          /* get network PA mask          */
+#define SIOCSIFNETMASK 0x891c          /* set network PA mask          */
+#define SIOCGIFMETRIC  0x891d          /* get metric                   */
+#define SIOCSIFMETRIC  0x891e          /* set metric                   */
+#define SIOCGIFMEM     0x891f          /* get memory address (BSD)     */
+#define SIOCSIFMEM     0x8920          /* set memory address (BSD)     */
+#define SIOCGIFMTU     0x8921          /* get MTU size                 */
+#define SIOCSIFMTU     0x8922          /* set MTU size                 */
+#define SIOCSIFNAME    0x8923          /* set interface name           */
+#define        SIOCSIFHWADDR   0x8924          /* set hardware address         */
+#define SIOCGIFENCAP   0x8925          /* get/set encapsulations       */
+#define SIOCSIFENCAP   0x8926
+#define SIOCGIFHWADDR  0x8927          /* Get hardware address         */
+#define SIOCGIFSLAVE   0x8929          /* Driver slaving support       */
+#define SIOCSIFSLAVE   0x8930
+#define SIOCADDMULTI   0x8931          /* Multicast address lists      */
+#define SIOCDELMULTI   0x8932
+#define SIOCGIFINDEX   0x8933          /* name -> if_index mapping     */
+#define SIOGIFINDEX    SIOCGIFINDEX    /* misprint compatibility :-)   */
+#define SIOCSIFPFLAGS  0x8934          /* set/get extended flags set   */
+#define SIOCGIFPFLAGS  0x8935
+#define SIOCDIFADDR    0x8936          /* delete PA address            */
+#define        SIOCSIFHWBROADCAST      0x8937  /* set hardware broadcast addr  */
+#define SIOCGIFCOUNT   0x8938          /* get number of devices */
+
+#define SIOCGIFBR      0x8940          /* Bridging support             */
+#define SIOCSIFBR      0x8941          /* Set bridging options         */
+
+#define SIOCGIFTXQLEN  0x8942          /* Get the tx queue length      */
+#define SIOCSIFTXQLEN  0x8943          /* Set the tx queue length      */
+
+
+/* ARP cache control calls. */
+                   /*  0x8950 - 0x8952  * obsolete calls, don't re-use */
+#define SIOCDARP       0x8953          /* delete ARP table entry       */
+#define SIOCGARP       0x8954          /* get ARP table entry          */
+#define SIOCSARP       0x8955          /* set ARP table entry          */
+
+/* RARP cache control calls. */
+#define SIOCDRARP      0x8960          /* delete RARP table entry      */
+#define SIOCGRARP      0x8961          /* get RARP table entry         */
+#define SIOCSRARP      0x8962          /* set RARP table entry         */
+
+/* Driver configuration calls */
+
+#define SIOCGIFMAP     0x8970          /* Get device parameters        */
+#define SIOCSIFMAP     0x8971          /* Set device parameters        */
+
+/* DLCI configuration calls */
+
+#define SIOCADDDLCI    0x8980          /* Create new DLCI device       */
+#define SIOCDELDLCI    0x8981          /* Delete DLCI device           */
+
+/* Device private ioctl calls.  */
+
+/* These 16 ioctls are available to devices via the do_ioctl() device
+   vector.  Each device should include this file and redefine these
+   names as their own. Because these are device dependent it is a good
+   idea _NOT_ to issue them to random objects and hope.  */
+
+#define SIOCDEVPRIVATE                 0x89F0  /* to 89FF */
+
+/*
+ *     These 16 ioctl calls are protocol private
+ */
+
+#define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/libc-lock.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/libc-lock.h
new file mode 100644 (file)
index 0000000..39943b9
--- /dev/null
@@ -0,0 +1,346 @@
+/* libc-internal interface for mutex locks.  NPTL version.
+   Copyright (C) 1996-2003, 2005, 2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _BITS_LIBC_LOCK_H
+#define _BITS_LIBC_LOCK_H 1
+
+#define __need_NULL
+#include <stddef.h>
+
+#ifdef _LIBC
+# include <lowlevellock.h>
+# include <tls.h>
+#endif
+
+/* Lock types.  */
+typedef int __libc_lock_t; 
+#define _LIBC_LOCK_INITIALIZER LLL_LOCK_INITIALIZER
+
+typedef struct __libc_lock_recursive { 
+       __libc_lock_t lock; 
+       int count; 
+       void* owner; 
+} __libc_lock_recursive_t;
+#define _LIBC_LOCK_RECURSIVE_INITIALIZER {_LIBC_LOCK_INITIALIZER,0,0}
+
+/* Define a lock variable NAME with storage class CLASS.  The lock must be
+   initialized with __libc_lock_init before it can be used (or define it
+   with __libc_lock_define_initialized, below).  Use `extern' for CLASS to
+   declare a lock defined in another module.  In public structure
+   definitions you must use a pointer to the lock structure (i.e., NAME
+   begins with a `*'), because its storage size will not be known outside
+   of libc.  */
+#define __libc_lock_define(CLASS,NAME)\
+       CLASS __libc_lock_t NAME;
+#define __libc_lock_define_recursive(CLASS,NAME)\
+       CLASS __libc_lock_recursive_t NAME;
+
+/* Define an initialized lock variable NAME with storage class CLASS.
+   For the C library we take a deeper look at the initializer.  For
+   this implementation all fields are initialized to zero.  Therefore
+   we don't initialize the variable which allows putting it into the
+   BSS section.  (Except on PA-RISC and other odd architectures, where
+   initialized locks must be set to one due to the lack of normal
+   atomic operations.) */
+
+#if LLL_LOCK_INITIALIZER == 0
+#define __libc_lock_define_initialized(CLASS,NAME)\
+       CLASS __libc_lock_t NAME;
+#else
+#define __libc_lock_define_initialized(CLASS,NAME)\
+       CLASS __libc_lock_t NAME = _LIBC_LOCK_INITIALIZER;
+#endif
+
+/* Define an initialized recursive lock variable NAME with storage
+   class CLASS.  */
+#if LLL_LOCK_INITIALIZER == 0
+#define __libc_lock_define_initialized_recursive(CLASS,NAME)\
+       CLASS __libc_lock_recursive_t NAME;
+#else
+#define __libc_lock_define_initialized_recursive(CLASS,NAME)\
+       CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
+#endif
+
+/* Initialize the named lock variable, leaving it in a consistent, unlocked
+   state.  */
+#define __libc_lock_init(NAME) ((NAME) = _LIBC_LOCK_INITIALIZER, 0)
+
+/* Same as last but this time we initialize a recursive mutex.  */
+#if defined _LIBC && (!defined NOT_IN_libc)
+#define __libc_lock_init_recursive(NAME)\
+       ((NAME) = (__libc_lock_recursive_t) _LIBC_LOCK_RECURSIVE_INITIALIZER, 0)
+#else
+#define __libc_lock_init_recursive(NAME)\
+do {\
+       NAME.lock = 0;\
+       NAME.count = 0;\
+       NAME.owner = 0;\
+} while (0)
+#endif
+
+/* Finalize the named lock variable, which must be locked.  It cannot be
+   used again until __libc_lock_init is called again on it.  This must be
+   called on a lock variable before the containing storage is reused.  */
+#define __libc_lock_fini(NAME) ((void) 0)
+
+/* Finalize recursive named lock.  */
+#define __libc_lock_fini_recursive(NAME) ((void) 0)
+
+/* Lock the named lock variable.  */
+# define __libc_lock_lock(NAME)\
+       ({ lll_lock (NAME, LLL_PRIVATE); 0; })
+
+/* Lock the recursive named lock variable.  */
+#ifndef IS_IN_rtld
+
+# define __libc_lock_lock_recursive(NAME)\
+do {\
+       void *self = THREAD_SELF;\
+       if((NAME).owner != self) {\
+               lll_lock ((NAME).lock, LLL_PRIVATE);\
+               (NAME).owner = self;\
+       }\
+       ++(NAME).count;\
+} while (0)
+
+/* Unlock the recursive named lock variable.  */
+/* We do no error checking here.  */
+# define __libc_lock_unlock_recursive(NAME)\
+       do {\
+               if(--(NAME).count == 0) {\
+                       (NAME).owner = NULL;\
+                       lll_unlock((NAME).lock, LLL_PRIVATE);\
+               }\
+       } while (0)
+
+#else /* Ignore recursive locks within rtld */
+
+# define __libc_lock_lock_recursive(NAME) do { } while(0)
+# define __libc_lock_unlock_recursive(NAME) do { } while(0)
+
+#endif
+
+/* Try to lock the named lock variable.  */
+#define __libc_lock_trylock(NAME)\
+       lll_trylock(NAME)
+
+/* Try to lock the recursive named lock variable.  */
+#define __libc_lock_trylock_recursive(NAME)\
+({\
+       int result = 0;\
+       void *self = THREAD_SELF;\
+       if((NAME).owner != self) {\
+               if(lll_trylock((NAME).lock) == 0) {\
+                       (NAME).owner = self;\
+                       (NAME).count = 1;\
+               }\
+               else\
+                       result = EBUSY;\
+    }\
+       else\
+               ++(NAME).count;\
+       result;\
+})
+
+/* Unlock the named lock variable.  */
+#define __libc_lock_unlock(NAME)\
+       lll_unlock (NAME, LLL_PRIVATE)
+
+#define __libc_lock_default_lock_recursive(lock)\
+       ++((__libc_lock_recursive_t *)(lock))->count;
+#define __libc_lock_default_unlock_recursive(lock)\
+       --((__libc_lock_recursive_t *)(lock))->count;
+
+/* libc's rwlocks are the same as regular locks for now... */
+typedef __libc_lock_t __libc_rwlock_t; 
+#define _LIBC_RWLOCK_INITIALIZER _LIBC_LOCK_INITIALIZER
+typedef __libc_lock_recursive_t __libc_rwlock_recursive_t; 
+#define _LIBC_RWLOCK_RECURSIVE_INITIALIZER _LIBC_LOCK_RECURSIVE_INITIALIZER
+#define __libc_rwlock_define(CLASS,NAME)\
+       __libc_lock_define(CLASS,NAME)
+#define __libc_rwlock_define_recursive(CLASS,NAME)\
+       __libc_lock_define_recursive(CLASS,NAME)
+#define __libc_rwlock_define_initialized(CLASS,NAME)\
+       __libc_lock_define_initialized(CLASS,NAME)
+#define __libc_rwlock_define_initialized_recursive(CLASS,NAME)\
+       __libc_lock_define_initialized_recursive(CLASS,NAME)
+#define __libc_rwlock_init(NAME)\
+       __libc_lock_init(NAME)
+#define __libc_rwlock_init_recursive(NAME)\
+       __libc_lock_init_recursive(NAME)
+#define __libc_rwlock_fini(NAME)\
+       __libc_lock_fini(NAME)
+#define __libc_rwlock_fini_recursive(NAME)\
+       __libc_lock_fini_recursive(NAME)
+#define __libc_rwlock_rdlock(NAME)\
+       __libc_lock_lock(NAME)
+#define __libc_rwlock_wrlock(NAME)\
+       __libc_lock_lock(NAME)
+#define __libc_rwlock_rdlock_recursive(NAME)\
+       __libc_lock_lock_recursive(NAME)
+#define __libc_rwlock_wrlock_recursive(NAME)\
+       __libc_lock_lock_recursive(NAME)
+#define __libc_rwlock_tryrlock(NAME)\
+       __libc_lock_trylock(NAME)
+#define __libc_rwlock_trywlock(NAME)\
+       __libc_lock_trylock(NAME)
+#define __libc_rwlock_tryrlock_recursive(NAME)\
+       __libc_lock_trylock_recursive(NAME)
+#define __libc_rwlock_trywlock_recursive(NAME)\
+       __libc_lock_trylock_recursive(NAME)
+#define __libc_rwlock_unlock(NAME)\
+       __libc_lock_unlock(NAME) 
+#define __libc_rwlock_unlock_recursive(NAME)\
+       __libc_lock_unlock_recursive(NAME) 
+#define __libc_rwlock_default_rdlock_recursive(lock)\
+       __libc_lock_default_lock_recursive(lock)
+#define __libc_rwlock_default_wrlock_recursive(lock)\
+       __libc_lock_default_lock_recursive(lock)
+#define __libc_rwlock_default_unlock_recursive(lock)\
+       __libc_lock_default_unlock_recursive(lock)
+
+/* rtld locks are the same as libc locks */
+typedef __libc_lock_t __rtld_lock_t;
+#define _RTLD_LOCK_INITIALIZER _LIBC_LOCK_INITIALIZER
+typedef __libc_lock_recursive_t __rtld_lock_recursive_t;
+#define _RTLD_LOCK_RECURSIVE_INITIALIZER _LIBC_LOCK_RECURSIVE_INITIALIZER
+#define __rtld_lock_define(CLASS,NAME)\
+       __libc_lock_define_recursive(CLASS,NAME)
+#define __rtld_lock_define_recursive(CLASS,NAME)\
+       __libc_lock_define_recursive(CLASS,NAME)
+#define __rtld_lock_define_initialized(CLASS,NAME)\
+       __libc_lock_define_initialized_recursive(CLASS,NAME)
+#define __rtld_lock_define_initialized_recursive(CLASS,NAME)\
+       __libc_lock_define_initialized_recursive(CLASS,NAME)
+#define __rtld_lock_initialize(NAME)\
+       __libc_lock_init_recursive(NAME)
+#define __rtld_lock_init_recursive(NAME)\
+       __libc_lock_init_recursive(NAME)
+# define __rtld_lock_fini(NAME)\
+       __libc_lock_fini_recursive(NAME)
+# define __rtld_lock_fini_recursive(NAME)\
+       __libc_lock_fini_recursive(NAME)
+#define __rtld_lock_lock(NAME)\
+       __libc_lock_lock_recursive(NAME)
+#define __rtld_lock_lock_recursive(NAME)\
+       __libc_lock_lock_recursive(NAME)
+#define __rtld_lock_trylock(NAME)\
+       __libc_lock_trylock_recursive(NAME)
+#define __rtld_lock_trylock_recursive(NAME)\
+       __libc_lock_trylock_recursive(NAME)
+#define __rtld_lock_unlock(NAME)\
+       __libc_lock_unlock_recursive(NAME) 
+#define __rtld_lock_unlock_recursive(NAME)\
+       __libc_lock_unlock_recursive(NAME) 
+#define __rtld_lock_default_lock_recursive(lock)\
+       __libc_lock_default_lock_recursive(lock)
+#define __rtld_lock_default_unlock_recursive(lock)\
+       __libc_lock_default_unlock_recursive(lock)
+#define __rtld_rwlock_define(CLASS,NAME)\
+       __libc_rwlock_define_recursive(CLASS,NAME)
+#define __rtld_rwlock_define_recursive(CLASS,NAME)\
+       __libc_rwlock_define_recursive(CLASS,NAME)
+#define __rtld_rwlock_define_initialized(CLASS,NAME)\
+       __libc_rwlock_define_initialized_recursive(CLASS,NAME)
+#define __rtld_rwlock_define_initialized_recursive(CLASS,NAME)\
+       __libc_rwlock_define_initialized_recursive(CLASS,NAME)
+#define __rtld_rwlock_init(NAME)\
+       __libc_rwlock_init_recursive(NAME)
+#define __rtld_rwlock_init_recursive(NAME)\
+       __libc_rwlock_init_recursive(NAME)
+#define __rtld_rwlock_fini(NAME)\
+       __libc_rwlock_fini_recursive(NAME)
+#define __rtld_rwlock_fini_recursive(NAME)\
+       __libc_rwlock_fini_recursive(NAME)
+#define __rtld_rwlock_rdlock(NAME)\
+       __libc_rwlock_lock_recursive(NAME)
+#define __rtld_rwlock_wrlock(NAME)\
+       __libc_rwlock_lock_recursive(NAME)
+#define __rtld_rwlock_rdlock_recursive(NAME)\
+       __libc_rwlock_lock_recursive(NAME)
+#define __rtld_rwlock_wrlock_recursive(NAME)\
+       __libc_rwlock_lock_recursive(NAME)
+#define __rtld_rwlock_tryrlock(NAME)\
+       __libc_rwlock_trylock_recursive(NAME)
+#define __rtld_rwlock_trywlock(NAME)\
+       __libc_rwlock_trylock_recursive(NAME)
+#define __rtld_rwlock_tryrlock_recursive(NAME)\
+       __libc_rwlock_trylock_recursive(NAME)
+#define __rtld_rwlock_trywlock_recursive(NAME)\
+       __libc_rwlock_trylock_recursive(NAME)
+#define __rtld_rwlock_unlock(NAME)\
+       __libc_rwlock_unlock_recursive(NAME) 
+#define __rtld_rwlock_unlock_recursive(NAME)\
+       __libc_rwlock_unlock_recursive(NAME) 
+#define __rtld_rwlock_default_rdlock_recursive(lock)\
+       __libc_rwlock_default_lock_recursive(lock)
+#define __rtld_rwlock_default_wrlock_recursive(lock)\
+       __libc_rwlock_default_lock_recursive(lock)
+#define __rtld_rwlock_default_unlock_recursive(lock)\
+       __libc_rwlock_default_unlock_recursive(lock)
+
+/* Define once control variable.  */
+#define __libc_once_define(CLASS, NAME) CLASS int NAME = 0
+
+/* Call handler iff the first call.  */
+#define __libc_once(ONCE_CONTROL, INIT_FUNCTION)\
+do {\
+       if((ONCE_CONTROL) == 0) {\
+               INIT_FUNCTION ();\
+               (ONCE_CONTROL) = 1;\
+       }\
+} while (0)
+
+/* Start a critical region with a cleanup function */
+#define __libc_cleanup_region_start(DOIT, FCT, ARG)\
+{\
+  typeof (***(FCT)) *__save_FCT = (DOIT) ? (FCT) : 0;\
+  typeof (ARG) __save_ARG = ARG;\
+  /* close brace is in __libc_cleanup_region_end below. */
+
+/* End a critical region started with __libc_cleanup_region_start. */
+#define __libc_cleanup_region_end(DOIT)\
+if((DOIT) && __save_FCT != 0)\
+    (*__save_FCT)(__save_ARG);\
+}
+
+/* Sometimes we have to exit the block in the middle.  */
+#define __libc_cleanup_end(DOIT)\
+if ((DOIT) && __save_FCT != 0)\
+       (*__save_FCT)(__save_ARG);\
+
+#define __libc_cleanup_push(fct, arg) __libc_cleanup_region_start (1, fct, arg)
+#define __libc_cleanup_pop(execute) __libc_cleanup_region_end (execute)
+
+/* We need portable names for some of the functions.  */
+#define __libc_mutex_unlock
+
+/* Type for key of thread specific data.  */
+typedef int __libc_key_t;
+
+/* Create key for thread specific data.  */
+#define __libc_key_create(KEY,DEST) -1
+
+/* Set thread-specific data associated with KEY to VAL.  */
+#define __libc_setspecific(KEY,VAL) ((void)0)
+
+/* Get thread-specific data associated with KEY.  */
+#define __libc_getspecific(KEY) 0
+
+#endif /* bits/libc-lock.h */
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/local_lim.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/local_lim.h
new file mode 100644 (file)
index 0000000..5896dc9
--- /dev/null
@@ -0,0 +1 @@
+#define OPEN_MAX 256
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/mman.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/mman.h
new file mode 100644 (file)
index 0000000..22aa401
--- /dev/null
@@ -0,0 +1,107 @@
+/* Definitions for POSIX memory map interface.  Linux/i386 version.
+   Copyright (C) 1997,2000,2003,2005,2006,2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* The following definitions basically come from the kernel headers.
+   But the kernel header is not namespace clean.  */
+
+
+/* Protections are chosen from these bits, OR'd together.  The
+   implementation does not necessarily support PROT_EXEC or PROT_WRITE
+   without PROT_READ.  The only guarantees are that no writing will be
+   allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ      0x1             /* Page can be read.  */
+#define PROT_WRITE     0x2             /* Page can be written.  */
+#define PROT_EXEC      0x4             /* Page can be executed.  */
+#define PROT_NONE      0x0             /* Page can not be accessed.  */
+#define PROT_GROWSDOWN 0x01000000      /* Extend change to start of
+                                          growsdown vma (mprotect only).  */
+#define PROT_GROWSUP   0x02000000      /* Extend change to start of
+                                          growsup vma (mprotect only).  */
+
+/* Sharing types (must choose one and only one of these).  */
+#define MAP_SHARED     0x01            /* Share changes.  */
+#define MAP_PRIVATE    0x02            /* Changes are private.  */
+#ifdef __USE_MISC
+# define MAP_TYPE      0x0f            /* Mask for type of mapping.  */
+#endif
+
+/* Other flags.  */
+#define MAP_FIXED      0x10            /* Interpret addr exactly.  */
+#ifdef __USE_MISC
+# define MAP_FILE      0
+# define MAP_ANONYMOUS 0x20            /* Don't use a file.  */
+# define MAP_ANON      MAP_ANONYMOUS
+#endif
+
+/* These are Linux-specific.  */
+#ifdef __USE_MISC
+# define MAP_GROWSDOWN 0x00100         /* Stack-like segment.  */
+# define MAP_DENYWRITE 0x00800         /* ETXTBSY */
+# define MAP_EXECUTABLE        0x01000         /* Mark it as an executable.  */
+# define MAP_LOCKED    0x02000         /* Lock the mapping.  */
+# define MAP_NORESERVE 0x04000         /* Don't check for reservations.  */
+# define MAP_POPULATE  0x08000         /* Populate (prefault) pagetables.  */
+# define MAP_NONBLOCK  0x10000         /* Do not block on IO.  */
+# define MAP_STACK     0x20000         /* Allocation is for a stack.  */
+#endif
+
+/* Flags to `msync'.  */
+#define MS_ASYNC       1               /* Sync memory asynchronously.  */
+#define MS_SYNC                4               /* Synchronous memory sync.  */
+#define MS_INVALIDATE  2               /* Invalidate the caches.  */
+
+/* Flags for `mlockall'.  */
+#define MCL_CURRENT    1               /* Lock all currently mapped pages.  */
+#define MCL_FUTURE     2               /* Lock all additions to address
+                                          space.  */
+
+/* Flags for `mremap'.  */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE        1
+# define MREMAP_FIXED  2
+#endif
+
+/* Advice to `madvise'.  */
+#ifdef __USE_BSD
+# 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     /* Don't need these pages.  */
+# define MADV_REMOVE     9     /* Remove these pages and resources.  */
+# define MADV_DONTFORK   10    /* Do not inherit across fork.  */
+# define MADV_DOFORK     11    /* Do inherit across fork.  */
+# define MADV_MERGEABLE          12    /* KSM may merge identical pages.  */
+# define MADV_UNMERGEABLE 13   /* KSM may not merge identical pages.  */
+# define MADV_HWPOISON   100   /* Poison a page for testing.  */
+#endif
+
+/* The POSIX people had to invent similar names for the same things.  */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL     0 /* No further special treatment.  */
+# define POSIX_MADV_RANDOM     1 /* Expect random page references.  */
+# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references.  */
+# define POSIX_MADV_WILLNEED   3 /* Will need these pages.  */
+# define POSIX_MADV_DONTNEED   4 /* Don't need these pages.  */
+#endif
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/semaphore.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/semaphore.h
new file mode 100644 (file)
index 0000000..57541a6
--- /dev/null
@@ -0,0 +1 @@
+// This file is empty for the time being...
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/sigaction.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/sigaction.h
new file mode 100644 (file)
index 0000000..f3d3571
--- /dev/null
@@ -0,0 +1,81 @@
+/* The proper definitions for Linux's sigaction.
+   Copyright (C) 1993-1999, 2000, 2010 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
+/* AKAROS: Copy of sysdeps/unix/sysv/linux/bits/sigaction.h */
+
+/* Structure describing the action to be taken when a signal arrives.  */
+struct sigaction
+  {
+    /* Signal handler.  */
+#ifdef __USE_POSIX199309
+    union
+      {
+       /* Used if SA_SIGINFO is not set.  */
+       __sighandler_t sa_handler;
+       /* Used if SA_SIGINFO is set.  */
+       void (*sa_sigaction) (int, siginfo_t *, void *);
+      }
+    __sigaction_handler;
+# define sa_handler    __sigaction_handler.sa_handler
+# define sa_sigaction  __sigaction_handler.sa_sigaction
+#else
+    __sighandler_t sa_handler;
+#endif
+
+    /* Additional set of signals to be blocked.  */
+    __sigset_t sa_mask;
+
+    /* Special flags.  */
+    int sa_flags;
+
+    /* Restore handler.  */
+    void (*sa_restorer) (void);
+  };
+
+/* Bits in `sa_flags'.  */
+#define        SA_NOCLDSTOP  1          /* Don't send SIGCHLD when children stop.  */
+#define SA_NOCLDWAIT  2                 /* Don't create zombie on child death.  */
+#define SA_SIGINFO    4                 /* Invoke signal-catching function with
+                                   three arguments instead of one.  */
+#if defined __USE_UNIX98 || defined __USE_MISC
+# define SA_ONSTACK   0x08000000 /* Use signal stack by using `sa_restorer'. */
+#endif
+#if defined __USE_UNIX98 || defined __USE_MISC || defined __USE_XOPEN2K8
+# define SA_RESTART   0x10000000 /* Restart syscall on signal return.  */
+# define SA_NODEFER   0x40000000 /* Don't automatically block the signal when
+                                   its handler is being executed.  */
+# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler.  */
+#endif
+#ifdef __USE_MISC
+# define SA_INTERRUPT 0x20000000 /* Historical no-op.  */
+
+/* Some aliases for the SA_ constants.  */
+# define SA_NOMASK    SA_NODEFER
+# define SA_ONESHOT   SA_RESETHAND
+# define SA_STACK     SA_ONSTACK
+#endif
+
+/* Values for the HOW argument to `sigprocmask'.  */
+#define        SIG_BLOCK     0          /* Block signals.  */
+#define        SIG_UNBLOCK   1          /* Unblock signals.  */
+#define        SIG_SETMASK   2          /* Set the set of blocked signals.  */
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/sigcontext.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/sigcontext.h
new file mode 100644 (file)
index 0000000..ffc6932
--- /dev/null
@@ -0,0 +1,34 @@
+/* Structure describing state saved while handling a signal.  Stub version.
+   Copyright (C) 1991, 1994, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SIGNAL_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+/* State of this thread when the signal was taken.  */
+struct sigcontext
+  {
+    int sc_onstack;
+    __sigset_t sc_mask;
+
+    /* Registers and such.  */
+       int sc_pc;
+  };
+
+/* Signal subcodes should be defined here.  */
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/signum.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/signum.h
new file mode 100644 (file)
index 0000000..a18ac11
--- /dev/null
@@ -0,0 +1,80 @@
+/* Signal number definitions.  Linux version.
+   Copyright (C) 1995,1996,1997,1998,1999,2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifdef _SIGNAL_H
+
+/* Fake signal functions.  */
+#define SIG_ERR        ((__sighandler_t) -1)           /* Error return.  */
+#define SIG_DFL        ((__sighandler_t) 0)            /* Default action.  */
+#define SIG_IGN        ((__sighandler_t) 1)            /* Ignore signal.  */
+
+#ifdef __USE_UNIX98
+# define SIG_HOLD      ((__sighandler_t) 2)    /* Add signal to hold mask.  */
+#endif
+
+
+/* Signals.  */
+#define        SIGHUP          1       /* Hangup (POSIX).  */
+#define        SIGINT          2       /* Interrupt (ANSI).  */
+#define        SIGQUIT         3       /* Quit (POSIX).  */
+#define        SIGILL          4       /* Illegal instruction (ANSI).  */
+#define        SIGTRAP         5       /* Trace trap (POSIX).  */
+#define        SIGABRT         6       /* Abort (ANSI).  */
+#define        SIGIOT          6       /* IOT trap (4.2 BSD).  */
+#define        SIGBUS          7       /* BUS error (4.2 BSD).  */
+#define        SIGFPE          8       /* Floating-point exception (ANSI).  */
+#define        SIGKILL         9       /* Kill, unblockable (POSIX).  */
+#define        SIGUSR1         10      /* User-defined signal 1 (POSIX).  */
+#define        SIGSEGV         11      /* Segmentation violation (ANSI).  */
+#define        SIGUSR2         12      /* User-defined signal 2 (POSIX).  */
+#define        SIGPIPE         13      /* Broken pipe (POSIX).  */
+#define        SIGALRM         14      /* Alarm clock (POSIX).  */
+#define        SIGTERM         15      /* Termination (ANSI).  */
+#define        SIGSTKFLT       16      /* Stack fault.  */
+#define        SIGCLD          SIGCHLD /* Same as SIGCHLD (System V).  */
+#define        SIGCHLD         17      /* Child status has changed (POSIX).  */
+#define        SIGCONT         18      /* Continue (POSIX).  */
+#define        SIGSTOP         19      /* Stop, unblockable (POSIX).  */
+#define        SIGTSTP         20      /* Keyboard stop (POSIX).  */
+#define        SIGTTIN         21      /* Background read from tty (POSIX).  */
+#define        SIGTTOU         22      /* Background write to tty (POSIX).  */
+#define        SIGURG          23      /* Urgent condition on socket (4.2 BSD).  */
+#define        SIGXCPU         24      /* CPU limit exceeded (4.2 BSD).  */
+#define        SIGXFSZ         25      /* File size limit exceeded (4.2 BSD).  */
+#define        SIGVTALRM       26      /* Virtual alarm clock (4.2 BSD).  */
+#define        SIGPROF         27      /* Profiling alarm clock (4.2 BSD).  */
+#define        SIGWINCH        28      /* Window size change (4.3 BSD, Sun).  */
+#define        SIGPOLL         SIGIO   /* Pollable event occurred (System V).  */
+#define        SIGIO           29      /* I/O now possible (4.2 BSD).  */
+#define        SIGPWR          30      /* Power failure restart (System V).  */
+#define SIGSYS         31      /* Bad system call.  */
+#define SIGUNUSED      31
+
+#define        _NSIG           65      /* Biggest signal number + 1
+                                  (including real-time signals).  */
+
+#define SIGRTMIN        (__libc_current_sigrtmin ())
+#define SIGRTMAX        (__libc_current_sigrtmax ())
+
+/* These are the hard limits of the kernel.  These values should not be
+   used directly at user level.  */
+#define __SIGRTMIN     32
+#define __SIGRTMAX     (_NSIG - 1)
+
+#endif /* <signal.h> included.  */
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/socket.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/socket.h
new file mode 100644 (file)
index 0000000..d91cd53
--- /dev/null
@@ -0,0 +1,409 @@
+/* System-specific socket constants and types.  Linux version.
+   Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008, 2009
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef __BITS_SOCKET_H
+#define __BITS_SOCKET_H
+
+#ifndef _SYS_SOCKET_H
+# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
+#endif
+
+/* AKAROS note: we're including this file from the linux port.  We changed the
+ * asm include to ros/glibc-asm. */
+
+#define        __need_size_t
+#include <stddef.h>
+
+#include <sys/types.h>
+
+/* Type for length arguments in socket calls.  */
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
+
+/* Types of sockets.  */
+enum __socket_type
+{
+  SOCK_STREAM = 1,             /* Sequenced, reliable, connection-based
+                                  byte streams.  */
+#define SOCK_STREAM SOCK_STREAM
+  SOCK_DGRAM = 2,              /* Connectionless, unreliable datagrams
+                                  of fixed maximum length.  */
+#define SOCK_DGRAM SOCK_DGRAM
+  SOCK_RAW = 3,                        /* Raw protocol interface.  */
+#define SOCK_RAW SOCK_RAW
+  SOCK_RDM = 4,                        /* Reliably-delivered messages.  */
+#define SOCK_RDM SOCK_RDM
+  SOCK_SEQPACKET = 5,          /* Sequenced, reliable, connection-based,
+                                  datagrams of fixed maximum length.  */
+#define SOCK_SEQPACKET SOCK_SEQPACKET
+  SOCK_DCCP = 6,               /* Datagram Congestion Control Protocol.  */
+#define SOCK_DCCP SOCK_DCCP
+  SOCK_PACKET = 10,            /* Linux specific way of getting packets
+                                  at the dev level.  For writing rarp and
+                                  other similar things on the user level. */
+#define SOCK_PACKET SOCK_PACKET
+
+  /* Flags to be ORed into the type parameter of socket and socketpair and
+     used for the flags parameter of paccept.  */
+
+  SOCK_CLOEXEC = 02000000,     /* Atomically set close-on-exec flag for the
+                                  new descriptor(s).  */
+#define SOCK_CLOEXEC SOCK_CLOEXEC
+  SOCK_NONBLOCK = 04000                /* Atomically mark descriptor(s) as
+                                  non-blocking.  */
+#define SOCK_NONBLOCK SOCK_NONBLOCK
+};
+
+/* Protocol families.  */
+#define        PF_UNSPEC       0       /* Unspecified.  */
+#define        PF_LOCAL        1       /* Local to host (pipes and file-domain).  */
+#define        PF_UNIX         PF_LOCAL /* POSIX name for PF_LOCAL.  */
+#define        PF_FILE         PF_LOCAL /* Another non-standard name for PF_LOCAL.  */
+#define        PF_INET         2       /* IP protocol family.  */
+#define        PF_AX25         3       /* Amateur Radio AX.25.  */
+#define        PF_IPX          4       /* Novell Internet Protocol.  */
+#define        PF_APPLETALK    5       /* Appletalk DDP.  */
+#define        PF_NETROM       6       /* Amateur radio NetROM.  */
+#define        PF_BRIDGE       7       /* Multiprotocol bridge.  */
+#define        PF_ATMPVC       8       /* ATM PVCs.  */
+#define        PF_X25          9       /* Reserved for X.25 project.  */
+#define        PF_INET6        10      /* IP version 6.  */
+#define        PF_ROSE         11      /* Amateur Radio X.25 PLP.  */
+#define        PF_DECnet       12      /* Reserved for DECnet project.  */
+#define        PF_NETBEUI      13      /* Reserved for 802.2LLC project.  */
+#define        PF_SECURITY     14      /* Security callback pseudo AF.  */
+#define        PF_KEY          15      /* PF_KEY key management API.  */
+#define        PF_NETLINK      16
+#define        PF_ROUTE        PF_NETLINK /* Alias to emulate 4.4BSD.  */
+#define        PF_PACKET       17      /* Packet family.  */
+#define        PF_ASH          18      /* Ash.  */
+#define        PF_ECONET       19      /* Acorn Econet.  */
+#define        PF_ATMSVC       20      /* ATM SVCs.  */
+#define PF_RDS         21      /* RDS sockets.  */
+#define        PF_SNA          22      /* Linux SNA Project */
+#define        PF_IRDA         23      /* IRDA sockets.  */
+#define        PF_PPPOX        24      /* PPPoX sockets.  */
+#define        PF_WANPIPE      25      /* Wanpipe API sockets.  */
+#define PF_LLC         26      /* Linux LLC.  */
+#define PF_CAN         29      /* Controller Area Network.  */
+#define PF_TIPC                30      /* TIPC sockets.  */
+#define        PF_BLUETOOTH    31      /* Bluetooth sockets.  */
+#define        PF_IUCV         32      /* IUCV sockets.  */
+#define PF_RXRPC       33      /* RxRPC sockets.  */
+#define PF_ISDN                34      /* mISDN sockets.  */
+#define PF_PHONET      35      /* Phonet sockets.  */
+#define PF_IEEE802154  36      /* IEEE 802.15.4 sockets.  */
+#define        PF_MAX          37      /* For now..  */
+
+/* Address families.  */
+#define        AF_UNSPEC       PF_UNSPEC
+#define        AF_LOCAL        PF_LOCAL
+#define        AF_UNIX         PF_UNIX
+#define        AF_FILE         PF_FILE
+#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_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_MAX          PF_MAX
+
+/* Socket level values.  Others are defined in the appropriate headers.
+
+   XXX These definitions also should go into the appropriate headers as
+   far as they are available.  */
+#define SOL_RAW                255
+#define SOL_DECNET      261
+#define SOL_X25         262
+#define SOL_PACKET     263
+#define SOL_ATM                264     /* ATM layer (cell level).  */
+#define SOL_AAL                265     /* ATM Adaption Layer (packet level).  */
+#define SOL_IRDA       266
+
+/* Maximum queue length specifiable by listen.  */
+#define SOMAXCONN      128
+
+/* Get the definition of the macro to define the common sockaddr members.  */
+#include <bits/sockaddr.h>
+
+/* Structure describing a generic socket address.  */
+struct sockaddr
+  {
+    __SOCKADDR_COMMON (sa_);   /* Common data: address family and length.  */
+    char sa_data[14];          /* Address data.  */
+  };
+
+
+/* Structure large enough to hold any socket address (with the historical
+   exception of AF_UNIX).  We reserve 128 bytes.  */
+#define __ss_aligntype unsigned long int
+#define _SS_SIZE       128
+#define _SS_PADSIZE    (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
+
+struct sockaddr_storage
+  {
+    __SOCKADDR_COMMON (ss_);   /* Address family, etc.  */
+    __ss_aligntype __ss_align; /* Force desired alignment.  */
+    char __ss_padding[_SS_PADSIZE];
+  };
+
+
+/* Bits in the FLAGS argument to `send', `recv', et al.  */
+enum
+  {
+    MSG_OOB            = 0x01, /* Process out-of-band data.  */
+#define MSG_OOB                MSG_OOB
+    MSG_PEEK           = 0x02, /* Peek at incoming messages.  */
+#define MSG_PEEK       MSG_PEEK
+    MSG_DONTROUTE      = 0x04, /* Don't use local routing.  */
+#define MSG_DONTROUTE  MSG_DONTROUTE
+#ifdef __USE_GNU
+    /* DECnet uses a different name.  */
+    MSG_TRYHARD                = MSG_DONTROUTE,
+# define MSG_TRYHARD   MSG_DONTROUTE
+#endif
+    MSG_CTRUNC         = 0x08, /* Control data lost before delivery.  */
+#define MSG_CTRUNC     MSG_CTRUNC
+    MSG_PROXY          = 0x10, /* Supply or ask second address.  */
+#define MSG_PROXY      MSG_PROXY
+    MSG_TRUNC          = 0x20,
+#define        MSG_TRUNC       MSG_TRUNC
+    MSG_DONTWAIT       = 0x40, /* Nonblocking IO.  */
+#define        MSG_DONTWAIT    MSG_DONTWAIT
+    MSG_EOR            = 0x80, /* End of record.  */
+#define        MSG_EOR         MSG_EOR
+    MSG_WAITALL                = 0x100, /* Wait for a full request.  */
+#define        MSG_WAITALL     MSG_WAITALL
+    MSG_FIN            = 0x200,
+#define        MSG_FIN         MSG_FIN
+    MSG_SYN            = 0x400,
+#define        MSG_SYN         MSG_SYN
+    MSG_CONFIRM                = 0x800, /* Confirm path validity.  */
+#define        MSG_CONFIRM     MSG_CONFIRM
+    MSG_RST            = 0x1000,
+#define        MSG_RST         MSG_RST
+    MSG_ERRQUEUE       = 0x2000, /* Fetch message from error queue.  */
+#define        MSG_ERRQUEUE    MSG_ERRQUEUE
+    MSG_NOSIGNAL       = 0x4000, /* Do not generate SIGPIPE.  */
+#define        MSG_NOSIGNAL    MSG_NOSIGNAL
+    MSG_MORE           = 0x8000,  /* Sender will send more.  */
+#define        MSG_MORE        MSG_MORE
+
+    MSG_CMSG_CLOEXEC   = 0x40000000    /* Set close_on_exit for file
+                                           descriptor received through
+                                           SCM_RIGHTS.  */
+#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
+  };
+
+
+/* Structure describing messages sent by
+   `sendmsg' and received by `recvmsg'.  */
+struct msghdr
+  {
+    void *msg_name;            /* Address to send to/receive from.  */
+    socklen_t msg_namelen;     /* Length of address data.  */
+
+    struct iovec *msg_iov;     /* Vector of data to send/receive into.  */
+    size_t msg_iovlen;         /* Number of elements in the vector.  */
+
+    void *msg_control;         /* Ancillary data (eg BSD filedesc passing). */
+    size_t msg_controllen;     /* Ancillary data buffer length.
+                                  !! The type should be socklen_t but the
+                                  definition of the kernel is incompatible
+                                  with this.  */
+
+    int msg_flags;             /* Flags on received message.  */
+  };
+
+/* Structure used for storage of ancillary data object information.  */
+struct cmsghdr
+  {
+    size_t cmsg_len;           /* Length of data in cmsg_data plus length
+                                  of cmsghdr structure.
+                                  !! The type should be socklen_t but the
+                                  definition of the kernel is incompatible
+                                  with this.  */
+    int cmsg_level;            /* Originating protocol.  */
+    int cmsg_type;             /* Protocol specific type.  */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+    __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data.  */
+#endif
+  };
+
+/* Ancillary data object manipulation macros.  */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
+#else
+# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
+#endif
+#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, 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))
+
+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+                                     struct cmsghdr *__cmsg) __THROW;
+#ifdef __USE_EXTERN_INLINES
+# ifndef _EXTERN_INLINE
+#  define _EXTERN_INLINE __extern_inline
+# endif
+_EXTERN_INLINE struct cmsghdr *
+__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+{
+  if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+    /* The kernel header does this so there may be a reason.  */
+    return 0;
+
+  __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+                              + CMSG_ALIGN (__cmsg->cmsg_len));
+  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+                                       + __mhdr->msg_controllen)
+      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+         > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+    /* No more entries.  */
+    return 0;
+  return __cmsg;
+}
+#endif /* Use `extern inline'.  */
+
+/* Socket level message types.  This must match the definitions in
+   <linux/socket.h>.  */
+enum
+  {
+    SCM_RIGHTS = 0x01          /* Transfer file descriptors.  */
+#define SCM_RIGHTS SCM_RIGHTS
+#ifdef __USE_GNU
+    , SCM_CREDENTIALS = 0x02   /* Credentials passing.  */
+# define SCM_CREDENTIALS SCM_CREDENTIALS
+#endif
+  };
+
+#ifdef __USE_GNU
+/* User visible structure for SCM_CREDENTIALS message */
+struct ucred
+{
+  pid_t pid;                   /* PID of sending process.  */
+  uid_t uid;                   /* UID of sending process.  */
+  gid_t gid;                   /* GID of sending process.  */
+};
+#endif
+
+/* Ugly workaround for unclean kernel headers.  */
+#if !defined __USE_MISC && !defined __USE_GNU
+# ifndef FIOGETOWN
+#  define __SYS_SOCKET_H_undef_FIOGETOWN
+# endif
+# ifndef FIOSETOWN
+#  define __SYS_SOCKET_H_undef_FIOSETOWN
+# endif
+# ifndef SIOCATMARK
+#  define __SYS_SOCKET_H_undef_SIOCATMARK
+# endif
+# ifndef SIOCGPGRP
+#  define __SYS_SOCKET_H_undef_SIOCGPGRP
+# endif
+# ifndef SIOCGSTAMP
+#  define __SYS_SOCKET_H_undef_SIOCGSTAMP
+# endif
+# ifndef SIOCGSTAMPNS
+#  define __SYS_SOCKET_H_undef_SIOCGSTAMPNS
+# endif
+# ifndef SIOCSPGRP
+#  define __SYS_SOCKET_H_undef_SIOCSPGRP
+# endif
+#endif
+
+/* Get socket manipulation related informations from kernel headers.  */
+#include <ros/glibc-asm/socket.h>
+
+#if !defined __USE_MISC && !defined __USE_GNU
+# ifdef __SYS_SOCKET_H_undef_FIOGETOWN
+#  undef __SYS_SOCKET_H_undef_FIOGETOWN
+#  undef FIOGETOWN
+# endif
+# ifdef __SYS_SOCKET_H_undef_FIOSETOWN
+#  undef __SYS_SOCKET_H_undef_FIOSETOWN
+#  undef FIOSETOWN
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCATMARK
+#  undef __SYS_SOCKET_H_undef_SIOCATMARK
+#  undef SIOCATMARK
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCGPGRP
+#  undef __SYS_SOCKET_H_undef_SIOCGPGRP
+#  undef SIOCGPGRP
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMP
+#  undef __SYS_SOCKET_H_undef_SIOCGSTAMP
+#  undef SIOCGSTAMP
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMPNS
+#  undef __SYS_SOCKET_H_undef_SIOCGSTAMPNS
+#  undef SIOCGSTAMPNS
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCSPGRP
+#  undef __SYS_SOCKET_H_undef_SIOCSPGRP
+#  undef SIOCSPGRP
+# endif
+#endif
+
+/* Structure used to manipulate the SO_LINGER option.  */
+struct linger
+  {
+    int l_onoff;               /* Nonzero to linger on close.  */
+    int l_linger;              /* Time to linger.  */
+  };
+
+#endif /* bits/socket.h */
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/stat.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/stat.h
new file mode 100644 (file)
index 0000000..60fc2b7
--- /dev/null
@@ -0,0 +1,134 @@
+/* Copyright (C) 1992, 1995-2001, 2002, 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SYS_STAT_H && !defined _FCNTL_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H   1
+
+struct stat
+  {
+    __dev_t st_dev;                    /* Device.  */
+    __ino64_t st_ino;                  /* File serial number.  */
+    __mode_t st_mode;                  /* File mode.  */
+    __nlink_t st_nlink;                        /* Link count.  */
+    __uid_t st_uid;                    /* User ID of the file's owner. */
+    __gid_t st_gid;                    /* Group ID of the file's group.*/
+    __dev_t st_rdev;                   /* Device number, if device.  */
+    __off64_t st_size;                 /* Size of file, in bytes.  */
+    __blksize_t st_blksize;            /* Optimal block size for I/O.  */
+    __blkcnt64_t st_blocks;            /* Number 512-byte blocks allocated. */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;           /* Time of last access.  */
+    struct timespec st_mtim;           /* Time of last modification.  */
+    struct timespec st_ctim;           /* Time of last status change.  */
+# define st_atime st_atim.tv_sec       /* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;                 /* Time of last access.  */
+    unsigned long int st_atimensec;    /* Nscecs of last access.  */
+    __time_t st_mtime;                 /* Time of last modification.  */
+    unsigned long int st_mtimensec;    /* Nsecs of last modification.  */
+    __time_t st_ctime;                 /* Time of last status change.  */
+    unsigned long int st_ctimensec;    /* Nsecs of last status change.  */
+#endif
+  };
+
+#ifdef __USE_LARGEFILE64
+struct stat64
+  {
+    __dev_t st_dev;                    /* Device.  */
+    __ino64_t st_ino;                  /* File serial number.          */
+    __mode_t st_mode;                  /* File mode.  */
+    __nlink_t st_nlink;                        /* Link count.  */
+    __uid_t st_uid;                    /* User ID of the file's owner. */
+    __gid_t st_gid;                    /* Group ID of the file's group.*/
+    __dev_t st_rdev;                   /* Device number, if device.  */
+    __off64_t st_size;                 /* Size of file, in bytes.  */
+    __blksize_t st_blksize;            /* Optimal block size for I/O.  */
+    __blkcnt64_t st_blocks;            /* Number 512-byte blocks allocated. */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;           /* Time of last access.  */
+    struct timespec st_mtim;           /* Time of last modification.  */
+    struct timespec st_ctim;           /* Time of last status change.  */
+#else
+    __time_t st_atime;                 /* Time of last access.  */
+    unsigned long int st_atimensec;    /* Nscecs of last access.  */
+    __time_t st_mtime;                 /* Time of last modification.  */
+    unsigned long int st_mtimensec;    /* Nsecs of last modification.  */
+    __time_t st_ctime;                 /* Time of last status change.  */
+    unsigned long int st_ctimensec;    /* Nsecs of last status change.  */
+#endif
+  };
+#endif
+
+/* Tell code we have these members.  */
+#define        _STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+/* Nanosecond resolution time values are supported.  */
+#define _STATBUF_ST_NSEC
+
+/* Encoding of the file mode.  */
+
+#define        __S_IFMT        0170000 /* These bits determine file type.  */
+
+/* File types.  */
+#define        __S_IFDIR       0040000 /* Directory.  */
+#define        __S_IFCHR       0020000 /* Character device.  */
+#define        __S_IFBLK       0060000 /* Block device.  */
+#define        __S_IFREG       0100000 /* Regular file.  */
+#define        __S_IFIFO       0010000 /* FIFO.  */
+#define        __S_IFLNK       0120000 /* Symbolic link.  */
+#define        __S_IFSOCK      0140000 /* Socket.  */
+
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+/* Protection bits.  */
+
+#define        __S_ISUID       04000   /* Set user ID on execution.  */
+#define        __S_ISGID       02000   /* Set group ID on execution.  */
+#define        __S_ISVTX       01000   /* Save swapped text after use (sticky).  */
+#define        __S_IREAD       0400    /* Read by owner.  */
+#define        __S_IWRITE      0200    /* Write by owner.  */
+#define        __S_IEXEC       0100    /* Execute by owner.  */
+
+#ifdef __USE_ATFILE
+# define UTIME_NOW     ((1l << 30) - 1l)
+# define UTIME_OMIT    ((1l << 30) - 2l)
+#endif
+
+#endif
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/stdio-lock.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/stdio-lock.h
new file mode 100644 (file)
index 0000000..7b6f6e6
--- /dev/null
@@ -0,0 +1,110 @@
+/* Thread package specific definitions of stream lock type.  NPTL version.
+   Copyright (C) 2000, 2001, 2002, 2003, 2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_STDIO_LOCK_H
+#define _BITS_STDIO_LOCK_H 1
+
+#include <bits/libc-lock.h>
+
+
+/* The locking here is very inexpensive, even for inlining.  */
+#define _IO_lock_inexpensive   1
+
+typedef struct { int lock; int cnt; void *owner; } _IO_lock_t;
+
+#define _IO_lock_initializer { LLL_LOCK_INITIALIZER, 0, NULL }
+
+#define _IO_lock_init(_name) \
+  ((_name) = (_IO_lock_t) _IO_lock_initializer , 0)
+
+#define _IO_lock_fini(_name) \
+  ((void) 0)
+
+#define _IO_lock_lock(_name) \
+  do {                                                                       \
+    void *__self = THREAD_SELF;                                                      \
+    if ((_name).owner != __self)                                             \
+      {                                                                              \
+       lll_lock ((_name).lock, LLL_PRIVATE);                                 \
+        (_name).owner = __self;                                                      \
+      }                                                                              \
+    ++(_name).cnt;                                                           \
+  } while (0)
+
+#define _IO_lock_trylock(_name) \
+  ({                                                                         \
+    int __result = 0;                                                        \
+    void *__self = THREAD_SELF;                                                      \
+    if ((_name).owner != __self)                                             \
+      {                                                                              \
+        if (lll_trylock ((_name).lock) == 0)                                 \
+          {                                                                  \
+            (_name).owner = __self;                                          \
+            (_name).cnt = 1;                                                 \
+          }                                                                  \
+        else                                                                 \
+          __result = EBUSY;                                                  \
+      }                                                                              \
+    else                                                                     \
+      ++(_name).cnt;                                                         \
+    __result;                                                                \
+  })
+
+#define _IO_lock_unlock(_name) \
+  do {                                                                       \
+    if (--(_name).cnt == 0)                                                  \
+      {                                                                              \
+        (_name).owner = NULL;                                                \
+       lll_unlock ((_name).lock, LLL_PRIVATE);                               \
+      }                                                                              \
+  } while (0)
+
+
+
+#define _IO_cleanup_region_start(_fct, _fp) \
+  __libc_cleanup_region_start (((_fp)->_flags & _IO_USER_LOCK) == 0, _fct, _fp)
+#define _IO_cleanup_region_start_noarg(_fct) \
+  __libc_cleanup_region_start (1, _fct, NULL)
+#define _IO_cleanup_region_end(_doit) \
+  __libc_cleanup_region_end (_doit)
+
+#if defined _LIBC && !defined NOT_IN_libc
+
+# ifdef __EXCEPTIONS
+#  define _IO_acquire_lock(_fp) \
+  do {                                                                       \
+    _IO_FILE *_IO_acquire_lock_file                                          \
+       __attribute__((cleanup (_IO_acquire_lock_fct)))                       \
+       = (_fp);                                                              \
+    _IO_flockfile (_IO_acquire_lock_file);
+#  define _IO_acquire_lock_clear_flags2(_fp) \
+  do {                                                                       \
+    _IO_FILE *_IO_acquire_lock_file                                          \
+       __attribute__((cleanup (_IO_acquire_lock_clear_flags2_fct)))          \
+       = (_fp);                                                              \
+    _IO_flockfile (_IO_acquire_lock_file);
+# else
+#  define _IO_acquire_lock(_fp) _IO_acquire_lock_needs_exceptions_enabled
+#  define _IO_acquire_lock_clear_flags2(_fp) _IO_acquire_lock (_fp)
+# endif
+# define _IO_release_lock(_fp) ; } while (0)
+
+#endif
+
+#endif /* bits/stdio-lock.h */
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/termios.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/termios.h
new file mode 100644 (file)
index 0000000..5ba4c48
--- /dev/null
@@ -0,0 +1,221 @@
+/* termios type and macro definitions.  Linux version.
+   Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2005
+       Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
+
+typedef unsigned char  cc_t;
+typedef unsigned int   speed_t;
+typedef unsigned int   tcflag_t;
+
+#define NCCS 32
+struct termios
+  {
+    tcflag_t c_iflag;          /* input mode flags */
+    tcflag_t c_oflag;          /* output mode flags */
+    tcflag_t c_cflag;          /* control mode flags */
+    tcflag_t c_lflag;          /* local mode flags */
+    cc_t c_line;                       /* line discipline */
+    cc_t c_cc[NCCS];           /* control characters */
+    speed_t c_ispeed;          /* input speed */
+    speed_t c_ospeed;          /* output speed */
+#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1
+#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1
+  };
+
+#define __ispeed c_ispeed
+#define __ospeed c_ospeed
+
+/* c_cc characters */
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+/* c_iflag bits */
+#define IGNBRK 0000001
+#define BRKINT 0000002
+#define IGNPAR 0000004
+#define PARMRK 0000010
+#define INPCK  0000020
+#define ISTRIP 0000040
+#define INLCR  0000100
+#define IGNCR  0000200
+#define ICRNL  0000400
+#define IUCLC  0001000
+#define IXON   0002000
+#define IXANY  0004000
+#define IXOFF  0010000
+#define IMAXBEL        0020000
+#define IUTF8  0040000
+
+/* c_oflag bits */
+#define OPOST  0000001
+#define OLCUC  0000002
+#define ONLCR  0000004
+#define OCRNL  0000010
+#define ONOCR  0000020
+#define ONLRET 0000040
+#define OFILL  0000100
+#define OFDEL  0000200
+#if defined __USE_MISC || defined __USE_XOPEN
+# define NLDLY 0000400
+# define   NL0 0000000
+# define   NL1 0000400
+# define CRDLY 0003000
+# define   CR0 0000000
+# define   CR1 0001000
+# define   CR2 0002000
+# define   CR3 0003000
+# define TABDLY        0014000
+# define   TAB0        0000000
+# define   TAB1        0004000
+# define   TAB2        0010000
+# define   TAB3        0014000
+# define BSDLY 0020000
+# define   BS0 0000000
+# define   BS1 0020000
+# define FFDLY 0100000
+# define   FF0 0000000
+# define   FF1 0100000
+#endif
+
+#define VTDLY  0040000
+#define   VT0  0000000
+#define   VT1  0040000
+
+#ifdef __USE_MISC
+# define XTABS 0014000
+#endif
+
+/* c_cflag bit meaning */
+#ifdef __USE_MISC
+# define CBAUD 0010017
+#endif
+#define  B0    0000000         /* hang up */
+#define  B50   0000001
+#define  B75   0000002
+#define  B110  0000003
+#define  B134  0000004
+#define  B150  0000005
+#define  B200  0000006
+#define  B300  0000007
+#define  B600  0000010
+#define  B1200 0000011
+#define  B1800 0000012
+#define  B2400 0000013
+#define  B4800 0000014
+#define  B9600 0000015
+#define  B19200        0000016
+#define  B38400        0000017
+#ifdef __USE_MISC
+# define EXTA B19200
+# define EXTB B38400
+#endif
+#define CSIZE  0000060
+#define   CS5  0000000
+#define   CS6  0000020
+#define   CS7  0000040
+#define   CS8  0000060
+#define CSTOPB 0000100
+#define CREAD  0000200
+#define PARENB 0000400
+#define PARODD 0001000
+#define HUPCL  0002000
+#define CLOCAL 0004000
+#ifdef __USE_MISC
+# define CBAUDEX 0010000
+#endif
+#define  B57600   0010001
+#define  B115200  0010002
+#define  B230400  0010003
+#define  B460800  0010004
+#define  B500000  0010005
+#define  B576000  0010006
+#define  B921600  0010007
+#define  B1000000 0010010
+#define  B1152000 0010011
+#define  B1500000 0010012
+#define  B2000000 0010013
+#define  B2500000 0010014
+#define  B3000000 0010015
+#define  B3500000 0010016
+#define  B4000000 0010017
+#define __MAX_BAUD B4000000
+#ifdef __USE_MISC
+# define CIBAUD          002003600000          /* input baud rate (not used) */
+# define CMSPAR   010000000000         /* mark or space (stick) parity */
+# define CRTSCTS  020000000000         /* flow control */
+#endif
+
+/* c_lflag bits */
+#define ISIG   0000001
+#define ICANON 0000002
+#if defined __USE_MISC || defined __USE_XOPEN
+# define XCASE 0000004
+#endif
+#define ECHO   0000010
+#define ECHOE  0000020
+#define ECHOK  0000040
+#define ECHONL 0000100
+#define NOFLSH 0000200
+#define TOSTOP 0000400
+#ifdef __USE_MISC
+# define ECHOCTL 0001000
+# define ECHOPRT 0002000
+# define ECHOKE         0004000
+# define FLUSHO         0010000
+# define PENDIN         0040000
+#endif
+#define IEXTEN 0100000
+
+/* tcflow() and TCXONC use these */
+#define        TCOOFF          0
+#define        TCOON           1
+#define        TCIOFF          2
+#define        TCION           3
+
+/* tcflush() and TCFLSH use these */
+#define        TCIFLUSH        0
+#define        TCOFLUSH        1
+#define        TCIOFLUSH       2
+
+/* tcsetattr uses these */
+#define        TCSANOW         0
+#define        TCSADRAIN       1
+#define        TCSAFLUSH       2
+
+
+#define _IOT_termios /* Hurd ioctl type field.  */ \
+  _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/typesizes.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/typesizes.h
new file mode 100644 (file)
index 0000000..79bb91e
--- /dev/null
@@ -0,0 +1,66 @@
+/* bits/typesizes.h -- underlying types for *_t.  Generic version.
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef        _BITS_TYPESIZES_H
+#define        _BITS_TYPESIZES_H       1
+
+/* See <bits/types.h> for the meaning of these macros.  This file exists so
+   that <bits/types.h> need not vary across different GNU platforms.  */
+
+#define __DEV_T_TYPE           __UQUAD_TYPE
+#define __UID_T_TYPE           __U32_TYPE
+#define __GID_T_TYPE           __U32_TYPE
+#define __INO_T_TYPE           __ULONGWORD_TYPE
+#define __INO64_T_TYPE         __UQUAD_TYPE
+#define __MODE_T_TYPE          __U32_TYPE
+#define __NLINK_T_TYPE         __U32_TYPE
+#define __OFF_T_TYPE           __SLONGWORD_TYPE
+#define __OFF64_T_TYPE         __SQUAD_TYPE
+#define __PID_T_TYPE           __S32_TYPE
+#define __RLIM_T_TYPE          __ULONGWORD_TYPE
+#define __RLIM64_T_TYPE                __UQUAD_TYPE
+#define        __BLKCNT_T_TYPE         __SLONGWORD_TYPE
+#define        __BLKCNT64_T_TYPE       __SQUAD_TYPE
+#define        __FSBLKCNT_T_TYPE       __ULONGWORD_TYPE
+#define        __FSBLKCNT64_T_TYPE     __UQUAD_TYPE
+#define        __FSFILCNT_T_TYPE       __ULONGWORD_TYPE
+#define        __FSFILCNT64_T_TYPE     __UQUAD_TYPE
+#define        __ID_T_TYPE             __U32_TYPE
+#define __CLOCK_T_TYPE         __SLONGWORD_TYPE
+#define __TIME_T_TYPE          __SLONGWORD_TYPE
+#define __USECONDS_T_TYPE      __U32_TYPE
+#define __SUSECONDS_T_TYPE     __SLONGWORD_TYPE
+#define __DADDR_T_TYPE         __S32_TYPE
+#define __SWBLK_T_TYPE         __SLONGWORD_TYPE
+#define __KEY_T_TYPE           __S32_TYPE
+#define __CLOCKID_T_TYPE       __S32_TYPE
+#define __TIMER_T_TYPE         void *
+#define __BLKSIZE_T_TYPE       __S32_TYPE
+#define __FSID_T_TYPE          struct { int __val[2]; }
+#define __SSIZE_T_TYPE         __SWORD_TYPE
+
+/* Number of descriptors that can fit in an `fd_set'.  */
+#define        __FD_SETSIZE            1024
+
+
+#endif /* bits/typesizes.h */
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/utmp.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/bits/utmp.h
new file mode 100644 (file)
index 0000000..e855ad7
--- /dev/null
@@ -0,0 +1,125 @@
+/* The `struct utmp' type, describing entries in the utmp file.  GNU version.
+   Copyright (C) 1993, 1996, 1997, 1998, 1999, 2002
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _UTMP_H
+# error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
+#endif
+
+#include <paths.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <bits/wordsize.h>
+
+
+#define UT_LINESIZE    32
+#define UT_NAMESIZE    32
+#define UT_HOSTSIZE    256
+
+
+/* The structure describing an entry in the database of
+   previous logins.  */
+struct lastlog
+  {
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+    int32_t ll_time;
+#else
+    __time_t ll_time;
+#endif
+    char ll_line[UT_LINESIZE];
+    char ll_host[UT_HOSTSIZE];
+  };
+
+
+/* The structure describing the status of a terminated process.  This
+   type is used in `struct utmp' below.  */
+struct exit_status
+  {
+    short int e_termination;   /* Process termination status.  */
+    short int e_exit;          /* Process exit status.  */
+  };
+
+
+/* The structure describing an entry in the user accounting database.  */
+struct utmp
+{
+  short int ut_type;           /* Type of login.  */
+  pid_t ut_pid;                        /* Process ID of login process.  */
+  char ut_line[UT_LINESIZE];   /* Devicename.  */
+  char ut_id[4];               /* Inittab ID.  */
+  char ut_user[UT_NAMESIZE];   /* Username.  */
+  char ut_host[UT_HOSTSIZE];   /* Hostname for remote login.  */
+  struct exit_status ut_exit;  /* Exit status of a process marked
+                                  as DEAD_PROCESS.  */
+/* The ut_session and ut_tv fields must be the same size when compiled
+   32- and 64-bit.  This allows data files and shared memory to be
+   shared between 32- and 64-bit applications.  */
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+  int32_t ut_session;          /* Session ID, used for windowing.  */
+  struct
+  {
+    int32_t tv_sec;            /* Seconds.  */
+    int32_t tv_usec;           /* Microseconds.  */
+  } ut_tv;                     /* Time entry was made.  */
+#else
+  long int ut_session;         /* Session ID, used for windowing.  */
+  struct timeval ut_tv;                /* Time entry was made.  */
+#endif
+
+  int32_t ut_addr_v6[4];       /* Internet address of remote host.  */
+  char __unused[20];           /* Reserved for future use.  */
+};
+
+/* Backwards compatibility hacks.  */
+#define ut_name                ut_user
+#ifndef _NO_UT_TIME
+/* We have a problem here: `ut_time' is also used otherwise.  Define
+   _NO_UT_TIME if the compiler complains.  */
+# define ut_time       ut_tv.tv_sec
+#endif
+#define ut_xtime       ut_tv.tv_sec
+#define ut_addr                ut_addr_v6[0]
+
+
+/* Values for the `ut_type' field of a `struct utmp'.  */
+#define EMPTY          0       /* No valid user accounting information.  */
+
+#define RUN_LVL                1       /* The system's runlevel.  */
+#define BOOT_TIME      2       /* Time of system boot.  */
+#define NEW_TIME       3       /* Time after system clock changed.  */
+#define OLD_TIME       4       /* Time when system clock changed.  */
+
+#define INIT_PROCESS   5       /* Process spawned by the init process.  */
+#define LOGIN_PROCESS  6       /* Session leader of a logged in user.  */
+#define USER_PROCESS   7       /* Normal process.  */
+#define DEAD_PROCESS   8       /* Terminated process.  */
+
+#define ACCOUNTING     9
+
+/* Old Linux name for the EMPTY type.  */
+#define UT_UNKNOWN     EMPTY
+
+
+/* Tell the user that we have a modern system with UT_HOST, UT_PID,
+   UT_TYPE, UT_ID and UT_TV fields.  */
+#define _HAVE_UT_TYPE  1
+#define _HAVE_UT_PID   1
+#define _HAVE_UT_ID    1
+#define _HAVE_UT_TV    1
+#define _HAVE_UT_HOST  1
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/brk.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/brk.c
new file mode 100644 (file)
index 0000000..dd99d69
--- /dev/null
@@ -0,0 +1,20 @@
+/* Copyright (C) 1991, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* definition of __brk lives in sbrk.c */
+
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/chdir.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/chdir.c
new file mode 100644 (file)
index 0000000..9ebadd4
--- /dev/null
@@ -0,0 +1,39 @@
+/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <string.h>
+#include <ros/syscall.h>
+
+/* Change the current directory to PATH.  */
+int
+__chdir (path)
+     const char *path;
+{
+  if (path == NULL)
+  {
+    __set_errno (EINVAL);
+    return -1;
+  }
+
+  return ros_syscall(SYS_chdir, getpid(), path, strlen(path), 0, 0, 0);
+}
+weak_alias (__chdir, chdir)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/check_fds.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/check_fds.c
new file mode 100644 (file)
index 0000000..ff81640
--- /dev/null
@@ -0,0 +1,12 @@
+#include <fcntl.h>
+#include <unistd.h>
+#include <assert.h>
+
+void    
+__libc_check_standard_fds (void)
+{
+  #define check_one_fd(fd) assert(fcntl((fd),F_GETFD) != -1)
+  check_one_fd(STDIN_FILENO);
+  check_one_fd(STDOUT_FILENO);
+  check_one_fd(STDERR_FILENO);
+}
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/check_native.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/check_native.c
new file mode 100644 (file)
index 0000000..5396daa
--- /dev/null
@@ -0,0 +1,181 @@
+/* Determine whether interfaces use native transport.  Linux version.
+   Copyright (C) 2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* AKAROS note: this is the linux version, neutered/commented out.  Needed to let
+ * getaddrinfo compile */
+#include <assert.h>
+#include <errno.h>
+#include <ifaddrs.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <time.h>
+#include <unistd.h>
+#include <net/if.h>
+//#include <net/if_arp.h>
+//#include <sys/ioctl.h>
+
+//#include <asm/types.h>
+//#include <linux/netlink.h>
+//#include <linux/rtnetlink.h>
+
+#include <not-cancel.h>
+
+void
+__check_native (uint32_t a1_index, int *a1_native,
+               uint32_t a2_index, int *a2_native)
+{
+}
+
+#if 0
+void
+__check_native (uint32_t a1_index, int *a1_native,
+               uint32_t a2_index, int *a2_native)
+{
+  int fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+
+  struct sockaddr_nl nladdr;
+  memset (&nladdr, '\0', sizeof (nladdr));
+  nladdr.nl_family = AF_NETLINK;
+
+  socklen_t addr_len = sizeof (nladdr);
+
+  if (fd < 0
+      || __bind (fd, (struct sockaddr *) &nladdr, sizeof (nladdr)) != 0
+      || __getsockname (fd, (struct sockaddr *) &nladdr, &addr_len) != 0)
+    return;
+
+  pid_t pid = nladdr.nl_pid;
+  struct req
+  {
+    struct nlmsghdr nlh;
+    struct rtgenmsg g;
+    /* struct rtgenmsg consists of a single byte.  This means there
+       are three bytes of padding included in the REQ definition.
+       We make them explicit here.  */
+    char pad[3];
+  } req;
+
+  req.nlh.nlmsg_len = sizeof (req);
+  req.nlh.nlmsg_type = RTM_GETLINK;
+  req.nlh.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;
+  req.nlh.nlmsg_pid = 0;
+  req.nlh.nlmsg_seq = time (NULL);
+  req.g.rtgen_family = AF_UNSPEC;
+
+  assert (sizeof (req) - offsetof (struct req, pad) == 3);
+  memset (req.pad, '\0', sizeof (req.pad));
+
+  memset (&nladdr, '\0', sizeof (nladdr));
+  nladdr.nl_family = AF_NETLINK;
+
+#ifdef PAGE_SIZE
+  /* Help the compiler optimize out the malloc call if PAGE_SIZE
+     is constant and smaller or equal to PTHREAD_STACK_MIN/4.  */
+  const size_t buf_size = PAGE_SIZE;
+#else
+  const size_t buf_size = __getpagesize ();
+#endif
+  bool use_malloc = false;
+  char *buf;
+
+  if (__libc_use_alloca (buf_size))
+    buf = alloca (buf_size);
+  else
+    {
+      buf = malloc (buf_size);
+      if (buf != NULL)
+       use_malloc = true;
+      else
+       goto out_fail;
+    }
+
+  struct iovec iov = { buf, buf_size };
+
+  if (TEMP_FAILURE_RETRY (__sendto (fd, (void *) &req, sizeof (req), 0,
+                                   (struct sockaddr *) &nladdr,
+                                   sizeof (nladdr))) < 0)
+    goto out_fail;
+
+  bool done = false;
+  do
+    {
+      struct msghdr msg =
+       {
+         (void *) &nladdr, sizeof (nladdr),
+         &iov, 1,
+         NULL, 0,
+         0
+       };
+
+      ssize_t read_len = TEMP_FAILURE_RETRY (__recvmsg (fd, &msg, 0));
+      if (read_len < 0)
+       goto out_fail;
+
+      if (msg.msg_flags & MSG_TRUNC)
+       goto out_fail;
+
+      struct nlmsghdr *nlmh;
+      for (nlmh = (struct nlmsghdr *) buf;
+          NLMSG_OK (nlmh, (size_t) read_len);
+          nlmh = (struct nlmsghdr *) NLMSG_NEXT (nlmh, read_len))
+       {
+         if (nladdr.nl_pid != 0 || (pid_t) nlmh->nlmsg_pid != pid
+             || nlmh->nlmsg_seq != req.nlh.nlmsg_seq)
+           continue;
+
+         if (nlmh->nlmsg_type == RTM_NEWLINK)
+           {
+             struct ifinfomsg *ifim = (struct ifinfomsg *) NLMSG_DATA (nlmh);
+             int native = (ifim->ifi_type != ARPHRD_TUNNEL6
+                           && ifim->ifi_type != ARPHRD_TUNNEL
+                           && ifim->ifi_type != ARPHRD_SIT);
+
+             if (a1_index == ifim->ifi_index)
+               {
+                 *a1_native = native;
+                 a1_index = 0xffffffffu;
+               }
+             if (a2_index == ifim->ifi_index)
+               {
+                 *a2_native = native;
+                 a2_index = 0xffffffffu;
+               }
+
+             if (a1_index == 0xffffffffu
+                 && a2_index == 0xffffffffu)
+               goto out;
+           }
+         else if (nlmh->nlmsg_type == NLMSG_DONE)
+           /* We found the end, leave the loop.  */
+           done = true;
+       }
+    }
+  while (! done);
+
+ out:
+  close_not_cancel_no_status (fd);
+
+  return;
+
+out_fail:
+  if (use_malloc)
+    free (buf);
+}
+#endif
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/chmod.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/chmod.c
new file mode 100644 (file)
index 0000000..a707190
--- /dev/null
@@ -0,0 +1,48 @@
+/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <ros/syscall.h>
+#include <fcall.h>
+
+/* Change the protections of FILE to MODE.  */
+int
+__chmod (const char* file, mode_t mode)
+{
+  struct dir dir;
+  size_t mlen;
+  char mbuf[STATFIXLEN];
+  int ret;
+
+  if (file == NULL)
+  {
+    __set_errno (EINVAL);
+    return -1;
+  }
+
+  init_empty_dir(&dir);
+  dir.mode = mode;
+  mlen = convD2M(&dir, mbuf, STATFIXLEN);
+  ret = ros_syscall(SYS_wstat, file, strlen(file), mbuf, mlen, WSTAT_MODE, 0);
+  return (ret == mlen ? 0 : -1);
+}
+weak_alias (__chmod, chmod)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/close.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/close.c
new file mode 100644 (file)
index 0000000..fb403ee
--- /dev/null
@@ -0,0 +1,32 @@
+/* Copyright (C) 1991, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stddef.h>
+#include <ros/syscall.h>
+
+/* Write NBYTES of BUF to FD.  Return the number written, or -1.  */
+int
+__close (int fd)
+{
+  return ros_syscall(SYS_close, fd, 0, 0, 0, 0, 0);
+}
+libc_hidden_def (__close)
+weak_alias (__close, close)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/closedir.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/closedir.c
new file mode 100644 (file)
index 0000000..9c601de
--- /dev/null
@@ -0,0 +1 @@
+#include <sysdeps/unix/closedir.c>
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/configure b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/configure
new file mode 100644 (file)
index 0000000..8f15bf5
--- /dev/null
@@ -0,0 +1 @@
+DEFINES="$DEFINES -D_LIBC_REENTRANT"
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/convD2M.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/convD2M.c
new file mode 100644 (file)
index 0000000..6d336c2
--- /dev/null
@@ -0,0 +1,101 @@
+/* 
+ * This file is part of the UCB release of Plan 9. It is subject to the license
+ * terms in the LICENSE file found in the top-level directory of this
+ * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
+ * part of the UCB release of Plan 9, including this file, may be copied,
+ * modified, propagated, or distributed except according to the terms contained
+ * in the LICENSE file.
+ */
+
+#include <string.h>
+#include <fcall.h>
+
+unsigned int sizeD2M(struct dir *d)
+{
+       char *sv[4];
+       int i, ns;
+
+       sv[0] = d->name;
+       sv[1] = d->uid;
+       sv[2] = d->gid;
+       sv[3] = d->muid;
+
+       ns = 0;
+       for (i = 0; i < 4; i++)
+               if (sv[i])
+                       ns += strlen(sv[i]);
+
+       return STATFIXLEN + ns;
+}
+
+unsigned int convD2M(struct dir *d, uint8_t * buf, unsigned int nbuf)
+{
+       uint8_t *p, *ebuf;
+       char *sv[4];
+       int i, ns, nsv[4], ss;
+
+       if (nbuf < BIT16SZ)
+               return 0;
+
+       p = buf;
+       ebuf = buf + nbuf;
+
+       sv[0] = d->name;
+       sv[1] = d->uid;
+       sv[2] = d->gid;
+       sv[3] = d->muid;
+
+       ns = 0;
+       for (i = 0; i < 4; i++) {
+               if (sv[i])
+                       nsv[i] = strlen(sv[i]);
+               else
+                       nsv[i] = 0;
+               ns += nsv[i];
+       }
+
+       ss = STATFIXLEN + ns;
+
+       /* set size before erroring, so user can know how much is needed */
+       /* note that length excludes count field itself */
+       PBIT16(p, ss - BIT16SZ);
+       p += BIT16SZ;
+
+       if (ss > nbuf)
+               return BIT16SZ;
+
+       PBIT16(p, d->type);
+       p += BIT16SZ;
+       PBIT32(p, d->dev);
+       p += BIT32SZ;
+       PBIT8(p, d->qid.type);
+       p += BIT8SZ;
+       PBIT32(p, d->qid.vers);
+       p += BIT32SZ;
+       PBIT64(p, d->qid.path);
+       p += BIT64SZ;
+       PBIT32(p, d->mode);
+       p += BIT32SZ;
+       PBIT32(p, d->atime);
+       p += BIT32SZ;
+       PBIT32(p, d->mtime);
+       p += BIT32SZ;
+       PBIT64(p, d->length);
+       p += BIT64SZ;
+
+       for (i = 0; i < 4; i++) {
+               ns = nsv[i];
+               if (p + ns + BIT16SZ > ebuf)
+                       return 0;
+               PBIT16(p, ns);
+               p += BIT16SZ;
+               if (ns)
+                       memmove(p, sv[i], ns);
+               p += ns;
+       }
+
+       if (ss != p - buf)
+               return 0;
+
+       return p - buf;
+}
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/convM2D.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/convM2D.c
new file mode 100644 (file)
index 0000000..657e3b6
--- /dev/null
@@ -0,0 +1,101 @@
+/* 
+ * This file is part of the UCB release of Plan 9. It is subject to the license
+ * terms in the LICENSE file found in the top-level directory of this
+ * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
+ * part of the UCB release of Plan 9, including this file, may be copied,
+ * modified, propagated, or distributed except according to the terms contained
+ * in the LICENSE file.
+ */
+
+#include <fcall.h>
+#include <string.h>
+
+int statcheck(uint8_t * buf, unsigned int nbuf)
+{
+       uint8_t *ebuf;
+       int i;
+
+       ebuf = buf + nbuf;
+
+       if (nbuf < STATFIXLEN || nbuf != BIT16SZ + GBIT16(buf))
+               return -1;
+
+       buf += STATFIXLEN - 4 * BIT16SZ;
+
+       for (i = 0; i < 4; i++) {
+               if (buf + BIT16SZ > ebuf)
+                       return -1;
+               buf += BIT16SZ + GBIT16(buf);
+       }
+
+       if (buf != ebuf)
+               return -1;
+
+       return 0;
+}
+
+static char nullstring[] = "";
+
+unsigned int
+convM2D(uint8_t * buf, unsigned int nbuf, struct dir *d, char *strs)
+{
+       uint8_t *p, *ebuf;
+       char *sv[4];
+       int i, ns;
+
+       if (nbuf < STATFIXLEN)
+               return 0;
+
+       p = buf;
+       ebuf = buf + nbuf;
+
+       p += BIT16SZ;   /* ignore size */
+       d->type = GBIT16(p);
+       p += BIT16SZ;
+       d->dev = GBIT32(p);
+       p += BIT32SZ;
+       d->qid.type = GBIT8(p);
+       p += BIT8SZ;
+       d->qid.vers = GBIT32(p);
+       p += BIT32SZ;
+       d->qid.path = GBIT64(p);
+       p += BIT64SZ;
+       d->mode = GBIT32(p);
+       p += BIT32SZ;
+       d->atime = GBIT32(p);
+       p += BIT32SZ;
+       d->mtime = GBIT32(p);
+       p += BIT32SZ;
+       d->length = GBIT64(p);
+       p += BIT64SZ;
+
+       for (i = 0; i < 4; i++) {
+               if (p + BIT16SZ > ebuf)
+                       return 0;
+               ns = GBIT16(p);
+               p += BIT16SZ;
+               if (p + ns > ebuf)
+                       return 0;
+               if (strs) {
+                       sv[i] = strs;
+                       memmove(strs, p, ns);
+                       strs += ns;
+                       *strs++ = '\0';
+               }
+               p += ns;
+       }
+
+       if (strs) {
+               d->name = sv[0];
+               d->uid = sv[1];
+               d->gid = sv[2];
+               d->muid = sv[3];
+       } else {
+               d->name = nullstring;
+               d->uid = nullstring;
+               d->gid = nullstring;
+               d->muid = nullstring;
+       }
+
+       return p - buf;
+}
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/convM2S.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/convM2S.c
new file mode 100644 (file)
index 0000000..fa72621
--- /dev/null
@@ -0,0 +1,336 @@
+/* 
+ * This file is part of the UCB release of Plan 9. It is subject to the license
+ * terms in the LICENSE file found in the top-level directory of this
+ * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
+ * part of the UCB release of Plan 9, including this file, may be copied,
+ * modified, propagated, or distributed except according to the terms contained
+ * in the LICENSE file.
+ */
+
+#include <string.h>
+#include <fcall.h>
+
+static
+uint8_t *gstring(uint8_t * p, uint8_t * ep, char **s)
+{
+       unsigned int n;
+
+       if (p + BIT16SZ > ep)
+               return NULL;
+       n = GBIT16(p);
+       p += BIT16SZ - 1;
+       if (p + n + 1 > ep)
+               return NULL;
+       /* move it down, on top of count, to make room for '\0' */
+       memmove(p, p + 1, n);
+       p[n] = '\0';
+       *s = (char *)p;
+       p += n + 1;
+       return p;
+}
+
+static
+uint8_t *gqid(uint8_t * p, uint8_t * ep, struct qid *q)
+{
+       if (p + QIDSZ > ep)
+               return NULL;
+       q->type = GBIT8(p);
+       p += BIT8SZ;
+       q->vers = GBIT32(p);
+       p += BIT32SZ;
+       q->path = GBIT64(p);
+       p += BIT64SZ;
+       return p;
+}
+
+void init_empty_dir(struct dir *d)
+{
+       d->type = ~0;
+       d->dev = ~0;
+       d->qid.path = ~0;
+       d->qid.vers = ~0;
+       d->qid.type = ~0;
+       d->mode = ~0;
+       d->atime = ~0;
+       d->mtime = ~0;
+       d->length = ~0;
+       d->name = "";
+       d->uid = "";
+       d->gid = "";
+       d->muid = "";
+}
+
+/*
+ * no syntactic checks.
+ * three causes for error:
+ *  1. message size field is incorrect
+ *  2. input buffer too short for its own data (counts too long, etc.)
+ *  3. too many names or qids
+ * gqid() and gstring() return NULL if they would reach beyond buffer.
+ * main switch statement checks range and also can fall through
+ * to test at end of routine.
+ */
+unsigned int convM2S(uint8_t * ap, unsigned int nap, struct fcall *f)
+{
+       uint8_t *p, *ep;
+       unsigned int i, size;
+
+       p = ap;
+       ep = p + nap;
+
+       if (p + BIT32SZ + BIT8SZ + BIT16SZ > ep)
+               return 0;
+       size = GBIT32(p);
+       p += BIT32SZ;
+
+       if (size < BIT32SZ + BIT8SZ + BIT16SZ)
+               return 0;
+
+       f->type = GBIT8(p);
+       p += BIT8SZ;
+       f->tag = GBIT16(p);
+       p += BIT16SZ;
+
+       switch (f->type) {
+               default:
+                       return 0;
+
+               case Tversion:
+                       if (p + BIT32SZ > ep)
+                               return 0;
+                       f->msize = GBIT32(p);
+                       p += BIT32SZ;
+                       p = gstring(p, ep, &f->version);
+                       break;
+
+               case Tflush:
+                       if (p + BIT16SZ > ep)
+                               return 0;
+                       f->oldtag = GBIT16(p);
+                       p += BIT16SZ;
+                       break;
+
+               case Tauth:
+                       if (p + BIT32SZ > ep)
+                               return 0;
+                       f->afid = GBIT32(p);
+                       p += BIT32SZ;
+                       p = gstring(p, ep, &f->uname);
+                       if (p == NULL)
+                               break;
+                       p = gstring(p, ep, &f->aname);
+                       if (p == NULL)
+                               break;
+                       break;
+
+               case Tattach:
+                       if (p + BIT32SZ > ep)
+                               return 0;
+                       f->fid = GBIT32(p);
+                       p += BIT32SZ;
+                       if (p + BIT32SZ > ep)
+                               return 0;
+                       f->afid = GBIT32(p);
+                       p += BIT32SZ;
+                       p = gstring(p, ep, &f->uname);
+                       if (p == NULL)
+                               break;
+                       p = gstring(p, ep, &f->aname);
+                       if (p == NULL)
+                               break;
+                       break;
+
+               case Twalk:
+                       if (p + BIT32SZ + BIT32SZ + BIT16SZ > ep)
+                               return 0;
+                       f->fid = GBIT32(p);
+                       p += BIT32SZ;
+                       f->newfid = GBIT32(p);
+                       p += BIT32SZ;
+                       f->nwname = GBIT16(p);
+                       p += BIT16SZ;
+                       if (f->nwname > MAXWELEM)
+                               return 0;
+                       for (i = 0; i < f->nwname; i++) {
+                               p = gstring(p, ep, &f->wname[i]);
+                               if (p == NULL)
+                                       break;
+                       }
+                       break;
+
+               case Topen:
+                       if (p + BIT32SZ + BIT8SZ > ep)
+                               return 0;
+                       f->fid = GBIT32(p);
+                       p += BIT32SZ;
+                       f->mode = GBIT8(p);
+                       p += BIT8SZ;
+                       break;
+
+               case Tcreate:
+                       if (p + BIT32SZ > ep)
+                               return 0;
+                       f->fid = GBIT32(p);
+                       p += BIT32SZ;
+                       p = gstring(p, ep, &f->name);
+                       if (p == NULL)
+                               break;
+                       if (p + BIT32SZ + BIT8SZ > ep)
+                               return 0;
+                       f->perm = GBIT32(p);
+                       p += BIT32SZ;
+                       f->mode = GBIT8(p);
+                       p += BIT8SZ;
+                       break;
+
+               case Tread:
+                       if (p + BIT32SZ + BIT64SZ + BIT32SZ > ep)
+                               return 0;
+                       f->fid = GBIT32(p);
+                       p += BIT32SZ;
+                       f->offset = GBIT64(p);
+                       p += BIT64SZ;
+                       f->count = GBIT32(p);
+                       p += BIT32SZ;
+                       break;
+
+               case Twrite:
+                       if (p + BIT32SZ + BIT64SZ + BIT32SZ > ep)
+                               return 0;
+                       f->fid = GBIT32(p);
+                       p += BIT32SZ;
+                       f->offset = GBIT64(p);
+                       p += BIT64SZ;
+                       f->count = GBIT32(p);
+                       p += BIT32SZ;
+                       if (p + f->count > ep)
+                               return 0;
+                       f->data = (char *)p;
+                       p += f->count;
+                       break;
+
+               case Tclunk:
+               case Tremove:
+                       if (p + BIT32SZ > ep)
+                               return 0;
+                       f->fid = GBIT32(p);
+                       p += BIT32SZ;
+                       break;
+
+               case Tstat:
+                       if (p + BIT32SZ > ep)
+                               return 0;
+                       f->fid = GBIT32(p);
+                       p += BIT32SZ;
+                       break;
+
+               case Twstat:
+                       if (p + BIT32SZ + BIT16SZ > ep)
+                               return 0;
+                       f->fid = GBIT32(p);
+                       p += BIT32SZ;
+                       f->nstat = GBIT16(p);
+                       p += BIT16SZ;
+                       if (p + f->nstat > ep)
+                               return 0;
+                       f->stat = p;
+                       p += f->nstat;
+                       break;
+
+/*
+ */
+               case Rversion:
+                       if (p + BIT32SZ > ep)
+                               return 0;
+                       f->msize = GBIT32(p);
+                       p += BIT32SZ;
+                       p = gstring(p, ep, &f->version);
+                       break;
+
+               case Rerror:
+                       p = gstring(p, ep, &f->ename);
+                       break;
+
+               case Rflush:
+                       break;
+
+               case Rauth:
+                       p = gqid(p, ep, &f->aqid);
+                       if (p == NULL)
+                               break;
+                       break;
+
+               case Rattach:
+                       p = gqid(p, ep, &f->qid);
+                       if (p == NULL)
+                               break;
+                       break;
+
+               case Rwalk:
+                       if (p + BIT16SZ > ep)
+                               return 0;
+                       f->nwqid = GBIT16(p);
+                       p += BIT16SZ;
+                       if (f->nwqid > MAXWELEM)
+                               return 0;
+                       for (i = 0; i < f->nwqid; i++) {
+                               p = gqid(p, ep, &f->wqid[i]);
+                               if (p == NULL)
+                                       break;
+                       }
+                       break;
+
+               case Ropen:
+               case Rcreate:
+                       p = gqid(p, ep, &f->qid);
+                       if (p == NULL)
+                               break;
+                       if (p + BIT32SZ > ep)
+                               return 0;
+                       f->iounit = GBIT32(p);
+                       p += BIT32SZ;
+                       break;
+
+               case Rread:
+                       if (p + BIT32SZ > ep)
+                               return 0;
+                       f->count = GBIT32(p);
+                       p += BIT32SZ;
+                       if (p + f->count > ep)
+                               return 0;
+                       f->data = (char *)p;
+                       p += f->count;
+                       break;
+
+               case Rwrite:
+                       if (p + BIT32SZ > ep)
+                               return 0;
+                       f->count = GBIT32(p);
+                       p += BIT32SZ;
+                       break;
+
+               case Rclunk:
+               case Rremove:
+                       break;
+
+               case Rstat:
+                       if (p + BIT16SZ > ep)
+                               return 0;
+                       f->nstat = GBIT16(p);
+                       p += BIT16SZ;
+                       if (p + f->nstat > ep)
+                               return 0;
+                       f->stat = p;
+                       p += f->nstat;
+                       break;
+
+               case Rwstat:
+                       break;
+       }
+
+       if (p == NULL || p > ep)
+               return 0;
+       if (ap + size == p)
+               return size;
+       return 0;
+}
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/convS2M.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/convS2M.c
new file mode 100644 (file)
index 0000000..a1a0afa
--- /dev/null
@@ -0,0 +1,390 @@
+/* 
+ * This file is part of the UCB release of Plan 9. It is subject to the license
+ * terms in the LICENSE file found in the top-level directory of this
+ * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
+ * part of the UCB release of Plan 9, including this file, may be copied,
+ * modified, propagated, or distributed except according to the terms contained
+ * in the LICENSE file.
+ */
+
+#include <string.h>
+#include <fcall.h>
+
+static
+uint8_t *pstring(uint8_t * p, char *s)
+{
+       unsigned int n;
+
+       if (s == NULL) {
+               PBIT16(p, 0);
+               p += BIT16SZ;
+               return p;
+       }
+
+       n = strlen(s);
+       /*
+        * We are moving the string before the length,
+        * so you can S2M a struct into an existing message
+        */
+       memmove(p + BIT16SZ, s, n);
+       PBIT16(p, n);
+       p += n + BIT16SZ;
+       return p;
+}
+
+static
+uint8_t *pqid(uint8_t * p, struct qid *q)
+{
+       PBIT8(p, q->type);
+       p += BIT8SZ;
+       PBIT32(p, q->vers);
+       p += BIT32SZ;
+       PBIT64(p, q->path);
+       p += BIT64SZ;
+       return p;
+}
+
+static
+unsigned int stringsz(char *s)
+{
+       if (s == NULL)
+               return BIT16SZ;
+
+       return BIT16SZ + strlen(s);
+}
+
+unsigned int sizeS2M(struct fcall *f)
+{
+       unsigned int n;
+       int i;
+
+       n = 0;
+       n += BIT32SZ;   /* size */
+       n += BIT8SZ;    /* type */
+       n += BIT16SZ;   /* tag */
+
+       switch (f->type) {
+               default:
+                       return 0;
+
+               case Tversion:
+                       n += BIT32SZ;
+                       n += stringsz(f->version);
+                       break;
+
+               case Tflush:
+                       n += BIT16SZ;
+                       break;
+
+               case Tauth:
+                       n += BIT32SZ;
+                       n += stringsz(f->uname);
+                       n += stringsz(f->aname);
+                       break;
+
+               case Tattach:
+                       n += BIT32SZ;
+                       n += BIT32SZ;
+                       n += stringsz(f->uname);
+                       n += stringsz(f->aname);
+                       break;
+
+               case Twalk:
+                       n += BIT32SZ;
+                       n += BIT32SZ;
+                       n += BIT16SZ;
+                       for (i = 0; i < f->nwname; i++)
+                               n += stringsz(f->wname[i]);
+                       break;
+
+               case Topen:
+                       n += BIT32SZ;
+                       n += BIT8SZ;
+                       break;
+
+               case Tcreate:
+                       n += BIT32SZ;
+                       n += stringsz(f->name);
+                       n += BIT32SZ;
+                       n += BIT8SZ;
+                       break;
+
+               case Tread:
+                       n += BIT32SZ;
+                       n += BIT64SZ;
+                       n += BIT32SZ;
+                       break;
+
+               case Twrite:
+                       n += BIT32SZ;
+                       n += BIT64SZ;
+                       n += BIT32SZ;
+                       n += f->count;
+                       break;
+
+               case Tclunk:
+               case Tremove:
+                       n += BIT32SZ;
+                       break;
+
+               case Tstat:
+                       n += BIT32SZ;
+                       break;
+
+               case Twstat:
+                       n += BIT32SZ;
+                       n += BIT16SZ;
+                       n += f->nstat;
+                       break;
+/*
+ */
+
+               case Rversion:
+                       n += BIT32SZ;
+                       n += stringsz(f->version);
+                       break;
+
+               case Rerror:
+                       n += stringsz(f->ename);
+                       break;
+
+               case Rflush:
+                       break;
+
+               case Rauth:
+                       n += QIDSZ;
+                       break;
+
+               case Rattach:
+                       n += QIDSZ;
+                       break;
+
+               case Rwalk:
+                       n += BIT16SZ;
+                       n += f->nwqid * QIDSZ;
+                       break;
+
+               case Ropen:
+               case Rcreate:
+                       n += QIDSZ;
+                       n += BIT32SZ;
+                       break;
+
+               case Rread:
+                       n += BIT32SZ;
+                       n += f->count;
+                       break;
+
+               case Rwrite:
+                       n += BIT32SZ;
+                       break;
+
+               case Rclunk:
+                       break;
+
+               case Rremove:
+                       break;
+
+               case Rstat:
+                       n += BIT16SZ;
+                       n += f->nstat;
+                       break;
+
+               case Rwstat:
+                       break;
+       }
+       return n;
+}
+
+unsigned int convS2M(struct fcall *f, uint8_t * ap, unsigned int nap)
+{
+       uint8_t *p;
+       unsigned int i, size;
+
+       size = sizeS2M(f);
+       if (size == 0)
+               return 0;
+       if (size > nap)
+               return 0;
+
+       p = (uint8_t *) ap;
+
+       PBIT32(p, size);
+       p += BIT32SZ;
+       PBIT8(p, f->type);
+       p += BIT8SZ;
+       PBIT16(p, f->tag);
+       p += BIT16SZ;
+
+       switch (f->type) {
+               default:
+                       return 0;
+
+               case Tversion:
+                       PBIT32(p, f->msize);
+                       p += BIT32SZ;
+                       p = pstring(p, f->version);
+                       break;
+
+               case Tflush:
+                       PBIT16(p, f->oldtag);
+                       p += BIT16SZ;
+                       break;
+
+               case Tauth:
+                       PBIT32(p, f->afid);
+                       p += BIT32SZ;
+                       p = pstring(p, f->uname);
+                       p = pstring(p, f->aname);
+                       break;
+
+               case Tattach:
+                       PBIT32(p, f->fid);
+                       p += BIT32SZ;
+                       PBIT32(p, f->afid);
+                       p += BIT32SZ;
+                       p = pstring(p, f->uname);
+                       p = pstring(p, f->aname);
+                       break;
+
+               case Twalk:
+                       PBIT32(p, f->fid);
+                       p += BIT32SZ;
+                       PBIT32(p, f->newfid);
+                       p += BIT32SZ;
+                       PBIT16(p, f->nwname);
+                       p += BIT16SZ;
+                       if (f->nwname > MAXWELEM)
+                               return 0;
+                       for (i = 0; i < f->nwname; i++)
+                               p = pstring(p, f->wname[i]);
+                       break;
+
+               case Topen:
+                       PBIT32(p, f->fid);
+                       p += BIT32SZ;
+                       PBIT8(p, f->mode);
+                       p += BIT8SZ;
+                       break;
+
+               case Tcreate:
+                       PBIT32(p, f->fid);
+                       p += BIT32SZ;
+                       p = pstring(p, f->name);
+                       PBIT32(p, f->perm);
+                       p += BIT32SZ;
+                       PBIT8(p, f->mode);
+                       p += BIT8SZ;
+                       break;
+
+               case Tread:
+                       PBIT32(p, f->fid);
+                       p += BIT32SZ;
+                       PBIT64(p, f->offset);
+                       p += BIT64SZ;
+                       PBIT32(p, f->count);
+                       p += BIT32SZ;
+                       break;
+
+               case Twrite:
+                       PBIT32(p, f->fid);
+                       p += BIT32SZ;
+                       PBIT64(p, f->offset);
+                       p += BIT64SZ;
+                       PBIT32(p, f->count);
+                       p += BIT32SZ;
+                       memmove(p, f->data, f->count);
+                       p += f->count;
+                       break;
+
+               case Tclunk:
+               case Tremove:
+                       PBIT32(p, f->fid);
+                       p += BIT32SZ;
+                       break;
+
+               case Tstat:
+                       PBIT32(p, f->fid);
+                       p += BIT32SZ;
+                       break;
+
+               case Twstat:
+                       PBIT32(p, f->fid);
+                       p += BIT32SZ;
+                       PBIT16(p, f->nstat);
+                       p += BIT16SZ;
+                       memmove(p, f->stat, f->nstat);
+                       p += f->nstat;
+                       break;
+/*
+ */
+
+               case Rversion:
+                       PBIT32(p, f->msize);
+                       p += BIT32SZ;
+                       p = pstring(p, f->version);
+                       break;
+
+               case Rerror:
+                       p = pstring(p, f->ename);
+                       break;
+
+               case Rflush:
+                       break;
+
+               case Rauth:
+                       p = pqid(p, &f->aqid);
+                       break;
+
+               case Rattach:
+                       p = pqid(p, &f->qid);
+                       break;
+
+               case Rwalk:
+                       PBIT16(p, f->nwqid);
+                       p += BIT16SZ;
+                       if (f->nwqid > MAXWELEM)
+                               return 0;
+                       for (i = 0; i < f->nwqid; i++)
+                               p = pqid(p, &f->wqid[i]);
+                       break;
+
+               case Ropen:
+               case Rcreate:
+                       p = pqid(p, &f->qid);
+                       PBIT32(p, f->iounit);
+                       p += BIT32SZ;
+                       break;
+
+               case Rread:
+                       PBIT32(p, f->count);
+                       p += BIT32SZ;
+                       memmove(p, f->data, f->count);
+                       p += f->count;
+                       break;
+
+               case Rwrite:
+                       PBIT32(p, f->count);
+                       p += BIT32SZ;
+                       break;
+
+               case Rclunk:
+                       break;
+
+               case Rremove:
+                       break;
+
+               case Rstat:
+                       PBIT16(p, f->nstat);
+                       p += BIT16SZ;
+                       memmove(p, f->stat, f->nstat);
+                       p += f->nstat;
+                       break;
+
+               case Rwstat:
+                       break;
+       }
+       if (size != p - ap)
+               return 0;
+       return size;
+}
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/dirfd.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/dirfd.c
new file mode 100644 (file)
index 0000000..efcc4d2
--- /dev/null
@@ -0,0 +1,32 @@
+/* Return the file descriptor used by a DIR stream.  Stub version.
+   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <dirent.h>
+#include <dirstream.h>
+#include <errno.h>
+#undef dirfd
+
+int
+dirfd(DIR* dirp)
+{
+  return dirp->fd;
+}
+
+stub_warning (dirfd)
+#include <stub-tag.h>
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/dirstream.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/dirstream.h
new file mode 100644 (file)
index 0000000..b7f36c2
--- /dev/null
@@ -0,0 +1 @@
+#include <sysdeps/unix/dirstream.h>
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/dl-execstack.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/dl-execstack.c
new file mode 100644 (file)
index 0000000..f819c38
--- /dev/null
@@ -0,0 +1,40 @@
+/* Stack executability handling for GNU dynamic linker.  Stub version.
+   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <ldsodefs.h>
+#include <errno.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <ros/memlayout.h>
+
+/* There is no portable way to know the bounds of the initial thread's stack
+   so as to mprotect it.  */
+
+int
+internal_function
+_dl_make_stack_executable (void **stack_endp)
+{
+  *stack_endp = 0;
+  GL(dl_stack_flags) |= PF_X;
+
+  int size = USTACK_NUM_PAGES*PGSIZE;
+  void* bottom = USTACKTOP-size;
+  return mprotect(bottom,size,PROT_READ|PROT_WRITE|PROT_EXEC);
+}
+rtld_hidden_def (_dl_make_stack_executable)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/dl-sysdep.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/dl-sysdep.c
new file mode 100644 (file)
index 0000000..4f012a9
--- /dev/null
@@ -0,0 +1,16 @@
+#include <ros/procinfo.h>
+
+#define DL_FIND_ARG_COMPONENTS(cookie, argc, argv, envp, auxp) \
+  do {                                                                       \
+    void **_tmp;                                                             \
+    (argc) = 0;                                                                      \
+    while (__procinfo.argp[(argc)])                                          \
+      (argc)++;                                                                      \
+    (argv) = (char **) __procinfo.argp;                                              \
+    (envp) = (argv) + (argc) + 1;                                            \
+    for (_tmp = (void **) (envp); *_tmp; ++_tmp)                             \
+      continue;                                                                      \
+    (auxp) = (void *) ++_tmp;                                                \
+  } while (0)
+
+#include <elf/dl-sysdep.c>
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/errlist.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/errlist.c
new file mode 100644 (file)
index 0000000..124232f
--- /dev/null
@@ -0,0 +1,147 @@
+// This was automatically generated with make_errlist.sh, do not edit
+
+#include <stddef.h>
+
+const char *const _sys_errlist[] =
+{
+       [ 0 ] = "Success",
+       [ 1 ] = "Operation not permitted",
+       [ 2 ] = "No such file or directory",
+       [ 3 ] = "No such process",
+       [ 4 ] = "Interrupted system call",
+       [ 5 ] = "I/O error",
+       [ 6 ] = "No such device or address",
+       [ 7 ] = "Argument list too long",
+       [ 8 ] = "Exec format error",
+       [ 9 ] = "Bad file number",
+       [ 10 ] = "No child processes",
+       [ 11 ] = "Try again",
+       [ 12 ] = "Out of memory",
+       [ 13 ] = "Permission denied",
+       [ 14 ] = "Bad address",
+       [ 15 ] = "Block device required",
+       [ 16 ] = "Device or resource busy",
+       [ 17 ] = "File exists",
+       [ 18 ] = "Cross-device link",
+       [ 19 ] = "No such device",
+       [ 20 ] = "Not a directory",
+       [ 21 ] = "Is a directory",
+       [ 22 ] = "Invalid argument",
+       [ 23 ] = "File table overflow",
+       [ 24 ] = "Too many open files",
+       [ 25 ] = "Not a typewriter",
+       [ 26 ] = "Text file busy",
+       [ 27 ] = "File too large",
+       [ 28 ] = "No space left on device",
+       [ 29 ] = "Illegal seek",
+       [ 30 ] = "Read-only file system",
+       [ 31 ] = "Too many links",
+       [ 32 ] = "Broken pipe",
+       [ 33 ] = "Math argument out of domain of func",
+       [ 34 ] = "Math result not representable",
+       [ 35 ] = "Resource deadlock would occur",
+       [ 36 ] = "File name too long",
+       [ 37 ] = "No record locks available",
+       [ 38 ] = "Function not implemented",
+       [ 39 ] = "Directory not empty",
+       [ 40 ] = "Too many symbolic links encountered",
+       [ 42 ] = "No message of desired type",
+       [ 43 ] = "Identifier removed",
+       [ 44 ] = "Channel number out of range",
+       [ 45 ] = "Level 2 not synchronized",
+       [ 46 ] = "Level 3 halted",
+       [ 47 ] = "Level 3 reset",
+       [ 48 ] = "Link number out of range",
+       [ 49 ] = "Protocol driver not attached",
+       [ 50 ] = "No CSI structure available",
+       [ 51 ] = "Level 2 halted",
+       [ 52 ] = "Invalid exchange",
+       [ 53 ] = "Invalid request descriptor",
+       [ 54 ] = "Exchange full",
+       [ 55 ] = "No anode",
+       [ 56 ] = "Invalid request code",
+       [ 57 ] = "Invalid slot",
+       [ 59 ] = "Bad font file format",
+       [ 60 ] = "Device not a stream",
+       [ 61 ] = "No data available",
+       [ 62 ] = "Timer expired",
+       [ 63 ] = "Out of streams resources",
+       [ 64 ] = "Machine is not on the network",
+       [ 65 ] = "Package not installed",
+       [ 66 ] = "Object is remote",
+       [ 67 ] = "Link has been severed",
+       [ 68 ] = "Advertise error",
+       [ 69 ] = "Srmount error",
+       [ 70 ] = "Communication error on send",
+       [ 71 ] = "Protocol error",
+       [ 72 ] = "Multihop attempted",
+       [ 73 ] = "RFS specific error",
+       [ 74 ] = "Not a data message",
+       [ 75 ] = "Value too large for defined data type",
+       [ 76 ] = "Name not unique on network",
+       [ 77 ] = "File descriptor in bad state",
+       [ 78 ] = "Remote address changed",
+       [ 79 ] = "Can not access a needed shared library",
+       [ 80 ] = "Accessing a corrupted shared library",
+       [ 81 ] = ".lib section in a.out corrupted",
+       [ 82 ] = "Attempting to link in too many shared libraries",
+       [ 83 ] = "Cannot exec a shared library directly",
+       [ 84 ] = "Illegal byte sequence",
+       [ 85 ] = "Interrupted system call should be restarted",
+       [ 86 ] = "Streams pipe error",
+       [ 87 ] = "Too many users",
+       [ 88 ] = "Socket operation on non-socket",
+       [ 89 ] = "Destination address required",
+       [ 90 ] = "Message too long",
+       [ 91 ] = "Protocol wrong type for socket",
+       [ 92 ] = "Protocol not available",
+       [ 93 ] = "Protocol not supported",
+       [ 94 ] = "Socket type not supported",
+       [ 95 ] = "Operation not supported on transport endpoint",
+       [ 96 ] = "Protocol family not supported",
+       [ 97 ] = "Address family not supported by protocol",
+       [ 98 ] = "Address already in use",
+       [ 99 ] = "Cannot assign requested address",
+       [ 100 ] = "Network is down",
+       [ 101 ] = "Network is unreachable",
+       [ 102 ] = "Network dropped connection because of reset",
+       [ 103 ] = "Software caused connection abort",
+       [ 104 ] = "Connection reset by peer",
+       [ 105 ] = "No buffer space available",
+       [ 106 ] = "Transport endpoint is already connected",
+       [ 107 ] = "Transport endpoint is not connected",
+       [ 108 ] = "Cannot send after transport endpoint shutdown",
+       [ 109 ] = "Too many references: cannot splice",
+       [ 110 ] = "Connection timed out",
+       [ 111 ] = "Connection refused",
+       [ 112 ] = "Host is down",
+       [ 113 ] = "No route to host",
+       [ 114 ] = "Operation already in progress",
+       [ 115 ] = "Operation now in progress",
+       [ 116 ] = "Stale NFS file handle",
+       [ 117 ] = "Structure needs cleaning",
+       [ 118 ] = "Not a XENIX named type file",
+       [ 119 ] = "No XENIX semaphores available",
+       [ 120 ] = "Is a named type file",
+       [ 121 ] = "Remote I/O error",
+       [ 122 ] = "Quota exceeded",
+       [ 123 ] = "No medium found",
+       [ 124 ] = "Wrong medium type",
+       [ 125 ] = "Operation Canceled",
+       [ 126 ] = "Required key not available",
+       [ 127 ] = "Key has expired",
+       [ 128 ] = "Key has been revoked",
+       [ 129 ] = "Key was rejected by service",
+       [ 130 ] = "Owner died",
+       [ 131 ] = "State not recoverable",
+       [ 132 ] = "Generic Failure",
+       [ 133 ] = "No memory available",
+       [ 135 ] = "No free pid",
+       [ 136 ] = "Unspecified",
+       [ 137 ] = "Moron",
+};
+
+const int _sys_nerr = sizeof (_sys_errlist) / sizeof (_sys_errlist[0]);
+
+strong_alias(_sys_errlist,_sys_errlist_internal);
+strong_alias(_sys_nerr,_sys_nerr_internal);
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/errno.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/errno.c
new file mode 100644 (file)
index 0000000..3004bc0
--- /dev/null
@@ -0,0 +1,74 @@
+/* Definition of `errno' variable.  Canonical version.
+   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <tls.h>
+#include <dl-sysdep.h>
+#undef errno
+
+#if RTLD_PRIVATE_ERRNO
+
+/* Code compiled for rtld has errno #defined to rtld_errno. */
+int rtld_errno attribute_hidden;
+#define errno rtld_errno
+char __errstr_tls[MAX_ERRSTR_LEN] = {0};
+
+#else
+
+__thread int errno;
+extern __thread int __libc_errno __attribute__ ((alias ("errno")))
+  attribute_hidden;
+__thread char __errstr_tls[MAX_ERRSTR_LEN] = {0};
+
+#endif
+
+/* this is the glibc default, exported so uthread.c can use them */
+int *__errno_location_tls(void)
+{
+       return &errno;
+}
+
+char *__errstr_location_tls(void)
+{
+       return __errstr_tls;
+}
+
+/* These func ptrs will be used to access errno_loc and errstr_loc.  can be
+ * overriden at runtime (uthread code will do this) */
+int *(*ros_errno_loc)(void) = __errno_location_tls;
+char *(*ros_errstr_loc)(void) = __errstr_location_tls;
+
+/* errno calls this (and derefs the result).  it's also called internally */
+int *__errno_location(void)
+{
+       return ros_errno_loc();
+}
+
+/* libc doesn't really know about errstr, but we'll use it in syscall.c */
+char *errstr(void)
+{
+       return ros_errstr_loc();
+}
+
+/* Don't try to hidden_data_def the function pointers.  Won't allow us to
+ * switch, or otherwise track the right location. */
+libc_hidden_def(__errno_location_tls)
+libc_hidden_def(__errstr_location_tls)
+libc_hidden_def(__errno_location)
+libc_hidden_def(errstr)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/execve.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/execve.c
new file mode 100644 (file)
index 0000000..e7f2949
--- /dev/null
@@ -0,0 +1,51 @@
+/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <ros/syscall.h>
+#include <string.h>
+#include <fcntl.h>
+#include <elf/elf.h>
+#include <ros/procinfo.h>
+#include <assert.h>
+
+/* Replace the current process, executing PATH with arguments ARGV and
+   environment ENVP.  ARGV and ENVP are terminated by NULL pointers.  */
+int
+__execve (path, argv, envp)
+     const char *path;
+     char *const argv[];
+     char *const envp[];
+{
+  procinfo_t pi;
+  if(procinfo_pack_args(&pi,argv,envp))
+  {
+    errno = ENOMEM;
+    return -1;
+  }
+
+  int ret = ros_syscall(SYS_exec, path, strlen(path), (uintptr_t)&pi, 0, 0, 0);
+
+  // if we got here, then exec better have failed...
+  assert(ret == -1);
+
+  return ret;
+}
+weak_alias (__execve, execve)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fcall.h b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fcall.h
new file mode 100644 (file)
index 0000000..6e527d5
--- /dev/null
@@ -0,0 +1,173 @@
+/* 
+ * This file is part of the UCB release of Plan 9. It is subject to the license
+ * terms in the LICENSE file found in the top-level directory of this
+ * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
+ * part of the UCB release of Plan 9, including this file, may be copied,
+ * modified, propagated, or distributed except according to the terms contained
+ * in the LICENSE file.
+ */
+/*
+ * Copyright 2013 Google Inc.
+ * Copyright (c) 1989-2003 by Lucent Technologies, Bell Laboratories.
+ */
+
+#ifndef _GLIBC_AKAROS_FCALL_H
+#define _GLIBC_AKAROS_FCALL_H
+
+#include <ros/common.h>
+
+/* There are a bunch of structs and macros in there that the kernel also uses,
+ * though none of this is part of the actual kernel interface (I think) */
+
+/* STATFIXLEN includes leading 16-bit count */
+/* The count, however, excludes itself; total size is BIT16SZ+count */
+#define STATFIXLEN     (BIT16SZ+QIDSZ+5*BIT16SZ+4*BIT32SZ+1*BIT64SZ)   /* amount of fixed length data in a stat buffer */
+
+struct qid {
+       uint64_t path;
+       uint32_t vers;
+       uint8_t type;
+};
+
+struct dir {
+       /* system-modified data */
+       uint16_t type;                          /* server type */
+       unsigned int dev;                       /* server subtype */
+       /* file data */
+       struct qid qid;                         /* unique id from server */
+       uint32_t mode;                          /* permissions */
+       uint32_t atime;                         /* last read time */
+       uint32_t mtime;                         /* last write time */
+       int64_t length;                         /* file length: see <u.h> */
+       char *name;                                     /* last element of path */
+       char *uid;                                      /* owner name */
+       char *gid;                                      /* group name */
+       char *muid;                                     /* last modifier name */
+};
+
+#define        VERSION9P       "9P2000"
+
+#define        MAXWELEM        16
+
+struct fcall {
+       uint8_t type;
+       uint32_t fid;
+       uint16_t tag;
+       union {
+               struct {
+                       uint32_t msize;         /* Tversion, Rversion */
+                       char *version;          /* Tversion, Rversion */
+               };
+               struct {
+                       uint16_t oldtag;        /* Tflush */
+               };
+               struct {
+                       char *ename;            /* Rerror */
+               };
+               struct {
+                       struct qid qid;         /* Rattach, Ropen, Rcreate */
+                       uint32_t iounit;        /* Ropen, Rcreate */
+               };
+               struct {
+                       struct qid aqid;        /* Rauth */
+               };
+               struct {
+                       uint32_t afid;          /* Tauth, Tattach */
+                       char *uname;            /* Tauth, Tattach */
+                       char *aname;            /* Tauth, Tattach */
+               };
+               struct {
+                       uint32_t perm;          /* Tcreate */
+                       char *name;                     /* Tcreate */
+                       uint8_t mode;           /* Tcreate, Topen */
+               };
+               struct {
+                       uint32_t newfid;        /* Twalk */
+                       uint16_t nwname;        /* Twalk */
+                       char *wname[MAXWELEM];  /* Twalk */
+               };
+               struct {
+                       uint16_t nwqid;         /* Rwalk */
+                       struct qid wqid[MAXWELEM];      /* Rwalk */
+               };
+               struct {
+                       int64_t offset;         /* Tread, Twrite */
+                       uint32_t count;         /* Tread, Twrite, Rread */
+                       char *data;                     /* Twrite, Rread */
+               };
+               struct {
+                       uint16_t nstat;         /* Twstat, Rstat */
+                       uint8_t *stat;          /* Twstat, Rstat */
+               };
+       };
+};
+
+#define        GBIT8(p)        ((p)[0])
+#define        GBIT16(p)       ((p)[0]|((p)[1]<<8))
+#define        GBIT32(p)       ((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24))
+#define        GBIT64(p)       ((uint32_t)((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)) |\
+                               ((int64_t)((p)[4]|((p)[5]<<8)|((p)[6]<<16)|((p)[7]<<24)) << 32))
+
+#define        PBIT8(p,v)      (p)[0]=(v)
+#define        PBIT16(p,v)     (p)[0]=(v);(p)[1]=(v)>>8
+#define        PBIT32(p,v)     (p)[0]=(v);(p)[1]=(v)>>8;(p)[2]=(v)>>16;(p)[3]=(v)>>24
+#define        PBIT64(p,v)     (p)[0]=(v);(p)[1]=(v)>>8;(p)[2]=(v)>>16;(p)[3]=(v)>>24;\
+                       (p)[4]=(v)>>32;(p)[5]=(v)>>40;(p)[6]=(v)>>48;(p)[7]=(v)>>56
+
+#define        BIT8SZ          1
+#define        BIT16SZ         2
+#define        BIT32SZ         4
+#define        BIT64SZ         8
+#define        QIDSZ   (BIT8SZ+BIT32SZ+BIT64SZ)
+
+/* STATFIXLEN includes leading 16-bit count */
+/* The count, however, excludes itself; total size is BIT16SZ+count */
+#define STATFIXLEN     (BIT16SZ+QIDSZ+5*BIT16SZ+4*BIT32SZ+1*BIT64SZ)   /* amount of fixed length data in a stat buffer */
+
+#define        NOTAG           (uint16_t)~0U   /* Dummy tag */
+#define        NOFID           (uint32_t)~0U   /* Dummy fid */
+#define        IOHDRSZ         24      /* ample room for Twrite/Rread header (iounit) */
+
+enum {
+       Tversion = 100,
+       Rversion,
+       Tauth = 102,
+       Rauth,
+       Tattach = 104,
+       Rattach,
+       Terror = 106,   /* illegal */
+       Rerror,
+       Tflush = 108,
+       Rflush,
+       Twalk = 110,
+       Rwalk,
+       Topen = 112,
+       Ropen,
+       Tcreate = 114,
+       Rcreate,
+       Tread = 116,
+       Rread,
+       Twrite = 118,
+       Rwrite,
+       Tclunk = 120,
+       Rclunk,
+       Tremove = 122,
+       Rremove,
+       Tstat = 124,
+       Rstat,
+       Twstat = 126,
+       Rwstat,
+       Tmax,
+};
+
+void init_empty_dir(struct dir *d);
+unsigned int convM2S(uint8_t *, unsigned int, struct fcall *);
+unsigned int convS2M(struct fcall *, uint8_t *, unsigned int);
+unsigned int sizeS2M(struct fcall *);
+
+int statcheck(uint8_t * abuf, unsigned int nbuf);
+unsigned int convM2D(uint8_t *, unsigned int, struct dir *, char *);
+unsigned int convD2M(struct dir *, uint8_t *, unsigned int);
+unsigned int sizeD2M(struct dir *);
+
+#endif /* _GLIBC_AKAROS_FCALL_H */
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fchdir.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fchdir.c
new file mode 100644 (file)
index 0000000..1bd8259
--- /dev/null
@@ -0,0 +1,31 @@
+/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+/* Change the current directory to FD.  */
+int
+fchdir (fd)
+     int fd;
+{
+  return ros_syscall(SYS_fchdir, getpid(), fd, 0, 0, 0, 0);
+}
+strong_alias (fchdir,__fchdir)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fchmod.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fchmod.c
new file mode 100644 (file)
index 0000000..b2cbe48
--- /dev/null
@@ -0,0 +1,48 @@
+/* Copyright (C) 1991, 1992, 1995, 1996, 1997, 2011 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcall.h>
+
+/* Change the permissions of the file referenced by FD to MODE.  */
+int
+__fchmod (fd, mode)
+     int fd;
+     mode_t mode;
+{
+  struct dir dir;
+  size_t mlen;
+  char mbuf[STATFIXLEN];
+  int ret;
+
+  if (fd < 0)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  init_empty_dir(&dir);
+  dir.mode = mode;
+  mlen = convD2M(&dir, mbuf, STATFIXLEN);
+  ret = ros_syscall(SYS_fwstat, fd, mbuf, mlen, WSTAT_MODE, 0, 0);
+  return (ret == mlen ? 0 : -1);
+}
+weak_alias (__fchmod, fchmod)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fcntl.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fcntl.c
new file mode 100644 (file)
index 0000000..25fdf43
--- /dev/null
@@ -0,0 +1,49 @@
+/* Copyright (C) 1991, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <ros/syscall.h>
+
+/* Perform file control operations on FD.  */
+int
+__fcntl(int fd, int cmd, ...)
+{
+  va_list vl;
+  va_start(vl,cmd);
+  int arg = va_arg(vl,int);
+  va_end(vl);
+
+  switch(cmd)
+  {
+    case F_DUPFD:
+    case F_GETFD:
+    case F_SETFD:
+    case F_GETFL:
+    case F_SETFL:
+      return ros_syscall(SYS_fcntl, fd, cmd, arg, 0, 0, 0);
+    default:
+      errno = ENOSYS;
+      return -1;
+  }
+}
+
+libc_hidden_def (__fcntl)
+weak_alias (__fcntl, fcntl)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/flockfile.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/flockfile.c
new file mode 100644 (file)
index 0000000..139fbe7
--- /dev/null
@@ -0,0 +1,32 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stdio.h>
+#include <libio.h>
+#include <bits/stdio-lock.h>
+
+
+void
+__flockfile (stream)
+     FILE *stream;
+{
+  _IO_lock_lock (*stream->_lock);
+}
+strong_alias (__flockfile, _IO_flockfile)
+weak_alias (__flockfile, flockfile)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fork.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fork.c
new file mode 100644 (file)
index 0000000..adcdb22
--- /dev/null
@@ -0,0 +1,33 @@
+/* Copyright (C) 1991, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <stdlib.h>
+#include <ros/syscall.h>
+
+/* Clone the calling process, creating an exact copy.
+   Return -1 for errors, 0 to the new process,
+   and the process ID of the new process to the old process.  */
+pid_t __fork(void)
+{
+       return ros_syscall(SYS_fork, 0, 0, 0, 0, 0, 0);
+}
+libc_hidden_def (__fork)
+weak_alias (__fork, fork)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/ftruncate.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/ftruncate.c
new file mode 100644 (file)
index 0000000..d015757
--- /dev/null
@@ -0,0 +1,31 @@
+/* Copyright (C) 1991, 1995, 1996, 1997, 1998, 2011 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+/* Truncate the file referenced by FD to LENGTH bytes.  */
+int
+__ftruncate (fd, length)
+     int fd;
+     off_t length;
+{
+  return ftruncate64(fd, length);
+}
+weak_alias (__ftruncate, ftruncate)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/ftruncate64.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/ftruncate64.c
new file mode 100644 (file)
index 0000000..fc2d111
--- /dev/null
@@ -0,0 +1,47 @@
+/* Copyright (C) 1997, 1998, 2001, 2011 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/types.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcall.h>
+
+/* Truncate the file referenced by FD to LENGTH bytes.  */
+int
+__ftruncate64 (fd, length)
+     int fd;
+     off64_t length;
+{
+  struct dir dir;
+  size_t mlen;
+  char mbuf[STATFIXLEN];
+  int ret;
+
+  if (fd < 0)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  init_empty_dir(&dir);
+  dir.length = length;
+  mlen = convD2M(&dir, mbuf, STATFIXLEN);
+  ret = ros_syscall(SYS_fwstat, fd, mbuf, mlen, WSTAT_LENGTH, 0, 0);
+  return (ret == mlen ? 0 : -1);
+}
+weak_alias (__ftruncate64, ftruncate64)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/ftrylockfile.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/ftrylockfile.c
new file mode 100644 (file)
index 0000000..abb17a1
--- /dev/null
@@ -0,0 +1,32 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stdio.h>
+#include <bits/stdio-lock.h>
+
+
+int
+__ftrylockfile (stream)
+     FILE *stream;
+{
+  return _IO_lock_trylock (*stream->_lock);
+}
+strong_alias (__ftrylockfile, _IO_ftrylockfile)
+weak_alias (__ftrylockfile, ftrylockfile)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/funlockfile.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/funlockfile.c
new file mode 100644 (file)
index 0000000..d761c0b
--- /dev/null
@@ -0,0 +1,32 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stdio.h>
+#include <libio.h>
+#include <bits/stdio-lock.h>
+
+
+void
+__funlockfile (stream)
+     FILE *stream;
+{
+  _IO_lock_unlock (*stream->_lock);
+}
+strong_alias (__funlockfile, _IO_funlockfile)
+weak_alias (__funlockfile, funlockfile)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/futimens.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/futimens.c
new file mode 100644 (file)
index 0000000..52b9983
--- /dev/null
@@ -0,0 +1,90 @@
+/* Change access and modification times of open file.  Linux version.
+   Copyright (C) 2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <time.h>
+#include <sysdep.h>
+#include <fcall.h>
+#include <sys/time.h>
+#include <ros/syscall.h>
+
+/* Change the access time of the file associated with FD to TSP[0] and
+   the modification time of FILE to TSP[1].  */
+
+
+/* brho notes: gettimeofday doesn't have nsec precision, and we also drop down
+ * to second precision for wstat (for now).  also, on some systems, modifying
+ * the mtime may change the atime too.  could be surprising. */
+int
+futimens (int fd, const struct timespec tsp[2])
+{
+  struct dir dir;
+  size_t mlen;
+  char mbuf[STATFIXLEN];
+  int ret;
+  int wstat_flags = 0;
+  struct timeval tv_now = {0};
+
+  if (fd < 0)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  init_empty_dir(&dir);
+
+  /* copy-and-pasted with utimensat */
+  if (!tsp) {
+       if (gettimeofday(&tv_now, 0) < 0)
+               return -1;
+       dir.atime = tv_now.tv_sec;
+       dir.mtime = tv_now.tv_sec;
+       wstat_flags = WSTAT_ATIME | WSTAT_MTIME;
+  } else {
+       /* atime */
+    if (tsp[0].tv_nsec == UTIME_NOW) {
+               if (gettimeofday(&tv_now, 0) < 0)
+                       return -1;
+               dir.atime = tv_now.tv_sec;
+               wstat_flags |= WSTAT_ATIME;
+       } else if (tsp[0].tv_nsec != UTIME_OMIT) {
+               dir.atime = tsp[0].tv_sec;
+               wstat_flags |= WSTAT_ATIME;
+       }
+       /* mtime */
+    if (tsp[1].tv_nsec == UTIME_NOW) {
+               if (gettimeofday(&tv_now, 0) < 0)
+                       return -1;
+               dir.mtime = tv_now.tv_sec;
+               wstat_flags |= WSTAT_MTIME;
+       } else if (tsp[1].tv_nsec != UTIME_OMIT) {
+               dir.mtime = tsp[1].tv_sec;
+               wstat_flags |= WSTAT_MTIME;
+       }
+  }
+
+  if (!wstat_flags)
+       return 0;
+
+  mlen = convD2M(&dir, mbuf, STATFIXLEN);
+  ret = ros_syscall(SYS_fwstat, fd, mbuf, mlen, wstat_flags, 0, 0);
+  return (ret == mlen ? 0 : -1);
+}
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/futimes.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/futimes.c
new file mode 100644 (file)
index 0000000..f48ff25
--- /dev/null
@@ -0,0 +1,39 @@
+/* futimes -- change access and modification times of open file.  Stub version.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/time.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* Change the access time of FILE to TVP[0] and
+   the modification time of FILE to TVP[1], but do not follow symlinks.  */
+int
+__futimes (int fd, const struct timeval tvp[2])
+{
+  struct timespec tsp[2];
+  if (!tvp)
+       return futimens(fd, 0);
+  tsp[0].tv_sec = tvp[0].tv_sec;
+  tsp[0].tv_nsec = 0;
+  tsp[1].tv_sec = tvp[1].tv_sec;
+  tsp[1].tv_nsec = 0;
+  return futimens(fd, tsp);
+}
+weak_alias (__futimes, futimes)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/futimesat.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/futimesat.c
new file mode 100644 (file)
index 0000000..235fafa
--- /dev/null
@@ -0,0 +1,41 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+
+/* Change the access time of FILE relative to FD to TVP[0] and
+   the modification time of FILE to TVP[1].  */
+int
+futimesat (fd, file, tvp)
+     int fd;
+     const char *file;
+     const struct timeval tvp[2];
+{
+  struct timespec tsp[2];
+  if (!tvp)
+       return utimensat(fd, file, 0, 0);
+  tsp[0].tv_sec = tvp[0].tv_sec;
+  tsp[0].tv_nsec = 0;
+  tsp[1].tv_sec = tvp[1].tv_sec;
+  tsp[1].tv_nsec = 0;
+  return utimensat(fd, file, tsp, 0);
+}
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fxstat.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fxstat.c
new file mode 100644 (file)
index 0000000..c3f2ee8
--- /dev/null
@@ -0,0 +1,54 @@
+/* Copyright (C) 1991, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <ros/syscall.h>
+
+/* Get information about the file descriptor FD in BUF.  */
+int
+__fxstat (int vers, int fd, struct stat *buf)
+{
+  if (vers != _STAT_VER)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  if (fd < 0)
+    {
+      __set_errno (EBADF);
+      return -1;
+    }
+  else if (buf == NULL)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  
+  int ret = (int)ros_syscall(SYS_fstat, fd, buf, 0, 0, 0, 0);
+  return ret;
+}
+stub_warning (fstat)
+hidden_def (__fxstat)
+weak_alias (__fxstat, _fxstat)
+#include <stub-tag.h>
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fxstat64.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/fxstat64.c
new file mode 100644 (file)
index 0000000..e1603c2
--- /dev/null
@@ -0,0 +1,33 @@
+/* Copyright (C) 1991, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <ros/syscall.h>
+
+/* Get information about the file descriptor FD in BUF.  */
+int
+__fxstat64 (int vers, int fd, struct stat64 *buf)
+{
+  int ret = __fxstat(vers, fd, (struct stat*)buf);
+  return ret;
+}
+hidden_def (__fxstat64)
diff --git a/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/getaddrinfo.c b/tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/akaros/getaddrinfo.c
new file mode 100644 (file)
index 0000000..2aaaa8e
--- /dev/null
@@ -0,0 +1,2390 @@
+/* The Inner Net License, Version 2.00
+
+  The author(s) grant permission for redistribution and use in source and
+binary forms, with or without modification, of the software and documentation
+provided that the following conditions are met:
+
+0. If you receive a version of the software that is specifically labelled
+   as not being for redistribution (check the version message and/or README),
+   you are not permitted to redistribute that version of the software in any
+   way or form.
+1. All terms of the all other applicable copyrights and licenses must be
+   followed.
+2. Redistributions of source code must retain the authors' copyright
+   notice(s), this list of conditions, and the following disclaimer.
+3. Redistributions in binary form must reproduce the authors' copyright
+   notice(s), this list of conditions, and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+4. [The copyright holder has authorized the removal of this clause.]
+5. Neither the name(s) of the author(s) 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 ITS AUTHORS 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 AUTHORS 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.
+
+  If these license terms cause you a real problem, contact the author.  */
+
+/* This software is Copyright 1996 by Craig Metz, All Rights Reserved.  */
+
+/* AKAROS note: this is the sysdeps/posix one (not to be confused with the
+ * posix/ stub one.  Needed for something or other in the network related
+ * subdirs */
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+#include <ifaddrs.h>
+#include <netdb.h>
+#include <nss.h>
+#include <resolv.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdio_ext.h>
+#include <stdlib.h>
+#include <string.h>
+#include <arpa/inet.h>
+#include <net/if.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/un.h>
+#include <sys/utsname.h>
+#include <unistd.h>
+#include <nsswitch.h>
+#include <bits/libc-lock.h>
+#include <not-cancel.h>
+#include <nscd/nscd-client.h>
+#include <nscd/nscd_proto.h>
+#include <resolv/res_hconf.h>
+
+#ifdef HAVE_LIBIDN
+extern int __idna_to_ascii_lz (const char *input, char **output, int flags);
+extern int __idna_to_unicode_lzlz (const char *input, char **output,
+                                  int flags);
+# include <libidn/idna.h>
+#endif
+
+#define GAIH_OKIFUNSPEC 0x0100
+#define GAIH_EAI        ~(GAIH_OKIFUNSPEC)
+
+#ifndef UNIX_PATH_MAX
+# define UNIX_PATH_MAX  108
+#endif
+
+struct gaih_service
+  {
+    const char *name;
+    int num;
+  };
+
+struct gaih_servtuple
+  {
+    struct gaih_servtuple *next;
+    int socktype;
+    int protocol;
+    int port;
+  };
+
+static const struct gaih_servtuple nullserv;
+
+
+struct gaih_typeproto
+  {
+    int socktype;
+    int protocol;
+    uint8_t protoflag;
+    bool defaultflag;
+    char name[8];
+  };
+
+/* Values for `protoflag'.  */
+#define GAI_PROTO_NOSERVICE    1
+#define GAI_PROTO_PROTOANY     2
+
+static const struct gaih_typeproto gaih_inet_typeproto[] =
+{
+  { 0, 0, 0, false, "" },
+  { SOCK_STREAM, IPPROTO_TCP, 0, true, "tcp" },
+  { SOCK_DGRAM, IPPROTO_UDP, 0, true, "udp" },
+#if defined SOCK_DCCP && defined IPPROTO_DCCP
+  { SOCK_DCCP, IPPROTO_DCCP, 0, false, "dccp" },
+#endif
+#ifdef IPPROTO_UDPLITE
+  { SOCK_DGRAM, IPPROTO_UDPLITE, 0, false, "udplite" },
+#endif
+#ifdef IPPROTO_SCTP
+  { SOCK_STREAM, IPPROTO_SCTP, 0, false, "sctp" },
+  { SOCK_SEQPACKET, IPPROTO_SCTP, 0, false, "sctp" },
+#endif
+  { SOCK_RAW, 0, GAI_PROTO_PROTOANY|GAI_PROTO_NOSERVICE, true, "raw" },
+  { 0, 0, 0, false, "" }
+};
+
+struct gaih
+  {
+    int family;
+    int (*gaih)(const char *name, const struct gaih_service *service,
+               const struct addrinfo *req, struct addrinfo **pai,
+               unsigned int *naddrs);
+  };
+
+static const struct addrinfo default_hints =
+  {
+    .ai_flags = AI_DEFAULT,
+    .ai_family = PF_UNSPEC,
+    .ai_socktype = 0,
+    .ai_protocol = 0,
+    .ai_addrlen = 0,
+    .ai_addr = NULL,
+    .ai_canonname = NULL,
+    .ai_next = NULL
+  };
+
+
+static int
+gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp,
+               const struct addrinfo *req, struct gaih_servtuple *st)
+{
+  struct servent *s;
+  size_t tmpbuflen = 1024;
+  struct servent ts;
+  char *tmpbuf;
+  int r;
+
+  do
+    {
+      tmpbuf = __alloca (tmpbuflen);
+
+      r = __getservbyname_r (servicename, tp->name, &ts, tmpbuf, tmpbuflen,
+                            &s);
+      if (r != 0 || s == NULL)
+       {
+         if (r == ERANGE)
+           tmpbuflen *= 2;
+         else
+           return GAIH_OKIFUNSPEC | -EAI_SERVICE;
+       }
+    }
+  while (r);
+
+  st->next = NULL;
+  st->socktype = tp->socktype;
+  st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY)
+                 ? req->ai_protocol : tp->protocol);
+  st->port = s->s_port;
+
+  return 0;
+}
+
+#define gethosts(_family, _type) \
+ {                                                                           \
+  int i;                                                                     \
+  int herrno;                                                                \
+  struct hostent th;                                                         \
+  struct hostent *h;                                                         \
+  char *localcanon = NULL;                                                   \
+  no_data = 0;                                                               \
+  while (1) {                                                                \
+    rc = 0;                                                                  \
+    status = DL_CALL_FCT (fct, (name, _family, &th, tmpbuf, tmpbuflen,       \
+                               &rc, &herrno, NULL, &localcanon));            \
+    if (rc != ERANGE || herrno != NETDB_INTERNAL)                            \
+      break;                                                                 \
+    tmpbuf = extend_alloca (tmpbuf, tmpbuflen, 2 * tmpbuflen);               \
+  }                                                                          \
+  if (status == NSS_STATUS_SUCCESS && rc == 0)                               \
+    h = &th;                                                                 \
+  else                                                                       \
+    h = NULL;                                                                \
+  if (rc != 0)                                                               \
+    {                                                                        \
+      if (herrno == NETDB_INTERNAL)                                          \
+       {                                                                     \
+         __set_h_errno (herrno);                                             \
+         _res.options = old_res_options;                                     \
+         return -EAI_SYSTEM;                                                 \
+       }                                                                     \
+      if (herrno == TRY_AGAIN)                                               \
+       no_data = EAI_AGAIN;                                                  \
+      else                                                                   \
+       no_data = herrno == NO_DATA;                                          \
+    }                                                                        \
+  else if (h != NULL)                                                        \
+    {                                                                        \
+      for (i = 0; h->h_addr_list[i]; i++)                                    \
+       {                                                                     \
+         if (*pat == NULL)                                                   \
+           {                                                                 \
+             *pat = __alloca (sizeof (struct gaih_addrtuple));               \
+             (*pat)->scopeid = 0;                                            \
+           }                                                                 \
+         uint32_t *addr = (*pat)->addr;                                      \
+         (*pat)->next = NULL;                                                \
+         (*pat)->name = i == 0 ? strdupa (h->h_name) : NULL;                 \
+         if (_family == AF_INET && req->ai_family == AF_INET6)               \
+           {                                                                 \
+             (*pat)->family = AF_INET6;                                      \
+             addr[3] = *(uint32_t *) h->h_addr_list[i];                      \
+             addr[2] = htonl (0xffff);                                       \
+             addr[1] = 0;                                                    \
+             addr[0] = 0;                                                    \
+           }                                                                 \
+         else                                                                \
+           {                                                                 \
+             (*pat)->family = _family;                                       \
+             memcpy (addr, h->h_addr_list[i], sizeof(_type));                \
+           }                                                                 \
+         pat = &((*pat)->next);                                              \
+       }                                                                     \
+                                                                             \
+      if (localcanon !=        NULL && canon == NULL)                                \
+       canon = strdupa (localcanon);                                         \
+                                                                             \
+      if (_family == AF_INET6 && i > 0)                                              \
+       got_ipv6 = true;                                                      \
+    }                                                                        \
+ }
+
+
+typedef enum nss_status (*nss_gethostbyname4_r)
+  (const char *name, struct gaih_addrtuple **pat,
+   char *buffer, size_t buflen, int *errnop,
+   int *h_errnop, int32_t *ttlp);
+typedef enum nss_status (*nss_gethostbyname3_r)
+  (const char *name, int af, struct hostent *host,
+   char *buffer, size_t buflen, int *errnop,
+   int *h_errnop, int32_t *ttlp, char **canonp);
+typedef enum nss_status (*nss_getcanonname_r)
+  (const char *name, char *buffer, size_t buflen, char **result,
+   int *errnop, int *h_errnop);
+extern service_user *__nss_hosts_database attribute_hidden;
+
+
+static int
+gaih_inet (const char *name, const struct gaih_service *service,
+          const struct addrinfo *req, struct addrinfo **pai,
+          unsigned int *naddrs)
+{
+  const struct gaih_typeproto *tp = gaih_inet_typeproto;
+  struct gaih_servtuple *st = (struct gaih_servtuple *) &nullserv;
+  struct gaih_addrtuple *at = NULL;
+  int rc;
+  bool got_ipv6 = false;
+  const char *canon = NULL;
+  const char *orig_name = name;
+
+  if (req->ai_protocol || req->ai_socktype)
+    {
+      ++tp;
+
+      while (tp->name[0]
+            && ((req->ai_socktype != 0 && req->ai_socktype != tp->socktype)
+                || (req->ai_protocol != 0
+                    && !(tp->protoflag & GAI_PROTO_PROTOANY)
+                    && req->ai_protocol != tp->protocol)))
+       ++tp;
+
+      if (! tp->name[0])
+       {
+         if (req->ai_socktype)
+           return GAIH_OKIFUNSPEC | -EAI_SOCKTYPE;
+         else
+           return GAIH_OKIFUNSPEC | -EAI_SERVICE;
+       }
+    }
+
+  int port = 0;
+  if (service != NULL)
+    {
+      if ((tp->protoflag & GAI_PROTO_NOSERVICE) != 0)
+       return GAIH_OKIFUNSPEC | -EAI_SERVICE;
+
+      if (service->num < 0)
+       {
+         if (tp->name[0])
+           {
+             st = (struct gaih_servtuple *)
+               __alloca (sizeof (struct gaih_servtuple));
+
+             if ((rc = gaih_inet_serv (service->name, tp, req, st)))
+               return rc;
+           }
+         else
+           {
+             struct gaih_servtuple **pst = &st;
+             for (tp++; tp->name[0]; tp++)
+               {
+                 struct gaih_servtuple *newp;
+
+                 if ((tp->protoflag & GAI_PROTO_NOSERVICE) != 0)
+                   continue;
+
+                 if (req->ai_socktype != 0
+                     && req->ai_socktype != tp->socktype)
+                   continue;
+                 if (req->ai_protocol != 0
+                     && !(tp->protoflag & GAI_PROTO_PROTOANY)
+                     && req->ai_protocol != tp->protocol)
+                   continue;
+
+                 newp = (struct gaih_servtuple *)
+                   __alloca (sizeof (struct gaih_servtuple));
+
+                 if ((rc = gaih_inet_serv (service->name, tp, req, newp)))
+                   {
+                     if (rc & GAIH_OKIFUNSPEC)
+                       continue;
+                     return rc;
+                   }
+
+                 *pst = newp;
+                 pst = &(newp->next);
+               }
+             if (st == (struct gaih_servtuple *) &nullserv)
+               return GAIH_OKIFUNSPEC | -EAI_SERVICE;
+           }
+       }
+      else
+       {
+         port = htons (service->num);
+         goto got_port;
+       }
+    }
+  else
+    {
+    got_port:
+
+      if (req->ai_socktype || req->ai_protocol)
+       {
+         st = __alloca (sizeof (struct gaih_servtuple));
+         st->next = NULL;
+         st->socktype = tp->socktype;
+         st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY)
+                         ? req->ai_protocol : tp->protocol);
+         st->port = port;
+       }
+      else
+       {
+         /* Neither socket type nor protocol is set.  Return all socket types
+            we know about.  */
+         struct gaih_servtuple **lastp = &st;
+         for (++tp; tp->name[0]; ++tp)
+           if (tp->defaultflag)
+             {
+               struct gaih_servtuple *newp;
+
+               newp = __alloca (sizeof (struct gaih_servtuple));
+               newp->next = NULL;
+               newp->socktype = tp->socktype;
+               newp->protocol = tp->protocol;
+               newp->port = port;
+
+               *lastp = newp;
+               lastp = &newp->next;
+             }
+       }
+    }
+
+  if (name != NULL)
+    {
+      at = __alloca (sizeof (struct gaih_addrtuple));
+
+      at->family = AF_UNSPEC;
+      at->scopeid = 0;
+      at->next = NULL;
+
+#ifdef HAVE_LIBIDN
+      if (req->ai_flags & AI_IDN)
+       {
+         int idn_flags = 0;
+         if (req->ai_flags & AI_IDN_ALLOW_UNASSIGNED)
+           idn_flags |= IDNA_ALLOW_UNASSIGNED;
+         if (req->ai_flags & AI_IDN_USE_STD3_ASCII_RULES)
+           idn_flags |= IDNA_USE_STD3_ASCII_RULES;
+
+         char *p = NULL;
+         rc = __idna_to_ascii_lz (name, &p, idn_flags);
+         if (rc != IDNA_SUCCESS)
+           {
+             if (rc == IDNA_MALLOC_ERROR)
+               return -EAI_MEMORY;
+             if (rc == IDNA_DLOPEN_ERROR)
+               return -EAI_SYSTEM;
+             return -EAI_IDN_ENCODE;
+           }
+         /* In case the output string is the same as the input string
+            no new string has been allocated.  */
+         if (p != name)
+           {
+             name = strdupa (p);
+             free (p);
+           }
+       }
+#endif
+
+      if (__inet_aton (name, (struct in_addr *) at->addr) != 0)
+       {
+         if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET)
+           at->family = AF_INET;
+         else if (req->ai_family == AF_INET6 && (req->ai_flags & AI_V4MAPPED))
+           {
+             at->addr[3] = at->addr[0];
+             at->addr[2] = htonl (0xffff);
+             at->addr[1] = 0;
+             at->addr[0] = 0;
+             at->family = AF_INET6;
+           }
+         else
+           return -EAI_ADDRFAMILY;
+
+         if (req->ai_flags & AI_CANONNAME)
+           canon = name;
+       }
+      else if (at->family == AF_UNSPEC)
+       {
+         char *namebuf = (char *) name;
+         char *scope_delim = strchr (name, SCOPE_DELIMITER);
+
+         if (__builtin_expect (scope_delim != NULL, 0))
+           {
+             namebuf = alloca (scope_delim - name + 1);
+             *((char *) __mempcpy (namebuf, name, scope_delim - name)) = '\0';
+           }
+
+         if (inet_pton (AF_INET6, namebuf, at->addr) > 0)
+           {
+             if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET6)
+               at->family = AF_INET6;
+             else if (req->ai_family == AF_INET
+                      && IN6_IS_ADDR_V4MAPPED (at->addr))
+               {
+                 at->addr[0] = at->addr[3];
+                 at->family = AF_INET;
+               }
+             else
+               return -EAI_ADDRFAMILY;
+
+             if (scope_delim != NULL)
+               {
+                 int try_numericscope = 0;
+                 if (IN6_IS_ADDR_LINKLOCAL (at->addr)
+                     || IN6_IS_ADDR_MC_LINKLOCAL (at->addr))
+                   {
+                     at->scopeid = if_nametoindex (scope_delim + 1);
+                     if (at->scopeid == 0)
+                       try_numericscope = 1;
+                   }
+                 else
+                   try_numericscope = 1;
+
+                 if (try_numericscope != 0)
+                   {
+                     char *end;
+                     assert (sizeof (uint32_t) <= sizeof (unsigned long));
+                     at->scopeid = (uint32_t) strtoul (scope_delim + 1, &end,
+                                                       10);
+                     if (*end != '\0')
+                       return GAIH_OKIFUNSPEC | -EAI_NONAME;
+                   }
+               }
+
+             if (req->ai_flags & AI_CANONNAME)
+               canon = name;
+           }
+       }
+
+      if (at->family == AF_UNSPEC && (req->ai_flags & AI_NUMERICHOST) == 0)
+       {
+         struct gaih_addrtuple **pat = &at;
+         int no_data = 0;
+         int no_inet6_data = 0;
+         service_user *nip = NULL;
+         enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
+         enum nss_status status = NSS_STATUS_UNAVAIL;
+         int no_more;
+         int old_res_options;
+
+         /* If we do not have to look for IPv4 and IPv6 together, use
+            the simple, old functions.  */
+         if (req->ai_family == AF_INET
+             || (req->ai_family == AF_INET6
+                 && ((req->ai_flags & AI_V4MAPPED) == 0
+                     || (req->ai_flags & AI_ALL) == 0)))
+           {
+             int family = req->ai_family;
+             size_t tmpbuflen = 512;
+             char *tmpbuf = alloca (tmpbuflen);
+             int rc;
+             struct hostent th;
+             struct hostent *h;
+             int herrno;
+
+           simple_again:
+             while (1)
+               {
+                 rc = __gethostbyname2_r (name, family, &th, tmpbuf,
+                                          tmpbuflen, &h, &herrno);
+                 if (rc != ERANGE || herrno != NETDB_INTERNAL)
+                   break;
+                 tmpbuf = extend_alloca (tmpbuf, tmpbuflen, 2 * tmpbuflen);
+               }
+
+             if (rc == 0)
+               {
+                 if (h == NULL)
+                   {
+                     if (req->ai_family == AF_INET6
+                         && (req->ai_flags & AI_V4MAPPED)
+                         && family == AF_INET6)
+                       {
+                         /* Try again, this time looking for IPv4
+                            addresses.  */
+                         family = AF_INET;
+                         goto simple_again;
+                       }
+                   }
+                 else
+                   {
+                     /* We found data, now convert it into the list.  */
+                     for (int i = 0; h->h_addr_list[i]; ++i)
+                       {
+                         if (*pat == NULL)
+                           {
+                             *pat = __alloca (sizeof (struct gaih_addrtuple));
+                             (*pat)->scopeid = 0;
+                           }
+                         (*pat)->next = NULL;
+                         (*pat)->family = req->ai_family;
+                         if (family == req->ai_family)
+                           memcpy ((*pat)->addr, h->h_addr_list[i],
+                                   h->h_length);
+                         else
+                           {
+                             uint32_t *addr = (uint32_t *) (*pat)->addr;
+                             addr[3] = *(uint32_t *) h->h_addr_list[i];
+                             addr[2] = htonl (0xffff);
+                             addr[1] = 0;
+                             addr[0] = 0;
+                           }
+                         pat = &((*pat)->next);
+                       }
+                   }
+               }
+             else
+               {
+                 if (herrno == NETDB_INTERNAL)
+                   {
+                     __set_h_errno (herrno);
+                     return -EAI_SYSTEM;
+                   }
+                 if (herrno == TRY_AGAIN)
+                   {
+                     return -EAI_AGAIN;
+                   }
+                 /* We made requests but they turned out no data.
+                    The name is known, though.  */
+                 return GAIH_OKIFUNSPEC | -EAI_NODATA;
+               }
+
+             goto process_list;
+           }
+
+#ifdef USE_NSCD
+         if (__nss_not_use_nscd_hosts > 0
+             && ++__nss_not_use_nscd_hosts > NSS_NSCD_RETRY)
+           __nss_not_use_nscd_hosts = 0;
+
+         if (!__nss_not_use_nscd_hosts)
+           {
+             /* Try to use nscd.  */
+             struct nscd_ai_result *air = NULL;
+             int herrno;
+             int err = __nscd_getai (name, &air, &herrno);
+             if (air != NULL)
+               {
+                 /* Transform into gaih_addrtuple list.  */
+                 bool added_canon = (req->ai_flags & AI_CANONNAME) == 0;
+                 char *addrs = air->addrs;
+
+                 for (int i = 0; i < air->naddrs; ++i)
+                   {
+                     socklen_t size = (air->family[i] == AF_INET
+                                       ? INADDRSZ : IN6ADDRSZ);
+                     if (*pat == NULL)
+                       {
+                         *pat = __alloca (sizeof (struct gaih_addrtuple));
+                         (*pat)->scopeid = 0;
+                       }
+                     uint32_t *pataddr = (*pat)->addr;
+                     (*pat)->next = NULL;
+                     if (added_canon || air->canon == NULL)
+                       (*pat)->name = NULL;
+                     else
+                       canon = (*pat)->name = strdupa (air->canon);
+
+                     if (air->family[i] == AF_INET
+                         && req->ai_family == AF_INET6
+                         && (req->ai_flags & AI_V4MAPPED))
+                       {
+                         (*pat)->family = AF_INET6;
+                         pataddr[3] = *(uint32_t *) addrs;
+                         pataddr[2] = htonl (0xffff);
+                         pataddr[1] = 0;
+                         pataddr[0] = 0;
+                         pat = &((*pat)->next);
+                         added_canon = true;
+                       }
+                     else if (req->ai_family == AF_UNSPEC
+                              || air->family[i] == req->ai_family)
+                       {
+                         (*pat)->family = air->family[i];
+                         memcpy (pataddr, addrs, size);
+                         pat = &((*pat)->next);
+                         added_canon = true;
+                         if (air->family[i] == AF_INET6)
+                           got_ipv6 = true;
+                       }
+                     addrs += size;
+                   }
+
+                 free (air);
+
+                 if (at->family == AF_UNSPEC)
+                   return GAIH_OKIFUNSPEC | -EAI_NONAME;
+
+                 goto process_list;
+               }
+             else if (err == 0)
+               /* The database contains a negative entry.  */
+               return 0;
+             else if (__nss_not_use_nscd_hosts == 0)
+               {
+                 if (herrno == NETDB_INTERNAL && errno == ENOMEM)
+                   return -EAI_MEMORY;
+                 if (herrno == TRY_AGAIN)
+                   return -EAI_AGAIN;
+                 return -EAI_SYSTEM;
+               }
+           }
+#endif
+
+         if (__nss_hosts_database != NULL)
+           {
+             no_more = 0;
+             nip = __nss_hosts_database;
+           }
+         else
+           no_more = __nss_database_lookup ("hosts", NULL,
+                                            "dns [!UNAVAIL=return] files",
+                                            &nip);
+
+         /* Initialize configurations.  */
+         if (__builtin_expect (!_res_hconf.initialized, 0))
+           _res_hconf_init ();
+         if (__res_maybe_init (&_res, 0) == -1)
+           no_more = 1;
+
+         /* If we are looking for both IPv4 and IPv6 address we don't
+            want the lookup functions to automatically promote IPv4
+            addresses to IPv6 addresses.  Currently this is decided
+            by setting the RES_USE_INET6 bit in _res.options.  */
+         old_res_options = _res.options;
+         _res.options &= ~RES_USE_INET6;
+
+         size_t tmpbuflen = 1024;
+         char *tmpbuf = alloca (tmpbuflen);
+
+         while (!no_more)
+           {
+             nss_gethostbyname4_r fct4
+               = __nss_lookup_function (nip, "gethostbyname4_r");
+             if (fct4 != NULL)
+               {
+                 int herrno;
+
+                 while (1)
+                   {
+                     rc = 0;
+                     status = DL_CALL_FCT (fct4, (name, pat, tmpbuf,
+                                                  tmpbuflen, &rc, &herrno,
+                                                  NULL));
+                     if (status == NSS_STATUS_SUCCESS)
+                       break;
+                     if (status != NSS_STATUS_TRYAGAIN
+                         || rc != ERANGE || herrno != NETDB_INTERNAL)
+                       {
+                         if (herrno == NETDB_INTERNAL)
+                           {
+                             __set_h_errno (herrno);
+                             _res.options = old_res_options;
+                             return -EAI_SYSTEM;
+                           }
+                         if (herrno == TRY_AGAIN)
+                           no_data = EAI_AGAIN;
+                         else
+                           no_data = herrno == NO_DATA;
+                         break;
+                       }
+                     tmpbuf = extend_alloca (tmpbuf,
+                                             tmpbuflen, 2 * tmpbuflen);
+                   }
+
+                 no_inet6_data = no_data;
+
+                 if (status == NSS_STATUS_SUCCESS)
+                   {
+                     if ((req->ai_flags & AI_CANONNAME) != 0 && canon == NULL)
+                       canon = (*pat)->name;
+
+                     while (*pat != NULL)
+                       pat = &((*pat)->next);
+                   }
+               }
+             else
+               {
+                 nss_gethostbyname3_r fct = NULL;
+                 if (req->ai_flags & AI_CANONNAME)
+                   /* No need to use this function if we do not look for
+                      the canonical name.  The function does not exist in
+                      all NSS modules and therefore the lookup would
+                      often fail.  */
+                   fct = __nss_lookup_function (nip, "gethostbyname3_r");
+                 if (fct == NULL)
+                   /* We are cheating here.  The gethostbyname2_r
+                      function does not have the same interface as
+                      gethostbyname3_r but the extra arguments the
+                      latter takes are added at the end.  So the
+                      gethostbyname2_r code will just ignore them.  */
+                   fct = __nss_lookup_function (nip, "gethostbyname2_r");
+
+                 if (fct != NULL)
+                   {
+                     if (req->ai_family == AF_INET6
+                         || req->ai_family == AF_UNSPEC)
+                       {
+                         gethosts (AF_INET6, struct in6_addr);
+                         no_inet6_data = no_data;
+                         inet6_status = status;
+                       }
+                     if (req->ai_family == AF_INET
+                         || req->ai_family == AF_UNSPEC
+                         || (req->ai_family == AF_INET6
+                             && (req->ai_flags & AI_V4MAPPED)
+                             /* Avoid generating the mapped addresses if we
+                                know we are not going to need them.  */
+                             && ((req->ai_flags & AI_ALL) || !got_ipv6)))
+                       {
+                         gethosts (AF_INET, struct in_addr);
+
+                         if (req->ai_family == AF_INET)
+                           {
+                             no_inet6_data = no_data;
+                             inet6_status = status;
+                           }
+                       }
+
+                     /* If we found one address for AF_INET or AF_INET6,
+                        don't continue the search.  */
+                     if (inet6_status == NSS_STATUS_SUCCESS
+                         || status == NSS_STATUS_SUCCESS)
+                       {
+                         if ((req->ai_flags & AI_CANONNAME) != 0
+                             && canon == NULL)
+                           {
+                             /* If we need the canonical name, get it
+                                from the same service as the result.  */
+                             nss_getcanonname_r cfct;
+                             int herrno;
+
+                             cfct = __nss_lookup_function (nip,
+                                                           "getcanonname_r");
+                             if (cfct != NULL)
+                               {
+                                 const size_t max_fqdn_len = 256;
+                                 char *buf = alloca (max_fqdn_len);
+                                 char *s;
+
+                                 if (DL_CALL_FCT (cfct, (at->name ?: name,
+                                                         buf, max_fqdn_len,
+                                                         &s, &rc, &herrno))
+                                     == NSS_STATUS_SUCCESS)
+                                   canon = s;