├── .gitignore ├── COPYRIGHT ├── INSTALL ├── Makefile ├── README ├── README.md ├── VERSION ├── WHATSNEW ├── arch ├── aarch64 │ ├── atomic_arch.h │ ├── bits │ │ ├── alltypes.h.in │ │ ├── endian.h │ │ ├── fcntl.h │ │ ├── fenv.h │ │ ├── float.h │ │ ├── hwcap.h │ │ ├── ipc.h │ │ ├── limits.h │ │ ├── msg.h │ │ ├── posix.h │ │ ├── reg.h │ │ ├── sem.h │ │ ├── setjmp.h │ │ ├── shm.h │ │ ├── signal.h │ │ ├── socket.h │ │ ├── stat.h │ │ ├── stdint.h │ │ ├── syscall.h.in │ │ └── user.h │ ├── crt_arch.h │ ├── pthread_arch.h │ ├── reloc.h │ └── syscall_arch.h ├── arm │ ├── atomic_arch.h │ ├── bits │ │ ├── alltypes.h.in │ │ ├── endian.h │ │ ├── fcntl.h │ │ ├── fenv.h │ │ ├── float.h │ │ ├── hwcap.h │ │ ├── ioctl_fix.h │ │ ├── limits.h │ │ ├── posix.h │ │ ├── reg.h │ │ ├── setjmp.h │ │ ├── signal.h │ │ ├── stat.h │ │ ├── stdint.h │ │ ├── syscall.h.in │ │ └── user.h │ ├── crt_arch.h │ ├── pthread_arch.h │ ├── reloc.h │ └── syscall_arch.h ├── generic │ └── bits │ │ ├── errno.h │ │ ├── fcntl.h │ │ ├── fenv.h │ │ ├── hwcap.h │ │ ├── io.h │ │ ├── ioctl.h │ │ ├── ioctl_fix.h │ │ ├── ipc.h │ │ ├── link.h │ │ ├── mman.h │ │ ├── msg.h │ │ ├── poll.h │ │ ├── resource.h │ │ ├── sem.h │ │ ├── shm.h │ │ ├── socket.h │ │ ├── statfs.h │ │ └── termios.h ├── i386 │ ├── atomic_arch.h │ ├── bits │ │ ├── alltypes.h.in │ │ ├── endian.h │ │ ├── fenv.h │ │ ├── float.h │ │ ├── io.h │ │ ├── limits.h │ │ ├── mman.h │ │ ├── posix.h │ │ ├── reg.h │ │ ├── setjmp.h │ │ ├── signal.h │ │ ├── stat.h │ │ ├── stdint.h │ │ ├── syscall.h.in │ │ └── user.h │ ├── crt_arch.h │ ├── pthread_arch.h │ ├── reloc.h │ └── syscall_arch.h ├── m68k │ ├── atomic_arch.h │ ├── bits │ │ ├── alltypes.h.in │ │ ├── endian.h │ │ ├── fcntl.h │ │ ├── fenv.h │ │ ├── float.h │ │ ├── limits.h │ │ ├── posix.h │ │ ├── setjmp.h │ │ ├── signal.h │ │ ├── stat.h │ │ ├── stdint.h │ │ └── syscall.h.in │ ├── crt_arch.h │ ├── pthread_arch.h │ ├── reloc.h │ └── syscall_arch.h ├── microblaze │ ├── atomic_arch.h │ ├── bits │ │ ├── alltypes.h.in │ │ ├── endian.h │ │ ├── float.h │ │ ├── limits.h │ │ ├── posix.h │ │ ├── reg.h │ │ ├── setjmp.h │ │ ├── signal.h │ │ ├── stat.h │ │ ├── stdint.h │ │ ├── syscall.h.in │ │ └── user.h │ ├── crt_arch.h │ ├── pthread_arch.h │ ├── reloc.h │ └── syscall_arch.h ├── mips │ ├── atomic_arch.h │ ├── bits │ │ ├── alltypes.h.in │ │ ├── endian.h │ │ ├── errno.h │ │ ├── fcntl.h │ │ ├── fenv.h │ │ ├── float.h │ │ ├── hwcap.h │ │ ├── ioctl.h │ │ ├── limits.h │ │ ├── mman.h │ │ ├── msg.h │ │ ├── poll.h │ │ ├── posix.h │ │ ├── reg.h │ │ ├── resource.h │ │ ├── sem.h │ │ ├── setjmp.h │ │ ├── shm.h │ │ ├── signal.h │ │ ├── socket.h │ │ ├── stat.h │ │ ├── statfs.h │ │ ├── stdint.h │ │ ├── syscall.h.in │ │ ├── termios.h │ │ └── user.h │ ├── crt_arch.h │ ├── ksigaction.h │ ├── pthread_arch.h │ ├── reloc.h │ └── syscall_arch.h ├── mips64 │ ├── atomic_arch.h │ ├── bits │ │ ├── alltypes.h.in │ │ ├── endian.h │ │ ├── errno.h │ │ ├── fcntl.h │ │ ├── fenv.h │ │ ├── float.h │ │ ├── hwcap.h │ │ ├── ioctl.h │ │ ├── ipc.h │ │ ├── limits.h │ │ ├── mman.h │ │ ├── msg.h │ │ ├── poll.h │ │ ├── posix.h │ │ ├── reg.h │ │ ├── resource.h │ │ ├── sem.h │ │ ├── setjmp.h │ │ ├── shm.h │ │ ├── signal.h │ │ ├── socket.h │ │ ├── stat.h │ │ ├── statfs.h │ │ ├── stdint.h │ │ ├── syscall.h.in │ │ ├── termios.h │ │ └── user.h │ ├── crt_arch.h │ ├── ksigaction.h │ ├── pthread_arch.h │ ├── reloc.h │ └── syscall_arch.h ├── mipsn32 │ ├── atomic_arch.h │ ├── bits │ │ ├── alltypes.h.in │ │ ├── endian.h │ │ ├── errno.h │ │ ├── fcntl.h │ │ ├── fenv.h │ │ ├── float.h │ │ ├── hwcap.h │ │ ├── ioctl.h │ │ ├── limits.h │ │ ├── mman.h │ │ ├── msg.h │ │ ├── poll.h │ │ ├── posix.h │ │ ├── reg.h │ │ ├── resource.h │ │ ├── sem.h │ │ ├── setjmp.h │ │ ├── shm.h │ │ ├── signal.h │ │ ├── socket.h │ │ ├── stat.h │ │ ├── statfs.h │ │ ├── stdint.h │ │ ├── syscall.h.in │ │ ├── termios.h │ │ └── user.h │ ├── crt_arch.h │ ├── ksigaction.h │ ├── pthread_arch.h │ ├── reloc.h │ └── syscall_arch.h ├── or1k │ ├── atomic_arch.h │ ├── bits │ │ ├── alltypes.h.in │ │ ├── endian.h │ │ ├── float.h │ │ ├── ipc.h │ │ ├── limits.h │ │ ├── msg.h │ │ ├── posix.h │ │ ├── reg.h │ │ ├── setjmp.h │ │ ├── signal.h │ │ ├── stat.h │ │ ├── stdint.h │ │ ├── syscall.h.in │ │ └── user.h │ ├── crt_arch.h │ ├── pthread_arch.h │ ├── reloc.h │ └── syscall_arch.h ├── powerpc │ ├── atomic_arch.h │ ├── bits │ │ ├── alltypes.h.in │ │ ├── endian.h │ │ ├── errno.h │ │ ├── fcntl.h │ │ ├── fenv.h │ │ ├── float.h │ │ ├── hwcap.h │ │ ├── ioctl.h │ │ ├── ipc.h │ │ ├── limits.h │ │ ├── mman.h │ │ ├── msg.h │ │ ├── posix.h │ │ ├── reg.h │ │ ├── sem.h │ │ ├── setjmp.h │ │ ├── shm.h │ │ ├── signal.h │ │ ├── socket.h │ │ ├── stat.h │ │ ├── stdint.h │ │ ├── syscall.h.in │ │ ├── termios.h │ │ └── user.h │ ├── crt_arch.h │ ├── pthread_arch.h │ ├── reloc.h │ └── syscall_arch.h ├── powerpc64 │ ├── atomic_arch.h │ ├── bits │ │ ├── alltypes.h.in │ │ ├── endian.h │ │ ├── errno.h │ │ ├── fcntl.h │ │ ├── fenv.h │ │ ├── float.h │ │ ├── hwcap.h │ │ ├── ioctl.h │ │ ├── ipc.h │ │ ├── limits.h │ │ ├── mman.h │ │ ├── msg.h │ │ ├── posix.h │ │ ├── reg.h │ │ ├── sem.h │ │ ├── setjmp.h │ │ ├── shm.h │ │ ├── signal.h │ │ ├── socket.h │ │ ├── stat.h │ │ ├── stdint.h │ │ ├── syscall.h.in │ │ ├── termios.h │ │ └── user.h │ ├── crt_arch.h │ ├── pthread_arch.h │ ├── reloc.h │ └── syscall_arch.h ├── s390x │ ├── atomic_arch.h │ ├── bits │ │ ├── alltypes.h.in │ │ ├── endian.h │ │ ├── fcntl.h │ │ ├── fenv.h │ │ ├── float.h │ │ ├── hwcap.h │ │ ├── ioctl_fix.h │ │ ├── ipc.h │ │ ├── limits.h │ │ ├── link.h │ │ ├── msg.h │ │ ├── posix.h │ │ ├── reg.h │ │ ├── sem.h │ │ ├── setjmp.h │ │ ├── shm.h │ │ ├── signal.h │ │ ├── socket.h │ │ ├── stat.h │ │ ├── statfs.h │ │ ├── stdint.h │ │ ├── syscall.h.in │ │ └── user.h │ ├── crt_arch.h │ ├── pthread_arch.h │ ├── reloc.h │ └── syscall_arch.h ├── sh │ ├── atomic_arch.h │ ├── bits │ │ ├── alltypes.h.in │ │ ├── endian.h │ │ ├── fenv.h │ │ ├── float.h │ │ ├── hwcap.h │ │ ├── ioctl.h │ │ ├── limits.h │ │ ├── posix.h │ │ ├── setjmp.h │ │ ├── shm.h │ │ ├── signal.h │ │ ├── stat.h │ │ ├── stdint.h │ │ ├── syscall.h.in │ │ └── user.h │ ├── crt_arch.h │ ├── ksigaction.h │ ├── pthread_arch.h │ ├── reloc.h │ └── syscall_arch.h ├── wasm32 │ ├── atomic_arch.h │ ├── bits │ │ ├── alltypes.h.in │ │ ├── endian.h │ │ ├── errno.h │ │ ├── fcntl.h │ │ ├── fenv.h │ │ ├── float.h │ │ ├── ioctl.h │ │ ├── ipc.h │ │ ├── limits.h │ │ ├── msg.h │ │ ├── posix.h │ │ ├── reg.h │ │ ├── sem.h │ │ ├── setjmp.h │ │ ├── shm.h │ │ ├── signal.h │ │ ├── socket.h │ │ ├── stat.h │ │ ├── statfs.h │ │ ├── stdarg.h │ │ ├── stdint.h │ │ ├── syscall.h.in │ │ ├── termios.h │ │ └── user.h │ ├── crt_arch.h │ ├── libc.imports │ ├── pthread_arch.h │ ├── reloc.h │ ├── syscall_arch.h │ └── wasm.js ├── x32 │ ├── atomic_arch.h │ ├── bits │ │ ├── alltypes.h.in │ │ ├── endian.h │ │ ├── fcntl.h │ │ ├── fenv.h │ │ ├── float.h │ │ ├── io.h │ │ ├── ipc.h │ │ ├── limits.h │ │ ├── mman.h │ │ ├── msg.h │ │ ├── posix.h │ │ ├── reg.h │ │ ├── setjmp.h │ │ ├── shm.h │ │ ├── signal.h │ │ ├── socket.h │ │ ├── stat.h │ │ ├── statfs.h │ │ ├── stdint.h │ │ ├── syscall.h.in │ │ └── user.h │ ├── crt_arch.h │ ├── ksigaction.h │ ├── pthread_arch.h │ ├── reloc.h │ └── syscall_arch.h └── x86_64 │ ├── atomic_arch.h │ ├── bits │ ├── alltypes.h.in │ ├── endian.h │ ├── fcntl.h │ ├── fenv.h │ ├── float.h │ ├── io.h │ ├── ipc.h │ ├── limits.h │ ├── mman.h │ ├── msg.h │ ├── posix.h │ ├── reg.h │ ├── setjmp.h │ ├── shm.h │ ├── signal.h │ ├── socket.h │ ├── stat.h │ ├── stdint.h │ ├── syscall.h.in │ └── user.h │ ├── crt_arch.h │ ├── ksigaction.h │ ├── pthread_arch.h │ ├── reloc.h │ └── syscall_arch.h ├── configure ├── crt ├── Scrt1.c ├── aarch64 │ ├── crti.s │ └── crtn.s ├── arm │ ├── crti.s │ └── crtn.s ├── crt1.c ├── crti.c ├── crtn.c ├── i386 │ ├── crti.s │ └── crtn.s ├── microblaze │ ├── crti.s │ └── crtn.s ├── mips │ ├── crti.s │ └── crtn.s ├── mips64 │ ├── crti.s │ └── crtn.s ├── mipsn32 │ ├── crti.s │ └── crtn.s ├── or1k │ ├── crti.s │ └── crtn.s ├── powerpc │ ├── crti.s │ └── crtn.s ├── powerpc64 │ ├── crti.s │ └── crtn.s ├── rcrt1.c ├── s390x │ ├── crti.s │ └── crtn.s ├── sh │ ├── crti.s │ └── crtn.s ├── x32 │ ├── crti.s │ └── crtn.s └── x86_64 │ ├── crti.s │ └── crtn.s ├── dist └── config.mak ├── dynamic.list ├── include ├── aio.h ├── alloca.h ├── alltypes.h.in ├── ar.h ├── arpa │ ├── ftp.h │ ├── inet.h │ ├── nameser.h │ ├── nameser_compat.h │ ├── telnet.h │ └── tftp.h ├── assert.h ├── byteswap.h ├── complex.h ├── cpio.h ├── crypt.h ├── ctype.h ├── dirent.h ├── dlfcn.h ├── elf.h ├── endian.h ├── err.h ├── errno.h ├── fcntl.h ├── features.h ├── fenv.h ├── float.h ├── fmtmsg.h ├── fnmatch.h ├── ftw.h ├── getopt.h ├── glob.h ├── grp.h ├── iconv.h ├── ifaddrs.h ├── inttypes.h ├── iso646.h ├── langinfo.h ├── lastlog.h ├── libgen.h ├── libintl.h ├── limits.h ├── link.h ├── locale.h ├── malloc.h ├── math.h ├── memory.h ├── mntent.h ├── monetary.h ├── mqueue.h ├── net │ ├── ethernet.h │ ├── if.h │ ├── if_arp.h │ └── route.h ├── netdb.h ├── netinet │ ├── ether.h │ ├── icmp6.h │ ├── if_ether.h │ ├── igmp.h │ ├── in.h │ ├── in_systm.h │ ├── ip.h │ ├── ip6.h │ ├── ip_icmp.h │ ├── tcp.h │ └── udp.h ├── netpacket │ └── packet.h ├── nl_types.h ├── paths.h ├── poll.h ├── pthread.h ├── pty.h ├── pwd.h ├── regex.h ├── resolv.h ├── sched.h ├── scsi │ ├── scsi.h │ ├── scsi_ioctl.h │ └── sg.h ├── search.h ├── semaphore.h ├── setjmp.h ├── shadow.h ├── signal.h ├── spawn.h ├── stdalign.h ├── stdarg.h ├── stdbool.h ├── stdc-predef.h ├── stddef.h ├── stdint.h ├── stdio.h ├── stdio_ext.h ├── stdlib.h ├── stdnoreturn.h ├── string.h ├── strings.h ├── stropts.h ├── sys │ ├── acct.h │ ├── auxv.h │ ├── cachectl.h │ ├── dir.h │ ├── epoll.h │ ├── errno.h │ ├── eventfd.h │ ├── fanotify.h │ ├── fcntl.h │ ├── file.h │ ├── fsuid.h │ ├── inotify.h │ ├── io.h │ ├── ioctl.h │ ├── ipc.h │ ├── kd.h │ ├── klog.h │ ├── mman.h │ ├── mount.h │ ├── msg.h │ ├── mtio.h │ ├── param.h │ ├── personality.h │ ├── poll.h │ ├── prctl.h │ ├── procfs.h │ ├── ptrace.h │ ├── quota.h │ ├── random.h │ ├── reboot.h │ ├── reg.h │ ├── resource.h │ ├── select.h │ ├── sem.h │ ├── sendfile.h │ ├── shm.h │ ├── signal.h │ ├── signalfd.h │ ├── socket.h │ ├── soundcard.h │ ├── stat.h │ ├── statfs.h │ ├── statvfs.h │ ├── stropts.h │ ├── swap.h │ ├── syscall.h │ ├── sysinfo.h │ ├── syslog.h │ ├── sysmacros.h │ ├── termios.h │ ├── time.h │ ├── timeb.h │ ├── timerfd.h │ ├── times.h │ ├── timex.h │ ├── ttydefaults.h │ ├── types.h │ ├── ucontext.h │ ├── uio.h │ ├── un.h │ ├── user.h │ ├── utsname.h │ ├── vfs.h │ ├── vt.h │ ├── wait.h │ └── xattr.h ├── syscall.h ├── sysexits.h ├── syslog.h ├── tar.h ├── termios.h ├── tgmath.h ├── threads.h ├── time.h ├── uchar.h ├── ucontext.h ├── ulimit.h ├── unistd.h ├── utime.h ├── utmp.h ├── utmpx.h ├── values.h ├── wait.h ├── wchar.h ├── wctype.h └── wordexp.h ├── ldso ├── dlstart.c └── dynlink.c ├── libc.py ├── src ├── aio │ ├── aio.c │ ├── aio_suspend.c │ └── lio_listio.c ├── complex │ ├── __cexp.c │ ├── __cexpf.c │ ├── cabs.c │ ├── cabsf.c │ ├── cabsl.c │ ├── cacos.c │ ├── cacosf.c │ ├── cacosh.c │ ├── cacoshf.c │ ├── cacoshl.c │ ├── cacosl.c │ ├── carg.c │ ├── cargf.c │ ├── cargl.c │ ├── casin.c │ ├── casinf.c │ ├── casinh.c │ ├── casinhf.c │ ├── casinhl.c │ ├── casinl.c │ ├── catan.c │ ├── catanf.c │ ├── catanh.c │ ├── catanhf.c │ ├── catanhl.c │ ├── catanl.c │ ├── ccos.c │ ├── ccosf.c │ ├── ccosh.c │ ├── ccoshf.c │ ├── ccoshl.c │ ├── ccosl.c │ ├── cexp.c │ ├── cexpf.c │ ├── cexpl.c │ ├── cimag.c │ ├── cimagf.c │ ├── cimagl.c │ ├── clog.c │ ├── clogf.c │ ├── clogl.c │ ├── conj.c │ ├── conjf.c │ ├── conjl.c │ ├── cpow.c │ ├── cpowf.c │ ├── cpowl.c │ ├── cproj.c │ ├── cprojf.c │ ├── cprojl.c │ ├── creal.c │ ├── crealf.c │ ├── creall.c │ ├── csin.c │ ├── csinf.c │ ├── csinh.c │ ├── csinhf.c │ ├── csinhl.c │ ├── csinl.c │ ├── csqrt.c │ ├── csqrtf.c │ ├── csqrtl.c │ ├── ctan.c │ ├── ctanf.c │ ├── ctanh.c │ ├── ctanhf.c │ ├── ctanhl.c │ └── ctanl.c ├── conf │ ├── confstr.c │ ├── fpathconf.c │ ├── legacy.c │ ├── pathconf.c │ └── sysconf.c ├── crypt │ ├── crypt.c │ ├── crypt_blowfish.c │ ├── crypt_des.c │ ├── crypt_md5.c │ ├── crypt_r.c │ ├── crypt_sha256.c │ ├── crypt_sha512.c │ └── encrypt.c ├── ctype │ ├── __ctype_b_loc.c │ ├── __ctype_get_mb_cur_max.c │ ├── __ctype_tolower_loc.c │ ├── __ctype_toupper_loc.c │ ├── alpha.h │ ├── isalnum.c │ ├── isalpha.c │ ├── isascii.c │ ├── isblank.c │ ├── iscntrl.c │ ├── isdigit.c │ ├── isgraph.c │ ├── islower.c │ ├── isprint.c │ ├── ispunct.c │ ├── isspace.c │ ├── isupper.c │ ├── iswalnum.c │ ├── iswalpha.c │ ├── iswblank.c │ ├── iswcntrl.c │ ├── iswctype.c │ ├── iswdigit.c │ ├── iswgraph.c │ ├── iswlower.c │ ├── iswprint.c │ ├── iswpunct.c │ ├── iswspace.c │ ├── iswupper.c │ ├── iswxdigit.c │ ├── isxdigit.c │ ├── nonspacing.h │ ├── punct.h │ ├── toascii.c │ ├── tolower.c │ ├── toupper.c │ ├── towctrans.c │ ├── wcswidth.c │ ├── wctrans.c │ ├── wcwidth.c │ └── wide.h ├── dirent │ ├── __dirent.h │ ├── __getdents.c │ ├── alphasort.c │ ├── closedir.c │ ├── dirfd.c │ ├── fdopendir.c │ ├── opendir.c │ ├── readdir.c │ ├── readdir_r.c │ ├── rewinddir.c │ ├── scandir.c │ ├── seekdir.c │ ├── telldir.c │ └── versionsort.c ├── env │ ├── __environ.c │ ├── __init_tls.c │ ├── __libc_start_main.c │ ├── __reset_tls.c │ ├── __stack_chk_fail.c │ ├── clearenv.c │ ├── getenv.c │ ├── putenv.c │ ├── setenv.c │ └── unsetenv.c ├── errno │ ├── __errno_location.c │ ├── __strerror.h │ └── strerror.c ├── exit │ ├── _Exit.c │ ├── abort.c │ ├── arm │ │ └── __aeabi_atexit.c │ ├── assert.c │ ├── at_quick_exit.c │ ├── atexit.c │ ├── exit.c │ └── quick_exit.c ├── fcntl │ ├── creat.c │ ├── fcntl.c │ ├── open.c │ ├── openat.c │ ├── posix_fadvise.c │ └── posix_fallocate.c ├── fenv │ ├── __flt_rounds.c │ ├── aarch64 │ │ └── fenv.s │ ├── arm │ │ ├── fenv-hf.S │ │ └── fenv.c │ ├── fegetexceptflag.c │ ├── feholdexcept.c │ ├── fenv.c │ ├── fesetexceptflag.c │ ├── fesetround.c │ ├── feupdateenv.c │ ├── i386 │ │ └── fenv.s │ ├── m68k │ │ └── fenv.c │ ├── mips │ │ ├── fenv-sf.c │ │ └── fenv.S │ ├── mips64 │ │ ├── fenv-sf.c │ │ └── fenv.S │ ├── mipsn32 │ │ ├── fenv-sf.c │ │ └── fenv.S │ ├── powerpc │ │ ├── fenv-sf.c │ │ └── fenv.S │ ├── powerpc64 │ │ └── fenv.c │ ├── s390x │ │ └── fenv.c │ ├── sh │ │ ├── fenv-nofpu.c │ │ └── fenv.S │ ├── x32 │ │ └── fenv.s │ └── x86_64 │ │ └── fenv.s ├── internal │ ├── aarch64 │ │ └── syscall.s │ ├── arm │ │ └── syscall.s │ ├── atomic.h │ ├── dynlink.h │ ├── fdpic_crt.h │ ├── floatscan.c │ ├── floatscan.h │ ├── futex.h │ ├── i386 │ │ └── syscall.s │ ├── intscan.c │ ├── intscan.h │ ├── ksigaction.h │ ├── libc.c │ ├── libc.h │ ├── libm.h │ ├── locale_impl.h │ ├── m68k │ │ └── syscall.s │ ├── malloc_impl.h │ ├── microblaze │ │ └── syscall.s │ ├── mips │ │ └── syscall.s │ ├── mips64 │ │ └── syscall.s │ ├── mipsn32 │ │ └── syscall.s │ ├── or1k │ │ └── syscall.s │ ├── powerpc │ │ └── syscall.s │ ├── powerpc64 │ │ └── syscall.s │ ├── procfdname.c │ ├── pthread_impl.h │ ├── s390x │ │ └── syscall.s │ ├── sh │ │ ├── __shcall.c │ │ └── syscall.s │ ├── shgetc.c │ ├── shgetc.h │ ├── stdio_impl.h │ ├── syscall.c │ ├── syscall.h │ ├── syscall_ret.c │ ├── vdso.c │ ├── version.c │ ├── vis.h │ ├── x32 │ │ └── syscall.s │ └── x86_64 │ │ └── syscall.s ├── ipc │ ├── ftok.c │ ├── ipc.h │ ├── msgctl.c │ ├── msgget.c │ ├── msgrcv.c │ ├── msgsnd.c │ ├── semctl.c │ ├── semget.c │ ├── semop.c │ ├── semtimedop.c │ ├── shmat.c │ ├── shmctl.c │ ├── shmdt.c │ └── shmget.c ├── ldso │ ├── __dlsym.c │ ├── aarch64 │ │ ├── dlsym.s │ │ └── tlsdesc.s │ ├── arm │ │ ├── dlsym.s │ │ └── find_exidx.c │ ├── dl_iterate_phdr.c │ ├── dladdr.c │ ├── dlclose.c │ ├── dlerror.c │ ├── dlinfo.c │ ├── dlopen.c │ ├── dlsym.c │ ├── i386 │ │ ├── dlsym.s │ │ └── tlsdesc.s │ ├── m68k │ │ └── dlsym.s │ ├── microblaze │ │ └── dlsym.s │ ├── mips │ │ └── dlsym.s │ ├── mips64 │ │ └── dlsym.s │ ├── mipsn32 │ │ └── dlsym.s │ ├── or1k │ │ └── dlsym.s │ ├── powerpc │ │ └── dlsym.s │ ├── powerpc64 │ │ └── dlsym.s │ ├── s390x │ │ └── dlsym.s │ ├── sh │ │ └── dlsym.s │ ├── tlsdesc.c │ ├── x32 │ │ └── dlsym.s │ └── x86_64 │ │ ├── dlsym.s │ │ └── tlsdesc.s ├── legacy │ ├── cuserid.c │ ├── daemon.c │ ├── err.c │ ├── euidaccess.c │ ├── ftw.c │ ├── futimes.c │ ├── getdtablesize.c │ ├── getloadavg.c │ ├── getpagesize.c │ ├── getpass.c │ ├── getusershell.c │ ├── isastream.c │ ├── lutimes.c │ ├── ulimit.c │ ├── utmpx.c │ └── valloc.c ├── linux │ ├── adjtime.c │ ├── adjtimex.c │ ├── arch_prctl.c │ ├── brk.c │ ├── cache.c │ ├── cap.c │ ├── chroot.c │ ├── clock_adjtime.c │ ├── clone.c │ ├── epoll.c │ ├── eventfd.c │ ├── fallocate.c │ ├── fanotify.c │ ├── flock.c │ ├── getrandom.c │ ├── inotify.c │ ├── ioperm.c │ ├── iopl.c │ ├── klogctl.c │ ├── module.c │ ├── mount.c │ ├── personality.c │ ├── pivot_root.c │ ├── ppoll.c │ ├── prctl.c │ ├── prlimit.c │ ├── process_vm.c │ ├── ptrace.c │ ├── quotactl.c │ ├── readahead.c │ ├── reboot.c │ ├── remap_file_pages.c │ ├── sbrk.c │ ├── sendfile.c │ ├── setfsgid.c │ ├── setfsuid.c │ ├── setgroups.c │ ├── sethostname.c │ ├── setns.c │ ├── settimeofday.c │ ├── signalfd.c │ ├── splice.c │ ├── stime.c │ ├── swap.c │ ├── sync_file_range.c │ ├── syncfs.c │ ├── sysinfo.c │ ├── tee.c │ ├── timerfd.c │ ├── unshare.c │ ├── utimes.c │ ├── vhangup.c │ ├── vmsplice.c │ ├── wait3.c │ ├── wait4.c │ ├── x32 │ │ └── sysinfo.c │ └── xattr.c ├── locale │ ├── __lctrans.c │ ├── __mo_lookup.c │ ├── big5.h │ ├── bind_textdomain_codeset.c │ ├── c_locale.c │ ├── catclose.c │ ├── catgets.c │ ├── catopen.c │ ├── codepages.h │ ├── dcngettext.c │ ├── duplocale.c │ ├── freelocale.c │ ├── gb18030.h │ ├── hkscs.h │ ├── iconv.c │ ├── iconv_close.c │ ├── jis0208.h │ ├── ksc.h │ ├── langinfo.c │ ├── legacychars.h │ ├── locale_map.c │ ├── localeconv.c │ ├── newlocale.c │ ├── pleval.c │ ├── revjis.h │ ├── setlocale.c │ ├── strcoll.c │ ├── strfmon.c │ ├── strxfrm.c │ ├── textdomain.c │ ├── uselocale.c │ ├── wcscoll.c │ └── wcsxfrm.c ├── malloc │ ├── DESIGN │ ├── aligned_alloc.c │ ├── expand_heap.c │ ├── lite_malloc.c │ ├── malloc.c │ ├── malloc_usable_size.c │ ├── memalign.c │ └── posix_memalign.c ├── math │ ├── __cos.c │ ├── __cosdf.c │ ├── __cosl.c │ ├── __expo2.c │ ├── __expo2f.c │ ├── __fpclassify.c │ ├── __fpclassifyf.c │ ├── __fpclassifyl.c │ ├── __invtrigl.c │ ├── __invtrigl.h │ ├── __polevll.c │ ├── __rem_pio2.c │ ├── __rem_pio2_large.c │ ├── __rem_pio2f.c │ ├── __rem_pio2l.c │ ├── __signbit.c │ ├── __signbitf.c │ ├── __signbitl.c │ ├── __sin.c │ ├── __sindf.c │ ├── __sinl.c │ ├── __tan.c │ ├── __tandf.c │ ├── __tanl.c │ ├── aarch64 │ │ ├── ceil.c │ │ ├── ceilf.c │ │ ├── fabs.c │ │ ├── fabsf.c │ │ ├── floor.c │ │ ├── floorf.c │ │ ├── fma.c │ │ ├── fmaf.c │ │ ├── fmax.c │ │ ├── fmaxf.c │ │ ├── fmin.c │ │ ├── fminf.c │ │ ├── llrint.c │ │ ├── llrintf.c │ │ ├── llround.c │ │ ├── llroundf.c │ │ ├── lrint.c │ │ ├── lrintf.c │ │ ├── lround.c │ │ ├── lroundf.c │ │ ├── nearbyint.c │ │ ├── nearbyintf.c │ │ ├── rint.c │ │ ├── rintf.c │ │ ├── round.c │ │ ├── roundf.c │ │ ├── sqrt.c │ │ ├── sqrtf.c │ │ ├── trunc.c │ │ └── truncf.c │ ├── acos.c │ ├── acosf.c │ ├── acosh.c │ ├── acoshf.c │ ├── acoshl.c │ ├── acosl.c │ ├── arm │ │ ├── fabs.c │ │ ├── fabsf.c │ │ ├── sqrt.c │ │ └── sqrtf.c │ ├── asin.c │ ├── asinf.c │ ├── asinh.c │ ├── asinhf.c │ ├── asinhl.c │ ├── asinl.c │ ├── atan.c │ ├── atan2.c │ ├── atan2f.c │ ├── atan2l.c │ ├── atanf.c │ ├── atanh.c │ ├── atanhf.c │ ├── atanhl.c │ ├── atanl.c │ ├── cbrt.c │ ├── cbrtf.c │ ├── cbrtl.c │ ├── ceil.c │ ├── ceilf.c │ ├── ceill.c │ ├── copysign.c │ ├── copysignf.c │ ├── copysignl.c │ ├── cos.c │ ├── cosf.c │ ├── cosh.c │ ├── coshf.c │ ├── coshl.c │ ├── cosl.c │ ├── erf.c │ ├── erff.c │ ├── erfl.c │ ├── exp.c │ ├── exp10.c │ ├── exp10f.c │ ├── exp10l.c │ ├── exp2.c │ ├── exp2f.c │ ├── exp2l.c │ ├── expf.c │ ├── expl.c │ ├── expm1.c │ ├── expm1f.c │ ├── expm1l.c │ ├── fabs.c │ ├── fabsf.c │ ├── fabsl.c │ ├── fdim.c │ ├── fdimf.c │ ├── fdiml.c │ ├── finite.c │ ├── finitef.c │ ├── floor.c │ ├── floorf.c │ ├── floorl.c │ ├── fma.c │ ├── fmaf.c │ ├── fmal.c │ ├── fmax.c │ ├── fmaxf.c │ ├── fmaxl.c │ ├── fmin.c │ ├── fminf.c │ ├── fminl.c │ ├── fmod.c │ ├── fmodf.c │ ├── fmodl.c │ ├── frexp.c │ ├── frexpf.c │ ├── frexpl.c │ ├── hypot.c │ ├── hypotf.c │ ├── hypotl.c │ ├── i386 │ │ ├── __invtrigl.s │ │ ├── acos.s │ │ ├── acosf.s │ │ ├── acosl.s │ │ ├── asin.s │ │ ├── asinf.s │ │ ├── asinl.s │ │ ├── atan.s │ │ ├── atan2.s │ │ ├── atan2f.s │ │ ├── atan2l.s │ │ ├── atanf.s │ │ ├── atanl.s │ │ ├── ceil.s │ │ ├── ceilf.s │ │ ├── ceill.s │ │ ├── exp.s │ │ ├── exp2.s │ │ ├── exp2f.s │ │ ├── exp2l.s │ │ ├── expf.s │ │ ├── expl.s │ │ ├── expm1.s │ │ ├── expm1f.s │ │ ├── expm1l.s │ │ ├── fabs.s │ │ ├── fabsf.s │ │ ├── fabsl.s │ │ ├── floor.s │ │ ├── floorf.s │ │ ├── floorl.s │ │ ├── fmod.s │ │ ├── fmodf.s │ │ ├── fmodl.s │ │ ├── hypot.s │ │ ├── hypotf.s │ │ ├── ldexp.s │ │ ├── ldexpf.s │ │ ├── ldexpl.s │ │ ├── llrint.s │ │ ├── llrintf.s │ │ ├── llrintl.s │ │ ├── log.s │ │ ├── log10.s │ │ ├── log10f.s │ │ ├── log10l.s │ │ ├── log1p.s │ │ ├── log1pf.s │ │ ├── log1pl.s │ │ ├── log2.s │ │ ├── log2f.s │ │ ├── log2l.s │ │ ├── logf.s │ │ ├── logl.s │ │ ├── lrint.s │ │ ├── lrintf.s │ │ ├── lrintl.s │ │ ├── remainder.s │ │ ├── remainderf.s │ │ ├── remainderl.s │ │ ├── remquo.s │ │ ├── remquof.s │ │ ├── remquol.s │ │ ├── rint.s │ │ ├── rintf.s │ │ ├── rintl.s │ │ ├── scalbln.s │ │ ├── scalblnf.s │ │ ├── scalblnl.s │ │ ├── scalbn.s │ │ ├── scalbnf.s │ │ ├── scalbnl.s │ │ ├── sqrt.s │ │ ├── sqrtf.s │ │ ├── sqrtl.s │ │ ├── trunc.s │ │ ├── truncf.s │ │ └── truncl.s │ ├── ilogb.c │ ├── ilogbf.c │ ├── ilogbl.c │ ├── j0.c │ ├── j0f.c │ ├── j1.c │ ├── j1f.c │ ├── jn.c │ ├── jnf.c │ ├── ldexp.c │ ├── ldexpf.c │ ├── ldexpl.c │ ├── lgamma.c │ ├── lgamma_r.c │ ├── lgammaf.c │ ├── lgammaf_r.c │ ├── lgammal.c │ ├── llrint.c │ ├── llrintf.c │ ├── llrintl.c │ ├── llround.c │ ├── llroundf.c │ ├── llroundl.c │ ├── log.c │ ├── log10.c │ ├── log10f.c │ ├── log10l.c │ ├── log1p.c │ ├── log1pf.c │ ├── log1pl.c │ ├── log2.c │ ├── log2f.c │ ├── log2l.c │ ├── logb.c │ ├── logbf.c │ ├── logbl.c │ ├── logf.c │ ├── logl.c │ ├── lrint.c │ ├── lrintf.c │ ├── lrintl.c │ ├── lround.c │ ├── lroundf.c │ ├── lroundl.c │ ├── modf.c │ ├── modff.c │ ├── modfl.c │ ├── nan.c │ ├── nanf.c │ ├── nanl.c │ ├── nearbyint.c │ ├── nearbyintf.c │ ├── nearbyintl.c │ ├── nextafter.c │ ├── nextafterf.c │ ├── nextafterl.c │ ├── nexttoward.c │ ├── nexttowardf.c │ ├── nexttowardl.c │ ├── pow.c │ ├── powerpc64 │ │ ├── ceil.c │ │ ├── ceilf.c │ │ ├── fabs.c │ │ ├── fabsf.c │ │ ├── floor.c │ │ ├── floorf.c │ │ ├── fma.c │ │ ├── fmaf.c │ │ ├── fmax.c │ │ ├── fmaxf.c │ │ ├── fmin.c │ │ ├── fminf.c │ │ ├── lrint.c │ │ ├── lrintf.c │ │ ├── lround.c │ │ ├── lroundf.c │ │ ├── round.c │ │ ├── roundf.c │ │ ├── sqrt.c │ │ ├── sqrtf.c │ │ ├── trunc.c │ │ └── truncf.c │ ├── powf.c │ ├── powl.c │ ├── remainder.c │ ├── remainderf.c │ ├── remainderl.c │ ├── remquo.c │ ├── remquof.c │ ├── remquol.c │ ├── rint.c │ ├── rintf.c │ ├── rintl.c │ ├── round.c │ ├── roundf.c │ ├── roundl.c │ ├── s390x │ │ ├── ceil.c │ │ ├── ceilf.c │ │ ├── ceill.c │ │ ├── fabs.c │ │ ├── fabsf.c │ │ ├── fabsl.c │ │ ├── floor.c │ │ ├── floorf.c │ │ ├── floorl.c │ │ ├── nearbyint.c │ │ ├── nearbyintf.c │ │ ├── nearbyintl.c │ │ ├── rint.c │ │ ├── rintf.c │ │ ├── rintl.c │ │ ├── round.c │ │ ├── roundf.c │ │ ├── roundl.c │ │ ├── sqrt.c │ │ ├── sqrtf.c │ │ ├── sqrtl.c │ │ ├── trunc.c │ │ ├── truncf.c │ │ └── truncl.c │ ├── scalb.c │ ├── scalbf.c │ ├── scalbln.c │ ├── scalblnf.c │ ├── scalblnl.c │ ├── scalbn.c │ ├── scalbnf.c │ ├── scalbnl.c │ ├── signgam.c │ ├── significand.c │ ├── significandf.c │ ├── sin.c │ ├── sincos.c │ ├── sincosf.c │ ├── sincosl.c │ ├── sinf.c │ ├── sinh.c │ ├── sinhf.c │ ├── sinhl.c │ ├── sinl.c │ ├── sqrt.c │ ├── sqrtf.c │ ├── sqrtl.c │ ├── tan.c │ ├── tanf.c │ ├── tanh.c │ ├── tanhf.c │ ├── tanhl.c │ ├── tanl.c │ ├── tgamma.c │ ├── tgammaf.c │ ├── tgammal.c │ ├── trunc.c │ ├── truncf.c │ ├── truncl.c │ ├── x32 │ │ ├── __invtrigl.s │ │ ├── acosl.s │ │ ├── asinl.s │ │ ├── atan2l.s │ │ ├── atanl.s │ │ ├── ceill.s │ │ ├── exp2l.s │ │ ├── expl.s │ │ ├── expm1l.s │ │ ├── fabs.s │ │ ├── fabsf.s │ │ ├── fabsl.s │ │ ├── floorl.s │ │ ├── fmodl.s │ │ ├── llrint.s │ │ ├── llrintf.s │ │ ├── llrintl.s │ │ ├── log10l.s │ │ ├── log1pl.s │ │ ├── log2l.s │ │ ├── logl.s │ │ ├── lrint.s │ │ ├── lrintf.s │ │ ├── lrintl.s │ │ ├── remainderl.s │ │ ├── rintl.s │ │ ├── sqrt.s │ │ ├── sqrtf.s │ │ ├── sqrtl.s │ │ └── truncl.s │ └── x86_64 │ │ ├── __invtrigl.s │ │ ├── acosl.s │ │ ├── asinl.s │ │ ├── atan2l.s │ │ ├── atanl.s │ │ ├── ceill.s │ │ ├── exp2l.s │ │ ├── expl.s │ │ ├── expm1l.s │ │ ├── fabs.s │ │ ├── fabsf.s │ │ ├── fabsl.s │ │ ├── floorl.s │ │ ├── fmodl.s │ │ ├── llrint.s │ │ ├── llrintf.s │ │ ├── llrintl.s │ │ ├── log10l.s │ │ ├── log1pl.s │ │ ├── log2l.s │ │ ├── logl.s │ │ ├── lrint.s │ │ ├── lrintf.s │ │ ├── lrintl.s │ │ ├── remainderl.s │ │ ├── rintl.s │ │ ├── sqrt.s │ │ ├── sqrtf.s │ │ ├── sqrtl.s │ │ └── truncl.s ├── misc │ ├── a64l.c │ ├── basename.c │ ├── dirname.c │ ├── ffs.c │ ├── ffsl.c │ ├── ffsll.c │ ├── fmtmsg.c │ ├── forkpty.c │ ├── get_current_dir_name.c │ ├── getauxval.c │ ├── getdomainname.c │ ├── getentropy.c │ ├── gethostid.c │ ├── getopt.c │ ├── getopt_long.c │ ├── getpriority.c │ ├── getresgid.c │ ├── getresuid.c │ ├── getrlimit.c │ ├── getrusage.c │ ├── getsubopt.c │ ├── initgroups.c │ ├── ioctl.c │ ├── issetugid.c │ ├── lockf.c │ ├── login_tty.c │ ├── mntent.c │ ├── nftw.c │ ├── openpty.c │ ├── ptsname.c │ ├── pty.c │ ├── realpath.c │ ├── setdomainname.c │ ├── setpriority.c │ ├── setrlimit.c │ ├── syscall.c │ ├── syslog.c │ ├── uname.c │ └── wordexp.c ├── mman │ ├── madvise.c │ ├── mincore.c │ ├── mlock.c │ ├── mlockall.c │ ├── mmap.c │ ├── mprotect.c │ ├── mremap.c │ ├── msync.c │ ├── munlock.c │ ├── munlockall.c │ ├── munmap.c │ ├── posix_madvise.c │ └── shm_open.c ├── mq │ ├── mq_close.c │ ├── mq_getattr.c │ ├── mq_notify.c │ ├── mq_open.c │ ├── mq_receive.c │ ├── mq_send.c │ ├── mq_setattr.c │ ├── mq_timedreceive.c │ ├── mq_timedsend.c │ └── mq_unlink.c ├── multibyte │ ├── btowc.c │ ├── c16rtomb.c │ ├── c32rtomb.c │ ├── internal.c │ ├── internal.h │ ├── mblen.c │ ├── mbrlen.c │ ├── mbrtoc16.c │ ├── mbrtoc32.c │ ├── mbrtowc.c │ ├── mbsinit.c │ ├── mbsnrtowcs.c │ ├── mbsrtowcs.c │ ├── mbstowcs.c │ ├── mbtowc.c │ ├── wcrtomb.c │ ├── wcsnrtombs.c │ ├── wcsrtombs.c │ ├── wcstombs.c │ ├── wctob.c │ └── wctomb.c ├── network │ ├── accept.c │ ├── accept4.c │ ├── bind.c │ ├── connect.c │ ├── dn_comp.c │ ├── dn_expand.c │ ├── dn_skipname.c │ ├── dns_parse.c │ ├── ent.c │ ├── ether.c │ ├── freeaddrinfo.c │ ├── gai_strerror.c │ ├── getaddrinfo.c │ ├── gethostbyaddr.c │ ├── gethostbyaddr_r.c │ ├── gethostbyname.c │ ├── gethostbyname2.c │ ├── gethostbyname2_r.c │ ├── gethostbyname_r.c │ ├── getifaddrs.c │ ├── getnameinfo.c │ ├── getpeername.c │ ├── getservbyname.c │ ├── getservbyname_r.c │ ├── getservbyport.c │ ├── getservbyport_r.c │ ├── getsockname.c │ ├── getsockopt.c │ ├── h_errno.c │ ├── herror.c │ ├── hstrerror.c │ ├── htonl.c │ ├── htons.c │ ├── if_freenameindex.c │ ├── if_indextoname.c │ ├── if_nameindex.c │ ├── if_nametoindex.c │ ├── in6addr_any.c │ ├── in6addr_loopback.c │ ├── inet_addr.c │ ├── inet_aton.c │ ├── inet_legacy.c │ ├── inet_ntoa.c │ ├── inet_ntop.c │ ├── inet_pton.c │ ├── listen.c │ ├── lookup.h │ ├── lookup_ipliteral.c │ ├── lookup_name.c │ ├── lookup_serv.c │ ├── netlink.c │ ├── netlink.h │ ├── netname.c │ ├── ns_parse.c │ ├── ntohl.c │ ├── ntohs.c │ ├── proto.c │ ├── recv.c │ ├── recvfrom.c │ ├── recvmmsg.c │ ├── recvmsg.c │ ├── res_init.c │ ├── res_mkquery.c │ ├── res_msend.c │ ├── res_query.c │ ├── res_querydomain.c │ ├── res_send.c │ ├── res_state.c │ ├── resolvconf.c │ ├── send.c │ ├── sendmmsg.c │ ├── sendmsg.c │ ├── sendto.c │ ├── serv.c │ ├── setsockopt.c │ ├── shutdown.c │ ├── sockatmark.c │ ├── socket.c │ └── socketpair.c ├── passwd │ ├── fgetgrent.c │ ├── fgetpwent.c │ ├── fgetspent.c │ ├── getgr_a.c │ ├── getgr_r.c │ ├── getgrent.c │ ├── getgrent_a.c │ ├── getgrouplist.c │ ├── getpw_a.c │ ├── getpw_r.c │ ├── getpwent.c │ ├── getpwent_a.c │ ├── getspent.c │ ├── getspnam.c │ ├── getspnam_r.c │ ├── lckpwdf.c │ ├── nscd.h │ ├── nscd_query.c │ ├── putgrent.c │ ├── putpwent.c │ ├── putspent.c │ └── pwf.h ├── prng │ ├── __rand48_step.c │ ├── __seed48.c │ ├── drand48.c │ ├── lcong48.c │ ├── lrand48.c │ ├── mrand48.c │ ├── rand.c │ ├── rand_r.c │ ├── random.c │ ├── seed48.c │ └── srand48.c ├── process │ ├── execl.c │ ├── execle.c │ ├── execlp.c │ ├── execv.c │ ├── execve.c │ ├── execvp.c │ ├── fdop.h │ ├── fexecve.c │ ├── fork.c │ ├── i386 │ │ └── vfork.s │ ├── posix_spawn.c │ ├── posix_spawn_file_actions_addclose.c │ ├── posix_spawn_file_actions_adddup2.c │ ├── posix_spawn_file_actions_addopen.c │ ├── posix_spawn_file_actions_destroy.c │ ├── posix_spawn_file_actions_init.c │ ├── posix_spawnattr_destroy.c │ ├── posix_spawnattr_getflags.c │ ├── posix_spawnattr_getpgroup.c │ ├── posix_spawnattr_getsigdefault.c │ ├── posix_spawnattr_getsigmask.c │ ├── posix_spawnattr_init.c │ ├── posix_spawnattr_sched.c │ ├── posix_spawnattr_setflags.c │ ├── posix_spawnattr_setpgroup.c │ ├── posix_spawnattr_setsigdefault.c │ ├── posix_spawnattr_setsigmask.c │ ├── posix_spawnp.c │ ├── s390x │ │ └── vfork.s │ ├── sh │ │ └── vfork.s │ ├── system.c │ ├── vfork.c │ ├── wait.c │ ├── waitid.c │ ├── waitpid.c │ ├── x32 │ │ └── vfork.s │ └── x86_64 │ │ └── vfork.s ├── regex │ ├── fnmatch.c │ ├── glob.c │ ├── regcomp.c │ ├── regerror.c │ ├── regexec.c │ ├── tre-mem.c │ └── tre.h ├── sched │ ├── affinity.c │ ├── sched_cpucount.c │ ├── sched_get_priority_max.c │ ├── sched_getcpu.c │ ├── sched_getparam.c │ ├── sched_getscheduler.c │ ├── sched_rr_get_interval.c │ ├── sched_setparam.c │ ├── sched_setscheduler.c │ └── sched_yield.c ├── search │ ├── hsearch.c │ ├── insque.c │ ├── lsearch.c │ ├── tdestroy.c │ └── tsearch_avl.c ├── select │ ├── poll.c │ ├── pselect.c │ └── select.c ├── setjmp │ ├── aarch64 │ │ ├── longjmp.s │ │ └── setjmp.s │ ├── arm │ │ ├── longjmp.s │ │ └── setjmp.s │ ├── i386 │ │ ├── longjmp.s │ │ └── setjmp.s │ ├── longjmp.c │ ├── m68k │ │ ├── longjmp.s │ │ └── setjmp.s │ ├── microblaze │ │ ├── longjmp.s │ │ └── setjmp.s │ ├── mips │ │ ├── longjmp.S │ │ └── setjmp.S │ ├── mips64 │ │ ├── longjmp.S │ │ └── setjmp.S │ ├── mipsn32 │ │ ├── longjmp.S │ │ └── setjmp.S │ ├── or1k │ │ ├── longjmp.s │ │ └── setjmp.s │ ├── powerpc │ │ ├── longjmp.S │ │ └── setjmp.S │ ├── powerpc64 │ │ ├── longjmp.s │ │ └── setjmp.s │ ├── s390x │ │ ├── longjmp.s │ │ └── setjmp.s │ ├── setjmp.c │ ├── sh │ │ ├── longjmp.S │ │ └── setjmp.S │ ├── x32 │ │ ├── longjmp.s │ │ └── setjmp.s │ └── x86_64 │ │ ├── longjmp.s │ │ └── setjmp.s ├── signal │ ├── aarch64 │ │ ├── restore.s │ │ └── sigsetjmp.s │ ├── arm │ │ ├── restore.s │ │ └── sigsetjmp.s │ ├── block.c │ ├── getitimer.c │ ├── i386 │ │ ├── restore.s │ │ └── sigsetjmp.s │ ├── kill.c │ ├── killpg.c │ ├── m68k │ │ └── sigsetjmp.s │ ├── microblaze │ │ ├── restore.s │ │ └── sigsetjmp.s │ ├── mips │ │ ├── restore.s │ │ └── sigsetjmp.s │ ├── mips64 │ │ ├── restore.s │ │ └── sigsetjmp.s │ ├── mipsn32 │ │ ├── restore.s │ │ └── sigsetjmp.s │ ├── or1k │ │ └── sigsetjmp.s │ ├── powerpc │ │ ├── restore.s │ │ └── sigsetjmp.s │ ├── powerpc64 │ │ ├── restore.s │ │ └── sigsetjmp.s │ ├── psiginfo.c │ ├── psignal.c │ ├── raise.c │ ├── restore.c │ ├── s390x │ │ ├── restore.s │ │ └── sigsetjmp.s │ ├── setitimer.c │ ├── sh │ │ ├── restore.s │ │ └── sigsetjmp.s │ ├── sigaction.c │ ├── sigaddset.c │ ├── sigaltstack.c │ ├── sigandset.c │ ├── sigdelset.c │ ├── sigemptyset.c │ ├── sigfillset.c │ ├── sighold.c │ ├── sigignore.c │ ├── siginterrupt.c │ ├── sigisemptyset.c │ ├── sigismember.c │ ├── siglongjmp.c │ ├── signal.c │ ├── sigorset.c │ ├── sigpause.c │ ├── sigpending.c │ ├── sigprocmask.c │ ├── sigqueue.c │ ├── sigrelse.c │ ├── sigrtmax.c │ ├── sigrtmin.c │ ├── sigset.c │ ├── sigsetjmp.c │ ├── sigsetjmp_tail.c │ ├── sigsuspend.c │ ├── sigtimedwait.c │ ├── sigwait.c │ ├── sigwaitinfo.c │ ├── x32 │ │ ├── restore.s │ │ └── sigsetjmp.s │ └── x86_64 │ │ ├── restore.s │ │ └── sigsetjmp.s ├── stat │ ├── __xstat.c │ ├── chmod.c │ ├── fchmod.c │ ├── fchmodat.c │ ├── fstat.c │ ├── fstatat.c │ ├── futimens.c │ ├── futimesat.c │ ├── lchmod.c │ ├── lstat.c │ ├── mkdir.c │ ├── mkdirat.c │ ├── mkfifo.c │ ├── mkfifoat.c │ ├── mknod.c │ ├── mknodat.c │ ├── stat.c │ ├── statvfs.c │ ├── umask.c │ └── utimensat.c ├── stdio │ ├── __fclose_ca.c │ ├── __fdopen.c │ ├── __fmodeflags.c │ ├── __fopen_rb_ca.c │ ├── __lockfile.c │ ├── __overflow.c │ ├── __stdio_close.c │ ├── __stdio_exit.c │ ├── __stdio_read.c │ ├── __stdio_seek.c │ ├── __stdio_write.c │ ├── __stdout_write.c │ ├── __string_read.c │ ├── __toread.c │ ├── __towrite.c │ ├── __uflow.c │ ├── asprintf.c │ ├── clearerr.c │ ├── dprintf.c │ ├── ext.c │ ├── ext2.c │ ├── fclose.c │ ├── feof.c │ ├── ferror.c │ ├── fflush.c │ ├── fgetc.c │ ├── fgetln.c │ ├── fgetpos.c │ ├── fgets.c │ ├── fgetwc.c │ ├── fgetws.c │ ├── fileno.c │ ├── flockfile.c │ ├── fmemopen.c │ ├── fopen.c │ ├── fopencookie.c │ ├── fprintf.c │ ├── fputc.c │ ├── fputs.c │ ├── fputwc.c │ ├── fputws.c │ ├── fread.c │ ├── freopen.c │ ├── fscanf.c │ ├── fseek.c │ ├── fsetpos.c │ ├── ftell.c │ ├── ftrylockfile.c │ ├── funlockfile.c │ ├── fwide.c │ ├── fwprintf.c │ ├── fwrite.c │ ├── fwscanf.c │ ├── getc.c │ ├── getc_unlocked.c │ ├── getchar.c │ ├── getchar_unlocked.c │ ├── getdelim.c │ ├── getline.c │ ├── gets.c │ ├── getw.c │ ├── getwc.c │ ├── getwchar.c │ ├── ofl.c │ ├── ofl_add.c │ ├── open_memstream.c │ ├── open_wmemstream.c │ ├── pclose.c │ ├── perror.c │ ├── popen.c │ ├── printf.c │ ├── putc.c │ ├── putc_unlocked.c │ ├── putchar.c │ ├── putchar_unlocked.c │ ├── puts.c │ ├── putw.c │ ├── putwc.c │ ├── putwchar.c │ ├── remove.c │ ├── rename.c │ ├── rewind.c │ ├── scanf.c │ ├── setbuf.c │ ├── setbuffer.c │ ├── setlinebuf.c │ ├── setvbuf.c │ ├── snprintf.c │ ├── sprintf.c │ ├── sscanf.c │ ├── stderr.c │ ├── stdin.c │ ├── stdout.c │ ├── swprintf.c │ ├── swscanf.c │ ├── tempnam.c │ ├── tmpfile.c │ ├── tmpnam.c │ ├── ungetc.c │ ├── ungetwc.c │ ├── vasprintf.c │ ├── vdprintf.c │ ├── vfprintf.c │ ├── vfscanf.c │ ├── vfwprintf.c │ ├── vfwscanf.c │ ├── vprintf.c │ ├── vscanf.c │ ├── vsnprintf.c │ ├── vsprintf.c │ ├── vsscanf.c │ ├── vswprintf.c │ ├── vswscanf.c │ ├── vwprintf.c │ ├── vwscanf.c │ ├── wprintf.c │ └── wscanf.c ├── stdlib │ ├── abs.c │ ├── atof.c │ ├── atoi.c │ ├── atol.c │ ├── atoll.c │ ├── bsearch.c │ ├── div.c │ ├── ecvt.c │ ├── fcvt.c │ ├── gcvt.c │ ├── imaxabs.c │ ├── imaxdiv.c │ ├── labs.c │ ├── ldiv.c │ ├── llabs.c │ ├── lldiv.c │ ├── qsort.c │ ├── strtod.c │ ├── strtol.c │ ├── wcstod.c │ └── wcstol.c ├── string │ ├── arm │ │ ├── __aeabi_memcpy.s │ │ ├── __aeabi_memset.s │ │ ├── memcpy.c │ │ └── memcpy_le.S │ ├── bcmp.c │ ├── bcopy.c │ ├── bzero.c │ ├── i386 │ │ ├── memcpy.s │ │ ├── memmove.s │ │ └── memset.s │ ├── index.c │ ├── memccpy.c │ ├── memchr.c │ ├── memcmp.c │ ├── memcpy.c │ ├── memmem.c │ ├── memmove.c │ ├── mempcpy.c │ ├── memrchr.c │ ├── memset.c │ ├── rindex.c │ ├── stpcpy.c │ ├── stpncpy.c │ ├── strcasecmp.c │ ├── strcasestr.c │ ├── strcat.c │ ├── strchr.c │ ├── strchrnul.c │ ├── strcmp.c │ ├── strcpy.c │ ├── strcspn.c │ ├── strdup.c │ ├── strerror_r.c │ ├── strlcat.c │ ├── strlcpy.c │ ├── strlen.c │ ├── strncasecmp.c │ ├── strncat.c │ ├── strncmp.c │ ├── strncpy.c │ ├── strndup.c │ ├── strnlen.c │ ├── strpbrk.c │ ├── strrchr.c │ ├── strsep.c │ ├── strsignal.c │ ├── strspn.c │ ├── strstr.c │ ├── strtok.c │ ├── strtok_r.c │ ├── strverscmp.c │ ├── swab.c │ ├── wcpcpy.c │ ├── wcpncpy.c │ ├── wcscasecmp.c │ ├── wcscasecmp_l.c │ ├── wcscat.c │ ├── wcschr.c │ ├── wcscmp.c │ ├── wcscpy.c │ ├── wcscspn.c │ ├── wcsdup.c │ ├── wcslen.c │ ├── wcsncasecmp.c │ ├── wcsncasecmp_l.c │ ├── wcsncat.c │ ├── wcsncmp.c │ ├── wcsncpy.c │ ├── wcsnlen.c │ ├── wcspbrk.c │ ├── wcsrchr.c │ ├── wcsspn.c │ ├── wcsstr.c │ ├── wcstok.c │ ├── wcswcs.c │ ├── wmemchr.c │ ├── wmemcmp.c │ ├── wmemcpy.c │ ├── wmemmove.c │ ├── wmemset.c │ └── x86_64 │ │ ├── memcpy.s │ │ ├── memmove.s │ │ └── memset.s ├── temp │ ├── __randname.c │ ├── mkdtemp.c │ ├── mkostemp.c │ ├── mkostemps.c │ ├── mkstemp.c │ ├── mkstemps.c │ └── mktemp.c ├── termios │ ├── cfgetospeed.c │ ├── cfmakeraw.c │ ├── cfsetospeed.c │ ├── tcdrain.c │ ├── tcflow.c │ ├── tcflush.c │ ├── tcgetattr.c │ ├── tcgetsid.c │ ├── tcsendbreak.c │ └── tcsetattr.c ├── thread │ ├── __clone.c │ ├── __futex.c │ ├── __lock.c │ ├── __set_thread_area.c │ ├── __syscall_cp.c │ ├── __timedwait.c │ ├── __tls_get_addr.c │ ├── __unmapself.c │ ├── __wait.c │ ├── aarch64 │ │ ├── __clone.s │ │ ├── __set_thread_area.s │ │ ├── __unmapself.s │ │ └── syscall_cp.s │ ├── arm │ │ ├── __aeabi_read_tp.s │ │ ├── __aeabi_read_tp_c.c │ │ ├── __clone.s │ │ ├── __set_thread_area.c │ │ ├── __unmapself.s │ │ ├── atomics.s │ │ └── syscall_cp.s │ ├── call_once.c │ ├── cnd_broadcast.c │ ├── cnd_destroy.c │ ├── cnd_init.c │ ├── cnd_signal.c │ ├── cnd_timedwait.c │ ├── cnd_wait.c │ ├── i386 │ │ ├── __clone.s │ │ ├── __set_thread_area.s │ │ ├── __unmapself.s │ │ ├── syscall_cp.s │ │ └── tls.s │ ├── lock_ptc.c │ ├── m68k │ │ ├── __m68k_read_tp.s │ │ ├── clone.s │ │ └── syscall_cp.s │ ├── microblaze │ │ ├── __clone.s │ │ ├── __set_thread_area.s │ │ ├── __unmapself.s │ │ └── syscall_cp.s │ ├── mips │ │ ├── __clone.s │ │ ├── __unmapself.s │ │ └── syscall_cp.s │ ├── mips64 │ │ ├── __clone.s │ │ ├── __unmapself.s │ │ └── syscall_cp.s │ ├── mipsn32 │ │ ├── __clone.s │ │ ├── __unmapself.s │ │ └── syscall_cp.s │ ├── mtx_destroy.c │ ├── mtx_init.c │ ├── mtx_lock.c │ ├── mtx_timedlock.c │ ├── mtx_trylock.c │ ├── mtx_unlock.c │ ├── or1k │ │ ├── __clone.s │ │ ├── __set_thread_area.s │ │ ├── __unmapself.s │ │ └── syscall_cp.s │ ├── powerpc │ │ ├── __clone.s │ │ ├── __set_thread_area.s │ │ ├── __unmapself.s │ │ └── syscall_cp.s │ ├── powerpc64 │ │ ├── __clone.s │ │ ├── __set_thread_area.s │ │ ├── __unmapself.s │ │ └── syscall_cp.s │ ├── pthread_atfork.c │ ├── pthread_attr_destroy.c │ ├── pthread_attr_get.c │ ├── pthread_attr_init.c │ ├── pthread_attr_setdetachstate.c │ ├── pthread_attr_setguardsize.c │ ├── pthread_attr_setinheritsched.c │ ├── pthread_attr_setschedparam.c │ ├── pthread_attr_setschedpolicy.c │ ├── pthread_attr_setscope.c │ ├── pthread_attr_setstack.c │ ├── pthread_attr_setstacksize.c │ ├── pthread_barrier_destroy.c │ ├── pthread_barrier_init.c │ ├── pthread_barrier_wait.c │ ├── pthread_barrierattr_destroy.c │ ├── pthread_barrierattr_init.c │ ├── pthread_barrierattr_setpshared.c │ ├── pthread_cancel.c │ ├── pthread_cleanup_push.c │ ├── pthread_cond_broadcast.c │ ├── pthread_cond_destroy.c │ ├── pthread_cond_init.c │ ├── pthread_cond_signal.c │ ├── pthread_cond_timedwait.c │ ├── pthread_cond_wait.c │ ├── pthread_condattr_destroy.c │ ├── pthread_condattr_init.c │ ├── pthread_condattr_setclock.c │ ├── pthread_condattr_setpshared.c │ ├── pthread_create.c │ ├── pthread_detach.c │ ├── pthread_equal.c │ ├── pthread_getattr_np.c │ ├── pthread_getconcurrency.c │ ├── pthread_getcpuclockid.c │ ├── pthread_getschedparam.c │ ├── pthread_getspecific.c │ ├── pthread_join.c │ ├── pthread_key_create.c │ ├── pthread_kill.c │ ├── pthread_mutex_consistent.c │ ├── pthread_mutex_destroy.c │ ├── pthread_mutex_getprioceiling.c │ ├── pthread_mutex_init.c │ ├── pthread_mutex_lock.c │ ├── pthread_mutex_setprioceiling.c │ ├── pthread_mutex_timedlock.c │ ├── pthread_mutex_trylock.c │ ├── pthread_mutex_unlock.c │ ├── pthread_mutexattr_destroy.c │ ├── pthread_mutexattr_init.c │ ├── pthread_mutexattr_setprotocol.c │ ├── pthread_mutexattr_setpshared.c │ ├── pthread_mutexattr_setrobust.c │ ├── pthread_mutexattr_settype.c │ ├── pthread_once.c │ ├── pthread_rwlock_destroy.c │ ├── pthread_rwlock_init.c │ ├── pthread_rwlock_rdlock.c │ ├── pthread_rwlock_timedrdlock.c │ ├── pthread_rwlock_timedwrlock.c │ ├── pthread_rwlock_tryrdlock.c │ ├── pthread_rwlock_trywrlock.c │ ├── pthread_rwlock_unlock.c │ ├── pthread_rwlock_wrlock.c │ ├── pthread_rwlockattr_destroy.c │ ├── pthread_rwlockattr_init.c │ ├── pthread_rwlockattr_setpshared.c │ ├── pthread_self.c │ ├── pthread_setattr_default_np.c │ ├── pthread_setcancelstate.c │ ├── pthread_setcanceltype.c │ ├── pthread_setconcurrency.c │ ├── pthread_setname_np.c │ ├── pthread_setschedparam.c │ ├── pthread_setschedprio.c │ ├── pthread_setspecific.c │ ├── pthread_sigmask.c │ ├── pthread_spin_destroy.c │ ├── pthread_spin_init.c │ ├── pthread_spin_lock.c │ ├── pthread_spin_trylock.c │ ├── pthread_spin_unlock.c │ ├── pthread_testcancel.c │ ├── s390x │ │ ├── __clone.s │ │ ├── __set_thread_area.s │ │ ├── __tls_get_offset.s │ │ ├── __unmapself.s │ │ └── syscall_cp.s │ ├── sem_destroy.c │ ├── sem_getvalue.c │ ├── sem_init.c │ ├── sem_open.c │ ├── sem_post.c │ ├── sem_timedwait.c │ ├── sem_trywait.c │ ├── sem_unlink.c │ ├── sem_wait.c │ ├── sh │ │ ├── __clone.s │ │ ├── __set_thread_area.c │ │ ├── __unmapself.c │ │ ├── __unmapself_mmu.s │ │ ├── atomics.s │ │ └── syscall_cp.s │ ├── synccall.c │ ├── syscall_cp.c │ ├── thrd_create.c │ ├── thrd_exit.c │ ├── thrd_join.c │ ├── thrd_sleep.c │ ├── thrd_yield.c │ ├── tls.c │ ├── tss_create.c │ ├── tss_delete.c │ ├── tss_set.c │ ├── vmlock.c │ ├── x32 │ │ ├── __clone.s │ │ ├── __set_thread_area.s │ │ ├── __unmapself.s │ │ ├── syscall_cp.s │ │ └── syscall_cp_fixup.c │ └── x86_64 │ │ ├── __clone.s │ │ ├── __set_thread_area.s │ │ ├── __unmapself.s │ │ └── syscall_cp.s ├── time │ ├── __asctime.c │ ├── __map_file.c │ ├── __month_to_secs.c │ ├── __secs_to_tm.c │ ├── __tm_to_secs.c │ ├── __tz.c │ ├── __year_to_secs.c │ ├── asctime.c │ ├── asctime_r.c │ ├── clock.c │ ├── clock_getcpuclockid.c │ ├── clock_getres.c │ ├── clock_gettime.c │ ├── clock_nanosleep.c │ ├── clock_settime.c │ ├── ctime.c │ ├── ctime_r.c │ ├── difftime.c │ ├── ftime.c │ ├── getdate.c │ ├── gettimeofday.c │ ├── gmtime.c │ ├── gmtime_r.c │ ├── localtime.c │ ├── localtime_r.c │ ├── mktime.c │ ├── nanosleep.c │ ├── strftime.c │ ├── strptime.c │ ├── time.c │ ├── time_impl.h │ ├── timegm.c │ ├── timer_create.c │ ├── timer_delete.c │ ├── timer_getoverrun.c │ ├── timer_gettime.c │ ├── timer_settime.c │ ├── times.c │ ├── timespec_get.c │ ├── utime.c │ └── wcsftime.c └── unistd │ ├── _exit.c │ ├── access.c │ ├── acct.c │ ├── alarm.c │ ├── chdir.c │ ├── chown.c │ ├── close.c │ ├── ctermid.c │ ├── dup.c │ ├── dup2.c │ ├── dup3.c │ ├── faccessat.c │ ├── fchdir.c │ ├── fchown.c │ ├── fchownat.c │ ├── fdatasync.c │ ├── fsync.c │ ├── ftruncate.c │ ├── getcwd.c │ ├── getegid.c │ ├── geteuid.c │ ├── getgid.c │ ├── getgroups.c │ ├── gethostname.c │ ├── getlogin.c │ ├── getlogin_r.c │ ├── getpgid.c │ ├── getpgrp.c │ ├── getpid.c │ ├── getppid.c │ ├── getsid.c │ ├── getuid.c │ ├── isatty.c │ ├── lchown.c │ ├── link.c │ ├── linkat.c │ ├── lseek.c │ ├── mips │ └── pipe.s │ ├── mips64 │ └── pipe.s │ ├── mipsn32 │ └── pipe.s │ ├── nice.c │ ├── pause.c │ ├── pipe.c │ ├── pipe2.c │ ├── posix_close.c │ ├── pread.c │ ├── preadv.c │ ├── pwrite.c │ ├── pwritev.c │ ├── read.c │ ├── readlink.c │ ├── readlinkat.c │ ├── readv.c │ ├── renameat.c │ ├── rmdir.c │ ├── setegid.c │ ├── seteuid.c │ ├── setgid.c │ ├── setpgid.c │ ├── setpgrp.c │ ├── setregid.c │ ├── setresgid.c │ ├── setresuid.c │ ├── setreuid.c │ ├── setsid.c │ ├── setuid.c │ ├── setxid.c │ ├── sh │ └── pipe.s │ ├── sleep.c │ ├── symlink.c │ ├── symlinkat.c │ ├── sync.c │ ├── tcgetpgrp.c │ ├── tcsetpgrp.c │ ├── truncate.c │ ├── ttyname.c │ ├── ttyname_r.c │ ├── ualarm.c │ ├── unlink.c │ ├── unlinkat.c │ ├── usleep.c │ ├── write.c │ └── writev.c └── tools ├── add-cfi.common.awk ├── add-cfi.i386.awk ├── add-cfi.x86_64.awk ├── install.sh ├── ld.musl-clang.in ├── mkalltypes.sed ├── musl-clang.in ├── musl-gcc.specs.sh └── version.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.lo 3 | *.a 4 | *.so 5 | *.so.1 6 | config.mak 7 | lib/musl-gcc.specs 8 | /obj/ 9 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 1.1.19 2 | -------------------------------------------------------------------------------- /arch/aarch64/bits/endian.h: -------------------------------------------------------------------------------- 1 | #if __AARCH64EB__ 2 | #define __BYTE_ORDER __BIG_ENDIAN 3 | #else 4 | #define __BYTE_ORDER __LITTLE_ENDIAN 5 | #endif 6 | -------------------------------------------------------------------------------- /arch/aarch64/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_LP64_OFF64 1 2 | #define _POSIX_V7_LP64_OFF64 1 3 | -------------------------------------------------------------------------------- /arch/aarch64/bits/reg.h: -------------------------------------------------------------------------------- 1 | #undef __WORDSIZE 2 | #define __WORDSIZE 64 3 | -------------------------------------------------------------------------------- /arch/aarch64/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long __jmp_buf[22]; 2 | -------------------------------------------------------------------------------- /arch/arm/bits/endian.h: -------------------------------------------------------------------------------- 1 | #if __ARMEB__ 2 | #define __BYTE_ORDER __BIG_ENDIAN 3 | #else 4 | #define __BYTE_ORDER __LITTLE_ENDIAN 5 | #endif 6 | -------------------------------------------------------------------------------- /arch/arm/bits/ioctl_fix.h: -------------------------------------------------------------------------------- 1 | #undef FIOQSIZE 2 | #define FIOQSIZE 0x545e 3 | -------------------------------------------------------------------------------- /arch/arm/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_ILP32_OFFBIG 1 2 | #define _POSIX_V7_ILP32_OFFBIG 1 3 | -------------------------------------------------------------------------------- /arch/arm/bits/reg.h: -------------------------------------------------------------------------------- 1 | #undef __WORDSIZE 2 | #define __WORDSIZE 32 3 | /* FIXME */ 4 | -------------------------------------------------------------------------------- /arch/arm/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long long __jmp_buf[32]; 2 | -------------------------------------------------------------------------------- /arch/generic/bits/fenv.h: -------------------------------------------------------------------------------- 1 | #define FE_ALL_EXCEPT 0 2 | #define FE_TONEAREST 0 3 | 4 | typedef unsigned long fexcept_t; 5 | 6 | typedef struct { 7 | unsigned long __cw; 8 | } fenv_t; 9 | 10 | #define FE_DFL_ENV ((const fenv_t *) -1) 11 | -------------------------------------------------------------------------------- /arch/generic/bits/hwcap.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/arch/generic/bits/hwcap.h -------------------------------------------------------------------------------- /arch/generic/bits/io.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/arch/generic/bits/io.h -------------------------------------------------------------------------------- /arch/generic/bits/ioctl_fix.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/arch/generic/bits/ioctl_fix.h -------------------------------------------------------------------------------- /arch/generic/bits/link.h: -------------------------------------------------------------------------------- 1 | typedef uint32_t Elf_Symndx; 2 | -------------------------------------------------------------------------------- /arch/generic/bits/mman.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/arch/generic/bits/mman.h -------------------------------------------------------------------------------- /arch/generic/bits/poll.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/arch/generic/bits/poll.h -------------------------------------------------------------------------------- /arch/generic/bits/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/arch/generic/bits/resource.h -------------------------------------------------------------------------------- /arch/generic/bits/statfs.h: -------------------------------------------------------------------------------- 1 | struct statfs { 2 | unsigned long f_type, f_bsize; 3 | fsblkcnt_t f_blocks, f_bfree, f_bavail; 4 | fsfilcnt_t f_files, f_ffree; 5 | fsid_t f_fsid; 6 | unsigned long f_namelen, f_frsize, f_flags, f_spare[4]; 7 | }; 8 | -------------------------------------------------------------------------------- /arch/i386/bits/endian.h: -------------------------------------------------------------------------------- 1 | #define __BYTE_ORDER __LITTLE_ENDIAN 2 | -------------------------------------------------------------------------------- /arch/i386/bits/mman.h: -------------------------------------------------------------------------------- 1 | #define MAP_32BIT 0x40 2 | -------------------------------------------------------------------------------- /arch/i386/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_ILP32_OFFBIG 1 2 | #define _POSIX_V7_ILP32_OFFBIG 1 3 | -------------------------------------------------------------------------------- /arch/i386/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long __jmp_buf[6]; 2 | -------------------------------------------------------------------------------- /arch/m68k/atomic_arch.h: -------------------------------------------------------------------------------- 1 | #define a_cas a_cas 2 | static inline int a_cas(volatile int *p, int t, int s) 3 | { 4 | __asm__ __volatile__ ( 5 | "cas.l %0, %2, (%1)" 6 | : "+d"(t) : "a"(p), "d"(s) : "memory", "cc"); 7 | return t; 8 | } 9 | -------------------------------------------------------------------------------- /arch/m68k/bits/endian.h: -------------------------------------------------------------------------------- 1 | #define __BYTE_ORDER __BIG_ENDIAN 2 | -------------------------------------------------------------------------------- /arch/m68k/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_ILP32_OFFBIG 1 2 | #define _POSIX_V7_ILP32_OFFBIG 1 3 | -------------------------------------------------------------------------------- /arch/m68k/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long __jmp_buf[39]; 2 | -------------------------------------------------------------------------------- /arch/microblaze/bits/endian.h: -------------------------------------------------------------------------------- 1 | #if __MICROBLAZEEL__ 2 | #define __BYTE_ORDER __LITTLE_ENDIAN 3 | #else 4 | #define __BYTE_ORDER __BIG_ENDIAN 5 | #endif 6 | -------------------------------------------------------------------------------- /arch/microblaze/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_ILP32_OFFBIG 1 2 | #define _POSIX_V7_ILP32_OFFBIG 1 3 | -------------------------------------------------------------------------------- /arch/microblaze/bits/reg.h: -------------------------------------------------------------------------------- 1 | #undef __WORDSIZE 2 | #define __WORDSIZE 32 3 | /* FIXME */ 4 | -------------------------------------------------------------------------------- /arch/microblaze/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long __jmp_buf[18]; 2 | -------------------------------------------------------------------------------- /arch/mips/bits/endian.h: -------------------------------------------------------------------------------- 1 | #if _MIPSEL || __MIPSEL || __MIPSEL__ 2 | #define __BYTE_ORDER __LITTLE_ENDIAN 3 | #else 4 | #define __BYTE_ORDER __BIG_ENDIAN 5 | #endif 6 | -------------------------------------------------------------------------------- /arch/mips/bits/hwcap.h: -------------------------------------------------------------------------------- 1 | #define HWCAP_MIPS_R6 (1 << 0) 2 | #define HWCAP_MIPS_MSA (1 << 1) 3 | #define HWCAP_MIPS_CRC32 (1 << 2) 4 | -------------------------------------------------------------------------------- /arch/mips/bits/poll.h: -------------------------------------------------------------------------------- 1 | #define POLLWRNORM POLLOUT 2 | #define POLLWRBAND 0x100 3 | -------------------------------------------------------------------------------- /arch/mips/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_ILP32_OFFBIG 1 2 | #define _POSIX_V7_ILP32_OFFBIG 1 3 | -------------------------------------------------------------------------------- /arch/mips/bits/resource.h: -------------------------------------------------------------------------------- 1 | #define RLIMIT_NOFILE 5 2 | #define RLIMIT_AS 6 3 | #define RLIMIT_RSS 7 4 | #define RLIMIT_NPROC 8 5 | #define RLIMIT_MEMLOCK 9 6 | -------------------------------------------------------------------------------- /arch/mips/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long long __jmp_buf[13]; 2 | -------------------------------------------------------------------------------- /arch/mips64/bits/endian.h: -------------------------------------------------------------------------------- 1 | #if _MIPSEL || __MIPSEL || __MIPSEL__ 2 | #define __BYTE_ORDER __LITTLE_ENDIAN 3 | #else 4 | #define __BYTE_ORDER __BIG_ENDIAN 5 | #endif 6 | -------------------------------------------------------------------------------- /arch/mips64/bits/hwcap.h: -------------------------------------------------------------------------------- 1 | #define HWCAP_MIPS_R6 (1 << 0) 2 | #define HWCAP_MIPS_MSA (1 << 1) 3 | #define HWCAP_MIPS_CRC32 (1 << 2) 4 | -------------------------------------------------------------------------------- /arch/mips64/bits/poll.h: -------------------------------------------------------------------------------- 1 | #define POLLWRNORM POLLOUT 2 | #define POLLWRBAND 0x100 3 | -------------------------------------------------------------------------------- /arch/mips64/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_LP64_OFFBIG 1 2 | #define _POSIX_V7_LP64_OFFBIG 1 3 | -------------------------------------------------------------------------------- /arch/mips64/bits/resource.h: -------------------------------------------------------------------------------- 1 | #define RLIMIT_NOFILE 5 2 | #define RLIMIT_AS 6 3 | #define RLIMIT_RSS 7 4 | #define RLIMIT_NPROC 8 5 | #define RLIMIT_MEMLOCK 9 6 | -------------------------------------------------------------------------------- /arch/mips64/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long long __jmp_buf[23]; 2 | -------------------------------------------------------------------------------- /arch/mips64/ksigaction.h: -------------------------------------------------------------------------------- 1 | struct k_sigaction { 2 | unsigned flags; 3 | void (*handler)(int); 4 | unsigned long mask[2]; 5 | void (*restorer)(); 6 | }; 7 | 8 | void __restore(), __restore_rt(); 9 | -------------------------------------------------------------------------------- /arch/mipsn32/bits/endian.h: -------------------------------------------------------------------------------- 1 | #if _MIPSEL || __MIPSEL || __MIPSEL__ 2 | #define __BYTE_ORDER __LITTLE_ENDIAN 3 | #else 4 | #define __BYTE_ORDER __BIG_ENDIAN 5 | #endif 6 | -------------------------------------------------------------------------------- /arch/mipsn32/bits/hwcap.h: -------------------------------------------------------------------------------- 1 | #define HWCAP_MIPS_R6 (1 << 0) 2 | #define HWCAP_MIPS_MSA (1 << 1) 3 | #define HWCAP_MIPS_CRC32 (1 << 2) 4 | -------------------------------------------------------------------------------- /arch/mipsn32/bits/poll.h: -------------------------------------------------------------------------------- 1 | #define POLLWRNORM POLLOUT 2 | #define POLLWRBAND 0x100 3 | -------------------------------------------------------------------------------- /arch/mipsn32/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_ILP32_OFFBIG 1 2 | #define _POSIX_V7_ILP32_OFFBIG 1 3 | -------------------------------------------------------------------------------- /arch/mipsn32/bits/resource.h: -------------------------------------------------------------------------------- 1 | #define RLIMIT_NOFILE 5 2 | #define RLIMIT_AS 6 3 | #define RLIMIT_RSS 7 4 | #define RLIMIT_NPROC 8 5 | #define RLIMIT_MEMLOCK 9 6 | -------------------------------------------------------------------------------- /arch/mipsn32/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long long __jmp_buf[23]; 2 | -------------------------------------------------------------------------------- /arch/mipsn32/ksigaction.h: -------------------------------------------------------------------------------- 1 | struct k_sigaction { 2 | unsigned flags; 3 | void (*handler)(int); 4 | unsigned long mask[4]; 5 | void (*restorer)(); 6 | }; 7 | 8 | void __restore(), __restore_rt(); 9 | -------------------------------------------------------------------------------- /arch/or1k/bits/endian.h: -------------------------------------------------------------------------------- 1 | #define __BYTE_ORDER __BIG_ENDIAN 2 | -------------------------------------------------------------------------------- /arch/or1k/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_ILP32_OFFBIG 1 2 | #define _POSIX_V7_ILP32_OFFBIG 1 3 | -------------------------------------------------------------------------------- /arch/or1k/bits/reg.h: -------------------------------------------------------------------------------- 1 | #undef __WORDSIZE 2 | #define __WORDSIZE 32 3 | /* FIXME */ 4 | -------------------------------------------------------------------------------- /arch/or1k/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long __jmp_buf[13]; 2 | -------------------------------------------------------------------------------- /arch/or1k/bits/user.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/arch/or1k/bits/user.h -------------------------------------------------------------------------------- /arch/powerpc/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_ILP32_OFFBIG 1 2 | #define _POSIX_V7_ILP32_OFFBIG 1 3 | -------------------------------------------------------------------------------- /arch/powerpc/bits/reg.h: -------------------------------------------------------------------------------- 1 | #undef __WORDSIZE 2 | #define __WORDSIZE 32 3 | /* FIXME */ 4 | -------------------------------------------------------------------------------- /arch/powerpc/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long long __jmp_buf[56]; 2 | -------------------------------------------------------------------------------- /arch/powerpc64/bits/endian.h: -------------------------------------------------------------------------------- 1 | #if __BIG_ENDIAN__ 2 | #define __BYTE_ORDER __BIG_ENDIAN 3 | #else 4 | #define __BYTE_ORDER __LITTLE_ENDIAN 5 | #endif 6 | -------------------------------------------------------------------------------- /arch/powerpc64/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_LP64_OFF64 1 2 | #define _POSIX_V7_LP64_OFF64 1 3 | -------------------------------------------------------------------------------- /arch/powerpc64/bits/reg.h: -------------------------------------------------------------------------------- 1 | #undef __WORDSIZE 2 | #define __WORDSIZE 64 3 | /* FIXME */ 4 | -------------------------------------------------------------------------------- /arch/powerpc64/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned __int128 __jmp_buf[32]; 2 | -------------------------------------------------------------------------------- /arch/s390x/bits/endian.h: -------------------------------------------------------------------------------- 1 | #define __BYTE_ORDER __BIG_ENDIAN 2 | -------------------------------------------------------------------------------- /arch/s390x/bits/ioctl_fix.h: -------------------------------------------------------------------------------- 1 | #undef FIOQSIZE 2 | #define FIOQSIZE 0x545e 3 | -------------------------------------------------------------------------------- /arch/s390x/bits/link.h: -------------------------------------------------------------------------------- 1 | typedef uint64_t Elf_Symndx; 2 | -------------------------------------------------------------------------------- /arch/s390x/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_LP64_OFF64 1 2 | #define _POSIX_V7_LP64_OFF64 1 3 | -------------------------------------------------------------------------------- /arch/s390x/bits/reg.h: -------------------------------------------------------------------------------- 1 | #undef __WORDSIZE 2 | #define __WORDSIZE 64 3 | -------------------------------------------------------------------------------- /arch/s390x/bits/sem.h: -------------------------------------------------------------------------------- 1 | struct semid_ds { 2 | struct ipc_perm sem_perm; 3 | time_t sem_otime; 4 | time_t sem_ctime; 5 | unsigned short __pad[3], sem_nsems; 6 | unsigned long __unused[2]; 7 | }; 8 | -------------------------------------------------------------------------------- /arch/s390x/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long __jmp_buf[18]; 2 | -------------------------------------------------------------------------------- /arch/s390x/bits/statfs.h: -------------------------------------------------------------------------------- 1 | struct statfs { 2 | unsigned f_type, f_bsize; 3 | fsblkcnt_t f_blocks, f_bfree, f_bavail; 4 | fsfilcnt_t f_files, f_ffree; 5 | fsid_t f_fsid; 6 | unsigned f_namelen, f_frsize, f_flags, f_spare[4]; 7 | }; 8 | -------------------------------------------------------------------------------- /arch/sh/bits/endian.h: -------------------------------------------------------------------------------- 1 | #if __BIG_ENDIAN__ 2 | #define __BYTE_ORDER __BIG_ENDIAN 3 | #else 4 | #define __BYTE_ORDER __LITTLE_ENDIAN 5 | #endif 6 | -------------------------------------------------------------------------------- /arch/sh/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_ILP32_OFFBIG 1 2 | #define _POSIX_V7_ILP32_OFFBIG 1 3 | -------------------------------------------------------------------------------- /arch/sh/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long __jmp_buf[15]; 2 | -------------------------------------------------------------------------------- /arch/sh/ksigaction.h: -------------------------------------------------------------------------------- 1 | struct k_sigaction { 2 | void (*handler)(int); 3 | unsigned long flags; 4 | void *restorer; 5 | unsigned mask[2]; 6 | }; 7 | 8 | extern unsigned char __restore[], __restore_rt[]; 9 | -------------------------------------------------------------------------------- /arch/wasm32/bits/endian.h: -------------------------------------------------------------------------------- 1 | #define __BYTE_ORDER __LITTLE_ENDIAN 2 | -------------------------------------------------------------------------------- /arch/wasm32/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_ILP32_OFFBIG 1 2 | #define _POSIX_V7_ILP32_OFFBIG 1 3 | -------------------------------------------------------------------------------- /arch/wasm32/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long __jmp_buf[6]; 2 | -------------------------------------------------------------------------------- /arch/wasm32/bits/statfs.h: -------------------------------------------------------------------------------- 1 | struct statfs { 2 | unsigned long f_type, f_bsize; 3 | fsblkcnt_t f_blocks, f_bfree, f_bavail; 4 | fsfilcnt_t f_files, f_ffree; 5 | fsid_t f_fsid; 6 | unsigned long f_namelen, f_frsize, f_flags, f_spare[4]; 7 | }; 8 | -------------------------------------------------------------------------------- /arch/wasm32/bits/stdarg.h: -------------------------------------------------------------------------------- 1 | #define va_start(v,l) __builtin_va_start(v,l) 2 | #define va_end(v) __builtin_va_end(v) 3 | #define va_arg(v,l) __builtin_va_arg(v,l) 4 | #define va_copy(d,s) __builtin_va_copy(d,s) 5 | -------------------------------------------------------------------------------- /arch/wasm32/crt_arch.h: -------------------------------------------------------------------------------- 1 | #ifndef SHARED 2 | void _start_c(long *p); 3 | 4 | void _start(void) { 5 | long p = 0; 6 | _start_c(&p); 7 | } 8 | #endif 9 | -------------------------------------------------------------------------------- /arch/wasm32/pthread_arch.h: -------------------------------------------------------------------------------- 1 | static inline struct pthread *__pthread_self(void) { 2 | return (struct pthread *)UINTPTR_MAX; 3 | } 4 | 5 | #define TP_ADJ(p) (p) 6 | 7 | #define CANCEL_REG_IP 16 8 | 9 | #define MC_PC gregs[REG_EIP] 10 | -------------------------------------------------------------------------------- /arch/wasm32/reloc.h: -------------------------------------------------------------------------------- 1 | #define LDSO_ARCH "wasm32" 2 | 3 | #define CRTJMP(pc,sp) pc() 4 | -------------------------------------------------------------------------------- /arch/x32/bits/endian.h: -------------------------------------------------------------------------------- 1 | #define __BYTE_ORDER __LITTLE_ENDIAN 2 | -------------------------------------------------------------------------------- /arch/x32/bits/mman.h: -------------------------------------------------------------------------------- 1 | #define MAP_32BIT 0x40 2 | -------------------------------------------------------------------------------- /arch/x32/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_ILP32_OFFBIG 1 2 | #define _POSIX_V7_ILP32_OFFBIG 1 3 | -------------------------------------------------------------------------------- /arch/x32/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long long __jmp_buf[8]; 2 | -------------------------------------------------------------------------------- /arch/x32/ksigaction.h: -------------------------------------------------------------------------------- 1 | struct k_sigaction { 2 | void (*handler)(int); 3 | unsigned long flags; 4 | void (*restorer)(void); 5 | unsigned mask[2]; 6 | }; 7 | 8 | void __restore_rt(); 9 | #define __restore __restore_rt 10 | -------------------------------------------------------------------------------- /arch/x86_64/bits/endian.h: -------------------------------------------------------------------------------- 1 | #define __BYTE_ORDER __LITTLE_ENDIAN 2 | -------------------------------------------------------------------------------- /arch/x86_64/bits/mman.h: -------------------------------------------------------------------------------- 1 | #define MAP_32BIT 0x40 2 | -------------------------------------------------------------------------------- /arch/x86_64/bits/posix.h: -------------------------------------------------------------------------------- 1 | #define _POSIX_V6_LP64_OFF64 1 2 | #define _POSIX_V7_LP64_OFF64 1 3 | -------------------------------------------------------------------------------- /arch/x86_64/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | typedef unsigned long __jmp_buf[8]; 2 | -------------------------------------------------------------------------------- /arch/x86_64/ksigaction.h: -------------------------------------------------------------------------------- 1 | struct k_sigaction { 2 | void (*handler)(int); 3 | unsigned long flags; 4 | void (*restorer)(void); 5 | unsigned mask[2]; 6 | }; 7 | 8 | void __restore_rt(); 9 | #define __restore __restore_rt 10 | -------------------------------------------------------------------------------- /crt/Scrt1.c: -------------------------------------------------------------------------------- 1 | #include "crt1.c" 2 | -------------------------------------------------------------------------------- /crt/aarch64/crtn.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | ldp x29,x30,[sp],#16 3 | ret 4 | 5 | .section .fini 6 | ldp x29,x30,[sp],#16 7 | ret 8 | -------------------------------------------------------------------------------- /crt/arm/crti.s: -------------------------------------------------------------------------------- 1 | .syntax unified 2 | 3 | .section .init 4 | .global _init 5 | .type _init,%function 6 | _init: 7 | push {r0,lr} 8 | 9 | .section .fini 10 | .global _fini 11 | .type _fini,%function 12 | _fini: 13 | push {r0,lr} 14 | -------------------------------------------------------------------------------- /crt/arm/crtn.s: -------------------------------------------------------------------------------- 1 | .syntax unified 2 | 3 | .section .init 4 | pop {r0,lr} 5 | bx lr 6 | 7 | .section .fini 8 | pop {r0,lr} 9 | bx lr 10 | -------------------------------------------------------------------------------- /crt/crti.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/crt/crti.c -------------------------------------------------------------------------------- /crt/crtn.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/crt/crtn.c -------------------------------------------------------------------------------- /crt/i386/crti.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | .global _init 3 | _init: 4 | sub $12,%esp 5 | 6 | .section .fini 7 | .global _fini 8 | _fini: 9 | sub $12,%esp 10 | -------------------------------------------------------------------------------- /crt/i386/crtn.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | add $12,%esp 3 | ret 4 | 5 | .section .fini 6 | add $12,%esp 7 | ret 8 | -------------------------------------------------------------------------------- /crt/microblaze/crti.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | .global _init 3 | .align 2 4 | _init: 5 | addi r1, r1, -32 6 | swi r15, r1, 0 7 | 8 | .section .fini 9 | .global _fini 10 | .align 2 11 | _fini: 12 | addi r1, r1, -32 13 | swi r15, r1, 0 14 | -------------------------------------------------------------------------------- /crt/microblaze/crtn.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | lwi r15, r1, 0 3 | rtsd r15, 8 4 | addi r1, r1, 32 5 | 6 | .section .fini 7 | lwi r15, r1, 0 8 | rtsd r15, 8 9 | addi r1, r1, 32 10 | -------------------------------------------------------------------------------- /crt/mips/crtn.s: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | .section .init 4 | lw $gp,24($sp) 5 | lw $ra,28($sp) 6 | j $ra 7 | addu $sp,$sp,32 8 | 9 | .section .fini 10 | lw $gp,24($sp) 11 | lw $ra,28($sp) 12 | j $ra 13 | addu $sp,$sp,32 14 | -------------------------------------------------------------------------------- /crt/mips64/crtn.s: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | .section .init 4 | ld $gp,16($sp) 5 | ld $ra,24($sp) 6 | j $ra 7 | daddu $sp,$sp,32 8 | 9 | .section .fini 10 | ld $gp,16($sp) 11 | ld $ra,24($sp) 12 | j $ra 13 | daddu $sp,$sp,32 14 | -------------------------------------------------------------------------------- /crt/mipsn32/crtn.s: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | .section .init 3 | ld $gp, 16($sp) 4 | ld $ra, 24($sp) 5 | j $ra 6 | addu $sp, $sp, 32 7 | 8 | .section .fini 9 | ld $gp, 16($sp) 10 | ld $ra, 24($sp) 11 | j $ra 12 | addu $sp, $sp, 32 13 | -------------------------------------------------------------------------------- /crt/or1k/crti.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | .global _init 3 | _init: 4 | l.addi r1,r1,-4 5 | l.sw 0(r1),r9 6 | 7 | .section .fini 8 | .global _fini 9 | _fini: 10 | l.addi r1,r1,-4 11 | l.sw 0(r1),r9 12 | -------------------------------------------------------------------------------- /crt/or1k/crtn.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | l.lwz r9,0(r1) 3 | l.jr r9 4 | l.addi r1,r1,4 5 | 6 | .section .fini 7 | l.lwz r9,0(r1) 8 | l.jr r9 9 | l.addi r1,r1,4 10 | -------------------------------------------------------------------------------- /crt/powerpc/crtn.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | .align 2 3 | lwz 0,36(1) 4 | addi 1,1,32 5 | mtlr 0 6 | blr 7 | 8 | .section .fini 9 | .align 2 10 | lwz 0,36(1) 11 | addi 1,1,32 12 | mtlr 0 13 | blr 14 | -------------------------------------------------------------------------------- /crt/powerpc64/crtn.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | .align 2 3 | addi 1, 1, 32 4 | ld 0, 16(1) 5 | mtlr 0 6 | blr 7 | 8 | .section .fini 9 | .align 2 10 | addi 1, 1, 32 11 | ld 0, 16(1) 12 | mtlr 0 13 | blr 14 | -------------------------------------------------------------------------------- /crt/s390x/crtn.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | .align 2 3 | lmg %r14, %r15, 272(%r15) 4 | br %r14 5 | 6 | .section .fini 7 | .align 2 8 | lmg %r14, %r15, 272(%r15) 9 | br %r14 10 | -------------------------------------------------------------------------------- /crt/x32/crti.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | .global _init 3 | _init: 4 | push %rax 5 | 6 | .section .fini 7 | .global _fini 8 | _fini: 9 | push %rax 10 | -------------------------------------------------------------------------------- /crt/x32/crtn.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | pop %rax 3 | ret 4 | 5 | .section .fini 6 | pop %rax 7 | ret 8 | -------------------------------------------------------------------------------- /crt/x86_64/crti.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | .global _init 3 | _init: 4 | push %rax 5 | 6 | .section .fini 7 | .global _fini 8 | _fini: 9 | push %rax 10 | -------------------------------------------------------------------------------- /crt/x86_64/crtn.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | pop %rax 3 | ret 4 | 5 | .section .fini 6 | pop %rax 7 | ret 8 | -------------------------------------------------------------------------------- /include/arpa/nameser_compat.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | -------------------------------------------------------------------------------- /include/lastlog.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /include/libgen.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBGEN_H 2 | #define _LIBGEN_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | char *dirname(char *); 9 | char *basename(char *); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /include/memory.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /include/netinet/in_systm.h: -------------------------------------------------------------------------------- 1 | #ifndef _NETINET_IN_SYSTM_H 2 | #define _NETINET_IN_SYSTM_H 3 | 4 | #include 5 | 6 | typedef uint16_t n_short; 7 | typedef uint32_t n_long, n_time; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /include/stdc-predef.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDC_PREDEF_H 2 | #define _STDC_PREDEF_H 3 | 4 | #define __STDC_ISO_10646__ 201206L 5 | 6 | #if !defined(__GCC_IEC_559) || __GCC_IEC_559 > 0 7 | #define __STDC_IEC_559__ 1 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /include/stdnoreturn.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDNORETURN_H 2 | #define _STDNORETURN_H 3 | #ifndef __cplusplus 4 | #include 5 | #define noreturn _Noreturn 6 | #endif 7 | #endif 8 | -------------------------------------------------------------------------------- /include/sys/dir.h: -------------------------------------------------------------------------------- 1 | #include 2 | #define direct dirent 3 | -------------------------------------------------------------------------------- /include/sys/errno.h: -------------------------------------------------------------------------------- 1 | #warning redirecting incorrect #include to 2 | #include 3 | -------------------------------------------------------------------------------- /include/sys/fcntl.h: -------------------------------------------------------------------------------- 1 | #warning redirecting incorrect #include to 2 | #include 3 | -------------------------------------------------------------------------------- /include/sys/kd.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_KD_H 2 | #define _SYS_KD_H 3 | 4 | #define _LINUX_TYPES_H 5 | #include 6 | #undef _LINUX_TYPES_H 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /include/sys/klog.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_KLOG_H 2 | #define _SYS_KLOG_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | int klogctl (int, char *, int); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /include/sys/poll.h: -------------------------------------------------------------------------------- 1 | #warning redirecting incorrect #include to 2 | #include 3 | -------------------------------------------------------------------------------- /include/sys/reg.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_REG_H 2 | #define _SYS_REG_H 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /include/sys/signal.h: -------------------------------------------------------------------------------- 1 | #warning redirecting incorrect #include to 2 | #include 3 | -------------------------------------------------------------------------------- /include/sys/soundcard.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /include/sys/stropts.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /include/sys/syscall.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_SYSCALL_H 2 | #define _SYS_SYSCALL_H 3 | 4 | #include 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /include/sys/syslog.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /include/sys/termios.h: -------------------------------------------------------------------------------- 1 | #warning redirecting incorrect #include to 2 | #include 3 | -------------------------------------------------------------------------------- /include/sys/ucontext.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /include/sys/vfs.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /include/sys/vt.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /include/syscall.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /include/wait.h: -------------------------------------------------------------------------------- 1 | #warning redirecting incorrect #include to 2 | #include 3 | -------------------------------------------------------------------------------- /src/complex/cabs.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double cabs(double complex z) 4 | { 5 | return hypot(creal(z), cimag(z)); 6 | } 7 | -------------------------------------------------------------------------------- /src/complex/cabsf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float cabsf(float complex z) 4 | { 5 | return hypotf(crealf(z), cimagf(z)); 6 | } 7 | -------------------------------------------------------------------------------- /src/complex/cacosf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | // FIXME 4 | 5 | float complex cacosf(float complex z) 6 | { 7 | z = casinf(z); 8 | return CMPLXF((float)M_PI_2 - crealf(z), -cimagf(z)); 9 | } 10 | -------------------------------------------------------------------------------- /src/complex/cacosh.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | /* acosh(z) = i acos(z) */ 4 | 5 | double complex cacosh(double complex z) 6 | { 7 | z = cacos(z); 8 | return CMPLX(-cimag(z), creal(z)); 9 | } 10 | -------------------------------------------------------------------------------- /src/complex/cacoshf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float complex cacoshf(float complex z) 4 | { 5 | z = cacosf(z); 6 | return CMPLXF(-cimagf(z), crealf(z)); 7 | } 8 | -------------------------------------------------------------------------------- /src/complex/carg.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double carg(double complex z) 4 | { 5 | return atan2(cimag(z), creal(z)); 6 | } 7 | -------------------------------------------------------------------------------- /src/complex/cargf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float cargf(float complex z) 4 | { 5 | return atan2f(cimagf(z), crealf(z)); 6 | } 7 | -------------------------------------------------------------------------------- /src/complex/casinh.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | /* asinh(z) = -i asin(i z) */ 4 | 5 | double complex casinh(double complex z) 6 | { 7 | z = casin(CMPLX(-cimag(z), creal(z))); 8 | return CMPLX(cimag(z), -creal(z)); 9 | } 10 | -------------------------------------------------------------------------------- /src/complex/casinhf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float complex casinhf(float complex z) 4 | { 5 | z = casinf(CMPLXF(-cimagf(z), crealf(z))); 6 | return CMPLXF(cimagf(z), -crealf(z)); 7 | } 8 | -------------------------------------------------------------------------------- /src/complex/catanh.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | /* atanh = -i atan(i z) */ 4 | 5 | double complex catanh(double complex z) 6 | { 7 | z = catan(CMPLX(-cimag(z), creal(z))); 8 | return CMPLX(cimag(z), -creal(z)); 9 | } 10 | -------------------------------------------------------------------------------- /src/complex/catanhf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float complex catanhf(float complex z) 4 | { 5 | z = catanf(CMPLXF(-cimagf(z), crealf(z))); 6 | return CMPLXF(cimagf(z), -crealf(z)); 7 | } 8 | -------------------------------------------------------------------------------- /src/complex/ccos.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | /* cos(z) = cosh(i z) */ 4 | 5 | double complex ccos(double complex z) 6 | { 7 | return ccosh(CMPLX(-cimag(z), creal(z))); 8 | } 9 | -------------------------------------------------------------------------------- /src/complex/ccosf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float complex ccosf(float complex z) 4 | { 5 | return ccoshf(CMPLXF(-cimagf(z), crealf(z))); 6 | } 7 | -------------------------------------------------------------------------------- /src/complex/ccoshl.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | //FIXME 4 | long double complex ccoshl(long double complex z) 5 | { 6 | return ccosh(z); 7 | } 8 | -------------------------------------------------------------------------------- /src/complex/cexpl.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | //FIXME 4 | long double complex cexpl(long double complex z) 5 | { 6 | return cexp(z); 7 | } 8 | -------------------------------------------------------------------------------- /src/complex/cimag.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double (cimag)(double complex z) 4 | { 5 | return cimag(z); 6 | } 7 | -------------------------------------------------------------------------------- /src/complex/cimagf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float (cimagf)(float complex z) 4 | { 5 | return cimagf(z); 6 | } 7 | -------------------------------------------------------------------------------- /src/complex/cimagl.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | long double (cimagl)(long double complex z) 4 | { 5 | return cimagl(z); 6 | } 7 | -------------------------------------------------------------------------------- /src/complex/clogf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | // FIXME 4 | 5 | float complex clogf(float complex z) 6 | { 7 | float r, phi; 8 | 9 | r = cabsf(z); 10 | phi = cargf(z); 11 | return CMPLXF(logf(r), phi); 12 | } 13 | -------------------------------------------------------------------------------- /src/complex/conj.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double complex conj(double complex z) 4 | { 5 | return CMPLX(creal(z), -cimag(z)); 6 | } 7 | -------------------------------------------------------------------------------- /src/complex/conjf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float complex conjf(float complex z) 4 | { 5 | return CMPLXF(crealf(z), -cimagf(z)); 6 | } 7 | -------------------------------------------------------------------------------- /src/complex/conjl.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | long double complex conjl(long double complex z) 4 | { 5 | return CMPLXL(creall(z), -cimagl(z)); 6 | } 7 | -------------------------------------------------------------------------------- /src/complex/cpow.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | /* pow(z, c) = exp(c log(z)), See C99 G.6.4.1 */ 4 | 5 | double complex cpow(double complex z, double complex c) 6 | { 7 | return cexp(c * clog(z)); 8 | } 9 | -------------------------------------------------------------------------------- /src/complex/cpowf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float complex cpowf(float complex z, float complex c) 4 | { 5 | return cexpf(c * clogf(z)); 6 | } 7 | -------------------------------------------------------------------------------- /src/complex/cproj.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double complex cproj(double complex z) 4 | { 5 | if (isinf(creal(z)) || isinf(cimag(z))) 6 | return CMPLX(INFINITY, copysign(0.0, creal(z))); 7 | return z; 8 | } 9 | -------------------------------------------------------------------------------- /src/complex/cprojf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float complex cprojf(float complex z) 4 | { 5 | if (isinf(crealf(z)) || isinf(cimagf(z))) 6 | return CMPLXF(INFINITY, copysignf(0.0, crealf(z))); 7 | return z; 8 | } 9 | -------------------------------------------------------------------------------- /src/complex/creal.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double (creal)(double complex z) 4 | { 5 | return creal(z); 6 | } 7 | -------------------------------------------------------------------------------- /src/complex/crealf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float (crealf)(float complex z) 4 | { 5 | return crealf(z); 6 | } 7 | -------------------------------------------------------------------------------- /src/complex/creall.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double (creall)(long double complex z) 4 | { 5 | return creall(z); 6 | } 7 | -------------------------------------------------------------------------------- /src/complex/csin.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | /* sin(z) = -i sinh(i z) */ 4 | 5 | double complex csin(double complex z) 6 | { 7 | z = csinh(CMPLX(-cimag(z), creal(z))); 8 | return CMPLX(cimag(z), -creal(z)); 9 | } 10 | -------------------------------------------------------------------------------- /src/complex/csinf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float complex csinf(float complex z) 4 | { 5 | z = csinhf(CMPLXF(-cimagf(z), crealf(z))); 6 | return CMPLXF(cimagf(z), -crealf(z)); 7 | } 8 | -------------------------------------------------------------------------------- /src/complex/csinhl.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | //FIXME 4 | long double complex csinhl(long double complex z) 5 | { 6 | return csinh(z); 7 | } 8 | -------------------------------------------------------------------------------- /src/complex/csqrtl.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | //FIXME 4 | long double complex csqrtl(long double complex z) 5 | { 6 | return csqrt(z); 7 | } 8 | -------------------------------------------------------------------------------- /src/complex/ctan.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | /* tan(z) = -i tanh(i z) */ 4 | 5 | double complex ctan(double complex z) 6 | { 7 | z = ctanh(CMPLX(-cimag(z), creal(z))); 8 | return CMPLX(cimag(z), -creal(z)); 9 | } 10 | -------------------------------------------------------------------------------- /src/complex/ctanf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float complex ctanf(float complex z) 4 | { 5 | z = ctanhf(CMPLXF(-cimagf(z), crealf(z))); 6 | return CMPLXF(cimagf(z), -crealf(z)); 7 | } 8 | -------------------------------------------------------------------------------- /src/complex/ctanhl.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | //FIXME 4 | long double complex ctanhl(long double complex z) 5 | { 6 | return ctanh(z); 7 | } 8 | -------------------------------------------------------------------------------- /src/conf/pathconf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long pathconf(const char *path, int name) 4 | { 5 | return fpathconf(-1, name); 6 | } 7 | -------------------------------------------------------------------------------- /src/ctype/__ctype_get_mb_cur_max.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "locale_impl.h" 3 | 4 | size_t __ctype_get_mb_cur_max() 5 | { 6 | return MB_CUR_MAX; 7 | } 8 | -------------------------------------------------------------------------------- /src/ctype/isascii.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isascii 3 | 4 | int isascii(int c) 5 | { 6 | return !(c&~0x7f); 7 | } 8 | -------------------------------------------------------------------------------- /src/ctype/toascii.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* nonsense function that should NEVER be used! */ 4 | int toascii(int c) 5 | { 6 | return c & 0x7f; 7 | } 8 | -------------------------------------------------------------------------------- /src/ctype/wcswidth.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcswidth(const wchar_t *wcs, size_t n) 4 | { 5 | int l=0, k=0; 6 | for (; n-- && *wcs && (k = wcwidth(*wcs)) >= 0; l+=k, wcs++); 7 | return (k < 0) ? k : l; 8 | } 9 | -------------------------------------------------------------------------------- /src/dirent/__dirent.h: -------------------------------------------------------------------------------- 1 | struct __dirstream 2 | { 3 | int fd; 4 | off_t tell; 5 | int buf_pos; 6 | int buf_end; 7 | volatile int lock[1]; 8 | char buf[2048]; 9 | }; 10 | -------------------------------------------------------------------------------- /src/dirent/closedir.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "__dirent.h" 4 | #include "libc.h" 5 | 6 | int closedir(DIR *dir) 7 | { 8 | int ret = close(dir->fd); 9 | free(dir); 10 | return ret; 11 | } 12 | -------------------------------------------------------------------------------- /src/dirent/dirfd.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "__dirent.h" 3 | 4 | int dirfd(DIR *d) 5 | { 6 | return d->fd; 7 | } 8 | -------------------------------------------------------------------------------- /src/dirent/telldir.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "__dirent.h" 3 | 4 | long telldir(DIR *dir) 5 | { 6 | return dir->tell; 7 | } 8 | -------------------------------------------------------------------------------- /src/env/__environ.c: -------------------------------------------------------------------------------- 1 | #include "libc.h" 2 | 3 | char **__environ = 0; 4 | weak_alias(__environ, ___environ); 5 | weak_alias(__environ, _environ); 6 | weak_alias(__environ, environ); 7 | -------------------------------------------------------------------------------- /src/errno/__errno_location.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "pthread_impl.h" 3 | 4 | int *__errno_location(void) 5 | { 6 | return &__pthread_self()->errno_val; 7 | } 8 | -------------------------------------------------------------------------------- /src/exit/_Exit.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | _Noreturn void _Exit(int ec) 5 | { 6 | __syscall(SYS_exit_group, ec); 7 | for (;;) __syscall(SYS_exit, ec); 8 | } 9 | -------------------------------------------------------------------------------- /src/exit/arm/__aeabi_atexit.c: -------------------------------------------------------------------------------- 1 | int __cxa_atexit(void (*func)(void *), void *arg, void *dso); 2 | 3 | int __aeabi_atexit (void *obj, void (*func) (void *), void *d) 4 | { 5 | return __cxa_atexit (func, obj, d); 6 | } 7 | -------------------------------------------------------------------------------- /src/fcntl/creat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libc.h" 3 | 4 | int creat(const char *filename, mode_t mode) 5 | { 6 | return open(filename, O_CREAT|O_WRONLY|O_TRUNC, mode); 7 | } 8 | 9 | LFS64(creat); 10 | -------------------------------------------------------------------------------- /src/fenv/arm/fenv.c: -------------------------------------------------------------------------------- 1 | #if !__ARM_PCS_VFP 2 | #include "../fenv.c" 3 | #endif 4 | -------------------------------------------------------------------------------- /src/fenv/fegetexceptflag.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int fegetexceptflag(fexcept_t *fp, int mask) 4 | { 5 | *fp = fetestexcept(mask); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/fenv/feholdexcept.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int feholdexcept(fenv_t *envp) 4 | { 5 | fegetenv(envp); 6 | feclearexcept(FE_ALL_EXCEPT); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /src/fenv/fesetexceptflag.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int fesetexceptflag(const fexcept_t *fp, int mask) 4 | { 5 | feclearexcept(~*fp & mask); 6 | feraiseexcept(*fp & mask); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /src/fenv/feupdateenv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int feupdateenv(const fenv_t *envp) 4 | { 5 | int ex = fetestexcept(FE_ALL_EXCEPT); 6 | fesetenv(envp); 7 | feraiseexcept(ex); 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /src/fenv/mips/fenv-sf.c: -------------------------------------------------------------------------------- 1 | #ifdef __mips_soft_float 2 | #include "../fenv.c" 3 | #endif 4 | -------------------------------------------------------------------------------- /src/fenv/mips64/fenv-sf.c: -------------------------------------------------------------------------------- 1 | #ifdef __mips_soft_float 2 | #include "../fenv.c" 3 | #endif 4 | -------------------------------------------------------------------------------- /src/fenv/mipsn32/fenv-sf.c: -------------------------------------------------------------------------------- 1 | #ifdef __mips_soft_float 2 | #include "../fenv.c" 3 | #endif 4 | -------------------------------------------------------------------------------- /src/fenv/powerpc/fenv-sf.c: -------------------------------------------------------------------------------- 1 | #ifdef _SOFT_FLOAT 2 | #include "../fenv.c" 3 | #endif 4 | -------------------------------------------------------------------------------- /src/fenv/sh/fenv-nofpu.c: -------------------------------------------------------------------------------- 1 | #if !__SH_FPU_ANY__ && !__SH4__ 2 | #include "../fenv.c" 3 | #endif 4 | -------------------------------------------------------------------------------- /src/internal/floatscan.h: -------------------------------------------------------------------------------- 1 | #ifndef FLOATSCAN_H 2 | #define FLOATSCAN_H 3 | 4 | #include 5 | 6 | long double __floatscan(FILE *, int, int); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/internal/intscan.h: -------------------------------------------------------------------------------- 1 | #ifndef INTSCAN_H 2 | #define INTSCAN_H 3 | 4 | #include 5 | 6 | unsigned long long __intscan(FILE *, unsigned, int, unsigned long long); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/internal/m68k/syscall.s: -------------------------------------------------------------------------------- 1 | .global __syscall 2 | .hidden __syscall 3 | .type __syscall,%function 4 | __syscall: 5 | movem.l %d2-%d5,-(%sp) 6 | movem.l 20(%sp),%d0-%d5/%a0 7 | trap #0 8 | movem.l (%sp)+,%d2-%d5 9 | rts 10 | -------------------------------------------------------------------------------- /src/internal/sh/__shcall.c: -------------------------------------------------------------------------------- 1 | __attribute__((__visibility__("hidden"))) 2 | int __shcall(void *arg, int (*func)(void *)) 3 | { 4 | return func(arg); 5 | } 6 | -------------------------------------------------------------------------------- /src/internal/syscall.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/src/internal/syscall.c -------------------------------------------------------------------------------- /src/internal/syscall_ret.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | long __syscall_ret(unsigned long r) 5 | { 6 | if (r > -4096UL) { 7 | errno = -r; 8 | return -1; 9 | } 10 | return r; 11 | } 12 | -------------------------------------------------------------------------------- /src/internal/version.c: -------------------------------------------------------------------------------- 1 | #include "version.h" 2 | 3 | static const char version[] = VERSION; 4 | 5 | __attribute__((__visibility__("hidden"))) 6 | const char *__libc_get_version() 7 | { 8 | return version; 9 | } 10 | -------------------------------------------------------------------------------- /src/ldso/aarch64/dlsym.s: -------------------------------------------------------------------------------- 1 | .global dlsym 2 | .hidden __dlsym 3 | .type dlsym,%function 4 | dlsym: 5 | mov x2,x30 6 | b __dlsym 7 | -------------------------------------------------------------------------------- /src/ldso/arm/dlsym.s: -------------------------------------------------------------------------------- 1 | .syntax unified 2 | .text 3 | .global dlsym 4 | .hidden __dlsym 5 | .type dlsym,%function 6 | dlsym: 7 | mov r2,lr 8 | b __dlsym 9 | -------------------------------------------------------------------------------- /src/ldso/dladdr.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "libc.h" 4 | 5 | static int stub_dladdr(const void *addr, Dl_info *info) 6 | { 7 | return 0; 8 | } 9 | 10 | weak_alias(stub_dladdr, dladdr); 11 | -------------------------------------------------------------------------------- /src/ldso/dlclose.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | __attribute__((__visibility__("hidden"))) 4 | int __dl_invalid_handle(void *); 5 | 6 | int dlclose(void *p) 7 | { 8 | return __dl_invalid_handle(p); 9 | } 10 | -------------------------------------------------------------------------------- /src/ldso/dlsym.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void *__dlsym(void *restrict, const char *restrict, void *restrict); 4 | 5 | void *dlsym(void *restrict p, const char *restrict s) 6 | { 7 | return __dlsym(p, s, 0); 8 | } 9 | -------------------------------------------------------------------------------- /src/ldso/i386/dlsym.s: -------------------------------------------------------------------------------- 1 | .text 2 | .global dlsym 3 | .hidden __dlsym 4 | .type dlsym,@function 5 | dlsym: 6 | push (%esp) 7 | push 12(%esp) 8 | push 12(%esp) 9 | call __dlsym 10 | add $12,%esp 11 | ret 12 | -------------------------------------------------------------------------------- /src/ldso/microblaze/dlsym.s: -------------------------------------------------------------------------------- 1 | .global dlsym 2 | .hidden __dlsym 3 | .type dlsym,@function 4 | dlsym: 5 | brid __dlsym 6 | add r7, r15, r0 7 | -------------------------------------------------------------------------------- /src/ldso/or1k/dlsym.s: -------------------------------------------------------------------------------- 1 | .global dlsym 2 | .hidden __dlsym 3 | .type dlsym,@function 4 | dlsym: 5 | l.j __dlsym 6 | l.ori r5, r9, 0 7 | -------------------------------------------------------------------------------- /src/ldso/s390x/dlsym.s: -------------------------------------------------------------------------------- 1 | .global dlsym 2 | .hidden __dlsym 3 | .type dlsym,@function 4 | dlsym: 5 | lgr %r4, %r14 6 | jg __dlsym 7 | -------------------------------------------------------------------------------- /src/ldso/sh/dlsym.s: -------------------------------------------------------------------------------- 1 | .text 2 | .global dlsym 3 | .hidden __dlsym 4 | .type dlsym, @function 5 | dlsym: 6 | mov.l L1, r0 7 | 1: braf r0 8 | mov.l @r15, r6 9 | 10 | .align 2 11 | L1: .long __dlsym@PLT-(1b+4-.) 12 | -------------------------------------------------------------------------------- /src/ldso/x32/dlsym.s: -------------------------------------------------------------------------------- 1 | .text 2 | .global dlsym 3 | .hidden __dlsym 4 | .type dlsym,@function 5 | dlsym: 6 | mov (%rsp),%rdx 7 | jmp __dlsym 8 | -------------------------------------------------------------------------------- /src/ldso/x86_64/dlsym.s: -------------------------------------------------------------------------------- 1 | .text 2 | .global dlsym 3 | .hidden __dlsym 4 | .type dlsym,@function 5 | dlsym: 6 | mov (%rsp),%rdx 7 | jmp __dlsym 8 | -------------------------------------------------------------------------------- /src/legacy/getpagesize.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "libc.h" 4 | 5 | int getpagesize(void) 6 | { 7 | return PAGE_SIZE; 8 | } 9 | -------------------------------------------------------------------------------- /src/legacy/isastream.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int isastream(int fd) 5 | { 6 | return fcntl(fd, F_GETFD) < 0 ? -1 : 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/legacy/valloc.c: -------------------------------------------------------------------------------- 1 | #define _BSD_SOURCE 2 | #include 3 | #include "libc.h" 4 | 5 | void *valloc(size_t size) 6 | { 7 | return memalign(PAGE_SIZE, size); 8 | } 9 | -------------------------------------------------------------------------------- /src/linux/adjtimex.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int adjtimex(struct timex *tx) 5 | { 6 | return syscall(SYS_adjtimex, tx); 7 | } 8 | -------------------------------------------------------------------------------- /src/linux/arch_prctl.c: -------------------------------------------------------------------------------- 1 | #include "syscall.h" 2 | #ifdef SYS_arch_prctl 3 | int arch_prctl(int code, unsigned long addr) 4 | { 5 | return syscall(SYS_arch_prctl, code, addr); 6 | } 7 | #endif 8 | -------------------------------------------------------------------------------- /src/linux/brk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int brk(void *end) 5 | { 6 | return __syscall_ret(-ENOMEM); 7 | } 8 | -------------------------------------------------------------------------------- /src/linux/cap.c: -------------------------------------------------------------------------------- 1 | #include "syscall.h" 2 | 3 | int capset(void *a, void *b) 4 | { 5 | return syscall(SYS_capset, a, b); 6 | } 7 | 8 | int capget(void *a, void *b) 9 | { 10 | return syscall(SYS_capget, a, b); 11 | } 12 | -------------------------------------------------------------------------------- /src/linux/chroot.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "syscall.h" 4 | 5 | int chroot(const char *path) 6 | { 7 | return syscall(SYS_chroot, path); 8 | } 9 | -------------------------------------------------------------------------------- /src/linux/clock_adjtime.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int clock_adjtime (clockid_t clock_id, struct timex *utx) 5 | { 6 | return syscall(SYS_clock_adjtime, clock_id, utx); 7 | } 8 | -------------------------------------------------------------------------------- /src/linux/flock.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int flock(int fd, int op) 5 | { 6 | return syscall(SYS_flock, fd, op); 7 | } 8 | -------------------------------------------------------------------------------- /src/linux/getrandom.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | ssize_t getrandom(void *buf, size_t buflen, unsigned flags) 5 | { 6 | return syscall_cp(SYS_getrandom, buf, buflen, flags); 7 | } 8 | -------------------------------------------------------------------------------- /src/linux/ioperm.c: -------------------------------------------------------------------------------- 1 | #include "syscall.h" 2 | 3 | #ifdef SYS_ioperm 4 | #include 5 | 6 | int ioperm(unsigned long from, unsigned long num, int turn_on) 7 | { 8 | return syscall(SYS_ioperm, from, num, turn_on); 9 | } 10 | #endif 11 | -------------------------------------------------------------------------------- /src/linux/iopl.c: -------------------------------------------------------------------------------- 1 | #include "syscall.h" 2 | 3 | #ifdef SYS_iopl 4 | #include 5 | 6 | int iopl(int level) 7 | { 8 | return syscall(SYS_iopl, level); 9 | } 10 | #endif 11 | -------------------------------------------------------------------------------- /src/linux/klogctl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int klogctl (int type, char *buf, int len) 5 | { 6 | return syscall(SYS_syslog, type, buf, len); 7 | } 8 | -------------------------------------------------------------------------------- /src/linux/personality.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #ifdef SYS_personality 4 | int personality(unsigned long persona) 5 | { 6 | return syscall(SYS_personality, persona); 7 | } 8 | #endif 9 | -------------------------------------------------------------------------------- /src/linux/pivot_root.c: -------------------------------------------------------------------------------- 1 | #include "syscall.h" 2 | 3 | int pivot_root(const char *new, const char *old) 4 | { 5 | return syscall(SYS_pivot_root, new, old); 6 | } 7 | -------------------------------------------------------------------------------- /src/linux/quotactl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int quotactl(int cmd, const char *special, int id, char *addr) 5 | { 6 | return syscall(SYS_quotactl, cmd, special, id, addr); 7 | } 8 | -------------------------------------------------------------------------------- /src/linux/readahead.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "syscall.h" 4 | 5 | ssize_t readahead(int fd, off_t pos, size_t len) 6 | { 7 | return syscall(SYS_readahead, fd, __SYSCALL_LL_O(pos), len); 8 | } 9 | -------------------------------------------------------------------------------- /src/linux/reboot.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int reboot(int type) 5 | { 6 | return syscall(SYS_reboot, 0xfee1dead, 672274793, type); 7 | } 8 | -------------------------------------------------------------------------------- /src/linux/sbrk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "syscall.h" 4 | 5 | void *sbrk(intptr_t inc) 6 | { 7 | if (inc) return (void *)__syscall_ret(-ENOMEM); 8 | return (void *)__syscall(SYS_brk, 0); 9 | } 10 | -------------------------------------------------------------------------------- /src/linux/setfsgid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int setfsgid(gid_t gid) 6 | { 7 | return syscall(SYS_setfsgid, gid); 8 | } 9 | -------------------------------------------------------------------------------- /src/linux/setfsuid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int setfsuid(uid_t uid) 6 | { 7 | return syscall(SYS_setfsuid, uid); 8 | } 9 | -------------------------------------------------------------------------------- /src/linux/setgroups.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "syscall.h" 4 | 5 | int setgroups(size_t count, const gid_t list[]) 6 | { 7 | return syscall(SYS_setgroups, count, list); 8 | } 9 | -------------------------------------------------------------------------------- /src/linux/sethostname.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "syscall.h" 4 | 5 | int sethostname(const char *name, size_t len) 6 | { 7 | return syscall(SYS_sethostname, name, len); 8 | } 9 | -------------------------------------------------------------------------------- /src/linux/setns.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "syscall.h" 4 | 5 | int setns(int fd, int nstype) 6 | { 7 | return syscall(SYS_setns, fd, nstype); 8 | } 9 | -------------------------------------------------------------------------------- /src/linux/settimeofday.c: -------------------------------------------------------------------------------- 1 | #define _BSD_SOURCE 2 | #include 3 | #include "syscall.h" 4 | 5 | int settimeofday(const struct timeval *tv, const struct timezone *tz) 6 | { 7 | return syscall(SYS_settimeofday, tv, 0); 8 | } 9 | -------------------------------------------------------------------------------- /src/linux/stime.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include 4 | 5 | int stime(const time_t *t) 6 | { 7 | struct timeval tv = { .tv_sec = *t, .tv_usec = 0 }; 8 | return settimeofday(&tv, (void *)0); 9 | } 10 | -------------------------------------------------------------------------------- /src/linux/syncfs.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "syscall.h" 4 | 5 | int syncfs(int fd) 6 | { 7 | return syscall(SYS_syncfs, fd); 8 | } 9 | -------------------------------------------------------------------------------- /src/linux/sysinfo.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int __lsysinfo(struct sysinfo *info) 6 | { 7 | return syscall(SYS_sysinfo, info); 8 | } 9 | 10 | weak_alias(__lsysinfo, sysinfo); 11 | -------------------------------------------------------------------------------- /src/linux/tee.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "syscall.h" 4 | 5 | ssize_t tee(int src, int dest, size_t len, unsigned flags) 6 | { 7 | return syscall(SYS_tee, src, dest, len, flags); 8 | } 9 | -------------------------------------------------------------------------------- /src/linux/unshare.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "syscall.h" 4 | 5 | int unshare(int flags) 6 | { 7 | return syscall(SYS_unshare, flags); 8 | } 9 | -------------------------------------------------------------------------------- /src/linux/vhangup.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "syscall.h" 4 | 5 | int vhangup(void) 6 | { 7 | return syscall(SYS_vhangup); 8 | } 9 | -------------------------------------------------------------------------------- /src/linux/vmsplice.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "syscall.h" 4 | 5 | ssize_t vmsplice(int fd, const struct iovec *iov, size_t cnt, unsigned flags) 6 | { 7 | return syscall(SYS_vmsplice, fd, iov, cnt, flags); 8 | } 9 | -------------------------------------------------------------------------------- /src/locale/catclose.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int catclose (nl_catd catd) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /src/locale/catgets.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *catgets (nl_catd catd, int set_id, int msg_id, const char *s) 4 | { 5 | return (char *)s; 6 | } 7 | -------------------------------------------------------------------------------- /src/locale/catopen.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | nl_catd catopen (const char *name, int oflag) 5 | { 6 | errno = EOPNOTSUPP; 7 | return (nl_catd)-1; 8 | } 9 | -------------------------------------------------------------------------------- /src/locale/iconv_close.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int iconv_close(iconv_t cd) 5 | { 6 | if (!((size_t)cd & 1)) free((void *)cd); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /src/malloc/aligned_alloc.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void *__memalign(size_t, size_t); 4 | 5 | void *aligned_alloc(size_t align, size_t len) 6 | { 7 | return __memalign(align, len); 8 | } 9 | -------------------------------------------------------------------------------- /src/math/__invtrigl.h: -------------------------------------------------------------------------------- 1 | /* shared by acosl, asinl and atan2l */ 2 | #define pio2_hi __pio2_hi 3 | #define pio2_lo __pio2_lo 4 | extern const long double pio2_hi, pio2_lo; 5 | 6 | long double __invtrigl_R(long double z); 7 | -------------------------------------------------------------------------------- /src/math/__signbit.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | // FIXME: macro in math.h 4 | int __signbit(double x) 5 | { 6 | union { 7 | double d; 8 | uint64_t i; 9 | } y = { x }; 10 | return y.i>>63; 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/math/__signbitf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | // FIXME: macro in math.h 4 | int __signbitf(float x) 5 | { 6 | union { 7 | float f; 8 | uint32_t i; 9 | } y = { x }; 10 | return y.i>>31; 11 | } 12 | -------------------------------------------------------------------------------- /src/math/aarch64/ceil.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double ceil(double x) 4 | { 5 | __asm__ ("frintp %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/ceilf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float ceilf(float x) 4 | { 5 | __asm__ ("frintp %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/fabs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fabs(double x) 4 | { 5 | __asm__ ("fabs %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/fabsf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fabsf(float x) 4 | { 5 | __asm__ ("fabs %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/floor.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double floor(double x) 4 | { 5 | __asm__ ("frintm %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/floorf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float floorf(float x) 4 | { 5 | __asm__ ("frintm %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/fma.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fma(double x, double y, double z) 4 | { 5 | __asm__ ("fmadd %d0, %d1, %d2, %d3" : "=w"(x) : "w"(x), "w"(y), "w"(z)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/fmaf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fmaf(float x, float y, float z) 4 | { 5 | __asm__ ("fmadd %s0, %s1, %s2, %s3" : "=w"(x) : "w"(x), "w"(y), "w"(z)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/fmax.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fmax(double x, double y) 4 | { 5 | __asm__ ("fmaxnm %d0, %d1, %d2" : "=w"(x) : "w"(x), "w"(y)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/fmaxf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fmaxf(float x, float y) 4 | { 5 | __asm__ ("fmaxnm %s0, %s1, %s2" : "=w"(x) : "w"(x), "w"(y)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/fmin.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fmin(double x, double y) 4 | { 5 | __asm__ ("fminnm %d0, %d1, %d2" : "=w"(x) : "w"(x), "w"(y)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/fminf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fminf(float x, float y) 4 | { 5 | __asm__ ("fminnm %s0, %s1, %s2" : "=w"(x) : "w"(x), "w"(y)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/llrint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llrint(double x) 4 | { 5 | long long n; 6 | __asm__ ( 7 | "frintx %d1, %d1\n" 8 | "fcvtzs %x0, %d1\n" : "=r"(n), "+w"(x)); 9 | return n; 10 | } 11 | -------------------------------------------------------------------------------- /src/math/aarch64/llrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llrintf(float x) 4 | { 5 | long long n; 6 | __asm__ ( 7 | "frintx %s1, %s1\n" 8 | "fcvtzs %x0, %s1\n" : "=r"(n), "+w"(x)); 9 | return n; 10 | } 11 | -------------------------------------------------------------------------------- /src/math/aarch64/llround.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llround(double x) 4 | { 5 | long long n; 6 | __asm__ ("fcvtas %x0, %d1" : "=r"(n) : "w"(x)); 7 | return n; 8 | } 9 | -------------------------------------------------------------------------------- /src/math/aarch64/llroundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llroundf(float x) 4 | { 5 | long long n; 6 | __asm__ ("fcvtas %x0, %s1" : "=r"(n) : "w"(x)); 7 | return n; 8 | } 9 | -------------------------------------------------------------------------------- /src/math/aarch64/lrint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lrint(double x) 4 | { 5 | long n; 6 | __asm__ ( 7 | "frintx %d1, %d1\n" 8 | "fcvtzs %x0, %d1\n" : "=r"(n), "+w"(x)); 9 | return n; 10 | } 11 | -------------------------------------------------------------------------------- /src/math/aarch64/lrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lrintf(float x) 4 | { 5 | long n; 6 | __asm__ ( 7 | "frintx %s1, %s1\n" 8 | "fcvtzs %x0, %s1\n" : "=r"(n), "+w"(x)); 9 | return n; 10 | } 11 | -------------------------------------------------------------------------------- /src/math/aarch64/lround.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lround(double x) 4 | { 5 | long n; 6 | __asm__ ("fcvtas %x0, %d1" : "=r"(n) : "w"(x)); 7 | return n; 8 | } 9 | -------------------------------------------------------------------------------- /src/math/aarch64/lroundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lroundf(float x) 4 | { 5 | long n; 6 | __asm__ ("fcvtas %x0, %s1" : "=r"(n) : "w"(x)); 7 | return n; 8 | } 9 | -------------------------------------------------------------------------------- /src/math/aarch64/nearbyint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double nearbyint(double x) 4 | { 5 | __asm__ ("frinti %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/nearbyintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float nearbyintf(float x) 4 | { 5 | __asm__ ("frinti %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/rint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double rint(double x) 4 | { 5 | __asm__ ("frintx %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/rintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float rintf(float x) 4 | { 5 | __asm__ ("frintx %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/round.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double round(double x) 4 | { 5 | __asm__ ("frinta %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/roundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float roundf(float x) 4 | { 5 | __asm__ ("frinta %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/sqrt.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double sqrt(double x) 4 | { 5 | __asm__ ("fsqrt %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/sqrtf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float sqrtf(float x) 4 | { 5 | __asm__ ("fsqrt %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/trunc.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double trunc(double x) 4 | { 5 | __asm__ ("frintz %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/aarch64/truncf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float truncf(float x) 4 | { 5 | __asm__ ("frintz %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/copysign.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double copysign(double x, double y) { 4 | union {double f; uint64_t i;} ux={x}, uy={y}; 5 | ux.i &= -1ULL/2; 6 | ux.i |= uy.i & 1ULL<<63; 7 | return ux.f; 8 | } 9 | -------------------------------------------------------------------------------- /src/math/fabs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | double fabs(double x) 5 | { 6 | union {double f; uint64_t i;} u = {x}; 7 | u.i &= -1ULL/2; 8 | return u.f; 9 | } 10 | -------------------------------------------------------------------------------- /src/math/fabsf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | float fabsf(float x) 5 | { 6 | union {float f; uint32_t i;} u = {x}; 7 | u.i &= 0x7fffffff; 8 | return u.f; 9 | } 10 | -------------------------------------------------------------------------------- /src/math/fdim.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fdim(double x, double y) 4 | { 5 | if (isnan(x)) 6 | return x; 7 | if (isnan(y)) 8 | return y; 9 | return x > y ? x - y : 0; 10 | } 11 | -------------------------------------------------------------------------------- /src/math/fdimf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fdimf(float x, float y) 4 | { 5 | if (isnan(x)) 6 | return x; 7 | if (isnan(y)) 8 | return y; 9 | return x > y ? x - y : 0; 10 | } 11 | -------------------------------------------------------------------------------- /src/math/finite.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | int finite(double x) 5 | { 6 | return isfinite(x); 7 | } 8 | -------------------------------------------------------------------------------- /src/math/finitef.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | int finitef(float x) 5 | { 6 | return isfinite(x); 7 | } 8 | -------------------------------------------------------------------------------- /src/math/i386/__invtrigl.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/src/math/i386/__invtrigl.s -------------------------------------------------------------------------------- /src/math/i386/acosf.s: -------------------------------------------------------------------------------- 1 | # see acos.s 2 | -------------------------------------------------------------------------------- /src/math/i386/acosl.s: -------------------------------------------------------------------------------- 1 | # see acos.s 2 | -------------------------------------------------------------------------------- /src/math/i386/asinf.s: -------------------------------------------------------------------------------- 1 | # see asin.s 2 | -------------------------------------------------------------------------------- /src/math/i386/asinl.s: -------------------------------------------------------------------------------- 1 | # see asin.s 2 | -------------------------------------------------------------------------------- /src/math/i386/atan2l.s: -------------------------------------------------------------------------------- 1 | .global atan2l 2 | .type atan2l,@function 3 | atan2l: 4 | fldt 4(%esp) 5 | fldt 16(%esp) 6 | fpatan 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/i386/atanl.s: -------------------------------------------------------------------------------- 1 | .global atanl 2 | .type atanl,@function 3 | atanl: 4 | fldt 4(%esp) 5 | fld1 6 | fpatan 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/i386/ceil.s: -------------------------------------------------------------------------------- 1 | # see floor.s 2 | -------------------------------------------------------------------------------- /src/math/i386/ceilf.s: -------------------------------------------------------------------------------- 1 | # see floor.s 2 | -------------------------------------------------------------------------------- /src/math/i386/ceill.s: -------------------------------------------------------------------------------- 1 | # see floor.s 2 | -------------------------------------------------------------------------------- /src/math/i386/exp2.s: -------------------------------------------------------------------------------- 1 | # see exp.s 2 | -------------------------------------------------------------------------------- /src/math/i386/exp2f.s: -------------------------------------------------------------------------------- 1 | # see exp.s 2 | -------------------------------------------------------------------------------- /src/math/i386/exp2l.s: -------------------------------------------------------------------------------- 1 | # see exp.s 2 | -------------------------------------------------------------------------------- /src/math/i386/expf.s: -------------------------------------------------------------------------------- 1 | # see exp.s 2 | -------------------------------------------------------------------------------- /src/math/i386/expm1.s: -------------------------------------------------------------------------------- 1 | # see exp.s 2 | -------------------------------------------------------------------------------- /src/math/i386/expm1f.s: -------------------------------------------------------------------------------- 1 | # see exp.s 2 | -------------------------------------------------------------------------------- /src/math/i386/expm1l.s: -------------------------------------------------------------------------------- 1 | # see exp.s 2 | -------------------------------------------------------------------------------- /src/math/i386/fabs.s: -------------------------------------------------------------------------------- 1 | .global fabs 2 | .type fabs,@function 3 | fabs: 4 | fldl 4(%esp) 5 | fabs 6 | ret 7 | -------------------------------------------------------------------------------- /src/math/i386/fabsf.s: -------------------------------------------------------------------------------- 1 | .global fabsf 2 | .type fabsf,@function 3 | fabsf: 4 | flds 4(%esp) 5 | fabs 6 | ret 7 | -------------------------------------------------------------------------------- /src/math/i386/fabsl.s: -------------------------------------------------------------------------------- 1 | .global fabsl 2 | .type fabsl,@function 3 | fabsl: 4 | fldt 4(%esp) 5 | fabs 6 | ret 7 | -------------------------------------------------------------------------------- /src/math/i386/floorf.s: -------------------------------------------------------------------------------- 1 | # see floor.s 2 | -------------------------------------------------------------------------------- /src/math/i386/floorl.s: -------------------------------------------------------------------------------- 1 | # see floor.s 2 | -------------------------------------------------------------------------------- /src/math/i386/fmod.s: -------------------------------------------------------------------------------- 1 | .global fmod 2 | .type fmod,@function 3 | fmod: 4 | fldl 12(%esp) 5 | fldl 4(%esp) 6 | 1: fprem 7 | fnstsw %ax 8 | sahf 9 | jp 1b 10 | fstp %st(1) 11 | ret 12 | -------------------------------------------------------------------------------- /src/math/i386/fmodf.s: -------------------------------------------------------------------------------- 1 | .global fmodf 2 | .type fmodf,@function 3 | fmodf: 4 | flds 8(%esp) 5 | flds 4(%esp) 6 | 1: fprem 7 | fnstsw %ax 8 | sahf 9 | jp 1b 10 | fstp %st(1) 11 | ret 12 | -------------------------------------------------------------------------------- /src/math/i386/fmodl.s: -------------------------------------------------------------------------------- 1 | .global fmodl 2 | .type fmodl,@function 3 | fmodl: 4 | fldt 16(%esp) 5 | fldt 4(%esp) 6 | 1: fprem 7 | fnstsw %ax 8 | sahf 9 | jp 1b 10 | fstp %st(1) 11 | ret 12 | -------------------------------------------------------------------------------- /src/math/i386/ldexp.s: -------------------------------------------------------------------------------- 1 | # see scalbn.s 2 | -------------------------------------------------------------------------------- /src/math/i386/ldexpf.s: -------------------------------------------------------------------------------- 1 | # see scalbnf.s 2 | -------------------------------------------------------------------------------- /src/math/i386/ldexpl.s: -------------------------------------------------------------------------------- 1 | # see scalbnl.s 2 | -------------------------------------------------------------------------------- /src/math/i386/llrint.s: -------------------------------------------------------------------------------- 1 | .global llrint 2 | .type llrint,@function 3 | llrint: 4 | fldl 4(%esp) 5 | fistpll 4(%esp) 6 | mov 4(%esp),%eax 7 | mov 8(%esp),%edx 8 | ret 9 | -------------------------------------------------------------------------------- /src/math/i386/llrintf.s: -------------------------------------------------------------------------------- 1 | .global llrintf 2 | .type llrintf,@function 3 | llrintf: 4 | sub $8,%esp 5 | flds 12(%esp) 6 | fistpll (%esp) 7 | pop %eax 8 | pop %edx 9 | ret 10 | -------------------------------------------------------------------------------- /src/math/i386/llrintl.s: -------------------------------------------------------------------------------- 1 | .global llrintl 2 | .type llrintl,@function 3 | llrintl: 4 | fldt 4(%esp) 5 | fistpll 4(%esp) 6 | mov 4(%esp),%eax 7 | mov 8(%esp),%edx 8 | ret 9 | -------------------------------------------------------------------------------- /src/math/i386/log.s: -------------------------------------------------------------------------------- 1 | .global log 2 | .type log,@function 3 | log: 4 | fldln2 5 | fldl 4(%esp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/i386/log10.s: -------------------------------------------------------------------------------- 1 | .global log10 2 | .type log10,@function 3 | log10: 4 | fldlg2 5 | fldl 4(%esp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/i386/log10f.s: -------------------------------------------------------------------------------- 1 | .global log10f 2 | .type log10f,@function 3 | log10f: 4 | fldlg2 5 | flds 4(%esp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/i386/log10l.s: -------------------------------------------------------------------------------- 1 | .global log10l 2 | .type log10l,@function 3 | log10l: 4 | fldlg2 5 | fldt 4(%esp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/i386/log2.s: -------------------------------------------------------------------------------- 1 | .global log2 2 | .type log2,@function 3 | log2: 4 | fld1 5 | fldl 4(%esp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/i386/log2f.s: -------------------------------------------------------------------------------- 1 | .global log2f 2 | .type log2f,@function 3 | log2f: 4 | fld1 5 | flds 4(%esp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/i386/log2l.s: -------------------------------------------------------------------------------- 1 | .global log2l 2 | .type log2l,@function 3 | log2l: 4 | fld1 5 | fldt 4(%esp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/i386/logf.s: -------------------------------------------------------------------------------- 1 | .global logf 2 | .type logf,@function 3 | logf: 4 | fldln2 5 | flds 4(%esp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/i386/logl.s: -------------------------------------------------------------------------------- 1 | .global logl 2 | .type logl,@function 3 | logl: 4 | fldln2 5 | fldt 4(%esp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/i386/lrint.s: -------------------------------------------------------------------------------- 1 | .global lrint 2 | .type lrint,@function 3 | lrint: 4 | fldl 4(%esp) 5 | fistpl 4(%esp) 6 | mov 4(%esp),%eax 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/i386/lrintf.s: -------------------------------------------------------------------------------- 1 | .global lrintf 2 | .type lrintf,@function 3 | lrintf: 4 | flds 4(%esp) 5 | fistpl 4(%esp) 6 | mov 4(%esp),%eax 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/i386/lrintl.s: -------------------------------------------------------------------------------- 1 | .global lrintl 2 | .type lrintl,@function 3 | lrintl: 4 | fldt 4(%esp) 5 | fistpl 4(%esp) 6 | mov 4(%esp),%eax 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/i386/remainderl.s: -------------------------------------------------------------------------------- 1 | .global remainderl 2 | .type remainderl,@function 3 | remainderl: 4 | fldt 16(%esp) 5 | fldt 4(%esp) 6 | 1: fprem1 7 | fnstsw %ax 8 | sahf 9 | jp 1b 10 | fstp %st(1) 11 | ret 12 | -------------------------------------------------------------------------------- /src/math/i386/remquof.s: -------------------------------------------------------------------------------- 1 | # see remquo.s 2 | -------------------------------------------------------------------------------- /src/math/i386/remquol.s: -------------------------------------------------------------------------------- 1 | # see remquo.s 2 | -------------------------------------------------------------------------------- /src/math/i386/rint.s: -------------------------------------------------------------------------------- 1 | .global rint 2 | .type rint,@function 3 | rint: 4 | fldl 4(%esp) 5 | frndint 6 | ret 7 | -------------------------------------------------------------------------------- /src/math/i386/rintf.s: -------------------------------------------------------------------------------- 1 | .global rintf 2 | .type rintf,@function 3 | rintf: 4 | flds 4(%esp) 5 | frndint 6 | ret 7 | -------------------------------------------------------------------------------- /src/math/i386/rintl.s: -------------------------------------------------------------------------------- 1 | .global rintl 2 | .type rintl,@function 3 | rintl: 4 | fldt 4(%esp) 5 | frndint 6 | ret 7 | -------------------------------------------------------------------------------- /src/math/i386/scalbln.s: -------------------------------------------------------------------------------- 1 | # see scalbn.s 2 | -------------------------------------------------------------------------------- /src/math/i386/scalblnf.s: -------------------------------------------------------------------------------- 1 | # see scalbnf.s 2 | -------------------------------------------------------------------------------- /src/math/i386/scalblnl.s: -------------------------------------------------------------------------------- 1 | # see scalbnl.s 2 | -------------------------------------------------------------------------------- /src/math/i386/sqrtf.s: -------------------------------------------------------------------------------- 1 | .global sqrtf 2 | .type sqrtf,@function 3 | sqrtf: flds 4(%esp) 4 | fsqrt 5 | fstps 4(%esp) 6 | flds 4(%esp) 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/i386/sqrtl.s: -------------------------------------------------------------------------------- 1 | .global sqrtl 2 | .type sqrtl,@function 3 | sqrtl: fldt 4(%esp) 4 | fsqrt 5 | ret 6 | -------------------------------------------------------------------------------- /src/math/i386/trunc.s: -------------------------------------------------------------------------------- 1 | # see floor.s 2 | -------------------------------------------------------------------------------- /src/math/i386/truncf.s: -------------------------------------------------------------------------------- 1 | # see floor.s 2 | -------------------------------------------------------------------------------- /src/math/i386/truncl.s: -------------------------------------------------------------------------------- 1 | # see floor.s 2 | -------------------------------------------------------------------------------- /src/math/ldexp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double ldexp(double x, int n) 4 | { 5 | return scalbn(x, n); 6 | } 7 | -------------------------------------------------------------------------------- /src/math/ldexpf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float ldexpf(float x, int n) 4 | { 5 | return scalbnf(x, n); 6 | } 7 | -------------------------------------------------------------------------------- /src/math/ldexpl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double ldexpl(long double x, int n) 4 | { 5 | return scalbnl(x, n); 6 | } 7 | -------------------------------------------------------------------------------- /src/math/lgamma.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern int __signgam; 4 | double __lgamma_r(double, int *); 5 | 6 | double lgamma(double x) 7 | { 8 | return __lgamma_r(x, &__signgam); 9 | } 10 | -------------------------------------------------------------------------------- /src/math/lgammaf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern int __signgam; 4 | float __lgammaf_r(float, int *); 5 | 6 | float lgammaf(float x) 7 | { 8 | return __lgammaf_r(x, &__signgam); 9 | } 10 | -------------------------------------------------------------------------------- /src/math/llrint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* uses LLONG_MAX > 2^53, see comments in lrint.c */ 4 | 5 | long long llrint(double x) 6 | { 7 | return rint(x); 8 | } 9 | -------------------------------------------------------------------------------- /src/math/llrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* uses LLONG_MAX > 2^24, see comments in lrint.c */ 4 | 5 | long long llrintf(float x) 6 | { 7 | return rintf(x); 8 | } 9 | -------------------------------------------------------------------------------- /src/math/llround.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llround(double x) 4 | { 5 | return round(x); 6 | } 7 | -------------------------------------------------------------------------------- /src/math/llroundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llroundf(float x) 4 | { 5 | return roundf(x); 6 | } 7 | -------------------------------------------------------------------------------- /src/math/llroundl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llroundl(long double x) 4 | { 5 | return roundl(x); 6 | } 7 | -------------------------------------------------------------------------------- /src/math/logbf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float logbf(float x) 4 | { 5 | if (!isfinite(x)) 6 | return x * x; 7 | if (x == 0) 8 | return -1/(x*x); 9 | return ilogbf(x); 10 | } 11 | -------------------------------------------------------------------------------- /src/math/lrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* uses LONG_MAX > 2^24, see comments in lrint.c */ 4 | 5 | long lrintf(float x) 6 | { 7 | return rintf(x); 8 | } 9 | -------------------------------------------------------------------------------- /src/math/lround.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lround(double x) 4 | { 5 | return round(x); 6 | } 7 | -------------------------------------------------------------------------------- /src/math/lroundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lroundf(float x) 4 | { 5 | return roundf(x); 6 | } 7 | -------------------------------------------------------------------------------- /src/math/lroundl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lroundl(long double x) 4 | { 5 | return roundl(x); 6 | } 7 | -------------------------------------------------------------------------------- /src/math/nan.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double nan(const char *s) 4 | { 5 | return NAN; 6 | } 7 | -------------------------------------------------------------------------------- /src/math/nanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float nanf(const char *s) 4 | { 5 | return NAN; 6 | } 7 | -------------------------------------------------------------------------------- /src/math/nanl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double nanl(const char *s) 4 | { 5 | return NAN; 6 | } 7 | -------------------------------------------------------------------------------- /src/math/nexttowardl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double nexttowardl(long double x, long double y) 4 | { 5 | return nextafterl(x, y); 6 | } 7 | -------------------------------------------------------------------------------- /src/math/powerpc64/fabs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fabs(double x) 4 | { 5 | __asm__ ("fabs %0, %1" : "=d"(x) : "d"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/powerpc64/fabsf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fabsf(float x) 4 | { 5 | __asm__ ("fabs %0, %1" : "=f"(x) : "f"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/powerpc64/fma.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fma(double x, double y, double z) 4 | { 5 | __asm__ ("fmadd %0, %1, %2, %3" : "=d"(x) : "d"(x), "d"(y), "d"(z)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/powerpc64/fmaf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fmaf(float x, float y, float z) 4 | { 5 | __asm__ ("fmadds %0, %1, %2, %3" : "=f"(x) : "f"(x), "f"(y), "f"(z)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/powerpc64/sqrt.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double sqrt(double x) 4 | { 5 | __asm__ ("fsqrt %0, %1" : "=d"(x) : "d"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/powerpc64/sqrtf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float sqrtf(float x) 4 | { 5 | __asm__ ("fsqrts %0, %1" : "=f"(x) : "f"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /src/math/remainder.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libc.h" 3 | 4 | double remainder(double x, double y) 5 | { 6 | int q; 7 | return remquo(x, y, &q); 8 | } 9 | 10 | weak_alias(remainder, drem); 11 | -------------------------------------------------------------------------------- /src/math/remainderf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libc.h" 3 | 4 | float remainderf(float x, float y) 5 | { 6 | int q; 7 | return remquof(x, y, &q); 8 | } 9 | 10 | weak_alias(remainderf, dremf); 11 | -------------------------------------------------------------------------------- /src/math/scalbln.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | double scalbln(double x, long n) 5 | { 6 | if (n > INT_MAX) 7 | n = INT_MAX; 8 | else if (n < INT_MIN) 9 | n = INT_MIN; 10 | return scalbn(x, n); 11 | } 12 | -------------------------------------------------------------------------------- /src/math/scalblnf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | float scalblnf(float x, long n) 5 | { 6 | if (n > INT_MAX) 7 | n = INT_MAX; 8 | else if (n < INT_MIN) 9 | n = INT_MIN; 10 | return scalbnf(x, n); 11 | } 12 | -------------------------------------------------------------------------------- /src/math/signgam.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libc.h" 3 | 4 | int __signgam = 0; 5 | 6 | weak_alias(__signgam, signgam); 7 | -------------------------------------------------------------------------------- /src/math/significand.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | double significand(double x) 5 | { 6 | return scalbn(x, -ilogb(x)); 7 | } 8 | -------------------------------------------------------------------------------- /src/math/significandf.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | float significandf(float x) 5 | { 6 | return scalbnf(x, -ilogbf(x)); 7 | } 8 | -------------------------------------------------------------------------------- /src/math/sqrtl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double sqrtl(long double x) 4 | { 5 | /* FIXME: implement in C, this is for LDBL_MANT_DIG == 64 only */ 6 | return sqrt(x); 7 | } 8 | -------------------------------------------------------------------------------- /src/math/tgammaf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float tgammaf(float x) 4 | { 5 | return tgamma(x); 6 | } 7 | -------------------------------------------------------------------------------- /src/math/x32/__invtrigl.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/src/math/x32/__invtrigl.s -------------------------------------------------------------------------------- /src/math/x32/asinl.s: -------------------------------------------------------------------------------- 1 | .global asinl 2 | .type asinl,@function 3 | asinl: 4 | fldt 8(%esp) 5 | 1: fld %st(0) 6 | fld1 7 | fsub %st(0),%st(1) 8 | fadd %st(2) 9 | fmulp 10 | fsqrt 11 | fpatan 12 | ret 13 | -------------------------------------------------------------------------------- /src/math/x32/atan2l.s: -------------------------------------------------------------------------------- 1 | .global atan2l 2 | .type atan2l,@function 3 | atan2l: 4 | fldt 8(%esp) 5 | fldt 24(%esp) 6 | fpatan 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/x32/atanl.s: -------------------------------------------------------------------------------- 1 | .global atanl 2 | .type atanl,@function 3 | atanl: 4 | fldt 8(%esp) 5 | fld1 6 | fpatan 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/x32/ceill.s: -------------------------------------------------------------------------------- 1 | # see floorl.s 2 | -------------------------------------------------------------------------------- /src/math/x32/expm1l.s: -------------------------------------------------------------------------------- 1 | # see exp2l.s 2 | -------------------------------------------------------------------------------- /src/math/x32/fabs.s: -------------------------------------------------------------------------------- 1 | .global fabs 2 | .type fabs,@function 3 | fabs: 4 | xor %eax,%eax 5 | dec %rax 6 | shr %rax 7 | movq %rax,%xmm1 8 | andpd %xmm1,%xmm0 9 | ret 10 | -------------------------------------------------------------------------------- /src/math/x32/fabsf.s: -------------------------------------------------------------------------------- 1 | .global fabsf 2 | .type fabsf,@function 3 | fabsf: 4 | mov $0x7fffffff,%eax 5 | movq %rax,%xmm1 6 | andps %xmm1,%xmm0 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/x32/fabsl.s: -------------------------------------------------------------------------------- 1 | .global fabsl 2 | .type fabsl,@function 3 | fabsl: 4 | fldt 8(%esp) 5 | fabs 6 | ret 7 | -------------------------------------------------------------------------------- /src/math/x32/fmodl.s: -------------------------------------------------------------------------------- 1 | .global fmodl 2 | .type fmodl,@function 3 | fmodl: 4 | fldt 24(%esp) 5 | fldt 8(%esp) 6 | 1: fprem 7 | fnstsw %ax 8 | testb $4,%ah 9 | jnz 1b 10 | fstp %st(1) 11 | ret 12 | -------------------------------------------------------------------------------- /src/math/x32/llrint.s: -------------------------------------------------------------------------------- 1 | .global llrint 2 | .type llrint,@function 3 | llrint: 4 | cvtsd2si %xmm0,%rax 5 | ret 6 | -------------------------------------------------------------------------------- /src/math/x32/llrintf.s: -------------------------------------------------------------------------------- 1 | .global llrintf 2 | .type llrintf,@function 3 | llrintf: 4 | cvtss2si %xmm0,%rax 5 | ret 6 | -------------------------------------------------------------------------------- /src/math/x32/llrintl.s: -------------------------------------------------------------------------------- 1 | .global llrintl 2 | .type llrintl,@function 3 | llrintl: 4 | fldt 8(%esp) 5 | fistpll 8(%esp) 6 | mov 8(%esp),%rax 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/x32/log10l.s: -------------------------------------------------------------------------------- 1 | .global log10l 2 | .type log10l,@function 3 | log10l: 4 | fldlg2 5 | fldt 8(%esp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/x32/log2l.s: -------------------------------------------------------------------------------- 1 | .global log2l 2 | .type log2l,@function 3 | log2l: 4 | fld1 5 | fldt 8(%esp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/x32/logl.s: -------------------------------------------------------------------------------- 1 | .global logl 2 | .type logl,@function 3 | logl: 4 | fldln2 5 | fldt 8(%esp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/x32/lrint.s: -------------------------------------------------------------------------------- 1 | .global lrint 2 | .type lrint,@function 3 | lrint: 4 | cvtsd2si %xmm0,%rax 5 | ret 6 | -------------------------------------------------------------------------------- /src/math/x32/lrintf.s: -------------------------------------------------------------------------------- 1 | .global lrintf 2 | .type lrintf,@function 3 | lrintf: 4 | cvtss2si %xmm0,%rax 5 | ret 6 | -------------------------------------------------------------------------------- /src/math/x32/lrintl.s: -------------------------------------------------------------------------------- 1 | .global lrintl 2 | .type lrintl,@function 3 | lrintl: 4 | fldt 8(%esp) 5 | fistpll 8(%esp) 6 | mov 8(%esp),%rax 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/x32/remainderl.s: -------------------------------------------------------------------------------- 1 | .global remainderl 2 | .type remainderl,@function 3 | remainderl: 4 | fldt 24(%esp) 5 | fldt 8(%esp) 6 | 1: fprem1 7 | fnstsw %ax 8 | testb $4,%ah 9 | jnz 1b 10 | fstp %st(1) 11 | ret 12 | -------------------------------------------------------------------------------- /src/math/x32/rintl.s: -------------------------------------------------------------------------------- 1 | .global rintl 2 | .type rintl,@function 3 | rintl: 4 | fldt 8(%esp) 5 | frndint 6 | ret 7 | -------------------------------------------------------------------------------- /src/math/x32/sqrt.s: -------------------------------------------------------------------------------- 1 | .global sqrt 2 | .type sqrt,@function 3 | sqrt: sqrtsd %xmm0, %xmm0 4 | ret 5 | -------------------------------------------------------------------------------- /src/math/x32/sqrtf.s: -------------------------------------------------------------------------------- 1 | .global sqrtf 2 | .type sqrtf,@function 3 | sqrtf: sqrtss %xmm0, %xmm0 4 | ret 5 | -------------------------------------------------------------------------------- /src/math/x32/sqrtl.s: -------------------------------------------------------------------------------- 1 | .global sqrtl 2 | .type sqrtl,@function 3 | sqrtl: fldt 8(%esp) 4 | fsqrt 5 | ret 6 | -------------------------------------------------------------------------------- /src/math/x32/truncl.s: -------------------------------------------------------------------------------- 1 | # see floorl.s 2 | -------------------------------------------------------------------------------- /src/math/x86_64/__invtrigl.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/src/math/x86_64/__invtrigl.s -------------------------------------------------------------------------------- /src/math/x86_64/asinl.s: -------------------------------------------------------------------------------- 1 | .global asinl 2 | .type asinl,@function 3 | asinl: 4 | fldt 8(%rsp) 5 | 1: fld %st(0) 6 | fld1 7 | fsub %st(0),%st(1) 8 | fadd %st(2) 9 | fmulp 10 | fsqrt 11 | fpatan 12 | ret 13 | -------------------------------------------------------------------------------- /src/math/x86_64/atan2l.s: -------------------------------------------------------------------------------- 1 | .global atan2l 2 | .type atan2l,@function 3 | atan2l: 4 | fldt 8(%rsp) 5 | fldt 24(%rsp) 6 | fpatan 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/x86_64/atanl.s: -------------------------------------------------------------------------------- 1 | .global atanl 2 | .type atanl,@function 3 | atanl: 4 | fldt 8(%rsp) 5 | fld1 6 | fpatan 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/x86_64/ceill.s: -------------------------------------------------------------------------------- 1 | # see floorl.s 2 | -------------------------------------------------------------------------------- /src/math/x86_64/expm1l.s: -------------------------------------------------------------------------------- 1 | # see exp2l.s 2 | -------------------------------------------------------------------------------- /src/math/x86_64/fabs.s: -------------------------------------------------------------------------------- 1 | .global fabs 2 | .type fabs,@function 3 | fabs: 4 | xor %eax,%eax 5 | dec %rax 6 | shr %rax 7 | movq %rax,%xmm1 8 | andpd %xmm1,%xmm0 9 | ret 10 | -------------------------------------------------------------------------------- /src/math/x86_64/fabsf.s: -------------------------------------------------------------------------------- 1 | .global fabsf 2 | .type fabsf,@function 3 | fabsf: 4 | mov $0x7fffffff,%eax 5 | movq %rax,%xmm1 6 | andps %xmm1,%xmm0 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/x86_64/fabsl.s: -------------------------------------------------------------------------------- 1 | .global fabsl 2 | .type fabsl,@function 3 | fabsl: 4 | fldt 8(%rsp) 5 | fabs 6 | ret 7 | -------------------------------------------------------------------------------- /src/math/x86_64/fmodl.s: -------------------------------------------------------------------------------- 1 | .global fmodl 2 | .type fmodl,@function 3 | fmodl: 4 | fldt 24(%rsp) 5 | fldt 8(%rsp) 6 | 1: fprem 7 | fnstsw %ax 8 | testb $4,%ah 9 | jnz 1b 10 | fstp %st(1) 11 | ret 12 | -------------------------------------------------------------------------------- /src/math/x86_64/llrint.s: -------------------------------------------------------------------------------- 1 | .global llrint 2 | .type llrint,@function 3 | llrint: 4 | cvtsd2si %xmm0,%rax 5 | ret 6 | -------------------------------------------------------------------------------- /src/math/x86_64/llrintf.s: -------------------------------------------------------------------------------- 1 | .global llrintf 2 | .type llrintf,@function 3 | llrintf: 4 | cvtss2si %xmm0,%rax 5 | ret 6 | -------------------------------------------------------------------------------- /src/math/x86_64/llrintl.s: -------------------------------------------------------------------------------- 1 | .global llrintl 2 | .type llrintl,@function 3 | llrintl: 4 | fldt 8(%rsp) 5 | fistpll 8(%rsp) 6 | mov 8(%rsp),%rax 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/x86_64/log10l.s: -------------------------------------------------------------------------------- 1 | .global log10l 2 | .type log10l,@function 3 | log10l: 4 | fldlg2 5 | fldt 8(%rsp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/x86_64/log2l.s: -------------------------------------------------------------------------------- 1 | .global log2l 2 | .type log2l,@function 3 | log2l: 4 | fld1 5 | fldt 8(%rsp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/x86_64/logl.s: -------------------------------------------------------------------------------- 1 | .global logl 2 | .type logl,@function 3 | logl: 4 | fldln2 5 | fldt 8(%rsp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/x86_64/lrint.s: -------------------------------------------------------------------------------- 1 | .global lrint 2 | .type lrint,@function 3 | lrint: 4 | cvtsd2si %xmm0,%rax 5 | ret 6 | -------------------------------------------------------------------------------- /src/math/x86_64/lrintf.s: -------------------------------------------------------------------------------- 1 | .global lrintf 2 | .type lrintf,@function 3 | lrintf: 4 | cvtss2si %xmm0,%rax 5 | ret 6 | -------------------------------------------------------------------------------- /src/math/x86_64/lrintl.s: -------------------------------------------------------------------------------- 1 | .global lrintl 2 | .type lrintl,@function 3 | lrintl: 4 | fldt 8(%rsp) 5 | fistpll 8(%rsp) 6 | mov 8(%rsp),%rax 7 | ret 8 | -------------------------------------------------------------------------------- /src/math/x86_64/remainderl.s: -------------------------------------------------------------------------------- 1 | .global remainderl 2 | .type remainderl,@function 3 | remainderl: 4 | fldt 24(%rsp) 5 | fldt 8(%rsp) 6 | 1: fprem1 7 | fnstsw %ax 8 | testb $4,%ah 9 | jnz 1b 10 | fstp %st(1) 11 | ret 12 | -------------------------------------------------------------------------------- /src/math/x86_64/rintl.s: -------------------------------------------------------------------------------- 1 | .global rintl 2 | .type rintl,@function 3 | rintl: 4 | fldt 8(%rsp) 5 | frndint 6 | ret 7 | -------------------------------------------------------------------------------- /src/math/x86_64/sqrt.s: -------------------------------------------------------------------------------- 1 | .global sqrt 2 | .type sqrt,@function 3 | sqrt: sqrtsd %xmm0, %xmm0 4 | ret 5 | -------------------------------------------------------------------------------- /src/math/x86_64/sqrtf.s: -------------------------------------------------------------------------------- 1 | .global sqrtf 2 | .type sqrtf,@function 3 | sqrtf: sqrtss %xmm0, %xmm0 4 | ret 5 | -------------------------------------------------------------------------------- /src/math/x86_64/sqrtl.s: -------------------------------------------------------------------------------- 1 | .global sqrtl 2 | .type sqrtl,@function 3 | sqrtl: fldt 8(%rsp) 4 | fsqrt 5 | ret 6 | -------------------------------------------------------------------------------- /src/math/x86_64/truncl.s: -------------------------------------------------------------------------------- 1 | # see floorl.s 2 | -------------------------------------------------------------------------------- /src/misc/ffs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "atomic.h" 3 | 4 | int ffs(int i) 5 | { 6 | return i ? a_ctz_l(i)+1 : 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/misc/ffsl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "atomic.h" 3 | 4 | int ffsl(long i) 5 | { 6 | return i ? a_ctz_l(i)+1 : 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/misc/ffsll.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "atomic.h" 3 | 4 | int ffsll(long long i) 5 | { 6 | return i ? a_ctz_64(i)+1 : 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/misc/gethostid.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long gethostid() 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /src/misc/getpriority.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int getpriority(int which, id_t who) 5 | { 6 | int ret = syscall(SYS_getpriority, which, who); 7 | if (ret < 0) return ret; 8 | return 20-ret; 9 | } 10 | -------------------------------------------------------------------------------- /src/misc/getresgid.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "syscall.h" 4 | 5 | int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid) 6 | { 7 | return syscall(SYS_getresgid, rgid, egid, sgid); 8 | } 9 | -------------------------------------------------------------------------------- /src/misc/getresuid.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "syscall.h" 4 | 5 | int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid) 6 | { 7 | return syscall(SYS_getresuid, ruid, euid, suid); 8 | } 9 | -------------------------------------------------------------------------------- /src/misc/getrusage.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int getrusage(int who, struct rusage *ru) 5 | { 6 | return syscall(SYS_getrusage, who, ru); 7 | } 8 | -------------------------------------------------------------------------------- /src/misc/issetugid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libc.h" 3 | 4 | int issetugid(void) 5 | { 6 | return libc.secure; 7 | } 8 | -------------------------------------------------------------------------------- /src/misc/setdomainname.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "syscall.h" 4 | 5 | int setdomainname(const char *name, size_t len) 6 | { 7 | return syscall(SYS_setdomainname, name, len); 8 | } 9 | -------------------------------------------------------------------------------- /src/misc/setpriority.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int setpriority(int which, id_t who, int prio) 5 | { 6 | return syscall(SYS_setpriority, which, who, prio); 7 | } 8 | -------------------------------------------------------------------------------- /src/misc/uname.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int uname(struct utsname *uts) 5 | { 6 | return syscall(SYS_uname, uts); 7 | } 8 | -------------------------------------------------------------------------------- /src/mman/mincore.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "syscall.h" 4 | 5 | int mincore (void *addr, size_t len, unsigned char *vec) 6 | { 7 | return syscall(SYS_mincore, addr, len, vec); 8 | } 9 | -------------------------------------------------------------------------------- /src/mman/mlock.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int mlock(const void *addr, size_t len) 5 | { 6 | return syscall(SYS_mlock, addr, len); 7 | } 8 | -------------------------------------------------------------------------------- /src/mman/mlockall.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int mlockall(int flags) 5 | { 6 | return syscall(SYS_mlockall, flags); 7 | } 8 | -------------------------------------------------------------------------------- /src/mman/msync.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int msync(void *start, size_t len, int flags) 5 | { 6 | return syscall_cp(SYS_msync, start, len, flags); 7 | } 8 | -------------------------------------------------------------------------------- /src/mman/munlock.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int munlock(const void *addr, size_t len) 5 | { 6 | return syscall(SYS_munlock, addr, len); 7 | } 8 | -------------------------------------------------------------------------------- /src/mman/munlockall.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int munlockall(void) 5 | { 6 | return syscall(SYS_munlockall); 7 | } 8 | -------------------------------------------------------------------------------- /src/mq/mq_close.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int mq_close(mqd_t mqd) 5 | { 6 | return syscall(SYS_close, mqd); 7 | } 8 | -------------------------------------------------------------------------------- /src/mq/mq_getattr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int mq_getattr(mqd_t mqd, struct mq_attr *attr) 5 | { 6 | return mq_setattr(mqd, 0, attr); 7 | } 8 | -------------------------------------------------------------------------------- /src/mq/mq_receive.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | ssize_t mq_receive(mqd_t mqd, char *msg, size_t len, unsigned *prio) 4 | { 5 | return mq_timedreceive(mqd, msg, len, prio, 0); 6 | } 7 | -------------------------------------------------------------------------------- /src/mq/mq_send.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int mq_send(mqd_t mqd, const char *msg, size_t len, unsigned prio) 4 | { 5 | return mq_timedsend(mqd, msg, len, prio, 0); 6 | } 7 | -------------------------------------------------------------------------------- /src/mq/mq_setattr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int mq_setattr(mqd_t mqd, const struct mq_attr *restrict new, struct mq_attr *restrict old) 5 | { 6 | return syscall(SYS_mq_getsetattr, mqd, new, old); 7 | } 8 | -------------------------------------------------------------------------------- /src/multibyte/c32rtomb.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | size_t c32rtomb(char *restrict s, char32_t c32, mbstate_t *restrict ps) 5 | { 6 | return wcrtomb(s, c32, ps); 7 | } 8 | -------------------------------------------------------------------------------- /src/multibyte/mblen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int mblen(const char *s, size_t n) 4 | { 5 | return mbtowc(0, s, n); 6 | } 7 | -------------------------------------------------------------------------------- /src/multibyte/mbrlen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t mbrlen(const char *restrict s, size_t n, mbstate_t *restrict st) 4 | { 5 | static unsigned internal; 6 | return mbrtowc(0, s, n, st ? st : (mbstate_t *)&internal); 7 | } 8 | -------------------------------------------------------------------------------- /src/multibyte/mbsinit.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int mbsinit(const mbstate_t *st) 4 | { 5 | return !st || !*(unsigned *)st; 6 | } 7 | -------------------------------------------------------------------------------- /src/multibyte/mbstowcs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | size_t mbstowcs(wchar_t *restrict ws, const char *restrict s, size_t wn) 5 | { 6 | return mbsrtowcs(ws, (void*)&s, wn, 0); 7 | } 8 | -------------------------------------------------------------------------------- /src/multibyte/wcstombs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | size_t wcstombs(char *restrict s, const wchar_t *restrict ws, size_t n) 5 | { 6 | return wcsrtombs(s, &(const wchar_t *){ws}, n, 0); 7 | } 8 | -------------------------------------------------------------------------------- /src/multibyte/wctomb.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int wctomb(char *s, wchar_t wc) 5 | { 6 | if (!s) return 0; 7 | return wcrtomb(s, wc, 0); 8 | } 9 | -------------------------------------------------------------------------------- /src/network/accept.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int accept(int fd, struct sockaddr *restrict addr, socklen_t *restrict len) 6 | { 7 | return socketcall_cp(accept, fd, addr, len, 0, 0, 0); 8 | } 9 | -------------------------------------------------------------------------------- /src/network/bind.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int bind(int fd, const struct sockaddr *addr, socklen_t len) 5 | { 6 | return socketcall(bind, fd, addr, len, 0, 0, 0); 7 | } 8 | -------------------------------------------------------------------------------- /src/network/connect.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int connect(int fd, const struct sockaddr *addr, socklen_t len) 6 | { 7 | return socketcall_cp(connect, fd, addr, len, 0, 0, 0); 8 | } 9 | -------------------------------------------------------------------------------- /src/network/freeaddrinfo.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void freeaddrinfo(struct addrinfo *p) 5 | { 6 | free(p); 7 | } 8 | -------------------------------------------------------------------------------- /src/network/getpeername.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int getpeername(int fd, struct sockaddr *restrict addr, socklen_t *restrict len) 5 | { 6 | return socketcall(getpeername, fd, addr, len, 0, 0, 0); 7 | } 8 | -------------------------------------------------------------------------------- /src/network/getsockname.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int getsockname(int fd, struct sockaddr *restrict addr, socklen_t *restrict len) 5 | { 6 | return socketcall(getsockname, fd, addr, len, 0, 0, 0); 7 | } 8 | -------------------------------------------------------------------------------- /src/network/h_errno.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #undef h_errno 4 | int h_errno; 5 | 6 | int *__h_errno_location(void) 7 | { 8 | return &h_errno; 9 | } 10 | -------------------------------------------------------------------------------- /src/network/herror.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include 4 | 5 | void herror(const char *msg) 6 | { 7 | fprintf(stderr, "%s%s%s", msg?msg:"", msg?": ":"", hstrerror(h_errno)); 8 | } 9 | -------------------------------------------------------------------------------- /src/network/htonl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | uint32_t htonl(uint32_t n) 5 | { 6 | union { int i; char c; } u = { 1 }; 7 | return u.c ? bswap_32(n) : n; 8 | } 9 | -------------------------------------------------------------------------------- /src/network/htons.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | uint16_t htons(uint16_t n) 5 | { 6 | union { int i; char c; } u = { 1 }; 7 | return u.c ? bswap_16(n) : n; 8 | } 9 | -------------------------------------------------------------------------------- /src/network/if_freenameindex.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void if_freenameindex(struct if_nameindex *idx) 5 | { 6 | free(idx); 7 | } 8 | -------------------------------------------------------------------------------- /src/network/in6addr_any.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; 4 | -------------------------------------------------------------------------------- /src/network/in6addr_loopback.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; 4 | -------------------------------------------------------------------------------- /src/network/listen.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int listen(int fd, int backlog) 5 | { 6 | return socketcall(listen, fd, backlog, 0, 0, 0, 0); 7 | } 8 | -------------------------------------------------------------------------------- /src/network/netname.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct netent *getnetbyaddr(uint32_t net, int type) 4 | { 5 | return 0; 6 | } 7 | 8 | struct netent *getnetbyname(const char *name) 9 | { 10 | return 0; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/network/ntohl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | uint32_t ntohl(uint32_t n) 5 | { 6 | union { int i; char c; } u = { 1 }; 7 | return u.c ? bswap_32(n) : n; 8 | } 9 | -------------------------------------------------------------------------------- /src/network/ntohs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | uint16_t ntohs(uint16_t n) 5 | { 6 | union { int i; char c; } u = { 1 }; 7 | return u.c ? bswap_16(n) : n; 8 | } 9 | -------------------------------------------------------------------------------- /src/network/recv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | ssize_t recv(int fd, void *buf, size_t len, int flags) 4 | { 5 | return recvfrom(fd, buf, len, flags, 0, 0); 6 | } 7 | -------------------------------------------------------------------------------- /src/network/res_init.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int res_init() 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /src/network/res_state.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* This is completely unused, and exists purely to satisfy broken apps. */ 4 | 5 | struct __res_state *__res_state() 6 | { 7 | static struct __res_state res; 8 | return &res; 9 | } 10 | -------------------------------------------------------------------------------- /src/network/send.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | ssize_t send(int fd, const void *buf, size_t len, int flags) 4 | { 5 | return sendto(fd, buf, len, flags, 0, 0); 6 | } 7 | -------------------------------------------------------------------------------- /src/network/serv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void endservent(void) 4 | { 5 | } 6 | 7 | void setservent(int stayopen) 8 | { 9 | } 10 | 11 | struct servent *getservent(void) 12 | { 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /src/network/shutdown.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int shutdown(int fd, int how) 5 | { 6 | return socketcall(shutdown, fd, how, 0, 0, 0, 0); 7 | } 8 | -------------------------------------------------------------------------------- /src/network/sockatmark.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int sockatmark(int s) 5 | { 6 | int ret; 7 | if (ioctl(s, SIOCATMARK, &ret) < 0) 8 | return -1; 9 | return ret; 10 | } 11 | -------------------------------------------------------------------------------- /src/passwd/getspent.c: -------------------------------------------------------------------------------- 1 | #include "pwf.h" 2 | 3 | void setspent() 4 | { 5 | } 6 | 7 | void endspent() 8 | { 9 | } 10 | 11 | struct spwd *getspent() 12 | { 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /src/passwd/lckpwdf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int lckpwdf() 4 | { 5 | return 0; 6 | } 7 | 8 | int ulckpwdf() 9 | { 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /src/prng/__seed48.c: -------------------------------------------------------------------------------- 1 | unsigned short __seed48[7] = { 0, 0, 0, 0xe66d, 0xdeec, 0x5, 0xb }; 2 | -------------------------------------------------------------------------------- /src/prng/lcong48.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | extern unsigned short __seed48[7]; 5 | 6 | void lcong48(unsigned short p[7]) 7 | { 8 | memcpy(__seed48, p, sizeof __seed48); 9 | } 10 | -------------------------------------------------------------------------------- /src/prng/srand48.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void srand48(long seed) 4 | { 5 | seed48((unsigned short [3]){ 0x330e, seed, seed>>16 }); 6 | } 7 | -------------------------------------------------------------------------------- /src/process/execv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern char **__environ; 4 | 5 | int execv(const char *path, char *const argv[]) 6 | { 7 | return execve(path, argv, __environ); 8 | } 9 | -------------------------------------------------------------------------------- /src/process/fdop.h: -------------------------------------------------------------------------------- 1 | #define FDOP_CLOSE 1 2 | #define FDOP_DUP2 2 3 | #define FDOP_OPEN 3 4 | 5 | struct fdop { 6 | struct fdop *next, *prev; 7 | int cmd, fd, srcfd, oflag; 8 | mode_t mode; 9 | char path[]; 10 | }; 11 | -------------------------------------------------------------------------------- /src/process/posix_spawn_file_actions_init.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int posix_spawn_file_actions_init(posix_spawn_file_actions_t *fa) 4 | { 5 | fa->__actions = 0; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/process/posix_spawnattr_destroy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int posix_spawnattr_destroy(posix_spawnattr_t *attr) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /src/process/posix_spawnattr_getflags.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int posix_spawnattr_getflags(const posix_spawnattr_t *restrict attr, short *restrict flags) 4 | { 5 | *flags = attr->__flags; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/process/posix_spawnattr_getpgroup.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int posix_spawnattr_getpgroup(const posix_spawnattr_t *restrict attr, pid_t *restrict pgrp) 4 | { 5 | *pgrp = attr->__pgrp; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/process/posix_spawnattr_getsigdefault.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int posix_spawnattr_getsigdefault(const posix_spawnattr_t *restrict attr, sigset_t *restrict def) 4 | { 5 | *def = attr->__def; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/process/posix_spawnattr_getsigmask.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int posix_spawnattr_getsigmask(const posix_spawnattr_t *restrict attr, sigset_t *restrict mask) 4 | { 5 | *mask = attr->__mask; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/process/posix_spawnattr_init.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int posix_spawnattr_init(posix_spawnattr_t *attr) 4 | { 5 | *attr = (posix_spawnattr_t){ 0 }; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/process/posix_spawnattr_setpgroup.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int posix_spawnattr_setpgroup(posix_spawnattr_t *attr, pid_t pgrp) 4 | { 5 | attr->__pgrp = pgrp; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/process/posix_spawnattr_setsigdefault.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int posix_spawnattr_setsigdefault(posix_spawnattr_t *restrict attr, const sigset_t *restrict def) 4 | { 5 | attr->__def = *def; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/process/posix_spawnattr_setsigmask.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int posix_spawnattr_setsigmask(posix_spawnattr_t *restrict attr, const sigset_t *restrict mask) 4 | { 5 | attr->__mask = *mask; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/process/s390x/vfork.s: -------------------------------------------------------------------------------- 1 | .global __vfork 2 | .weak vfork 3 | .type __vfork,%function 4 | .type vfork,%function 5 | __vfork: 6 | vfork: 7 | svc 190 8 | jg __syscall_ret 9 | -------------------------------------------------------------------------------- /src/process/wait.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | pid_t wait(int *status) 4 | { 5 | return waitpid((pid_t)-1, status, 0); 6 | } 7 | -------------------------------------------------------------------------------- /src/process/waitid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int waitid(idtype_t type, id_t id, siginfo_t *info, int options) 6 | { 7 | return syscall_cp(SYS_waitid, type, id, info, options, 0); 8 | } 9 | -------------------------------------------------------------------------------- /src/process/waitpid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | pid_t waitpid(pid_t pid, int *status, int options) 6 | { 7 | return syscall_cp(SYS_wait4, pid, status, options, 0); 8 | } 9 | -------------------------------------------------------------------------------- /src/sched/sched_getparam.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "syscall.h" 4 | 5 | int sched_getparam(pid_t pid, struct sched_param *param) 6 | { 7 | return __syscall_ret(-ENOSYS); 8 | } 9 | -------------------------------------------------------------------------------- /src/sched/sched_getscheduler.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "syscall.h" 4 | 5 | int sched_getscheduler(pid_t pid) 6 | { 7 | return __syscall_ret(-ENOSYS); 8 | } 9 | -------------------------------------------------------------------------------- /src/sched/sched_rr_get_interval.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int sched_rr_get_interval(pid_t pid, struct timespec *ts) 5 | { 6 | return syscall(SYS_sched_rr_get_interval, pid, ts); 7 | } 8 | -------------------------------------------------------------------------------- /src/sched/sched_setparam.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "syscall.h" 4 | 5 | int sched_setparam(pid_t pid, const struct sched_param *param) 6 | { 7 | return __syscall_ret(-ENOSYS); 8 | } 9 | -------------------------------------------------------------------------------- /src/sched/sched_setscheduler.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "syscall.h" 4 | 5 | int sched_setscheduler(pid_t pid, int sched, const struct sched_param *param) 6 | { 7 | return __syscall_ret(-ENOSYS); 8 | } 9 | -------------------------------------------------------------------------------- /src/sched/sched_yield.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int sched_yield() 5 | { 6 | return syscall(SYS_sched_yield); 7 | } 8 | -------------------------------------------------------------------------------- /src/setjmp/longjmp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/src/setjmp/longjmp.c -------------------------------------------------------------------------------- /src/setjmp/setjmp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/src/setjmp/setjmp.c -------------------------------------------------------------------------------- /src/signal/aarch64/restore.s: -------------------------------------------------------------------------------- 1 | .global __restore 2 | .type __restore,%function 3 | __restore: 4 | .global __restore_rt 5 | .type __restore_rt,%function 6 | __restore_rt: 7 | mov x8,#139 // SYS_rt_sigreturn 8 | svc 0 9 | -------------------------------------------------------------------------------- /src/signal/getitimer.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int getitimer(int which, struct itimerval *old) 5 | { 6 | return syscall(SYS_getitimer, which, old); 7 | } 8 | -------------------------------------------------------------------------------- /src/signal/kill.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int kill(pid_t pid, int sig) 5 | { 6 | return syscall(SYS_kill, pid, sig); 7 | } 8 | -------------------------------------------------------------------------------- /src/signal/killpg.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int killpg(pid_t pgid, int sig) 5 | { 6 | if (pgid < 0) { 7 | errno = EINVAL; 8 | return -1; 9 | } 10 | return kill(-pgid, sig); 11 | } 12 | -------------------------------------------------------------------------------- /src/signal/mips64/restore.s: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | .global __restore_rt 3 | .global __restore 4 | .type __restore_rt,@function 5 | .type __restore,@function 6 | __restore_rt: 7 | __restore: 8 | li $2,5211 9 | syscall 10 | -------------------------------------------------------------------------------- /src/signal/mipsn32/restore.s: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | .global __restore_rt 3 | .global __restore 4 | .type __restore_rt,@function 5 | .type __restore,@function 6 | __restore_rt: 7 | __restore: 8 | li $2,6211 9 | syscall 10 | -------------------------------------------------------------------------------- /src/signal/s390x/restore.s: -------------------------------------------------------------------------------- 1 | .global __restore 2 | .type __restore,%function 3 | __restore: 4 | svc 119 #__NR_sigreturn 5 | 6 | .global __restore_rt 7 | .type __restore_rt,%function 8 | __restore_rt: 9 | svc 173 # __NR_rt_sigreturn 10 | -------------------------------------------------------------------------------- /src/signal/setitimer.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int setitimer(int which, const struct itimerval *restrict new, struct itimerval *restrict old) 5 | { 6 | return syscall(SYS_setitimer, which, new, old); 7 | } 8 | -------------------------------------------------------------------------------- /src/signal/sighold.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int sighold(int sig) 4 | { 5 | sigset_t mask; 6 | 7 | sigemptyset(&mask); 8 | if (sigaddset(&mask, sig) < 0) return -1; 9 | return sigprocmask(SIG_BLOCK, &mask, 0); 10 | } 11 | -------------------------------------------------------------------------------- /src/signal/sigignore.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int sigignore(int sig) 4 | { 5 | struct sigaction sa; 6 | 7 | sigemptyset(&sa.sa_mask); 8 | sa.sa_handler = SIG_IGN; 9 | sa.sa_flags = 0; 10 | return sigaction(sig, &sa, 0); 11 | } 12 | -------------------------------------------------------------------------------- /src/signal/siglongjmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "syscall.h" 4 | #include "pthread_impl.h" 5 | 6 | _Noreturn void siglongjmp(sigjmp_buf buf, int ret) 7 | { 8 | longjmp(buf, ret); 9 | } 10 | -------------------------------------------------------------------------------- /src/signal/sigpause.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int sigpause(int sig) 4 | { 5 | sigset_t mask; 6 | sigprocmask(0, 0, &mask); 7 | sigdelset(&mask, sig); 8 | return sigsuspend(&mask); 9 | } 10 | -------------------------------------------------------------------------------- /src/signal/sigpending.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int sigpending(sigset_t *set) 5 | { 6 | return syscall(SYS_rt_sigpending, set, _NSIG/8); 7 | } 8 | -------------------------------------------------------------------------------- /src/signal/sigrelse.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int sigrelse(int sig) 4 | { 5 | sigset_t mask; 6 | 7 | sigemptyset(&mask); 8 | if (sigaddset(&mask, sig) < 0) return -1; 9 | return sigprocmask(SIG_UNBLOCK, &mask, 0); 10 | } 11 | -------------------------------------------------------------------------------- /src/signal/sigrtmax.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int __libc_current_sigrtmax() 4 | { 5 | return _NSIG-1; 6 | } 7 | -------------------------------------------------------------------------------- /src/signal/sigrtmin.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int __libc_current_sigrtmin() 4 | { 5 | return 35; 6 | } 7 | -------------------------------------------------------------------------------- /src/signal/sigsetjmp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/src/signal/sigsetjmp.c -------------------------------------------------------------------------------- /src/signal/sigsuspend.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int sigsuspend(const sigset_t *mask) 6 | { 7 | return syscall_cp(SYS_rt_sigsuspend, mask, _NSIG/8); 8 | } 9 | -------------------------------------------------------------------------------- /src/signal/sigwaitinfo.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int sigwaitinfo(const sigset_t *restrict mask, siginfo_t *restrict si) 4 | { 5 | return sigtimedwait(mask, si, 0); 6 | } 7 | -------------------------------------------------------------------------------- /src/signal/x32/restore.s: -------------------------------------------------------------------------------- 1 | nop 2 | .global __restore_rt 3 | .type __restore_rt,@function 4 | __restore_rt: 5 | mov $0x40000201, %rax /* SYS_rt_sigreturn */ 6 | syscall 7 | .size __restore_rt,.-__restore_rt 8 | -------------------------------------------------------------------------------- /src/signal/x86_64/restore.s: -------------------------------------------------------------------------------- 1 | nop 2 | .global __restore_rt 3 | .type __restore_rt,@function 4 | __restore_rt: 5 | mov $15, %rax 6 | syscall 7 | .size __restore_rt,.-__restore_rt 8 | -------------------------------------------------------------------------------- /src/stat/futimens.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int futimens(int fd, const struct timespec times[2]) 4 | { 5 | return utimensat(fd, 0, times, 0); 6 | } 7 | -------------------------------------------------------------------------------- /src/stat/lchmod.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include 4 | 5 | int lchmod(const char *path, mode_t mode) 6 | { 7 | return fchmodat(AT_FDCWD, path, mode, AT_SYMLINK_NOFOLLOW); 8 | } 9 | -------------------------------------------------------------------------------- /src/stat/mkdirat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int mkdirat(int fd, const char *path, mode_t mode) 5 | { 6 | return syscall(SYS_mkdirat, fd, path, mode); 7 | } 8 | -------------------------------------------------------------------------------- /src/stat/mkfifo.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int mkfifo(const char *path, mode_t mode) 4 | { 5 | return mknod(path, mode | S_IFIFO, 0); 6 | } 7 | -------------------------------------------------------------------------------- /src/stat/mkfifoat.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int mkfifoat(int fd, const char *path, mode_t mode) 4 | { 5 | return mknodat(fd, path, mode | S_IFIFO, 0); 6 | } 7 | -------------------------------------------------------------------------------- /src/stat/mknodat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int mknodat(int fd, const char *path, mode_t mode, dev_t dev) 5 | { 6 | return syscall(SYS_mknodat, fd, path, mode, dev); 7 | } 8 | -------------------------------------------------------------------------------- /src/stat/umask.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | mode_t umask(mode_t mode) 5 | { 6 | return syscall(SYS_umask, mode); 7 | } 8 | -------------------------------------------------------------------------------- /src/stdio/__fclose_ca.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int __fclose_ca(FILE *f) 4 | { 5 | return f->close(f); 6 | } 7 | -------------------------------------------------------------------------------- /src/stdio/clearerr.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | void clearerr(FILE *f) 4 | { 5 | FLOCK(f); 6 | f->flags &= ~(F_EOF|F_ERR); 7 | FUNLOCK(f); 8 | } 9 | 10 | weak_alias(clearerr, clearerr_unlocked); 11 | -------------------------------------------------------------------------------- /src/stdio/fgetc.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int fgetc(FILE *f) 4 | { 5 | int c; 6 | if (f->lock < 0 || !__lockfile(f)) 7 | return getc_unlocked(f); 8 | c = getc_unlocked(f); 9 | __unlockfile(f); 10 | return c; 11 | } 12 | -------------------------------------------------------------------------------- /src/stdio/fputc.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int fputc(int c, FILE *f) 4 | { 5 | if (f->lock < 0 || !__lockfile(f)) 6 | return putc_unlocked(c, f); 7 | c = putc_unlocked(c, f); 8 | __unlockfile(f); 9 | return c; 10 | } 11 | -------------------------------------------------------------------------------- /src/stdio/fsetpos.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int fsetpos(FILE *f, const fpos_t *pos) 4 | { 5 | return __fseeko(f, *(const long long *)pos, SEEK_SET); 6 | } 7 | 8 | LFS64(fsetpos); 9 | -------------------------------------------------------------------------------- /src/stdio/getc_unlocked.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int (getc_unlocked)(FILE *f) 4 | { 5 | return getc_unlocked(f); 6 | } 7 | 8 | weak_alias (getc_unlocked, fgetc_unlocked); 9 | weak_alias (getc_unlocked, _IO_getc_unlocked); 10 | -------------------------------------------------------------------------------- /src/stdio/getchar.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int getchar(void) 4 | { 5 | return fgetc(stdin); 6 | } 7 | -------------------------------------------------------------------------------- /src/stdio/getchar_unlocked.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int getchar_unlocked(void) 4 | { 5 | return getc_unlocked(stdin); 6 | } 7 | -------------------------------------------------------------------------------- /src/stdio/getline.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | ssize_t getline(char **restrict s, size_t *restrict n, FILE *restrict f) 4 | { 5 | return getdelim(s, n, '\n', f); 6 | } 7 | -------------------------------------------------------------------------------- /src/stdio/getw.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | int getw(FILE *f) 5 | { 6 | int x; 7 | return fread(&x, sizeof x, 1, f) ? x : EOF; 8 | } 9 | -------------------------------------------------------------------------------- /src/stdio/getwc.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | #include 3 | 4 | wint_t getwc(FILE *f) 5 | { 6 | return fgetwc(f); 7 | } 8 | -------------------------------------------------------------------------------- /src/stdio/getwchar.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | #include 3 | 4 | wint_t getwchar(void) 5 | { 6 | return fgetwc(stdin); 7 | } 8 | 9 | weak_alias(getwchar, getwchar_unlocked); 10 | -------------------------------------------------------------------------------- /src/stdio/ofl_add.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | FILE *__ofl_add(FILE *f) 4 | { 5 | FILE **head = __ofl_lock(); 6 | f->next = *head; 7 | if (*head) (*head)->prev = f; 8 | *head = f; 9 | __ofl_unlock(); 10 | return f; 11 | } 12 | -------------------------------------------------------------------------------- /src/stdio/putchar.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int putchar(int c) 4 | { 5 | return fputc(c, stdout); 6 | } 7 | -------------------------------------------------------------------------------- /src/stdio/putchar_unlocked.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int putchar_unlocked(int c) 4 | { 5 | return putc_unlocked(c, stdout); 6 | } 7 | -------------------------------------------------------------------------------- /src/stdio/puts.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int puts(const char *s) 4 | { 5 | int r; 6 | FLOCK(stdout); 7 | r = -(fputs(s, stdout) < 0 || putc_unlocked('\n', stdout) < 0); 8 | FUNLOCK(stdout); 9 | return r; 10 | } 11 | -------------------------------------------------------------------------------- /src/stdio/putw.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | int putw(int x, FILE *f) 5 | { 6 | return (int)fwrite(&x, sizeof x, 1, f)-1; 7 | } 8 | -------------------------------------------------------------------------------- /src/stdio/putwc.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | #include 3 | 4 | wint_t putwc(wchar_t c, FILE *f) 5 | { 6 | return fputwc(c, f); 7 | } 8 | -------------------------------------------------------------------------------- /src/stdio/putwchar.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | #include 3 | 4 | wint_t putwchar(wchar_t c) 5 | { 6 | return fputwc(c, stdout); 7 | } 8 | 9 | weak_alias(putwchar, putwchar_unlocked); 10 | -------------------------------------------------------------------------------- /src/stdio/rewind.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | void rewind(FILE *f) 4 | { 5 | FLOCK(f); 6 | __fseeko_unlocked(f, 0, SEEK_SET); 7 | f->flags &= ~F_ERR; 8 | FUNLOCK(f); 9 | } 10 | -------------------------------------------------------------------------------- /src/stdio/setbuf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void setbuf(FILE *restrict f, char *restrict buf) 4 | { 5 | setvbuf(f, buf, buf ? _IOFBF : _IONBF, BUFSIZ); 6 | } 7 | -------------------------------------------------------------------------------- /src/stdio/setbuffer.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | void setbuffer(FILE *f, char *buf, size_t size) 5 | { 6 | setvbuf(f, buf, buf ? _IOFBF : _IONBF, size); 7 | } 8 | -------------------------------------------------------------------------------- /src/stdio/setlinebuf.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | void setlinebuf(FILE *f) 5 | { 6 | setvbuf(f, 0, _IOLBF, 0); 7 | } 8 | -------------------------------------------------------------------------------- /src/stdio/vprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int vprintf(const char *restrict fmt, va_list ap) 4 | { 5 | return vfprintf(stdout, fmt, ap); 6 | } 7 | -------------------------------------------------------------------------------- /src/stdio/vscanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "libc.h" 4 | 5 | int vscanf(const char *restrict fmt, va_list ap) 6 | { 7 | return vfscanf(stdin, fmt, ap); 8 | } 9 | 10 | weak_alias(vscanf,__isoc99_vscanf); 11 | -------------------------------------------------------------------------------- /src/stdio/vsprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int vsprintf(char *restrict s, const char *restrict fmt, va_list ap) 5 | { 6 | return vsnprintf(s, INT_MAX, fmt, ap); 7 | } 8 | -------------------------------------------------------------------------------- /src/stdio/vwprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int vwprintf(const wchar_t *restrict fmt, va_list ap) 5 | { 6 | return vfwprintf(stdout, fmt, ap); 7 | } 8 | -------------------------------------------------------------------------------- /src/stdlib/abs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int abs(int a) 4 | { 5 | return a>0 ? a : -a; 6 | } 7 | -------------------------------------------------------------------------------- /src/stdlib/atof.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double atof(const char *s) 4 | { 5 | return strtod(s, 0); 6 | } 7 | -------------------------------------------------------------------------------- /src/stdlib/div.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | div_t div(int num, int den) 4 | { 5 | return (div_t){ num/den, num%den }; 6 | } 7 | -------------------------------------------------------------------------------- /src/stdlib/gcvt.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include 4 | 5 | char *gcvt(double x, int n, char *b) 6 | { 7 | sprintf(b, "%.*g", n, x); 8 | return b; 9 | } 10 | -------------------------------------------------------------------------------- /src/stdlib/imaxabs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | intmax_t imaxabs(intmax_t a) 4 | { 5 | return a>0 ? a : -a; 6 | } 7 | -------------------------------------------------------------------------------- /src/stdlib/imaxdiv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | imaxdiv_t imaxdiv(intmax_t num, intmax_t den) 4 | { 5 | return (imaxdiv_t){ num/den, num%den }; 6 | } 7 | -------------------------------------------------------------------------------- /src/stdlib/labs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long labs(long a) 4 | { 5 | return a>0 ? a : -a; 6 | } 7 | -------------------------------------------------------------------------------- /src/stdlib/ldiv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | ldiv_t ldiv(long num, long den) 4 | { 5 | return (ldiv_t){ num/den, num%den }; 6 | } 7 | -------------------------------------------------------------------------------- /src/stdlib/llabs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llabs(long long a) 4 | { 5 | return a>0 ? a : -a; 6 | } 7 | -------------------------------------------------------------------------------- /src/stdlib/lldiv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | lldiv_t lldiv(long long num, long long den) 4 | { 5 | return (lldiv_t){ num/den, num%den }; 6 | } 7 | -------------------------------------------------------------------------------- /src/string/arm/memcpy.c: -------------------------------------------------------------------------------- 1 | #if __ARMEB__ || __thumb__ 2 | #include "../memcpy.c" 3 | #endif 4 | -------------------------------------------------------------------------------- /src/string/bcmp.c: -------------------------------------------------------------------------------- 1 | #define _BSD_SOURCE 2 | #include 3 | #include 4 | 5 | int bcmp(const void *s1, const void *s2, size_t n) 6 | { 7 | return memcmp(s1, s2, n); 8 | } 9 | -------------------------------------------------------------------------------- /src/string/bcopy.c: -------------------------------------------------------------------------------- 1 | #define _BSD_SOURCE 2 | #include 3 | #include 4 | 5 | void bcopy(const void *s1, void *s2, size_t n) 6 | { 7 | memmove(s2, s1, n); 8 | } 9 | -------------------------------------------------------------------------------- /src/string/bzero.c: -------------------------------------------------------------------------------- 1 | #define _BSD_SOURCE 2 | #include 3 | #include 4 | 5 | void bzero(void *s, size_t n) 6 | { 7 | memset(s, 0, n); 8 | } 9 | -------------------------------------------------------------------------------- /src/string/index.c: -------------------------------------------------------------------------------- 1 | #define _BSD_SOURCE 2 | #include 3 | #include 4 | 5 | char *index(const char *s, int c) 6 | { 7 | return strchr(s, c); 8 | } 9 | -------------------------------------------------------------------------------- /src/string/memcmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int memcmp(const void *vl, const void *vr, size_t n) 4 | { 5 | const unsigned char *l=vl, *r=vr; 6 | for (; n && *l == *r; n--, l++, r++); 7 | return n ? *l-*r : 0; 8 | } 9 | -------------------------------------------------------------------------------- /src/string/mempcpy.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | void *mempcpy(void *dest, const void *src, size_t n) 5 | { 6 | return (char *)memcpy(dest, src, n) + n; 7 | } 8 | -------------------------------------------------------------------------------- /src/string/rindex.c: -------------------------------------------------------------------------------- 1 | #define _BSD_SOURCE 2 | #include 3 | #include 4 | 5 | char *rindex(const char *s, int c) 6 | { 7 | return strrchr(s, c); 8 | } 9 | -------------------------------------------------------------------------------- /src/string/strcat.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *strcat(char *restrict dest, const char *restrict src) 4 | { 5 | strcpy(dest + strlen(dest), src); 6 | return dest; 7 | } 8 | -------------------------------------------------------------------------------- /src/string/strchr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *__strchrnul(const char *, int); 4 | 5 | char *strchr(const char *s, int c) 6 | { 7 | char *r = __strchrnul(s, c); 8 | return *(unsigned char *)r == (unsigned char)c ? r : 0; 9 | } 10 | -------------------------------------------------------------------------------- /src/string/strcmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int strcmp(const char *l, const char *r) 4 | { 5 | for (; *l==*r && *l; l++, r++); 6 | return *(unsigned char *)l - *(unsigned char *)r; 7 | } 8 | -------------------------------------------------------------------------------- /src/string/strncat.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *strncat(char *restrict d, const char *restrict s, size_t n) 4 | { 5 | char *a = d; 6 | d += strlen(d); 7 | while (n && *s) n--, *d++ = *s++; 8 | *d++ = 0; 9 | return a; 10 | } 11 | -------------------------------------------------------------------------------- /src/string/strncpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *__stpncpy(char *, const char *, size_t); 4 | 5 | char *strncpy(char *restrict d, const char *restrict s, size_t n) 6 | { 7 | __stpncpy(d, s, n); 8 | return d; 9 | } 10 | -------------------------------------------------------------------------------- /src/string/strnlen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t strnlen(const char *s, size_t n) 4 | { 5 | const char *p = memchr(s, 0, n); 6 | return p ? p-s : n; 7 | } 8 | -------------------------------------------------------------------------------- /src/string/strpbrk.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *strpbrk(const char *s, const char *b) 4 | { 5 | s += strcspn(s, b); 6 | return *s ? (char *)s : 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/string/strrchr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void *__memrchr(const void *, int, size_t); 4 | 5 | char *strrchr(const char *s, int c) 6 | { 7 | return __memrchr(s, c, strlen(s) + 1); 8 | } 9 | -------------------------------------------------------------------------------- /src/string/wcpcpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcpcpy(wchar_t *restrict d, const wchar_t *restrict s) 4 | { 5 | return wcscpy(d, s) + wcslen(s); 6 | } 7 | -------------------------------------------------------------------------------- /src/string/wcpncpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcpncpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n) 4 | { 5 | return wcsncpy(d, s, n) + wcsnlen(s, n); 6 | } 7 | -------------------------------------------------------------------------------- /src/string/wcscasecmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int wcscasecmp(const wchar_t *l, const wchar_t *r) 5 | { 6 | return wcsncasecmp(l, r, -1); 7 | } 8 | -------------------------------------------------------------------------------- /src/string/wcscasecmp_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcscasecmp_l(const wchar_t *l, const wchar_t *r, locale_t locale) 4 | { 5 | return wcscasecmp(l, r); 6 | } 7 | -------------------------------------------------------------------------------- /src/string/wcscat.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcscat(wchar_t *restrict dest, const wchar_t *restrict src) 4 | { 5 | wcscpy(dest + wcslen(dest), src); 6 | return dest; 7 | } 8 | -------------------------------------------------------------------------------- /src/string/wcschr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcschr(const wchar_t *s, wchar_t c) 4 | { 5 | if (!c) return (wchar_t *)s + wcslen(s); 6 | for (; *s && *s != c; s++); 7 | return *s ? (wchar_t *)s : 0; 8 | } 9 | -------------------------------------------------------------------------------- /src/string/wcscmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcscmp(const wchar_t *l, const wchar_t *r) 4 | { 5 | for (; *l==*r && *l && *r; l++, r++); 6 | return *l - *r; 7 | } 8 | -------------------------------------------------------------------------------- /src/string/wcscpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcscpy(wchar_t *restrict d, const wchar_t *restrict s) 4 | { 5 | wchar_t *a = d; 6 | while ((*d++ = *s++)); 7 | return a; 8 | } 9 | -------------------------------------------------------------------------------- /src/string/wcslen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t wcslen(const wchar_t *s) 4 | { 5 | const wchar_t *a; 6 | for (a=s; *s; s++); 7 | return s-a; 8 | } 9 | -------------------------------------------------------------------------------- /src/string/wcsncasecmp_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcsncasecmp_l(const wchar_t *l, const wchar_t *r, size_t n, locale_t locale) 4 | { 5 | return wcsncasecmp(l, r, n); 6 | } 7 | -------------------------------------------------------------------------------- /src/string/wcsncmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcsncmp(const wchar_t *l, const wchar_t *r, size_t n) 4 | { 5 | for (; n && *l==*r && *l && *r; n--, l++, r++); 6 | return n ? *l - *r : 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/string/wcsncpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcsncpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n) 4 | { 5 | wchar_t *a = d; 6 | while (n && *s) n--, *d++ = *s++; 7 | wmemset(d, 0, n); 8 | return a; 9 | } 10 | -------------------------------------------------------------------------------- /src/string/wcsnlen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t wcsnlen(const wchar_t *s, size_t n) 4 | { 5 | const wchar_t *z = wmemchr(s, 0, n); 6 | if (z) n = z-s; 7 | return n; 8 | } 9 | -------------------------------------------------------------------------------- /src/string/wcspbrk.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcspbrk(const wchar_t *s, const wchar_t *b) 4 | { 5 | s += wcscspn(s, b); 6 | return *s ? (wchar_t *)s : NULL; 7 | } 8 | -------------------------------------------------------------------------------- /src/string/wcsrchr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcsrchr(const wchar_t *s, wchar_t c) 4 | { 5 | const wchar_t *p; 6 | for (p=s+wcslen(s); p>=s && *p!=c; p--); 7 | return p>=s ? (wchar_t *)p : 0; 8 | } 9 | -------------------------------------------------------------------------------- /src/string/wcsspn.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t wcsspn(const wchar_t *s, const wchar_t *c) 4 | { 5 | const wchar_t *a; 6 | for (a=s; *s && wcschr(c, *s); s++); 7 | return s-a; 8 | } 9 | -------------------------------------------------------------------------------- /src/string/wcswcs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcswcs(const wchar_t *haystack, const wchar_t *needle) 4 | { 5 | return wcsstr(haystack, needle); 6 | } 7 | -------------------------------------------------------------------------------- /src/string/wmemchr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n) 4 | { 5 | for (; n && *s != c; n--, s++); 6 | return n ? (wchar_t *)s : 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/string/wmemcmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wmemcmp(const wchar_t *l, const wchar_t *r, size_t n) 4 | { 5 | for (; n && *l==*r; n--, l++, r++); 6 | return n ? *l-*r : 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/string/wmemcpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wmemcpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n) 4 | { 5 | wchar_t *a = d; 6 | while (n--) *d++ = *s++; 7 | return a; 8 | } 9 | -------------------------------------------------------------------------------- /src/string/wmemset.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wmemset(wchar_t *d, wchar_t c, size_t n) 4 | { 5 | wchar_t *ret = d; 6 | while (n--) *d++ = c; 7 | return ret; 8 | } 9 | -------------------------------------------------------------------------------- /src/temp/mkstemp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libc.h" 3 | 4 | int __mkostemps(char *, int, int); 5 | 6 | int mkstemp(char *template) 7 | { 8 | return __mkostemps(template, 0, 0); 9 | } 10 | 11 | LFS64(mkstemp); 12 | -------------------------------------------------------------------------------- /src/termios/tcdrain.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "libc.h" 4 | #include "syscall.h" 5 | 6 | int tcdrain(int fd) 7 | { 8 | return syscall_cp(SYS_ioctl, fd, TCSBRK, 1); 9 | } 10 | -------------------------------------------------------------------------------- /src/termios/tcflow.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int tcflow(int fd, int action) 5 | { 6 | return ioctl(fd, TCXONC, action); 7 | } 8 | -------------------------------------------------------------------------------- /src/termios/tcflush.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int tcflush(int fd, int queue) 5 | { 6 | return ioctl(fd, TCFLSH, queue); 7 | } 8 | -------------------------------------------------------------------------------- /src/termios/tcgetattr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int tcgetattr(int fd, struct termios *tio) 5 | { 6 | if (ioctl(fd, TCGETS, tio)) 7 | return -1; 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /src/termios/tcgetsid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | pid_t tcgetsid(int fd) 5 | { 6 | int sid; 7 | if (ioctl(fd, TIOCGSID, &sid) < 0) 8 | return -1; 9 | return sid; 10 | } 11 | -------------------------------------------------------------------------------- /src/termios/tcsendbreak.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int tcsendbreak(int fd, int dur) 5 | { 6 | /* nonzero duration is implementation-defined, so ignore it */ 7 | return ioctl(fd, TCSBRK, 0); 8 | } 9 | -------------------------------------------------------------------------------- /src/thread/__clone.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "pthread_impl.h" 3 | 4 | int __clone(int (*func)(void *), void *stack, int flags, void *arg, ...) 5 | { 6 | return -ENOSYS; 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/__futex.c: -------------------------------------------------------------------------------- 1 | #include "futex.h" 2 | #include "syscall.h" 3 | 4 | int __futex(volatile int *addr, int op, int val, void *ts) 5 | { 6 | return syscall(SYS_futex, addr, op, val, ts); 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/__set_thread_area.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int __set_thread_area(void *p) 4 | { 5 | #ifdef SYS_set_thread_area 6 | return __syscall(SYS_set_thread_area, p); 7 | #else 8 | return -ENOSYS; 9 | #endif 10 | } 11 | -------------------------------------------------------------------------------- /src/thread/aarch64/__set_thread_area.s: -------------------------------------------------------------------------------- 1 | .global __set_thread_area 2 | .type __set_thread_area,@function 3 | __set_thread_area: 4 | msr tpidr_el0,x0 5 | mov w0,#0 6 | ret 7 | -------------------------------------------------------------------------------- /src/thread/aarch64/__unmapself.s: -------------------------------------------------------------------------------- 1 | .global __unmapself 2 | .type __unmapself,%function 3 | __unmapself: 4 | mov x8,#215 // SYS_munmap 5 | svc 0 6 | mov x8,#93 // SYS_exit 7 | svc 0 8 | -------------------------------------------------------------------------------- /src/thread/arm/__aeabi_read_tp.s: -------------------------------------------------------------------------------- 1 | .syntax unified 2 | .global __aeabi_read_tp 3 | .type __aeabi_read_tp,%function 4 | __aeabi_read_tp: 5 | push {r1,r2,r3,lr} 6 | bl __aeabi_read_tp_c 7 | pop {r1,r2,r3,lr} 8 | bx lr 9 | -------------------------------------------------------------------------------- /src/thread/arm/__unmapself.s: -------------------------------------------------------------------------------- 1 | .syntax unified 2 | .text 3 | .global __unmapself 4 | .type __unmapself,%function 5 | __unmapself: 6 | mov r7,#91 7 | svc 0 8 | mov r7,#1 9 | svc 0 10 | -------------------------------------------------------------------------------- /src/thread/call_once.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int __pthread_once(once_flag *, void (*)(void)); 4 | 5 | void call_once(once_flag *flag, void (*func)(void)) 6 | { 7 | __pthread_once(flag, func); 8 | } 9 | -------------------------------------------------------------------------------- /src/thread/cnd_destroy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void cnd_destroy(cnd_t *c) 4 | { 5 | /* For private cv this is a no-op */ 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/cnd_init.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int cnd_init(cnd_t *c) 4 | { 5 | *c = (cnd_t){ 0 }; 6 | return thrd_success; 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/m68k/__m68k_read_tp.s: -------------------------------------------------------------------------------- 1 | .text 2 | .global __m68k_read_tp 3 | .type __m68k_read_tp,@function 4 | __m68k_read_tp: 5 | move.l #333,%d0 6 | trap #0 7 | move.l %d0,%a0 8 | rts 9 | -------------------------------------------------------------------------------- /src/thread/microblaze/__set_thread_area.s: -------------------------------------------------------------------------------- 1 | .global __set_thread_area 2 | .type __set_thread_area,@function 3 | __set_thread_area: 4 | ori r21, r5, 0 5 | rtsd r15, 8 6 | ori r3, r0, 0 7 | -------------------------------------------------------------------------------- /src/thread/microblaze/__unmapself.s: -------------------------------------------------------------------------------- 1 | .global __unmapself 2 | .type __unmapself,@function 3 | __unmapself: 4 | ori r12, r0, 91 5 | brki r14, 0x8 6 | ori r12, r0, 1 7 | brki r14, 0x8 8 | nop 9 | -------------------------------------------------------------------------------- /src/thread/mips/__unmapself.s: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | .global __unmapself 3 | .type __unmapself,@function 4 | __unmapself: 5 | move $sp, $25 6 | li $2, 4091 7 | syscall 8 | li $4, 0 9 | li $2, 4001 10 | syscall 11 | -------------------------------------------------------------------------------- /src/thread/mips64/__unmapself.s: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | .global __unmapself 3 | .type __unmapself, @function 4 | __unmapself: 5 | li $2, 5011 6 | syscall 7 | li $4, 0 8 | li $2, 5058 9 | syscall 10 | -------------------------------------------------------------------------------- /src/thread/mipsn32/__unmapself.s: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | .global __unmapself 3 | .type __unmapself,@function 4 | __unmapself: 5 | li $2, 6011 6 | syscall 7 | li $4, 0 8 | li $2, 6058 9 | syscall 10 | -------------------------------------------------------------------------------- /src/thread/mtx_destroy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void mtx_destroy(mtx_t *mtx) 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /src/thread/or1k/__set_thread_area.s: -------------------------------------------------------------------------------- 1 | .global __set_thread_area 2 | .type __set_thread_area,@function 3 | __set_thread_area: 4 | l.ori r10, r3, 0 5 | l.jr r9 6 | l.ori r11, r0, 0 7 | -------------------------------------------------------------------------------- /src/thread/or1k/__unmapself.s: -------------------------------------------------------------------------------- 1 | .global __unmapself 2 | .type __unmapself,@function 3 | __unmapself: 4 | l.ori r11, r0, 215 /* __NR_munmap */ 5 | l.sys 1 6 | l.ori r3, r0, 0 7 | l.ori r11, r0, 93 /* __NR_exit */ 8 | l.sys 1 9 | -------------------------------------------------------------------------------- /src/thread/powerpc/__unmapself.s: -------------------------------------------------------------------------------- 1 | .text 2 | .global __unmapself 3 | .type __unmapself,%function 4 | __unmapself: 5 | li 0, 91 # __NR_munmap 6 | sc 7 | li 0, 1 #__NR_exit 8 | sc 9 | blr 10 | -------------------------------------------------------------------------------- /src/thread/powerpc64/__set_thread_area.s: -------------------------------------------------------------------------------- 1 | .text 2 | .global __set_thread_area 3 | .type __set_thread_area, %function 4 | __set_thread_area: 5 | mr 13, 3 6 | li 3, 0 7 | blr 8 | 9 | -------------------------------------------------------------------------------- /src/thread/powerpc64/__unmapself.s: -------------------------------------------------------------------------------- 1 | .text 2 | .global __unmapself 3 | .type __unmapself,%function 4 | __unmapself: 5 | li 0, 91 # __NR_munmap 6 | sc 7 | li 0, 1 #__NR_exit 8 | sc 9 | blr 10 | -------------------------------------------------------------------------------- /src/thread/pthread_attr_destroy.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_attr_destroy(pthread_attr_t *a) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/pthread_attr_setdetachstate.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_attr_setdetachstate(pthread_attr_t *a, int state) 4 | { 5 | if (state > 1U) return EINVAL; 6 | a->_a_detach = state; 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /src/thread/pthread_attr_setguardsize.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_attr_setguardsize(pthread_attr_t *a, size_t size) 4 | { 5 | if (size > SIZE_MAX/8) return EINVAL; 6 | a->_a_guardsize = size; 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /src/thread/pthread_attr_setschedparam.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_attr_setschedparam(pthread_attr_t *restrict a, const struct sched_param *restrict param) 4 | { 5 | a->_a_prio = param->sched_priority; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/pthread_attr_setschedpolicy.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_attr_setschedpolicy(pthread_attr_t *a, int policy) 4 | { 5 | a->_a_policy = policy; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/pthread_barrierattr_destroy.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_barrierattr_destroy(pthread_barrierattr_t *a) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/pthread_barrierattr_init.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_barrierattr_init(pthread_barrierattr_t *a) 4 | { 5 | *a = (pthread_barrierattr_t){0}; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/pthread_barrierattr_setpshared.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_barrierattr_setpshared(pthread_barrierattr_t *a, int pshared) 4 | { 5 | a->__attr = pshared ? INT_MIN : 0; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/pthread_cond_wait.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_cond_wait(pthread_cond_t *restrict c, pthread_mutex_t *restrict m) 4 | { 5 | return pthread_cond_timedwait(c, m, 0); 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/pthread_condattr_destroy.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_condattr_destroy(pthread_condattr_t *a) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/pthread_condattr_init.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_condattr_init(pthread_condattr_t *a) 4 | { 5 | *a = (pthread_condattr_t){0}; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/pthread_getconcurrency.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int pthread_getconcurrency() 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/pthread_getcpuclockid.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_getcpuclockid(pthread_t t, clockid_t *clockid) 4 | { 5 | *clockid = (-t->tid-1)*8U + 6; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/pthread_mutex_destroy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int pthread_mutex_destroy(pthread_mutex_t *mutex) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/pthread_mutex_getprioceiling.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_mutex_getprioceiling(const pthread_mutex_t *restrict m, int *restrict ceiling) 4 | { 5 | return EINVAL; 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/pthread_mutex_setprioceiling.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_mutex_setprioceiling(pthread_mutex_t *restrict m, int ceiling, int *restrict old) 4 | { 5 | return EINVAL; 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/pthread_mutexattr_destroy.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_mutexattr_destroy(pthread_mutexattr_t *a) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/pthread_mutexattr_init.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_mutexattr_init(pthread_mutexattr_t *a) 4 | { 5 | *a = (pthread_mutexattr_t){0}; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/pthread_mutexattr_setprotocol.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_mutexattr_setprotocol(pthread_mutexattr_t *a, int protocol) 4 | { 5 | if (protocol) return ENOTSUP; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/pthread_rwlock_destroy.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_rwlock_destroy(pthread_rwlock_t *rw) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/pthread_rwlock_rdlock.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_rwlock_rdlock(pthread_rwlock_t *rw) 4 | { 5 | return pthread_rwlock_timedrdlock(rw, 0); 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/pthread_rwlock_trywrlock.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_rwlock_trywrlock(pthread_rwlock_t *rw) 4 | { 5 | if (a_cas(&rw->_rw_lock, 0, 0x7fffffff)) return EBUSY; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/pthread_rwlock_wrlock.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_rwlock_wrlock(pthread_rwlock_t *rw) 4 | { 5 | return pthread_rwlock_timedwrlock(rw, 0); 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/pthread_rwlockattr_destroy.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_rwlockattr_destroy(pthread_rwlockattr_t *a) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/pthread_rwlockattr_init.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_rwlockattr_init(pthread_rwlockattr_t *a) 4 | { 5 | *a = (pthread_rwlockattr_t){0}; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/pthread_rwlockattr_setpshared.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *a, int pshared) 4 | { 5 | if (pshared > 1U) return EINVAL; 6 | a->__attr[0] = pshared; 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /src/thread/pthread_setconcurrency.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int pthread_setconcurrency(int val) 5 | { 6 | if (val < 0) return EINVAL; 7 | if (val > 0) return EAGAIN; 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /src/thread/pthread_spin_destroy.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_spin_destroy(pthread_spinlock_t *s) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/pthread_spin_init.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_spin_init(pthread_spinlock_t *s, int shared) 4 | { 5 | return *s = 0; 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/pthread_spin_lock.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | #include 3 | 4 | int pthread_spin_lock(pthread_spinlock_t *s) 5 | { 6 | while (*(volatile int *)s || a_cas(s, 0, EBUSY)) a_spin(); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /src/thread/pthread_spin_trylock.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | #include 3 | 4 | int pthread_spin_trylock(pthread_spinlock_t *s) 5 | { 6 | return a_cas(s, 0, EBUSY); 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/pthread_spin_unlock.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | 3 | int pthread_spin_unlock(pthread_spinlock_t *s) 4 | { 5 | a_store(s, 0); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/s390x/__set_thread_area.s: -------------------------------------------------------------------------------- 1 | .text 2 | .global __set_thread_area 3 | .type __set_thread_area, %function 4 | __set_thread_area: 5 | sar %a1, %r2 6 | srlg %r2, %r2, 32 7 | sar %a0, %r2 8 | lghi %r2, 0 9 | br %r14 10 | -------------------------------------------------------------------------------- /src/thread/s390x/__unmapself.s: -------------------------------------------------------------------------------- 1 | .text 2 | .global __unmapself 3 | .type __unmapself, @function 4 | __unmapself: 5 | svc 91 # SYS_munmap 6 | svc 1 # SYS_exit 7 | -------------------------------------------------------------------------------- /src/thread/sem_destroy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int sem_destroy(sem_t *sem) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/sem_getvalue.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int sem_getvalue(sem_t *restrict sem, int *restrict valp) 4 | { 5 | int val = sem->__val[0]; 6 | *valp = val < 0 ? 0 : val; 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /src/thread/sem_unlink.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int sem_unlink(const char *name) 5 | { 6 | return shm_unlink(name); 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/sem_wait.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int sem_wait(sem_t *sem) 4 | { 5 | return sem_timedwait(sem, 0); 6 | } 7 | -------------------------------------------------------------------------------- /src/thread/syscall_cp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/src/thread/syscall_cp.c -------------------------------------------------------------------------------- /src/thread/thrd_exit.c: -------------------------------------------------------------------------------- 1 | #include "pthread_impl.h" 2 | #include 3 | 4 | _Noreturn void __pthread_exit(void *); 5 | 6 | _Noreturn void thrd_exit(int result) 7 | { 8 | __pthread_exit((void*)(intptr_t)result); 9 | } 10 | -------------------------------------------------------------------------------- /src/thread/thrd_yield.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | void thrd_yield() 5 | { 6 | __syscall(SYS_sched_yield); 7 | } 8 | -------------------------------------------------------------------------------- /src/thread/tls.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfbastien/musl/f471628a96b568dcadf66879a8a1f364edd935ff/src/thread/tls.c -------------------------------------------------------------------------------- /src/thread/tss_delete.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int __pthread_key_delete(tss_t k); 4 | 5 | void tss_delete(tss_t key) 6 | { 7 | __pthread_key_delete(key); 8 | } 9 | -------------------------------------------------------------------------------- /src/time/asctime.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *__asctime(const struct tm *, char *); 4 | 5 | char *asctime(const struct tm *tm) 6 | { 7 | static char buf[26]; 8 | return __asctime(tm, buf); 9 | } 10 | -------------------------------------------------------------------------------- /src/time/asctime_r.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *__asctime(const struct tm *restrict, char *restrict); 4 | 5 | char *asctime_r(const struct tm *restrict tm, char *restrict buf) 6 | { 7 | return __asctime(tm, buf); 8 | } 9 | -------------------------------------------------------------------------------- /src/time/clock_getres.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int clock_getres(clockid_t clk, struct timespec *ts) 5 | { 6 | return syscall(SYS_clock_getres, clk, ts); 7 | } 8 | -------------------------------------------------------------------------------- /src/time/clock_settime.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int clock_settime(clockid_t clk, const struct timespec *ts) 5 | { 6 | return syscall(SYS_clock_settime, clk, ts); 7 | } 8 | -------------------------------------------------------------------------------- /src/time/ctime.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *ctime(const time_t *t) 4 | { 5 | struct tm *tm = localtime(t); 6 | if (!tm) return 0; 7 | return asctime(tm); 8 | } 9 | -------------------------------------------------------------------------------- /src/time/ctime_r.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *ctime_r(const time_t *t, char *buf) 4 | { 5 | struct tm tm, *tm_p = localtime_r(t, &tm); 6 | return tm_p ? asctime_r(tm_p, buf) : 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/time/difftime.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double difftime(time_t t1, time_t t0) 4 | { 5 | return t1-t0; 6 | } 7 | -------------------------------------------------------------------------------- /src/time/nanosleep.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int nanosleep(const struct timespec *req, struct timespec *rem) 6 | { 7 | return syscall_cp(SYS_nanosleep, req, rem); 8 | } 9 | -------------------------------------------------------------------------------- /src/time/times.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | clock_t times(struct tms *tms) 5 | { 6 | return __syscall(SYS_times, tms); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/_exit.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | _Noreturn void _exit(int status) 5 | { 6 | _Exit(status); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/acct.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include "syscall.h" 4 | #include "libc.h" 5 | 6 | int acct(const char *filename) 7 | { 8 | return syscall(SYS_acct, filename); 9 | } 10 | -------------------------------------------------------------------------------- /src/unistd/chdir.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int chdir(const char *path) 5 | { 6 | return syscall(SYS_chdir, path); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/ctermid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char *ctermid(char *s) 5 | { 6 | return s ? strcpy(s, "/dev/tty") : "/dev/tty"; 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/dup.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int dup(int fd) 5 | { 6 | return syscall(SYS_dup, fd); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/fchownat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int fchownat(int fd, const char *path, uid_t uid, gid_t gid, int flag) 5 | { 6 | return syscall(SYS_fchownat, fd, path, uid, gid, flag); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/fdatasync.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int fdatasync(int fd) 5 | { 6 | return syscall_cp(SYS_fdatasync, fd); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/fsync.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int fsync(int fd) 5 | { 6 | return syscall_cp(SYS_fsync, fd); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/ftruncate.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int ftruncate(int fd, off_t length) 6 | { 7 | return syscall(SYS_ftruncate, fd, __SYSCALL_LL_O(length)); 8 | } 9 | 10 | LFS64(ftruncate); 11 | -------------------------------------------------------------------------------- /src/unistd/getegid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | gid_t getegid(void) 5 | { 6 | return __syscall(SYS_getegid); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/geteuid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | uid_t geteuid(void) 5 | { 6 | return __syscall(SYS_geteuid); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/getgid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | gid_t getgid(void) 5 | { 6 | return __syscall(SYS_getgid); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/getgroups.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int getgroups(int count, gid_t list[]) 5 | { 6 | return syscall(SYS_getgroups, count, list); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/getlogin.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char *getlogin(void) 5 | { 6 | return getenv("LOGNAME"); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/getpgid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | pid_t getpgid(pid_t pid) 5 | { 6 | return syscall(SYS_getpgid, pid); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/getpgrp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | pid_t getpgrp(void) 5 | { 6 | return __syscall(SYS_getpgid, 0); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/getpid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | pid_t getpid(void) 5 | { 6 | return __syscall(SYS_getpid); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/getppid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | pid_t getppid(void) 5 | { 6 | return __syscall(SYS_getppid); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/getsid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | pid_t getsid(pid_t pid) 5 | { 6 | return syscall(SYS_getsid, pid); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/getuid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | uid_t getuid(void) 5 | { 6 | return __syscall(SYS_getuid); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/isatty.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "syscall.h" 4 | 5 | int isatty(int fd) 6 | { 7 | struct winsize wsz; 8 | return !__syscall(SYS_ioctl, fd, TIOCGWINSZ, &wsz); 9 | } 10 | -------------------------------------------------------------------------------- /src/unistd/linkat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int linkat(int fd1, const char *existing, int fd2, const char *new, int flag) 5 | { 6 | return syscall(SYS_linkat, fd1, existing, fd2, new, flag); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/pipe.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int pipe(int fd[2]) 5 | { 6 | #ifdef SYS_pipe 7 | return syscall(SYS_pipe, fd); 8 | #else 9 | return syscall(SYS_pipe2, fd, 0); 10 | #endif 11 | } 12 | -------------------------------------------------------------------------------- /src/unistd/posix_close.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int posix_close(int fd, int flags) 4 | { 5 | return close(fd); 6 | } 7 | -------------------------------------------------------------------------------- /src/unistd/read.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | ssize_t read(int fd, void *buf, size_t count) 6 | { 7 | return syscall_cp(SYS_read, fd, buf, count); 8 | } 9 | -------------------------------------------------------------------------------- /src/unistd/readlinkat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | ssize_t readlinkat(int fd, const char *restrict path, char *restrict buf, size_t bufsize) 5 | { 6 | return syscall(SYS_readlinkat, fd, path, buf, bufsize); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/readv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | ssize_t readv(int fd, const struct iovec *iov, int count) 6 | { 7 | return syscall_cp(SYS_readv, fd, iov, count); 8 | } 9 | -------------------------------------------------------------------------------- /src/unistd/renameat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int renameat(int oldfd, const char *old, int newfd, const char *new) 5 | { 6 | return syscall(SYS_renameat, oldfd, old, newfd, new); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/setegid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libc.h" 3 | #include "syscall.h" 4 | 5 | int setegid(gid_t egid) 6 | { 7 | return __setxid(SYS_setresgid, -1, egid, -1); 8 | } 9 | -------------------------------------------------------------------------------- /src/unistd/seteuid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int seteuid(uid_t euid) 6 | { 7 | return __setxid(SYS_setresuid, -1, euid, -1); 8 | } 9 | -------------------------------------------------------------------------------- /src/unistd/setgid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int setgid(gid_t gid) 6 | { 7 | return __setxid(SYS_setgid, gid, 0, 0); 8 | } 9 | -------------------------------------------------------------------------------- /src/unistd/setpgid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int setpgid(pid_t pid, pid_t pgid) 5 | { 6 | return syscall(SYS_setpgid, pid, pgid); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/setpgrp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | pid_t setpgrp(void) 4 | { 5 | return setpgid(0, 0); 6 | } 7 | -------------------------------------------------------------------------------- /src/unistd/setregid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int setregid(gid_t rgid, gid_t egid) 6 | { 7 | return __setxid(SYS_setregid, rgid, egid, 0); 8 | } 9 | -------------------------------------------------------------------------------- /src/unistd/setreuid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int setreuid(uid_t ruid, uid_t euid) 6 | { 7 | return __setxid(SYS_setreuid, ruid, euid, 0); 8 | } 9 | -------------------------------------------------------------------------------- /src/unistd/setsid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | pid_t setsid(void) 5 | { 6 | return syscall(SYS_setsid); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/setuid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | int setuid(uid_t uid) 6 | { 7 | return __setxid(SYS_setuid, uid, 0, 0); 8 | } 9 | -------------------------------------------------------------------------------- /src/unistd/symlinkat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int symlinkat(const char *existing, int fd, const char *new) 5 | { 6 | return syscall(SYS_symlinkat, existing, fd, new); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/sync.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | void sync(void) 5 | { 6 | __syscall(SYS_sync); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/tcgetpgrp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | pid_t tcgetpgrp(int fd) 6 | { 7 | int pgrp; 8 | if (ioctl(fd, TIOCGPGRP, &pgrp) < 0) 9 | return -1; 10 | return pgrp; 11 | } 12 | -------------------------------------------------------------------------------- /src/unistd/tcsetpgrp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int tcsetpgrp(int fd, pid_t pgrp) 6 | { 7 | int pgrp_int = pgrp; 8 | return ioctl(fd, TIOCSPGRP, &pgrp_int); 9 | } 10 | -------------------------------------------------------------------------------- /src/unistd/unlinkat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | 4 | int unlinkat(int fd, const char *path, int flag) 5 | { 6 | return syscall(SYS_unlinkat, fd, path, flag); 7 | } 8 | -------------------------------------------------------------------------------- /src/unistd/write.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | ssize_t write(int fd, const void *buf, size_t count) 6 | { 7 | return syscall_cp(SYS_write, fd, buf, count); 8 | } 9 | -------------------------------------------------------------------------------- /src/unistd/writev.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "syscall.h" 3 | #include "libc.h" 4 | 5 | ssize_t writev(int fd, const struct iovec *iov, int count) 6 | { 7 | return syscall_cp(SYS_writev, fd, iov, count); 8 | } 9 | --------------------------------------------------------------------------------