mirror of
https://github.com/ziglang/zig.git
synced 2024-12-13 14:47:09 +00:00
initial glibc support
This commit is contained in:
parent
9c5852aa86
commit
aeb16010f3
605
CMakeLists.txt
605
CMakeLists.txt
@ -804,6 +804,604 @@ set(ZIG_C_HEADER_FILES
|
||||
"xtestintrin.h"
|
||||
)
|
||||
|
||||
set(ZIG_LIBC_FILES
|
||||
"glibc-include/a.out.h"
|
||||
"glibc-include/aio.h"
|
||||
"glibc-include/aliases.h"
|
||||
"glibc-include/alloca.h"
|
||||
"glibc-include/ar.h"
|
||||
"glibc-include/argp.h"
|
||||
"glibc-include/argz.h"
|
||||
"glibc-include/arpa/ftp.h"
|
||||
"glibc-include/arpa/inet.h"
|
||||
"glibc-include/arpa/nameser.h"
|
||||
"glibc-include/arpa/nameser_compat.h"
|
||||
"glibc-include/arpa/telnet.h"
|
||||
"glibc-include/arpa/tftp.h"
|
||||
"glibc-include/assert.h"
|
||||
"glibc-include/bits/a.out.h"
|
||||
"glibc-include/bits/byteswap.h"
|
||||
"glibc-include/bits/cmathcalls.h"
|
||||
"glibc-include/bits/confname.h"
|
||||
"glibc-include/bits/cpu-set.h"
|
||||
"glibc-include/bits/dirent.h"
|
||||
"glibc-include/bits/dlfcn.h"
|
||||
"glibc-include/bits/elfclass.h"
|
||||
"glibc-include/bits/endian.h"
|
||||
"glibc-include/bits/environments.h"
|
||||
"glibc-include/bits/epoll.h"
|
||||
"glibc-include/bits/errno.h"
|
||||
"glibc-include/bits/error.h"
|
||||
"glibc-include/bits/eventfd.h"
|
||||
"glibc-include/bits/fcntl-linux.h"
|
||||
"glibc-include/bits/fcntl.h"
|
||||
"glibc-include/bits/fcntl2.h"
|
||||
"glibc-include/bits/fenv.h"
|
||||
"glibc-include/bits/fenvinline.h"
|
||||
"glibc-include/bits/floatn-common.h"
|
||||
"glibc-include/bits/floatn.h"
|
||||
"glibc-include/bits/flt-eval-method.h"
|
||||
"glibc-include/bits/fp-fast.h"
|
||||
"glibc-include/bits/fp-logb.h"
|
||||
"glibc-include/bits/getopt_core.h"
|
||||
"glibc-include/bits/getopt_ext.h"
|
||||
"glibc-include/bits/getopt_posix.h"
|
||||
"glibc-include/bits/hwcap.h"
|
||||
"glibc-include/bits/in.h"
|
||||
"glibc-include/bits/indirect-return.h"
|
||||
"glibc-include/bits/initspin.h"
|
||||
"glibc-include/bits/inotify.h"
|
||||
"glibc-include/bits/ioctl-types.h"
|
||||
"glibc-include/bits/ioctls.h"
|
||||
"glibc-include/bits/ipc.h"
|
||||
"glibc-include/bits/ipctypes.h"
|
||||
"glibc-include/bits/iscanonical.h"
|
||||
"glibc-include/bits/libc-header-start.h"
|
||||
"glibc-include/bits/libm-simd-decl-stubs.h"
|
||||
"glibc-include/bits/link.h"
|
||||
"glibc-include/bits/local_lim.h"
|
||||
"glibc-include/bits/locale.h"
|
||||
"glibc-include/bits/long-double.h"
|
||||
"glibc-include/bits/math-finite.h"
|
||||
"glibc-include/bits/math-vector.h"
|
||||
"glibc-include/bits/mathcalls-helper-functions.h"
|
||||
"glibc-include/bits/mathcalls-narrow.h"
|
||||
"glibc-include/bits/mathcalls.h"
|
||||
"glibc-include/bits/mathdef.h"
|
||||
"glibc-include/bits/mathinline.h"
|
||||
"glibc-include/bits/mman-linux.h"
|
||||
"glibc-include/bits/mman-map-flags-generic.h"
|
||||
"glibc-include/bits/mman-shared.h"
|
||||
"glibc-include/bits/mman.h"
|
||||
"glibc-include/bits/monetary-ldbl.h"
|
||||
"glibc-include/bits/mqueue.h"
|
||||
"glibc-include/bits/mqueue2.h"
|
||||
"glibc-include/bits/msq-pad.h"
|
||||
"glibc-include/bits/msq.h"
|
||||
"glibc-include/bits/netdb.h"
|
||||
"glibc-include/bits/param.h"
|
||||
"glibc-include/bits/poll.h"
|
||||
"glibc-include/bits/poll2.h"
|
||||
"glibc-include/bits/posix1_lim.h"
|
||||
"glibc-include/bits/posix2_lim.h"
|
||||
"glibc-include/bits/posix_opt.h"
|
||||
"glibc-include/bits/printf-ldbl.h"
|
||||
"glibc-include/bits/procfs-extra.h"
|
||||
"glibc-include/bits/procfs-id.h"
|
||||
"glibc-include/bits/procfs-prregset.h"
|
||||
"glibc-include/bits/procfs.h"
|
||||
"glibc-include/bits/pthreadtypes-arch.h"
|
||||
"glibc-include/bits/pthreadtypes.h"
|
||||
"glibc-include/bits/ptrace-shared.h"
|
||||
"glibc-include/bits/resource.h"
|
||||
"glibc-include/bits/sched.h"
|
||||
"glibc-include/bits/select.h"
|
||||
"glibc-include/bits/select2.h"
|
||||
"glibc-include/bits/sem-pad.h"
|
||||
"glibc-include/bits/sem.h"
|
||||
"glibc-include/bits/semaphore.h"
|
||||
"glibc-include/bits/setjmp.h"
|
||||
"glibc-include/bits/setjmp2.h"
|
||||
"glibc-include/bits/shm-pad.h"
|
||||
"glibc-include/bits/shm.h"
|
||||
"glibc-include/bits/shmlba.h"
|
||||
"glibc-include/bits/sigaction.h"
|
||||
"glibc-include/bits/sigcontext.h"
|
||||
"glibc-include/bits/sigevent-consts.h"
|
||||
"glibc-include/bits/siginfo-arch.h"
|
||||
"glibc-include/bits/siginfo-consts-arch.h"
|
||||
"glibc-include/bits/siginfo-consts.h"
|
||||
"glibc-include/bits/signalfd.h"
|
||||
"glibc-include/bits/signum-generic.h"
|
||||
"glibc-include/bits/signum.h"
|
||||
"glibc-include/bits/sigstack.h"
|
||||
"glibc-include/bits/sigthread.h"
|
||||
"glibc-include/bits/sockaddr.h"
|
||||
"glibc-include/bits/socket.h"
|
||||
"glibc-include/bits/socket2.h"
|
||||
"glibc-include/bits/socket_type.h"
|
||||
"glibc-include/bits/ss_flags.h"
|
||||
"glibc-include/bits/stab.def"
|
||||
"glibc-include/bits/stat.h"
|
||||
"glibc-include/bits/statfs.h"
|
||||
"glibc-include/bits/statvfs.h"
|
||||
"glibc-include/bits/statx.h"
|
||||
"glibc-include/bits/stdint-intn.h"
|
||||
"glibc-include/bits/stdint-uintn.h"
|
||||
"glibc-include/bits/stdio-ldbl.h"
|
||||
"glibc-include/bits/stdio.h"
|
||||
"glibc-include/bits/stdio2.h"
|
||||
"glibc-include/bits/stdio_lim.h"
|
||||
"glibc-include/bits/stdlib-bsearch.h"
|
||||
"glibc-include/bits/stdlib-float.h"
|
||||
"glibc-include/bits/stdlib-ldbl.h"
|
||||
"glibc-include/bits/stdlib.h"
|
||||
"glibc-include/bits/string_fortified.h"
|
||||
"glibc-include/bits/strings_fortified.h"
|
||||
"glibc-include/bits/stropts.h"
|
||||
"glibc-include/bits/sys_errlist.h"
|
||||
"glibc-include/bits/syscall.h"
|
||||
"glibc-include/bits/sysctl.h"
|
||||
"glibc-include/bits/syslog-ldbl.h"
|
||||
"glibc-include/bits/syslog-path.h"
|
||||
"glibc-include/bits/syslog.h"
|
||||
"glibc-include/bits/sysmacros.h"
|
||||
"glibc-include/bits/termios-baud.h"
|
||||
"glibc-include/bits/termios-c_cc.h"
|
||||
"glibc-include/bits/termios-c_cflag.h"
|
||||
"glibc-include/bits/termios-c_iflag.h"
|
||||
"glibc-include/bits/termios-c_lflag.h"
|
||||
"glibc-include/bits/termios-c_oflag.h"
|
||||
"glibc-include/bits/termios-misc.h"
|
||||
"glibc-include/bits/termios-struct.h"
|
||||
"glibc-include/bits/termios-tcflow.h"
|
||||
"glibc-include/bits/termios.h"
|
||||
"glibc-include/bits/thread-shared-types.h"
|
||||
"glibc-include/bits/time.h"
|
||||
"glibc-include/bits/time64.h"
|
||||
"glibc-include/bits/timerfd.h"
|
||||
"glibc-include/bits/timesize.h"
|
||||
"glibc-include/bits/timex.h"
|
||||
"glibc-include/bits/types.h"
|
||||
"glibc-include/bits/types/FILE.h"
|
||||
"glibc-include/bits/types/__FILE.h"
|
||||
"glibc-include/bits/types/__fpos64_t.h"
|
||||
"glibc-include/bits/types/__fpos_t.h"
|
||||
"glibc-include/bits/types/__locale_t.h"
|
||||
"glibc-include/bits/types/__mbstate_t.h"
|
||||
"glibc-include/bits/types/__sigset_t.h"
|
||||
"glibc-include/bits/types/__sigval_t.h"
|
||||
"glibc-include/bits/types/clock_t.h"
|
||||
"glibc-include/bits/types/clockid_t.h"
|
||||
"glibc-include/bits/types/cookie_io_functions_t.h"
|
||||
"glibc-include/bits/types/error_t.h"
|
||||
"glibc-include/bits/types/locale_t.h"
|
||||
"glibc-include/bits/types/mbstate_t.h"
|
||||
"glibc-include/bits/types/res_state.h"
|
||||
"glibc-include/bits/types/sig_atomic_t.h"
|
||||
"glibc-include/bits/types/sigevent_t.h"
|
||||
"glibc-include/bits/types/siginfo_t.h"
|
||||
"glibc-include/bits/types/sigset_t.h"
|
||||
"glibc-include/bits/types/sigval_t.h"
|
||||
"glibc-include/bits/types/stack_t.h"
|
||||
"glibc-include/bits/types/struct_FILE.h"
|
||||
"glibc-include/bits/types/struct_iovec.h"
|
||||
"glibc-include/bits/types/struct_itimerspec.h"
|
||||
"glibc-include/bits/types/struct_osockaddr.h"
|
||||
"glibc-include/bits/types/struct_rusage.h"
|
||||
"glibc-include/bits/types/struct_sched_param.h"
|
||||
"glibc-include/bits/types/struct_sigstack.h"
|
||||
"glibc-include/bits/types/struct_timespec.h"
|
||||
"glibc-include/bits/types/struct_timeval.h"
|
||||
"glibc-include/bits/types/struct_tm.h"
|
||||
"glibc-include/bits/types/time_t.h"
|
||||
"glibc-include/bits/types/timer_t.h"
|
||||
"glibc-include/bits/types/wint_t.h"
|
||||
"glibc-include/bits/typesizes.h"
|
||||
"glibc-include/bits/uintn-identity.h"
|
||||
"glibc-include/bits/uio-ext.h"
|
||||
"glibc-include/bits/uio_lim.h"
|
||||
"glibc-include/bits/unistd.h"
|
||||
"glibc-include/bits/utmp.h"
|
||||
"glibc-include/bits/utmpx.h"
|
||||
"glibc-include/bits/utsname.h"
|
||||
"glibc-include/bits/waitflags.h"
|
||||
"glibc-include/bits/waitstatus.h"
|
||||
"glibc-include/bits/wchar-ldbl.h"
|
||||
"glibc-include/bits/wchar.h"
|
||||
"glibc-include/bits/wchar2.h"
|
||||
"glibc-include/bits/wctype-wchar.h"
|
||||
"glibc-include/bits/wordsize.h"
|
||||
"glibc-include/bits/xopen_lim.h"
|
||||
"glibc-include/bits/xtitypes.h"
|
||||
"glibc-include/byteswap.h"
|
||||
"glibc-include/complex.h"
|
||||
"glibc-include/cpio.h"
|
||||
"glibc-include/crypt.h"
|
||||
"glibc-include/ctype.h"
|
||||
"glibc-include/dirent.h"
|
||||
"glibc-include/dlfcn.h"
|
||||
"glibc-include/elf.h"
|
||||
"glibc-include/endian.h"
|
||||
"glibc-include/envz.h"
|
||||
"glibc-include/err.h"
|
||||
"glibc-include/errno.h"
|
||||
"glibc-include/error.h"
|
||||
"glibc-include/execinfo.h"
|
||||
"glibc-include/fcntl.h"
|
||||
"glibc-include/features.h"
|
||||
"glibc-include/fenv.h"
|
||||
"glibc-include/fmtmsg.h"
|
||||
"glibc-include/fnmatch.h"
|
||||
"glibc-include/fpu_control.h"
|
||||
"glibc-include/fstab.h"
|
||||
"glibc-include/fts.h"
|
||||
"glibc-include/ftw.h"
|
||||
"glibc-include/gconv.h"
|
||||
"glibc-include/getopt.h"
|
||||
"glibc-include/glob.h"
|
||||
"glibc-include/gnu-versions.h"
|
||||
"glibc-include/gnu/lib-names-64.h"
|
||||
"glibc-include/gnu/lib-names.h"
|
||||
"glibc-include/gnu/libc-version.h"
|
||||
"glibc-include/gnu/stubs-64.h"
|
||||
"glibc-include/gnu/stubs.h"
|
||||
"glibc-include/grp.h"
|
||||
"glibc-include/gshadow.h"
|
||||
"glibc-include/iconv.h"
|
||||
"glibc-include/ieee754.h"
|
||||
"glibc-include/ifaddrs.h"
|
||||
"glibc-include/inttypes.h"
|
||||
"glibc-include/langinfo.h"
|
||||
"glibc-include/lastlog.h"
|
||||
"glibc-include/libgen.h"
|
||||
"glibc-include/libintl.h"
|
||||
"glibc-include/limits.h"
|
||||
"glibc-include/link.h"
|
||||
"glibc-include/locale.h"
|
||||
"glibc-include/malloc.h"
|
||||
"glibc-include/math.h"
|
||||
"glibc-include/mcheck.h"
|
||||
"glibc-include/memory.h"
|
||||
"glibc-include/mntent.h"
|
||||
"glibc-include/monetary.h"
|
||||
"glibc-include/mqueue.h"
|
||||
"glibc-include/net/ethernet.h"
|
||||
"glibc-include/net/if.h"
|
||||
"glibc-include/net/if_arp.h"
|
||||
"glibc-include/net/if_packet.h"
|
||||
"glibc-include/net/if_ppp.h"
|
||||
"glibc-include/net/if_shaper.h"
|
||||
"glibc-include/net/if_slip.h"
|
||||
"glibc-include/net/ppp-comp.h"
|
||||
"glibc-include/net/ppp_defs.h"
|
||||
"glibc-include/net/route.h"
|
||||
"glibc-include/netash/ash.h"
|
||||
"glibc-include/netatalk/at.h"
|
||||
"glibc-include/netax25/ax25.h"
|
||||
"glibc-include/netdb.h"
|
||||
"glibc-include/neteconet/ec.h"
|
||||
"glibc-include/netinet/ether.h"
|
||||
"glibc-include/netinet/icmp6.h"
|
||||
"glibc-include/netinet/if_ether.h"
|
||||
"glibc-include/netinet/if_fddi.h"
|
||||
"glibc-include/netinet/if_tr.h"
|
||||
"glibc-include/netinet/igmp.h"
|
||||
"glibc-include/netinet/in.h"
|
||||
"glibc-include/netinet/in_systm.h"
|
||||
"glibc-include/netinet/ip.h"
|
||||
"glibc-include/netinet/ip6.h"
|
||||
"glibc-include/netinet/ip_icmp.h"
|
||||
"glibc-include/netinet/tcp.h"
|
||||
"glibc-include/netinet/udp.h"
|
||||
"glibc-include/netipx/ipx.h"
|
||||
"glibc-include/netiucv/iucv.h"
|
||||
"glibc-include/netpacket/packet.h"
|
||||
"glibc-include/netrom/netrom.h"
|
||||
"glibc-include/netrose/rose.h"
|
||||
"glibc-include/nfs/nfs.h"
|
||||
"glibc-include/nl_types.h"
|
||||
"glibc-include/nss.h"
|
||||
"glibc-include/obstack.h"
|
||||
"glibc-include/paths.h"
|
||||
"glibc-include/poll.h"
|
||||
"glibc-include/printf.h"
|
||||
"glibc-include/proc_service.h"
|
||||
"glibc-include/protocols/routed.h"
|
||||
"glibc-include/protocols/rwhod.h"
|
||||
"glibc-include/protocols/talkd.h"
|
||||
"glibc-include/protocols/timed.h"
|
||||
"glibc-include/pthread.h"
|
||||
"glibc-include/pty.h"
|
||||
"glibc-include/pwd.h"
|
||||
"glibc-include/re_comp.h"
|
||||
"glibc-include/regex.h"
|
||||
"glibc-include/regexp.h"
|
||||
"glibc-include/resolv.h"
|
||||
"glibc-include/rpc/netdb.h"
|
||||
"glibc-include/sched.h"
|
||||
"glibc-include/scsi/scsi.h"
|
||||
"glibc-include/scsi/scsi_ioctl.h"
|
||||
"glibc-include/scsi/sg.h"
|
||||
"glibc-include/search.h"
|
||||
"glibc-include/semaphore.h"
|
||||
"glibc-include/setjmp.h"
|
||||
"glibc-include/sgtty.h"
|
||||
"glibc-include/shadow.h"
|
||||
"glibc-include/signal.h"
|
||||
"glibc-include/spawn.h"
|
||||
"glibc-include/stab.h"
|
||||
"glibc-include/stdc-predef.h"
|
||||
"glibc-include/stdint.h"
|
||||
"glibc-include/stdio.h"
|
||||
"glibc-include/stdio_ext.h"
|
||||
"glibc-include/stdlib.h"
|
||||
"glibc-include/string.h"
|
||||
"glibc-include/strings.h"
|
||||
"glibc-include/stropts.h"
|
||||
"glibc-include/sys/acct.h"
|
||||
"glibc-include/sys/auxv.h"
|
||||
"glibc-include/sys/bitypes.h"
|
||||
"glibc-include/sys/cdefs.h"
|
||||
"glibc-include/sys/debugreg.h"
|
||||
"glibc-include/sys/dir.h"
|
||||
"glibc-include/sys/elf.h"
|
||||
"glibc-include/sys/epoll.h"
|
||||
"glibc-include/sys/errno.h"
|
||||
"glibc-include/sys/eventfd.h"
|
||||
"glibc-include/sys/fanotify.h"
|
||||
"glibc-include/sys/fcntl.h"
|
||||
"glibc-include/sys/file.h"
|
||||
"glibc-include/sys/fsuid.h"
|
||||
"glibc-include/sys/gmon.h"
|
||||
"glibc-include/sys/gmon_out.h"
|
||||
"glibc-include/sys/inotify.h"
|
||||
"glibc-include/sys/io.h"
|
||||
"glibc-include/sys/ioctl.h"
|
||||
"glibc-include/sys/ipc.h"
|
||||
"glibc-include/sys/kd.h"
|
||||
"glibc-include/sys/klog.h"
|
||||
"glibc-include/sys/mman.h"
|
||||
"glibc-include/sys/mount.h"
|
||||
"glibc-include/sys/msg.h"
|
||||
"glibc-include/sys/mtio.h"
|
||||
"glibc-include/sys/param.h"
|
||||
"glibc-include/sys/pci.h"
|
||||
"glibc-include/sys/perm.h"
|
||||
"glibc-include/sys/personality.h"
|
||||
"glibc-include/sys/poll.h"
|
||||
"glibc-include/sys/prctl.h"
|
||||
"glibc-include/sys/procfs.h"
|
||||
"glibc-include/sys/profil.h"
|
||||
"glibc-include/sys/ptrace.h"
|
||||
"glibc-include/sys/queue.h"
|
||||
"glibc-include/sys/quota.h"
|
||||
"glibc-include/sys/random.h"
|
||||
"glibc-include/sys/raw.h"
|
||||
"glibc-include/sys/reboot.h"
|
||||
"glibc-include/sys/reg.h"
|
||||
"glibc-include/sys/resource.h"
|
||||
"glibc-include/sys/select.h"
|
||||
"glibc-include/sys/sem.h"
|
||||
"glibc-include/sys/sendfile.h"
|
||||
"glibc-include/sys/shm.h"
|
||||
"glibc-include/sys/signal.h"
|
||||
"glibc-include/sys/signalfd.h"
|
||||
"glibc-include/sys/socket.h"
|
||||
"glibc-include/sys/socketvar.h"
|
||||
"glibc-include/sys/soundcard.h"
|
||||
"glibc-include/sys/stat.h"
|
||||
"glibc-include/sys/statfs.h"
|
||||
"glibc-include/sys/statvfs.h"
|
||||
"glibc-include/sys/stropts.h"
|
||||
"glibc-include/sys/swap.h"
|
||||
"glibc-include/sys/syscall.h"
|
||||
"glibc-include/sys/sysctl.h"
|
||||
"glibc-include/sys/sysinfo.h"
|
||||
"glibc-include/sys/syslog.h"
|
||||
"glibc-include/sys/sysmacros.h"
|
||||
"glibc-include/sys/termios.h"
|
||||
"glibc-include/sys/time.h"
|
||||
"glibc-include/sys/timeb.h"
|
||||
"glibc-include/sys/timerfd.h"
|
||||
"glibc-include/sys/times.h"
|
||||
"glibc-include/sys/timex.h"
|
||||
"glibc-include/sys/ttychars.h"
|
||||
"glibc-include/sys/ttydefaults.h"
|
||||
"glibc-include/sys/types.h"
|
||||
"glibc-include/sys/ucontext.h"
|
||||
"glibc-include/sys/uio.h"
|
||||
"glibc-include/sys/un.h"
|
||||
"glibc-include/sys/unistd.h"
|
||||
"glibc-include/sys/user.h"
|
||||
"glibc-include/sys/utsname.h"
|
||||
"glibc-include/sys/vfs.h"
|
||||
"glibc-include/sys/vlimit.h"
|
||||
"glibc-include/sys/vm86.h"
|
||||
"glibc-include/sys/vt.h"
|
||||
"glibc-include/sys/vtimes.h"
|
||||
"glibc-include/sys/wait.h"
|
||||
"glibc-include/sys/xattr.h"
|
||||
"glibc-include/syscall.h"
|
||||
"glibc-include/sysexits.h"
|
||||
"glibc-include/syslog.h"
|
||||
"glibc-include/tar.h"
|
||||
"glibc-include/termio.h"
|
||||
"glibc-include/termios.h"
|
||||
"glibc-include/tgmath.h"
|
||||
"glibc-include/thread_db.h"
|
||||
"glibc-include/threads.h"
|
||||
"glibc-include/time.h"
|
||||
"glibc-include/ttyent.h"
|
||||
"glibc-include/uchar.h"
|
||||
"glibc-include/ucontext.h"
|
||||
"glibc-include/ulimit.h"
|
||||
"glibc-include/unistd.h"
|
||||
"glibc-include/utime.h"
|
||||
"glibc-include/utmp.h"
|
||||
"glibc-include/utmpx.h"
|
||||
"glibc-include/values.h"
|
||||
"glibc-include/wait.h"
|
||||
"glibc-include/wchar.h"
|
||||
"glibc-include/wctype.h"
|
||||
"glibc-include/wordexp.h"
|
||||
"glibc/bits/byteswap.h"
|
||||
"glibc/bits/endian.h"
|
||||
"glibc/bits/floatn-common.h"
|
||||
"glibc/bits/libc-header-start.h"
|
||||
"glibc/bits/long-double.h"
|
||||
"glibc/bits/stdint-intn.h"
|
||||
"glibc/bits/timesize.h"
|
||||
"glibc/bits/typesizes.h"
|
||||
"glibc/bits/time64.h"
|
||||
"glibc/bits/uintn-identity.h"
|
||||
"glibc/bits/waitflags.h"
|
||||
"glibc/bits/waitstatus.h"
|
||||
"glibc/bits/select.h"
|
||||
"glibc/bits/pthreadtypes.h"
|
||||
"glibc/bits/types/__sigset_t.h"
|
||||
"glibc/bits/types/struct_sched_param.h"
|
||||
"glibc/bits/stdlib-bsearch.h"
|
||||
"glibc/bits/stat.h"
|
||||
"glibc/bits/sched.h"
|
||||
"glibc/bits/time.h"
|
||||
"glibc/csu/abi-note.S"
|
||||
"glibc/csu/abi-tag.h"
|
||||
"glibc/csu/elf-init.c"
|
||||
"glibc/csu/init.c"
|
||||
"glibc/debug/stack_chk_fail_local.c"
|
||||
"glibc/debug/warning-nop.c"
|
||||
"glibc/include/alloca.h"
|
||||
"glibc/include/bits/types.h"
|
||||
"glibc/include/bits/types/__locale_t.h"
|
||||
"glibc/include/bits/types/clock_t.h"
|
||||
"glibc/include/bits/types/time_t.h"
|
||||
"glibc/include/bits/types/timer_t.h"
|
||||
"glibc/include/bits/types/clockid_t.h"
|
||||
"glibc/include/bits/types/locale_t.h"
|
||||
"glibc/include/bits/types/sigset_t.h"
|
||||
"glibc/include/bits/types/struct_timeval.h"
|
||||
"glibc/include/bits/types/struct_timespec.h"
|
||||
"glibc/include/bits/stdlib-float.h"
|
||||
"glibc/include/bits/statx.h"
|
||||
"glibc/include/bits/cpu-set.h"
|
||||
"glibc/include/config.h"
|
||||
"glibc/include/elf.h"
|
||||
"glibc/include/endian.h"
|
||||
"glibc/include/features.h"
|
||||
"glibc/include/gnu/stubs.h"
|
||||
"glibc/include/libc-modules.h"
|
||||
"glibc/include/libc-symbols.h"
|
||||
"glibc/include/stdc-predef.h"
|
||||
"glibc/include/stdlib.h"
|
||||
"glibc/include/sys/cdefs.h"
|
||||
"glibc/include/sys/types.h"
|
||||
"glibc/include/sys/select.h"
|
||||
"glibc/include/sys/stat.h"
|
||||
"glibc/include/stackinfo.h"
|
||||
"glibc/include/libc-pointer-arith.h"
|
||||
"glibc/include/dso_handle.h"
|
||||
"glibc/include/pthread.h"
|
||||
"glibc/include/sched.h"
|
||||
"glibc/include/time.h"
|
||||
"glibc/include/sys/time.h"
|
||||
"glibc/io/fstat.c"
|
||||
"glibc/io/fstat64.c"
|
||||
"glibc/io/fstatat.c"
|
||||
"glibc/io/fstatat64.c"
|
||||
"glibc/io/lstat.c"
|
||||
"glibc/io/lstat64.c"
|
||||
"glibc/io/mknod.c"
|
||||
"glibc/io/mknodat.c"
|
||||
"glibc/io/stat.c"
|
||||
"glibc/io/stat64.c"
|
||||
"glibc/io/sys/stat.h"
|
||||
"glibc/io/bits/statx.h"
|
||||
"glibc/locale/bits/types/__locale_t.h"
|
||||
"glibc/locale/bits/types/locale_t.h"
|
||||
"glibc/misc/sys/cdefs.h"
|
||||
"glibc/misc/sys/select.h"
|
||||
"glibc/nptl/pthread_atfork.c"
|
||||
"glibc/posix/bits/types.h"
|
||||
"glibc/posix/sys/types.h"
|
||||
"glibc/posix/sched.h"
|
||||
"glibc/posix/bits/cpu-set.h"
|
||||
"glibc/stdlib/at_quick_exit.c"
|
||||
"glibc/stdlib/atexit.c"
|
||||
"glibc/stdlib/exit.h"
|
||||
"glibc/stdlib/stdlib.h"
|
||||
"glibc/stdlib/bits/stdlib-float.h"
|
||||
"glibc/sysdeps/generic/dwarf2.h"
|
||||
"glibc/sysdeps/generic/symbol-hacks.h"
|
||||
"glibc/sysdeps/generic/sysdep.h"
|
||||
"glibc/sysdeps/generic/stackinfo.h"
|
||||
"glibc/sysdeps/generic/dl-dtprocnum.h"
|
||||
"glibc/sysdeps/generic/allocalim.h"
|
||||
"glibc/sysdeps/generic/libc-lock.h"
|
||||
"glibc/sysdeps/pthread/allocalim.h"
|
||||
"glibc/sysdeps/nptl/bits/pthreadtypes.h"
|
||||
"glibc/sysdeps/nptl/bits/thread-shared-types.h"
|
||||
"glibc/sysdeps/nptl/libc-lock.h"
|
||||
"glibc/sysdeps/nptl/pthread.h"
|
||||
"glibc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h"
|
||||
"glibc/sysdeps/unix/sysv/linux/x86/sys/elf.h"
|
||||
"glibc/sysdeps/unix/sysv/linux/bits/sched.h"
|
||||
"glibc/sysdeps/unix/sysv/linux/bits/time.h"
|
||||
"glibc/sysdeps/unix/sysv/linux/include/sys/timex.h"
|
||||
"glibc/sysdeps/unix/sysv/linux/sys/timex.h"
|
||||
"glibc/sysdeps/unix/sysv/linux/bits/timex.h"
|
||||
"glibc/sysdeps/x86/bits/floatn.h"
|
||||
"glibc/sysdeps/x86/bits/wordsize.h"
|
||||
"glibc/sysdeps/x86/bits/endian.h"
|
||||
"glibc/sysdeps/x86/bits/select.h"
|
||||
"glibc/sysdeps/x86/sysdep.h"
|
||||
"glibc/sysdeps/x86/nptl/bits/pthreadtypes-arch.h"
|
||||
"glibc/sysdeps/x86_64/crti.S"
|
||||
"glibc/sysdeps/x86_64/crtn.S"
|
||||
"glibc/sysdeps/x86_64/start.S"
|
||||
"glibc/sysdeps/x86_64/sysdep.h"
|
||||
"glibc/sysdeps/x86_64/stackinfo.h"
|
||||
"glibc/time/bits/types/clock_t.h"
|
||||
"glibc/time/bits/types/clockid_t.h"
|
||||
"glibc/time/bits/types/time_t.h"
|
||||
"glibc/time/bits/types/timer_t.h"
|
||||
"glibc/time/bits/types/struct_timeval.h"
|
||||
"glibc/time/bits/types/struct_timespec.h"
|
||||
"glibc/time/time.h"
|
||||
"glibc/time/sys/time.h"
|
||||
"glibc/string/endian.h"
|
||||
"glibc/signal/bits/types/sigset_t.h"
|
||||
"glibc/stdlib/alloca.h"
|
||||
"glibc/elf/elf.h"
|
||||
"glibc/include/bits/types/struct_tm.h"
|
||||
"glibc/time/bits/types/struct_tm.h"
|
||||
"glibc/include/bits/types/struct_itimerspec.h"
|
||||
"glibc/time/bits/types/struct_itimerspec.h"
|
||||
"glibc/sysdeps/x86/bits/setjmp.h"
|
||||
"glibc/include/setjmp.h"
|
||||
"glibc/setjmp/setjmp.h"
|
||||
"glibc/setjmp/setjmp.h"
|
||||
"glibc/bits/setjmp.h"
|
||||
"glibc/sysdeps/nptl/libc-lockP.h"
|
||||
"glibc/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h"
|
||||
"glibc/sysdeps/nptl/lowlevellock.h"
|
||||
"glibc/include/stap-probe.h"
|
||||
"glibc/sysdeps/unix/sysv/linux/bits/param.h"
|
||||
"glibc/include/sys/param.h"
|
||||
"glibc/misc/sys/param.h"
|
||||
"glibc/bits/param.h"
|
||||
"glibc/include/signal.h"
|
||||
"glibc/include/sys/signal.h"
|
||||
"glibc/signal/signal.h"
|
||||
"glibc/signal/sys/signal.h"
|
||||
"glibc/sysdeps/unix/sysv/linux/bits/signum.h"
|
||||
"glibc/bits/signum.h"
|
||||
"glibc/bits/signum-generic.h"
|
||||
"glibc/include/bits/types/sig_atomic_t.h"
|
||||
"glibc/signal/bits/types/sig_atomic_t.h"
|
||||
"symbols.zig"
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
set(MSVC_DIA_SDK_DIR "$ENV{VSINSTALLDIR}DIA SDK")
|
||||
if (IS_DIRECTORY ${MSVC_DIA_SDK_DIR})
|
||||
@ -814,6 +1412,7 @@ endif()
|
||||
|
||||
set(ZIG_LIB_DIR "lib/zig")
|
||||
set(C_HEADERS_DEST "${ZIG_LIB_DIR}/include")
|
||||
set(LIBC_FILES_DEST "${ZIG_LIB_DIR}/libc")
|
||||
set(ZIG_STD_DEST "${ZIG_LIB_DIR}/std")
|
||||
set(CONFIGURE_OUT_FILE "${CMAKE_BINARY_DIR}/config.h")
|
||||
configure_file (
|
||||
@ -917,6 +1516,12 @@ foreach(file ${ZIG_STD_FILES})
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/std/${file}" DESTINATION "${file_dir}")
|
||||
endforeach()
|
||||
|
||||
foreach(file ${ZIG_LIBC_FILES})
|
||||
get_filename_component(file_dir "${LIBC_FILES_DEST}/${file}" DIRECTORY)
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/libc/${file}" DESTINATION "${file_dir}")
|
||||
endforeach()
|
||||
|
||||
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/src-self-hosted/arg.zig" DESTINATION "${ZIG_STD_DEST}/special/fmt/")
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/src-self-hosted/main.zig" DESTINATION "${ZIG_STD_DEST}/special/fmt/")
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/src-self-hosted/errmsg.zig" DESTINATION "${ZIG_STD_DEST}/special/fmt/")
|
||||
|
138
libc/glibc-include/a.out.h
Normal file
138
libc/glibc-include/a.out.h
Normal file
@ -0,0 +1,138 @@
|
||||
#ifndef __A_OUT_GNU_H__
|
||||
#define __A_OUT_GNU_H__
|
||||
|
||||
#include <bits/a.out.h>
|
||||
|
||||
#define __GNU_EXEC_MACROS__
|
||||
|
||||
struct exec
|
||||
{
|
||||
unsigned long a_info; /* Use macros N_MAGIC, etc for access. */
|
||||
unsigned int a_text; /* Length of text, in bytes. */
|
||||
unsigned int a_data; /* Length of data, in bytes. */
|
||||
unsigned int a_bss; /* Length of uninitialized data area for file, in bytes. */
|
||||
unsigned int a_syms; /* Length of symbol table data in file, in bytes. */
|
||||
unsigned int a_entry; /* Start address. */
|
||||
unsigned int a_trsize;/* Length of relocation info for text, in bytes. */
|
||||
unsigned int a_drsize;/* Length of relocation info for data, in bytes. */
|
||||
};
|
||||
|
||||
enum machine_type
|
||||
{
|
||||
M_OLDSUN2 = 0,
|
||||
M_68010 = 1,
|
||||
M_68020 = 2,
|
||||
M_SPARC = 3,
|
||||
M_386 = 100,
|
||||
M_MIPS1 = 151,
|
||||
M_MIPS2 = 152
|
||||
};
|
||||
|
||||
#define N_MAGIC(exec) ((exec).a_info & 0xffff)
|
||||
#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
|
||||
#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
|
||||
#define N_SET_INFO(exec, magic, type, flags) \
|
||||
((exec).a_info = ((magic) & 0xffff) \
|
||||
| (((int)(type) & 0xff) << 16) \
|
||||
| (((flags) & 0xff) << 24))
|
||||
#define N_SET_MAGIC(exec, magic) \
|
||||
((exec).a_info = ((exec).a_info & 0xffff0000) | ((magic) & 0xffff))
|
||||
#define N_SET_MACHTYPE(exec, machtype) \
|
||||
((exec).a_info = \
|
||||
((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
|
||||
#define N_SET_FLAGS(exec, flags) \
|
||||
((exec).a_info = \
|
||||
((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
|
||||
|
||||
/* Code indicating object file or impure executable. */
|
||||
#define OMAGIC 0407
|
||||
/* Code indicating pure executable. */
|
||||
#define NMAGIC 0410
|
||||
/* Code indicating demand-paged executable. */
|
||||
#define ZMAGIC 0413
|
||||
/* This indicates a demand-paged executable with the header in the text.
|
||||
The first page is unmapped to help trap NULL pointer references. */
|
||||
#define QMAGIC 0314
|
||||
/* Code indicating core file. */
|
||||
#define CMAGIC 0421
|
||||
|
||||
#define N_TRSIZE(a) ((a).a_trsize)
|
||||
#define N_DRSIZE(a) ((a).a_drsize)
|
||||
#define N_SYMSIZE(a) ((a).a_syms)
|
||||
#define N_BADMAG(x) \
|
||||
(N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC \
|
||||
&& N_MAGIC(x) != ZMAGIC && N_MAGIC(x) != QMAGIC)
|
||||
#define _N_HDROFF(x) (1024 - sizeof (struct exec))
|
||||
#define N_TXTOFF(x) \
|
||||
(N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : \
|
||||
(N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec)))
|
||||
#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text)
|
||||
#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
|
||||
#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x))
|
||||
#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x))
|
||||
#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x))
|
||||
|
||||
/* Address of text segment in memory after it is loaded. */
|
||||
#define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? 4096 : 0)
|
||||
|
||||
/* Address of data segment in memory after it is loaded. */
|
||||
#define SEGMENT_SIZE 1024
|
||||
|
||||
#define _N_SEGMENT_ROUND(x) (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1))
|
||||
#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text)
|
||||
|
||||
#define N_DATADDR(x) \
|
||||
(N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \
|
||||
: (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
|
||||
#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
|
||||
|
||||
#if !defined (N_NLIST_DECLARED)
|
||||
struct nlist
|
||||
{
|
||||
union
|
||||
{
|
||||
char *n_name;
|
||||
struct nlist *n_next;
|
||||
long n_strx;
|
||||
} n_un;
|
||||
unsigned char n_type;
|
||||
char n_other;
|
||||
short n_desc;
|
||||
unsigned long n_value;
|
||||
};
|
||||
#endif /* no N_NLIST_DECLARED. */
|
||||
|
||||
#define N_UNDF 0
|
||||
#define N_ABS 2
|
||||
#define N_TEXT 4
|
||||
#define N_DATA 6
|
||||
#define N_BSS 8
|
||||
#define N_FN 15
|
||||
#define N_EXT 1
|
||||
#define N_TYPE 036
|
||||
#define N_STAB 0340
|
||||
#define N_INDR 0xa
|
||||
#define N_SETA 0x14 /* Absolute set element symbol. */
|
||||
#define N_SETT 0x16 /* Text set element symbol. */
|
||||
#define N_SETD 0x18 /* Data set element symbol. */
|
||||
#define N_SETB 0x1A /* Bss set element symbol. */
|
||||
#define N_SETV 0x1C /* Pointer to set vector in data area. */
|
||||
|
||||
#if !defined (N_RELOCATION_INFO_DECLARED)
|
||||
/* This structure describes a single relocation to be performed.
|
||||
The text-relocation section of the file is a vector of these structures,
|
||||
all of which apply to the text section.
|
||||
Likewise, the data-relocation section applies to the data section. */
|
||||
|
||||
struct relocation_info
|
||||
{
|
||||
int r_address;
|
||||
unsigned int r_symbolnum:24;
|
||||
unsigned int r_pcrel:1;
|
||||
unsigned int r_length:2;
|
||||
unsigned int r_extern:1;
|
||||
unsigned int r_pad:4;
|
||||
};
|
||||
#endif /* no N_RELOCATION_INFO_DECLARED. */
|
||||
|
||||
#endif /* __A_OUT_GNU_H__ */
|
245
libc/glibc-include/aio.h
Normal file
245
libc/glibc-include/aio.h
Normal file
@ -0,0 +1,245 @@
|
||||
/* Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* ISO/IEC 9945-1:1996 6.7: Asynchronous Input and Output
|
||||
*/
|
||||
|
||||
#ifndef _AIO_H
|
||||
#define _AIO_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/types.h>
|
||||
#include <bits/types/sigevent_t.h>
|
||||
#include <bits/sigevent-consts.h>
|
||||
#include <bits/types/struct_timespec.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Asynchronous I/O control block. */
|
||||
struct aiocb
|
||||
{
|
||||
int aio_fildes; /* File desriptor. */
|
||||
int aio_lio_opcode; /* Operation to be performed. */
|
||||
int aio_reqprio; /* Request priority offset. */
|
||||
volatile void *aio_buf; /* Location of buffer. */
|
||||
size_t aio_nbytes; /* Length of transfer. */
|
||||
struct sigevent aio_sigevent; /* Signal number and value. */
|
||||
|
||||
/* Internal members. */
|
||||
struct aiocb *__next_prio;
|
||||
int __abs_prio;
|
||||
int __policy;
|
||||
int __error_code;
|
||||
__ssize_t __return_value;
|
||||
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
__off_t aio_offset; /* File offset. */
|
||||
char __pad[sizeof (__off64_t) - sizeof (__off_t)];
|
||||
#else
|
||||
__off64_t aio_offset; /* File offset. */
|
||||
#endif
|
||||
char __glibc_reserved[32];
|
||||
};
|
||||
|
||||
/* The same for the 64bit offsets. Please note that the members aio_fildes
|
||||
to __return_value have to be the same in aiocb and aiocb64. */
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct aiocb64
|
||||
{
|
||||
int aio_fildes; /* File desriptor. */
|
||||
int aio_lio_opcode; /* Operation to be performed. */
|
||||
int aio_reqprio; /* Request priority offset. */
|
||||
volatile void *aio_buf; /* Location of buffer. */
|
||||
size_t aio_nbytes; /* Length of transfer. */
|
||||
struct sigevent aio_sigevent; /* Signal number and value. */
|
||||
|
||||
/* Internal members. */
|
||||
struct aiocb *__next_prio;
|
||||
int __abs_prio;
|
||||
int __policy;
|
||||
int __error_code;
|
||||
__ssize_t __return_value;
|
||||
|
||||
__off64_t aio_offset; /* File offset. */
|
||||
char __glibc_reserved[32];
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* To customize the implementation one can use the following struct.
|
||||
This implementation follows the one in Irix. */
|
||||
struct aioinit
|
||||
{
|
||||
int aio_threads; /* Maximal number of threads. */
|
||||
int aio_num; /* Number of expected simultanious requests. */
|
||||
int aio_locks; /* Not used. */
|
||||
int aio_usedba; /* Not used. */
|
||||
int aio_debug; /* Not used. */
|
||||
int aio_numusers; /* Not used. */
|
||||
int aio_idle_time; /* Number of seconds before idle thread
|
||||
terminates. */
|
||||
int aio_reserved;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
/* Return values of cancelation function. */
|
||||
enum
|
||||
{
|
||||
AIO_CANCELED,
|
||||
#define AIO_CANCELED AIO_CANCELED
|
||||
AIO_NOTCANCELED,
|
||||
#define AIO_NOTCANCELED AIO_NOTCANCELED
|
||||
AIO_ALLDONE
|
||||
#define AIO_ALLDONE AIO_ALLDONE
|
||||
};
|
||||
|
||||
|
||||
/* Operation codes for `aio_lio_opcode'. */
|
||||
enum
|
||||
{
|
||||
LIO_READ,
|
||||
#define LIO_READ LIO_READ
|
||||
LIO_WRITE,
|
||||
#define LIO_WRITE LIO_WRITE
|
||||
LIO_NOP
|
||||
#define LIO_NOP LIO_NOP
|
||||
};
|
||||
|
||||
|
||||
/* Synchronization options for `lio_listio' function. */
|
||||
enum
|
||||
{
|
||||
LIO_WAIT,
|
||||
#define LIO_WAIT LIO_WAIT
|
||||
LIO_NOWAIT
|
||||
#define LIO_NOWAIT LIO_NOWAIT
|
||||
};
|
||||
|
||||
|
||||
/* Allow user to specify optimization. */
|
||||
#ifdef __USE_GNU
|
||||
extern void aio_init (const struct aioinit *__init) __THROW __nonnull ((1));
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
/* Enqueue read request for given number of bytes and the given priority. */
|
||||
extern int aio_read (struct aiocb *__aiocbp) __THROW __nonnull ((1));
|
||||
/* Enqueue write request for given number of bytes and the given priority. */
|
||||
extern int aio_write (struct aiocb *__aiocbp) __THROW __nonnull ((1));
|
||||
|
||||
/* Initiate list of I/O requests. */
|
||||
extern int lio_listio (int __mode,
|
||||
struct aiocb *const __list[__restrict_arr],
|
||||
int __nent, struct sigevent *__restrict __sig)
|
||||
__THROW __nonnull ((2));
|
||||
|
||||
/* Retrieve error status associated with AIOCBP. */
|
||||
extern int aio_error (const struct aiocb *__aiocbp) __THROW __nonnull ((1));
|
||||
/* Return status associated with AIOCBP. */
|
||||
extern __ssize_t aio_return (struct aiocb *__aiocbp) __THROW __nonnull ((1));
|
||||
|
||||
/* Try to cancel asynchronous I/O requests outstanding against file
|
||||
descriptor FILDES. */
|
||||
extern int aio_cancel (int __fildes, struct aiocb *__aiocbp) __THROW;
|
||||
|
||||
/* Suspend calling thread until at least one of the asynchronous I/O
|
||||
operations referenced by LIST has completed.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int aio_suspend (const struct aiocb *const __list[], int __nent,
|
||||
const struct timespec *__restrict __timeout)
|
||||
__nonnull ((1));
|
||||
|
||||
/* Force all operations associated with file desriptor described by
|
||||
`aio_fildes' member of AIOCBP. */
|
||||
extern int aio_fsync (int __operation, struct aiocb *__aiocbp)
|
||||
__THROW __nonnull ((2));
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (aio_read, (struct aiocb *__aiocbp), aio_read64)
|
||||
__nonnull ((1));
|
||||
extern int __REDIRECT_NTH (aio_write, (struct aiocb *__aiocbp), aio_write64)
|
||||
__nonnull ((1));
|
||||
|
||||
extern int __REDIRECT_NTH (lio_listio,
|
||||
(int __mode,
|
||||
struct aiocb *const __list[__restrict_arr],
|
||||
int __nent, struct sigevent *__restrict __sig),
|
||||
lio_listio64) __nonnull ((2));
|
||||
|
||||
extern int __REDIRECT_NTH (aio_error, (const struct aiocb *__aiocbp),
|
||||
aio_error64) __nonnull ((1));
|
||||
extern __ssize_t __REDIRECT_NTH (aio_return, (struct aiocb *__aiocbp),
|
||||
aio_return64) __nonnull ((1));
|
||||
|
||||
extern int __REDIRECT_NTH (aio_cancel,
|
||||
(int __fildes, struct aiocb *__aiocbp),
|
||||
aio_cancel64);
|
||||
|
||||
extern int __REDIRECT_NTH (aio_suspend,
|
||||
(const struct aiocb *const __list[], int __nent,
|
||||
const struct timespec *__restrict __timeout),
|
||||
aio_suspend64) __nonnull ((1));
|
||||
|
||||
extern int __REDIRECT_NTH (aio_fsync,
|
||||
(int __operation, struct aiocb *__aiocbp),
|
||||
aio_fsync64) __nonnull ((2));
|
||||
|
||||
# else
|
||||
# define aio_read aio_read64
|
||||
# define aio_write aio_write64
|
||||
# define lio_listio lio_listio64
|
||||
# define aio_error aio_error64
|
||||
# define aio_return aio_return64
|
||||
# define aio_cancel aio_cancel64
|
||||
# define aio_suspend aio_suspend64
|
||||
# define aio_fsync aio_fsync64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int aio_read64 (struct aiocb64 *__aiocbp) __THROW __nonnull ((1));
|
||||
extern int aio_write64 (struct aiocb64 *__aiocbp) __THROW __nonnull ((1));
|
||||
|
||||
extern int lio_listio64 (int __mode,
|
||||
struct aiocb64 *const __list[__restrict_arr],
|
||||
int __nent, struct sigevent *__restrict __sig)
|
||||
__THROW __nonnull ((2));
|
||||
|
||||
extern int aio_error64 (const struct aiocb64 *__aiocbp)
|
||||
__THROW __nonnull ((1));
|
||||
extern __ssize_t aio_return64 (struct aiocb64 *__aiocbp)
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
extern int aio_cancel64 (int __fildes, struct aiocb64 *__aiocbp) __THROW;
|
||||
|
||||
extern int aio_suspend64 (const struct aiocb64 *const __list[], int __nent,
|
||||
const struct timespec *__restrict __timeout)
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
extern int aio_fsync64 (int __operation, struct aiocb64 *__aiocbp)
|
||||
__THROW __nonnull ((2));
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* aio.h */
|
63
libc/glibc-include/aliases.h
Normal file
63
libc/glibc-include/aliases.h
Normal file
@ -0,0 +1,63 @@
|
||||
/* Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _ALIASES_H
|
||||
#define _ALIASES_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Structure to represent one entry of the alias data base. */
|
||||
struct aliasent
|
||||
{
|
||||
char *alias_name;
|
||||
size_t alias_members_len;
|
||||
char **alias_members;
|
||||
int alias_local;
|
||||
};
|
||||
|
||||
|
||||
/* Open alias data base files. */
|
||||
extern void setaliasent (void) __THROW;
|
||||
|
||||
/* Close alias data base files. */
|
||||
extern void endaliasent (void) __THROW;
|
||||
|
||||
/* Get the next entry from the alias data base. */
|
||||
extern struct aliasent *getaliasent (void) __THROW;
|
||||
|
||||
/* Get the next entry from the alias data base and put it in RESULT_BUF. */
|
||||
extern int getaliasent_r (struct aliasent *__restrict __result_buf,
|
||||
char *__restrict __buffer, size_t __buflen,
|
||||
struct aliasent **__restrict __result) __THROW;
|
||||
|
||||
/* Get alias entry corresponding to NAME. */
|
||||
extern struct aliasent *getaliasbyname (const char *__name) __THROW;
|
||||
|
||||
/* Get alias entry corresponding to NAME and put it in RESULT_BUF. */
|
||||
extern int getaliasbyname_r (const char *__restrict __name,
|
||||
struct aliasent *__restrict __result_buf,
|
||||
char *__restrict __buffer, size_t __buflen,
|
||||
struct aliasent **__restrict __result) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* aliases.h */
|
40
libc/glibc-include/alloca.h
Normal file
40
libc/glibc-include/alloca.h
Normal file
@ -0,0 +1,40 @@
|
||||
/* Copyright (C) 1992-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _ALLOCA_H
|
||||
#define _ALLOCA_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Remove any previous definitions. */
|
||||
#undef alloca
|
||||
|
||||
/* Allocate a block that will be freed when the calling function exits. */
|
||||
extern void *alloca (size_t __size) __THROW;
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define alloca(size) __builtin_alloca (size)
|
||||
#endif /* GCC. */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* alloca.h */
|
47
libc/glibc-include/ar.h
Normal file
47
libc/glibc-include/ar.h
Normal file
@ -0,0 +1,47 @@
|
||||
/* Header describing `ar' archive file format.
|
||||
Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _AR_H
|
||||
#define _AR_H 1
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/* Archive files start with the ARMAG identifying string. Then follows a
|
||||
`struct ar_hdr', and as many bytes of member file data as its `ar_size'
|
||||
member indicates, for each member file. */
|
||||
|
||||
#define ARMAG "!<arch>\n" /* String that begins an archive file. */
|
||||
#define SARMAG 8 /* Size of that string. */
|
||||
|
||||
#define ARFMAG "`\n" /* String in ar_fmag at end of each header. */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
struct ar_hdr
|
||||
{
|
||||
char ar_name[16]; /* Member file name, sometimes / terminated. */
|
||||
char ar_date[12]; /* File date, decimal seconds since Epoch. */
|
||||
char ar_uid[6], ar_gid[6]; /* User and group IDs, in ASCII decimal. */
|
||||
char ar_mode[8]; /* File mode, in ASCII octal. */
|
||||
char ar_size[10]; /* File size, in ASCII decimal. */
|
||||
char ar_fmag[2]; /* Always contains ARFMAG. */
|
||||
};
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* ar.h */
|
559
libc/glibc-include/argp.h
Normal file
559
libc/glibc-include/argp.h
Normal file
@ -0,0 +1,559 @@
|
||||
/* Hierarchial argument parsing, layered over getopt.
|
||||
Copyright (C) 1995-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _ARGP_H
|
||||
#define _ARGP_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <getopt.h>
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* error_t may or may not be available from errno.h, depending on the
|
||||
operating system. */
|
||||
#ifndef __error_t_defined
|
||||
# define __error_t_defined 1
|
||||
typedef int error_t;
|
||||
#endif
|
||||
|
||||
/* A description of a particular option. A pointer to an array of
|
||||
these is passed in the OPTIONS field of an argp structure. Each option
|
||||
entry can correspond to one long option and/or one short option; more
|
||||
names for the same option can be added by following an entry in an option
|
||||
array with options having the OPTION_ALIAS flag set. */
|
||||
struct argp_option
|
||||
{
|
||||
/* The long option name. For more than one name for the same option, you
|
||||
can use following options with the OPTION_ALIAS flag set. */
|
||||
const char *name;
|
||||
|
||||
/* What key is returned for this option. If > 0 and printable, then it's
|
||||
also accepted as a short option. */
|
||||
int key;
|
||||
|
||||
/* If non-NULL, this is the name of the argument associated with this
|
||||
option, which is required unless the OPTION_ARG_OPTIONAL flag is set. */
|
||||
const char *arg;
|
||||
|
||||
/* OPTION_ flags. */
|
||||
int flags;
|
||||
|
||||
/* The doc string for this option. If both NAME and KEY are 0, This string
|
||||
will be printed outdented from the normal option column, making it
|
||||
useful as a group header (it will be the first thing printed in its
|
||||
group); in this usage, it's conventional to end the string with a `:'. */
|
||||
const char *doc;
|
||||
|
||||
/* The group this option is in. In a long help message, options are sorted
|
||||
alphabetically within each group, and the groups presented in the order
|
||||
0, 1, 2, ..., n, -m, ..., -2, -1. Every entry in an options array with
|
||||
if this field 0 will inherit the group number of the previous entry, or
|
||||
zero if it's the first one, unless its a group header (NAME and KEY both
|
||||
0), in which case, the previous entry + 1 is the default. Automagic
|
||||
options such as --help are put into group -1. */
|
||||
int group;
|
||||
};
|
||||
|
||||
/* The argument associated with this option is optional. */
|
||||
#define OPTION_ARG_OPTIONAL 0x1
|
||||
|
||||
/* This option isn't displayed in any help messages. */
|
||||
#define OPTION_HIDDEN 0x2
|
||||
|
||||
/* This option is an alias for the closest previous non-alias option. This
|
||||
means that it will be displayed in the same help entry, and will inherit
|
||||
fields other than NAME and KEY from the aliased option. */
|
||||
#define OPTION_ALIAS 0x4
|
||||
|
||||
/* This option isn't actually an option (and so should be ignored by the
|
||||
actual option parser), but rather an arbitrary piece of documentation that
|
||||
should be displayed in much the same manner as the options. If this flag
|
||||
is set, then the option NAME field is displayed unmodified (e.g., no `--'
|
||||
prefix is added) at the left-margin (where a *short* option would normally
|
||||
be displayed), and the documentation string in the normal place. For
|
||||
purposes of sorting, any leading whitespace and punctuation is ignored,
|
||||
except that if the first non-whitespace character is not `-', this entry
|
||||
is displayed after all options (and OPTION_DOC entries with a leading `-')
|
||||
in the same group. */
|
||||
#define OPTION_DOC 0x8
|
||||
|
||||
/* This option shouldn't be included in `long' usage messages (but is still
|
||||
included in help messages). This is mainly intended for options that are
|
||||
completely documented in an argp's ARGS_DOC field, in which case including
|
||||
the option in the generic usage list would be redundant. For instance,
|
||||
if ARGS_DOC is "FOO BAR\n-x BLAH", and the `-x' option's purpose is to
|
||||
distinguish these two cases, -x should probably be marked
|
||||
OPTION_NO_USAGE. */
|
||||
#define OPTION_NO_USAGE 0x10
|
||||
|
||||
struct argp; /* fwd declare this type */
|
||||
struct argp_state; /* " */
|
||||
struct argp_child; /* " */
|
||||
|
||||
/* The type of a pointer to an argp parsing function. */
|
||||
typedef error_t (*argp_parser_t) (int __key, char *__arg,
|
||||
struct argp_state *__state);
|
||||
|
||||
/* What to return for unrecognized keys. For special ARGP_KEY_ keys, such
|
||||
returns will simply be ignored. For user keys, this error will be turned
|
||||
into EINVAL (if the call to argp_parse is such that errors are propagated
|
||||
back to the user instead of exiting); returning EINVAL itself would result
|
||||
in an immediate stop to parsing in *all* cases. */
|
||||
#define ARGP_ERR_UNKNOWN E2BIG /* Hurd should never need E2BIG. XXX */
|
||||
|
||||
/* Special values for the KEY argument to an argument parsing function.
|
||||
ARGP_ERR_UNKNOWN should be returned if they aren't understood.
|
||||
|
||||
The sequence of keys to a parsing function is either (where each
|
||||
uppercased word should be prefixed by `ARGP_KEY_' and opt is a user key):
|
||||
|
||||
INIT opt... NO_ARGS END SUCCESS -- No non-option arguments at all
|
||||
or INIT (opt | ARG)... END SUCCESS -- All non-option args parsed
|
||||
or INIT (opt | ARG)... SUCCESS -- Some non-option arg unrecognized
|
||||
|
||||
The third case is where every parser returned ARGP_KEY_UNKNOWN for an
|
||||
argument, in which case parsing stops at that argument (returning the
|
||||
unparsed arguments to the caller of argp_parse if requested, or stopping
|
||||
with an error message if not).
|
||||
|
||||
If an error occurs (either detected by argp, or because the parsing
|
||||
function returned an error value), then the parser is called with
|
||||
ARGP_KEY_ERROR, and no further calls are made. */
|
||||
|
||||
/* This is not an option at all, but rather a command line argument. If a
|
||||
parser receiving this key returns success, the fact is recorded, and the
|
||||
ARGP_KEY_NO_ARGS case won't be used. HOWEVER, if while processing the
|
||||
argument, a parser function decrements the NEXT field of the state it's
|
||||
passed, the option won't be considered processed; this is to allow you to
|
||||
actually modify the argument (perhaps into an option), and have it
|
||||
processed again. */
|
||||
#define ARGP_KEY_ARG 0
|
||||
/* There are remaining arguments not parsed by any parser, which may be found
|
||||
starting at (STATE->argv + STATE->next). If success is returned, but
|
||||
STATE->next left untouched, it's assumed that all arguments were consume,
|
||||
otherwise, the parser should adjust STATE->next to reflect any arguments
|
||||
consumed. */
|
||||
#define ARGP_KEY_ARGS 0x1000006
|
||||
/* There are no more command line arguments at all. */
|
||||
#define ARGP_KEY_END 0x1000001
|
||||
/* Because it's common to want to do some special processing if there aren't
|
||||
any non-option args, user parsers are called with this key if they didn't
|
||||
successfully process any non-option arguments. Called just before
|
||||
ARGP_KEY_END (where more general validity checks on previously parsed
|
||||
arguments can take place). */
|
||||
#define ARGP_KEY_NO_ARGS 0x1000002
|
||||
/* Passed in before any parsing is done. Afterwards, the values of each
|
||||
element of the CHILD_INPUT field, if any, in the state structure is
|
||||
copied to each child's state to be the initial value of the INPUT field. */
|
||||
#define ARGP_KEY_INIT 0x1000003
|
||||
/* Use after all other keys, including SUCCESS & END. */
|
||||
#define ARGP_KEY_FINI 0x1000007
|
||||
/* Passed in when parsing has successfully been completed (even if there are
|
||||
still arguments remaining). */
|
||||
#define ARGP_KEY_SUCCESS 0x1000004
|
||||
/* Passed in if an error occurs. */
|
||||
#define ARGP_KEY_ERROR 0x1000005
|
||||
|
||||
/* An argp structure contains a set of options declarations, a function to
|
||||
deal with parsing one, documentation string, a possible vector of child
|
||||
argp's, and perhaps a function to filter help output. When actually
|
||||
parsing options, getopt is called with the union of all the argp
|
||||
structures chained together through their CHILD pointers, with conflicts
|
||||
being resolved in favor of the first occurrence in the chain. */
|
||||
struct argp
|
||||
{
|
||||
/* An array of argp_option structures, terminated by an entry with both
|
||||
NAME and KEY having a value of 0. */
|
||||
const struct argp_option *options;
|
||||
|
||||
/* What to do with an option from this structure. KEY is the key
|
||||
associated with the option, and ARG is any associated argument (NULL if
|
||||
none was supplied). If KEY isn't understood, ARGP_ERR_UNKNOWN should be
|
||||
returned. If a non-zero, non-ARGP_ERR_UNKNOWN value is returned, then
|
||||
parsing is stopped immediately, and that value is returned from
|
||||
argp_parse(). For special (non-user-supplied) values of KEY, see the
|
||||
ARGP_KEY_ definitions below. */
|
||||
argp_parser_t parser;
|
||||
|
||||
/* A string describing what other arguments are wanted by this program. It
|
||||
is only used by argp_usage to print the `Usage:' message. If it
|
||||
contains newlines, the strings separated by them are considered
|
||||
alternative usage patterns, and printed on separate lines (lines after
|
||||
the first are prefix by ` or: ' instead of `Usage:'). */
|
||||
const char *args_doc;
|
||||
|
||||
/* If non-NULL, a string containing extra text to be printed before and
|
||||
after the options in a long help message (separated by a vertical tab
|
||||
`\v' character). */
|
||||
const char *doc;
|
||||
|
||||
/* A vector of argp_children structures, terminated by a member with a 0
|
||||
argp field, pointing to child argps should be parsed with this one. Any
|
||||
conflicts are resolved in favor of this argp, or early argps in the
|
||||
CHILDREN list. This field is useful if you use libraries that supply
|
||||
their own argp structure, which you want to use in conjunction with your
|
||||
own. */
|
||||
const struct argp_child *children;
|
||||
|
||||
/* If non-zero, this should be a function to filter the output of help
|
||||
messages. KEY is either a key from an option, in which case TEXT is
|
||||
that option's help text, or a special key from the ARGP_KEY_HELP_
|
||||
defines, below, describing which other help text TEXT is. The function
|
||||
should return either TEXT, if it should be used as-is, a replacement
|
||||
string, which should be malloced, and will be freed by argp, or NULL,
|
||||
meaning `print nothing'. The value for TEXT is *after* any translation
|
||||
has been done, so if any of the replacement text also needs translation,
|
||||
that should be done by the filter function. INPUT is either the input
|
||||
supplied to argp_parse, or NULL, if argp_help was called directly. */
|
||||
char *(*help_filter) (int __key, const char *__text, void *__input);
|
||||
|
||||
/* If non-zero the strings used in the argp library are translated using
|
||||
the domain described by this string. Otherwise the currently installed
|
||||
default domain is used. */
|
||||
const char *argp_domain;
|
||||
};
|
||||
|
||||
/* Possible KEY arguments to a help filter function. */
|
||||
#define ARGP_KEY_HELP_PRE_DOC 0x2000001 /* Help text preceeding options. */
|
||||
#define ARGP_KEY_HELP_POST_DOC 0x2000002 /* Help text following options. */
|
||||
#define ARGP_KEY_HELP_HEADER 0x2000003 /* Option header string. */
|
||||
#define ARGP_KEY_HELP_EXTRA 0x2000004 /* After all other documentation;
|
||||
TEXT is NULL for this key. */
|
||||
/* Explanatory note emitted when duplicate option arguments have been
|
||||
suppressed. */
|
||||
#define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005
|
||||
#define ARGP_KEY_HELP_ARGS_DOC 0x2000006 /* Argument doc string. */
|
||||
|
||||
/* When an argp has a non-zero CHILDREN field, it should point to a vector of
|
||||
argp_child structures, each of which describes a subsidiary argp. */
|
||||
struct argp_child
|
||||
{
|
||||
/* The child parser. */
|
||||
const struct argp *argp;
|
||||
|
||||
/* Flags for this child. */
|
||||
int flags;
|
||||
|
||||
/* If non-zero, an optional header to be printed in help output before the
|
||||
child options. As a side-effect, a non-zero value forces the child
|
||||
options to be grouped together; to achieve this effect without actually
|
||||
printing a header string, use a value of "". */
|
||||
const char *header;
|
||||
|
||||
/* Where to group the child options relative to the other (`consolidated')
|
||||
options in the parent argp; the values are the same as the GROUP field
|
||||
in argp_option structs, but all child-groupings follow parent options at
|
||||
a particular group level. If both this field and HEADER are zero, then
|
||||
they aren't grouped at all, but rather merged with the parent options
|
||||
(merging the child's grouping levels with the parents). */
|
||||
int group;
|
||||
};
|
||||
|
||||
/* Parsing state. This is provided to parsing functions called by argp,
|
||||
which may examine and, as noted, modify fields. */
|
||||
struct argp_state
|
||||
{
|
||||
/* The top level ARGP being parsed. */
|
||||
const struct argp *root_argp;
|
||||
|
||||
/* The argument vector being parsed. May be modified. */
|
||||
int argc;
|
||||
char **argv;
|
||||
|
||||
/* The index in ARGV of the next arg that to be parsed. May be modified. */
|
||||
int next;
|
||||
|
||||
/* The flags supplied to argp_parse. May be modified. */
|
||||
unsigned flags;
|
||||
|
||||
/* While calling a parsing function with a key of ARGP_KEY_ARG, this is the
|
||||
number of the current arg, starting at zero, and incremented after each
|
||||
such call returns. At all other times, this is the number of such
|
||||
arguments that have been processed. */
|
||||
unsigned arg_num;
|
||||
|
||||
/* If non-zero, the index in ARGV of the first argument following a special
|
||||
`--' argument (which prevents anything following being interpreted as an
|
||||
option). Only set once argument parsing has proceeded past this point. */
|
||||
int quoted;
|
||||
|
||||
/* An arbitrary pointer passed in from the user. */
|
||||
void *input;
|
||||
/* Values to pass to child parsers. This vector will be the same length as
|
||||
the number of children for the current parser. */
|
||||
void **child_inputs;
|
||||
|
||||
/* For the parser's use. Initialized to 0. */
|
||||
void *hook;
|
||||
|
||||
/* The name used when printing messages. This is initialized to ARGV[0],
|
||||
or PROGRAM_INVOCATION_NAME if that is unavailable. */
|
||||
char *name;
|
||||
|
||||
/* Streams used when argp prints something. */
|
||||
FILE *err_stream; /* For errors; initialized to stderr. */
|
||||
FILE *out_stream; /* For information; initialized to stdout. */
|
||||
|
||||
void *pstate; /* Private, for use by argp. */
|
||||
};
|
||||
|
||||
/* Flags for argp_parse (note that the defaults are those that are
|
||||
convenient for program command line parsing): */
|
||||
|
||||
/* Don't ignore the first element of ARGV. Normally (and always unless
|
||||
ARGP_NO_ERRS is set) the first element of the argument vector is
|
||||
skipped for option parsing purposes, as it corresponds to the program name
|
||||
in a command line. */
|
||||
#define ARGP_PARSE_ARGV0 0x01
|
||||
|
||||
/* Don't print error messages for unknown options to stderr; unless this flag
|
||||
is set, ARGP_PARSE_ARGV0 is ignored, as ARGV[0] is used as the program
|
||||
name in the error messages. This flag implies ARGP_NO_EXIT (on the
|
||||
assumption that silent exiting upon errors is bad behaviour). */
|
||||
#define ARGP_NO_ERRS 0x02
|
||||
|
||||
/* Don't parse any non-option args. Normally non-option args are parsed by
|
||||
calling the parse functions with a key of ARGP_KEY_ARG, and the actual arg
|
||||
as the value. Since it's impossible to know which parse function wants to
|
||||
handle it, each one is called in turn, until one returns 0 or an error
|
||||
other than ARGP_ERR_UNKNOWN; if an argument is handled by no one, the
|
||||
argp_parse returns prematurely (but with a return value of 0). If all
|
||||
args have been parsed without error, all parsing functions are called one
|
||||
last time with a key of ARGP_KEY_END. This flag needn't normally be set,
|
||||
as the normal behavior is to stop parsing as soon as some argument can't
|
||||
be handled. */
|
||||
#define ARGP_NO_ARGS 0x04
|
||||
|
||||
/* Parse options and arguments in the same order they occur on the command
|
||||
line -- normally they're rearranged so that all options come first. */
|
||||
#define ARGP_IN_ORDER 0x08
|
||||
|
||||
/* Don't provide the standard long option --help, which causes usage and
|
||||
option help information to be output to stdout, and exit (0) called. */
|
||||
#define ARGP_NO_HELP 0x10
|
||||
|
||||
/* Don't exit on errors (they may still result in error messages). */
|
||||
#define ARGP_NO_EXIT 0x20
|
||||
|
||||
/* Use the gnu getopt `long-only' rules for parsing arguments. */
|
||||
#define ARGP_LONG_ONLY 0x40
|
||||
|
||||
/* Turns off any message-printing/exiting options. */
|
||||
#define ARGP_SILENT (ARGP_NO_EXIT | ARGP_NO_ERRS | ARGP_NO_HELP)
|
||||
|
||||
/* Parse the options strings in ARGC & ARGV according to the options in ARGP.
|
||||
FLAGS is one of the ARGP_ flags above. If ARG_INDEX is non-NULL, the
|
||||
index in ARGV of the first unparsed option is returned in it. If an
|
||||
unknown option is present, ARGP_ERR_UNKNOWN is returned; if some parser
|
||||
routine returned a non-zero value, it is returned; otherwise 0 is
|
||||
returned. This function may also call exit unless the ARGP_NO_HELP flag
|
||||
is set. INPUT is a pointer to a value to be passed in to the parser. */
|
||||
extern error_t argp_parse (const struct argp *__restrict __argp,
|
||||
int __argc, char **__restrict __argv,
|
||||
unsigned __flags, int *__restrict __arg_index,
|
||||
void *__restrict __input);
|
||||
extern error_t __argp_parse (const struct argp *__restrict __argp,
|
||||
int __argc, char **__restrict __argv,
|
||||
unsigned __flags, int *__restrict __arg_index,
|
||||
void *__restrict __input);
|
||||
|
||||
/* Global variables. */
|
||||
|
||||
/* If defined or set by the user program to a non-zero value, then a default
|
||||
option --version is added (unless the ARGP_NO_HELP flag is used), which
|
||||
will print this string followed by a newline and exit (unless the
|
||||
ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
|
||||
extern const char *argp_program_version;
|
||||
|
||||
/* If defined or set by the user program to a non-zero value, then a default
|
||||
option --version is added (unless the ARGP_NO_HELP flag is used), which
|
||||
calls this function with a stream to print the version to and a pointer to
|
||||
the current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
|
||||
used). This variable takes precedent over ARGP_PROGRAM_VERSION. */
|
||||
extern void (*argp_program_version_hook) (FILE *__restrict __stream,
|
||||
struct argp_state *__restrict
|
||||
__state);
|
||||
|
||||
/* If defined or set by the user program, it should point to string that is
|
||||
the bug-reporting address for the program. It will be printed by
|
||||
argp_help if the ARGP_HELP_BUG_ADDR flag is set (as it is by various
|
||||
standard help messages), embedded in a sentence that says something like
|
||||
`Report bugs to ADDR.'. */
|
||||
extern const char *argp_program_bug_address;
|
||||
|
||||
/* The exit status that argp will use when exiting due to a parsing error.
|
||||
If not defined or set by the user program, this defaults to EX_USAGE from
|
||||
<sysexits.h>. */
|
||||
extern error_t argp_err_exit_status;
|
||||
|
||||
/* Flags for argp_help. */
|
||||
#define ARGP_HELP_USAGE 0x01 /* a Usage: message. */
|
||||
#define ARGP_HELP_SHORT_USAGE 0x02 /* " but don't actually print options. */
|
||||
#define ARGP_HELP_SEE 0x04 /* a `Try ... for more help' message. */
|
||||
#define ARGP_HELP_LONG 0x08 /* a long help message. */
|
||||
#define ARGP_HELP_PRE_DOC 0x10 /* doc string preceding long help. */
|
||||
#define ARGP_HELP_POST_DOC 0x20 /* doc string following long help. */
|
||||
#define ARGP_HELP_DOC (ARGP_HELP_PRE_DOC | ARGP_HELP_POST_DOC)
|
||||
#define ARGP_HELP_BUG_ADDR 0x40 /* bug report address */
|
||||
#define ARGP_HELP_LONG_ONLY 0x80 /* modify output appropriately to
|
||||
reflect ARGP_LONG_ONLY mode. */
|
||||
|
||||
/* These ARGP_HELP flags are only understood by argp_state_help. */
|
||||
#define ARGP_HELP_EXIT_ERR 0x100 /* Call exit(1) instead of returning. */
|
||||
#define ARGP_HELP_EXIT_OK 0x200 /* Call exit(0) instead of returning. */
|
||||
|
||||
/* The standard thing to do after a program command line parsing error, if an
|
||||
error message has already been printed. */
|
||||
#define ARGP_HELP_STD_ERR \
|
||||
(ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
|
||||
/* The standard thing to do after a program command line parsing error, if no
|
||||
more specific error message has been printed. */
|
||||
#define ARGP_HELP_STD_USAGE \
|
||||
(ARGP_HELP_SHORT_USAGE | ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
|
||||
/* The standard thing to do in response to a --help option. */
|
||||
#define ARGP_HELP_STD_HELP \
|
||||
(ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG | ARGP_HELP_EXIT_OK \
|
||||
| ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR)
|
||||
|
||||
/* Output a usage message for ARGP to STREAM. FLAGS are from the set
|
||||
ARGP_HELP_*. */
|
||||
extern void argp_help (const struct argp *__restrict __argp,
|
||||
FILE *__restrict __stream,
|
||||
unsigned __flags, char *__restrict __name);
|
||||
extern void __argp_help (const struct argp *__restrict __argp,
|
||||
FILE *__restrict __stream, unsigned __flags,
|
||||
char *__name);
|
||||
|
||||
/* The following routines are intended to be called from within an argp
|
||||
parsing routine (thus taking an argp_state structure as the first
|
||||
argument). They may or may not print an error message and exit, depending
|
||||
on the flags in STATE -- in any case, the caller should be prepared for
|
||||
them *not* to exit, and should return an appropiate error after calling
|
||||
them. [argp_usage & argp_error should probably be called argp_state_...,
|
||||
but they're used often enough that they should be short] */
|
||||
|
||||
/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are
|
||||
from the set ARGP_HELP_*. */
|
||||
extern void argp_state_help (const struct argp_state *__restrict __state,
|
||||
FILE *__restrict __stream,
|
||||
unsigned int __flags);
|
||||
extern void __argp_state_help (const struct argp_state *__restrict __state,
|
||||
FILE *__restrict __stream,
|
||||
unsigned int __flags);
|
||||
|
||||
/* Possibly output the standard usage message for ARGP to stderr and exit. */
|
||||
extern void argp_usage (const struct argp_state *__state);
|
||||
extern void __argp_usage (const struct argp_state *__state);
|
||||
|
||||
/* If appropriate, print the printf string FMT and following args, preceded
|
||||
by the program name and `:', to stderr, and followed by a `Try ... --help'
|
||||
message, then exit (1). */
|
||||
extern void argp_error (const struct argp_state *__restrict __state,
|
||||
const char *__restrict __fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
extern void __argp_error (const struct argp_state *__restrict __state,
|
||||
const char *__restrict __fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
|
||||
/* Similar to the standard gnu error-reporting function error(), but will
|
||||
respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print
|
||||
to STATE->err_stream. This is useful for argument parsing code that is
|
||||
shared between program startup (when exiting is desired) and runtime
|
||||
option parsing (when typically an error code is returned instead). The
|
||||
difference between this function and argp_error is that the latter is for
|
||||
*parsing errors*, and the former is for other problems that occur during
|
||||
parsing but don't reflect a (syntactic) problem with the input. */
|
||||
extern void argp_failure (const struct argp_state *__restrict __state,
|
||||
int __status, int __errnum,
|
||||
const char *__restrict __fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 4, 5)));
|
||||
extern void __argp_failure (const struct argp_state *__restrict __state,
|
||||
int __status, int __errnum,
|
||||
const char *__restrict __fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 4, 5)));
|
||||
|
||||
/* Returns true if the option OPT is a valid short option. */
|
||||
extern int _option_is_short (const struct argp_option *__opt) __THROW;
|
||||
extern int __option_is_short (const struct argp_option *__opt) __THROW;
|
||||
|
||||
/* Returns true if the option OPT is in fact the last (unused) entry in an
|
||||
options array. */
|
||||
extern int _option_is_end (const struct argp_option *__opt) __THROW;
|
||||
extern int __option_is_end (const struct argp_option *__opt) __THROW;
|
||||
|
||||
/* Return the input field for ARGP in the parser corresponding to STATE; used
|
||||
by the help routines. */
|
||||
extern void *_argp_input (const struct argp *__restrict __argp,
|
||||
const struct argp_state *__restrict __state)
|
||||
__THROW;
|
||||
extern void *__argp_input (const struct argp *__restrict __argp,
|
||||
const struct argp_state *__restrict __state)
|
||||
__THROW;
|
||||
|
||||
#ifdef __USE_EXTERN_INLINES
|
||||
|
||||
# if !(defined _LIBC && _LIBC)
|
||||
# define __argp_usage argp_usage
|
||||
# define __argp_state_help argp_state_help
|
||||
# define __option_is_short _option_is_short
|
||||
# define __option_is_end _option_is_end
|
||||
# endif
|
||||
|
||||
# ifndef ARGP_EI
|
||||
# define ARGP_EI __extern_inline
|
||||
# endif
|
||||
|
||||
ARGP_EI void
|
||||
__argp_usage (const struct argp_state *__state)
|
||||
{
|
||||
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
|
||||
}
|
||||
|
||||
ARGP_EI int
|
||||
__NTH (__option_is_short (const struct argp_option *__opt))
|
||||
{
|
||||
if (__opt->flags & OPTION_DOC)
|
||||
return 0;
|
||||
else
|
||||
{
|
||||
int __key = __opt->key;
|
||||
return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
|
||||
}
|
||||
}
|
||||
|
||||
ARGP_EI int
|
||||
__NTH (__option_is_end (const struct argp_option *__opt))
|
||||
{
|
||||
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
|
||||
}
|
||||
|
||||
# if !(defined _LIBC && _LIBC)
|
||||
# undef __argp_usage
|
||||
# undef __argp_state_help
|
||||
# undef __option_is_short
|
||||
# undef __option_is_end
|
||||
# endif
|
||||
#endif /* Use extern inlines. */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* argp.h */
|
156
libc/glibc-include/argz.h
Normal file
156
libc/glibc-include/argz.h
Normal file
@ -0,0 +1,156 @@
|
||||
/* Routines for dealing with '\0' separated arg vectors.
|
||||
Copyright (C) 1995-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _ARGZ_H
|
||||
#define _ARGZ_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <errno.h>
|
||||
#include <string.h> /* Need size_t, and strchr is called below. */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* error_t may or may not be available from errno.h, depending on the
|
||||
operating system. */
|
||||
#ifndef __error_t_defined
|
||||
# define __error_t_defined 1
|
||||
typedef int error_t;
|
||||
#endif
|
||||
|
||||
/* Make a '\0' separated arg vector from a unix argv vector, returning it in
|
||||
ARGZ, and the total length in LEN. If a memory allocation error occurs,
|
||||
ENOMEM is returned, otherwise 0. The result can be destroyed using free. */
|
||||
extern error_t __argz_create (char *const __argv[], char **__restrict __argz,
|
||||
size_t *__restrict __len) __THROW;
|
||||
extern error_t argz_create (char *const __argv[], char **__restrict __argz,
|
||||
size_t *__restrict __len) __THROW;
|
||||
|
||||
/* Make a '\0' separated arg vector from a SEP separated list in
|
||||
STRING, returning it in ARGZ, and the total length in LEN. If a
|
||||
memory allocation error occurs, ENOMEM is returned, otherwise 0.
|
||||
The result can be destroyed using free. */
|
||||
extern error_t argz_create_sep (const char *__restrict __string,
|
||||
int __sep, char **__restrict __argz,
|
||||
size_t *__restrict __len) __THROW;
|
||||
|
||||
/* Returns the number of strings in ARGZ. */
|
||||
extern size_t __argz_count (const char *__argz, size_t __len)
|
||||
__THROW __attribute_pure__;
|
||||
extern size_t argz_count (const char *__argz, size_t __len)
|
||||
__THROW __attribute_pure__;
|
||||
|
||||
/* Puts pointers to each string in ARGZ into ARGV, which must be large enough
|
||||
to hold them all. */
|
||||
extern void __argz_extract (const char *__restrict __argz, size_t __len,
|
||||
char **__restrict __argv) __THROW;
|
||||
extern void argz_extract (const char *__restrict __argz, size_t __len,
|
||||
char **__restrict __argv) __THROW;
|
||||
|
||||
/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
|
||||
except the last into the character SEP. */
|
||||
extern void __argz_stringify (char *__argz, size_t __len, int __sep) __THROW;
|
||||
extern void argz_stringify (char *__argz, size_t __len, int __sep) __THROW;
|
||||
|
||||
/* Append BUF, of length BUF_LEN to the argz vector in ARGZ & ARGZ_LEN. */
|
||||
extern error_t argz_append (char **__restrict __argz,
|
||||
size_t *__restrict __argz_len,
|
||||
const char *__restrict __buf, size_t __buf_len)
|
||||
__THROW;
|
||||
|
||||
/* Append STR to the argz vector in ARGZ & ARGZ_LEN. */
|
||||
extern error_t argz_add (char **__restrict __argz,
|
||||
size_t *__restrict __argz_len,
|
||||
const char *__restrict __str) __THROW;
|
||||
|
||||
/* Append SEP separated list in STRING to the argz vector in ARGZ &
|
||||
ARGZ_LEN. */
|
||||
extern error_t argz_add_sep (char **__restrict __argz,
|
||||
size_t *__restrict __argz_len,
|
||||
const char *__restrict __string, int __delim)
|
||||
__THROW;
|
||||
|
||||
/* Delete ENTRY from ARGZ & ARGZ_LEN, if it appears there. */
|
||||
extern void argz_delete (char **__restrict __argz,
|
||||
size_t *__restrict __argz_len,
|
||||
char *__restrict __entry) __THROW;
|
||||
|
||||
/* Insert ENTRY into ARGZ & ARGZ_LEN before BEFORE, which should be an
|
||||
existing entry in ARGZ; if BEFORE is NULL, ENTRY is appended to the end.
|
||||
Since ARGZ's first entry is the same as ARGZ, argz_insert (ARGZ, ARGZ_LEN,
|
||||
ARGZ, ENTRY) will insert ENTRY at the beginning of ARGZ. If BEFORE is not
|
||||
in ARGZ, EINVAL is returned, else if memory can't be allocated for the new
|
||||
ARGZ, ENOMEM is returned, else 0. */
|
||||
extern error_t argz_insert (char **__restrict __argz,
|
||||
size_t *__restrict __argz_len,
|
||||
char *__restrict __before,
|
||||
const char *__restrict __entry) __THROW;
|
||||
|
||||
/* Replace any occurrences of the string STR in ARGZ with WITH, reallocating
|
||||
ARGZ as necessary. If REPLACE_COUNT is non-zero, *REPLACE_COUNT will be
|
||||
incremented by number of replacements performed. */
|
||||
extern error_t argz_replace (char **__restrict __argz,
|
||||
size_t *__restrict __argz_len,
|
||||
const char *__restrict __str,
|
||||
const char *__restrict __with,
|
||||
unsigned int *__restrict __replace_count);
|
||||
|
||||
/* Returns the next entry in ARGZ & ARGZ_LEN after ENTRY, or NULL if there
|
||||
are no more. If entry is NULL, then the first entry is returned. This
|
||||
behavior allows two convenient iteration styles:
|
||||
|
||||
char *entry = 0;
|
||||
while ((entry = argz_next (argz, argz_len, entry)))
|
||||
...;
|
||||
|
||||
or
|
||||
|
||||
char *entry;
|
||||
for (entry = argz; entry; entry = argz_next (argz, argz_len, entry))
|
||||
...;
|
||||
*/
|
||||
extern char *__argz_next (const char *__restrict __argz, size_t __argz_len,
|
||||
const char *__restrict __entry) __THROW;
|
||||
extern char *argz_next (const char *__restrict __argz, size_t __argz_len,
|
||||
const char *__restrict __entry) __THROW;
|
||||
|
||||
#ifdef __USE_EXTERN_INLINES
|
||||
__extern_inline char *
|
||||
__NTH (__argz_next (const char *__argz, size_t __argz_len,
|
||||
const char *__entry))
|
||||
{
|
||||
if (__entry)
|
||||
{
|
||||
if (__entry < __argz + __argz_len)
|
||||
__entry = strchr (__entry, '\0') + 1;
|
||||
|
||||
return __entry >= __argz + __argz_len ? (char *) NULL : (char *) __entry;
|
||||
}
|
||||
else
|
||||
return __argz_len > 0 ? (char *) __argz : 0;
|
||||
}
|
||||
__extern_inline char *
|
||||
__NTH (argz_next (const char *__argz, size_t __argz_len,
|
||||
const char *__entry))
|
||||
{
|
||||
return __argz_next (__argz, __argz_len, __entry);
|
||||
}
|
||||
#endif /* Use extern inlines. */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* argz.h */
|
105
libc/glibc-include/arpa/ftp.h
Normal file
105
libc/glibc-include/arpa/ftp.h
Normal file
@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright (c) 1983, 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ftp.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _ARPA_FTP_H
|
||||
#define _ARPA_FTP_H 1
|
||||
|
||||
/* Definitions for FTP; see RFC-765. */
|
||||
|
||||
/*
|
||||
* Reply codes.
|
||||
*/
|
||||
#define PRELIM 1 /* positive preliminary */
|
||||
#define COMPLETE 2 /* positive completion */
|
||||
#define CONTINUE 3 /* positive intermediate */
|
||||
#define TRANSIENT 4 /* transient negative completion */
|
||||
#define ERROR 5 /* permanent negative completion */
|
||||
|
||||
/*
|
||||
* Type codes
|
||||
*/
|
||||
#define TYPE_A 1 /* ASCII */
|
||||
#define TYPE_E 2 /* EBCDIC */
|
||||
#define TYPE_I 3 /* image */
|
||||
#define TYPE_L 4 /* local byte size */
|
||||
|
||||
#ifdef FTP_NAMES
|
||||
char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" };
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Form codes
|
||||
*/
|
||||
#define FORM_N 1 /* non-print */
|
||||
#define FORM_T 2 /* telnet format effectors */
|
||||
#define FORM_C 3 /* carriage control (ASA) */
|
||||
#ifdef FTP_NAMES
|
||||
char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" };
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Structure codes
|
||||
*/
|
||||
#define STRU_F 1 /* file (no record structure) */
|
||||
#define STRU_R 2 /* record structure */
|
||||
#define STRU_P 3 /* page structure */
|
||||
#ifdef FTP_NAMES
|
||||
char *strunames[] = {"0", "File", "Record", "Page" };
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Mode types
|
||||
*/
|
||||
#define MODE_S 1 /* stream */
|
||||
#define MODE_B 2 /* block */
|
||||
#define MODE_C 3 /* compressed */
|
||||
#ifdef FTP_NAMES
|
||||
char *modenames[] = {"0", "Stream", "Block", "Compressed" };
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Record Tokens
|
||||
*/
|
||||
#define REC_ESC '\377' /* Record-mode Escape */
|
||||
#define REC_EOR '\001' /* Record-mode End-of-Record */
|
||||
#define REC_EOF '\002' /* Record-mode End-of-File */
|
||||
|
||||
/*
|
||||
* Block Header
|
||||
*/
|
||||
#define BLK_EOR 0x80 /* Block is End-of-Record */
|
||||
#define BLK_EOF 0x40 /* Block is End-of-File */
|
||||
#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */
|
||||
#define BLK_RESTART 0x10 /* Block is Restart Marker */
|
||||
|
||||
#define BLK_BYTECOUNT 2 /* Bytes in this block */
|
||||
|
||||
#endif /* arpa/ftp.h */
|
105
libc/glibc-include/arpa/inet.h
Normal file
105
libc/glibc-include/arpa/inet.h
Normal file
@ -0,0 +1,105 @@
|
||||
/* Copyright (C) 1997-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _ARPA_INET_H
|
||||
#define _ARPA_INET_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <netinet/in.h> /* To define `struct in_addr'. */
|
||||
|
||||
/* Type for length arguments in socket calls. */
|
||||
#ifndef __socklen_t_defined
|
||||
typedef __socklen_t socklen_t;
|
||||
# define __socklen_t_defined
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Convert Internet host address from numbers-and-dots notation in CP
|
||||
into binary data in network byte order. */
|
||||
extern in_addr_t inet_addr (const char *__cp) __THROW;
|
||||
|
||||
/* Return the local host address part of the Internet address in IN. */
|
||||
extern in_addr_t inet_lnaof (struct in_addr __in) __THROW;
|
||||
|
||||
/* Make Internet host address in network byte order by combining the
|
||||
network number NET with the local address HOST. */
|
||||
extern struct in_addr inet_makeaddr (in_addr_t __net, in_addr_t __host)
|
||||
__THROW;
|
||||
|
||||
/* Return network number part of the Internet address IN. */
|
||||
extern in_addr_t inet_netof (struct in_addr __in) __THROW;
|
||||
|
||||
/* Extract the network number in network byte order from the address
|
||||
in numbers-and-dots natation starting at CP. */
|
||||
extern in_addr_t inet_network (const char *__cp) __THROW;
|
||||
|
||||
/* Convert Internet number in IN to ASCII representation. The return value
|
||||
is a pointer to an internal array containing the string. */
|
||||
extern char *inet_ntoa (struct in_addr __in) __THROW;
|
||||
|
||||
/* Convert from presentation format of an Internet number in buffer
|
||||
starting at CP to the binary network format and store result for
|
||||
interface type AF in buffer starting at BUF. */
|
||||
extern int inet_pton (int __af, const char *__restrict __cp,
|
||||
void *__restrict __buf) __THROW;
|
||||
|
||||
/* Convert a Internet address in binary network format for interface
|
||||
type AF in buffer starting at CP to presentation form and place
|
||||
result in buffer of length LEN astarting at BUF. */
|
||||
extern const char *inet_ntop (int __af, const void *__restrict __cp,
|
||||
char *__restrict __buf, socklen_t __len)
|
||||
__THROW;
|
||||
|
||||
|
||||
/* The following functions are not part of XNS 5.2. */
|
||||
#ifdef __USE_MISC
|
||||
/* Convert Internet host address from numbers-and-dots notation in CP
|
||||
into binary data and store the result in the structure INP. */
|
||||
extern int inet_aton (const char *__cp, struct in_addr *__inp) __THROW;
|
||||
|
||||
/* Format a network number NET into presentation format and place result
|
||||
in buffer starting at BUF with length of LEN bytes. */
|
||||
extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __THROW;
|
||||
|
||||
/* Convert network number for interface type AF in buffer starting at
|
||||
CP to presentation format. The result will specifiy BITS bits of
|
||||
the number. */
|
||||
extern char *inet_net_ntop (int __af, const void *__cp, int __bits,
|
||||
char *__buf, size_t __len) __THROW;
|
||||
|
||||
/* Convert network number for interface type AF from presentation in
|
||||
buffer starting at CP to network format and store result int
|
||||
buffer starting at BUF of size LEN. */
|
||||
extern int inet_net_pton (int __af, const char *__cp,
|
||||
void *__buf, size_t __len) __THROW;
|
||||
|
||||
/* Convert ASCII representation in hexadecimal form of the Internet
|
||||
address to binary form and place result in buffer of length LEN
|
||||
starting at BUF. */
|
||||
extern unsigned int inet_nsap_addr (const char *__cp,
|
||||
unsigned char *__buf, int __len) __THROW;
|
||||
|
||||
/* Convert internet address in binary form in LEN bytes starting at CP
|
||||
a presentation form and place result in BUF. */
|
||||
extern char *inet_nsap_ntoa (int __len, const unsigned char *__cp,
|
||||
char *__buf) __THROW;
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* arpa/inet.h */
|
443
libc/glibc-include/arpa/nameser.h
Normal file
443
libc/glibc-include/arpa/nameser.h
Normal file
@ -0,0 +1,443 @@
|
||||
/*
|
||||
* Copyright (c) 1983, 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 1996-1999 by Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
||||
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef _ARPA_NAMESER_H_
|
||||
#define _ARPA_NAMESER_H_
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/*
|
||||
* Define constants based on RFC 883, RFC 1034, RFC 1035
|
||||
*/
|
||||
#define NS_PACKETSZ 512 /*%< default UDP packet size */
|
||||
#define NS_MAXDNAME 1025 /*%< maximum domain name */
|
||||
#define NS_MAXMSG 65535 /*%< maximum message size */
|
||||
#define NS_MAXCDNAME 255 /*%< maximum compressed domain name */
|
||||
#define NS_MAXLABEL 63 /*%< maximum length of domain label */
|
||||
#define NS_HFIXEDSZ 12 /*%< #/bytes of fixed data in header */
|
||||
#define NS_QFIXEDSZ 4 /*%< #/bytes of fixed data in query */
|
||||
#define NS_RRFIXEDSZ 10 /*%< #/bytes of fixed data in r record */
|
||||
#define NS_INT32SZ 4 /*%< #/bytes of data in a uint32_t */
|
||||
#define NS_INT16SZ 2 /*%< #/bytes of data in a uint16_t */
|
||||
#define NS_INT8SZ 1 /*%< #/bytes of data in a uint8_t */
|
||||
#define NS_INADDRSZ 4 /*%< IPv4 T_A */
|
||||
#define NS_IN6ADDRSZ 16 /*%< IPv6 T_AAAA */
|
||||
#define NS_CMPRSFLGS 0xc0 /*%< Flag bits indicating name compression. */
|
||||
#define NS_DEFAULTPORT 53 /*%< For both TCP and UDP. */
|
||||
/*
|
||||
* These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord()
|
||||
* in synch with it.
|
||||
*/
|
||||
typedef enum __ns_sect {
|
||||
ns_s_qd = 0, /*%< Query: Question. */
|
||||
ns_s_zn = 0, /*%< Update: Zone. */
|
||||
ns_s_an = 1, /*%< Query: Answer. */
|
||||
ns_s_pr = 1, /*%< Update: Prerequisites. */
|
||||
ns_s_ns = 2, /*%< Query: Name servers. */
|
||||
ns_s_ud = 2, /*%< Update: Update. */
|
||||
ns_s_ar = 3, /*%< Query|Update: Additional records. */
|
||||
ns_s_max = 4
|
||||
} ns_sect;
|
||||
|
||||
/*%
|
||||
* This is a message handle. It is caller allocated and has no dynamic data.
|
||||
* This structure is intended to be opaque to all but ns_parse.c, thus the
|
||||
* leading _'s on the member names. Use the accessor functions, not the _'s.
|
||||
*/
|
||||
typedef struct __ns_msg {
|
||||
const unsigned char *_msg, *_eom;
|
||||
uint16_t _id, _flags, _counts[ns_s_max];
|
||||
const unsigned char *_sections[ns_s_max];
|
||||
ns_sect _sect;
|
||||
int _rrnum;
|
||||
const unsigned char *_msg_ptr;
|
||||
} ns_msg;
|
||||
|
||||
/* Private data structure - do not use from outside library. */
|
||||
struct _ns_flagdata { int mask, shift; };
|
||||
extern const struct _ns_flagdata _ns_flagdata[];
|
||||
|
||||
/* Accessor macros - this is part of the public interface. */
|
||||
|
||||
#define ns_msg_id(handle) ((handle)._id + 0)
|
||||
#define ns_msg_base(handle) ((handle)._msg + 0)
|
||||
#define ns_msg_end(handle) ((handle)._eom + 0)
|
||||
#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
|
||||
#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
|
||||
|
||||
/*%
|
||||
* This is a parsed record. It is caller allocated and has no dynamic data.
|
||||
*/
|
||||
typedef struct __ns_rr {
|
||||
char name[NS_MAXDNAME];
|
||||
uint16_t type;
|
||||
uint16_t rr_class;
|
||||
uint32_t ttl;
|
||||
uint16_t rdlength;
|
||||
const unsigned char * rdata;
|
||||
} ns_rr;
|
||||
|
||||
/* Accessor macros - this is part of the public interface. */
|
||||
#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
|
||||
#define ns_rr_type(rr) ((ns_type)((rr).type + 0))
|
||||
#define ns_rr_class(rr) ((ns_class)((rr).rr_class + 0))
|
||||
#define ns_rr_ttl(rr) ((rr).ttl + 0)
|
||||
#define ns_rr_rdlen(rr) ((rr).rdlength + 0)
|
||||
#define ns_rr_rdata(rr) ((rr).rdata + 0)
|
||||
|
||||
/*%
|
||||
* These don't have to be in the same order as in the packet flags word,
|
||||
* and they can even overlap in some cases, but they will need to be kept
|
||||
* in synch with ns_parse.c:ns_flagdata[].
|
||||
*/
|
||||
typedef enum __ns_flag {
|
||||
ns_f_qr, /*%< Question/Response. */
|
||||
ns_f_opcode, /*%< Operation code. */
|
||||
ns_f_aa, /*%< Authoritative Answer. */
|
||||
ns_f_tc, /*%< Truncation occurred. */
|
||||
ns_f_rd, /*%< Recursion Desired. */
|
||||
ns_f_ra, /*%< Recursion Available. */
|
||||
ns_f_z, /*%< MBZ. */
|
||||
ns_f_ad, /*%< Authentic Data (DNSSEC). */
|
||||
ns_f_cd, /*%< Checking Disabled (DNSSEC). */
|
||||
ns_f_rcode, /*%< Response code. */
|
||||
ns_f_max
|
||||
} ns_flag;
|
||||
|
||||
/*%
|
||||
* Currently defined opcodes.
|
||||
*/
|
||||
typedef enum __ns_opcode {
|
||||
ns_o_query = 0, /*%< Standard query. */
|
||||
ns_o_iquery = 1, /*%< Inverse query (deprecated/unsupported). */
|
||||
ns_o_status = 2, /*%< Name server status query (unsupported). */
|
||||
/* Opcode 3 is undefined/reserved. */
|
||||
ns_o_notify = 4, /*%< Zone change notification. */
|
||||
ns_o_update = 5, /*%< Zone update message. */
|
||||
ns_o_max = 6
|
||||
} ns_opcode;
|
||||
|
||||
/*%
|
||||
* Currently defined response codes.
|
||||
*/
|
||||
typedef enum __ns_rcode {
|
||||
ns_r_noerror = 0, /*%< No error occurred. */
|
||||
ns_r_formerr = 1, /*%< Format error. */
|
||||
ns_r_servfail = 2, /*%< Server failure. */
|
||||
ns_r_nxdomain = 3, /*%< Name error. */
|
||||
ns_r_notimpl = 4, /*%< Unimplemented. */
|
||||
ns_r_refused = 5, /*%< Operation refused. */
|
||||
/* these are for BIND_UPDATE */
|
||||
ns_r_yxdomain = 6, /*%< Name exists */
|
||||
ns_r_yxrrset = 7, /*%< RRset exists */
|
||||
ns_r_nxrrset = 8, /*%< RRset does not exist */
|
||||
ns_r_notauth = 9, /*%< Not authoritative for zone */
|
||||
ns_r_notzone = 10, /*%< Zone of record different from zone section */
|
||||
ns_r_max = 11,
|
||||
/* The following are EDNS extended rcodes */
|
||||
ns_r_badvers = 16,
|
||||
/* The following are TSIG errors */
|
||||
ns_r_badsig = 16,
|
||||
ns_r_badkey = 17,
|
||||
ns_r_badtime = 18
|
||||
} ns_rcode;
|
||||
|
||||
/* BIND_UPDATE */
|
||||
typedef enum __ns_update_operation {
|
||||
ns_uop_delete = 0,
|
||||
ns_uop_add = 1,
|
||||
ns_uop_max = 2
|
||||
} ns_update_operation;
|
||||
|
||||
/*%
|
||||
* This structure is used for TSIG authenticated messages
|
||||
*/
|
||||
struct ns_tsig_key {
|
||||
char name[NS_MAXDNAME], alg[NS_MAXDNAME];
|
||||
unsigned char *data;
|
||||
int len;
|
||||
};
|
||||
typedef struct ns_tsig_key ns_tsig_key;
|
||||
|
||||
/*%
|
||||
* This structure is used for TSIG authenticated TCP messages
|
||||
*/
|
||||
struct ns_tcp_tsig_state {
|
||||
int counter;
|
||||
struct dst_key *key;
|
||||
void *ctx;
|
||||
unsigned char sig[NS_PACKETSZ];
|
||||
int siglen;
|
||||
};
|
||||
typedef struct ns_tcp_tsig_state ns_tcp_tsig_state;
|
||||
|
||||
#define NS_TSIG_FUDGE 300
|
||||
#define NS_TSIG_TCP_COUNT 100
|
||||
#define NS_TSIG_ALG_HMAC_MD5 "HMAC-MD5.SIG-ALG.REG.INT"
|
||||
|
||||
#define NS_TSIG_ERROR_NO_TSIG -10
|
||||
#define NS_TSIG_ERROR_NO_SPACE -11
|
||||
#define NS_TSIG_ERROR_FORMERR -12
|
||||
|
||||
/*%
|
||||
* Currently defined type values for resources and queries.
|
||||
*/
|
||||
typedef enum __ns_type
|
||||
{
|
||||
ns_t_invalid = 0,
|
||||
|
||||
ns_t_a = 1,
|
||||
ns_t_ns = 2,
|
||||
ns_t_md = 3,
|
||||
ns_t_mf = 4,
|
||||
ns_t_cname = 5,
|
||||
ns_t_soa = 6,
|
||||
ns_t_mb = 7,
|
||||
ns_t_mg = 8,
|
||||
ns_t_mr = 9,
|
||||
ns_t_null = 10,
|
||||
ns_t_wks = 11,
|
||||
ns_t_ptr = 12,
|
||||
ns_t_hinfo = 13,
|
||||
ns_t_minfo = 14,
|
||||
ns_t_mx = 15,
|
||||
ns_t_txt = 16,
|
||||
ns_t_rp = 17,
|
||||
ns_t_afsdb = 18,
|
||||
ns_t_x25 = 19,
|
||||
ns_t_isdn = 20,
|
||||
ns_t_rt = 21,
|
||||
ns_t_nsap = 22,
|
||||
ns_t_nsap_ptr = 23,
|
||||
ns_t_sig = 24,
|
||||
ns_t_key = 25,
|
||||
ns_t_px = 26,
|
||||
ns_t_gpos = 27,
|
||||
ns_t_aaaa = 28,
|
||||
ns_t_loc = 29,
|
||||
ns_t_nxt = 30,
|
||||
ns_t_eid = 31,
|
||||
ns_t_nimloc = 32,
|
||||
ns_t_srv = 33,
|
||||
ns_t_atma = 34,
|
||||
ns_t_naptr = 35,
|
||||
ns_t_kx = 36,
|
||||
ns_t_cert = 37,
|
||||
ns_t_a6 = 38,
|
||||
ns_t_dname = 39,
|
||||
ns_t_sink = 40,
|
||||
ns_t_opt = 41,
|
||||
ns_t_apl = 42,
|
||||
ns_t_ds = 43,
|
||||
ns_t_sshfp = 44,
|
||||
ns_t_ipseckey = 45,
|
||||
ns_t_rrsig = 46,
|
||||
ns_t_nsec = 47,
|
||||
ns_t_dnskey = 48,
|
||||
ns_t_dhcid = 49,
|
||||
ns_t_nsec3 = 50,
|
||||
ns_t_nsec3param = 51,
|
||||
ns_t_tlsa = 52,
|
||||
ns_t_smimea = 53,
|
||||
ns_t_hip = 55,
|
||||
ns_t_ninfo = 56,
|
||||
ns_t_rkey = 57,
|
||||
ns_t_talink = 58,
|
||||
ns_t_cds = 59,
|
||||
ns_t_cdnskey = 60,
|
||||
ns_t_openpgpkey = 61,
|
||||
ns_t_csync = 62,
|
||||
ns_t_spf = 99,
|
||||
ns_t_uinfo = 100,
|
||||
ns_t_uid = 101,
|
||||
ns_t_gid = 102,
|
||||
ns_t_unspec = 103,
|
||||
ns_t_nid = 104,
|
||||
ns_t_l32 = 105,
|
||||
ns_t_l64 = 106,
|
||||
ns_t_lp = 107,
|
||||
ns_t_eui48 = 108,
|
||||
ns_t_eui64 = 109,
|
||||
ns_t_tkey = 249,
|
||||
ns_t_tsig = 250,
|
||||
ns_t_ixfr = 251,
|
||||
ns_t_axfr = 252,
|
||||
ns_t_mailb = 253,
|
||||
ns_t_maila = 254,
|
||||
ns_t_any = 255,
|
||||
ns_t_uri = 256,
|
||||
ns_t_caa = 257,
|
||||
ns_t_avc = 258,
|
||||
ns_t_ta = 32768,
|
||||
ns_t_dlv = 32769,
|
||||
|
||||
ns_t_max = 65536
|
||||
} ns_type;
|
||||
|
||||
/*%
|
||||
* Values for class field
|
||||
*/
|
||||
typedef enum __ns_class {
|
||||
ns_c_invalid = 0, /*%< Cookie. */
|
||||
ns_c_in = 1, /*%< Internet. */
|
||||
ns_c_2 = 2, /*%< unallocated/unsupported. */
|
||||
ns_c_chaos = 3, /*%< MIT Chaos-net. */
|
||||
ns_c_hs = 4, /*%< MIT Hesiod. */
|
||||
/* Query class values which do not appear in resource records */
|
||||
ns_c_none = 254, /*%< for prereq. sections in update requests */
|
||||
ns_c_any = 255, /*%< Wildcard match. */
|
||||
ns_c_max = 65536
|
||||
} ns_class;
|
||||
|
||||
/* Certificate type values in CERT resource records. */
|
||||
typedef enum __ns_cert_types {
|
||||
cert_t_pkix = 1, /*%< PKIX (X.509v3) */
|
||||
cert_t_spki = 2, /*%< SPKI */
|
||||
cert_t_pgp = 3, /*%< PGP */
|
||||
cert_t_url = 253, /*%< URL private type */
|
||||
cert_t_oid = 254 /*%< OID private type */
|
||||
} ns_cert_types;
|
||||
|
||||
/*%
|
||||
* EDNS0 extended flags and option codes, host order.
|
||||
*/
|
||||
#define NS_OPT_DNSSEC_OK 0x8000U
|
||||
#define NS_OPT_NSID 3
|
||||
|
||||
/*%
|
||||
* Inline versions of get/put short/long. Pointer is advanced.
|
||||
*/
|
||||
#define NS_GET16(s, cp) do { \
|
||||
const unsigned char *t_cp = (const unsigned char *)(cp); \
|
||||
(s) = ((uint16_t)t_cp[0] << 8) \
|
||||
| ((uint16_t)t_cp[1]) \
|
||||
; \
|
||||
(cp) += NS_INT16SZ; \
|
||||
} while (0)
|
||||
|
||||
#define NS_GET32(l, cp) do { \
|
||||
const unsigned char *t_cp = (const unsigned char *)(cp); \
|
||||
(l) = ((uint32_t)t_cp[0] << 24) \
|
||||
| ((uint32_t)t_cp[1] << 16) \
|
||||
| ((uint32_t)t_cp[2] << 8) \
|
||||
| ((uint32_t)t_cp[3]) \
|
||||
; \
|
||||
(cp) += NS_INT32SZ; \
|
||||
} while (0)
|
||||
|
||||
#define NS_PUT16(s, cp) do { \
|
||||
uint16_t t_s = (uint16_t)(s); \
|
||||
unsigned char *t_cp = (unsigned char *)(cp); \
|
||||
*t_cp++ = t_s >> 8; \
|
||||
*t_cp = t_s; \
|
||||
(cp) += NS_INT16SZ; \
|
||||
} while (0)
|
||||
|
||||
#define NS_PUT32(l, cp) do { \
|
||||
uint32_t t_l = (uint32_t)(l); \
|
||||
unsigned char *t_cp = (unsigned char *)(cp); \
|
||||
*t_cp++ = t_l >> 24; \
|
||||
*t_cp++ = t_l >> 16; \
|
||||
*t_cp++ = t_l >> 8; \
|
||||
*t_cp = t_l; \
|
||||
(cp) += NS_INT32SZ; \
|
||||
} while (0)
|
||||
|
||||
__BEGIN_DECLS
|
||||
int ns_msg_getflag (ns_msg, int) __THROW;
|
||||
unsigned int ns_get16 (const unsigned char *) __THROW;
|
||||
unsigned long ns_get32 (const unsigned char *) __THROW;
|
||||
void ns_put16 (unsigned int, unsigned char *) __THROW;
|
||||
void ns_put32 (unsigned long, unsigned char *) __THROW;
|
||||
int ns_initparse (const unsigned char *, int, ns_msg *) __THROW;
|
||||
int ns_skiprr (const unsigned char *, const unsigned char *,
|
||||
ns_sect, int) __THROW;
|
||||
int ns_parserr (ns_msg *, ns_sect, int, ns_rr *) __THROW;
|
||||
int ns_sprintrr (const ns_msg *, const ns_rr *,
|
||||
const char *, const char *, char *, size_t)
|
||||
__THROW;
|
||||
int ns_sprintrrf (const unsigned char *, size_t, const char *,
|
||||
ns_class, ns_type, unsigned long,
|
||||
const unsigned char *, size_t, const char *,
|
||||
const char *, char *, size_t) __THROW;
|
||||
int ns_format_ttl (unsigned long, char *, size_t) __THROW;
|
||||
int ns_parse_ttl (const char *, unsigned long *) __THROW;
|
||||
uint32_t ns_datetosecs (const char *, int *) __THROW;
|
||||
int ns_name_ntol (const unsigned char *, unsigned char *, size_t)
|
||||
__THROW;
|
||||
int ns_name_ntop (const unsigned char *, char *, size_t) __THROW;
|
||||
int ns_name_pton (const char *, unsigned char *, size_t) __THROW;
|
||||
int ns_name_unpack (const unsigned char *, const unsigned char *,
|
||||
const unsigned char *, unsigned char *, size_t)
|
||||
__THROW;
|
||||
int ns_name_pack (const unsigned char *, unsigned char *, int,
|
||||
const unsigned char **, const unsigned char **)
|
||||
__THROW;
|
||||
int ns_name_uncompress (const unsigned char *,
|
||||
const unsigned char *,
|
||||
const unsigned char *,
|
||||
char *, size_t) __THROW;
|
||||
int ns_name_compress (const char *, unsigned char *, size_t,
|
||||
const unsigned char **,
|
||||
const unsigned char **) __THROW;
|
||||
int ns_name_skip (const unsigned char **, const unsigned char *)
|
||||
__THROW;
|
||||
void ns_name_rollback (const unsigned char *,
|
||||
const unsigned char **,
|
||||
const unsigned char **) __THROW;
|
||||
int ns_samedomain (const char *, const char *) __THROW;
|
||||
int ns_subdomain (const char *, const char *) __THROW;
|
||||
int ns_makecanon (const char *, char *, size_t) __THROW;
|
||||
int ns_samename (const char *, const char *) __THROW;
|
||||
__END_DECLS
|
||||
|
||||
#include <arpa/nameser_compat.h>
|
||||
|
||||
#endif /* !_ARPA_NAMESER_H_ */
|
||||
/*! \file */
|
221
libc/glibc-include/arpa/nameser_compat.h
Normal file
221
libc/glibc-include/arpa/nameser_compat.h
Normal file
@ -0,0 +1,221 @@
|
||||
/* Copyright (c) 1983, 1989
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _ARPA_NAMESER_COMPAT_
|
||||
#define _ARPA_NAMESER_COMPAT_
|
||||
|
||||
#include <endian.h>
|
||||
|
||||
/*%
|
||||
* Structure for query header. The order of the fields is machine- and
|
||||
* compiler-dependent, depending on the byte/bit order and the layout
|
||||
* of bit fields. We use bit fields only in int variables, as this
|
||||
* is all ANSI requires. This requires a somewhat confusing rearrangement.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
unsigned id :16; /*%< query identification number */
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
/* fields in third byte */
|
||||
unsigned qr: 1; /*%< response flag */
|
||||
unsigned opcode: 4; /*%< purpose of message */
|
||||
unsigned aa: 1; /*%< authoritive answer */
|
||||
unsigned tc: 1; /*%< truncated message */
|
||||
unsigned rd: 1; /*%< recursion desired */
|
||||
/* fields in fourth byte */
|
||||
unsigned ra: 1; /*%< recursion available */
|
||||
unsigned unused :1; /*%< unused bits (MBZ as of 4.9.3a3) */
|
||||
unsigned ad: 1; /*%< authentic data from named */
|
||||
unsigned cd: 1; /*%< checking disabled by resolver */
|
||||
unsigned rcode :4; /*%< response code */
|
||||
#endif
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN || __BYTE_ORDER == __PDP_ENDIAN
|
||||
/* fields in third byte */
|
||||
unsigned rd :1; /*%< recursion desired */
|
||||
unsigned tc :1; /*%< truncated message */
|
||||
unsigned aa :1; /*%< authoritive answer */
|
||||
unsigned opcode :4; /*%< purpose of message */
|
||||
unsigned qr :1; /*%< response flag */
|
||||
/* fields in fourth byte */
|
||||
unsigned rcode :4; /*%< response code */
|
||||
unsigned cd: 1; /*%< checking disabled by resolver */
|
||||
unsigned ad: 1; /*%< authentic data from named */
|
||||
unsigned unused :1; /*%< unused bits (MBZ as of 4.9.3a3) */
|
||||
unsigned ra :1; /*%< recursion available */
|
||||
#endif
|
||||
/* remaining bytes */
|
||||
unsigned qdcount :16; /*%< number of question entries */
|
||||
unsigned ancount :16; /*%< number of answer entries */
|
||||
unsigned nscount :16; /*%< number of authority entries */
|
||||
unsigned arcount :16; /*%< number of resource entries */
|
||||
} HEADER;
|
||||
|
||||
#define PACKETSZ NS_PACKETSZ
|
||||
#define MAXDNAME NS_MAXDNAME
|
||||
#define MAXCDNAME NS_MAXCDNAME
|
||||
#define MAXLABEL NS_MAXLABEL
|
||||
#define HFIXEDSZ NS_HFIXEDSZ
|
||||
#define QFIXEDSZ NS_QFIXEDSZ
|
||||
#define RRFIXEDSZ NS_RRFIXEDSZ
|
||||
#define INT32SZ NS_INT32SZ
|
||||
#define INT16SZ NS_INT16SZ
|
||||
#define INT8SZ NS_INT8SZ
|
||||
#define INADDRSZ NS_INADDRSZ
|
||||
#define IN6ADDRSZ NS_IN6ADDRSZ
|
||||
#define INDIR_MASK NS_CMPRSFLGS
|
||||
#define NAMESERVER_PORT NS_DEFAULTPORT
|
||||
|
||||
#define S_ZONE ns_s_zn
|
||||
#define S_PREREQ ns_s_pr
|
||||
#define S_UPDATE ns_s_ud
|
||||
#define S_ADDT ns_s_ar
|
||||
|
||||
#define QUERY ns_o_query
|
||||
#define IQUERY ns_o_iquery
|
||||
#define STATUS ns_o_status
|
||||
#define NS_NOTIFY_OP ns_o_notify
|
||||
#define NS_UPDATE_OP ns_o_update
|
||||
|
||||
#define NOERROR ns_r_noerror
|
||||
#define FORMERR ns_r_formerr
|
||||
#define SERVFAIL ns_r_servfail
|
||||
#define NXDOMAIN ns_r_nxdomain
|
||||
#define NOTIMP ns_r_notimpl
|
||||
#define REFUSED ns_r_refused
|
||||
#define YXDOMAIN ns_r_yxdomain
|
||||
#define YXRRSET ns_r_yxrrset
|
||||
#define NXRRSET ns_r_nxrrset
|
||||
#define NOTAUTH ns_r_notauth
|
||||
#define NOTZONE ns_r_notzone
|
||||
/*#define BADSIG ns_r_badsig*/
|
||||
/*#define BADKEY ns_r_badkey*/
|
||||
/*#define BADTIME ns_r_badtime*/
|
||||
|
||||
|
||||
#define DELETE ns_uop_delete
|
||||
#define ADD ns_uop_add
|
||||
|
||||
#define T_A ns_t_a
|
||||
#define T_NS ns_t_ns
|
||||
#define T_MD ns_t_md
|
||||
#define T_MF ns_t_mf
|
||||
#define T_CNAME ns_t_cname
|
||||
#define T_SOA ns_t_soa
|
||||
#define T_MB ns_t_mb
|
||||
#define T_MG ns_t_mg
|
||||
#define T_MR ns_t_mr
|
||||
#define T_NULL ns_t_null
|
||||
#define T_WKS ns_t_wks
|
||||
#define T_PTR ns_t_ptr
|
||||
#define T_HINFO ns_t_hinfo
|
||||
#define T_MINFO ns_t_minfo
|
||||
#define T_MX ns_t_mx
|
||||
#define T_TXT ns_t_txt
|
||||
#define T_RP ns_t_rp
|
||||
#define T_AFSDB ns_t_afsdb
|
||||
#define T_X25 ns_t_x25
|
||||
#define T_ISDN ns_t_isdn
|
||||
#define T_RT ns_t_rt
|
||||
#define T_NSAP ns_t_nsap
|
||||
#define T_NSAP_PTR ns_t_nsap_ptr
|
||||
#define T_SIG ns_t_sig
|
||||
#define T_KEY ns_t_key
|
||||
#define T_PX ns_t_px
|
||||
#define T_GPOS ns_t_gpos
|
||||
#define T_AAAA ns_t_aaaa
|
||||
#define T_LOC ns_t_loc
|
||||
#define T_NXT ns_t_nxt
|
||||
#define T_EID ns_t_eid
|
||||
#define T_NIMLOC ns_t_nimloc
|
||||
#define T_SRV ns_t_srv
|
||||
#define T_ATMA ns_t_atma
|
||||
#define T_NAPTR ns_t_naptr
|
||||
#define T_KX ns_t_kx
|
||||
#define T_CERT ns_t_cert
|
||||
#define T_A6 ns_t_a6
|
||||
#define T_DNAME ns_t_dname
|
||||
#define T_SINK ns_t_sink
|
||||
#define T_OPT ns_t_opt
|
||||
#define T_APL ns_t_apl
|
||||
#define T_DS ns_t_ds
|
||||
#define T_SSHFP ns_t_sshfp
|
||||
#define T_IPSECKEY ns_t_ipseckey
|
||||
#define T_RRSIG ns_t_rrsig
|
||||
#define T_NSEC ns_t_nsec
|
||||
#define T_DNSKEY ns_t_dnskey
|
||||
#define T_DHCID ns_t_dhcid
|
||||
#define T_NSEC3 ns_t_nsec3
|
||||
#define T_NSEC3PARAM ns_t_nsec3param
|
||||
#define T_TLSA ns_t_tlsa
|
||||
#define T_SMIMEA ns_t_smimea
|
||||
#define T_HIP ns_t_hip
|
||||
#define T_NINFO ns_t_ninfo
|
||||
#define T_RKEY ns_t_rkey
|
||||
#define T_TALINK ns_t_talink
|
||||
#define T_CDS ns_t_cds
|
||||
#define T_CDNSKEY ns_t_cdnskey
|
||||
#define T_OPENPGPKEY ns_t_openpgpkey
|
||||
#define T_CSYNC ns_t_csync
|
||||
#define T_SPF ns_t_spf
|
||||
#define T_UINFO ns_t_uinfo
|
||||
#define T_UID ns_t_uid
|
||||
#define T_GID ns_t_gid
|
||||
#define T_UNSPEC ns_t_unspec
|
||||
#define T_NID ns_t_nid
|
||||
#define T_L32 ns_t_l32
|
||||
#define T_L64 ns_t_l64
|
||||
#define T_LP ns_t_lp
|
||||
#define T_EUI48 ns_t_eui48
|
||||
#define T_EUI64 ns_t_eui64
|
||||
#define T_TKEY ns_t_tkey
|
||||
#define T_TSIG ns_t_tsig
|
||||
#define T_IXFR ns_t_ixfr
|
||||
#define T_AXFR ns_t_axfr
|
||||
#define T_MAILB ns_t_mailb
|
||||
#define T_MAILA ns_t_maila
|
||||
#define T_ANY ns_t_any
|
||||
#define T_URI ns_t_uri
|
||||
#define T_CAA ns_t_caa
|
||||
#define T_AVC ns_t_avc
|
||||
#define T_TA ns_t_ta
|
||||
#define T_DLV ns_t_dlv
|
||||
|
||||
#define C_IN ns_c_in
|
||||
#define C_CHAOS ns_c_chaos
|
||||
#define C_HS ns_c_hs
|
||||
/* BIND_UPDATE */
|
||||
#define C_NONE ns_c_none
|
||||
#define C_ANY ns_c_any
|
||||
|
||||
#define GETSHORT NS_GET16
|
||||
#define GETLONG NS_GET32
|
||||
#define PUTSHORT NS_PUT16
|
||||
#define PUTLONG NS_PUT32
|
||||
|
||||
#endif /* _ARPA_NAMESER_COMPAT_ */
|
||||
/*! \file */
|
316
libc/glibc-include/arpa/telnet.h
Normal file
316
libc/glibc-include/arpa/telnet.h
Normal file
@ -0,0 +1,316 @@
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)telnet.h 8.2 (Berkeley) 12/15/93
|
||||
*/
|
||||
|
||||
#ifndef _ARPA_TELNET_H
|
||||
#define _ARPA_TELNET_H 1
|
||||
|
||||
/*
|
||||
* Definitions for the TELNET protocol.
|
||||
*/
|
||||
#define IAC 255 /* interpret as command: */
|
||||
#define DONT 254 /* you are not to use option */
|
||||
#define DO 253 /* please, you use option */
|
||||
#define WONT 252 /* I won't use option */
|
||||
#define WILL 251 /* I will use option */
|
||||
#define SB 250 /* interpret as subnegotiation */
|
||||
#define GA 249 /* you may reverse the line */
|
||||
#define EL 248 /* erase the current line */
|
||||
#define EC 247 /* erase the current character */
|
||||
#define AYT 246 /* are you there */
|
||||
#define AO 245 /* abort output--but let prog finish */
|
||||
#define IP 244 /* interrupt process--permanently */
|
||||
#define BREAK 243 /* break */
|
||||
#define DM 242 /* data mark--for connect. cleaning */
|
||||
#define NOP 241 /* nop */
|
||||
#define SE 240 /* end sub negotiation */
|
||||
#define EOR 239 /* end of record (transparent mode) */
|
||||
#define ABORT 238 /* Abort process */
|
||||
#define SUSP 237 /* Suspend process */
|
||||
#define xEOF 236 /* End of file: EOF is already used... */
|
||||
|
||||
#define SYNCH 242 /* for telfunc calls */
|
||||
|
||||
#ifdef TELCMDS
|
||||
char *telcmds[] = {
|
||||
"EOF", "SUSP", "ABORT", "EOR",
|
||||
"SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
|
||||
"EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0,
|
||||
};
|
||||
#else
|
||||
extern char *telcmds[];
|
||||
#endif
|
||||
|
||||
#define TELCMD_FIRST xEOF
|
||||
#define TELCMD_LAST IAC
|
||||
#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \
|
||||
(unsigned int)(x) >= TELCMD_FIRST)
|
||||
#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
|
||||
|
||||
/* telnet options */
|
||||
#define TELOPT_BINARY 0 /* 8-bit data path */
|
||||
#define TELOPT_ECHO 1 /* echo */
|
||||
#define TELOPT_RCP 2 /* prepare to reconnect */
|
||||
#define TELOPT_SGA 3 /* suppress go ahead */
|
||||
#define TELOPT_NAMS 4 /* approximate message size */
|
||||
#define TELOPT_STATUS 5 /* give status */
|
||||
#define TELOPT_TM 6 /* timing mark */
|
||||
#define TELOPT_RCTE 7 /* remote controlled transmission and echo */
|
||||
#define TELOPT_NAOL 8 /* negotiate about output line width */
|
||||
#define TELOPT_NAOP 9 /* negotiate about output page size */
|
||||
#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */
|
||||
#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
|
||||
#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */
|
||||
#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
|
||||
#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
|
||||
#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
|
||||
#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
|
||||
#define TELOPT_XASCII 17 /* extended ascii character set */
|
||||
#define TELOPT_LOGOUT 18 /* force logout */
|
||||
#define TELOPT_BM 19 /* byte macro */
|
||||
#define TELOPT_DET 20 /* data entry terminal */
|
||||
#define TELOPT_SUPDUP 21 /* supdup protocol */
|
||||
#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */
|
||||
#define TELOPT_SNDLOC 23 /* send location */
|
||||
#define TELOPT_TTYPE 24 /* terminal type */
|
||||
#define TELOPT_EOR 25 /* end or record */
|
||||
#define TELOPT_TUID 26 /* TACACS user identification */
|
||||
#define TELOPT_OUTMRK 27 /* output marking */
|
||||
#define TELOPT_TTYLOC 28 /* terminal location number */
|
||||
#define TELOPT_3270REGIME 29 /* 3270 regime */
|
||||
#define TELOPT_X3PAD 30 /* X.3 PAD */
|
||||
#define TELOPT_NAWS 31 /* window size */
|
||||
#define TELOPT_TSPEED 32 /* terminal speed */
|
||||
#define TELOPT_LFLOW 33 /* remote flow control */
|
||||
#define TELOPT_LINEMODE 34 /* Linemode option */
|
||||
#define TELOPT_XDISPLOC 35 /* X Display Location */
|
||||
#define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */
|
||||
#define TELOPT_AUTHENTICATION 37/* Authenticate */
|
||||
#define TELOPT_ENCRYPT 38 /* Encryption option */
|
||||
#define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */
|
||||
#define TELOPT_EXOPL 255 /* extended-options-list */
|
||||
|
||||
|
||||
#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
|
||||
#ifdef TELOPTS
|
||||
char *telopts[NTELOPTS+1] = {
|
||||
"BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
|
||||
"STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
|
||||
"NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
|
||||
"NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
|
||||
"DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
|
||||
"SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
|
||||
"TACACS UID", "OUTPUT MARKING", "TTYLOC",
|
||||
"3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
|
||||
"LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
|
||||
"ENCRYPT", "NEW-ENVIRON",
|
||||
0,
|
||||
};
|
||||
#define TELOPT_FIRST TELOPT_BINARY
|
||||
#define TELOPT_LAST TELOPT_NEW_ENVIRON
|
||||
#define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST)
|
||||
#define TELOPT(x) telopts[(x)-TELOPT_FIRST]
|
||||
#endif
|
||||
|
||||
/* sub-option qualifiers */
|
||||
#define TELQUAL_IS 0 /* option is... */
|
||||
#define TELQUAL_SEND 1 /* send option */
|
||||
#define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */
|
||||
#define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */
|
||||
#define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */
|
||||
|
||||
#define LFLOW_OFF 0 /* Disable remote flow control */
|
||||
#define LFLOW_ON 1 /* Enable remote flow control */
|
||||
#define LFLOW_RESTART_ANY 2 /* Restart output on any char */
|
||||
#define LFLOW_RESTART_XON 3 /* Restart output only on XON */
|
||||
|
||||
/*
|
||||
* LINEMODE suboptions
|
||||
*/
|
||||
|
||||
#define LM_MODE 1
|
||||
#define LM_FORWARDMASK 2
|
||||
#define LM_SLC 3
|
||||
|
||||
#define MODE_EDIT 0x01
|
||||
#define MODE_TRAPSIG 0x02
|
||||
#define MODE_ACK 0x04
|
||||
#define MODE_SOFT_TAB 0x08
|
||||
#define MODE_LIT_ECHO 0x10
|
||||
|
||||
#define MODE_MASK 0x1f
|
||||
|
||||
/* Not part of protocol, but needed to simplify things... */
|
||||
#define MODE_FLOW 0x0100
|
||||
#define MODE_ECHO 0x0200
|
||||
#define MODE_INBIN 0x0400
|
||||
#define MODE_OUTBIN 0x0800
|
||||
#define MODE_FORCE 0x1000
|
||||
|
||||
#define SLC_SYNCH 1
|
||||
#define SLC_BRK 2
|
||||
#define SLC_IP 3
|
||||
#define SLC_AO 4
|
||||
#define SLC_AYT 5
|
||||
#define SLC_EOR 6
|
||||
#define SLC_ABORT 7
|
||||
#define SLC_EOF 8
|
||||
#define SLC_SUSP 9
|
||||
#define SLC_EC 10
|
||||
#define SLC_EL 11
|
||||
#define SLC_EW 12
|
||||
#define SLC_RP 13
|
||||
#define SLC_LNEXT 14
|
||||
#define SLC_XON 15
|
||||
#define SLC_XOFF 16
|
||||
#define SLC_FORW1 17
|
||||
#define SLC_FORW2 18
|
||||
|
||||
#define NSLC 18
|
||||
|
||||
/*
|
||||
* For backwards compatibility, we define SLC_NAMES to be the
|
||||
* list of names if SLC_NAMES is not defined.
|
||||
*/
|
||||
#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
|
||||
"ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
|
||||
"LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0,
|
||||
#ifdef SLC_NAMES
|
||||
char *slc_names[] = {
|
||||
SLC_NAMELIST
|
||||
};
|
||||
#else
|
||||
extern char *slc_names[];
|
||||
#define SLC_NAMES SLC_NAMELIST
|
||||
#endif
|
||||
|
||||
#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
|
||||
#define SLC_NAME(x) slc_names[x]
|
||||
|
||||
#define SLC_NOSUPPORT 0
|
||||
#define SLC_CANTCHANGE 1
|
||||
#define SLC_VARIABLE 2
|
||||
#define SLC_DEFAULT 3
|
||||
#define SLC_LEVELBITS 0x03
|
||||
|
||||
#define SLC_FUNC 0
|
||||
#define SLC_FLAGS 1
|
||||
#define SLC_VALUE 2
|
||||
|
||||
#define SLC_ACK 0x80
|
||||
#define SLC_FLUSHIN 0x40
|
||||
#define SLC_FLUSHOUT 0x20
|
||||
|
||||
#define OLD_ENV_VAR 1
|
||||
#define OLD_ENV_VALUE 0
|
||||
#define NEW_ENV_VAR 0
|
||||
#define NEW_ENV_VALUE 1
|
||||
#define ENV_ESC 2
|
||||
#define ENV_USERVAR 3
|
||||
|
||||
/*
|
||||
* AUTHENTICATION suboptions
|
||||
*/
|
||||
|
||||
/*
|
||||
* Who is authenticating who ...
|
||||
*/
|
||||
#define AUTH_WHO_CLIENT 0 /* Client authenticating server */
|
||||
#define AUTH_WHO_SERVER 1 /* Server authenticating client */
|
||||
#define AUTH_WHO_MASK 1
|
||||
|
||||
/*
|
||||
* amount of authentication done
|
||||
*/
|
||||
#define AUTH_HOW_ONE_WAY 0
|
||||
#define AUTH_HOW_MUTUAL 2
|
||||
#define AUTH_HOW_MASK 2
|
||||
|
||||
#define AUTHTYPE_NULL 0
|
||||
#define AUTHTYPE_KERBEROS_V4 1
|
||||
#define AUTHTYPE_KERBEROS_V5 2
|
||||
#define AUTHTYPE_SPX 3
|
||||
#define AUTHTYPE_MINK 4
|
||||
#define AUTHTYPE_CNT 5
|
||||
|
||||
#define AUTHTYPE_TEST 99
|
||||
|
||||
#ifdef AUTH_NAMES
|
||||
char *authtype_names[] = {
|
||||
"NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", 0,
|
||||
};
|
||||
#else
|
||||
extern char *authtype_names[];
|
||||
#endif
|
||||
|
||||
#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
|
||||
#define AUTHTYPE_NAME(x) authtype_names[x]
|
||||
|
||||
/*
|
||||
* ENCRYPTion suboptions
|
||||
*/
|
||||
#define ENCRYPT_IS 0 /* I pick encryption type ... */
|
||||
#define ENCRYPT_SUPPORT 1 /* I support encryption types ... */
|
||||
#define ENCRYPT_REPLY 2 /* Initial setup response */
|
||||
#define ENCRYPT_START 3 /* Am starting to send encrypted */
|
||||
#define ENCRYPT_END 4 /* Am ending encrypted */
|
||||
#define ENCRYPT_REQSTART 5 /* Request you start encrypting */
|
||||
#define ENCRYPT_REQEND 6 /* Request you send encrypting */
|
||||
#define ENCRYPT_ENC_KEYID 7
|
||||
#define ENCRYPT_DEC_KEYID 8
|
||||
#define ENCRYPT_CNT 9
|
||||
|
||||
#define ENCTYPE_ANY 0
|
||||
#define ENCTYPE_DES_CFB64 1
|
||||
#define ENCTYPE_DES_OFB64 2
|
||||
#define ENCTYPE_CNT 3
|
||||
|
||||
#ifdef ENCRYPT_NAMES
|
||||
char *encrypt_names[] = {
|
||||
"IS", "SUPPORT", "REPLY", "START", "END",
|
||||
"REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
|
||||
0,
|
||||
};
|
||||
char *enctype_names[] = {
|
||||
"ANY", "DES_CFB64", "DES_OFB64", 0,
|
||||
};
|
||||
#else
|
||||
extern char *encrypt_names[];
|
||||
extern char *enctype_names[];
|
||||
#endif
|
||||
|
||||
|
||||
#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
|
||||
#define ENCRYPT_NAME(x) encrypt_names[x]
|
||||
|
||||
#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
|
||||
#define ENCTYPE_NAME(x) enctype_names[x]
|
||||
|
||||
#endif /* arpa/telnet.h */
|
82
libc/glibc-include/arpa/tftp.h
Normal file
82
libc/glibc-include/arpa/tftp.h
Normal file
@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tftp.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _ARPA_TFTP_H
|
||||
#define _ARPA_TFTP_H 1
|
||||
|
||||
/*
|
||||
* Trivial File Transfer Protocol (IEN-133)
|
||||
*/
|
||||
#define SEGSIZE 512 /* data segment size */
|
||||
|
||||
/*
|
||||
* Packet types.
|
||||
*/
|
||||
#define RRQ 01 /* read request */
|
||||
#define WRQ 02 /* write request */
|
||||
#define DATA 03 /* data packet */
|
||||
#define ACK 04 /* acknowledgement */
|
||||
#define ERROR 05 /* error code */
|
||||
|
||||
struct tftphdr {
|
||||
short th_opcode; /* packet type */
|
||||
union {
|
||||
char tu_padding[3]; /* sizeof() compat */
|
||||
struct {
|
||||
union {
|
||||
unsigned short tu_block; /* block # */
|
||||
short tu_code; /* error code */
|
||||
} __attribute__ ((__packed__)) th_u3;
|
||||
char tu_data[0]; /* data or error string */
|
||||
} __attribute__ ((__packed__)) th_u2;
|
||||
char tu_stuff[0]; /* request packet stuff */
|
||||
} __attribute__ ((__packed__)) th_u1;
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
#define th_block th_u1.th_u2.th_u3.tu_block
|
||||
#define th_code th_u1.th_u2.th_u3.tu_code
|
||||
#define th_stuff th_u1.tu_stuff
|
||||
#define th_data th_u1.th_u2.tu_data
|
||||
#define th_msg th_u1.th_u2.tu_data
|
||||
|
||||
/*
|
||||
* Error codes.
|
||||
*/
|
||||
#define EUNDEF 0 /* not defined */
|
||||
#define ENOTFOUND 1 /* file not found */
|
||||
#define EACCESS 2 /* access violation */
|
||||
#define ENOSPACE 3 /* disk full or allocation exceeded */
|
||||
#define EBADOP 4 /* illegal TFTP operation */
|
||||
#define EBADID 5 /* unknown transfer ID */
|
||||
#define EEXISTS 6 /* file already exists */
|
||||
#define ENOUSER 7 /* no such user */
|
||||
|
||||
#endif /* arpa/tftp.h */
|
141
libc/glibc-include/assert.h
Normal file
141
libc/glibc-include/assert.h
Normal file
@ -0,0 +1,141 @@
|
||||
/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* ISO C99 Standard: 7.2 Diagnostics <assert.h>
|
||||
*/
|
||||
|
||||
#ifdef _ASSERT_H
|
||||
|
||||
# undef _ASSERT_H
|
||||
# undef assert
|
||||
# undef __ASSERT_VOID_CAST
|
||||
|
||||
# ifdef __USE_GNU
|
||||
# undef assert_perror
|
||||
# endif
|
||||
|
||||
#endif /* assert.h */
|
||||
|
||||
#define _ASSERT_H 1
|
||||
#include <features.h>
|
||||
|
||||
#if defined __cplusplus && __GNUC_PREREQ (2,95)
|
||||
# define __ASSERT_VOID_CAST static_cast<void>
|
||||
#else
|
||||
# define __ASSERT_VOID_CAST (void)
|
||||
#endif
|
||||
|
||||
/* void assert (int expression);
|
||||
|
||||
If NDEBUG is defined, do nothing.
|
||||
If not, and EXPRESSION is zero, print an error message and abort. */
|
||||
|
||||
#ifdef NDEBUG
|
||||
|
||||
# define assert(expr) (__ASSERT_VOID_CAST (0))
|
||||
|
||||
/* void assert_perror (int errnum);
|
||||
|
||||
If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an
|
||||
error message with the error text for ERRNUM and abort.
|
||||
(This is a GNU extension.) */
|
||||
|
||||
# ifdef __USE_GNU
|
||||
# define assert_perror(errnum) (__ASSERT_VOID_CAST (0))
|
||||
# endif
|
||||
|
||||
#else /* Not NDEBUG. */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* This prints an "Assertion failed" message and aborts. */
|
||||
extern void __assert_fail (const char *__assertion, const char *__file,
|
||||
unsigned int __line, const char *__function)
|
||||
__THROW __attribute__ ((__noreturn__));
|
||||
|
||||
/* Likewise, but prints the error text for ERRNUM. */
|
||||
extern void __assert_perror_fail (int __errnum, const char *__file,
|
||||
unsigned int __line, const char *__function)
|
||||
__THROW __attribute__ ((__noreturn__));
|
||||
|
||||
|
||||
/* The following is not at all used here but needed for standard
|
||||
compliance. */
|
||||
extern void __assert (const char *__assertion, const char *__file, int __line)
|
||||
__THROW __attribute__ ((__noreturn__));
|
||||
|
||||
|
||||
__END_DECLS
|
||||
|
||||
/* When possible, define assert so that it does not add extra
|
||||
parentheses around EXPR. Otherwise, those added parentheses would
|
||||
suppress warnings we'd expect to be detected by gcc's -Wparentheses. */
|
||||
# if defined __cplusplus
|
||||
# define assert(expr) \
|
||||
(static_cast <bool> (expr) \
|
||||
? void (0) \
|
||||
: __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION))
|
||||
# elif !defined __GNUC__ || defined __STRICT_ANSI__
|
||||
# define assert(expr) \
|
||||
((expr) \
|
||||
? __ASSERT_VOID_CAST (0) \
|
||||
: __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION))
|
||||
# else
|
||||
/* The first occurrence of EXPR is not evaluated due to the sizeof,
|
||||
but will trigger any pedantic warnings masked by the __extension__
|
||||
for the second occurrence. The ternary operator is required to
|
||||
support function pointers and bit fields in this context, and to
|
||||
suppress the evaluation of variable length arrays. */
|
||||
# define assert(expr) \
|
||||
((void) sizeof ((expr) ? 1 : 0), __extension__ ({ \
|
||||
if (expr) \
|
||||
; /* empty */ \
|
||||
else \
|
||||
__assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION); \
|
||||
}))
|
||||
# endif
|
||||
|
||||
# ifdef __USE_GNU
|
||||
# define assert_perror(errnum) \
|
||||
(!(errnum) \
|
||||
? __ASSERT_VOID_CAST (0) \
|
||||
: __assert_perror_fail ((errnum), __FILE__, __LINE__, __ASSERT_FUNCTION))
|
||||
# endif
|
||||
|
||||
/* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
|
||||
which contains the name of the function currently being defined.
|
||||
This is broken in G++ before version 2.6.
|
||||
C9x has a similar variable called __func__, but prefer the GCC one since
|
||||
it demangles C++ function names. */
|
||||
# if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
|
||||
# define __ASSERT_FUNCTION __extension__ __PRETTY_FUNCTION__
|
||||
# else
|
||||
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
|
||||
# define __ASSERT_FUNCTION __func__
|
||||
# else
|
||||
# define __ASSERT_FUNCTION ((const char *) 0)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif /* NDEBUG. */
|
||||
|
||||
|
||||
#if defined __USE_ISOC11 && !defined __cplusplus
|
||||
# undef static_assert
|
||||
# define static_assert _Static_assert
|
||||
#endif
|
11
libc/glibc-include/bits/a.out.h
Normal file
11
libc/glibc-include/bits/a.out.h
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef __A_OUT_GNU_H__
|
||||
# error "Never use <bits/a.out.h> directly; include <a.out.h> instead."
|
||||
#endif
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
||||
/* Signal to users of this header that this architecture really doesn't
|
||||
support a.out binary format. */
|
||||
#define __NO_A_OUT_SUPPORT 1
|
||||
|
||||
#endif
|
79
libc/glibc-include/bits/byteswap.h
Normal file
79
libc/glibc-include/bits/byteswap.h
Normal file
@ -0,0 +1,79 @@
|
||||
/* Macros and inline functions to swap the order of bytes in integer values.
|
||||
Copyright (C) 1997-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H
|
||||
# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef _BITS_BYTESWAP_H
|
||||
#define _BITS_BYTESWAP_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <bits/types.h>
|
||||
|
||||
/* Swap bytes in 16-bit value. */
|
||||
#define __bswap_constant_16(x) \
|
||||
((__uint16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
|
||||
|
||||
static __inline __uint16_t
|
||||
__bswap_16 (__uint16_t __bsx)
|
||||
{
|
||||
#if __GNUC_PREREQ (4, 8)
|
||||
return __builtin_bswap16 (__bsx);
|
||||
#else
|
||||
return __bswap_constant_16 (__bsx);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Swap bytes in 32-bit value. */
|
||||
#define __bswap_constant_32(x) \
|
||||
((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) \
|
||||
| (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24))
|
||||
|
||||
static __inline __uint32_t
|
||||
__bswap_32 (__uint32_t __bsx)
|
||||
{
|
||||
#if __GNUC_PREREQ (4, 3)
|
||||
return __builtin_bswap32 (__bsx);
|
||||
#else
|
||||
return __bswap_constant_32 (__bsx);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Swap bytes in 64-bit value. */
|
||||
#define __bswap_constant_64(x) \
|
||||
((((x) & 0xff00000000000000ull) >> 56) \
|
||||
| (((x) & 0x00ff000000000000ull) >> 40) \
|
||||
| (((x) & 0x0000ff0000000000ull) >> 24) \
|
||||
| (((x) & 0x000000ff00000000ull) >> 8) \
|
||||
| (((x) & 0x00000000ff000000ull) << 8) \
|
||||
| (((x) & 0x0000000000ff0000ull) << 24) \
|
||||
| (((x) & 0x000000000000ff00ull) << 40) \
|
||||
| (((x) & 0x00000000000000ffull) << 56))
|
||||
|
||||
__extension__ static __inline __uint64_t
|
||||
__bswap_64 (__uint64_t __bsx)
|
||||
{
|
||||
#if __GNUC_PREREQ (4, 3)
|
||||
return __builtin_bswap64 (__bsx);
|
||||
#else
|
||||
return __bswap_constant_64 (__bsx);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* _BITS_BYTESWAP_H */
|
130
libc/glibc-include/bits/cmathcalls.h
Normal file
130
libc/glibc-include/bits/cmathcalls.h
Normal file
@ -0,0 +1,130 @@
|
||||
/* Prototype declarations for complex math functions;
|
||||
helper file for <complex.h>.
|
||||
Copyright (C) 1997-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* NOTE: Because of the special way this file is used by <complex.h>, this
|
||||
file must NOT be protected from multiple inclusion as header files
|
||||
usually are.
|
||||
|
||||
This file provides prototype declarations for the math functions.
|
||||
Most functions are declared using the macro:
|
||||
|
||||
__MATHCALL (NAME, (ARGS...));
|
||||
|
||||
This means there is a function `NAME' returning `double' and a function
|
||||
`NAMEf' returning `float'. Each place `_Mdouble_' appears in the
|
||||
prototype, that is actually `double' in the prototype for `NAME' and
|
||||
`float' in the prototype for `NAMEf'. Reentrant variant functions are
|
||||
called `NAME_r' and `NAMEf_r'.
|
||||
|
||||
Functions returning other types like `int' are declared using the macro:
|
||||
|
||||
__MATHDECL (TYPE, NAME, (ARGS...));
|
||||
|
||||
This is just like __MATHCALL but for a function returning `TYPE'
|
||||
instead of `_Mdouble_'. In all of these cases, there is still
|
||||
both a `NAME' and a `NAMEf' that takes `float' arguments. */
|
||||
|
||||
#ifndef _COMPLEX_H
|
||||
#error "Never use <bits/cmathcalls.h> directly; include <complex.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef _Mdouble_complex_
|
||||
# define _Mdouble_complex_ _Mdouble_ _Complex
|
||||
#endif
|
||||
|
||||
|
||||
/* Trigonometric functions. */
|
||||
|
||||
/* Arc cosine of Z. */
|
||||
__MATHCALL (cacos, (_Mdouble_complex_ __z));
|
||||
/* Arc sine of Z. */
|
||||
__MATHCALL (casin, (_Mdouble_complex_ __z));
|
||||
/* Arc tangent of Z. */
|
||||
__MATHCALL (catan, (_Mdouble_complex_ __z));
|
||||
|
||||
/* Cosine of Z. */
|
||||
__MATHCALL (ccos, (_Mdouble_complex_ __z));
|
||||
/* Sine of Z. */
|
||||
__MATHCALL (csin, (_Mdouble_complex_ __z));
|
||||
/* Tangent of Z. */
|
||||
__MATHCALL (ctan, (_Mdouble_complex_ __z));
|
||||
|
||||
|
||||
/* Hyperbolic functions. */
|
||||
|
||||
/* Hyperbolic arc cosine of Z. */
|
||||
__MATHCALL (cacosh, (_Mdouble_complex_ __z));
|
||||
/* Hyperbolic arc sine of Z. */
|
||||
__MATHCALL (casinh, (_Mdouble_complex_ __z));
|
||||
/* Hyperbolic arc tangent of Z. */
|
||||
__MATHCALL (catanh, (_Mdouble_complex_ __z));
|
||||
|
||||
/* Hyperbolic cosine of Z. */
|
||||
__MATHCALL (ccosh, (_Mdouble_complex_ __z));
|
||||
/* Hyperbolic sine of Z. */
|
||||
__MATHCALL (csinh, (_Mdouble_complex_ __z));
|
||||
/* Hyperbolic tangent of Z. */
|
||||
__MATHCALL (ctanh, (_Mdouble_complex_ __z));
|
||||
|
||||
|
||||
/* Exponential and logarithmic functions. */
|
||||
|
||||
/* Exponential function of Z. */
|
||||
__MATHCALL (cexp, (_Mdouble_complex_ __z));
|
||||
|
||||
/* Natural logarithm of Z. */
|
||||
__MATHCALL (clog, (_Mdouble_complex_ __z));
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* The base 10 logarithm is not defined by the standard but to implement
|
||||
the standard C++ library it is handy. */
|
||||
__MATHCALL (clog10, (_Mdouble_complex_ __z));
|
||||
#endif
|
||||
|
||||
/* Power functions. */
|
||||
|
||||
/* Return X to the Y power. */
|
||||
__MATHCALL (cpow, (_Mdouble_complex_ __x, _Mdouble_complex_ __y));
|
||||
|
||||
/* Return the square root of Z. */
|
||||
__MATHCALL (csqrt, (_Mdouble_complex_ __z));
|
||||
|
||||
|
||||
/* Absolute value, conjugates, and projection. */
|
||||
|
||||
/* Absolute value of Z. */
|
||||
__MATHDECL (_Mdouble_,cabs, (_Mdouble_complex_ __z));
|
||||
|
||||
/* Argument value of Z. */
|
||||
__MATHDECL (_Mdouble_,carg, (_Mdouble_complex_ __z));
|
||||
|
||||
/* Complex conjugate of Z. */
|
||||
__MATHCALL (conj, (_Mdouble_complex_ __z));
|
||||
|
||||
/* Projection of Z onto the Riemann sphere. */
|
||||
__MATHCALL (cproj, (_Mdouble_complex_ __z));
|
||||
|
||||
|
||||
/* Decomposing complex values. */
|
||||
|
||||
/* Imaginary part of Z. */
|
||||
__MATHDECL (_Mdouble_,cimag, (_Mdouble_complex_ __z));
|
||||
|
||||
/* Real part of Z. */
|
||||
__MATHDECL (_Mdouble_,creal, (_Mdouble_complex_ __z));
|
675
libc/glibc-include/bits/confname.h
Normal file
675
libc/glibc-include/bits/confname.h
Normal file
@ -0,0 +1,675 @@
|
||||
/* `sysconf', `pathconf', and `confstr' NAME values. Generic version.
|
||||
Copyright (C) 1993-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _UNISTD_H
|
||||
# error "Never use <bits/confname.h> directly; include <unistd.h> instead."
|
||||
#endif
|
||||
|
||||
/* Values for the NAME argument to `pathconf' and `fpathconf'. */
|
||||
enum
|
||||
{
|
||||
_PC_LINK_MAX,
|
||||
#define _PC_LINK_MAX _PC_LINK_MAX
|
||||
_PC_MAX_CANON,
|
||||
#define _PC_MAX_CANON _PC_MAX_CANON
|
||||
_PC_MAX_INPUT,
|
||||
#define _PC_MAX_INPUT _PC_MAX_INPUT
|
||||
_PC_NAME_MAX,
|
||||
#define _PC_NAME_MAX _PC_NAME_MAX
|
||||
_PC_PATH_MAX,
|
||||
#define _PC_PATH_MAX _PC_PATH_MAX
|
||||
_PC_PIPE_BUF,
|
||||
#define _PC_PIPE_BUF _PC_PIPE_BUF
|
||||
_PC_CHOWN_RESTRICTED,
|
||||
#define _PC_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED
|
||||
_PC_NO_TRUNC,
|
||||
#define _PC_NO_TRUNC _PC_NO_TRUNC
|
||||
_PC_VDISABLE,
|
||||
#define _PC_VDISABLE _PC_VDISABLE
|
||||
_PC_SYNC_IO,
|
||||
#define _PC_SYNC_IO _PC_SYNC_IO
|
||||
_PC_ASYNC_IO,
|
||||
#define _PC_ASYNC_IO _PC_ASYNC_IO
|
||||
_PC_PRIO_IO,
|
||||
#define _PC_PRIO_IO _PC_PRIO_IO
|
||||
_PC_SOCK_MAXBUF,
|
||||
#define _PC_SOCK_MAXBUF _PC_SOCK_MAXBUF
|
||||
_PC_FILESIZEBITS,
|
||||
#define _PC_FILESIZEBITS _PC_FILESIZEBITS
|
||||
_PC_REC_INCR_XFER_SIZE,
|
||||
#define _PC_REC_INCR_XFER_SIZE _PC_REC_INCR_XFER_SIZE
|
||||
_PC_REC_MAX_XFER_SIZE,
|
||||
#define _PC_REC_MAX_XFER_SIZE _PC_REC_MAX_XFER_SIZE
|
||||
_PC_REC_MIN_XFER_SIZE,
|
||||
#define _PC_REC_MIN_XFER_SIZE _PC_REC_MIN_XFER_SIZE
|
||||
_PC_REC_XFER_ALIGN,
|
||||
#define _PC_REC_XFER_ALIGN _PC_REC_XFER_ALIGN
|
||||
_PC_ALLOC_SIZE_MIN,
|
||||
#define _PC_ALLOC_SIZE_MIN _PC_ALLOC_SIZE_MIN
|
||||
_PC_SYMLINK_MAX,
|
||||
#define _PC_SYMLINK_MAX _PC_SYMLINK_MAX
|
||||
_PC_2_SYMLINKS
|
||||
#define _PC_2_SYMLINKS _PC_2_SYMLINKS
|
||||
};
|
||||
|
||||
/* Values for the argument to `sysconf'. */
|
||||
enum
|
||||
{
|
||||
_SC_ARG_MAX,
|
||||
#define _SC_ARG_MAX _SC_ARG_MAX
|
||||
_SC_CHILD_MAX,
|
||||
#define _SC_CHILD_MAX _SC_CHILD_MAX
|
||||
_SC_CLK_TCK,
|
||||
#define _SC_CLK_TCK _SC_CLK_TCK
|
||||
_SC_NGROUPS_MAX,
|
||||
#define _SC_NGROUPS_MAX _SC_NGROUPS_MAX
|
||||
_SC_OPEN_MAX,
|
||||
#define _SC_OPEN_MAX _SC_OPEN_MAX
|
||||
_SC_STREAM_MAX,
|
||||
#define _SC_STREAM_MAX _SC_STREAM_MAX
|
||||
_SC_TZNAME_MAX,
|
||||
#define _SC_TZNAME_MAX _SC_TZNAME_MAX
|
||||
_SC_JOB_CONTROL,
|
||||
#define _SC_JOB_CONTROL _SC_JOB_CONTROL
|
||||
_SC_SAVED_IDS,
|
||||
#define _SC_SAVED_IDS _SC_SAVED_IDS
|
||||
_SC_REALTIME_SIGNALS,
|
||||
#define _SC_REALTIME_SIGNALS _SC_REALTIME_SIGNALS
|
||||
_SC_PRIORITY_SCHEDULING,
|
||||
#define _SC_PRIORITY_SCHEDULING _SC_PRIORITY_SCHEDULING
|
||||
_SC_TIMERS,
|
||||
#define _SC_TIMERS _SC_TIMERS
|
||||
_SC_ASYNCHRONOUS_IO,
|
||||
#define _SC_ASYNCHRONOUS_IO _SC_ASYNCHRONOUS_IO
|
||||
_SC_PRIORITIZED_IO,
|
||||
#define _SC_PRIORITIZED_IO _SC_PRIORITIZED_IO
|
||||
_SC_SYNCHRONIZED_IO,
|
||||
#define _SC_SYNCHRONIZED_IO _SC_SYNCHRONIZED_IO
|
||||
_SC_FSYNC,
|
||||
#define _SC_FSYNC _SC_FSYNC
|
||||
_SC_MAPPED_FILES,
|
||||
#define _SC_MAPPED_FILES _SC_MAPPED_FILES
|
||||
_SC_MEMLOCK,
|
||||
#define _SC_MEMLOCK _SC_MEMLOCK
|
||||
_SC_MEMLOCK_RANGE,
|
||||
#define _SC_MEMLOCK_RANGE _SC_MEMLOCK_RANGE
|
||||
_SC_MEMORY_PROTECTION,
|
||||
#define _SC_MEMORY_PROTECTION _SC_MEMORY_PROTECTION
|
||||
_SC_MESSAGE_PASSING,
|
||||
#define _SC_MESSAGE_PASSING _SC_MESSAGE_PASSING
|
||||
_SC_SEMAPHORES,
|
||||
#define _SC_SEMAPHORES _SC_SEMAPHORES
|
||||
_SC_SHARED_MEMORY_OBJECTS,
|
||||
#define _SC_SHARED_MEMORY_OBJECTS _SC_SHARED_MEMORY_OBJECTS
|
||||
_SC_AIO_LISTIO_MAX,
|
||||
#define _SC_AIO_LISTIO_MAX _SC_AIO_LISTIO_MAX
|
||||
_SC_AIO_MAX,
|
||||
#define _SC_AIO_MAX _SC_AIO_MAX
|
||||
_SC_AIO_PRIO_DELTA_MAX,
|
||||
#define _SC_AIO_PRIO_DELTA_MAX _SC_AIO_PRIO_DELTA_MAX
|
||||
_SC_DELAYTIMER_MAX,
|
||||
#define _SC_DELAYTIMER_MAX _SC_DELAYTIMER_MAX
|
||||
_SC_MQ_OPEN_MAX,
|
||||
#define _SC_MQ_OPEN_MAX _SC_MQ_OPEN_MAX
|
||||
_SC_MQ_PRIO_MAX,
|
||||
#define _SC_MQ_PRIO_MAX _SC_MQ_PRIO_MAX
|
||||
_SC_VERSION,
|
||||
#define _SC_VERSION _SC_VERSION
|
||||
_SC_PAGESIZE,
|
||||
#define _SC_PAGESIZE _SC_PAGESIZE
|
||||
#define _SC_PAGE_SIZE _SC_PAGESIZE
|
||||
_SC_RTSIG_MAX,
|
||||
#define _SC_RTSIG_MAX _SC_RTSIG_MAX
|
||||
_SC_SEM_NSEMS_MAX,
|
||||
#define _SC_SEM_NSEMS_MAX _SC_SEM_NSEMS_MAX
|
||||
_SC_SEM_VALUE_MAX,
|
||||
#define _SC_SEM_VALUE_MAX _SC_SEM_VALUE_MAX
|
||||
_SC_SIGQUEUE_MAX,
|
||||
#define _SC_SIGQUEUE_MAX _SC_SIGQUEUE_MAX
|
||||
_SC_TIMER_MAX,
|
||||
#define _SC_TIMER_MAX _SC_TIMER_MAX
|
||||
|
||||
/* Values for the argument to `sysconf'
|
||||
corresponding to _POSIX2_* symbols. */
|
||||
_SC_BC_BASE_MAX,
|
||||
#define _SC_BC_BASE_MAX _SC_BC_BASE_MAX
|
||||
_SC_BC_DIM_MAX,
|
||||
#define _SC_BC_DIM_MAX _SC_BC_DIM_MAX
|
||||
_SC_BC_SCALE_MAX,
|
||||
#define _SC_BC_SCALE_MAX _SC_BC_SCALE_MAX
|
||||
_SC_BC_STRING_MAX,
|
||||
#define _SC_BC_STRING_MAX _SC_BC_STRING_MAX
|
||||
_SC_COLL_WEIGHTS_MAX,
|
||||
#define _SC_COLL_WEIGHTS_MAX _SC_COLL_WEIGHTS_MAX
|
||||
_SC_EQUIV_CLASS_MAX,
|
||||
#define _SC_EQUIV_CLASS_MAX _SC_EQUIV_CLASS_MAX
|
||||
_SC_EXPR_NEST_MAX,
|
||||
#define _SC_EXPR_NEST_MAX _SC_EXPR_NEST_MAX
|
||||
_SC_LINE_MAX,
|
||||
#define _SC_LINE_MAX _SC_LINE_MAX
|
||||
_SC_RE_DUP_MAX,
|
||||
#define _SC_RE_DUP_MAX _SC_RE_DUP_MAX
|
||||
_SC_CHARCLASS_NAME_MAX,
|
||||
#define _SC_CHARCLASS_NAME_MAX _SC_CHARCLASS_NAME_MAX
|
||||
|
||||
_SC_2_VERSION,
|
||||
#define _SC_2_VERSION _SC_2_VERSION
|
||||
_SC_2_C_BIND,
|
||||
#define _SC_2_C_BIND _SC_2_C_BIND
|
||||
_SC_2_C_DEV,
|
||||
#define _SC_2_C_DEV _SC_2_C_DEV
|
||||
_SC_2_FORT_DEV,
|
||||
#define _SC_2_FORT_DEV _SC_2_FORT_DEV
|
||||
_SC_2_FORT_RUN,
|
||||
#define _SC_2_FORT_RUN _SC_2_FORT_RUN
|
||||
_SC_2_SW_DEV,
|
||||
#define _SC_2_SW_DEV _SC_2_SW_DEV
|
||||
_SC_2_LOCALEDEF,
|
||||
#define _SC_2_LOCALEDEF _SC_2_LOCALEDEF
|
||||
|
||||
_SC_PII,
|
||||
#define _SC_PII _SC_PII
|
||||
_SC_PII_XTI,
|
||||
#define _SC_PII_XTI _SC_PII_XTI
|
||||
_SC_PII_SOCKET,
|
||||
#define _SC_PII_SOCKET _SC_PII_SOCKET
|
||||
_SC_PII_INTERNET,
|
||||
#define _SC_PII_INTERNET _SC_PII_INTERNET
|
||||
_SC_PII_OSI,
|
||||
#define _SC_PII_OSI _SC_PII_OSI
|
||||
_SC_POLL,
|
||||
#define _SC_POLL _SC_POLL
|
||||
_SC_SELECT,
|
||||
#define _SC_SELECT _SC_SELECT
|
||||
_SC_UIO_MAXIOV,
|
||||
#define _SC_UIO_MAXIOV _SC_UIO_MAXIOV
|
||||
_SC_IOV_MAX = _SC_UIO_MAXIOV,
|
||||
#define _SC_IOV_MAX _SC_IOV_MAX
|
||||
_SC_PII_INTERNET_STREAM,
|
||||
#define _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_STREAM
|
||||
_SC_PII_INTERNET_DGRAM,
|
||||
#define _SC_PII_INTERNET_DGRAM _SC_PII_INTERNET_DGRAM
|
||||
_SC_PII_OSI_COTS,
|
||||
#define _SC_PII_OSI_COTS _SC_PII_OSI_COTS
|
||||
_SC_PII_OSI_CLTS,
|
||||
#define _SC_PII_OSI_CLTS _SC_PII_OSI_CLTS
|
||||
_SC_PII_OSI_M,
|
||||
#define _SC_PII_OSI_M _SC_PII_OSI_M
|
||||
_SC_T_IOV_MAX,
|
||||
#define _SC_T_IOV_MAX _SC_T_IOV_MAX
|
||||
|
||||
/* Values according to POSIX 1003.1c (POSIX threads). */
|
||||
_SC_THREADS,
|
||||
#define _SC_THREADS _SC_THREADS
|
||||
_SC_THREAD_SAFE_FUNCTIONS,
|
||||
#define _SC_THREAD_SAFE_FUNCTIONS _SC_THREAD_SAFE_FUNCTIONS
|
||||
_SC_GETGR_R_SIZE_MAX,
|
||||
#define _SC_GETGR_R_SIZE_MAX _SC_GETGR_R_SIZE_MAX
|
||||
_SC_GETPW_R_SIZE_MAX,
|
||||
#define _SC_GETPW_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX
|
||||
_SC_LOGIN_NAME_MAX,
|
||||
#define _SC_LOGIN_NAME_MAX _SC_LOGIN_NAME_MAX
|
||||
_SC_TTY_NAME_MAX,
|
||||
#define _SC_TTY_NAME_MAX _SC_TTY_NAME_MAX
|
||||
_SC_THREAD_DESTRUCTOR_ITERATIONS,
|
||||
#define _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_DESTRUCTOR_ITERATIONS
|
||||
_SC_THREAD_KEYS_MAX,
|
||||
#define _SC_THREAD_KEYS_MAX _SC_THREAD_KEYS_MAX
|
||||
_SC_THREAD_STACK_MIN,
|
||||
#define _SC_THREAD_STACK_MIN _SC_THREAD_STACK_MIN
|
||||
_SC_THREAD_THREADS_MAX,
|
||||
#define _SC_THREAD_THREADS_MAX _SC_THREAD_THREADS_MAX
|
||||
_SC_THREAD_ATTR_STACKADDR,
|
||||
#define _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKADDR
|
||||
_SC_THREAD_ATTR_STACKSIZE,
|
||||
#define _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_ATTR_STACKSIZE
|
||||
_SC_THREAD_PRIORITY_SCHEDULING,
|
||||
#define _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIORITY_SCHEDULING
|
||||
_SC_THREAD_PRIO_INHERIT,
|
||||
#define _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_INHERIT
|
||||
_SC_THREAD_PRIO_PROTECT,
|
||||
#define _SC_THREAD_PRIO_PROTECT _SC_THREAD_PRIO_PROTECT
|
||||
_SC_THREAD_PROCESS_SHARED,
|
||||
#define _SC_THREAD_PROCESS_SHARED _SC_THREAD_PROCESS_SHARED
|
||||
|
||||
_SC_NPROCESSORS_CONF,
|
||||
#define _SC_NPROCESSORS_CONF _SC_NPROCESSORS_CONF
|
||||
_SC_NPROCESSORS_ONLN,
|
||||
#define _SC_NPROCESSORS_ONLN _SC_NPROCESSORS_ONLN
|
||||
_SC_PHYS_PAGES,
|
||||
#define _SC_PHYS_PAGES _SC_PHYS_PAGES
|
||||
_SC_AVPHYS_PAGES,
|
||||
#define _SC_AVPHYS_PAGES _SC_AVPHYS_PAGES
|
||||
_SC_ATEXIT_MAX,
|
||||
#define _SC_ATEXIT_MAX _SC_ATEXIT_MAX
|
||||
_SC_PASS_MAX,
|
||||
#define _SC_PASS_MAX _SC_PASS_MAX
|
||||
|
||||
_SC_XOPEN_VERSION,
|
||||
#define _SC_XOPEN_VERSION _SC_XOPEN_VERSION
|
||||
_SC_XOPEN_XCU_VERSION,
|
||||
#define _SC_XOPEN_XCU_VERSION _SC_XOPEN_XCU_VERSION
|
||||
_SC_XOPEN_UNIX,
|
||||
#define _SC_XOPEN_UNIX _SC_XOPEN_UNIX
|
||||
_SC_XOPEN_CRYPT,
|
||||
#define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT
|
||||
_SC_XOPEN_ENH_I18N,
|
||||
#define _SC_XOPEN_ENH_I18N _SC_XOPEN_ENH_I18N
|
||||
_SC_XOPEN_SHM,
|
||||
#define _SC_XOPEN_SHM _SC_XOPEN_SHM
|
||||
|
||||
_SC_2_CHAR_TERM,
|
||||
#define _SC_2_CHAR_TERM _SC_2_CHAR_TERM
|
||||
_SC_2_C_VERSION,
|
||||
#define _SC_2_C_VERSION _SC_2_C_VERSION
|
||||
_SC_2_UPE,
|
||||
#define _SC_2_UPE _SC_2_UPE
|
||||
|
||||
_SC_XOPEN_XPG2,
|
||||
#define _SC_XOPEN_XPG2 _SC_XOPEN_XPG2
|
||||
_SC_XOPEN_XPG3,
|
||||
#define _SC_XOPEN_XPG3 _SC_XOPEN_XPG3
|
||||
_SC_XOPEN_XPG4,
|
||||
#define _SC_XOPEN_XPG4 _SC_XOPEN_XPG4
|
||||
|
||||
_SC_CHAR_BIT,
|
||||
#define _SC_CHAR_BIT _SC_CHAR_BIT
|
||||
_SC_CHAR_MAX,
|
||||
#define _SC_CHAR_MAX _SC_CHAR_MAX
|
||||
_SC_CHAR_MIN,
|
||||
#define _SC_CHAR_MIN _SC_CHAR_MIN
|
||||
_SC_INT_MAX,
|
||||
#define _SC_INT_MAX _SC_INT_MAX
|
||||
_SC_INT_MIN,
|
||||
#define _SC_INT_MIN _SC_INT_MIN
|
||||
_SC_LONG_BIT,
|
||||
#define _SC_LONG_BIT _SC_LONG_BIT
|
||||
_SC_WORD_BIT,
|
||||
#define _SC_WORD_BIT _SC_WORD_BIT
|
||||
_SC_MB_LEN_MAX,
|
||||
#define _SC_MB_LEN_MAX _SC_MB_LEN_MAX
|
||||
_SC_NZERO,
|
||||
#define _SC_NZERO _SC_NZERO
|
||||
_SC_SSIZE_MAX,
|
||||
#define _SC_SSIZE_MAX _SC_SSIZE_MAX
|
||||
_SC_SCHAR_MAX,
|
||||
#define _SC_SCHAR_MAX _SC_SCHAR_MAX
|
||||
_SC_SCHAR_MIN,
|
||||
#define _SC_SCHAR_MIN _SC_SCHAR_MIN
|
||||
_SC_SHRT_MAX,
|
||||
#define _SC_SHRT_MAX _SC_SHRT_MAX
|
||||
_SC_SHRT_MIN,
|
||||
#define _SC_SHRT_MIN _SC_SHRT_MIN
|
||||
_SC_UCHAR_MAX,
|
||||
#define _SC_UCHAR_MAX _SC_UCHAR_MAX
|
||||
_SC_UINT_MAX,
|
||||
#define _SC_UINT_MAX _SC_UINT_MAX
|
||||
_SC_ULONG_MAX,
|
||||
#define _SC_ULONG_MAX _SC_ULONG_MAX
|
||||
_SC_USHRT_MAX,
|
||||
#define _SC_USHRT_MAX _SC_USHRT_MAX
|
||||
|
||||
_SC_NL_ARGMAX,
|
||||
#define _SC_NL_ARGMAX _SC_NL_ARGMAX
|
||||
_SC_NL_LANGMAX,
|
||||
#define _SC_NL_LANGMAX _SC_NL_LANGMAX
|
||||
_SC_NL_MSGMAX,
|
||||
#define _SC_NL_MSGMAX _SC_NL_MSGMAX
|
||||
_SC_NL_NMAX,
|
||||
#define _SC_NL_NMAX _SC_NL_NMAX
|
||||
_SC_NL_SETMAX,
|
||||
#define _SC_NL_SETMAX _SC_NL_SETMAX
|
||||
_SC_NL_TEXTMAX,
|
||||
#define _SC_NL_TEXTMAX _SC_NL_TEXTMAX
|
||||
|
||||
_SC_XBS5_ILP32_OFF32,
|
||||
#define _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFF32
|
||||
_SC_XBS5_ILP32_OFFBIG,
|
||||
#define _SC_XBS5_ILP32_OFFBIG _SC_XBS5_ILP32_OFFBIG
|
||||
_SC_XBS5_LP64_OFF64,
|
||||
#define _SC_XBS5_LP64_OFF64 _SC_XBS5_LP64_OFF64
|
||||
_SC_XBS5_LPBIG_OFFBIG,
|
||||
#define _SC_XBS5_LPBIG_OFFBIG _SC_XBS5_LPBIG_OFFBIG
|
||||
|
||||
_SC_XOPEN_LEGACY,
|
||||
#define _SC_XOPEN_LEGACY _SC_XOPEN_LEGACY
|
||||
_SC_XOPEN_REALTIME,
|
||||
#define _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME
|
||||
_SC_XOPEN_REALTIME_THREADS,
|
||||
#define _SC_XOPEN_REALTIME_THREADS _SC_XOPEN_REALTIME_THREADS
|
||||
|
||||
_SC_ADVISORY_INFO,
|
||||
#define _SC_ADVISORY_INFO _SC_ADVISORY_INFO
|
||||
_SC_BARRIERS,
|
||||
#define _SC_BARRIERS _SC_BARRIERS
|
||||
_SC_BASE,
|
||||
#define _SC_BASE _SC_BASE
|
||||
_SC_C_LANG_SUPPORT,
|
||||
#define _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT
|
||||
_SC_C_LANG_SUPPORT_R,
|
||||
#define _SC_C_LANG_SUPPORT_R _SC_C_LANG_SUPPORT_R
|
||||
_SC_CLOCK_SELECTION,
|
||||
#define _SC_CLOCK_SELECTION _SC_CLOCK_SELECTION
|
||||
_SC_CPUTIME,
|
||||
#define _SC_CPUTIME _SC_CPUTIME
|
||||
_SC_THREAD_CPUTIME,
|
||||
#define _SC_THREAD_CPUTIME _SC_THREAD_CPUTIME
|
||||
_SC_DEVICE_IO,
|
||||
#define _SC_DEVICE_IO _SC_DEVICE_IO
|
||||
_SC_DEVICE_SPECIFIC,
|
||||
#define _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC
|
||||
_SC_DEVICE_SPECIFIC_R,
|
||||
#define _SC_DEVICE_SPECIFIC_R _SC_DEVICE_SPECIFIC_R
|
||||
_SC_FD_MGMT,
|
||||
#define _SC_FD_MGMT _SC_FD_MGMT
|
||||
_SC_FIFO,
|
||||
#define _SC_FIFO _SC_FIFO
|
||||
_SC_PIPE,
|
||||
#define _SC_PIPE _SC_PIPE
|
||||
_SC_FILE_ATTRIBUTES,
|
||||
#define _SC_FILE_ATTRIBUTES _SC_FILE_ATTRIBUTES
|
||||
_SC_FILE_LOCKING,
|
||||
#define _SC_FILE_LOCKING _SC_FILE_LOCKING
|
||||
_SC_FILE_SYSTEM,
|
||||
#define _SC_FILE_SYSTEM _SC_FILE_SYSTEM
|
||||
_SC_MONOTONIC_CLOCK,
|
||||
#define _SC_MONOTONIC_CLOCK _SC_MONOTONIC_CLOCK
|
||||
_SC_MULTI_PROCESS,
|
||||
#define _SC_MULTI_PROCESS _SC_MULTI_PROCESS
|
||||
_SC_SINGLE_PROCESS,
|
||||
#define _SC_SINGLE_PROCESS _SC_SINGLE_PROCESS
|
||||
_SC_NETWORKING,
|
||||
#define _SC_NETWORKING _SC_NETWORKING
|
||||
_SC_READER_WRITER_LOCKS,
|
||||
#define _SC_READER_WRITER_LOCKS _SC_READER_WRITER_LOCKS
|
||||
_SC_SPIN_LOCKS,
|
||||
#define _SC_SPIN_LOCKS _SC_SPIN_LOCKS
|
||||
_SC_REGEXP,
|
||||
#define _SC_REGEXP _SC_REGEXP
|
||||
_SC_REGEX_VERSION,
|
||||
#define _SC_REGEX_VERSION _SC_REGEX_VERSION
|
||||
_SC_SHELL,
|
||||
#define _SC_SHELL _SC_SHELL
|
||||
_SC_SIGNALS,
|
||||
#define _SC_SIGNALS _SC_SIGNALS
|
||||
_SC_SPAWN,
|
||||
#define _SC_SPAWN _SC_SPAWN
|
||||
_SC_SPORADIC_SERVER,
|
||||
#define _SC_SPORADIC_SERVER _SC_SPORADIC_SERVER
|
||||
_SC_THREAD_SPORADIC_SERVER,
|
||||
#define _SC_THREAD_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER
|
||||
_SC_SYSTEM_DATABASE,
|
||||
#define _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE
|
||||
_SC_SYSTEM_DATABASE_R,
|
||||
#define _SC_SYSTEM_DATABASE_R _SC_SYSTEM_DATABASE_R
|
||||
_SC_TIMEOUTS,
|
||||
#define _SC_TIMEOUTS _SC_TIMEOUTS
|
||||
_SC_TYPED_MEMORY_OBJECTS,
|
||||
#define _SC_TYPED_MEMORY_OBJECTS _SC_TYPED_MEMORY_OBJECTS
|
||||
_SC_USER_GROUPS,
|
||||
#define _SC_USER_GROUPS _SC_USER_GROUPS
|
||||
_SC_USER_GROUPS_R,
|
||||
#define _SC_USER_GROUPS_R _SC_USER_GROUPS_R
|
||||
_SC_2_PBS,
|
||||
#define _SC_2_PBS _SC_2_PBS
|
||||
_SC_2_PBS_ACCOUNTING,
|
||||
#define _SC_2_PBS_ACCOUNTING _SC_2_PBS_ACCOUNTING
|
||||
_SC_2_PBS_LOCATE,
|
||||
#define _SC_2_PBS_LOCATE _SC_2_PBS_LOCATE
|
||||
_SC_2_PBS_MESSAGE,
|
||||
#define _SC_2_PBS_MESSAGE _SC_2_PBS_MESSAGE
|
||||
_SC_2_PBS_TRACK,
|
||||
#define _SC_2_PBS_TRACK _SC_2_PBS_TRACK
|
||||
_SC_SYMLOOP_MAX,
|
||||
#define _SC_SYMLOOP_MAX _SC_SYMLOOP_MAX
|
||||
_SC_STREAMS,
|
||||
#define _SC_STREAMS _SC_STREAMS
|
||||
_SC_2_PBS_CHECKPOINT,
|
||||
#define _SC_2_PBS_CHECKPOINT _SC_2_PBS_CHECKPOINT
|
||||
|
||||
_SC_V6_ILP32_OFF32,
|
||||
#define _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFF32
|
||||
_SC_V6_ILP32_OFFBIG,
|
||||
#define _SC_V6_ILP32_OFFBIG _SC_V6_ILP32_OFFBIG
|
||||
_SC_V6_LP64_OFF64,
|
||||
#define _SC_V6_LP64_OFF64 _SC_V6_LP64_OFF64
|
||||
_SC_V6_LPBIG_OFFBIG,
|
||||
#define _SC_V6_LPBIG_OFFBIG _SC_V6_LPBIG_OFFBIG
|
||||
|
||||
_SC_HOST_NAME_MAX,
|
||||
#define _SC_HOST_NAME_MAX _SC_HOST_NAME_MAX
|
||||
_SC_TRACE,
|
||||
#define _SC_TRACE _SC_TRACE
|
||||
_SC_TRACE_EVENT_FILTER,
|
||||
#define _SC_TRACE_EVENT_FILTER _SC_TRACE_EVENT_FILTER
|
||||
_SC_TRACE_INHERIT,
|
||||
#define _SC_TRACE_INHERIT _SC_TRACE_INHERIT
|
||||
_SC_TRACE_LOG,
|
||||
#define _SC_TRACE_LOG _SC_TRACE_LOG
|
||||
|
||||
_SC_LEVEL1_ICACHE_SIZE,
|
||||
#define _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_SIZE
|
||||
_SC_LEVEL1_ICACHE_ASSOC,
|
||||
#define _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_ASSOC
|
||||
_SC_LEVEL1_ICACHE_LINESIZE,
|
||||
#define _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_ICACHE_LINESIZE
|
||||
_SC_LEVEL1_DCACHE_SIZE,
|
||||
#define _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_SIZE
|
||||
_SC_LEVEL1_DCACHE_ASSOC,
|
||||
#define _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_ASSOC
|
||||
_SC_LEVEL1_DCACHE_LINESIZE,
|
||||
#define _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL1_DCACHE_LINESIZE
|
||||
_SC_LEVEL2_CACHE_SIZE,
|
||||
#define _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_SIZE
|
||||
_SC_LEVEL2_CACHE_ASSOC,
|
||||
#define _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_ASSOC
|
||||
_SC_LEVEL2_CACHE_LINESIZE,
|
||||
#define _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL2_CACHE_LINESIZE
|
||||
_SC_LEVEL3_CACHE_SIZE,
|
||||
#define _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_SIZE
|
||||
_SC_LEVEL3_CACHE_ASSOC,
|
||||
#define _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_ASSOC
|
||||
_SC_LEVEL3_CACHE_LINESIZE,
|
||||
#define _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL3_CACHE_LINESIZE
|
||||
_SC_LEVEL4_CACHE_SIZE,
|
||||
#define _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_SIZE
|
||||
_SC_LEVEL4_CACHE_ASSOC,
|
||||
#define _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_ASSOC
|
||||
_SC_LEVEL4_CACHE_LINESIZE,
|
||||
#define _SC_LEVEL4_CACHE_LINESIZE _SC_LEVEL4_CACHE_LINESIZE
|
||||
/* Leave room here, maybe we need a few more cache levels some day. */
|
||||
|
||||
_SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
|
||||
#define _SC_IPV6 _SC_IPV6
|
||||
_SC_RAW_SOCKETS,
|
||||
#define _SC_RAW_SOCKETS _SC_RAW_SOCKETS
|
||||
|
||||
_SC_V7_ILP32_OFF32,
|
||||
#define _SC_V7_ILP32_OFF32 _SC_V7_ILP32_OFF32
|
||||
_SC_V7_ILP32_OFFBIG,
|
||||
#define _SC_V7_ILP32_OFFBIG _SC_V7_ILP32_OFFBIG
|
||||
_SC_V7_LP64_OFF64,
|
||||
#define _SC_V7_LP64_OFF64 _SC_V7_LP64_OFF64
|
||||
_SC_V7_LPBIG_OFFBIG,
|
||||
#define _SC_V7_LPBIG_OFFBIG _SC_V7_LPBIG_OFFBIG
|
||||
|
||||
_SC_SS_REPL_MAX,
|
||||
#define _SC_SS_REPL_MAX _SC_SS_REPL_MAX
|
||||
|
||||
_SC_TRACE_EVENT_NAME_MAX,
|
||||
#define _SC_TRACE_EVENT_NAME_MAX _SC_TRACE_EVENT_NAME_MAX
|
||||
_SC_TRACE_NAME_MAX,
|
||||
#define _SC_TRACE_NAME_MAX _SC_TRACE_NAME_MAX
|
||||
_SC_TRACE_SYS_MAX,
|
||||
#define _SC_TRACE_SYS_MAX _SC_TRACE_SYS_MAX
|
||||
_SC_TRACE_USER_EVENT_MAX,
|
||||
#define _SC_TRACE_USER_EVENT_MAX _SC_TRACE_USER_EVENT_MAX
|
||||
|
||||
_SC_XOPEN_STREAMS,
|
||||
#define _SC_XOPEN_STREAMS _SC_XOPEN_STREAMS
|
||||
|
||||
_SC_THREAD_ROBUST_PRIO_INHERIT,
|
||||
#define _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_INHERIT
|
||||
_SC_THREAD_ROBUST_PRIO_PROTECT
|
||||
#define _SC_THREAD_ROBUST_PRIO_PROTECT _SC_THREAD_ROBUST_PRIO_PROTECT
|
||||
};
|
||||
|
||||
/* Values for the NAME argument to `confstr'. */
|
||||
enum
|
||||
{
|
||||
_CS_PATH, /* The default search path. */
|
||||
#define _CS_PATH _CS_PATH
|
||||
|
||||
_CS_V6_WIDTH_RESTRICTED_ENVS,
|
||||
#define _CS_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS
|
||||
#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS
|
||||
|
||||
_CS_GNU_LIBC_VERSION,
|
||||
#define _CS_GNU_LIBC_VERSION _CS_GNU_LIBC_VERSION
|
||||
_CS_GNU_LIBPTHREAD_VERSION,
|
||||
#define _CS_GNU_LIBPTHREAD_VERSION _CS_GNU_LIBPTHREAD_VERSION
|
||||
|
||||
_CS_V5_WIDTH_RESTRICTED_ENVS,
|
||||
#define _CS_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS
|
||||
#define _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS
|
||||
|
||||
_CS_V7_WIDTH_RESTRICTED_ENVS,
|
||||
#define _CS_V7_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS
|
||||
#define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS
|
||||
|
||||
_CS_LFS_CFLAGS = 1000,
|
||||
#define _CS_LFS_CFLAGS _CS_LFS_CFLAGS
|
||||
_CS_LFS_LDFLAGS,
|
||||
#define _CS_LFS_LDFLAGS _CS_LFS_LDFLAGS
|
||||
_CS_LFS_LIBS,
|
||||
#define _CS_LFS_LIBS _CS_LFS_LIBS
|
||||
_CS_LFS_LINTFLAGS,
|
||||
#define _CS_LFS_LINTFLAGS _CS_LFS_LINTFLAGS
|
||||
_CS_LFS64_CFLAGS,
|
||||
#define _CS_LFS64_CFLAGS _CS_LFS64_CFLAGS
|
||||
_CS_LFS64_LDFLAGS,
|
||||
#define _CS_LFS64_LDFLAGS _CS_LFS64_LDFLAGS
|
||||
_CS_LFS64_LIBS,
|
||||
#define _CS_LFS64_LIBS _CS_LFS64_LIBS
|
||||
_CS_LFS64_LINTFLAGS,
|
||||
#define _CS_LFS64_LINTFLAGS _CS_LFS64_LINTFLAGS
|
||||
|
||||
_CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
|
||||
#define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS
|
||||
_CS_XBS5_ILP32_OFF32_LDFLAGS,
|
||||
#define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS
|
||||
_CS_XBS5_ILP32_OFF32_LIBS,
|
||||
#define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS
|
||||
_CS_XBS5_ILP32_OFF32_LINTFLAGS,
|
||||
#define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS
|
||||
_CS_XBS5_ILP32_OFFBIG_CFLAGS,
|
||||
#define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS
|
||||
_CS_XBS5_ILP32_OFFBIG_LDFLAGS,
|
||||
#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS
|
||||
_CS_XBS5_ILP32_OFFBIG_LIBS,
|
||||
#define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS
|
||||
_CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
|
||||
#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
|
||||
_CS_XBS5_LP64_OFF64_CFLAGS,
|
||||
#define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS
|
||||
_CS_XBS5_LP64_OFF64_LDFLAGS,
|
||||
#define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS
|
||||
_CS_XBS5_LP64_OFF64_LIBS,
|
||||
#define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS
|
||||
_CS_XBS5_LP64_OFF64_LINTFLAGS,
|
||||
#define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS
|
||||
_CS_XBS5_LPBIG_OFFBIG_CFLAGS,
|
||||
#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS
|
||||
_CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
|
||||
#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
|
||||
_CS_XBS5_LPBIG_OFFBIG_LIBS,
|
||||
#define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS
|
||||
_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
|
||||
#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
|
||||
|
||||
_CS_POSIX_V6_ILP32_OFF32_CFLAGS,
|
||||
#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS
|
||||
_CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
|
||||
#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
|
||||
_CS_POSIX_V6_ILP32_OFF32_LIBS,
|
||||
#define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LIBS
|
||||
_CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
|
||||
#define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
|
||||
_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
|
||||
#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
|
||||
_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
|
||||
#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
|
||||
_CS_POSIX_V6_ILP32_OFFBIG_LIBS,
|
||||
#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LIBS
|
||||
_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
|
||||
#define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
|
||||
_CS_POSIX_V6_LP64_OFF64_CFLAGS,
|
||||
#define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS
|
||||
_CS_POSIX_V6_LP64_OFF64_LDFLAGS,
|
||||
#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS
|
||||
_CS_POSIX_V6_LP64_OFF64_LIBS,
|
||||
#define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LIBS
|
||||
_CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
|
||||
#define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
|
||||
_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
|
||||
#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
|
||||
_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
|
||||
#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
|
||||
_CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
|
||||
#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
|
||||
_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,
|
||||
#define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
|
||||
|
||||
_CS_POSIX_V7_ILP32_OFF32_CFLAGS,
|
||||
#define _CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS
|
||||
_CS_POSIX_V7_ILP32_OFF32_LDFLAGS,
|
||||
#define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS
|
||||
_CS_POSIX_V7_ILP32_OFF32_LIBS,
|
||||
#define _CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LIBS
|
||||
_CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,
|
||||
#define _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS
|
||||
_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,
|
||||
#define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS
|
||||
_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,
|
||||
#define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS
|
||||
_CS_POSIX_V7_ILP32_OFFBIG_LIBS,
|
||||
#define _CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LIBS
|
||||
_CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,
|
||||
#define _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS
|
||||
_CS_POSIX_V7_LP64_OFF64_CFLAGS,
|
||||
#define _CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS
|
||||
_CS_POSIX_V7_LP64_OFF64_LDFLAGS,
|
||||
#define _CS_POSIX_V7_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS
|
||||
_CS_POSIX_V7_LP64_OFF64_LIBS,
|
||||
#define _CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LIBS
|
||||
_CS_POSIX_V7_LP64_OFF64_LINTFLAGS,
|
||||
#define _CS_POSIX_V7_LP64_OFF64_LINTFLAGS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS
|
||||
_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,
|
||||
#define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS
|
||||
_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,
|
||||
#define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS
|
||||
_CS_POSIX_V7_LPBIG_OFFBIG_LIBS,
|
||||
#define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS
|
||||
_CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,
|
||||
#define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS
|
||||
|
||||
_CS_V6_ENV,
|
||||
#define _CS_V6_ENV _CS_V6_ENV
|
||||
_CS_V7_ENV
|
||||
#define _CS_V7_ENV _CS_V7_ENV
|
||||
};
|
124
libc/glibc-include/bits/cpu-set.h
Normal file
124
libc/glibc-include/bits/cpu-set.h
Normal file
@ -0,0 +1,124 @@
|
||||
/* Definition of the cpu_set_t structure used by the POSIX 1003.1b-1993
|
||||
scheduling interface.
|
||||
Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BITS_CPU_SET_H
|
||||
#define _BITS_CPU_SET_H 1
|
||||
|
||||
#ifndef _SCHED_H
|
||||
# error "Never include <bits/cpu-set.h> directly; use <sched.h> instead."
|
||||
#endif
|
||||
|
||||
/* Size definition for CPU sets. */
|
||||
#define __CPU_SETSIZE 1024
|
||||
#define __NCPUBITS (8 * sizeof (__cpu_mask))
|
||||
|
||||
/* Type for array elements in 'cpu_set_t'. */
|
||||
typedef __CPU_MASK_TYPE __cpu_mask;
|
||||
|
||||
/* Basic access functions. */
|
||||
#define __CPUELT(cpu) ((cpu) / __NCPUBITS)
|
||||
#define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS))
|
||||
|
||||
/* Data structure to describe CPU mask. */
|
||||
typedef struct
|
||||
{
|
||||
__cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
|
||||
} cpu_set_t;
|
||||
|
||||
/* Access functions for CPU masks. */
|
||||
#if __GNUC_PREREQ (2, 91)
|
||||
# define __CPU_ZERO_S(setsize, cpusetp) \
|
||||
do __builtin_memset (cpusetp, '\0', setsize); while (0)
|
||||
#else
|
||||
# define __CPU_ZERO_S(setsize, cpusetp) \
|
||||
do { \
|
||||
size_t __i; \
|
||||
size_t __imax = (setsize) / sizeof (__cpu_mask); \
|
||||
__cpu_mask *__bits = (cpusetp)->__bits; \
|
||||
for (__i = 0; __i < __imax; ++__i) \
|
||||
__bits[__i] = 0; \
|
||||
} while (0)
|
||||
#endif
|
||||
#define __CPU_SET_S(cpu, setsize, cpusetp) \
|
||||
(__extension__ \
|
||||
({ size_t __cpu = (cpu); \
|
||||
__cpu / 8 < (setsize) \
|
||||
? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \
|
||||
|= __CPUMASK (__cpu)) \
|
||||
: 0; }))
|
||||
#define __CPU_CLR_S(cpu, setsize, cpusetp) \
|
||||
(__extension__ \
|
||||
({ size_t __cpu = (cpu); \
|
||||
__cpu / 8 < (setsize) \
|
||||
? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \
|
||||
&= ~__CPUMASK (__cpu)) \
|
||||
: 0; }))
|
||||
#define __CPU_ISSET_S(cpu, setsize, cpusetp) \
|
||||
(__extension__ \
|
||||
({ size_t __cpu = (cpu); \
|
||||
__cpu / 8 < (setsize) \
|
||||
? ((((const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \
|
||||
& __CPUMASK (__cpu))) != 0 \
|
||||
: 0; }))
|
||||
|
||||
#define __CPU_COUNT_S(setsize, cpusetp) \
|
||||
__sched_cpucount (setsize, cpusetp)
|
||||
|
||||
#if __GNUC_PREREQ (2, 91)
|
||||
# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
|
||||
(__builtin_memcmp (cpusetp1, cpusetp2, setsize) == 0)
|
||||
#else
|
||||
# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
|
||||
(__extension__ \
|
||||
({ const __cpu_mask *__arr1 = (cpusetp1)->__bits; \
|
||||
const __cpu_mask *__arr2 = (cpusetp2)->__bits; \
|
||||
size_t __imax = (setsize) / sizeof (__cpu_mask); \
|
||||
size_t __i; \
|
||||
for (__i = 0; __i < __imax; ++__i) \
|
||||
if (__arr1[__i] != __arr2[__i]) \
|
||||
break; \
|
||||
__i == __imax; }))
|
||||
#endif
|
||||
|
||||
#define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \
|
||||
(__extension__ \
|
||||
({ cpu_set_t *__dest = (destset); \
|
||||
const __cpu_mask *__arr1 = (srcset1)->__bits; \
|
||||
const __cpu_mask *__arr2 = (srcset2)->__bits; \
|
||||
size_t __imax = (setsize) / sizeof (__cpu_mask); \
|
||||
size_t __i; \
|
||||
for (__i = 0; __i < __imax; ++__i) \
|
||||
((__cpu_mask *) __dest->__bits)[__i] = __arr1[__i] op __arr2[__i]; \
|
||||
__dest; }))
|
||||
|
||||
#define __CPU_ALLOC_SIZE(count) \
|
||||
((((count) + __NCPUBITS - 1) / __NCPUBITS) * sizeof (__cpu_mask))
|
||||
#define __CPU_ALLOC(count) __sched_cpualloc (count)
|
||||
#define __CPU_FREE(cpuset) __sched_cpufree (cpuset)
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
|
||||
__THROW;
|
||||
extern cpu_set_t *__sched_cpualloc (size_t __count) __THROW __wur;
|
||||
extern void __sched_cpufree (cpu_set_t *__set) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* bits/cpu-set.h */
|
59
libc/glibc-include/bits/dirent.h
Normal file
59
libc/glibc-include/bits/dirent.h
Normal file
@ -0,0 +1,59 @@
|
||||
/* Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _DIRENT_H
|
||||
# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
|
||||
#endif
|
||||
|
||||
struct dirent
|
||||
{
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
__ino_t d_ino;
|
||||
__off_t d_off;
|
||||
#else
|
||||
__ino64_t d_ino;
|
||||
__off64_t d_off;
|
||||
#endif
|
||||
unsigned short int d_reclen;
|
||||
unsigned char d_type;
|
||||
char d_name[256]; /* We must not include limits.h! */
|
||||
};
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct dirent64
|
||||
{
|
||||
__ino64_t d_ino;
|
||||
__off64_t d_off;
|
||||
unsigned short int d_reclen;
|
||||
unsigned char d_type;
|
||||
char d_name[256]; /* We must not include limits.h! */
|
||||
};
|
||||
#endif
|
||||
|
||||
#define d_fileno d_ino /* Backwards compatibility. */
|
||||
|
||||
#undef _DIRENT_HAVE_D_NAMLEN
|
||||
#define _DIRENT_HAVE_D_RECLEN
|
||||
#define _DIRENT_HAVE_D_OFF
|
||||
#define _DIRENT_HAVE_D_TYPE
|
||||
|
||||
#if defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T
|
||||
/* Inform libc code that these two types are effectively identical. */
|
||||
# define _DIRENT_MATCHES_DIRENT64 1
|
||||
#else
|
||||
# define _DIRENT_MATCHES_DIRENT64 0
|
||||
#endif
|
64
libc/glibc-include/bits/dlfcn.h
Normal file
64
libc/glibc-include/bits/dlfcn.h
Normal file
@ -0,0 +1,64 @@
|
||||
/* System dependent definitions for run-time dynamic loading.
|
||||
Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _DLFCN_H
|
||||
# error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
|
||||
#endif
|
||||
|
||||
/* The MODE argument to `dlopen' contains one of the following: */
|
||||
#define RTLD_LAZY 0x00001 /* Lazy function call binding. */
|
||||
#define RTLD_NOW 0x00002 /* Immediate function call binding. */
|
||||
#define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */
|
||||
#define RTLD_NOLOAD 0x00004 /* Do not load the object. */
|
||||
#define RTLD_DEEPBIND 0x00008 /* Use deep binding. */
|
||||
|
||||
/* If the following bit is set in the MODE argument to `dlopen',
|
||||
the symbols of the loaded object and its dependencies are made
|
||||
visible as if the object were linked directly into the program. */
|
||||
#define RTLD_GLOBAL 0x00100
|
||||
|
||||
/* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL.
|
||||
The implementation does this by default and so we can define the
|
||||
value to zero. */
|
||||
#define RTLD_LOCAL 0
|
||||
|
||||
/* Do not delete object when closed. */
|
||||
#define RTLD_NODELETE 0x01000
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* To support profiling of shared objects it is a good idea to call
|
||||
the function found using `dlsym' using the following macro since
|
||||
these calls do not use the PLT. But this would mean the dynamic
|
||||
loader has no chance to find out when the function is called. The
|
||||
macro applies the necessary magic so that profiling is possible.
|
||||
Rewrite
|
||||
foo = (*fctp) (arg1, arg2);
|
||||
into
|
||||
foo = DL_CALL_FCT (fctp, (arg1, arg2));
|
||||
*/
|
||||
# define DL_CALL_FCT(fctp, args) \
|
||||
(_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args)
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* This function calls the profiling functions. */
|
||||
extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
14
libc/glibc-include/bits/elfclass.h
Normal file
14
libc/glibc-include/bits/elfclass.h
Normal file
@ -0,0 +1,14 @@
|
||||
/* This file specifies the native word size of the machine, which indicates
|
||||
the ELF file class used for executables and shared objects on this
|
||||
machine. */
|
||||
|
||||
#ifndef _LINK_H
|
||||
# error "Never use <bits/elfclass.h> directly; include <link.h> instead."
|
||||
#endif
|
||||
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
#define __ELF_NATIVE_CLASS __WORDSIZE
|
||||
|
||||
/* The entries in the .hash table always have a size of 32 bits. */
|
||||
typedef uint32_t Elf_Symndx;
|
7
libc/glibc-include/bits/endian.h
Normal file
7
libc/glibc-include/bits/endian.h
Normal file
@ -0,0 +1,7 @@
|
||||
/* i386/x86_64 are little-endian. */
|
||||
|
||||
#ifndef _ENDIAN_H
|
||||
# error "Never use <bits/endian.h> directly; include <endian.h> instead."
|
||||
#endif
|
||||
|
||||
#define __BYTE_ORDER __LITTLE_ENDIAN
|
105
libc/glibc-include/bits/environments.h
Normal file
105
libc/glibc-include/bits/environments.h
Normal file
@ -0,0 +1,105 @@
|
||||
/* Copyright (C) 1999-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _UNISTD_H
|
||||
# error "Never include this file directly. Use <unistd.h> instead"
|
||||
#endif
|
||||
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
/* This header should define the following symbols under the described
|
||||
situations. A value `1' means that the model is always supported,
|
||||
`-1' means it is never supported. Undefined means it cannot be
|
||||
statically decided.
|
||||
|
||||
_POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type
|
||||
_POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type
|
||||
|
||||
_POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type
|
||||
_POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type
|
||||
|
||||
The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
|
||||
_POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
|
||||
_XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
|
||||
used in previous versions of the Unix standard and are available
|
||||
only for compatibility.
|
||||
*/
|
||||
|
||||
#if __WORDSIZE == 64
|
||||
|
||||
/* Environments with 32-bit wide pointers are optionally provided.
|
||||
Therefore following macros aren't defined:
|
||||
# undef _POSIX_V7_ILP32_OFF32
|
||||
# undef _POSIX_V7_ILP32_OFFBIG
|
||||
# undef _POSIX_V6_ILP32_OFF32
|
||||
# undef _POSIX_V6_ILP32_OFFBIG
|
||||
# undef _XBS5_ILP32_OFF32
|
||||
# undef _XBS5_ILP32_OFFBIG
|
||||
and users need to check at runtime. */
|
||||
|
||||
/* We also have no use (for now) for an environment with bigger pointers
|
||||
and offsets. */
|
||||
# define _POSIX_V7_LPBIG_OFFBIG -1
|
||||
# define _POSIX_V6_LPBIG_OFFBIG -1
|
||||
# define _XBS5_LPBIG_OFFBIG -1
|
||||
|
||||
/* By default we have 64-bit wide `long int', pointers and `off_t'. */
|
||||
# define _POSIX_V7_LP64_OFF64 1
|
||||
# define _POSIX_V6_LP64_OFF64 1
|
||||
# define _XBS5_LP64_OFF64 1
|
||||
|
||||
#else /* __WORDSIZE == 32 */
|
||||
|
||||
/* We have 32-bit wide `int', `long int' and pointers and all platforms
|
||||
support LFS. -mx32 has 64-bit wide `off_t'. */
|
||||
# define _POSIX_V7_ILP32_OFFBIG 1
|
||||
# define _POSIX_V6_ILP32_OFFBIG 1
|
||||
# define _XBS5_ILP32_OFFBIG 1
|
||||
|
||||
# ifndef __x86_64__
|
||||
/* -m32 has 32-bit wide `off_t'. */
|
||||
# define _POSIX_V7_ILP32_OFF32 1
|
||||
# define _POSIX_V6_ILP32_OFF32 1
|
||||
# define _XBS5_ILP32_OFF32 1
|
||||
# endif
|
||||
|
||||
/* We optionally provide an environment with the above size but an 64-bit
|
||||
side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */
|
||||
|
||||
/* Environments with 64-bit wide pointers can be provided,
|
||||
so these macros aren't defined:
|
||||
# undef _POSIX_V7_LP64_OFF64
|
||||
# undef _POSIX_V7_LPBIG_OFFBIG
|
||||
# undef _POSIX_V6_LP64_OFF64
|
||||
# undef _POSIX_V6_LPBIG_OFFBIG
|
||||
# undef _XBS5_LP64_OFF64
|
||||
# undef _XBS5_LPBIG_OFFBIG
|
||||
and sysconf tests for it at runtime. */
|
||||
|
||||
#endif /* __WORDSIZE == 32 */
|
||||
|
||||
#define __ILP32_OFF32_CFLAGS "-m32"
|
||||
#define __ILP32_OFF32_LDFLAGS "-m32"
|
||||
#if defined __x86_64__ && defined __ILP32__
|
||||
# define __ILP32_OFFBIG_CFLAGS "-mx32"
|
||||
# define __ILP32_OFFBIG_LDFLAGS "-mx32"
|
||||
#else
|
||||
# define __ILP32_OFFBIG_CFLAGS "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
|
||||
# define __ILP32_OFFBIG_LDFLAGS "-m32"
|
||||
#endif
|
||||
#define __LP64_OFF64_CFLAGS "-m64"
|
||||
#define __LP64_OFF64_LDFLAGS "-m64"
|
29
libc/glibc-include/bits/epoll.h
Normal file
29
libc/glibc-include/bits/epoll.h
Normal file
@ -0,0 +1,29 @@
|
||||
/* Copyright (C) 2002-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_EPOLL_H
|
||||
# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
|
||||
#endif
|
||||
|
||||
/* Flags to be passed to epoll_create1. */
|
||||
enum
|
||||
{
|
||||
EPOLL_CLOEXEC = 02000000
|
||||
#define EPOLL_CLOEXEC EPOLL_CLOEXEC
|
||||
};
|
||||
|
||||
#define __EPOLL_PACKED __attribute__ ((__packed__))
|
53
libc/glibc-include/bits/errno.h
Normal file
53
libc/glibc-include/bits/errno.h
Normal file
@ -0,0 +1,53 @@
|
||||
/* Error constants. Linux specific version.
|
||||
Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BITS_ERRNO_H
|
||||
#define _BITS_ERRNO_H 1
|
||||
|
||||
#if !defined _ERRNO_H
|
||||
# error "Never include <bits/errno.h> directly; use <errno.h> instead."
|
||||
#endif
|
||||
|
||||
# include <linux/errno.h>
|
||||
|
||||
/* Older Linux headers do not define these constants. */
|
||||
# ifndef ENOTSUP
|
||||
# define ENOTSUP EOPNOTSUPP
|
||||
# endif
|
||||
|
||||
# ifndef ECANCELED
|
||||
# define ECANCELED 125
|
||||
# endif
|
||||
|
||||
# ifndef EOWNERDEAD
|
||||
# define EOWNERDEAD 130
|
||||
# endif
|
||||
|
||||
#ifndef ENOTRECOVERABLE
|
||||
# define ENOTRECOVERABLE 131
|
||||
# endif
|
||||
|
||||
# ifndef ERFKILL
|
||||
# define ERFKILL 132
|
||||
# endif
|
||||
|
||||
# ifndef EHWPOISON
|
||||
# define EHWPOISON 133
|
||||
# endif
|
||||
|
||||
#endif /* bits/errno.h. */
|
73
libc/glibc-include/bits/error.h
Normal file
73
libc/glibc-include/bits/error.h
Normal file
@ -0,0 +1,73 @@
|
||||
/* Specializations for error functions.
|
||||
Copyright (C) 2007-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _ERROR_H
|
||||
# error "Never include <bits/error.h> directly; use <error.h> instead."
|
||||
#endif
|
||||
|
||||
|
||||
extern void __REDIRECT (__error_alias, (int __status, int __errnum,
|
||||
const char *__format, ...),
|
||||
error)
|
||||
__attribute__ ((__format__ (__printf__, 3, 4)));
|
||||
extern void __REDIRECT (__error_noreturn, (int __status, int __errnum,
|
||||
const char *__format, ...),
|
||||
error)
|
||||
__attribute__ ((__noreturn__, __format__ (__printf__, 3, 4)));
|
||||
|
||||
|
||||
/* If we know the function will never return make sure the compiler
|
||||
realizes that, too. */
|
||||
__extern_always_inline void
|
||||
error (int __status, int __errnum, const char *__format, ...)
|
||||
{
|
||||
if (__builtin_constant_p (__status) && __status != 0)
|
||||
__error_noreturn (__status, __errnum, __format, __va_arg_pack ());
|
||||
else
|
||||
__error_alias (__status, __errnum, __format, __va_arg_pack ());
|
||||
}
|
||||
|
||||
|
||||
extern void __REDIRECT (__error_at_line_alias, (int __status, int __errnum,
|
||||
const char *__fname,
|
||||
unsigned int __line,
|
||||
const char *__format, ...),
|
||||
error_at_line)
|
||||
__attribute__ ((__format__ (__printf__, 5, 6)));
|
||||
extern void __REDIRECT (__error_at_line_noreturn, (int __status, int __errnum,
|
||||
const char *__fname,
|
||||
unsigned int __line,
|
||||
const char *__format,
|
||||
...),
|
||||
error_at_line)
|
||||
__attribute__ ((__noreturn__, __format__ (__printf__, 5, 6)));
|
||||
|
||||
|
||||
/* If we know the function will never return make sure the compiler
|
||||
realizes that, too. */
|
||||
__extern_always_inline void
|
||||
error_at_line (int __status, int __errnum, const char *__fname,
|
||||
unsigned int __line, const char *__format, ...)
|
||||
{
|
||||
if (__builtin_constant_p (__status) && __status != 0)
|
||||
__error_at_line_noreturn (__status, __errnum, __fname, __line, __format,
|
||||
__va_arg_pack ());
|
||||
else
|
||||
__error_at_line_alias (__status, __errnum, __fname, __line,
|
||||
__format, __va_arg_pack ());
|
||||
}
|
31
libc/glibc-include/bits/eventfd.h
Normal file
31
libc/glibc-include/bits/eventfd.h
Normal file
@ -0,0 +1,31 @@
|
||||
/* Copyright (C) 2007-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_EVENTFD_H
|
||||
# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead."
|
||||
#endif
|
||||
|
||||
/* Flags for eventfd. */
|
||||
enum
|
||||
{
|
||||
EFD_SEMAPHORE = 00000001,
|
||||
#define EFD_SEMAPHORE EFD_SEMAPHORE
|
||||
EFD_CLOEXEC = 02000000,
|
||||
#define EFD_CLOEXEC EFD_CLOEXEC
|
||||
EFD_NONBLOCK = 00004000
|
||||
#define EFD_NONBLOCK EFD_NONBLOCK
|
||||
};
|
436
libc/glibc-include/bits/fcntl-linux.h
Normal file
436
libc/glibc-include/bits/fcntl-linux.h
Normal file
@ -0,0 +1,436 @@
|
||||
/* O_*, F_*, FD_* bit values for Linux.
|
||||
Copyright (C) 2001-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FCNTL_H
|
||||
# error "Never use <bits/fcntl-linux.h> directly; include <fcntl.h> instead."
|
||||
#endif
|
||||
|
||||
/* This file contains shared definitions between Linux architectures
|
||||
and is included by <bits/fcntl.h> to declare them. The various
|
||||
#ifndef cases allow the architecture specific file to define those
|
||||
values with different values.
|
||||
|
||||
A minimal <bits/fcntl.h> contains just:
|
||||
|
||||
struct flock {...}
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct flock64 {...}
|
||||
#endif
|
||||
#include <bits/fcntl-linux.h>
|
||||
*/
|
||||
|
||||
#ifdef __USE_GNU
|
||||
# include <bits/types/struct_iovec.h>
|
||||
#endif
|
||||
|
||||
/* open/fcntl. */
|
||||
#define O_ACCMODE 0003
|
||||
#define O_RDONLY 00
|
||||
#define O_WRONLY 01
|
||||
#define O_RDWR 02
|
||||
#ifndef O_CREAT
|
||||
# define O_CREAT 0100 /* Not fcntl. */
|
||||
#endif
|
||||
#ifndef O_EXCL
|
||||
# define O_EXCL 0200 /* Not fcntl. */
|
||||
#endif
|
||||
#ifndef O_NOCTTY
|
||||
# define O_NOCTTY 0400 /* Not fcntl. */
|
||||
#endif
|
||||
#ifndef O_TRUNC
|
||||
# define O_TRUNC 01000 /* Not fcntl. */
|
||||
#endif
|
||||
#ifndef O_APPEND
|
||||
# define O_APPEND 02000
|
||||
#endif
|
||||
#ifndef O_NONBLOCK
|
||||
# define O_NONBLOCK 04000
|
||||
#endif
|
||||
#ifndef O_NDELAY
|
||||
# define O_NDELAY O_NONBLOCK
|
||||
#endif
|
||||
#ifndef O_SYNC
|
||||
# define O_SYNC 04010000
|
||||
#endif
|
||||
#define O_FSYNC O_SYNC
|
||||
#ifndef O_ASYNC
|
||||
# define O_ASYNC 020000
|
||||
#endif
|
||||
#ifndef __O_LARGEFILE
|
||||
# define __O_LARGEFILE 0100000
|
||||
#endif
|
||||
|
||||
#ifndef __O_DIRECTORY
|
||||
# define __O_DIRECTORY 0200000
|
||||
#endif
|
||||
#ifndef __O_NOFOLLOW
|
||||
# define __O_NOFOLLOW 0400000
|
||||
#endif
|
||||
#ifndef __O_CLOEXEC
|
||||
# define __O_CLOEXEC 02000000
|
||||
#endif
|
||||
#ifndef __O_DIRECT
|
||||
# define __O_DIRECT 040000
|
||||
#endif
|
||||
#ifndef __O_NOATIME
|
||||
# define __O_NOATIME 01000000
|
||||
#endif
|
||||
#ifndef __O_PATH
|
||||
# define __O_PATH 010000000
|
||||
#endif
|
||||
#ifndef __O_DSYNC
|
||||
# define __O_DSYNC 010000
|
||||
#endif
|
||||
#ifndef __O_TMPFILE
|
||||
# define __O_TMPFILE (020000000 | __O_DIRECTORY)
|
||||
#endif
|
||||
|
||||
#ifndef F_GETLK
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
# define F_GETLK 5 /* Get record locking info. */
|
||||
# define F_SETLK 6 /* Set record locking info (non-blocking). */
|
||||
# define F_SETLKW 7 /* Set record locking info (blocking). */
|
||||
# else
|
||||
# define F_GETLK F_GETLK64 /* Get record locking info. */
|
||||
# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/
|
||||
# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
|
||||
# endif
|
||||
#endif
|
||||
#ifndef F_GETLK64
|
||||
# define F_GETLK64 12 /* Get record locking info. */
|
||||
# define F_SETLK64 13 /* Set record locking info (non-blocking). */
|
||||
# define F_SETLKW64 14 /* Set record locking info (blocking). */
|
||||
#endif
|
||||
|
||||
/* open file description locks.
|
||||
|
||||
Usually record locks held by a process are released on *any* close and are
|
||||
not inherited across a fork.
|
||||
|
||||
These cmd values will set locks that conflict with process-associated record
|
||||
locks, but are "owned" by the opened file description, not the process.
|
||||
This means that they are inherited across fork or clone with CLONE_FILES
|
||||
like BSD (flock) locks, and they are only released automatically when the
|
||||
last reference to the the file description against which they were acquired
|
||||
is put. */
|
||||
#ifdef __USE_GNU
|
||||
# define F_OFD_GETLK 36
|
||||
# define F_OFD_SETLK 37
|
||||
# define F_OFD_SETLKW 38
|
||||
#endif
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
# define O_LARGEFILE __O_LARGEFILE
|
||||
#endif
|
||||
|
||||
#ifdef __USE_XOPEN2K8
|
||||
# define O_DIRECTORY __O_DIRECTORY /* Must be a directory. */
|
||||
# define O_NOFOLLOW __O_NOFOLLOW /* Do not follow links. */
|
||||
# define O_CLOEXEC __O_CLOEXEC /* Set close_on_exec. */
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
# define O_DIRECT __O_DIRECT /* Direct disk access. */
|
||||
# define O_NOATIME __O_NOATIME /* Do not set atime. */
|
||||
# define O_PATH __O_PATH /* Resolve pathname but do not open file. */
|
||||
# define O_TMPFILE __O_TMPFILE /* Atomically create nameless file. */
|
||||
#endif
|
||||
|
||||
/* For now, Linux has no separate synchronicity options for read
|
||||
operations. We define O_RSYNC therefore as the same as O_SYNC
|
||||
since this is a superset. */
|
||||
#if defined __USE_POSIX199309 || defined __USE_UNIX98
|
||||
# define O_DSYNC __O_DSYNC /* Synchronize data. */
|
||||
# if defined __O_RSYNC
|
||||
# define O_RSYNC __O_RSYNC /* Synchronize read operations. */
|
||||
# else
|
||||
# define O_RSYNC O_SYNC /* Synchronize read operations. */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Values for the second argument to `fcntl'. */
|
||||
#define F_DUPFD 0 /* Duplicate file descriptor. */
|
||||
#define F_GETFD 1 /* Get file descriptor flags. */
|
||||
#define F_SETFD 2 /* Set file descriptor flags. */
|
||||
#define F_GETFL 3 /* Get file status flags. */
|
||||
#define F_SETFL 4 /* Set file status flags. */
|
||||
|
||||
#ifndef __F_SETOWN
|
||||
# define __F_SETOWN 8
|
||||
# define __F_GETOWN 9
|
||||
#endif
|
||||
|
||||
#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
|
||||
# define F_SETOWN __F_SETOWN /* Get owner (process receiving SIGIO). */
|
||||
# define F_GETOWN __F_GETOWN /* Set owner (process receiving SIGIO). */
|
||||
#endif
|
||||
|
||||
#ifndef __F_SETSIG
|
||||
# define __F_SETSIG 10 /* Set number of signal to be sent. */
|
||||
# define __F_GETSIG 11 /* Get number of signal to be sent. */
|
||||
#endif
|
||||
#ifndef __F_SETOWN_EX
|
||||
# define __F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */
|
||||
# define __F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
# define F_SETSIG __F_SETSIG /* Set number of signal to be sent. */
|
||||
# define F_GETSIG __F_GETSIG /* Get number of signal to be sent. */
|
||||
# define F_SETOWN_EX __F_SETOWN_EX /* Get owner (thread receiving SIGIO). */
|
||||
# define F_GETOWN_EX __F_GETOWN_EX /* Set owner (thread receiving SIGIO). */
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
# define F_SETLEASE 1024 /* Set a lease. */
|
||||
# define F_GETLEASE 1025 /* Enquire what lease is active. */
|
||||
# define F_NOTIFY 1026 /* Request notifications on a directory. */
|
||||
# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
|
||||
# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */
|
||||
# define F_ADD_SEALS 1033 /* Add seals to file. */
|
||||
# define F_GET_SEALS 1034 /* Get seals for file. */
|
||||
/* Set / get write life time hints. */
|
||||
# define F_GET_RW_HINT 1035
|
||||
# define F_SET_RW_HINT 1036
|
||||
# define F_GET_FILE_RW_HINT 1037
|
||||
# define F_SET_FILE_RW_HINT 1038
|
||||
#endif
|
||||
#ifdef __USE_XOPEN2K8
|
||||
# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
|
||||
close-on-exit set. */
|
||||
#endif
|
||||
|
||||
/* For F_[GET|SET]FD. */
|
||||
#define FD_CLOEXEC 1 /* Actually anything with low bit set goes */
|
||||
|
||||
#ifndef F_RDLCK
|
||||
/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
|
||||
# define F_RDLCK 0 /* Read lock. */
|
||||
# define F_WRLCK 1 /* Write lock. */
|
||||
# define F_UNLCK 2 /* Remove lock. */
|
||||
#endif
|
||||
|
||||
|
||||
/* For old implementation of BSD flock. */
|
||||
#ifndef F_EXLCK
|
||||
# define F_EXLCK 4 /* or 3 */
|
||||
# define F_SHLCK 8 /* or 4 */
|
||||
#endif
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Operations for BSD flock, also used by the kernel implementation. */
|
||||
# define LOCK_SH 1 /* Shared lock. */
|
||||
# define LOCK_EX 2 /* Exclusive lock. */
|
||||
# define LOCK_NB 4 /* Or'd with one of the above to prevent
|
||||
blocking. */
|
||||
# define LOCK_UN 8 /* Remove lock. */
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
# define LOCK_MAND 32 /* This is a mandatory flock: */
|
||||
# define LOCK_READ 64 /* ... which allows concurrent read operations. */
|
||||
# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */
|
||||
# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Types of directory notifications that may be requested with F_NOTIFY. */
|
||||
# define DN_ACCESS 0x00000001 /* File accessed. */
|
||||
# define DN_MODIFY 0x00000002 /* File modified. */
|
||||
# define DN_CREATE 0x00000004 /* File created. */
|
||||
# define DN_DELETE 0x00000008 /* File removed. */
|
||||
# define DN_RENAME 0x00000010 /* File renamed. */
|
||||
# define DN_ATTRIB 0x00000020 /* File changed attributes. */
|
||||
# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Owner types. */
|
||||
enum __pid_type
|
||||
{
|
||||
F_OWNER_TID = 0, /* Kernel thread. */
|
||||
F_OWNER_PID, /* Process. */
|
||||
F_OWNER_PGRP, /* Process group. */
|
||||
F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */
|
||||
};
|
||||
|
||||
/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
|
||||
struct f_owner_ex
|
||||
{
|
||||
enum __pid_type type; /* Owner type of ID. */
|
||||
__pid_t pid; /* ID of owner. */
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Types of seals. */
|
||||
# define F_SEAL_SEAL 0x0001 /* Prevent further seals from being set. */
|
||||
# define F_SEAL_SHRINK 0x0002 /* Prevent file from shrinking. */
|
||||
# define F_SEAL_GROW 0x0004 /* Prevent file from growing. */
|
||||
# define F_SEAL_WRITE 0x0008 /* Prevent writes. */
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Hint values for F_{GET,SET}_RW_HINT. */
|
||||
# define RWF_WRITE_LIFE_NOT_SET 0
|
||||
# define RWH_WRITE_LIFE_NONE 1
|
||||
# define RWH_WRITE_LIFE_SHORT 2
|
||||
# define RWH_WRITE_LIFE_MEDIUM 3
|
||||
# define RWH_WRITE_LIFE_LONG 4
|
||||
# define RWH_WRITE_LIFE_EXTREME 5
|
||||
#endif
|
||||
|
||||
/* Define some more compatibility macros to be backward compatible with
|
||||
BSD systems which did not managed to hide these kernel macros. */
|
||||
#ifdef __USE_MISC
|
||||
# define FAPPEND O_APPEND
|
||||
# define FFSYNC O_FSYNC
|
||||
# define FASYNC O_ASYNC
|
||||
# define FNONBLOCK O_NONBLOCK
|
||||
# define FNDELAY O_NDELAY
|
||||
#endif /* Use misc. */
|
||||
|
||||
#ifndef __POSIX_FADV_DONTNEED
|
||||
# define __POSIX_FADV_DONTNEED 4
|
||||
# define __POSIX_FADV_NOREUSE 5
|
||||
#endif
|
||||
/* Advise to `posix_fadvise'. */
|
||||
#ifdef __USE_XOPEN2K
|
||||
# define POSIX_FADV_NORMAL 0 /* No further special treatment. */
|
||||
# define POSIX_FADV_RANDOM 1 /* Expect random page references. */
|
||||
# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
||||
# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
|
||||
# define POSIX_FADV_DONTNEED __POSIX_FADV_DONTNEED /* Don't need these pages. */
|
||||
# define POSIX_FADV_NOREUSE __POSIX_FADV_NOREUSE /* Data will be accessed once. */
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Flags for SYNC_FILE_RANGE. */
|
||||
# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
|
||||
in the range before performing the
|
||||
write. */
|
||||
# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those
|
||||
dirty pages in the range which are
|
||||
not presently under writeback. */
|
||||
# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
|
||||
the range after performing the
|
||||
write. */
|
||||
|
||||
/* Flags for SPLICE and VMSPLICE. */
|
||||
# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
|
||||
# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
|
||||
(but we may still block on the fd
|
||||
we splice from/to). */
|
||||
# define SPLICE_F_MORE 4 /* Expect more data. */
|
||||
# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
|
||||
|
||||
|
||||
/* Flags for fallocate. */
|
||||
# include <linux/falloc.h>
|
||||
|
||||
|
||||
/* File handle structure. */
|
||||
struct file_handle
|
||||
{
|
||||
unsigned int handle_bytes;
|
||||
int handle_type;
|
||||
/* File identifier. */
|
||||
unsigned char f_handle[0];
|
||||
};
|
||||
|
||||
/* Maximum handle size (for now). */
|
||||
# define MAX_HANDLE_SZ 128
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#ifdef __USE_GNU
|
||||
|
||||
/* Provide kernel hint to read ahead. */
|
||||
extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
|
||||
__THROW;
|
||||
|
||||
|
||||
/* Selective file content synch'ing.
|
||||
|
||||
This function is a possible cancellation point and therefore not
|
||||
marked with __THROW. */
|
||||
extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
|
||||
unsigned int __flags);
|
||||
|
||||
|
||||
/* Splice address range into a pipe.
|
||||
|
||||
This function is a possible cancellation point and therefore not
|
||||
marked with __THROW. */
|
||||
extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
|
||||
size_t __count, unsigned int __flags);
|
||||
|
||||
/* Splice two files together.
|
||||
|
||||
This function is a possible cancellation point and therefore not
|
||||
marked with __THROW. */
|
||||
extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
|
||||
__off64_t *__offout, size_t __len,
|
||||
unsigned int __flags);
|
||||
|
||||
/* In-kernel implementation of tee for pipe buffers.
|
||||
|
||||
This function is a possible cancellation point and therefore not
|
||||
marked with __THROW. */
|
||||
extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
|
||||
unsigned int __flags);
|
||||
|
||||
/* Reserve storage for the data of the file associated with FD.
|
||||
|
||||
This function is a possible cancellation point and therefore not
|
||||
marked with __THROW. */
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
|
||||
# else
|
||||
# ifdef __REDIRECT
|
||||
extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset,
|
||||
__off64_t __len),
|
||||
fallocate64);
|
||||
# else
|
||||
# define fallocate fallocate64
|
||||
# endif
|
||||
# endif
|
||||
# ifdef __USE_LARGEFILE64
|
||||
extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
|
||||
__off64_t __len);
|
||||
# endif
|
||||
|
||||
|
||||
/* Map file name to file handle. */
|
||||
extern int name_to_handle_at (int __dfd, const char *__name,
|
||||
struct file_handle *__handle, int *__mnt_id,
|
||||
int __flags) __THROW;
|
||||
|
||||
/* Open file using the file handle.
|
||||
|
||||
This function is a possible cancellation point and therefore not
|
||||
marked with __THROW. */
|
||||
extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
|
||||
int __flags);
|
||||
|
||||
#endif /* use GNU */
|
||||
|
||||
__END_DECLS
|
61
libc/glibc-include/bits/fcntl.h
Normal file
61
libc/glibc-include/bits/fcntl.h
Normal file
@ -0,0 +1,61 @@
|
||||
/* O_*, F_*, FD_* bit values for Linux/x86.
|
||||
Copyright (C) 2001-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FCNTL_H
|
||||
# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
|
||||
#endif
|
||||
|
||||
#ifdef __x86_64__
|
||||
# define __O_LARGEFILE 0
|
||||
#endif
|
||||
|
||||
#ifdef __x86_64__
|
||||
/* Not necessary, we always have 64-bit offsets. */
|
||||
# define F_GETLK64 5 /* Get record locking info. */
|
||||
# define F_SETLK64 6 /* Set record locking info (non-blocking). */
|
||||
# define F_SETLKW64 7 /* Set record locking info (blocking). */
|
||||
#endif
|
||||
|
||||
|
||||
struct flock
|
||||
{
|
||||
short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
|
||||
short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
__off_t l_start; /* Offset where the lock begins. */
|
||||
__off_t l_len; /* Size of the locked area; zero means until EOF. */
|
||||
#else
|
||||
__off64_t l_start; /* Offset where the lock begins. */
|
||||
__off64_t l_len; /* Size of the locked area; zero means until EOF. */
|
||||
#endif
|
||||
__pid_t l_pid; /* Process holding the lock. */
|
||||
};
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct flock64
|
||||
{
|
||||
short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
|
||||
short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
|
||||
__off64_t l_start; /* Offset where the lock begins. */
|
||||
__off64_t l_len; /* Size of the locked area; zero means until EOF. */
|
||||
__pid_t l_pid; /* Process holding the lock. */
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Include generic Linux declarations. */
|
||||
#include <bits/fcntl-linux.h>
|
172
libc/glibc-include/bits/fcntl2.h
Normal file
172
libc/glibc-include/bits/fcntl2.h
Normal file
@ -0,0 +1,172 @@
|
||||
/* Checking macros for fcntl functions.
|
||||
Copyright (C) 2007-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FCNTL_H
|
||||
# error "Never include <bits/fcntl2.h> directly; use <fcntl.h> instead."
|
||||
#endif
|
||||
|
||||
/* Check that calls to open and openat with O_CREAT or O_TMPFILE set have an
|
||||
appropriate third/fourth parameter. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int __open_2 (const char *__path, int __oflag) __nonnull ((1));
|
||||
extern int __REDIRECT (__open_alias, (const char *__path, int __oflag, ...),
|
||||
open) __nonnull ((1));
|
||||
#else
|
||||
extern int __REDIRECT (__open_2, (const char *__path, int __oflag),
|
||||
__open64_2) __nonnull ((1));
|
||||
extern int __REDIRECT (__open_alias, (const char *__path, int __oflag, ...),
|
||||
open64) __nonnull ((1));
|
||||
#endif
|
||||
__errordecl (__open_too_many_args,
|
||||
"open can be called either with 2 or 3 arguments, not more");
|
||||
__errordecl (__open_missing_mode,
|
||||
"open with O_CREAT or O_TMPFILE in second argument needs 3 arguments");
|
||||
|
||||
__fortify_function int
|
||||
open (const char *__path, int __oflag, ...)
|
||||
{
|
||||
if (__va_arg_pack_len () > 1)
|
||||
__open_too_many_args ();
|
||||
|
||||
if (__builtin_constant_p (__oflag))
|
||||
{
|
||||
if (__OPEN_NEEDS_MODE (__oflag) && __va_arg_pack_len () < 1)
|
||||
{
|
||||
__open_missing_mode ();
|
||||
return __open_2 (__path, __oflag);
|
||||
}
|
||||
return __open_alias (__path, __oflag, __va_arg_pack ());
|
||||
}
|
||||
|
||||
if (__va_arg_pack_len () < 1)
|
||||
return __open_2 (__path, __oflag);
|
||||
|
||||
return __open_alias (__path, __oflag, __va_arg_pack ());
|
||||
}
|
||||
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int __open64_2 (const char *__path, int __oflag) __nonnull ((1));
|
||||
extern int __REDIRECT (__open64_alias, (const char *__path, int __oflag,
|
||||
...), open64) __nonnull ((1));
|
||||
__errordecl (__open64_too_many_args,
|
||||
"open64 can be called either with 2 or 3 arguments, not more");
|
||||
__errordecl (__open64_missing_mode,
|
||||
"open64 with O_CREAT or O_TMPFILE in second argument needs 3 arguments");
|
||||
|
||||
__fortify_function int
|
||||
open64 (const char *__path, int __oflag, ...)
|
||||
{
|
||||
if (__va_arg_pack_len () > 1)
|
||||
__open64_too_many_args ();
|
||||
|
||||
if (__builtin_constant_p (__oflag))
|
||||
{
|
||||
if (__OPEN_NEEDS_MODE (__oflag) && __va_arg_pack_len () < 1)
|
||||
{
|
||||
__open64_missing_mode ();
|
||||
return __open64_2 (__path, __oflag);
|
||||
}
|
||||
return __open64_alias (__path, __oflag, __va_arg_pack ());
|
||||
}
|
||||
|
||||
if (__va_arg_pack_len () < 1)
|
||||
return __open64_2 (__path, __oflag);
|
||||
|
||||
return __open64_alias (__path, __oflag, __va_arg_pack ());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_ATFILE
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
extern int __openat_2 (int __fd, const char *__path, int __oflag)
|
||||
__nonnull ((2));
|
||||
extern int __REDIRECT (__openat_alias, (int __fd, const char *__path,
|
||||
int __oflag, ...), openat)
|
||||
__nonnull ((2));
|
||||
# else
|
||||
extern int __REDIRECT (__openat_2, (int __fd, const char *__path,
|
||||
int __oflag), __openat64_2)
|
||||
__nonnull ((2));
|
||||
extern int __REDIRECT (__openat_alias, (int __fd, const char *__path,
|
||||
int __oflag, ...), openat64)
|
||||
__nonnull ((2));
|
||||
# endif
|
||||
__errordecl (__openat_too_many_args,
|
||||
"openat can be called either with 3 or 4 arguments, not more");
|
||||
__errordecl (__openat_missing_mode,
|
||||
"openat with O_CREAT or O_TMPFILE in third argument needs 4 arguments");
|
||||
|
||||
__fortify_function int
|
||||
openat (int __fd, const char *__path, int __oflag, ...)
|
||||
{
|
||||
if (__va_arg_pack_len () > 1)
|
||||
__openat_too_many_args ();
|
||||
|
||||
if (__builtin_constant_p (__oflag))
|
||||
{
|
||||
if (__OPEN_NEEDS_MODE (__oflag) && __va_arg_pack_len () < 1)
|
||||
{
|
||||
__openat_missing_mode ();
|
||||
return __openat_2 (__fd, __path, __oflag);
|
||||
}
|
||||
return __openat_alias (__fd, __path, __oflag, __va_arg_pack ());
|
||||
}
|
||||
|
||||
if (__va_arg_pack_len () < 1)
|
||||
return __openat_2 (__fd, __path, __oflag);
|
||||
|
||||
return __openat_alias (__fd, __path, __oflag, __va_arg_pack ());
|
||||
}
|
||||
|
||||
|
||||
# ifdef __USE_LARGEFILE64
|
||||
extern int __openat64_2 (int __fd, const char *__path, int __oflag)
|
||||
__nonnull ((2));
|
||||
extern int __REDIRECT (__openat64_alias, (int __fd, const char *__path,
|
||||
int __oflag, ...), openat64)
|
||||
__nonnull ((2));
|
||||
__errordecl (__openat64_too_many_args,
|
||||
"openat64 can be called either with 3 or 4 arguments, not more");
|
||||
__errordecl (__openat64_missing_mode,
|
||||
"openat64 with O_CREAT or O_TMPFILE in third argument needs 4 arguments");
|
||||
|
||||
__fortify_function int
|
||||
openat64 (int __fd, const char *__path, int __oflag, ...)
|
||||
{
|
||||
if (__va_arg_pack_len () > 1)
|
||||
__openat64_too_many_args ();
|
||||
|
||||
if (__builtin_constant_p (__oflag))
|
||||
{
|
||||
if (__OPEN_NEEDS_MODE (__oflag) && __va_arg_pack_len () < 1)
|
||||
{
|
||||
__openat64_missing_mode ();
|
||||
return __openat64_2 (__fd, __path, __oflag);
|
||||
}
|
||||
return __openat64_alias (__fd, __path, __oflag, __va_arg_pack ());
|
||||
}
|
||||
|
||||
if (__va_arg_pack_len () < 1)
|
||||
return __openat64_2 (__fd, __path, __oflag);
|
||||
|
||||
return __openat64_alias (__fd, __path, __oflag, __va_arg_pack ());
|
||||
}
|
||||
# endif
|
||||
#endif
|
170
libc/glibc-include/bits/fenv.h
Normal file
170
libc/glibc-include/bits/fenv.h
Normal file
@ -0,0 +1,170 @@
|
||||
/* Copyright (C) 1997-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FENV_H
|
||||
# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
|
||||
#endif
|
||||
|
||||
/* Define bits representing the exception. We use the bit positions
|
||||
of the appropriate bits in the FPU control word. */
|
||||
enum
|
||||
{
|
||||
FE_INVALID =
|
||||
#define FE_INVALID 0x01
|
||||
FE_INVALID,
|
||||
__FE_DENORM = 0x02,
|
||||
FE_DIVBYZERO =
|
||||
#define FE_DIVBYZERO 0x04
|
||||
FE_DIVBYZERO,
|
||||
FE_OVERFLOW =
|
||||
#define FE_OVERFLOW 0x08
|
||||
FE_OVERFLOW,
|
||||
FE_UNDERFLOW =
|
||||
#define FE_UNDERFLOW 0x10
|
||||
FE_UNDERFLOW,
|
||||
FE_INEXACT =
|
||||
#define FE_INEXACT 0x20
|
||||
FE_INEXACT
|
||||
};
|
||||
|
||||
#define FE_ALL_EXCEPT \
|
||||
(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
|
||||
|
||||
/* The ix87 FPU supports all of the four defined rounding modes. We
|
||||
use again the bit positions in the FPU control word as the values
|
||||
for the appropriate macros. */
|
||||
enum
|
||||
{
|
||||
FE_TONEAREST =
|
||||
#define FE_TONEAREST 0
|
||||
FE_TONEAREST,
|
||||
FE_DOWNWARD =
|
||||
#define FE_DOWNWARD 0x400
|
||||
FE_DOWNWARD,
|
||||
FE_UPWARD =
|
||||
#define FE_UPWARD 0x800
|
||||
FE_UPWARD,
|
||||
FE_TOWARDZERO =
|
||||
#define FE_TOWARDZERO 0xc00
|
||||
FE_TOWARDZERO
|
||||
};
|
||||
|
||||
|
||||
/* Type representing exception flags. */
|
||||
typedef unsigned short int fexcept_t;
|
||||
|
||||
|
||||
/* Type representing floating-point environment. This structure
|
||||
corresponds to the layout of the block written by the `fstenv'
|
||||
instruction and has additional fields for the contents of the MXCSR
|
||||
register as written by the `stmxcsr' instruction. */
|
||||
typedef struct
|
||||
{
|
||||
unsigned short int __control_word;
|
||||
unsigned short int __glibc_reserved1;
|
||||
unsigned short int __status_word;
|
||||
unsigned short int __glibc_reserved2;
|
||||
unsigned short int __tags;
|
||||
unsigned short int __glibc_reserved3;
|
||||
unsigned int __eip;
|
||||
unsigned short int __cs_selector;
|
||||
unsigned int __opcode:11;
|
||||
unsigned int __glibc_reserved4:5;
|
||||
unsigned int __data_offset;
|
||||
unsigned short int __data_selector;
|
||||
unsigned short int __glibc_reserved5;
|
||||
#ifdef __x86_64__
|
||||
unsigned int __mxcsr;
|
||||
#endif
|
||||
}
|
||||
fenv_t;
|
||||
|
||||
/* If the default argument is used we use this value. */
|
||||
#define FE_DFL_ENV ((const fenv_t *) -1)
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Floating-point environment where none of the exception is masked. */
|
||||
# define FE_NOMASK_ENV ((const fenv_t *) -2)
|
||||
#endif
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT)
|
||||
/* Type representing floating-point control modes. */
|
||||
typedef struct
|
||||
{
|
||||
unsigned short int __control_word;
|
||||
unsigned short int __glibc_reserved;
|
||||
unsigned int __mxcsr;
|
||||
}
|
||||
femode_t;
|
||||
|
||||
/* Default floating-point control modes. */
|
||||
# define FE_DFL_MODE ((const femode_t *) -1L)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_EXTERN_INLINES
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Optimized versions. */
|
||||
#ifndef _LIBC
|
||||
extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept);
|
||||
#endif
|
||||
__extern_always_inline void
|
||||
__NTH (__feraiseexcept_invalid_divbyzero (int __excepts))
|
||||
{
|
||||
if ((FE_INVALID & __excepts) != 0)
|
||||
{
|
||||
/* One example of an invalid operation is 0.0 / 0.0. */
|
||||
float __f = 0.0;
|
||||
|
||||
# ifdef __SSE_MATH__
|
||||
__asm__ __volatile__ ("divss %0, %0 " : : "x" (__f));
|
||||
# else
|
||||
__asm__ __volatile__ ("fdiv %%st, %%st(0); fwait"
|
||||
: "=t" (__f) : "0" (__f));
|
||||
# endif
|
||||
(void) &__f;
|
||||
}
|
||||
if ((FE_DIVBYZERO & __excepts) != 0)
|
||||
{
|
||||
float __f = 1.0;
|
||||
float __g = 0.0;
|
||||
|
||||
# ifdef __SSE_MATH__
|
||||
__asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g));
|
||||
# else
|
||||
__asm__ __volatile__ ("fdivp %%st, %%st(1); fwait"
|
||||
: "=t" (__f) : "0" (__f), "u" (__g) : "st(1)");
|
||||
# endif
|
||||
(void) &__f;
|
||||
}
|
||||
}
|
||||
__extern_inline int
|
||||
__NTH (feraiseexcept (int __excepts))
|
||||
{
|
||||
if (__builtin_constant_p (__excepts)
|
||||
&& (__excepts & ~(FE_INVALID | FE_DIVBYZERO)) == 0)
|
||||
{
|
||||
__feraiseexcept_invalid_divbyzero (__excepts);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return __feraiseexcept_renamed (__excepts);
|
||||
}
|
||||
|
||||
__END_DECLS
|
||||
#endif
|
8
libc/glibc-include/bits/fenvinline.h
Normal file
8
libc/glibc-include/bits/fenvinline.h
Normal file
@ -0,0 +1,8 @@
|
||||
/* This file provides inline versions of floating-pint environment
|
||||
handling functions. If there were any. */
|
||||
|
||||
#ifndef __NO_MATH_INLINES
|
||||
|
||||
/* Here is where the code would go. */
|
||||
|
||||
#endif
|
329
libc/glibc-include/bits/floatn-common.h
Normal file
329
libc/glibc-include/bits/floatn-common.h
Normal file
@ -0,0 +1,329 @@
|
||||
/* Macros to control TS 18661-3 glibc features where the same
|
||||
definitions are appropriate for all platforms.
|
||||
Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BITS_FLOATN_COMMON_H
|
||||
#define _BITS_FLOATN_COMMON_H
|
||||
|
||||
#include <features.h>
|
||||
#include <bits/long-double.h>
|
||||
|
||||
/* This header should be included at the bottom of each bits/floatn.h.
|
||||
It defines the following macros for each _FloatN and _FloatNx type,
|
||||
where the same definitions, or definitions based only on the macros
|
||||
in bits/floatn.h, are appropriate for all glibc configurations. */
|
||||
|
||||
/* Defined to 1 if the current compiler invocation provides a
|
||||
floating-point type with the right format for this type, and this
|
||||
glibc includes corresponding *fN or *fNx interfaces for it. */
|
||||
#define __HAVE_FLOAT16 0
|
||||
#define __HAVE_FLOAT32 1
|
||||
#define __HAVE_FLOAT64 1
|
||||
#define __HAVE_FLOAT32X 1
|
||||
#define __HAVE_FLOAT128X 0
|
||||
|
||||
/* Defined to 1 if the corresponding __HAVE_<type> macro is 1 and the
|
||||
type is the first with its format in the sequence of (the default
|
||||
choices for) float, double, long double, _Float16, _Float32,
|
||||
_Float64, _Float128, _Float32x, _Float64x, _Float128x for this
|
||||
glibc; that is, if functions present once per floating-point format
|
||||
rather than once per type are present for this type.
|
||||
|
||||
All configurations supported by glibc have _Float32 the same format
|
||||
as float, _Float64 and _Float32x the same format as double, the
|
||||
_Float64x the same format as either long double or _Float128. No
|
||||
configurations support _Float128x or, as of GCC 7, have compiler
|
||||
support for a type meeting the requirements for _Float128x. */
|
||||
#define __HAVE_DISTINCT_FLOAT16 __HAVE_FLOAT16
|
||||
#define __HAVE_DISTINCT_FLOAT32 0
|
||||
#define __HAVE_DISTINCT_FLOAT64 0
|
||||
#define __HAVE_DISTINCT_FLOAT32X 0
|
||||
#define __HAVE_DISTINCT_FLOAT64X 0
|
||||
#define __HAVE_DISTINCT_FLOAT128X __HAVE_FLOAT128X
|
||||
|
||||
/* Defined to 1 if the corresponding _FloatN type is not binary compatible
|
||||
with the corresponding ISO C type in the current compilation unit as
|
||||
opposed to __HAVE_DISTINCT_FLOATN, which indicates the default types built
|
||||
in glibc. */
|
||||
#define __HAVE_FLOAT128_UNLIKE_LDBL (__HAVE_DISTINCT_FLOAT128 \
|
||||
&& __LDBL_MANT_DIG__ != 113)
|
||||
|
||||
/* Defined to 1 if any _FloatN or _FloatNx types that are not
|
||||
ABI-distinct are however distinct types at the C language level (so
|
||||
for the purposes of __builtin_types_compatible_p and _Generic). */
|
||||
#if __GNUC_PREREQ (7, 0) && !defined __cplusplus
|
||||
# define __HAVE_FLOATN_NOT_TYPEDEF 1
|
||||
#else
|
||||
# define __HAVE_FLOATN_NOT_TYPEDEF 0
|
||||
#endif
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
/* Defined to concatenate the literal suffix to be used with _FloatN
|
||||
or _FloatNx types, if __HAVE_<type> is 1. The corresponding
|
||||
literal suffixes exist since GCC 7, for C only. */
|
||||
# if __HAVE_FLOAT16
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
/* No corresponding suffix available for this type. */
|
||||
# define __f16(x) ((_Float16) x##f)
|
||||
# else
|
||||
# define __f16(x) x##f16
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if __HAVE_FLOAT32
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
# define __f32(x) x##f
|
||||
# else
|
||||
# define __f32(x) x##f32
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if __HAVE_FLOAT64
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
# ifdef __NO_LONG_DOUBLE_MATH
|
||||
# define __f64(x) x##l
|
||||
# else
|
||||
# define __f64(x) x
|
||||
# endif
|
||||
# else
|
||||
# define __f64(x) x##f64
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if __HAVE_FLOAT32X
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
# define __f32x(x) x
|
||||
# else
|
||||
# define __f32x(x) x##f32x
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if __HAVE_FLOAT64X
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
# if __HAVE_FLOAT64X_LONG_DOUBLE
|
||||
# define __f64x(x) x##l
|
||||
# else
|
||||
# define __f64x(x) __f128 (x)
|
||||
# endif
|
||||
# else
|
||||
# define __f64x(x) x##f64x
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if __HAVE_FLOAT128X
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
# error "_Float128X supported but no constant suffix"
|
||||
# else
|
||||
# define __f128x(x) x##f128x
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* Defined to a complex type if __HAVE_<type> is 1. */
|
||||
# if __HAVE_FLOAT16
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
|
||||
# define __CFLOAT16 __cfloat16
|
||||
# else
|
||||
# define __CFLOAT16 _Complex _Float16
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if __HAVE_FLOAT32
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
# define __CFLOAT32 _Complex float
|
||||
# else
|
||||
# define __CFLOAT32 _Complex _Float32
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if __HAVE_FLOAT64
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
# ifdef __NO_LONG_DOUBLE_MATH
|
||||
# define __CFLOAT64 _Complex long double
|
||||
# else
|
||||
# define __CFLOAT64 _Complex double
|
||||
# endif
|
||||
# else
|
||||
# define __CFLOAT64 _Complex _Float64
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if __HAVE_FLOAT32X
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
# define __CFLOAT32X _Complex double
|
||||
# else
|
||||
# define __CFLOAT32X _Complex _Float32x
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if __HAVE_FLOAT64X
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
# if __HAVE_FLOAT64X_LONG_DOUBLE
|
||||
# define __CFLOAT64X _Complex long double
|
||||
# else
|
||||
# define __CFLOAT64X __CFLOAT128
|
||||
# endif
|
||||
# else
|
||||
# define __CFLOAT64X _Complex _Float64x
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if __HAVE_FLOAT128X
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
# error "_Float128X supported but no complex type"
|
||||
# else
|
||||
# define __CFLOAT128X _Complex _Float128x
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* The remaining of this file provides support for older compilers. */
|
||||
# if __HAVE_FLOAT16
|
||||
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
typedef float _Float16 __attribute__ ((__mode__ (__HF__)));
|
||||
# endif
|
||||
|
||||
# if !__GNUC_PREREQ (7, 0)
|
||||
# define __builtin_huge_valf16() ((_Float16) __builtin_huge_val ())
|
||||
# define __builtin_inff16() ((_Float16) __builtin_inf ())
|
||||
# define __builtin_nanf16(x) ((_Float16) __builtin_nan (x))
|
||||
# define __builtin_nansf16(x) ((_Float16) __builtin_nans (x))
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
# if __HAVE_FLOAT32
|
||||
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
typedef float _Float32;
|
||||
# endif
|
||||
|
||||
# if !__GNUC_PREREQ (7, 0)
|
||||
# define __builtin_huge_valf32() (__builtin_huge_valf ())
|
||||
# define __builtin_inff32() (__builtin_inff ())
|
||||
# define __builtin_nanf32(x) (__builtin_nanf (x))
|
||||
# define __builtin_nansf32(x) (__builtin_nansf (x))
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
# if __HAVE_FLOAT64
|
||||
|
||||
/* If double, long double and _Float64 all have the same set of
|
||||
values, TS 18661-3 requires the usual arithmetic conversions on
|
||||
long double and _Float64 to produce _Float64. For this to be the
|
||||
case when building with a compiler without a distinct _Float64
|
||||
type, _Float64 must be a typedef for long double, not for
|
||||
double. */
|
||||
|
||||
# ifdef __NO_LONG_DOUBLE_MATH
|
||||
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
typedef long double _Float64;
|
||||
# endif
|
||||
|
||||
# if !__GNUC_PREREQ (7, 0)
|
||||
# define __builtin_huge_valf64() (__builtin_huge_vall ())
|
||||
# define __builtin_inff64() (__builtin_infl ())
|
||||
# define __builtin_nanf64(x) (__builtin_nanl (x))
|
||||
# define __builtin_nansf64(x) (__builtin_nansl (x))
|
||||
# endif
|
||||
|
||||
# else
|
||||
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
typedef double _Float64;
|
||||
# endif
|
||||
|
||||
# if !__GNUC_PREREQ (7, 0)
|
||||
# define __builtin_huge_valf64() (__builtin_huge_val ())
|
||||
# define __builtin_inff64() (__builtin_inf ())
|
||||
# define __builtin_nanf64(x) (__builtin_nan (x))
|
||||
# define __builtin_nansf64(x) (__builtin_nans (x))
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
# if __HAVE_FLOAT32X
|
||||
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
typedef double _Float32x;
|
||||
# endif
|
||||
|
||||
# if !__GNUC_PREREQ (7, 0)
|
||||
# define __builtin_huge_valf32x() (__builtin_huge_val ())
|
||||
# define __builtin_inff32x() (__builtin_inf ())
|
||||
# define __builtin_nanf32x(x) (__builtin_nan (x))
|
||||
# define __builtin_nansf32x(x) (__builtin_nans (x))
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
# if __HAVE_FLOAT64X
|
||||
|
||||
# if __HAVE_FLOAT64X_LONG_DOUBLE
|
||||
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
typedef long double _Float64x;
|
||||
# endif
|
||||
|
||||
# if !__GNUC_PREREQ (7, 0)
|
||||
# define __builtin_huge_valf64x() (__builtin_huge_vall ())
|
||||
# define __builtin_inff64x() (__builtin_infl ())
|
||||
# define __builtin_nanf64x(x) (__builtin_nanl (x))
|
||||
# define __builtin_nansf64x(x) (__builtin_nansl (x))
|
||||
# endif
|
||||
|
||||
# else
|
||||
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
typedef _Float128 _Float64x;
|
||||
# endif
|
||||
|
||||
# if !__GNUC_PREREQ (7, 0)
|
||||
# define __builtin_huge_valf64x() (__builtin_huge_valf128 ())
|
||||
# define __builtin_inff64x() (__builtin_inff128 ())
|
||||
# define __builtin_nanf64x(x) (__builtin_nanf128 (x))
|
||||
# define __builtin_nansf64x(x) (__builtin_nansf128 (x))
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
# if __HAVE_FLOAT128X
|
||||
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
# error "_Float128x supported but no type"
|
||||
# endif
|
||||
|
||||
# if !__GNUC_PREREQ (7, 0)
|
||||
# define __builtin_huge_valf128x() ((_Float128x) __builtin_huge_val ())
|
||||
# define __builtin_inff128x() ((_Float128x) __builtin_inf ())
|
||||
# define __builtin_nanf128x(x) ((_Float128x) __builtin_nan (x))
|
||||
# define __builtin_nansf128x(x) ((_Float128x) __builtin_nans (x))
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
#endif /* !__ASSEMBLER__. */
|
||||
|
||||
#endif /* _BITS_FLOATN_COMMON_H */
|
121
libc/glibc-include/bits/floatn.h
Normal file
121
libc/glibc-include/bits/floatn.h
Normal file
@ -0,0 +1,121 @@
|
||||
/* Macros to control TS 18661-3 glibc features on x86.
|
||||
Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BITS_FLOATN_H
|
||||
#define _BITS_FLOATN_H
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Defined to 1 if the current compiler invocation provides a
|
||||
floating-point type with the IEEE 754 binary128 format, and this
|
||||
glibc includes corresponding *f128 interfaces for it. The required
|
||||
libgcc support was added some time after the basic compiler
|
||||
support, for x86_64 and x86. */
|
||||
#if (defined __x86_64__ \
|
||||
? __GNUC_PREREQ (4, 3) \
|
||||
: (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4)))
|
||||
# define __HAVE_FLOAT128 1
|
||||
#else
|
||||
# define __HAVE_FLOAT128 0
|
||||
#endif
|
||||
|
||||
/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
|
||||
from the default float, double and long double types in this glibc. */
|
||||
#if __HAVE_FLOAT128
|
||||
# define __HAVE_DISTINCT_FLOAT128 1
|
||||
#else
|
||||
# define __HAVE_DISTINCT_FLOAT128 0
|
||||
#endif
|
||||
|
||||
/* Defined to 1 if the current compiler invocation provides a
|
||||
floating-point type with the right format for _Float64x, and this
|
||||
glibc includes corresponding *f64x interfaces for it. */
|
||||
#define __HAVE_FLOAT64X 1
|
||||
|
||||
/* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format
|
||||
of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has
|
||||
the format of _Float128, which must be different from that of long
|
||||
double. */
|
||||
#define __HAVE_FLOAT64X_LONG_DOUBLE 1
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
/* Defined to concatenate the literal suffix to be used with _Float128
|
||||
types, if __HAVE_FLOAT128 is 1. */
|
||||
# if __HAVE_FLOAT128
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
/* The literal suffix f128 exists only since GCC 7.0. */
|
||||
# define __f128(x) x##q
|
||||
# else
|
||||
# define __f128(x) x##f128
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */
|
||||
# if __HAVE_FLOAT128
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
/* Add a typedef for older GCC compilers which don't natively support
|
||||
_Complex _Float128. */
|
||||
typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
|
||||
# define __CFLOAT128 __cfloat128
|
||||
# else
|
||||
# define __CFLOAT128 _Complex _Float128
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* The remaining of this file provides support for older compilers. */
|
||||
# if __HAVE_FLOAT128
|
||||
|
||||
/* The type _Float128 exists only since GCC 7.0. */
|
||||
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
|
||||
typedef __float128 _Float128;
|
||||
# endif
|
||||
|
||||
/* __builtin_huge_valf128 doesn't exist before GCC 7.0. */
|
||||
# if !__GNUC_PREREQ (7, 0)
|
||||
# define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ())
|
||||
# endif
|
||||
|
||||
/* Older GCC has only a subset of built-in functions for _Float128 on
|
||||
x86, and __builtin_infq is not usable in static initializers.
|
||||
Converting a narrower sNaN to _Float128 produces a quiet NaN, so
|
||||
attempts to use _Float128 sNaNs will not work properly with older
|
||||
compilers. */
|
||||
# if !__GNUC_PREREQ (7, 0)
|
||||
# define __builtin_copysignf128 __builtin_copysignq
|
||||
# define __builtin_fabsf128 __builtin_fabsq
|
||||
# define __builtin_inff128() ((_Float128) __builtin_inf ())
|
||||
# define __builtin_nanf128(x) ((_Float128) __builtin_nan (x))
|
||||
# define __builtin_nansf128(x) ((_Float128) __builtin_nans (x))
|
||||
# endif
|
||||
|
||||
/* In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*,
|
||||
e.g.: __builtin_signbitf128, before GCC 6. However, there has never
|
||||
been a __builtin_signbitf128 in GCC and the type-generic builtin is
|
||||
only available since GCC 6. */
|
||||
# if !__GNUC_PREREQ (6, 0)
|
||||
# define __builtin_signbitf128 __signbitf128
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
#endif /* !__ASSEMBLER__. */
|
||||
|
||||
#include <bits/floatn-common.h>
|
||||
|
||||
#endif /* _BITS_FLOATN_H */
|
33
libc/glibc-include/bits/flt-eval-method.h
Normal file
33
libc/glibc-include/bits/flt-eval-method.h
Normal file
@ -0,0 +1,33 @@
|
||||
/* Define __GLIBC_FLT_EVAL_METHOD. x86 version.
|
||||
Copyright (C) 2016-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _MATH_H
|
||||
# error "Never use <bits/flt-eval-method.h> directly; include <math.h> instead."
|
||||
#endif
|
||||
|
||||
#ifdef __FLT_EVAL_METHOD__
|
||||
# if __FLT_EVAL_METHOD__ == -1
|
||||
# define __GLIBC_FLT_EVAL_METHOD 2
|
||||
# else
|
||||
# define __GLIBC_FLT_EVAL_METHOD __FLT_EVAL_METHOD__
|
||||
# endif
|
||||
#elif defined __x86_64__
|
||||
# define __GLIBC_FLT_EVAL_METHOD 0
|
||||
#else
|
||||
# define __GLIBC_FLT_EVAL_METHOD 2
|
||||
#endif
|
39
libc/glibc-include/bits/fp-fast.h
Normal file
39
libc/glibc-include/bits/fp-fast.h
Normal file
@ -0,0 +1,39 @@
|
||||
/* Define FP_FAST_* macros.
|
||||
Copyright (C) 2016-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _MATH_H
|
||||
# error "Never use <bits/fp-fast.h> directly; include <math.h> instead."
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ISOC99
|
||||
|
||||
/* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l}
|
||||
builtins are supported. */
|
||||
# ifdef __FP_FAST_FMA
|
||||
# define FP_FAST_FMA 1
|
||||
# endif
|
||||
|
||||
# ifdef __FP_FAST_FMAF
|
||||
# define FP_FAST_FMAF 1
|
||||
# endif
|
||||
|
||||
# ifdef __FP_FAST_FMAL
|
||||
# define FP_FAST_FMAL 1
|
||||
# endif
|
||||
|
||||
#endif
|
24
libc/glibc-include/bits/fp-logb.h
Normal file
24
libc/glibc-include/bits/fp-logb.h
Normal file
@ -0,0 +1,24 @@
|
||||
/* Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. x86 version.
|
||||
Copyright (C) 2016-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _MATH_H
|
||||
# error "Never use <bits/fp-logb.h> directly; include <math.h> instead."
|
||||
#endif
|
||||
|
||||
#define __FP_LOGB0_IS_MIN 1
|
||||
#define __FP_LOGBNAN_IS_MIN 1
|
96
libc/glibc-include/bits/getopt_core.h
Normal file
96
libc/glibc-include/bits/getopt_core.h
Normal file
@ -0,0 +1,96 @@
|
||||
/* Declarations for getopt (basic, portable features only).
|
||||
Copyright (C) 1989-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library and is also part of gnulib.
|
||||
Patches to this file should be submitted to both projects.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GETOPT_CORE_H
|
||||
#define _GETOPT_CORE_H 1
|
||||
|
||||
/* This header should not be used directly; include getopt.h or
|
||||
unistd.h instead. Unlike most bits headers, it does not have
|
||||
a protective #error, because the guard macro for getopt.h in
|
||||
gnulib is not fixed. */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* For communication from 'getopt' to the caller.
|
||||
When 'getopt' finds an option that takes an argument,
|
||||
the argument value is returned here.
|
||||
Also, when 'ordering' is RETURN_IN_ORDER,
|
||||
each non-option ARGV-element is returned here. */
|
||||
|
||||
extern char *optarg;
|
||||
|
||||
/* Index in ARGV of the next element to be scanned.
|
||||
This is used for communication to and from the caller
|
||||
and for communication between successive calls to 'getopt'.
|
||||
|
||||
On entry to 'getopt', zero means this is the first call; initialize.
|
||||
|
||||
When 'getopt' returns -1, this is the index of the first of the
|
||||
non-option elements that the caller should itself scan.
|
||||
|
||||
Otherwise, 'optind' communicates from one call to the next
|
||||
how much of ARGV has been scanned so far. */
|
||||
|
||||
extern int optind;
|
||||
|
||||
/* Callers store zero here to inhibit the error message 'getopt' prints
|
||||
for unrecognized options. */
|
||||
|
||||
extern int opterr;
|
||||
|
||||
/* Set to an option character which was unrecognized. */
|
||||
|
||||
extern int optopt;
|
||||
|
||||
/* Get definitions and prototypes for functions to process the
|
||||
arguments in ARGV (ARGC of them, minus the program name) for
|
||||
options given in OPTS.
|
||||
|
||||
Return the option character from OPTS just read. Return -1 when
|
||||
there are no more options. For unrecognized options, or options
|
||||
missing arguments, 'optopt' is set to the option letter, and '?' is
|
||||
returned.
|
||||
|
||||
The OPTS string is a list of characters which are recognized option
|
||||
letters, optionally followed by colons, specifying that that letter
|
||||
takes an argument, to be placed in 'optarg'.
|
||||
|
||||
If a letter in OPTS is followed by two colons, its argument is
|
||||
optional. This behavior is specific to the GNU 'getopt'.
|
||||
|
||||
The argument '--' causes premature termination of argument
|
||||
scanning, explicitly telling 'getopt' that there are no more
|
||||
options.
|
||||
|
||||
If OPTS begins with '-', then non-option arguments are treated as
|
||||
arguments to the option '\1'. This behavior is specific to the GNU
|
||||
'getopt'. If OPTS begins with '+', or POSIXLY_CORRECT is set in
|
||||
the environment, then do not permute arguments.
|
||||
|
||||
For standards compliance, the 'argv' argument has the type
|
||||
char *const *, but this is inaccurate; if argument permutation is
|
||||
enabled, the argv array (not the strings it points to) must be
|
||||
writable. */
|
||||
|
||||
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
|
||||
__THROW __nonnull ((2, 3));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* getopt_core.h */
|
77
libc/glibc-include/bits/getopt_ext.h
Normal file
77
libc/glibc-include/bits/getopt_ext.h
Normal file
@ -0,0 +1,77 @@
|
||||
/* Declarations for getopt (GNU extensions).
|
||||
Copyright (C) 1989-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library and is also part of gnulib.
|
||||
Patches to this file should be submitted to both projects.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GETOPT_EXT_H
|
||||
#define _GETOPT_EXT_H 1
|
||||
|
||||
/* This header should not be used directly; include getopt.h instead.
|
||||
Unlike most bits headers, it does not have a protective #error,
|
||||
because the guard macro for getopt.h in gnulib is not fixed. */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Describe the long-named options requested by the application.
|
||||
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
|
||||
of 'struct option' terminated by an element containing a name which is
|
||||
zero.
|
||||
|
||||
The field 'has_arg' is:
|
||||
no_argument (or 0) if the option does not take an argument,
|
||||
required_argument (or 1) if the option requires an argument,
|
||||
optional_argument (or 2) if the option takes an optional argument.
|
||||
|
||||
If the field 'flag' is not NULL, it points to a variable that is set
|
||||
to the value given in the field 'val' when the option is found, but
|
||||
left unchanged if the option is not found.
|
||||
|
||||
To have a long-named option do something other than set an 'int' to
|
||||
a compiled-in constant, such as set a value from 'optarg', set the
|
||||
option's 'flag' field to zero and its 'val' field to a nonzero
|
||||
value (the equivalent single-letter option character, if there is
|
||||
one). For long options that have a zero 'flag' field, 'getopt'
|
||||
returns the contents of the 'val' field. */
|
||||
|
||||
struct option
|
||||
{
|
||||
const char *name;
|
||||
/* has_arg can't be an enum because some compilers complain about
|
||||
type mismatches in all the code that assumes it is an int. */
|
||||
int has_arg;
|
||||
int *flag;
|
||||
int val;
|
||||
};
|
||||
|
||||
/* Names for the values of the 'has_arg' field of 'struct option'. */
|
||||
|
||||
#define no_argument 0
|
||||
#define required_argument 1
|
||||
#define optional_argument 2
|
||||
|
||||
extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
|
||||
const char *__shortopts,
|
||||
const struct option *__longopts, int *__longind)
|
||||
__THROW __nonnull ((2, 3));
|
||||
extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
|
||||
const char *__shortopts,
|
||||
const struct option *__longopts, int *__longind)
|
||||
__THROW __nonnull ((2, 3));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* getopt_ext.h */
|
51
libc/glibc-include/bits/getopt_posix.h
Normal file
51
libc/glibc-include/bits/getopt_posix.h
Normal file
@ -0,0 +1,51 @@
|
||||
/* Declarations for getopt (POSIX compatibility shim).
|
||||
Copyright (C) 1989-2019 Free Software Foundation, Inc.
|
||||
Unlike the bulk of the getopt implementation, this file is NOT part
|
||||
of gnulib.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GETOPT_POSIX_H
|
||||
#define _GETOPT_POSIX_H 1
|
||||
|
||||
#if !defined _UNISTD_H && !defined _STDIO_H
|
||||
#error "Never include getopt_posix.h directly; use unistd.h instead."
|
||||
#endif
|
||||
|
||||
#include <bits/getopt_core.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#if defined __USE_POSIX2 && !defined __USE_POSIX_IMPLICITLY \
|
||||
&& !defined __USE_GNU && !defined _GETOPT_H
|
||||
/* GNU getopt has more functionality than POSIX getopt. When we are
|
||||
explicitly conforming to POSIX and not GNU, and getopt.h (which is
|
||||
not part of POSIX) has not been included, the extra functionality
|
||||
is disabled. */
|
||||
# ifdef __REDIRECT
|
||||
extern int __REDIRECT_NTH (getopt, (int ___argc, char *const *___argv,
|
||||
const char *__shortopts),
|
||||
__posix_getopt);
|
||||
# else
|
||||
extern int __posix_getopt (int ___argc, char *const *___argv,
|
||||
const char *__shortopts)
|
||||
__THROW __nonnull ((2, 3));
|
||||
# define getopt __posix_getopt
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* getopt_posix.h */
|
23
libc/glibc-include/bits/hwcap.h
Normal file
23
libc/glibc-include/bits/hwcap.h
Normal file
@ -0,0 +1,23 @@
|
||||
/* Defines for bits in AT_HWCAP.
|
||||
Copyright (C) 2012-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_AUXV_H
|
||||
# error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead."
|
||||
#endif
|
||||
|
||||
/* No bits defined for this architecture. */
|
258
libc/glibc-include/bits/in.h
Normal file
258
libc/glibc-include/bits/in.h
Normal file
@ -0,0 +1,258 @@
|
||||
/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Linux version. */
|
||||
|
||||
#ifndef _NETINET_IN_H
|
||||
# error "Never use <bits/in.h> directly; include <netinet/in.h> instead."
|
||||
#endif
|
||||
|
||||
/* If the application has already included linux/in6.h from a linux-based
|
||||
kernel then we will not define the IPv6 IPPROTO_* defines, in6_addr (nor the
|
||||
defines), sockaddr_in6, or ipv6_mreq. Same for in6_ptkinfo or ip6_mtuinfo
|
||||
in linux/ipv6.h. The ABI used by the linux-kernel and glibc match exactly.
|
||||
Neither the linux kernel nor glibc should break this ABI without coordination.
|
||||
In upstream kernel 56c176c9 the _UAPI prefix was stripped so we need to check
|
||||
for _LINUX_IN6_H and _IPV6_H now, and keep checking the old versions for
|
||||
maximum backwards compatibility. */
|
||||
#if defined _UAPI_LINUX_IN6_H \
|
||||
|| defined _UAPI_IPV6_H \
|
||||
|| defined _LINUX_IN6_H \
|
||||
|| defined _IPV6_H
|
||||
/* This is not quite the same API since the kernel always defines s6_addr16 and
|
||||
s6_addr32. This is not a violation of POSIX since POSIX says "at least the
|
||||
following member" and that holds true. */
|
||||
# define __USE_KERNEL_IPV6_DEFS 1
|
||||
#else
|
||||
# define __USE_KERNEL_IPV6_DEFS 0
|
||||
#endif
|
||||
|
||||
/* Options for use with `getsockopt' and `setsockopt' at the IP level.
|
||||
The first word in the comment at the right is the data type used;
|
||||
"bool" means a boolean value stored in an `int'. */
|
||||
#define IP_OPTIONS 4 /* ip_opts; IP per-packet options. */
|
||||
#define IP_HDRINCL 3 /* int; Header is included with data. */
|
||||
#define IP_TOS 1 /* int; IP type of service and precedence. */
|
||||
#define IP_TTL 2 /* int; IP time to live. */
|
||||
#define IP_RECVOPTS 6 /* bool; Receive all IP options w/datagram. */
|
||||
/* For BSD compatibility. */
|
||||
#define IP_RECVRETOPTS IP_RETOPTS /* bool; Receive IP options for response. */
|
||||
#define IP_RETOPTS 7 /* ip_opts; Set/get IP per-packet options. */
|
||||
#define IP_MULTICAST_IF 32 /* in_addr; set/get IP multicast i/f */
|
||||
#define IP_MULTICAST_TTL 33 /* unsigned char; set/get IP multicast ttl */
|
||||
#define IP_MULTICAST_LOOP 34 /* bool; set/get IP multicast loopback */
|
||||
#define IP_ADD_MEMBERSHIP 35 /* ip_mreq; add an IP group membership */
|
||||
#define IP_DROP_MEMBERSHIP 36 /* ip_mreq; drop an IP group membership */
|
||||
#define IP_UNBLOCK_SOURCE 37 /* ip_mreq_source: unblock data from source */
|
||||
#define IP_BLOCK_SOURCE 38 /* ip_mreq_source: block data from source */
|
||||
#define IP_ADD_SOURCE_MEMBERSHIP 39 /* ip_mreq_source: join source group */
|
||||
#define IP_DROP_SOURCE_MEMBERSHIP 40 /* ip_mreq_source: leave source group */
|
||||
#define IP_MSFILTER 41
|
||||
#ifdef __USE_MISC
|
||||
# define MCAST_JOIN_GROUP 42 /* group_req: join any-source group */
|
||||
# define MCAST_BLOCK_SOURCE 43 /* group_source_req: block from given group */
|
||||
# define MCAST_UNBLOCK_SOURCE 44 /* group_source_req: unblock from given group*/
|
||||
# define MCAST_LEAVE_GROUP 45 /* group_req: leave any-source group */
|
||||
# define MCAST_JOIN_SOURCE_GROUP 46 /* group_source_req: join source-spec gr */
|
||||
# define MCAST_LEAVE_SOURCE_GROUP 47 /* group_source_req: leave source-spec gr*/
|
||||
# define MCAST_MSFILTER 48
|
||||
# define IP_MULTICAST_ALL 49
|
||||
# define IP_UNICAST_IF 50
|
||||
|
||||
# define MCAST_EXCLUDE 0
|
||||
# define MCAST_INCLUDE 1
|
||||
#endif
|
||||
|
||||
#define IP_ROUTER_ALERT 5 /* bool */
|
||||
#define IP_PKTINFO 8 /* bool */
|
||||
#define IP_PKTOPTIONS 9
|
||||
#define IP_PMTUDISC 10 /* obsolete name? */
|
||||
#define IP_MTU_DISCOVER 10 /* int; see below */
|
||||
#define IP_RECVERR 11 /* bool */
|
||||
#define IP_RECVTTL 12 /* bool */
|
||||
#define IP_RECVTOS 13 /* bool */
|
||||
#define IP_MTU 14 /* int */
|
||||
#define IP_FREEBIND 15
|
||||
#define IP_IPSEC_POLICY 16
|
||||
#define IP_XFRM_POLICY 17
|
||||
#define IP_PASSSEC 18
|
||||
#define IP_TRANSPARENT 19
|
||||
#define IP_MULTICAST_ALL 49 /* bool */
|
||||
|
||||
/* TProxy original addresses */
|
||||
#define IP_ORIGDSTADDR 20
|
||||
#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
|
||||
|
||||
#define IP_MINTTL 21
|
||||
#define IP_NODEFRAG 22
|
||||
#define IP_CHECKSUM 23
|
||||
#define IP_BIND_ADDRESS_NO_PORT 24
|
||||
#define IP_RECVFRAGSIZE 25
|
||||
|
||||
/* IP_MTU_DISCOVER arguments. */
|
||||
#define IP_PMTUDISC_DONT 0 /* Never send DF frames. */
|
||||
#define IP_PMTUDISC_WANT 1 /* Use per route hints. */
|
||||
#define IP_PMTUDISC_DO 2 /* Always DF. */
|
||||
#define IP_PMTUDISC_PROBE 3 /* Ignore dst pmtu. */
|
||||
/* Always use interface mtu (ignores dst pmtu) but don't set DF flag.
|
||||
Also incoming ICMP frag_needed notifications will be ignored on
|
||||
this socket to prevent accepting spoofed ones. */
|
||||
#define IP_PMTUDISC_INTERFACE 4
|
||||
/* Like IP_PMTUDISC_INTERFACE but allow packets to be fragmented. */
|
||||
#define IP_PMTUDISC_OMIT 5
|
||||
|
||||
#define IP_MULTICAST_IF 32
|
||||
#define IP_MULTICAST_TTL 33
|
||||
#define IP_MULTICAST_LOOP 34
|
||||
#define IP_ADD_MEMBERSHIP 35
|
||||
#define IP_DROP_MEMBERSHIP 36
|
||||
#define IP_UNBLOCK_SOURCE 37
|
||||
#define IP_BLOCK_SOURCE 38
|
||||
#define IP_ADD_SOURCE_MEMBERSHIP 39
|
||||
#define IP_DROP_SOURCE_MEMBERSHIP 40
|
||||
#define IP_MSFILTER 41
|
||||
#define IP_MULTICAST_ALL 49
|
||||
#define IP_UNICAST_IF 50
|
||||
|
||||
/* To select the IP level. */
|
||||
#define SOL_IP 0
|
||||
|
||||
#define IP_DEFAULT_MULTICAST_TTL 1
|
||||
#define IP_DEFAULT_MULTICAST_LOOP 1
|
||||
#define IP_MAX_MEMBERSHIPS 20
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS.
|
||||
The `ip_dst' field is used for the first-hop gateway when using a
|
||||
source route (this gets put into the header proper). */
|
||||
struct ip_opts
|
||||
{
|
||||
struct in_addr ip_dst; /* First hop; zero without source route. */
|
||||
char ip_opts[40]; /* Actually variable in size. */
|
||||
};
|
||||
|
||||
/* Like `struct ip_mreq' but including interface specification by index. */
|
||||
struct ip_mreqn
|
||||
{
|
||||
struct in_addr imr_multiaddr; /* IP multicast address of group */
|
||||
struct in_addr imr_address; /* local IP address of interface */
|
||||
int imr_ifindex; /* Interface index */
|
||||
};
|
||||
|
||||
/* Structure used for IP_PKTINFO. */
|
||||
struct in_pktinfo
|
||||
{
|
||||
int ipi_ifindex; /* Interface index */
|
||||
struct in_addr ipi_spec_dst; /* Routing destination address */
|
||||
struct in_addr ipi_addr; /* Header destination address */
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Options for use with `getsockopt' and `setsockopt' at the IPv6 level.
|
||||
The first word in the comment at the right is the data type used;
|
||||
"bool" means a boolean value stored in an `int'. */
|
||||
#define IPV6_ADDRFORM 1
|
||||
#define IPV6_2292PKTINFO 2
|
||||
#define IPV6_2292HOPOPTS 3
|
||||
#define IPV6_2292DSTOPTS 4
|
||||
#define IPV6_2292RTHDR 5
|
||||
#define IPV6_2292PKTOPTIONS 6
|
||||
#define IPV6_CHECKSUM 7
|
||||
#define IPV6_2292HOPLIMIT 8
|
||||
|
||||
#define SCM_SRCRT IPV6_RXSRCRT
|
||||
|
||||
#define IPV6_NEXTHOP 9
|
||||
#define IPV6_AUTHHDR 10
|
||||
#define IPV6_UNICAST_HOPS 16
|
||||
#define IPV6_MULTICAST_IF 17
|
||||
#define IPV6_MULTICAST_HOPS 18
|
||||
#define IPV6_MULTICAST_LOOP 19
|
||||
#define IPV6_JOIN_GROUP 20
|
||||
#define IPV6_LEAVE_GROUP 21
|
||||
#define IPV6_ROUTER_ALERT 22
|
||||
#define IPV6_MTU_DISCOVER 23
|
||||
#define IPV6_MTU 24
|
||||
#define IPV6_RECVERR 25
|
||||
#define IPV6_V6ONLY 26
|
||||
#define IPV6_JOIN_ANYCAST 27
|
||||
#define IPV6_LEAVE_ANYCAST 28
|
||||
#define IPV6_MULTICAST_ALL 29
|
||||
#define IPV6_IPSEC_POLICY 34
|
||||
#define IPV6_XFRM_POLICY 35
|
||||
#define IPV6_HDRINCL 36
|
||||
|
||||
/* Advanced API (RFC3542) (1). */
|
||||
#define IPV6_RECVPKTINFO 49
|
||||
#define IPV6_PKTINFO 50
|
||||
#define IPV6_RECVHOPLIMIT 51
|
||||
#define IPV6_HOPLIMIT 52
|
||||
#define IPV6_RECVHOPOPTS 53
|
||||
#define IPV6_HOPOPTS 54
|
||||
#define IPV6_RTHDRDSTOPTS 55
|
||||
#define IPV6_RECVRTHDR 56
|
||||
#define IPV6_RTHDR 57
|
||||
#define IPV6_RECVDSTOPTS 58
|
||||
#define IPV6_DSTOPTS 59
|
||||
#define IPV6_RECVPATHMTU 60
|
||||
#define IPV6_PATHMTU 61
|
||||
#define IPV6_DONTFRAG 62
|
||||
|
||||
/* Advanced API (RFC3542) (2). */
|
||||
#define IPV6_RECVTCLASS 66
|
||||
#define IPV6_TCLASS 67
|
||||
|
||||
#define IPV6_AUTOFLOWLABEL 70
|
||||
|
||||
/* RFC5014. */
|
||||
#define IPV6_ADDR_PREFERENCES 72
|
||||
|
||||
/* RFC5082. */
|
||||
#define IPV6_MINHOPCOUNT 73
|
||||
|
||||
#define IPV6_ORIGDSTADDR 74
|
||||
#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR
|
||||
#define IPV6_TRANSPARENT 75
|
||||
#define IPV6_UNICAST_IF 76
|
||||
#define IPV6_RECVFRAGSIZE 77
|
||||
#define IPV6_FREEBIND 78
|
||||
|
||||
/* Obsolete synonyms for the above. */
|
||||
#if !__USE_KERNEL_IPV6_DEFS
|
||||
# define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
|
||||
# define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
|
||||
#endif
|
||||
#define IPV6_RXHOPOPTS IPV6_HOPOPTS
|
||||
#define IPV6_RXDSTOPTS IPV6_DSTOPTS
|
||||
|
||||
/* IPV6_MTU_DISCOVER values. */
|
||||
#define IPV6_PMTUDISC_DONT 0 /* Never send DF frames. */
|
||||
#define IPV6_PMTUDISC_WANT 1 /* Use per route hints. */
|
||||
#define IPV6_PMTUDISC_DO 2 /* Always DF. */
|
||||
#define IPV6_PMTUDISC_PROBE 3 /* Ignore dst pmtu. */
|
||||
#define IPV6_PMTUDISC_INTERFACE 4 /* See IP_PMTUDISC_INTERFACE. */
|
||||
#define IPV6_PMTUDISC_OMIT 5 /* See IP_PMTUDISC_OMIT. */
|
||||
|
||||
/* Socket level values for IPv6. */
|
||||
#define SOL_IPV6 41
|
||||
#define SOL_ICMPV6 58
|
||||
|
||||
/* Routing header options for IPv6. */
|
||||
#define IPV6_RTHDR_LOOSE 0 /* Hop doesn't need to be neighbour. */
|
||||
#define IPV6_RTHDR_STRICT 1 /* Hop must be a neighbour. */
|
||||
|
||||
#define IPV6_RTHDR_TYPE_0 0 /* IPv6 Routing header type 0. */
|
37
libc/glibc-include/bits/indirect-return.h
Normal file
37
libc/glibc-include/bits/indirect-return.h
Normal file
@ -0,0 +1,37 @@
|
||||
/* Definition of __INDIRECT_RETURN. x86 version.
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _UCONTEXT_H
|
||||
# error "Never include <bits/indirect-return.h> directly; use <ucontext.h> instead."
|
||||
#endif
|
||||
|
||||
/* On x86, swapcontext returns via indirect branch when the shadow stack
|
||||
is enabled. Define __INDIRECT_RETURN to indicate whether swapcontext
|
||||
returns via indirect branch. */
|
||||
#if defined __CET__ && (__CET__ & 2) != 0
|
||||
# if __glibc_has_attribute (__indirect_return__)
|
||||
# define __INDIRECT_RETURN __attribute__ ((__indirect_return__))
|
||||
# else
|
||||
/* Newer compilers provide the indirect_return attribute, but without
|
||||
it we can use returns_twice to affect the optimizer in the same
|
||||
way and avoid unsafe optimizations. */
|
||||
# define __INDIRECT_RETURN __attribute__ ((__returns_twice__))
|
||||
# endif
|
||||
#else
|
||||
# define __INDIRECT_RETURN
|
||||
#endif
|
1
libc/glibc-include/bits/initspin.h
Normal file
1
libc/glibc-include/bits/initspin.h
Normal file
@ -0,0 +1 @@
|
||||
/* No thread support. */
|
29
libc/glibc-include/bits/inotify.h
Normal file
29
libc/glibc-include/bits/inotify.h
Normal file
@ -0,0 +1,29 @@
|
||||
/* Copyright (C) 2005-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_INOTIFY_H
|
||||
# error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead."
|
||||
#endif
|
||||
|
||||
/* Flags for the parameter of inotify_init1. */
|
||||
enum
|
||||
{
|
||||
IN_CLOEXEC = 02000000,
|
||||
#define IN_CLOEXEC IN_CLOEXEC
|
||||
IN_NONBLOCK = 00004000
|
||||
#define IN_NONBLOCK IN_NONBLOCK
|
||||
};
|
77
libc/glibc-include/bits/ioctl-types.h
Normal file
77
libc/glibc-include/bits/ioctl-types.h
Normal file
@ -0,0 +1,77 @@
|
||||
/* Structure types for pre-termios terminal ioctls. Linux version.
|
||||
Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_IOCTL_H
|
||||
# error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
|
||||
#endif
|
||||
|
||||
/* Get definition of constants for use with `ioctl'. */
|
||||
#include <asm/ioctls.h>
|
||||
|
||||
|
||||
struct winsize
|
||||
{
|
||||
unsigned short int ws_row;
|
||||
unsigned short int ws_col;
|
||||
unsigned short int ws_xpixel;
|
||||
unsigned short int ws_ypixel;
|
||||
};
|
||||
|
||||
#define NCC 8
|
||||
struct termio
|
||||
{
|
||||
unsigned short int c_iflag; /* input mode flags */
|
||||
unsigned short int c_oflag; /* output mode flags */
|
||||
unsigned short int c_cflag; /* control mode flags */
|
||||
unsigned short int c_lflag; /* local mode flags */
|
||||
unsigned char c_line; /* line discipline */
|
||||
unsigned char c_cc[NCC]; /* control characters */
|
||||
};
|
||||
|
||||
/* modem lines */
|
||||
#define TIOCM_LE 0x001
|
||||
#define TIOCM_DTR 0x002
|
||||
#define TIOCM_RTS 0x004
|
||||
#define TIOCM_ST 0x008
|
||||
#define TIOCM_SR 0x010
|
||||
#define TIOCM_CTS 0x020
|
||||
#define TIOCM_CAR 0x040
|
||||
#define TIOCM_RNG 0x080
|
||||
#define TIOCM_DSR 0x100
|
||||
#define TIOCM_CD TIOCM_CAR
|
||||
#define TIOCM_RI TIOCM_RNG
|
||||
|
||||
/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
|
||||
|
||||
/* line disciplines */
|
||||
#define N_TTY 0
|
||||
#define N_SLIP 1
|
||||
#define N_MOUSE 2
|
||||
#define N_PPP 3
|
||||
#define N_STRIP 4
|
||||
#define N_AX25 5
|
||||
#define N_X25 6 /* X.25 async */
|
||||
#define N_6PACK 7
|
||||
#define N_MASC 8 /* Mobitex module */
|
||||
#define N_R3964 9 /* Simatic R3964 module */
|
||||
#define N_PROFIBUS_FDL 10 /* Profibus */
|
||||
#define N_IRDA 11 /* Linux IR */
|
||||
#define N_SMSBLOCK 12 /* SMS block mode */
|
||||
#define N_HDLC 13 /* synchronous HDLC */
|
||||
#define N_SYNC_PPP 14 /* synchronous PPP */
|
||||
#define N_HCI 15 /* Bluetooth HCI UART */
|
108
libc/glibc-include/bits/ioctls.h
Normal file
108
libc/glibc-include/bits/ioctls.h
Normal file
@ -0,0 +1,108 @@
|
||||
/* Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_IOCTL_H
|
||||
# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
|
||||
#endif
|
||||
|
||||
/* Use the definitions from the kernel header files. */
|
||||
#include <asm/ioctls.h>
|
||||
|
||||
/* Routing table calls. */
|
||||
#define SIOCADDRT 0x890B /* add routing table entry */
|
||||
#define SIOCDELRT 0x890C /* delete routing table entry */
|
||||
#define SIOCRTMSG 0x890D /* call to routing system */
|
||||
|
||||
/* Socket configuration controls. */
|
||||
#define SIOCGIFNAME 0x8910 /* get iface name */
|
||||
#define SIOCSIFLINK 0x8911 /* set iface channel */
|
||||
#define SIOCGIFCONF 0x8912 /* get iface list */
|
||||
#define SIOCGIFFLAGS 0x8913 /* get flags */
|
||||
#define SIOCSIFFLAGS 0x8914 /* set flags */
|
||||
#define SIOCGIFADDR 0x8915 /* get PA address */
|
||||
#define SIOCSIFADDR 0x8916 /* set PA address */
|
||||
#define SIOCGIFDSTADDR 0x8917 /* get remote PA address */
|
||||
#define SIOCSIFDSTADDR 0x8918 /* set remote PA address */
|
||||
#define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */
|
||||
#define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */
|
||||
#define SIOCGIFNETMASK 0x891b /* get network PA mask */
|
||||
#define SIOCSIFNETMASK 0x891c /* set network PA mask */
|
||||
#define SIOCGIFMETRIC 0x891d /* get metric */
|
||||
#define SIOCSIFMETRIC 0x891e /* set metric */
|
||||
#define SIOCGIFMEM 0x891f /* get memory address (BSD) */
|
||||
#define SIOCSIFMEM 0x8920 /* set memory address (BSD) */
|
||||
#define SIOCGIFMTU 0x8921 /* get MTU size */
|
||||
#define SIOCSIFMTU 0x8922 /* set MTU size */
|
||||
#define SIOCSIFNAME 0x8923 /* set interface name */
|
||||
#define SIOCSIFHWADDR 0x8924 /* set hardware address */
|
||||
#define SIOCGIFENCAP 0x8925 /* get/set encapsulations */
|
||||
#define SIOCSIFENCAP 0x8926
|
||||
#define SIOCGIFHWADDR 0x8927 /* Get hardware address */
|
||||
#define SIOCGIFSLAVE 0x8929 /* Driver slaving support */
|
||||
#define SIOCSIFSLAVE 0x8930
|
||||
#define SIOCADDMULTI 0x8931 /* Multicast address lists */
|
||||
#define SIOCDELMULTI 0x8932
|
||||
#define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */
|
||||
#define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */
|
||||
#define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */
|
||||
#define SIOCGIFPFLAGS 0x8935
|
||||
#define SIOCDIFADDR 0x8936 /* delete PA address */
|
||||
#define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */
|
||||
#define SIOCGIFCOUNT 0x8938 /* get number of devices */
|
||||
|
||||
#define SIOCGIFBR 0x8940 /* Bridging support */
|
||||
#define SIOCSIFBR 0x8941 /* Set bridging options */
|
||||
|
||||
#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */
|
||||
#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */
|
||||
|
||||
|
||||
/* ARP cache control calls. */
|
||||
/* 0x8950 - 0x8952 * obsolete calls, don't re-use */
|
||||
#define SIOCDARP 0x8953 /* delete ARP table entry */
|
||||
#define SIOCGARP 0x8954 /* get ARP table entry */
|
||||
#define SIOCSARP 0x8955 /* set ARP table entry */
|
||||
|
||||
/* RARP cache control calls. */
|
||||
#define SIOCDRARP 0x8960 /* delete RARP table entry */
|
||||
#define SIOCGRARP 0x8961 /* get RARP table entry */
|
||||
#define SIOCSRARP 0x8962 /* set RARP table entry */
|
||||
|
||||
/* Driver configuration calls */
|
||||
|
||||
#define SIOCGIFMAP 0x8970 /* Get device parameters */
|
||||
#define SIOCSIFMAP 0x8971 /* Set device parameters */
|
||||
|
||||
/* DLCI configuration calls */
|
||||
|
||||
#define SIOCADDDLCI 0x8980 /* Create new DLCI device */
|
||||
#define SIOCDELDLCI 0x8981 /* Delete DLCI device */
|
||||
|
||||
/* Device private ioctl calls. */
|
||||
|
||||
/* These 16 ioctls are available to devices via the do_ioctl() device
|
||||
vector. Each device should include this file and redefine these
|
||||
names as their own. Because these are device dependent it is a good
|
||||
idea _NOT_ to issue them to random objects and hope. */
|
||||
|
||||
#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */
|
||||
|
||||
/*
|
||||
* These 16 ioctl calls are protocol private
|
||||
*/
|
||||
|
||||
#define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */
|
55
libc/glibc-include/bits/ipc.h
Normal file
55
libc/glibc-include/bits/ipc.h
Normal file
@ -0,0 +1,55 @@
|
||||
/* Copyright (C) 1995-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_IPC_H
|
||||
# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
|
||||
#endif
|
||||
|
||||
#include <bits/types.h>
|
||||
|
||||
/* Mode bits for `msgget', `semget', and `shmget'. */
|
||||
#define IPC_CREAT 01000 /* Create key if key does not exist. */
|
||||
#define IPC_EXCL 02000 /* Fail if key exists. */
|
||||
#define IPC_NOWAIT 04000 /* Return error on wait. */
|
||||
|
||||
/* Control commands for `msgctl', `semctl', and `shmctl'. */
|
||||
#define IPC_RMID 0 /* Remove identifier. */
|
||||
#define IPC_SET 1 /* Set `ipc_perm' options. */
|
||||
#define IPC_STAT 2 /* Get `ipc_perm' options. */
|
||||
#ifdef __USE_GNU
|
||||
# define IPC_INFO 3 /* See ipcs. */
|
||||
#endif
|
||||
|
||||
/* Special key values. */
|
||||
#define IPC_PRIVATE ((__key_t) 0) /* Private key. */
|
||||
|
||||
|
||||
/* Data structure used to pass permission information to IPC operations. */
|
||||
struct ipc_perm
|
||||
{
|
||||
__key_t __key; /* Key. */
|
||||
__uid_t uid; /* Owner's user ID. */
|
||||
__gid_t gid; /* Owner's group ID. */
|
||||
__uid_t cuid; /* Creator's user ID. */
|
||||
__gid_t cgid; /* Creator's group ID. */
|
||||
unsigned short int mode; /* Read/write permission. */
|
||||
unsigned short int __pad1;
|
||||
unsigned short int __seq; /* Sequence number. */
|
||||
unsigned short int __pad2;
|
||||
__syscall_ulong_t __glibc_reserved1;
|
||||
__syscall_ulong_t __glibc_reserved2;
|
||||
};
|
33
libc/glibc-include/bits/ipctypes.h
Normal file
33
libc/glibc-include/bits/ipctypes.h
Normal file
@ -0,0 +1,33 @@
|
||||
/* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM.
|
||||
Copyright (C) 2012-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_IPC_H
|
||||
# error "Never use <bits/ipctypes.h> directly; include <sys/ipc.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef _BITS_IPCTYPES_H
|
||||
#define _BITS_IPCTYPES_H 1
|
||||
|
||||
/* Used in `struct shmid_ds'. */
|
||||
# ifdef __x86_64__
|
||||
typedef int __ipc_pid_t;
|
||||
# else
|
||||
typedef unsigned short int __ipc_pid_t;
|
||||
# endif
|
||||
|
||||
#endif /* bits/ipctypes.h */
|
54
libc/glibc-include/bits/iscanonical.h
Normal file
54
libc/glibc-include/bits/iscanonical.h
Normal file
@ -0,0 +1,54 @@
|
||||
/* Define iscanonical macro. ldbl-96 version.
|
||||
Copyright (C) 2016-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _MATH_H
|
||||
# error "Never use <bits/iscanonical.h> directly; include <math.h> instead."
|
||||
#endif
|
||||
|
||||
extern int __iscanonicall (long double __x)
|
||||
__THROW __attribute__ ((__const__));
|
||||
#define __iscanonicalf(x) ((void) (__typeof (x)) (x), 1)
|
||||
#define __iscanonical(x) ((void) (__typeof (x)) (x), 1)
|
||||
#if __HAVE_DISTINCT_FLOAT128
|
||||
# define __iscanonicalf128(x) ((void) (__typeof (x)) (x), 1)
|
||||
#endif
|
||||
|
||||
/* Return nonzero value if X is canonical. In IEEE interchange binary
|
||||
formats, all values are canonical, but the argument must still be
|
||||
converted to its semantic type for any exceptions arising from the
|
||||
conversion, before being discarded; in extended precision, there
|
||||
are encodings that are not consistently handled as corresponding to
|
||||
any particular value of the type, and we return 0 for those. */
|
||||
#ifndef __cplusplus
|
||||
# define iscanonical(x) __MATH_TG ((x), __iscanonical, (x))
|
||||
#else
|
||||
/* In C++ mode, __MATH_TG cannot be used, because it relies on
|
||||
__builtin_types_compatible_p, which is a C-only builtin. On the
|
||||
other hand, overloading provides the means to distinguish between
|
||||
the floating-point types. The overloading resolution will match
|
||||
the correct parameter (regardless of type qualifiers (i.e.: const
|
||||
and volatile)). */
|
||||
extern "C++" {
|
||||
inline int iscanonical (float __val) { return __iscanonicalf (__val); }
|
||||
inline int iscanonical (double __val) { return __iscanonical (__val); }
|
||||
inline int iscanonical (long double __val) { return __iscanonicall (__val); }
|
||||
# if __HAVE_DISTINCT_FLOAT128
|
||||
inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); }
|
||||
# endif
|
||||
}
|
||||
#endif /* __cplusplus */
|
70
libc/glibc-include/bits/libc-header-start.h
Normal file
70
libc/glibc-include/bits/libc-header-start.h
Normal file
@ -0,0 +1,70 @@
|
||||
/* Handle feature test macros at the start of a header.
|
||||
Copyright (C) 2016-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This header is internal to glibc and should not be included outside
|
||||
of glibc headers. Headers including it must define
|
||||
__GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION first. This header
|
||||
cannot have multiple include guards because ISO C feature test
|
||||
macros depend on the definition of the macro when an affected
|
||||
header is included, not when the first system header is
|
||||
included. */
|
||||
|
||||
#ifndef __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
|
||||
# error "Never include <bits/libc-header-start.h> directly."
|
||||
#endif
|
||||
|
||||
#undef __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* ISO/IEC TR 24731-2:2010 defines the __STDC_WANT_LIB_EXT2__
|
||||
macro. */
|
||||
#undef __GLIBC_USE_LIB_EXT2
|
||||
#if (defined __USE_GNU \
|
||||
|| (defined __STDC_WANT_LIB_EXT2__ && __STDC_WANT_LIB_EXT2__ > 0))
|
||||
# define __GLIBC_USE_LIB_EXT2 1
|
||||
#else
|
||||
# define __GLIBC_USE_LIB_EXT2 0
|
||||
#endif
|
||||
|
||||
/* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__
|
||||
macro. */
|
||||
#undef __GLIBC_USE_IEC_60559_BFP_EXT
|
||||
#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_BFP_EXT__
|
||||
# define __GLIBC_USE_IEC_60559_BFP_EXT 1
|
||||
#else
|
||||
# define __GLIBC_USE_IEC_60559_BFP_EXT 0
|
||||
#endif
|
||||
|
||||
/* ISO/IEC TS 18661-4:2015 defines the
|
||||
__STDC_WANT_IEC_60559_FUNCS_EXT__ macro. */
|
||||
#undef __GLIBC_USE_IEC_60559_FUNCS_EXT
|
||||
#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_FUNCS_EXT__
|
||||
# define __GLIBC_USE_IEC_60559_FUNCS_EXT 1
|
||||
#else
|
||||
# define __GLIBC_USE_IEC_60559_FUNCS_EXT 0
|
||||
#endif
|
||||
|
||||
/* ISO/IEC TS 18661-3:2015 defines the
|
||||
__STDC_WANT_IEC_60559_TYPES_EXT__ macro. */
|
||||
#undef __GLIBC_USE_IEC_60559_TYPES_EXT
|
||||
#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_TYPES_EXT__
|
||||
# define __GLIBC_USE_IEC_60559_TYPES_EXT 1
|
||||
#else
|
||||
# define __GLIBC_USE_IEC_60559_TYPES_EXT 0
|
||||
#endif
|
101
libc/glibc-include/bits/libm-simd-decl-stubs.h
Normal file
101
libc/glibc-include/bits/libm-simd-decl-stubs.h
Normal file
@ -0,0 +1,101 @@
|
||||
/* Empty definitions required for __MATHCALL_VEC unfolding in mathcalls.h.
|
||||
Copyright (C) 2014-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _MATH_H
|
||||
# error "Never include <bits/libm-simd-decl-stubs.h> directly;\
|
||||
include <math.h> instead."
|
||||
#endif
|
||||
|
||||
/* Needed definitions could be generated with:
|
||||
for func in $(grep __MATHCALL_VEC math/bits/mathcalls.h |\
|
||||
sed -r "s|__MATHCALL_VEC.?\(||; s|,.*||"); do
|
||||
echo "#define __DECL_SIMD_${func}";
|
||||
echo "#define __DECL_SIMD_${func}f";
|
||||
echo "#define __DECL_SIMD_${func}l";
|
||||
done
|
||||
*/
|
||||
|
||||
#ifndef _BITS_LIBM_SIMD_DECL_STUBS_H
|
||||
#define _BITS_LIBM_SIMD_DECL_STUBS_H 1
|
||||
|
||||
#define __DECL_SIMD_cos
|
||||
#define __DECL_SIMD_cosf
|
||||
#define __DECL_SIMD_cosl
|
||||
#define __DECL_SIMD_cosf16
|
||||
#define __DECL_SIMD_cosf32
|
||||
#define __DECL_SIMD_cosf64
|
||||
#define __DECL_SIMD_cosf128
|
||||
#define __DECL_SIMD_cosf32x
|
||||
#define __DECL_SIMD_cosf64x
|
||||
#define __DECL_SIMD_cosf128x
|
||||
|
||||
#define __DECL_SIMD_sin
|
||||
#define __DECL_SIMD_sinf
|
||||
#define __DECL_SIMD_sinl
|
||||
#define __DECL_SIMD_sinf16
|
||||
#define __DECL_SIMD_sinf32
|
||||
#define __DECL_SIMD_sinf64
|
||||
#define __DECL_SIMD_sinf128
|
||||
#define __DECL_SIMD_sinf32x
|
||||
#define __DECL_SIMD_sinf64x
|
||||
#define __DECL_SIMD_sinf128x
|
||||
|
||||
#define __DECL_SIMD_sincos
|
||||
#define __DECL_SIMD_sincosf
|
||||
#define __DECL_SIMD_sincosl
|
||||
#define __DECL_SIMD_sincosf16
|
||||
#define __DECL_SIMD_sincosf32
|
||||
#define __DECL_SIMD_sincosf64
|
||||
#define __DECL_SIMD_sincosf128
|
||||
#define __DECL_SIMD_sincosf32x
|
||||
#define __DECL_SIMD_sincosf64x
|
||||
#define __DECL_SIMD_sincosf128x
|
||||
|
||||
#define __DECL_SIMD_log
|
||||
#define __DECL_SIMD_logf
|
||||
#define __DECL_SIMD_logl
|
||||
#define __DECL_SIMD_logf16
|
||||
#define __DECL_SIMD_logf32
|
||||
#define __DECL_SIMD_logf64
|
||||
#define __DECL_SIMD_logf128
|
||||
#define __DECL_SIMD_logf32x
|
||||
#define __DECL_SIMD_logf64x
|
||||
#define __DECL_SIMD_logf128x
|
||||
|
||||
#define __DECL_SIMD_exp
|
||||
#define __DECL_SIMD_expf
|
||||
#define __DECL_SIMD_expl
|
||||
#define __DECL_SIMD_expf16
|
||||
#define __DECL_SIMD_expf32
|
||||
#define __DECL_SIMD_expf64
|
||||
#define __DECL_SIMD_expf128
|
||||
#define __DECL_SIMD_expf32x
|
||||
#define __DECL_SIMD_expf64x
|
||||
#define __DECL_SIMD_expf128x
|
||||
|
||||
#define __DECL_SIMD_pow
|
||||
#define __DECL_SIMD_powf
|
||||
#define __DECL_SIMD_powl
|
||||
#define __DECL_SIMD_powf16
|
||||
#define __DECL_SIMD_powf32
|
||||
#define __DECL_SIMD_powf64
|
||||
#define __DECL_SIMD_powf128
|
||||
#define __DECL_SIMD_powf32x
|
||||
#define __DECL_SIMD_powf64x
|
||||
#define __DECL_SIMD_powf128x
|
||||
#endif
|
159
libc/glibc-include/bits/link.h
Normal file
159
libc/glibc-include/bits/link.h
Normal file
@ -0,0 +1,159 @@
|
||||
/* Copyright (C) 2004-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _LINK_H
|
||||
# error "Never include <bits/link.h> directly; use <link.h> instead."
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __x86_64__
|
||||
/* Registers for entry into PLT on IA-32. */
|
||||
typedef struct La_i86_regs
|
||||
{
|
||||
uint32_t lr_edx;
|
||||
uint32_t lr_ecx;
|
||||
uint32_t lr_eax;
|
||||
uint32_t lr_ebp;
|
||||
uint32_t lr_esp;
|
||||
} La_i86_regs;
|
||||
|
||||
/* Return values for calls from PLT on IA-32. */
|
||||
typedef struct La_i86_retval
|
||||
{
|
||||
uint32_t lrv_eax;
|
||||
uint32_t lrv_edx;
|
||||
long double lrv_st0;
|
||||
long double lrv_st1;
|
||||
uint64_t lrv_bnd0;
|
||||
uint64_t lrv_bnd1;
|
||||
} La_i86_retval;
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern Elf32_Addr la_i86_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx,
|
||||
uintptr_t *__refcook,
|
||||
uintptr_t *__defcook,
|
||||
La_i86_regs *__regs,
|
||||
unsigned int *__flags,
|
||||
const char *__symname,
|
||||
long int *__framesizep);
|
||||
extern unsigned int la_i86_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx,
|
||||
uintptr_t *__refcook,
|
||||
uintptr_t *__defcook,
|
||||
const La_i86_regs *__inregs,
|
||||
La_i86_retval *__outregs,
|
||||
const char *symname);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#else
|
||||
|
||||
/* Registers for entry into PLT on x86-64. */
|
||||
# if __GNUC_PREREQ (4,0)
|
||||
typedef float La_x86_64_xmm __attribute__ ((__vector_size__ (16)));
|
||||
typedef float La_x86_64_ymm
|
||||
__attribute__ ((__vector_size__ (32), __aligned__ (16)));
|
||||
typedef double La_x86_64_zmm
|
||||
__attribute__ ((__vector_size__ (64), __aligned__ (16)));
|
||||
# else
|
||||
typedef float La_x86_64_xmm __attribute__ ((__mode__ (__V4SF__)));
|
||||
# endif
|
||||
|
||||
typedef union
|
||||
{
|
||||
# if __GNUC_PREREQ (4,0)
|
||||
La_x86_64_ymm ymm[2];
|
||||
La_x86_64_zmm zmm[1];
|
||||
# endif
|
||||
La_x86_64_xmm xmm[4];
|
||||
} La_x86_64_vector __attribute__ ((__aligned__ (16)));
|
||||
|
||||
typedef struct La_x86_64_regs
|
||||
{
|
||||
uint64_t lr_rdx;
|
||||
uint64_t lr_r8;
|
||||
uint64_t lr_r9;
|
||||
uint64_t lr_rcx;
|
||||
uint64_t lr_rsi;
|
||||
uint64_t lr_rdi;
|
||||
uint64_t lr_rbp;
|
||||
uint64_t lr_rsp;
|
||||
La_x86_64_xmm lr_xmm[8];
|
||||
La_x86_64_vector lr_vector[8];
|
||||
#ifndef __ILP32__
|
||||
__int128_t lr_bnd[4];
|
||||
#endif
|
||||
} La_x86_64_regs;
|
||||
|
||||
/* Return values for calls from PLT on x86-64. */
|
||||
typedef struct La_x86_64_retval
|
||||
{
|
||||
uint64_t lrv_rax;
|
||||
uint64_t lrv_rdx;
|
||||
La_x86_64_xmm lrv_xmm0;
|
||||
La_x86_64_xmm lrv_xmm1;
|
||||
long double lrv_st0;
|
||||
long double lrv_st1;
|
||||
La_x86_64_vector lrv_vector0;
|
||||
La_x86_64_vector lrv_vector1;
|
||||
#ifndef __ILP32__
|
||||
__int128_t lrv_bnd0;
|
||||
__int128_t lrv_bnd1;
|
||||
#endif
|
||||
} La_x86_64_retval;
|
||||
|
||||
#define La_x32_regs La_x86_64_regs
|
||||
#define La_x32_retval La_x86_64_retval
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern Elf64_Addr la_x86_64_gnu_pltenter (Elf64_Sym *__sym,
|
||||
unsigned int __ndx,
|
||||
uintptr_t *__refcook,
|
||||
uintptr_t *__defcook,
|
||||
La_x86_64_regs *__regs,
|
||||
unsigned int *__flags,
|
||||
const char *__symname,
|
||||
long int *__framesizep);
|
||||
extern unsigned int la_x86_64_gnu_pltexit (Elf64_Sym *__sym,
|
||||
unsigned int __ndx,
|
||||
uintptr_t *__refcook,
|
||||
uintptr_t *__defcook,
|
||||
const La_x86_64_regs *__inregs,
|
||||
La_x86_64_retval *__outregs,
|
||||
const char *__symname);
|
||||
|
||||
extern Elf32_Addr la_x32_gnu_pltenter (Elf32_Sym *__sym,
|
||||
unsigned int __ndx,
|
||||
uintptr_t *__refcook,
|
||||
uintptr_t *__defcook,
|
||||
La_x32_regs *__regs,
|
||||
unsigned int *__flags,
|
||||
const char *__symname,
|
||||
long int *__framesizep);
|
||||
extern unsigned int la_x32_gnu_pltexit (Elf32_Sym *__sym,
|
||||
unsigned int __ndx,
|
||||
uintptr_t *__refcook,
|
||||
uintptr_t *__defcook,
|
||||
const La_x32_regs *__inregs,
|
||||
La_x32_retval *__outregs,
|
||||
const char *__symname);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
99
libc/glibc-include/bits/local_lim.h
Normal file
99
libc/glibc-include/bits/local_lim.h
Normal file
@ -0,0 +1,99 @@
|
||||
/* Minimum guaranteed maximum values for system limits. Linux version.
|
||||
Copyright (C) 1993-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* The kernel header pollutes the namespace with the NR_OPEN symbol
|
||||
and defines LINK_MAX although filesystems have different maxima. A
|
||||
similar thing is true for OPEN_MAX: the limit can be changed at
|
||||
runtime and therefore the macro must not be defined. Remove this
|
||||
after including the header if necessary. */
|
||||
#ifndef NR_OPEN
|
||||
# define __undef_NR_OPEN
|
||||
#endif
|
||||
#ifndef LINK_MAX
|
||||
# define __undef_LINK_MAX
|
||||
#endif
|
||||
#ifndef OPEN_MAX
|
||||
# define __undef_OPEN_MAX
|
||||
#endif
|
||||
#ifndef ARG_MAX
|
||||
# define __undef_ARG_MAX
|
||||
#endif
|
||||
|
||||
/* The kernel sources contain a file with all the needed information. */
|
||||
#include <linux/limits.h>
|
||||
|
||||
/* Have to remove NR_OPEN? */
|
||||
#ifdef __undef_NR_OPEN
|
||||
# undef NR_OPEN
|
||||
# undef __undef_NR_OPEN
|
||||
#endif
|
||||
/* Have to remove LINK_MAX? */
|
||||
#ifdef __undef_LINK_MAX
|
||||
# undef LINK_MAX
|
||||
# undef __undef_LINK_MAX
|
||||
#endif
|
||||
/* Have to remove OPEN_MAX? */
|
||||
#ifdef __undef_OPEN_MAX
|
||||
# undef OPEN_MAX
|
||||
# undef __undef_OPEN_MAX
|
||||
#endif
|
||||
/* Have to remove ARG_MAX? */
|
||||
#ifdef __undef_ARG_MAX
|
||||
# undef ARG_MAX
|
||||
# undef __undef_ARG_MAX
|
||||
#endif
|
||||
|
||||
/* The number of data keys per process. */
|
||||
#define _POSIX_THREAD_KEYS_MAX 128
|
||||
/* This is the value this implementation supports. */
|
||||
#define PTHREAD_KEYS_MAX 1024
|
||||
|
||||
/* Controlling the iterations of destructors for thread-specific data. */
|
||||
#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
|
||||
/* Number of iterations this implementation does. */
|
||||
#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
|
||||
|
||||
/* The number of threads per process. */
|
||||
#define _POSIX_THREAD_THREADS_MAX 64
|
||||
/* We have no predefined limit on the number of threads. */
|
||||
#undef PTHREAD_THREADS_MAX
|
||||
|
||||
/* Maximum amount by which a process can descrease its asynchronous I/O
|
||||
priority level. */
|
||||
#define AIO_PRIO_DELTA_MAX 20
|
||||
|
||||
/* Minimum size for a thread. We are free to choose a reasonable value. */
|
||||
#define PTHREAD_STACK_MIN 16384
|
||||
|
||||
/* Maximum number of timer expiration overruns. */
|
||||
#define DELAYTIMER_MAX 2147483647
|
||||
|
||||
/* Maximum tty name length. */
|
||||
#define TTY_NAME_MAX 32
|
||||
|
||||
/* Maximum login name length. This is arbitrary. */
|
||||
#define LOGIN_NAME_MAX 256
|
||||
|
||||
/* Maximum host name length. */
|
||||
#define HOST_NAME_MAX 64
|
||||
|
||||
/* Maximum message queue priority level. */
|
||||
#define MQ_PRIO_MAX 32768
|
||||
|
||||
/* Maximum value the semaphore can have. */
|
||||
#define SEM_VALUE_MAX (2147483647)
|
40
libc/glibc-include/bits/locale.h
Normal file
40
libc/glibc-include/bits/locale.h
Normal file
@ -0,0 +1,40 @@
|
||||
/* Definition of locale category symbol values.
|
||||
Copyright (C) 2001-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#if !defined _LOCALE_H && !defined _LANGINFO_H
|
||||
# error "Never use <bits/locale.h> directly; include <locale.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef _BITS_LOCALE_H
|
||||
#define _BITS_LOCALE_H 1
|
||||
|
||||
#define __LC_CTYPE 0
|
||||
#define __LC_NUMERIC 1
|
||||
#define __LC_TIME 2
|
||||
#define __LC_COLLATE 3
|
||||
#define __LC_MONETARY 4
|
||||
#define __LC_MESSAGES 5
|
||||
#define __LC_ALL 6
|
||||
#define __LC_PAPER 7
|
||||
#define __LC_NAME 8
|
||||
#define __LC_ADDRESS 9
|
||||
#define __LC_TELEPHONE 10
|
||||
#define __LC_MEASUREMENT 11
|
||||
#define __LC_IDENTIFICATION 12
|
||||
|
||||
#endif /* bits/locale.h */
|
20
libc/glibc-include/bits/long-double.h
Normal file
20
libc/glibc-include/bits/long-double.h
Normal file
@ -0,0 +1,20 @@
|
||||
/* Properties of long double type. ldbl-96 version.
|
||||
Copyright (C) 2016-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* long double is distinct from double, so there is nothing to
|
||||
define here. */
|
197
libc/glibc-include/bits/math-finite.h
Normal file
197
libc/glibc-include/bits/math-finite.h
Normal file
@ -0,0 +1,197 @@
|
||||
/* Entry points to finite-math-only compiler runs.
|
||||
Copyright (C) 2011-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _MATH_H
|
||||
# error "Never use <bits/math-finite.h> directly; include <math.h> instead."
|
||||
#endif
|
||||
|
||||
#define __REDIRFROM(...) __REDIRFROM_X(__VA_ARGS__)
|
||||
|
||||
#define __REDIRTO(...) __REDIRTO_X(__VA_ARGS__)
|
||||
|
||||
#define __MATH_REDIRCALL_X(from, args, to) \
|
||||
extern _Mdouble_ __REDIRECT_NTH (from, args, to)
|
||||
#define __MATH_REDIRCALL(function, reentrant, args) \
|
||||
__MATH_REDIRCALL_X \
|
||||
(__REDIRFROM (function, reentrant), args, \
|
||||
__REDIRTO (function, reentrant))
|
||||
#define __MATH_REDIRCALL_2(from, reentrant, args, to) \
|
||||
__MATH_REDIRCALL_X \
|
||||
(__REDIRFROM (from, reentrant), args, \
|
||||
__REDIRTO (to, reentrant))
|
||||
|
||||
#define __MATH_REDIRCALL_INTERNAL(function, reentrant, args) \
|
||||
__MATH_REDIRCALL_X \
|
||||
(__REDIRFROM (__CONCAT (__, function), \
|
||||
__CONCAT (reentrant, _finite)), \
|
||||
args, __REDIRTO (function, _r))
|
||||
|
||||
|
||||
/* acos. */
|
||||
__MATH_REDIRCALL (acos, , (_Mdouble_));
|
||||
|
||||
#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
|
||||
/* acosh. */
|
||||
__MATH_REDIRCALL (acosh, , (_Mdouble_));
|
||||
#endif
|
||||
|
||||
/* asin. */
|
||||
__MATH_REDIRCALL (asin, , (_Mdouble_));
|
||||
|
||||
/* atan2. */
|
||||
__MATH_REDIRCALL (atan2, , (_Mdouble_, _Mdouble_));
|
||||
|
||||
#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
|
||||
/* atanh. */
|
||||
__MATH_REDIRCALL (atanh, , (_Mdouble_));
|
||||
#endif
|
||||
|
||||
/* cosh. */
|
||||
__MATH_REDIRCALL (cosh, , (_Mdouble_));
|
||||
|
||||
/* exp. */
|
||||
__MATH_REDIRCALL (exp, , (_Mdouble_));
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_FUNCS_EXT)
|
||||
/* exp10. */
|
||||
__MATH_REDIRCALL (exp10, , (_Mdouble_));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ISOC99
|
||||
/* exp2. */
|
||||
__MATH_REDIRCALL (exp2, , (_Mdouble_));
|
||||
#endif
|
||||
|
||||
/* fmod. */
|
||||
__MATH_REDIRCALL (fmod, , (_Mdouble_, _Mdouble_));
|
||||
|
||||
#if defined __USE_XOPEN || defined __USE_ISOC99
|
||||
/* hypot. */
|
||||
__MATH_REDIRCALL (hypot, , (_Mdouble_, _Mdouble_));
|
||||
#endif
|
||||
|
||||
#if (__MATH_DECLARING_DOUBLE && (defined __USE_MISC || defined __USE_XOPEN)) \
|
||||
|| (!__MATH_DECLARING_DOUBLE && defined __USE_MISC)
|
||||
/* j0. */
|
||||
__MATH_REDIRCALL (j0, , (_Mdouble_));
|
||||
|
||||
/* y0. */
|
||||
__MATH_REDIRCALL (y0, , (_Mdouble_));
|
||||
|
||||
/* j1. */
|
||||
__MATH_REDIRCALL (j1, , (_Mdouble_));
|
||||
|
||||
/* y1. */
|
||||
__MATH_REDIRCALL (y1, , (_Mdouble_));
|
||||
|
||||
/* jn. */
|
||||
__MATH_REDIRCALL (jn, , (int, _Mdouble_));
|
||||
|
||||
/* yn. */
|
||||
__MATH_REDIRCALL (yn, , (int, _Mdouble_));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* lgamma_r. */
|
||||
__MATH_REDIRCALL (lgamma, _r, (_Mdouble_, int *));
|
||||
#endif
|
||||
|
||||
/* Redirect __lgammal_r_finite to __lgamma_r_finite when __NO_LONG_DOUBLE_MATH
|
||||
is set and to itself otherwise. It also redirects __lgamma_r_finite and
|
||||
__lgammaf_r_finite to themselves. */
|
||||
__MATH_REDIRCALL_INTERNAL (lgamma, _r, (_Mdouble_, int *));
|
||||
|
||||
#if ((defined __USE_XOPEN || defined __USE_ISOC99) \
|
||||
&& defined __extern_always_inline)
|
||||
/* lgamma. */
|
||||
__extern_always_inline _Mdouble_
|
||||
__NTH (__REDIRFROM (lgamma, ) (_Mdouble_ __d))
|
||||
{
|
||||
# if defined __USE_MISC || defined __USE_XOPEN
|
||||
return __REDIRTO (lgamma, _r) (__d, &signgam);
|
||||
# else
|
||||
int __local_signgam = 0;
|
||||
return __REDIRTO (lgamma, _r) (__d, &__local_signgam);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ((defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)) \
|
||||
&& defined __extern_always_inline) && !__MATH_DECLARING_FLOATN
|
||||
/* gamma. */
|
||||
__extern_always_inline _Mdouble_
|
||||
__NTH (__REDIRFROM (gamma, ) (_Mdouble_ __d))
|
||||
{
|
||||
return __REDIRTO (lgamma, _r) (__d, &signgam);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* log. */
|
||||
__MATH_REDIRCALL (log, , (_Mdouble_));
|
||||
|
||||
/* log10. */
|
||||
__MATH_REDIRCALL (log10, , (_Mdouble_));
|
||||
|
||||
#ifdef __USE_ISOC99
|
||||
/* log2. */
|
||||
__MATH_REDIRCALL (log2, , (_Mdouble_));
|
||||
#endif
|
||||
|
||||
/* pow. */
|
||||
__MATH_REDIRCALL (pow, , (_Mdouble_, _Mdouble_));
|
||||
|
||||
#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
|
||||
/* remainder. */
|
||||
__MATH_REDIRCALL (remainder, , (_Mdouble_, _Mdouble_));
|
||||
#endif
|
||||
|
||||
#if ((__MATH_DECLARING_DOUBLE \
|
||||
&& (defined __USE_MISC \
|
||||
|| (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8))) \
|
||||
|| (!defined __MATH_DECLARE_LDOUBLE && defined __USE_MISC)) \
|
||||
&& !__MATH_DECLARING_FLOATN
|
||||
/* scalb. */
|
||||
__MATH_REDIRCALL (scalb, , (_Mdouble_, _Mdouble_));
|
||||
#endif
|
||||
|
||||
/* sinh. */
|
||||
__MATH_REDIRCALL (sinh, , (_Mdouble_));
|
||||
|
||||
/* sqrt. */
|
||||
__MATH_REDIRCALL (sqrt, , (_Mdouble_));
|
||||
|
||||
#if defined __USE_ISOC99 && defined __extern_always_inline
|
||||
/* tgamma. */
|
||||
extern _Mdouble_
|
||||
__REDIRFROM (__gamma, _r_finite) (_Mdouble_, int *);
|
||||
|
||||
__extern_always_inline _Mdouble_
|
||||
__NTH (__REDIRFROM (tgamma, ) (_Mdouble_ __d))
|
||||
{
|
||||
int __local_signgam = 0;
|
||||
_Mdouble_ __res = __REDIRTO (gamma, _r) (__d, &__local_signgam);
|
||||
return __local_signgam < 0 ? -__res : __res;
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef __REDIRFROM
|
||||
#undef __REDIRTO
|
||||
#undef __MATH_REDIRCALL
|
||||
#undef __MATH_REDIRCALL_2
|
||||
#undef __MATH_REDIRCALL_INTERNAL
|
||||
#undef __MATH_REDIRCALL_X
|
63
libc/glibc-include/bits/math-vector.h
Normal file
63
libc/glibc-include/bits/math-vector.h
Normal file
@ -0,0 +1,63 @@
|
||||
/* Platform-specific SIMD declarations of math functions.
|
||||
Copyright (C) 2014-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _MATH_H
|
||||
# error "Never include <bits/math-vector.h> directly;\
|
||||
include <math.h> instead."
|
||||
#endif
|
||||
|
||||
/* Get default empty definitions for simd declarations. */
|
||||
#include <bits/libm-simd-decl-stubs.h>
|
||||
|
||||
#if defined __x86_64__ && defined __FAST_MATH__
|
||||
# if defined _OPENMP && _OPENMP >= 201307
|
||||
/* OpenMP case. */
|
||||
# define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch")
|
||||
# elif __GNUC_PREREQ (6,0)
|
||||
/* W/o OpenMP use GCC 6.* __attribute__ ((__simd__)). */
|
||||
# define __DECL_SIMD_x86_64 __attribute__ ((__simd__ ("notinbranch")))
|
||||
# endif
|
||||
|
||||
# ifdef __DECL_SIMD_x86_64
|
||||
# undef __DECL_SIMD_cos
|
||||
# define __DECL_SIMD_cos __DECL_SIMD_x86_64
|
||||
# undef __DECL_SIMD_cosf
|
||||
# define __DECL_SIMD_cosf __DECL_SIMD_x86_64
|
||||
# undef __DECL_SIMD_sin
|
||||
# define __DECL_SIMD_sin __DECL_SIMD_x86_64
|
||||
# undef __DECL_SIMD_sinf
|
||||
# define __DECL_SIMD_sinf __DECL_SIMD_x86_64
|
||||
# undef __DECL_SIMD_sincos
|
||||
# define __DECL_SIMD_sincos __DECL_SIMD_x86_64
|
||||
# undef __DECL_SIMD_sincosf
|
||||
# define __DECL_SIMD_sincosf __DECL_SIMD_x86_64
|
||||
# undef __DECL_SIMD_log
|
||||
# define __DECL_SIMD_log __DECL_SIMD_x86_64
|
||||
# undef __DECL_SIMD_logf
|
||||
# define __DECL_SIMD_logf __DECL_SIMD_x86_64
|
||||
# undef __DECL_SIMD_exp
|
||||
# define __DECL_SIMD_exp __DECL_SIMD_x86_64
|
||||
# undef __DECL_SIMD_expf
|
||||
# define __DECL_SIMD_expf __DECL_SIMD_x86_64
|
||||
# undef __DECL_SIMD_pow
|
||||
# define __DECL_SIMD_pow __DECL_SIMD_x86_64
|
||||
# undef __DECL_SIMD_powf
|
||||
# define __DECL_SIMD_powf __DECL_SIMD_x86_64
|
||||
|
||||
# endif
|
||||
#endif
|
43
libc/glibc-include/bits/mathcalls-helper-functions.h
Normal file
43
libc/glibc-include/bits/mathcalls-helper-functions.h
Normal file
@ -0,0 +1,43 @@
|
||||
/* Prototype declarations for math classification macros helpers.
|
||||
Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
/* Classify given number. */
|
||||
__MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value))
|
||||
__attribute__ ((__const__));
|
||||
|
||||
/* Test for negative number. */
|
||||
__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value))
|
||||
__attribute__ ((__const__));
|
||||
|
||||
/* Return 0 if VALUE is finite or NaN, +1 if it
|
||||
is +Infinity, -1 if it is -Infinity. */
|
||||
__MATHDECL_1 (int, __isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
|
||||
|
||||
/* Return nonzero if VALUE is finite and not NaN. Used by isfinite macro. */
|
||||
__MATHDECL_1 (int, __finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
|
||||
|
||||
/* Return nonzero if VALUE is not a number. */
|
||||
__MATHDECL_1 (int, __isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
|
||||
|
||||
/* Test equality. */
|
||||
__MATHDECL_1 (int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y));
|
||||
|
||||
/* Test for signaling NaN. */
|
||||
__MATHDECL_1 (int, __issignaling,, (_Mdouble_ __value))
|
||||
__attribute__ ((__const__));
|
33
libc/glibc-include/bits/mathcalls-narrow.h
Normal file
33
libc/glibc-include/bits/mathcalls-narrow.h
Normal file
@ -0,0 +1,33 @@
|
||||
/* Declare functions returning a narrower type.
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _MATH_H
|
||||
# error "Never include <bits/mathcalls-narrow.h> directly; include <math.h> instead."
|
||||
#endif
|
||||
|
||||
/* Add. */
|
||||
__MATHCALL_NARROW (__MATHCALL_NAME (add), __MATHCALL_REDIR_NAME (add), 2);
|
||||
|
||||
/* Divide. */
|
||||
__MATHCALL_NARROW (__MATHCALL_NAME (div), __MATHCALL_REDIR_NAME (div), 2);
|
||||
|
||||
/* Multiply. */
|
||||
__MATHCALL_NARROW (__MATHCALL_NAME (mul), __MATHCALL_REDIR_NAME (mul), 2);
|
||||
|
||||
/* Subtract. */
|
||||
__MATHCALL_NARROW (__MATHCALL_NAME (sub), __MATHCALL_REDIR_NAME (sub), 2);
|
397
libc/glibc-include/bits/mathcalls.h
Normal file
397
libc/glibc-include/bits/mathcalls.h
Normal file
@ -0,0 +1,397 @@
|
||||
/* Prototype declarations for math functions; helper file for <math.h>.
|
||||
Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* NOTE: Because of the special way this file is used by <math.h>, this
|
||||
file must NOT be protected from multiple inclusion as header files
|
||||
usually are.
|
||||
|
||||
This file provides prototype declarations for the math functions.
|
||||
Most functions are declared using the macro:
|
||||
|
||||
__MATHCALL (NAME,[_r], (ARGS...));
|
||||
|
||||
This means there is a function `NAME' returning `double' and a function
|
||||
`NAMEf' returning `float'. Each place `_Mdouble_' appears in the
|
||||
prototype, that is actually `double' in the prototype for `NAME' and
|
||||
`float' in the prototype for `NAMEf'. Reentrant variant functions are
|
||||
called `NAME_r' and `NAMEf_r'.
|
||||
|
||||
Functions returning other types like `int' are declared using the macro:
|
||||
|
||||
__MATHDECL (TYPE, NAME,[_r], (ARGS...));
|
||||
|
||||
This is just like __MATHCALL but for a function returning `TYPE'
|
||||
instead of `_Mdouble_'. In all of these cases, there is still
|
||||
both a `NAME' and a `NAMEf' that takes `float' arguments.
|
||||
|
||||
Note that there must be no whitespace before the argument passed for
|
||||
NAME, to make token pasting work with -traditional. */
|
||||
|
||||
#ifndef _MATH_H
|
||||
# error "Never include <bits/mathcalls.h> directly; include <math.h> instead."
|
||||
#endif
|
||||
|
||||
|
||||
/* Trigonometric functions. */
|
||||
|
||||
/* Arc cosine of X. */
|
||||
__MATHCALL (acos,, (_Mdouble_ __x));
|
||||
/* Arc sine of X. */
|
||||
__MATHCALL (asin,, (_Mdouble_ __x));
|
||||
/* Arc tangent of X. */
|
||||
__MATHCALL (atan,, (_Mdouble_ __x));
|
||||
/* Arc tangent of Y/X. */
|
||||
__MATHCALL (atan2,, (_Mdouble_ __y, _Mdouble_ __x));
|
||||
|
||||
/* Cosine of X. */
|
||||
__MATHCALL_VEC (cos,, (_Mdouble_ __x));
|
||||
/* Sine of X. */
|
||||
__MATHCALL_VEC (sin,, (_Mdouble_ __x));
|
||||
/* Tangent of X. */
|
||||
__MATHCALL (tan,, (_Mdouble_ __x));
|
||||
|
||||
/* Hyperbolic functions. */
|
||||
|
||||
/* Hyperbolic cosine of X. */
|
||||
__MATHCALL (cosh,, (_Mdouble_ __x));
|
||||
/* Hyperbolic sine of X. */
|
||||
__MATHCALL (sinh,, (_Mdouble_ __x));
|
||||
/* Hyperbolic tangent of X. */
|
||||
__MATHCALL (tanh,, (_Mdouble_ __x));
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Cosine and sine of X. */
|
||||
__MATHDECL_VEC (void,sincos,,
|
||||
(_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx));
|
||||
#endif
|
||||
|
||||
#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
|
||||
/* Hyperbolic arc cosine of X. */
|
||||
__MATHCALL (acosh,, (_Mdouble_ __x));
|
||||
/* Hyperbolic arc sine of X. */
|
||||
__MATHCALL (asinh,, (_Mdouble_ __x));
|
||||
/* Hyperbolic arc tangent of X. */
|
||||
__MATHCALL (atanh,, (_Mdouble_ __x));
|
||||
#endif
|
||||
|
||||
/* Exponential and logarithmic functions. */
|
||||
|
||||
/* Exponential function of X. */
|
||||
__MATHCALL_VEC (exp,, (_Mdouble_ __x));
|
||||
|
||||
/* Break VALUE into a normalized fraction and an integral power of 2. */
|
||||
__MATHCALL (frexp,, (_Mdouble_ __x, int *__exponent));
|
||||
|
||||
/* X times (two to the EXP power). */
|
||||
__MATHCALL (ldexp,, (_Mdouble_ __x, int __exponent));
|
||||
|
||||
/* Natural logarithm of X. */
|
||||
__MATHCALL_VEC (log,, (_Mdouble_ __x));
|
||||
|
||||
/* Base-ten logarithm of X. */
|
||||
__MATHCALL (log10,, (_Mdouble_ __x));
|
||||
|
||||
/* Break VALUE into integral and fractional parts. */
|
||||
__MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2));
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_FUNCS_EXT)
|
||||
/* Compute exponent to base ten. */
|
||||
__MATHCALL (exp10,, (_Mdouble_ __x));
|
||||
#endif
|
||||
|
||||
#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
|
||||
/* Return exp(X) - 1. */
|
||||
__MATHCALL (expm1,, (_Mdouble_ __x));
|
||||
|
||||
/* Return log(1 + X). */
|
||||
__MATHCALL (log1p,, (_Mdouble_ __x));
|
||||
|
||||
/* Return the base 2 signed integral exponent of X. */
|
||||
__MATHCALL (logb,, (_Mdouble_ __x));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ISOC99
|
||||
/* Compute base-2 exponential of X. */
|
||||
__MATHCALL (exp2,, (_Mdouble_ __x));
|
||||
|
||||
/* Compute base-2 logarithm of X. */
|
||||
__MATHCALL (log2,, (_Mdouble_ __x));
|
||||
#endif
|
||||
|
||||
|
||||
/* Power functions. */
|
||||
|
||||
/* Return X to the Y power. */
|
||||
__MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
|
||||
|
||||
/* Return the square root of X. */
|
||||
__MATHCALL (sqrt,, (_Mdouble_ __x));
|
||||
|
||||
#if defined __USE_XOPEN || defined __USE_ISOC99
|
||||
/* Return `sqrt(X*X + Y*Y)'. */
|
||||
__MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y));
|
||||
#endif
|
||||
|
||||
#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
|
||||
/* Return the cube root of X. */
|
||||
__MATHCALL (cbrt,, (_Mdouble_ __x));
|
||||
#endif
|
||||
|
||||
|
||||
/* Nearest integer, absolute value, and remainder functions. */
|
||||
|
||||
/* Smallest integral value not less than X. */
|
||||
__MATHCALLX (ceil,, (_Mdouble_ __x), (__const__));
|
||||
|
||||
/* Absolute value of X. */
|
||||
__MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
|
||||
|
||||
/* Largest integer not greater than X. */
|
||||
__MATHCALLX (floor,, (_Mdouble_ __x), (__const__));
|
||||
|
||||
/* Floating-point modulo remainder of X/Y. */
|
||||
__MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y));
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# if ((!defined __cplusplus \
|
||||
|| __cplusplus < 201103L /* isinf conflicts with C++11. */ \
|
||||
|| __MATH_DECLARING_DOUBLE == 0)) /* isinff or isinfl don't. */ \
|
||||
&& !__MATH_DECLARING_FLOATN
|
||||
/* Return 0 if VALUE is finite or NaN, +1 if it
|
||||
is +Infinity, -1 if it is -Infinity. */
|
||||
__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
|
||||
# endif
|
||||
|
||||
# if !__MATH_DECLARING_FLOATN
|
||||
/* Return nonzero if VALUE is finite and not NaN. */
|
||||
__MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
|
||||
|
||||
/* Return the remainder of X/Y. */
|
||||
__MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y));
|
||||
|
||||
|
||||
/* Return the fractional part of X after dividing out `ilogb (X)'. */
|
||||
__MATHCALL (significand,, (_Mdouble_ __x));
|
||||
# endif
|
||||
|
||||
#endif /* Use misc. */
|
||||
|
||||
#ifdef __USE_ISOC99
|
||||
/* Return X with its signed changed to Y's. */
|
||||
__MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ISOC99
|
||||
/* Return representation of qNaN for double type. */
|
||||
__MATHCALL (nan,, (const char *__tagb));
|
||||
#endif
|
||||
|
||||
|
||||
#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
|
||||
# if ((!defined __cplusplus \
|
||||
|| __cplusplus < 201103L /* isnan conflicts with C++11. */ \
|
||||
|| __MATH_DECLARING_DOUBLE == 0)) /* isnanf or isnanl don't. */ \
|
||||
&& !__MATH_DECLARING_FLOATN
|
||||
/* Return nonzero if VALUE is not a number. */
|
||||
__MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined __USE_MISC || (defined __USE_XOPEN && __MATH_DECLARING_DOUBLE)
|
||||
/* Bessel functions. */
|
||||
__MATHCALL (j0,, (_Mdouble_));
|
||||
__MATHCALL (j1,, (_Mdouble_));
|
||||
__MATHCALL (jn,, (int, _Mdouble_));
|
||||
__MATHCALL (y0,, (_Mdouble_));
|
||||
__MATHCALL (y1,, (_Mdouble_));
|
||||
__MATHCALL (yn,, (int, _Mdouble_));
|
||||
#endif
|
||||
|
||||
|
||||
#if defined __USE_XOPEN || defined __USE_ISOC99
|
||||
/* Error and gamma functions. */
|
||||
__MATHCALL (erf,, (_Mdouble_));
|
||||
__MATHCALL (erfc,, (_Mdouble_));
|
||||
__MATHCALL (lgamma,, (_Mdouble_));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ISOC99
|
||||
/* True gamma function. */
|
||||
__MATHCALL (tgamma,, (_Mdouble_));
|
||||
#endif
|
||||
|
||||
#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
|
||||
# if !__MATH_DECLARING_FLOATN
|
||||
/* Obsolete alias for `lgamma'. */
|
||||
__MATHCALL (gamma,, (_Mdouble_));
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Reentrant version of lgamma. This function uses the global variable
|
||||
`signgam'. The reentrant version instead takes a pointer and stores
|
||||
the value through it. */
|
||||
__MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp));
|
||||
#endif
|
||||
|
||||
|
||||
#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
|
||||
/* Return the integer nearest X in the direction of the
|
||||
prevailing rounding mode. */
|
||||
__MATHCALL (rint,, (_Mdouble_ __x));
|
||||
|
||||
/* Return X + epsilon if X < Y, X - epsilon if X > Y. */
|
||||
__MATHCALL (nextafter,, (_Mdouble_ __x, _Mdouble_ __y));
|
||||
# if defined __USE_ISOC99 && !defined __LDBL_COMPAT && !__MATH_DECLARING_FLOATN
|
||||
__MATHCALL (nexttoward,, (_Mdouble_ __x, long double __y));
|
||||
# endif
|
||||
|
||||
# if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
|
||||
/* Return X - epsilon. */
|
||||
__MATHCALL (nextdown,, (_Mdouble_ __x));
|
||||
/* Return X + epsilon. */
|
||||
__MATHCALL (nextup,, (_Mdouble_ __x));
|
||||
# endif
|
||||
|
||||
/* Return the remainder of integer divison X / Y with infinite precision. */
|
||||
__MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y));
|
||||
|
||||
# ifdef __USE_ISOC99
|
||||
/* Return X times (2 to the Nth power). */
|
||||
__MATHCALL (scalbn,, (_Mdouble_ __x, int __n));
|
||||
# endif
|
||||
|
||||
/* Return the binary exponent of X, which must be nonzero. */
|
||||
__MATHDECL (int,ilogb,, (_Mdouble_ __x));
|
||||
#endif
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
|
||||
/* Like ilogb, but returning long int. */
|
||||
__MATHDECL (long int, llogb,, (_Mdouble_ __x));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ISOC99
|
||||
/* Return X times (2 to the Nth power). */
|
||||
__MATHCALL (scalbln,, (_Mdouble_ __x, long int __n));
|
||||
|
||||
/* Round X to integral value in floating-point format using current
|
||||
rounding direction, but do not raise inexact exception. */
|
||||
__MATHCALL (nearbyint,, (_Mdouble_ __x));
|
||||
|
||||
/* Round X to nearest integral value, rounding halfway cases away from
|
||||
zero. */
|
||||
__MATHCALLX (round,, (_Mdouble_ __x), (__const__));
|
||||
|
||||
/* Round X to the integral value in floating-point format nearest but
|
||||
not larger in magnitude. */
|
||||
__MATHCALLX (trunc,, (_Mdouble_ __x), (__const__));
|
||||
|
||||
/* Compute remainder of X and Y and put in *QUO a value with sign of x/y
|
||||
and magnitude congruent `mod 2^n' to the magnitude of the integral
|
||||
quotient x/y, with n >= 3. */
|
||||
__MATHCALL (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo));
|
||||
|
||||
|
||||
/* Conversion functions. */
|
||||
|
||||
/* Round X to nearest integral value according to current rounding
|
||||
direction. */
|
||||
__MATHDECL (long int,lrint,, (_Mdouble_ __x));
|
||||
__extension__
|
||||
__MATHDECL (long long int,llrint,, (_Mdouble_ __x));
|
||||
|
||||
/* Round X to nearest integral value, rounding halfway cases away from
|
||||
zero. */
|
||||
__MATHDECL (long int,lround,, (_Mdouble_ __x));
|
||||
__extension__
|
||||
__MATHDECL (long long int,llround,, (_Mdouble_ __x));
|
||||
|
||||
|
||||
/* Return positive difference between X and Y. */
|
||||
__MATHCALL (fdim,, (_Mdouble_ __x, _Mdouble_ __y));
|
||||
|
||||
/* Return maximum numeric value from X and Y. */
|
||||
__MATHCALLX (fmax,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
|
||||
|
||||
/* Return minimum numeric value from X and Y. */
|
||||
__MATHCALLX (fmin,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
|
||||
|
||||
/* Multiply-add function computed as a ternary operation. */
|
||||
__MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z));
|
||||
#endif /* Use ISO C99. */
|
||||
|
||||
#if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
|
||||
/* Round X to nearest integer value, rounding halfway cases to even. */
|
||||
__MATHCALLX (roundeven,, (_Mdouble_ __x), (__const__));
|
||||
|
||||
/* Round X to nearest signed integer value, not raising inexact, with
|
||||
control of rounding direction and width of result. */
|
||||
__MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
|
||||
unsigned int __width));
|
||||
|
||||
/* Round X to nearest unsigned integer value, not raising inexact,
|
||||
with control of rounding direction and width of result. */
|
||||
__MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
|
||||
unsigned int __width));
|
||||
|
||||
/* Round X to nearest signed integer value, raising inexact for
|
||||
non-integers, with control of rounding direction and width of
|
||||
result. */
|
||||
__MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
|
||||
unsigned int __width));
|
||||
|
||||
/* Round X to nearest unsigned integer value, raising inexact for
|
||||
non-integers, with control of rounding direction and width of
|
||||
result. */
|
||||
__MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
|
||||
unsigned int __width));
|
||||
|
||||
/* Return value with maximum magnitude. */
|
||||
__MATHCALLX (fmaxmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
|
||||
|
||||
/* Return value with minimum magnitude. */
|
||||
__MATHCALLX (fminmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
|
||||
|
||||
/* Total order operation. */
|
||||
__MATHDECL_1 (int, totalorder,, (_Mdouble_ __x, _Mdouble_ __y))
|
||||
__attribute__ ((__const__));
|
||||
|
||||
/* Total order operation on absolute values. */
|
||||
__MATHDECL_1 (int, totalordermag,, (_Mdouble_ __x, _Mdouble_ __y))
|
||||
__attribute__ ((__const__));
|
||||
|
||||
/* Canonicalize floating-point representation. */
|
||||
__MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x));
|
||||
|
||||
/* Get NaN payload. */
|
||||
__MATHCALL (getpayload,, (const _Mdouble_ *__x));
|
||||
|
||||
/* Set quiet NaN payload. */
|
||||
__MATHDECL_1 (int, setpayload,, (_Mdouble_ *__x, _Mdouble_ __payload));
|
||||
|
||||
/* Set signaling NaN payload. */
|
||||
__MATHDECL_1 (int, setpayloadsig,, (_Mdouble_ *__x, _Mdouble_ __payload));
|
||||
#endif
|
||||
|
||||
#if (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \
|
||||
&& __MATH_DECLARING_DOUBLE \
|
||||
&& !defined __USE_XOPEN2K8)) \
|
||||
&& !__MATH_DECLARING_FLOATN
|
||||
/* Return X times (2 to the Nth power). */
|
||||
__MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n));
|
||||
#endif
|
20
libc/glibc-include/bits/mathdef.h
Normal file
20
libc/glibc-include/bits/mathdef.h
Normal file
@ -0,0 +1,20 @@
|
||||
/* Copyright (C) 1997-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _COMPLEX_H
|
||||
# error "Never use <bits/mathdef.h> directly; include <complex.h> instead"
|
||||
#endif
|
12
libc/glibc-include/bits/mathinline.h
Normal file
12
libc/glibc-include/bits/mathinline.h
Normal file
@ -0,0 +1,12 @@
|
||||
/* This file should provide inline versions of math functions.
|
||||
|
||||
Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'.
|
||||
|
||||
This file should define __MATH_INLINES if functions are actually defined as
|
||||
inlines. */
|
||||
|
||||
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
|
||||
|
||||
/* Here goes the real code. */
|
||||
|
||||
#endif
|
111
libc/glibc-include/bits/mman-linux.h
Normal file
111
libc/glibc-include/bits/mman-linux.h
Normal file
@ -0,0 +1,111 @@
|
||||
/* Definitions for POSIX memory map interface. Linux generic version.
|
||||
Copyright (C) 2001-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_MMAN_H
|
||||
# error "Never use <bits/mman-linux.h> directly; include <sys/mman.h> instead."
|
||||
#endif
|
||||
|
||||
/* The following definitions basically come from the kernel headers.
|
||||
But the kernel header is not namespace clean. */
|
||||
|
||||
|
||||
/* Protections are chosen from these bits, OR'd together. The
|
||||
implementation does not necessarily support PROT_EXEC or PROT_WRITE
|
||||
without PROT_READ. The only guarantees are that no writing will be
|
||||
allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
|
||||
|
||||
#define PROT_READ 0x1 /* Page can be read. */
|
||||
#define PROT_WRITE 0x2 /* Page can be written. */
|
||||
#define PROT_EXEC 0x4 /* Page can be executed. */
|
||||
#define PROT_NONE 0x0 /* Page can not be accessed. */
|
||||
#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
|
||||
growsdown vma (mprotect only). */
|
||||
#define PROT_GROWSUP 0x02000000 /* Extend change to start of
|
||||
growsup vma (mprotect only). */
|
||||
|
||||
/* Sharing types (must choose one and only one of these). */
|
||||
#define MAP_SHARED 0x01 /* Share changes. */
|
||||
#define MAP_PRIVATE 0x02 /* Changes are private. */
|
||||
#ifdef __USE_MISC
|
||||
# define MAP_SHARED_VALIDATE 0x03 /* Share changes and validate
|
||||
extension flags. */
|
||||
# define MAP_TYPE 0x0f /* Mask for type of mapping. */
|
||||
#endif
|
||||
|
||||
/* Other flags. */
|
||||
#define MAP_FIXED 0x10 /* Interpret addr exactly. */
|
||||
#ifdef __USE_MISC
|
||||
# define MAP_FILE 0
|
||||
# ifdef __MAP_ANONYMOUS
|
||||
# define MAP_ANONYMOUS __MAP_ANONYMOUS /* Don't use a file. */
|
||||
# else
|
||||
# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
|
||||
# endif
|
||||
# define MAP_ANON MAP_ANONYMOUS
|
||||
/* When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. */
|
||||
# define MAP_HUGE_SHIFT 26
|
||||
# define MAP_HUGE_MASK 0x3f
|
||||
#endif
|
||||
|
||||
/* Flags to `msync'. */
|
||||
#define MS_ASYNC 1 /* Sync memory asynchronously. */
|
||||
#define MS_SYNC 4 /* Synchronous memory sync. */
|
||||
#define MS_INVALIDATE 2 /* Invalidate the caches. */
|
||||
|
||||
/* Advice to `madvise'. */
|
||||
#ifdef __USE_MISC
|
||||
# define MADV_NORMAL 0 /* No further special treatment. */
|
||||
# define MADV_RANDOM 1 /* Expect random page references. */
|
||||
# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
||||
# define MADV_WILLNEED 3 /* Will need these pages. */
|
||||
# define MADV_DONTNEED 4 /* Don't need these pages. */
|
||||
# define MADV_FREE 8 /* Free pages only if memory pressure. */
|
||||
# define MADV_REMOVE 9 /* Remove these pages and resources. */
|
||||
# define MADV_DONTFORK 10 /* Do not inherit across fork. */
|
||||
# define MADV_DOFORK 11 /* Do inherit across fork. */
|
||||
# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
|
||||
# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
|
||||
# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
|
||||
# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
|
||||
# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
|
||||
overrides the coredump filter bits. */
|
||||
# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
|
||||
# define MADV_WIPEONFORK 18 /* Zero memory on fork, child only. */
|
||||
# define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK. */
|
||||
# define MADV_HWPOISON 100 /* Poison a page for testing. */
|
||||
#endif
|
||||
|
||||
/* The POSIX people had to invent similar names for the same things. */
|
||||
#ifdef __USE_XOPEN2K
|
||||
# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
|
||||
# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
|
||||
# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
||||
# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
|
||||
# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
|
||||
#endif
|
||||
|
||||
/* Flags for `mlockall'. */
|
||||
#ifndef MCL_CURRENT
|
||||
# define MCL_CURRENT 1 /* Lock all currently mapped pages. */
|
||||
# define MCL_FUTURE 2 /* Lock all additions to address
|
||||
space. */
|
||||
# define MCL_ONFAULT 4 /* Lock all pages that are
|
||||
faulted in. */
|
||||
#endif
|
||||
|
||||
#include <bits/mman-shared.h>
|
42
libc/glibc-include/bits/mman-map-flags-generic.h
Normal file
42
libc/glibc-include/bits/mman-map-flags-generic.h
Normal file
@ -0,0 +1,42 @@
|
||||
/* Definitions for POSIX memory map interface. Linux/generic version.
|
||||
Copyright (C) 1997-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_MMAN_H
|
||||
# error "Never use <bits/mman-map-flags-generic.h> directly; include <sys/mman.h> instead."
|
||||
#endif
|
||||
|
||||
/* These definitions are appropriate for architectures that, in the
|
||||
Linux kernel, either have no uapi/asm/mman.h, or have one that
|
||||
includes asm-generic/mman.h without any changes to the values of
|
||||
the MAP_* flags defined in that header. */
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */
|
||||
# define MAP_DENYWRITE 0x00800 /* ETXTBSY. */
|
||||
# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */
|
||||
# define MAP_LOCKED 0x02000 /* Lock the mapping. */
|
||||
# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */
|
||||
# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */
|
||||
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
|
||||
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
|
||||
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
|
||||
# define MAP_SYNC 0x80000 /* Perform synchronous page
|
||||
faults for the mapping. */
|
||||
# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
|
||||
underlying mapping. */
|
||||
#endif
|
80
libc/glibc-include/bits/mman-shared.h
Normal file
80
libc/glibc-include/bits/mman-shared.h
Normal file
@ -0,0 +1,80 @@
|
||||
/* Memory-mapping-related declarations/definitions, not architecture-specific.
|
||||
Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_MMAN_H
|
||||
# error "Never use <bits/mman-shared.h> directly; include <sys/mman.h> instead."
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Flags for mremap. */
|
||||
# define MREMAP_MAYMOVE 1
|
||||
# define MREMAP_FIXED 2
|
||||
|
||||
/* Flags for memfd_create. */
|
||||
# ifndef MFD_CLOEXEC
|
||||
# define MFD_CLOEXEC 1U
|
||||
# define MFD_ALLOW_SEALING 2U
|
||||
# define MFD_HUGETLB 4U
|
||||
# endif
|
||||
|
||||
/* Flags for mlock2. */
|
||||
# ifndef MLOCK_ONFAULT
|
||||
# define MLOCK_ONFAULT 1U
|
||||
# endif
|
||||
|
||||
/* Access rights for pkey_alloc. */
|
||||
# ifndef PKEY_DISABLE_ACCESS
|
||||
# define PKEY_DISABLE_ACCESS 0x1
|
||||
# define PKEY_DISABLE_WRITE 0x2
|
||||
# endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Create a new memory file descriptor. NAME is a name for debugging.
|
||||
FLAGS is a combination of the MFD_* constants. */
|
||||
int memfd_create (const char *__name, unsigned int __flags) __THROW;
|
||||
|
||||
/* Lock pages from ADDR (inclusive) to ADDR + LENGTH (exclusive) into
|
||||
memory. FLAGS is a combination of the MLOCK_* flags above. */
|
||||
int mlock2 (const void *__addr, size_t __length, unsigned int __flags) __THROW;
|
||||
|
||||
/* Allocate a new protection key, with the PKEY_DISABLE_* bits
|
||||
specified in ACCESS_RIGHTS. The protection key mask for the
|
||||
current thread is updated to match the access privilege for the new
|
||||
key. */
|
||||
int pkey_alloc (unsigned int __flags, unsigned int __access_rights) __THROW;
|
||||
|
||||
/* Update the access rights for the current thread for KEY, which must
|
||||
have been allocated using pkey_alloc. */
|
||||
int pkey_set (int __key, unsigned int __access_rights) __THROW;
|
||||
|
||||
/* Return the access rights for the current thread for KEY, which must
|
||||
have been allocated using pkey_alloc. */
|
||||
int pkey_get (int __key) __THROW;
|
||||
|
||||
/* Free an allocated protection key, which must have been allocated
|
||||
using pkey_alloc. */
|
||||
int pkey_free (int __key) __THROW;
|
||||
|
||||
/* Apply memory protection flags for KEY to the specified address
|
||||
range. */
|
||||
int pkey_mprotect (void *__addr, size_t __len, int __prot, int __pkey) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* __USE_GNU */
|
34
libc/glibc-include/bits/mman.h
Normal file
34
libc/glibc-include/bits/mman.h
Normal file
@ -0,0 +1,34 @@
|
||||
/* Definitions for POSIX memory map interface. Linux/x86_64 version.
|
||||
Copyright (C) 2001-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_MMAN_H
|
||||
# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
|
||||
#endif
|
||||
|
||||
/* The following definitions basically come from the kernel headers.
|
||||
But the kernel header is not namespace clean. */
|
||||
|
||||
/* Other flags. */
|
||||
#ifdef __USE_MISC
|
||||
# define MAP_32BIT 0x40 /* Only give out 32-bit addresses. */
|
||||
#endif
|
||||
|
||||
#include <bits/mman-map-flags-generic.h>
|
||||
|
||||
/* Include generic Linux declarations. */
|
||||
#include <bits/mman-linux.h>
|
27
libc/glibc-include/bits/monetary-ldbl.h
Normal file
27
libc/glibc-include/bits/monetary-ldbl.h
Normal file
@ -0,0 +1,27 @@
|
||||
/* -mlong-double-64 compatibility mode for monetary functions.
|
||||
Copyright (C) 2006-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _MONETARY_H
|
||||
# error "Never include <bits/monetary-ldbl.h> directly; use <monetary.h> instead."
|
||||
#endif
|
||||
|
||||
__LDBL_REDIR_DECL (strfmon)
|
||||
|
||||
#ifdef __USE_GNU
|
||||
__LDBL_REDIR_DECL (strfmon_l)
|
||||
#endif
|
33
libc/glibc-include/bits/mqueue.h
Normal file
33
libc/glibc-include/bits/mqueue.h
Normal file
@ -0,0 +1,33 @@
|
||||
/* Copyright (C) 2004-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _MQUEUE_H
|
||||
# error "Never use <bits/mqueue.h> directly; include <mqueue.h> instead."
|
||||
#endif
|
||||
|
||||
#include <bits/types.h>
|
||||
|
||||
typedef int mqd_t;
|
||||
|
||||
struct mq_attr
|
||||
{
|
||||
__syscall_slong_t mq_flags; /* Message queue flags. */
|
||||
__syscall_slong_t mq_maxmsg; /* Maximum number of messages. */
|
||||
__syscall_slong_t mq_msgsize; /* Maximum message size. */
|
||||
__syscall_slong_t mq_curmsgs; /* Number of messages currently queued. */
|
||||
__syscall_slong_t __pad[4];
|
||||
};
|
57
libc/glibc-include/bits/mqueue2.h
Normal file
57
libc/glibc-include/bits/mqueue2.h
Normal file
@ -0,0 +1,57 @@
|
||||
/* Checking macros for mq functions.
|
||||
Copyright (C) 2007-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FCNTL_H
|
||||
# error "Never include <bits/mqueue2.h> directly; use <mqueue.h> instead."
|
||||
#endif
|
||||
|
||||
/* Check that calls to mq_open with O_CREAT set have an appropriate third and fourth
|
||||
parameter. */
|
||||
extern mqd_t mq_open (const char *__name, int __oflag, ...)
|
||||
__THROW __nonnull ((1));
|
||||
extern mqd_t __mq_open_2 (const char *__name, int __oflag)
|
||||
__THROW __nonnull ((1));
|
||||
extern mqd_t __REDIRECT_NTH (__mq_open_alias, (const char *__name,
|
||||
int __oflag, ...), mq_open)
|
||||
__nonnull ((1));
|
||||
__errordecl (__mq_open_wrong_number_of_args,
|
||||
"mq_open can be called either with 2 or 4 arguments");
|
||||
__errordecl (__mq_open_missing_mode_and_attr,
|
||||
"mq_open with O_CREAT in second argument needs 4 arguments");
|
||||
|
||||
__fortify_function mqd_t
|
||||
__NTH (mq_open (const char *__name, int __oflag, ...))
|
||||
{
|
||||
if (__va_arg_pack_len () != 0 && __va_arg_pack_len () != 2)
|
||||
__mq_open_wrong_number_of_args ();
|
||||
|
||||
if (__builtin_constant_p (__oflag))
|
||||
{
|
||||
if ((__oflag & O_CREAT) != 0 && __va_arg_pack_len () == 0)
|
||||
{
|
||||
__mq_open_missing_mode_and_attr ();
|
||||
return __mq_open_2 (__name, __oflag);
|
||||
}
|
||||
return __mq_open_alias (__name, __oflag, __va_arg_pack ());
|
||||
}
|
||||
|
||||
if (__va_arg_pack_len () == 0)
|
||||
return __mq_open_2 (__name, __oflag);
|
||||
|
||||
return __mq_open_alias (__name, __oflag, __va_arg_pack ());
|
||||
}
|
31
libc/glibc-include/bits/msq-pad.h
Normal file
31
libc/glibc-include/bits/msq-pad.h
Normal file
@ -0,0 +1,31 @@
|
||||
/* Define where padding goes in struct msqid_ds. Generic version.
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_MSG_H
|
||||
# error "Never use <bits/msq-pad.h> directly; include <sys/msg.h> instead."
|
||||
#endif
|
||||
|
||||
#include <bits/timesize.h>
|
||||
|
||||
/* On most architectures, padding goes after time fields for 32-bit
|
||||
systems and is omitted for 64-bit systems. Some architectures pad
|
||||
before time fields instead, or omit padding despite being
|
||||
32-bit. */
|
||||
|
||||
#define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32)
|
||||
#define __MSQ_PAD_BEFORE_TIME 0
|
86
libc/glibc-include/bits/msq.h
Normal file
86
libc/glibc-include/bits/msq.h
Normal file
@ -0,0 +1,86 @@
|
||||
/* Copyright (C) 1995-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_MSG_H
|
||||
# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
|
||||
#endif
|
||||
|
||||
#include <bits/types.h>
|
||||
#include <bits/msq-pad.h>
|
||||
|
||||
/* Define options for message queue functions. */
|
||||
#define MSG_NOERROR 010000 /* no error if message is too big */
|
||||
#ifdef __USE_GNU
|
||||
# define MSG_EXCEPT 020000 /* recv any msg except of specified type */
|
||||
# define MSG_COPY 040000 /* copy (not remove) all queue messages */
|
||||
#endif
|
||||
|
||||
/* Types used in the structure definition. */
|
||||
typedef __syscall_ulong_t msgqnum_t;
|
||||
typedef __syscall_ulong_t msglen_t;
|
||||
|
||||
#if __MSQ_PAD_BEFORE_TIME
|
||||
# define __MSQ_PAD_TIME(NAME, RES) \
|
||||
unsigned long int __glibc_reserved ## RES; __time_t NAME
|
||||
#elif __MSQ_PAD_AFTER_TIME
|
||||
# define __MSQ_PAD_TIME(NAME, RES) \
|
||||
__time_t NAME; unsigned long int __glibc_reserved ## RES
|
||||
#else
|
||||
# define __MSQ_PAD_TIME(NAME, RES) \
|
||||
__time_t NAME
|
||||
#endif
|
||||
|
||||
/* Structure of record for one message inside the kernel.
|
||||
The type `struct msg' is opaque. */
|
||||
struct msqid_ds
|
||||
{
|
||||
struct ipc_perm msg_perm; /* structure describing operation permission */
|
||||
__MSQ_PAD_TIME (msg_stime, 1); /* time of last msgsnd command */
|
||||
__MSQ_PAD_TIME (msg_rtime, 2); /* time of last msgrcv command */
|
||||
__MSQ_PAD_TIME (msg_ctime, 3); /* time of last change */
|
||||
__syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
|
||||
msgqnum_t msg_qnum; /* number of messages currently on queue */
|
||||
msglen_t msg_qbytes; /* max number of bytes allowed on queue */
|
||||
__pid_t msg_lspid; /* pid of last msgsnd() */
|
||||
__pid_t msg_lrpid; /* pid of last msgrcv() */
|
||||
__syscall_ulong_t __glibc_reserved4;
|
||||
__syscall_ulong_t __glibc_reserved5;
|
||||
};
|
||||
|
||||
#ifdef __USE_MISC
|
||||
|
||||
# define msg_cbytes __msg_cbytes
|
||||
|
||||
/* ipcs ctl commands */
|
||||
# define MSG_STAT 11
|
||||
# define MSG_INFO 12
|
||||
# define MSG_STAT_ANY 13
|
||||
|
||||
/* buffer for msgctl calls IPC_INFO, MSG_INFO */
|
||||
struct msginfo
|
||||
{
|
||||
int msgpool;
|
||||
int msgmap;
|
||||
int msgmax;
|
||||
int msgmnb;
|
||||
int msgmni;
|
||||
int msgssz;
|
||||
int msgtql;
|
||||
unsigned short int msgseg;
|
||||
};
|
||||
|
||||
#endif /* __USE_MISC */
|
32
libc/glibc-include/bits/netdb.h
Normal file
32
libc/glibc-include/bits/netdb.h
Normal file
@ -0,0 +1,32 @@
|
||||
/* Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _NETDB_H
|
||||
# error "Never include <bits/netdb.h> directly; use <netdb.h> instead."
|
||||
#endif
|
||||
|
||||
|
||||
/* Description of data base entry for a single network. NOTE: here a
|
||||
poor assumption is made. The network number is expected to fit
|
||||
into an unsigned long int variable. */
|
||||
struct netent
|
||||
{
|
||||
char *n_name; /* Official name of network. */
|
||||
char **n_aliases; /* Alias list. */
|
||||
int n_addrtype; /* Net address type. */
|
||||
uint32_t n_net; /* Network number. */
|
||||
};
|
42
libc/glibc-include/bits/param.h
Normal file
42
libc/glibc-include/bits/param.h
Normal file
@ -0,0 +1,42 @@
|
||||
/* Old-style Unix parameters and limits. Linux version.
|
||||
Copyright (C) 1995-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_PARAM_H
|
||||
# error "Never use <bits/param.h> directly; include <sys/param.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef ARG_MAX
|
||||
# define __undef_ARG_MAX
|
||||
#endif
|
||||
|
||||
#include <linux/limits.h>
|
||||
#include <linux/param.h>
|
||||
|
||||
/* The kernel headers define ARG_MAX. The value is wrong, though. */
|
||||
#ifdef __undef_ARG_MAX
|
||||
# undef ARG_MAX
|
||||
# undef __undef_ARG_MAX
|
||||
#endif
|
||||
|
||||
#define MAXSYMLINKS 20
|
||||
|
||||
/* The following are not really correct but it is a value we used for a
|
||||
long time and which seems to be usable. People should not use NOFILE
|
||||
and NCARGS anyway. */
|
||||
#define NOFILE 256
|
||||
#define NCARGS 131072
|
49
libc/glibc-include/bits/poll.h
Normal file
49
libc/glibc-include/bits/poll.h
Normal file
@ -0,0 +1,49 @@
|
||||
/* Copyright (C) 1997-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_POLL_H
|
||||
# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
|
||||
#endif
|
||||
|
||||
/* Event types that can be polled for. These bits may be set in `events'
|
||||
to indicate the interesting event types; they will appear in `revents'
|
||||
to indicate the status of the file descriptor. */
|
||||
#define POLLIN 0x001 /* There is data to read. */
|
||||
#define POLLPRI 0x002 /* There is urgent data to read. */
|
||||
#define POLLOUT 0x004 /* Writing now will not block. */
|
||||
|
||||
#if defined __USE_XOPEN || defined __USE_XOPEN2K8
|
||||
/* These values are defined in XPG4.2. */
|
||||
# define POLLRDNORM 0x040 /* Normal data may be read. */
|
||||
# define POLLRDBAND 0x080 /* Priority data may be read. */
|
||||
# define POLLWRNORM 0x100 /* Writing now will not block. */
|
||||
# define POLLWRBAND 0x200 /* Priority data may be written. */
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* These are extensions for Linux. */
|
||||
# define POLLMSG 0x400
|
||||
# define POLLREMOVE 0x1000
|
||||
# define POLLRDHUP 0x2000
|
||||
#endif
|
||||
|
||||
/* Event types always implicitly polled for. These bits need not be set in
|
||||
`events', but they will appear in `revents' to indicate the status of
|
||||
the file descriptor. */
|
||||
#define POLLERR 0x008 /* Error condition. */
|
||||
#define POLLHUP 0x010 /* Hung up. */
|
||||
#define POLLNVAL 0x020 /* Invalid polling request. */
|
81
libc/glibc-include/bits/poll2.h
Normal file
81
libc/glibc-include/bits/poll2.h
Normal file
@ -0,0 +1,81 @@
|
||||
/* Checking macros for poll functions.
|
||||
Copyright (C) 2012-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_POLL_H
|
||||
# error "Never include <bits/poll2.h> directly; use <sys/poll.h> instead."
|
||||
#endif
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern int __REDIRECT (__poll_alias, (struct pollfd *__fds, nfds_t __nfds,
|
||||
int __timeout), poll);
|
||||
extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
|
||||
__SIZE_TYPE__ __fdslen);
|
||||
extern int __REDIRECT (__poll_chk_warn, (struct pollfd *__fds, nfds_t __nfds,
|
||||
int __timeout, __SIZE_TYPE__ __fdslen),
|
||||
__poll_chk)
|
||||
__warnattr ("poll called with fds buffer too small file nfds entries");
|
||||
|
||||
__fortify_function int
|
||||
poll (struct pollfd *__fds, nfds_t __nfds, int __timeout)
|
||||
{
|
||||
if (__bos (__fds) != (__SIZE_TYPE__) -1)
|
||||
{
|
||||
if (! __builtin_constant_p (__nfds))
|
||||
return __poll_chk (__fds, __nfds, __timeout, __bos (__fds));
|
||||
else if (__bos (__fds) / sizeof (*__fds) < __nfds)
|
||||
return __poll_chk_warn (__fds, __nfds, __timeout, __bos (__fds));
|
||||
}
|
||||
|
||||
return __poll_alias (__fds, __nfds, __timeout);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __USE_GNU
|
||||
extern int __REDIRECT (__ppoll_alias, (struct pollfd *__fds, nfds_t __nfds,
|
||||
const struct timespec *__timeout,
|
||||
const __sigset_t *__ss), ppoll);
|
||||
extern int __ppoll_chk (struct pollfd *__fds, nfds_t __nfds,
|
||||
const struct timespec *__timeout,
|
||||
const __sigset_t *__ss, __SIZE_TYPE__ __fdslen);
|
||||
extern int __REDIRECT (__ppoll_chk_warn, (struct pollfd *__fds, nfds_t __nfds,
|
||||
const struct timespec *__timeout,
|
||||
const __sigset_t *__ss,
|
||||
__SIZE_TYPE__ __fdslen),
|
||||
__ppoll_chk)
|
||||
__warnattr ("ppoll called with fds buffer too small file nfds entries");
|
||||
|
||||
__fortify_function int
|
||||
ppoll (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout,
|
||||
const __sigset_t *__ss)
|
||||
{
|
||||
if (__bos (__fds) != (__SIZE_TYPE__) -1)
|
||||
{
|
||||
if (! __builtin_constant_p (__nfds))
|
||||
return __ppoll_chk (__fds, __nfds, __timeout, __ss, __bos (__fds));
|
||||
else if (__bos (__fds) / sizeof (*__fds) < __nfds)
|
||||
return __ppoll_chk_warn (__fds, __nfds, __timeout, __ss,
|
||||
__bos (__fds));
|
||||
}
|
||||
|
||||
return __ppoll_alias (__fds, __nfds, __timeout, __ss);
|
||||
}
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
183
libc/glibc-include/bits/posix1_lim.h
Normal file
183
libc/glibc-include/bits/posix1_lim.h
Normal file
@ -0,0 +1,183 @@
|
||||
/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* POSIX Standard: 2.9.2 Minimum Values Added to <limits.h>
|
||||
*
|
||||
* Never include this file directly; use <limits.h> instead.
|
||||
*/
|
||||
|
||||
#ifndef _BITS_POSIX1_LIM_H
|
||||
#define _BITS_POSIX1_LIM_H 1
|
||||
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
/* These are the standard-mandated minimum values. */
|
||||
|
||||
/* Minimum number of operations in one list I/O call. */
|
||||
#define _POSIX_AIO_LISTIO_MAX 2
|
||||
|
||||
/* Minimal number of outstanding asynchronous I/O operations. */
|
||||
#define _POSIX_AIO_MAX 1
|
||||
|
||||
/* Maximum length of arguments to `execve', including environment. */
|
||||
#define _POSIX_ARG_MAX 4096
|
||||
|
||||
/* Maximum simultaneous processes per real user ID. */
|
||||
#ifdef __USE_XOPEN2K
|
||||
# define _POSIX_CHILD_MAX 25
|
||||
#else
|
||||
# define _POSIX_CHILD_MAX 6
|
||||
#endif
|
||||
|
||||
/* Minimal number of timer expiration overruns. */
|
||||
#define _POSIX_DELAYTIMER_MAX 32
|
||||
|
||||
/* Maximum length of a host name (not including the terminating null)
|
||||
as returned from the GETHOSTNAME function. */
|
||||
#define _POSIX_HOST_NAME_MAX 255
|
||||
|
||||
/* Maximum link count of a file. */
|
||||
#define _POSIX_LINK_MAX 8
|
||||
|
||||
/* Maximum length of login name. */
|
||||
#define _POSIX_LOGIN_NAME_MAX 9
|
||||
|
||||
/* Number of bytes in a terminal canonical input queue. */
|
||||
#define _POSIX_MAX_CANON 255
|
||||
|
||||
/* Number of bytes for which space will be
|
||||
available in a terminal input queue. */
|
||||
#define _POSIX_MAX_INPUT 255
|
||||
|
||||
/* Maximum number of message queues open for a process. */
|
||||
#define _POSIX_MQ_OPEN_MAX 8
|
||||
|
||||
/* Maximum number of supported message priorities. */
|
||||
#define _POSIX_MQ_PRIO_MAX 32
|
||||
|
||||
/* Number of bytes in a filename. */
|
||||
#define _POSIX_NAME_MAX 14
|
||||
|
||||
/* Number of simultaneous supplementary group IDs per process. */
|
||||
#ifdef __USE_XOPEN2K
|
||||
# define _POSIX_NGROUPS_MAX 8
|
||||
#else
|
||||
# define _POSIX_NGROUPS_MAX 0
|
||||
#endif
|
||||
|
||||
/* Number of files one process can have open at once. */
|
||||
#ifdef __USE_XOPEN2K
|
||||
# define _POSIX_OPEN_MAX 20
|
||||
#else
|
||||
# define _POSIX_OPEN_MAX 16
|
||||
#endif
|
||||
|
||||
#if !defined __USE_XOPEN2K || defined __USE_GNU
|
||||
/* Number of descriptors that a process may examine with `pselect' or
|
||||
`select'. */
|
||||
# define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX
|
||||
#endif
|
||||
|
||||
/* Number of bytes in a pathname. */
|
||||
#define _POSIX_PATH_MAX 256
|
||||
|
||||
/* Number of bytes than can be written atomically to a pipe. */
|
||||
#define _POSIX_PIPE_BUF 512
|
||||
|
||||
/* The number of repeated occurrences of a BRE permitted by the
|
||||
REGEXEC and REGCOMP functions when using the interval notation. */
|
||||
#define _POSIX_RE_DUP_MAX 255
|
||||
|
||||
/* Minimal number of realtime signals reserved for the application. */
|
||||
#define _POSIX_RTSIG_MAX 8
|
||||
|
||||
/* Number of semaphores a process can have. */
|
||||
#define _POSIX_SEM_NSEMS_MAX 256
|
||||
|
||||
/* Maximal value of a semaphore. */
|
||||
#define _POSIX_SEM_VALUE_MAX 32767
|
||||
|
||||
/* Number of pending realtime signals. */
|
||||
#define _POSIX_SIGQUEUE_MAX 32
|
||||
|
||||
/* Largest value of a `ssize_t'. */
|
||||
#define _POSIX_SSIZE_MAX 32767
|
||||
|
||||
/* Number of streams a process can have open at once. */
|
||||
#define _POSIX_STREAM_MAX 8
|
||||
|
||||
/* The number of bytes in a symbolic link. */
|
||||
#define _POSIX_SYMLINK_MAX 255
|
||||
|
||||
/* The number of symbolic links that can be traversed in the
|
||||
resolution of a pathname in the absence of a loop. */
|
||||
#define _POSIX_SYMLOOP_MAX 8
|
||||
|
||||
/* Number of timer for a process. */
|
||||
#define _POSIX_TIMER_MAX 32
|
||||
|
||||
/* Maximum number of characters in a tty name. */
|
||||
#define _POSIX_TTY_NAME_MAX 9
|
||||
|
||||
/* Maximum length of a timezone name (element of `tzname'). */
|
||||
#ifdef __USE_XOPEN2K
|
||||
# define _POSIX_TZNAME_MAX 6
|
||||
#else
|
||||
# define _POSIX_TZNAME_MAX 3
|
||||
#endif
|
||||
|
||||
#if !defined __USE_XOPEN2K || defined __USE_GNU
|
||||
/* Maximum number of connections that can be queued on a socket. */
|
||||
# define _POSIX_QLIMIT 1
|
||||
|
||||
/* Maximum number of bytes that can be buffered on a socket for send
|
||||
or receive. */
|
||||
# define _POSIX_HIWAT _POSIX_PIPE_BUF
|
||||
|
||||
/* Maximum number of elements in an `iovec' array. */
|
||||
# define _POSIX_UIO_MAXIOV 16
|
||||
#endif
|
||||
|
||||
/* Maximum clock resolution in nanoseconds. */
|
||||
#define _POSIX_CLOCKRES_MIN 20000000
|
||||
|
||||
|
||||
/* Get the implementation-specific values for the above. */
|
||||
#include <bits/local_lim.h>
|
||||
|
||||
|
||||
#ifndef SSIZE_MAX
|
||||
/* ssize_t is not formally required to be the signed type
|
||||
corresponding to size_t, but it is for all configurations supported
|
||||
by glibc. */
|
||||
# if __WORDSIZE == 64 || __WORDSIZE32_SIZE_ULONG
|
||||
# define SSIZE_MAX LONG_MAX
|
||||
# else
|
||||
# define SSIZE_MAX INT_MAX
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* This value is a guaranteed minimum maximum.
|
||||
The current maximum can be got from `sysconf'. */
|
||||
|
||||
#ifndef NGROUPS_MAX
|
||||
# define NGROUPS_MAX 8
|
||||
#endif
|
||||
|
||||
#endif /* bits/posix1_lim.h */
|
90
libc/glibc-include/bits/posix2_lim.h
Normal file
90
libc/glibc-include/bits/posix2_lim.h
Normal file
@ -0,0 +1,90 @@
|
||||
/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* Never include this file directly; include <limits.h> instead.
|
||||
*/
|
||||
|
||||
#ifndef _BITS_POSIX2_LIM_H
|
||||
#define _BITS_POSIX2_LIM_H 1
|
||||
|
||||
|
||||
/* The maximum `ibase' and `obase' values allowed by the `bc' utility. */
|
||||
#define _POSIX2_BC_BASE_MAX 99
|
||||
|
||||
/* The maximum number of elements allowed in an array by the `bc' utility. */
|
||||
#define _POSIX2_BC_DIM_MAX 2048
|
||||
|
||||
/* The maximum `scale' value allowed by the `bc' utility. */
|
||||
#define _POSIX2_BC_SCALE_MAX 99
|
||||
|
||||
/* The maximum length of a string constant accepted by the `bc' utility. */
|
||||
#define _POSIX2_BC_STRING_MAX 1000
|
||||
|
||||
/* The maximum number of weights that can be assigned to an entry of
|
||||
the LC_COLLATE `order' keyword in the locale definition file. */
|
||||
#define _POSIX2_COLL_WEIGHTS_MAX 2
|
||||
|
||||
/* The maximum number of expressions that can be nested
|
||||
within parentheses by the `expr' utility. */
|
||||
#define _POSIX2_EXPR_NEST_MAX 32
|
||||
|
||||
/* The maximum length, in bytes, of an input line. */
|
||||
#define _POSIX2_LINE_MAX 2048
|
||||
|
||||
/* The maximum number of repeated occurrences of a regular expression
|
||||
permitted when using the interval notation `\{M,N\}'. */
|
||||
#define _POSIX2_RE_DUP_MAX 255
|
||||
|
||||
/* The maximum number of bytes in a character class name. We have no
|
||||
fixed limit, 2048 is a high number. */
|
||||
#define _POSIX2_CHARCLASS_NAME_MAX 14
|
||||
|
||||
|
||||
/* These values are implementation-specific,
|
||||
and may vary within the implementation.
|
||||
Their precise values can be obtained from sysconf. */
|
||||
|
||||
#ifndef BC_BASE_MAX
|
||||
#define BC_BASE_MAX _POSIX2_BC_BASE_MAX
|
||||
#endif
|
||||
#ifndef BC_DIM_MAX
|
||||
#define BC_DIM_MAX _POSIX2_BC_DIM_MAX
|
||||
#endif
|
||||
#ifndef BC_SCALE_MAX
|
||||
#define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX
|
||||
#endif
|
||||
#ifndef BC_STRING_MAX
|
||||
#define BC_STRING_MAX _POSIX2_BC_STRING_MAX
|
||||
#endif
|
||||
#ifndef COLL_WEIGHTS_MAX
|
||||
#define COLL_WEIGHTS_MAX 255
|
||||
#endif
|
||||
#ifndef EXPR_NEST_MAX
|
||||
#define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX
|
||||
#endif
|
||||
#ifndef LINE_MAX
|
||||
#define LINE_MAX _POSIX2_LINE_MAX
|
||||
#endif
|
||||
#ifndef CHARCLASS_NAME_MAX
|
||||
#define CHARCLASS_NAME_MAX 2048
|
||||
#endif
|
||||
|
||||
/* This value is defined like this in regex.h. */
|
||||
#define RE_DUP_MAX (0x7fff)
|
||||
|
||||
#endif /* bits/posix2_lim.h */
|
191
libc/glibc-include/bits/posix_opt.h
Normal file
191
libc/glibc-include/bits/posix_opt.h
Normal file
@ -0,0 +1,191 @@
|
||||
/* Define POSIX options for Linux.
|
||||
Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BITS_POSIX_OPT_H
|
||||
#define _BITS_POSIX_OPT_H 1
|
||||
|
||||
/* Job control is supported. */
|
||||
#define _POSIX_JOB_CONTROL 1
|
||||
|
||||
/* Processes have a saved set-user-ID and a saved set-group-ID. */
|
||||
#define _POSIX_SAVED_IDS 1
|
||||
|
||||
/* Priority scheduling is supported. */
|
||||
#define _POSIX_PRIORITY_SCHEDULING 200809L
|
||||
|
||||
/* Synchronizing file data is supported. */
|
||||
#define _POSIX_SYNCHRONIZED_IO 200809L
|
||||
|
||||
/* The fsync function is present. */
|
||||
#define _POSIX_FSYNC 200809L
|
||||
|
||||
/* Mapping of files to memory is supported. */
|
||||
#define _POSIX_MAPPED_FILES 200809L
|
||||
|
||||
/* Locking of all memory is supported. */
|
||||
#define _POSIX_MEMLOCK 200809L
|
||||
|
||||
/* Locking of ranges of memory is supported. */
|
||||
#define _POSIX_MEMLOCK_RANGE 200809L
|
||||
|
||||
/* Setting of memory protections is supported. */
|
||||
#define _POSIX_MEMORY_PROTECTION 200809L
|
||||
|
||||
/* Some filesystems allow all users to change file ownership. */
|
||||
#define _POSIX_CHOWN_RESTRICTED 0
|
||||
|
||||
/* `c_cc' member of 'struct termios' structure can be disabled by
|
||||
using the value _POSIX_VDISABLE. */
|
||||
#define _POSIX_VDISABLE '\0'
|
||||
|
||||
/* Filenames are not silently truncated. */
|
||||
#define _POSIX_NO_TRUNC 1
|
||||
|
||||
/* X/Open realtime support is available. */
|
||||
#define _XOPEN_REALTIME 1
|
||||
|
||||
/* X/Open thread realtime support is available. */
|
||||
#define _XOPEN_REALTIME_THREADS 1
|
||||
|
||||
/* XPG4.2 shared memory is supported. */
|
||||
#define _XOPEN_SHM 1
|
||||
|
||||
/* Tell we have POSIX threads. */
|
||||
#define _POSIX_THREADS 200809L
|
||||
|
||||
/* We have the reentrant functions described in POSIX. */
|
||||
#define _POSIX_REENTRANT_FUNCTIONS 1
|
||||
#define _POSIX_THREAD_SAFE_FUNCTIONS 200809L
|
||||
|
||||
/* We provide priority scheduling for threads. */
|
||||
#define _POSIX_THREAD_PRIORITY_SCHEDULING 200809L
|
||||
|
||||
/* We support user-defined stack sizes. */
|
||||
#define _POSIX_THREAD_ATTR_STACKSIZE 200809L
|
||||
|
||||
/* We support user-defined stacks. */
|
||||
#define _POSIX_THREAD_ATTR_STACKADDR 200809L
|
||||
|
||||
/* We support priority inheritence. */
|
||||
#define _POSIX_THREAD_PRIO_INHERIT 200809L
|
||||
|
||||
/* We support priority protection, though only for non-robust
|
||||
mutexes. */
|
||||
#define _POSIX_THREAD_PRIO_PROTECT 200809L
|
||||
|
||||
#ifdef __USE_XOPEN2K8
|
||||
/* We support priority inheritence for robust mutexes. */
|
||||
# define _POSIX_THREAD_ROBUST_PRIO_INHERIT 200809L
|
||||
|
||||
/* We do not support priority protection for robust mutexes. */
|
||||
# define _POSIX_THREAD_ROBUST_PRIO_PROTECT -1
|
||||
#endif
|
||||
|
||||
/* We support POSIX.1b semaphores. */
|
||||
#define _POSIX_SEMAPHORES 200809L
|
||||
|
||||
/* Real-time signals are supported. */
|
||||
#define _POSIX_REALTIME_SIGNALS 200809L
|
||||
|
||||
/* We support asynchronous I/O. */
|
||||
#define _POSIX_ASYNCHRONOUS_IO 200809L
|
||||
#define _POSIX_ASYNC_IO 1
|
||||
/* Alternative name for Unix98. */
|
||||
#define _LFS_ASYNCHRONOUS_IO 1
|
||||
/* Support for prioritization is also available. */
|
||||
#define _POSIX_PRIORITIZED_IO 200809L
|
||||
|
||||
/* The LFS support in asynchronous I/O is also available. */
|
||||
#define _LFS64_ASYNCHRONOUS_IO 1
|
||||
|
||||
/* The rest of the LFS is also available. */
|
||||
#define _LFS_LARGEFILE 1
|
||||
#define _LFS64_LARGEFILE 1
|
||||
#define _LFS64_STDIO 1
|
||||
|
||||
/* POSIX shared memory objects are implemented. */
|
||||
#define _POSIX_SHARED_MEMORY_OBJECTS 200809L
|
||||
|
||||
/* CPU-time clocks support needs to be checked at runtime. */
|
||||
#define _POSIX_CPUTIME 0
|
||||
|
||||
/* Clock support in threads must be also checked at runtime. */
|
||||
#define _POSIX_THREAD_CPUTIME 0
|
||||
|
||||
/* GNU libc provides regular expression handling. */
|
||||
#define _POSIX_REGEXP 1
|
||||
|
||||
/* Reader/Writer locks are available. */
|
||||
#define _POSIX_READER_WRITER_LOCKS 200809L
|
||||
|
||||
/* We have a POSIX shell. */
|
||||
#define _POSIX_SHELL 1
|
||||
|
||||
/* We support the Timeouts option. */
|
||||
#define _POSIX_TIMEOUTS 200809L
|
||||
|
||||
/* We support spinlocks. */
|
||||
#define _POSIX_SPIN_LOCKS 200809L
|
||||
|
||||
/* The `spawn' function family is supported. */
|
||||
#define _POSIX_SPAWN 200809L
|
||||
|
||||
/* We have POSIX timers. */
|
||||
#define _POSIX_TIMERS 200809L
|
||||
|
||||
/* The barrier functions are available. */
|
||||
#define _POSIX_BARRIERS 200809L
|
||||
|
||||
/* POSIX message queues are available. */
|
||||
#define _POSIX_MESSAGE_PASSING 200809L
|
||||
|
||||
/* Thread process-shared synchronization is supported. */
|
||||
#define _POSIX_THREAD_PROCESS_SHARED 200809L
|
||||
|
||||
/* The monotonic clock might be available. */
|
||||
#define _POSIX_MONOTONIC_CLOCK 0
|
||||
|
||||
/* The clock selection interfaces are available. */
|
||||
#define _POSIX_CLOCK_SELECTION 200809L
|
||||
|
||||
/* Advisory information interfaces are available. */
|
||||
#define _POSIX_ADVISORY_INFO 200809L
|
||||
|
||||
/* IPv6 support is available. */
|
||||
#define _POSIX_IPV6 200809L
|
||||
|
||||
/* Raw socket support is available. */
|
||||
#define _POSIX_RAW_SOCKETS 200809L
|
||||
|
||||
/* We have at least one terminal. */
|
||||
#define _POSIX2_CHAR_TERM 200809L
|
||||
|
||||
/* Neither process nor thread sporadic server interfaces is available. */
|
||||
#define _POSIX_SPORADIC_SERVER -1
|
||||
#define _POSIX_THREAD_SPORADIC_SERVER -1
|
||||
|
||||
/* trace.h is not available. */
|
||||
#define _POSIX_TRACE -1
|
||||
#define _POSIX_TRACE_EVENT_FILTER -1
|
||||
#define _POSIX_TRACE_INHERIT -1
|
||||
#define _POSIX_TRACE_LOG -1
|
||||
|
||||
/* Typed memory objects are not available. */
|
||||
#define _POSIX_TYPED_MEMORY_OBJECTS -1
|
||||
|
||||
#endif /* bits/posix_opt.h */
|
23
libc/glibc-include/bits/printf-ldbl.h
Normal file
23
libc/glibc-include/bits/printf-ldbl.h
Normal file
@ -0,0 +1,23 @@
|
||||
/* -mlong-double-64 compatibility mode for <printf.h> functions.
|
||||
Copyright (C) 2006-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _PRINTF_H
|
||||
# error "Never include <bits/printf-ldbl.h> directly; use <printf.h> instead."
|
||||
#endif
|
||||
|
||||
__LDBL_REDIR_DECL (printf_size)
|
22
libc/glibc-include/bits/procfs-extra.h
Normal file
22
libc/glibc-include/bits/procfs-extra.h
Normal file
@ -0,0 +1,22 @@
|
||||
/* Extra sys/procfs.h definitions. Generic Linux version.
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_PROCFS_H
|
||||
# error "Never include <bits/procfs-extra.h> directly; use <sys/procfs.h> instead."
|
||||
#endif
|
30
libc/glibc-include/bits/procfs-id.h
Normal file
30
libc/glibc-include/bits/procfs-id.h
Normal file
@ -0,0 +1,30 @@
|
||||
/* Types of pr_uid and pr_gid in struct elf_prpsinfo. x86 version.
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_PROCFS_H
|
||||
# error "Never include <bits/procfs-id.h> directly; use <sys/procfs.h> instead."
|
||||
#endif
|
||||
|
||||
#if __WORDSIZE == 32
|
||||
typedef unsigned short int __pr_uid_t;
|
||||
typedef unsigned short int __pr_gid_t;
|
||||
#else
|
||||
typedef unsigned int __pr_uid_t;
|
||||
typedef unsigned int __pr_gid_t;
|
||||
#endif
|
25
libc/glibc-include/bits/procfs-prregset.h
Normal file
25
libc/glibc-include/bits/procfs-prregset.h
Normal file
@ -0,0 +1,25 @@
|
||||
/* Types of prgregset_t and prfpregset_t. Generic Linux version.
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_PROCFS_H
|
||||
# error "Never include <bits/procfs-prregset.h> directly; use <sys/procfs.h> instead."
|
||||
#endif
|
||||
|
||||
typedef elf_gregset_t __prgregset_t;
|
||||
typedef elf_fpregset_t __prfpregset_t;
|
50
libc/glibc-include/bits/procfs.h
Normal file
50
libc/glibc-include/bits/procfs.h
Normal file
@ -0,0 +1,50 @@
|
||||
/* Types for registers for sys/procfs.h. x86 version.
|
||||
Copyright (C) 2001-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_PROCFS_H
|
||||
# error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
|
||||
#endif
|
||||
|
||||
/* Type for a general-purpose register. */
|
||||
#ifdef __x86_64__
|
||||
__extension__ typedef unsigned long long elf_greg_t;
|
||||
#else
|
||||
typedef unsigned long elf_greg_t;
|
||||
#endif
|
||||
|
||||
/* And the whole bunch of them. We could have used `struct
|
||||
user_regs_struct' directly in the typedef, but tradition says that
|
||||
the register set is an array, which does have some peculiar
|
||||
semantics, so leave it that way. */
|
||||
#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
|
||||
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
|
||||
|
||||
#ifndef __x86_64__
|
||||
/* Register set for the floating-point registers. */
|
||||
typedef struct user_fpregs_struct elf_fpregset_t;
|
||||
|
||||
/* Register set for the extended floating-point registers. Includes
|
||||
the Pentium III SSE registers in addition to the classic
|
||||
floating-point stuff. */
|
||||
typedef struct user_fpxregs_struct elf_fpxregset_t;
|
||||
#else
|
||||
/* Register set for the extended floating-point registers. Includes
|
||||
the Pentium III SSE registers in addition to the classic
|
||||
floating-point stuff. */
|
||||
typedef struct user_fpregs_struct elf_fpregset_t;
|
||||
#endif
|
106
libc/glibc-include/bits/pthreadtypes-arch.h
Normal file
106
libc/glibc-include/bits/pthreadtypes-arch.h
Normal file
@ -0,0 +1,106 @@
|
||||
/* Copyright (C) 2002-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BITS_PTHREADTYPES_ARCH_H
|
||||
#define _BITS_PTHREADTYPES_ARCH_H 1
|
||||
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
#ifdef __x86_64__
|
||||
# if __WORDSIZE == 64
|
||||
# define __SIZEOF_PTHREAD_MUTEX_T 40
|
||||
# define __SIZEOF_PTHREAD_ATTR_T 56
|
||||
# define __SIZEOF_PTHREAD_MUTEX_T 40
|
||||
# define __SIZEOF_PTHREAD_RWLOCK_T 56
|
||||
# define __SIZEOF_PTHREAD_BARRIER_T 32
|
||||
# else
|
||||
# define __SIZEOF_PTHREAD_MUTEX_T 32
|
||||
# define __SIZEOF_PTHREAD_ATTR_T 32
|
||||
# define __SIZEOF_PTHREAD_MUTEX_T 32
|
||||
# define __SIZEOF_PTHREAD_RWLOCK_T 44
|
||||
# define __SIZEOF_PTHREAD_BARRIER_T 20
|
||||
# endif
|
||||
#else
|
||||
# define __SIZEOF_PTHREAD_MUTEX_T 24
|
||||
# define __SIZEOF_PTHREAD_ATTR_T 36
|
||||
# define __SIZEOF_PTHREAD_MUTEX_T 24
|
||||
# define __SIZEOF_PTHREAD_RWLOCK_T 32
|
||||
# define __SIZEOF_PTHREAD_BARRIER_T 20
|
||||
#endif
|
||||
#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
|
||||
#define __SIZEOF_PTHREAD_COND_T 48
|
||||
#define __SIZEOF_PTHREAD_CONDATTR_T 4
|
||||
#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
|
||||
#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
|
||||
|
||||
/* Definitions for internal mutex struct. */
|
||||
#define __PTHREAD_COMPAT_PADDING_MID
|
||||
#define __PTHREAD_COMPAT_PADDING_END
|
||||
#define __PTHREAD_MUTEX_LOCK_ELISION 1
|
||||
#ifdef __x86_64__
|
||||
# define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0
|
||||
# define __PTHREAD_MUTEX_USE_UNION 0
|
||||
#else
|
||||
# define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1
|
||||
# define __PTHREAD_MUTEX_USE_UNION 1
|
||||
#endif
|
||||
|
||||
#define __LOCK_ALIGNMENT
|
||||
#define __ONCE_ALIGNMENT
|
||||
|
||||
struct __pthread_rwlock_arch_t
|
||||
{
|
||||
unsigned int __readers;
|
||||
unsigned int __writers;
|
||||
unsigned int __wrphase_futex;
|
||||
unsigned int __writers_futex;
|
||||
unsigned int __pad3;
|
||||
unsigned int __pad4;
|
||||
#ifdef __x86_64__
|
||||
int __cur_writer;
|
||||
int __shared;
|
||||
signed char __rwelision;
|
||||
# ifdef __ILP32__
|
||||
unsigned char __pad1[3];
|
||||
# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0 }
|
||||
# else
|
||||
unsigned char __pad1[7];
|
||||
# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0, 0, 0, 0, 0 }
|
||||
# endif
|
||||
unsigned long int __pad2;
|
||||
/* FLAGS must stay at this position in the structure to maintain
|
||||
binary compatibility. */
|
||||
unsigned int __flags;
|
||||
# define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1
|
||||
#else
|
||||
/* FLAGS must stay at this position in the structure to maintain
|
||||
binary compatibility. */
|
||||
unsigned char __flags;
|
||||
unsigned char __shared;
|
||||
signed char __rwelision;
|
||||
# define __PTHREAD_RWLOCK_ELISION_EXTRA 0
|
||||
unsigned char __pad2;
|
||||
int __cur_writer;
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifndef __x86_64__
|
||||
/* Extra attributes for the cleanup functions. */
|
||||
# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1)))
|
||||
#endif
|
||||
|
||||
#endif /* bits/pthreadtypes.h */
|
121
libc/glibc-include/bits/pthreadtypes.h
Normal file
121
libc/glibc-include/bits/pthreadtypes.h
Normal file
@ -0,0 +1,121 @@
|
||||
/* Declaration of common pthread types for all architectures.
|
||||
Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BITS_PTHREADTYPES_COMMON_H
|
||||
# define _BITS_PTHREADTYPES_COMMON_H 1
|
||||
|
||||
/* For internal mutex and condition variable definitions. */
|
||||
#include <bits/thread-shared-types.h>
|
||||
|
||||
/* Thread identifiers. The structure of the attribute type is not
|
||||
exposed on purpose. */
|
||||
typedef unsigned long int pthread_t;
|
||||
|
||||
|
||||
/* Data structures for mutex handling. The structure of the attribute
|
||||
type is not exposed on purpose. */
|
||||
typedef union
|
||||
{
|
||||
char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
|
||||
int __align;
|
||||
} pthread_mutexattr_t;
|
||||
|
||||
|
||||
/* Data structure for condition variable handling. The structure of
|
||||
the attribute type is not exposed on purpose. */
|
||||
typedef union
|
||||
{
|
||||
char __size[__SIZEOF_PTHREAD_CONDATTR_T];
|
||||
int __align;
|
||||
} pthread_condattr_t;
|
||||
|
||||
|
||||
/* Keys for thread-specific data */
|
||||
typedef unsigned int pthread_key_t;
|
||||
|
||||
|
||||
/* Once-only execution */
|
||||
typedef int __ONCE_ALIGNMENT pthread_once_t;
|
||||
|
||||
|
||||
union pthread_attr_t
|
||||
{
|
||||
char __size[__SIZEOF_PTHREAD_ATTR_T];
|
||||
long int __align;
|
||||
};
|
||||
#ifndef __have_pthread_attr_t
|
||||
typedef union pthread_attr_t pthread_attr_t;
|
||||
# define __have_pthread_attr_t 1
|
||||
#endif
|
||||
|
||||
|
||||
typedef union
|
||||
{
|
||||
struct __pthread_mutex_s __data;
|
||||
char __size[__SIZEOF_PTHREAD_MUTEX_T];
|
||||
long int __align;
|
||||
} pthread_mutex_t;
|
||||
|
||||
|
||||
typedef union
|
||||
{
|
||||
struct __pthread_cond_s __data;
|
||||
char __size[__SIZEOF_PTHREAD_COND_T];
|
||||
__extension__ long long int __align;
|
||||
} pthread_cond_t;
|
||||
|
||||
|
||||
#if defined __USE_UNIX98 || defined __USE_XOPEN2K
|
||||
/* Data structure for reader-writer lock variable handling. The
|
||||
structure of the attribute type is deliberately not exposed. */
|
||||
typedef union
|
||||
{
|
||||
struct __pthread_rwlock_arch_t __data;
|
||||
char __size[__SIZEOF_PTHREAD_RWLOCK_T];
|
||||
long int __align;
|
||||
} pthread_rwlock_t;
|
||||
|
||||
typedef union
|
||||
{
|
||||
char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
|
||||
long int __align;
|
||||
} pthread_rwlockattr_t;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_XOPEN2K
|
||||
/* POSIX spinlock data type. */
|
||||
typedef volatile int pthread_spinlock_t;
|
||||
|
||||
|
||||
/* POSIX barriers data type. The structure of the type is
|
||||
deliberately not exposed. */
|
||||
typedef union
|
||||
{
|
||||
char __size[__SIZEOF_PTHREAD_BARRIER_T];
|
||||
long int __align;
|
||||
} pthread_barrier_t;
|
||||
|
||||
typedef union
|
||||
{
|
||||
char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
|
||||
int __align;
|
||||
} pthread_barrierattr_t;
|
||||
#endif
|
||||
|
||||
#endif
|
85
libc/glibc-include/bits/ptrace-shared.h
Normal file
85
libc/glibc-include/bits/ptrace-shared.h
Normal file
@ -0,0 +1,85 @@
|
||||
/* `ptrace' debugger support interface. Linux version,
|
||||
not architecture-specific.
|
||||
Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_PTRACE_H
|
||||
# error "Never use <bits/ptrace-shared.h> directly; include <sys/ptrace.h> instead."
|
||||
#endif
|
||||
|
||||
/* Options set using PTRACE_SETOPTIONS. */
|
||||
enum __ptrace_setoptions
|
||||
{
|
||||
PTRACE_O_TRACESYSGOOD = 0x00000001,
|
||||
PTRACE_O_TRACEFORK = 0x00000002,
|
||||
PTRACE_O_TRACEVFORK = 0x00000004,
|
||||
PTRACE_O_TRACECLONE = 0x00000008,
|
||||
PTRACE_O_TRACEEXEC = 0x00000010,
|
||||
PTRACE_O_TRACEVFORKDONE = 0x00000020,
|
||||
PTRACE_O_TRACEEXIT = 0x00000040,
|
||||
PTRACE_O_TRACESECCOMP = 0x00000080,
|
||||
PTRACE_O_EXITKILL = 0x00100000,
|
||||
PTRACE_O_SUSPEND_SECCOMP = 0x00200000,
|
||||
PTRACE_O_MASK = 0x003000ff
|
||||
};
|
||||
|
||||
enum __ptrace_eventcodes
|
||||
{
|
||||
/* Wait extended result codes for the above trace options. */
|
||||
PTRACE_EVENT_FORK = 1,
|
||||
PTRACE_EVENT_VFORK = 2,
|
||||
PTRACE_EVENT_CLONE = 3,
|
||||
PTRACE_EVENT_EXEC = 4,
|
||||
PTRACE_EVENT_VFORK_DONE = 5,
|
||||
PTRACE_EVENT_EXIT = 6,
|
||||
PTRACE_EVENT_SECCOMP = 7,
|
||||
/* Extended result codes enabled by means other than options. */
|
||||
PTRACE_EVENT_STOP = 128
|
||||
};
|
||||
|
||||
/* Arguments for PTRACE_PEEKSIGINFO. */
|
||||
struct __ptrace_peeksiginfo_args
|
||||
{
|
||||
__uint64_t off; /* From which siginfo to start. */
|
||||
__uint32_t flags; /* Flags for peeksiginfo. */
|
||||
__int32_t nr; /* How many siginfos to take. */
|
||||
};
|
||||
|
||||
enum __ptrace_peeksiginfo_flags
|
||||
{
|
||||
/* Read signals from a shared (process wide) queue. */
|
||||
PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
|
||||
};
|
||||
|
||||
/* Argument and results of PTRACE_SECCOMP_GET_METADATA. */
|
||||
struct __ptrace_seccomp_metadata
|
||||
{
|
||||
__uint64_t filter_off; /* Input: which filter. */
|
||||
__uint64_t flags; /* Output: filter's flags. */
|
||||
};
|
||||
|
||||
/* Perform process tracing functions. REQUEST is one of the values
|
||||
above, and determines the action to be taken.
|
||||
For all requests except PTRACE_TRACEME, PID specifies the process to be
|
||||
traced.
|
||||
|
||||
PID and the other arguments described above for the various requests should
|
||||
appear (those that are used for the particular request) as:
|
||||
pid_t PID, void *ADDR, int DATA, void *ADDR2
|
||||
after REQUEST. */
|
||||
extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
|
223
libc/glibc-include/bits/resource.h
Normal file
223
libc/glibc-include/bits/resource.h
Normal file
@ -0,0 +1,223 @@
|
||||
/* Bit values & structures for resource limits. Linux version.
|
||||
Copyright (C) 1994-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_RESOURCE_H
|
||||
# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
|
||||
#endif
|
||||
|
||||
#include <bits/types.h>
|
||||
|
||||
/* Transmute defines to enumerations. The macro re-definitions are
|
||||
necessary because some programs want to test for operating system
|
||||
features with #ifdef RUSAGE_SELF. In ISO C the reflexive
|
||||
definition is a no-op. */
|
||||
|
||||
/* Kinds of resource limit. */
|
||||
enum __rlimit_resource
|
||||
{
|
||||
/* Per-process CPU limit, in seconds. */
|
||||
RLIMIT_CPU = 0,
|
||||
#define RLIMIT_CPU RLIMIT_CPU
|
||||
|
||||
/* Largest file that can be created, in bytes. */
|
||||
RLIMIT_FSIZE = 1,
|
||||
#define RLIMIT_FSIZE RLIMIT_FSIZE
|
||||
|
||||
/* Maximum size of data segment, in bytes. */
|
||||
RLIMIT_DATA = 2,
|
||||
#define RLIMIT_DATA RLIMIT_DATA
|
||||
|
||||
/* Maximum size of stack segment, in bytes. */
|
||||
RLIMIT_STACK = 3,
|
||||
#define RLIMIT_STACK RLIMIT_STACK
|
||||
|
||||
/* Largest core file that can be created, in bytes. */
|
||||
RLIMIT_CORE = 4,
|
||||
#define RLIMIT_CORE RLIMIT_CORE
|
||||
|
||||
/* Largest resident set size, in bytes.
|
||||
This affects swapping; processes that are exceeding their
|
||||
resident set size will be more likely to have physical memory
|
||||
taken from them. */
|
||||
__RLIMIT_RSS = 5,
|
||||
#define RLIMIT_RSS __RLIMIT_RSS
|
||||
|
||||
/* Number of open files. */
|
||||
RLIMIT_NOFILE = 7,
|
||||
__RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */
|
||||
#define RLIMIT_NOFILE RLIMIT_NOFILE
|
||||
#define RLIMIT_OFILE __RLIMIT_OFILE
|
||||
|
||||
/* Address space limit. */
|
||||
RLIMIT_AS = 9,
|
||||
#define RLIMIT_AS RLIMIT_AS
|
||||
|
||||
/* Number of processes. */
|
||||
__RLIMIT_NPROC = 6,
|
||||
#define RLIMIT_NPROC __RLIMIT_NPROC
|
||||
|
||||
/* Locked-in-memory address space. */
|
||||
__RLIMIT_MEMLOCK = 8,
|
||||
#define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK
|
||||
|
||||
/* Maximum number of file locks. */
|
||||
__RLIMIT_LOCKS = 10,
|
||||
#define RLIMIT_LOCKS __RLIMIT_LOCKS
|
||||
|
||||
/* Maximum number of pending signals. */
|
||||
__RLIMIT_SIGPENDING = 11,
|
||||
#define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING
|
||||
|
||||
/* Maximum bytes in POSIX message queues. */
|
||||
__RLIMIT_MSGQUEUE = 12,
|
||||
#define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE
|
||||
|
||||
/* Maximum nice priority allowed to raise to.
|
||||
Nice levels 19 .. -20 correspond to 0 .. 39
|
||||
values of this resource limit. */
|
||||
__RLIMIT_NICE = 13,
|
||||
#define RLIMIT_NICE __RLIMIT_NICE
|
||||
|
||||
/* Maximum realtime priority allowed for non-priviledged
|
||||
processes. */
|
||||
__RLIMIT_RTPRIO = 14,
|
||||
#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
|
||||
|
||||
/* Maximum CPU time in µs that a process scheduled under a real-time
|
||||
scheduling policy may consume without making a blocking system
|
||||
call before being forcibly descheduled. */
|
||||
__RLIMIT_RTTIME = 15,
|
||||
#define RLIMIT_RTTIME __RLIMIT_RTTIME
|
||||
|
||||
__RLIMIT_NLIMITS = 16,
|
||||
__RLIM_NLIMITS = __RLIMIT_NLIMITS
|
||||
#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
|
||||
#define RLIM_NLIMITS __RLIM_NLIMITS
|
||||
};
|
||||
|
||||
/* Value to indicate that there is no limit. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
# define RLIM_INFINITY ((__rlim_t) -1)
|
||||
#else
|
||||
# define RLIM_INFINITY 0xffffffffffffffffuLL
|
||||
#endif
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
# define RLIM64_INFINITY 0xffffffffffffffffuLL
|
||||
#endif
|
||||
|
||||
/* We can represent all limits. */
|
||||
#define RLIM_SAVED_MAX RLIM_INFINITY
|
||||
#define RLIM_SAVED_CUR RLIM_INFINITY
|
||||
|
||||
|
||||
/* Type for resource quantity measurement. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
typedef __rlim_t rlim_t;
|
||||
#else
|
||||
typedef __rlim64_t rlim_t;
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
typedef __rlim64_t rlim64_t;
|
||||
#endif
|
||||
|
||||
struct rlimit
|
||||
{
|
||||
/* The current (soft) limit. */
|
||||
rlim_t rlim_cur;
|
||||
/* The hard limit. */
|
||||
rlim_t rlim_max;
|
||||
};
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct rlimit64
|
||||
{
|
||||
/* The current (soft) limit. */
|
||||
rlim64_t rlim_cur;
|
||||
/* The hard limit. */
|
||||
rlim64_t rlim_max;
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Whose usage statistics do you want? */
|
||||
enum __rusage_who
|
||||
{
|
||||
/* The calling process. */
|
||||
RUSAGE_SELF = 0,
|
||||
#define RUSAGE_SELF RUSAGE_SELF
|
||||
|
||||
/* All of its terminated child processes. */
|
||||
RUSAGE_CHILDREN = -1
|
||||
#define RUSAGE_CHILDREN RUSAGE_CHILDREN
|
||||
|
||||
#ifdef __USE_GNU
|
||||
,
|
||||
/* The calling thread. */
|
||||
RUSAGE_THREAD = 1
|
||||
# define RUSAGE_THREAD RUSAGE_THREAD
|
||||
/* Name for the same functionality on Solaris. */
|
||||
# define RUSAGE_LWP RUSAGE_THREAD
|
||||
#endif
|
||||
};
|
||||
|
||||
#include <bits/types/struct_timeval.h>
|
||||
#include <bits/types/struct_rusage.h>
|
||||
|
||||
/* Priority limits. */
|
||||
#define PRIO_MIN -20 /* Minimum priority a process can have. */
|
||||
#define PRIO_MAX 20 /* Maximum priority a process can have. */
|
||||
|
||||
/* The type of the WHICH argument to `getpriority' and `setpriority',
|
||||
indicating what flavor of entity the WHO argument specifies. */
|
||||
enum __priority_which
|
||||
{
|
||||
PRIO_PROCESS = 0, /* WHO is a process ID. */
|
||||
#define PRIO_PROCESS PRIO_PROCESS
|
||||
PRIO_PGRP = 1, /* WHO is a process group ID. */
|
||||
#define PRIO_PGRP PRIO_PGRP
|
||||
PRIO_USER = 2 /* WHO is a user ID. */
|
||||
#define PRIO_USER PRIO_USER
|
||||
};
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Modify and return resource limits of a process atomically. */
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource,
|
||||
const struct rlimit *__new_limit,
|
||||
struct rlimit *__old_limit) __THROW;
|
||||
# else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (prlimit, (__pid_t __pid,
|
||||
enum __rlimit_resource __resource,
|
||||
const struct rlimit *__new_limit,
|
||||
struct rlimit *__old_limit), prlimit64);
|
||||
# else
|
||||
# define prlimit prlimit64
|
||||
# endif
|
||||
# endif
|
||||
# ifdef __USE_LARGEFILE64
|
||||
extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource,
|
||||
const struct rlimit64 *__new_limit,
|
||||
struct rlimit64 *__old_limit) __THROW;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
98
libc/glibc-include/bits/sched.h
Normal file
98
libc/glibc-include/bits/sched.h
Normal file
@ -0,0 +1,98 @@
|
||||
/* Definitions of constants and data structure for POSIX 1003.1b-1993
|
||||
scheduling interface.
|
||||
Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BITS_SCHED_H
|
||||
#define _BITS_SCHED_H 1
|
||||
|
||||
#ifndef _SCHED_H
|
||||
# error "Never include <bits/sched.h> directly; use <sched.h> instead."
|
||||
#endif
|
||||
|
||||
/* Scheduling algorithms. */
|
||||
#define SCHED_OTHER 0
|
||||
#define SCHED_FIFO 1
|
||||
#define SCHED_RR 2
|
||||
#ifdef __USE_GNU
|
||||
# define SCHED_BATCH 3
|
||||
# define SCHED_ISO 4
|
||||
# define SCHED_IDLE 5
|
||||
# define SCHED_DEADLINE 6
|
||||
|
||||
# define SCHED_RESET_ON_FORK 0x40000000
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Cloning flags. */
|
||||
# define CSIGNAL 0x000000ff /* Signal mask to be sent at exit. */
|
||||
# define CLONE_VM 0x00000100 /* Set if VM shared between processes. */
|
||||
# define CLONE_FS 0x00000200 /* Set if fs info shared between processes. */
|
||||
# define CLONE_FILES 0x00000400 /* Set if open files shared between processes. */
|
||||
# define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared. */
|
||||
# define CLONE_PTRACE 0x00002000 /* Set if tracing continues on the child. */
|
||||
# define CLONE_VFORK 0x00004000 /* Set if the parent wants the child to
|
||||
wake it up on mm_release. */
|
||||
# define CLONE_PARENT 0x00008000 /* Set if we want to have the same
|
||||
parent as the cloner. */
|
||||
# define CLONE_THREAD 0x00010000 /* Set to add to same thread group. */
|
||||
# define CLONE_NEWNS 0x00020000 /* Set to create new namespace. */
|
||||
# define CLONE_SYSVSEM 0x00040000 /* Set to shared SVID SEM_UNDO semantics. */
|
||||
# define CLONE_SETTLS 0x00080000 /* Set TLS info. */
|
||||
# define CLONE_PARENT_SETTID 0x00100000 /* Store TID in userlevel buffer
|
||||
before MM copy. */
|
||||
# define CLONE_CHILD_CLEARTID 0x00200000 /* Register exit futex and memory
|
||||
location to clear. */
|
||||
# define CLONE_DETACHED 0x00400000 /* Create clone detached. */
|
||||
# define CLONE_UNTRACED 0x00800000 /* Set if the tracing process can't
|
||||
force CLONE_PTRACE on this clone. */
|
||||
# define CLONE_CHILD_SETTID 0x01000000 /* Store TID in userlevel buffer in
|
||||
the child. */
|
||||
# define CLONE_NEWCGROUP 0x02000000 /* New cgroup namespace. */
|
||||
# define CLONE_NEWUTS 0x04000000 /* New utsname group. */
|
||||
# define CLONE_NEWIPC 0x08000000 /* New ipcs. */
|
||||
# define CLONE_NEWUSER 0x10000000 /* New user namespace. */
|
||||
# define CLONE_NEWPID 0x20000000 /* New pid namespace. */
|
||||
# define CLONE_NEWNET 0x40000000 /* New network namespace. */
|
||||
# define CLONE_IO 0x80000000 /* Clone I/O context. */
|
||||
#endif
|
||||
|
||||
#include <bits/types/struct_sched_param.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Clone current process. */
|
||||
extern int clone (int (*__fn) (void *__arg), void *__child_stack,
|
||||
int __flags, void *__arg, ...) __THROW;
|
||||
|
||||
/* Unshare the specified resources. */
|
||||
extern int unshare (int __flags) __THROW;
|
||||
|
||||
/* Get index of currently used CPU. */
|
||||
extern int sched_getcpu (void) __THROW;
|
||||
|
||||
/* Get currently used CPU and NUMA node. */
|
||||
extern int getcpu (unsigned int *, unsigned int *) __THROW;
|
||||
|
||||
/* Switch process to namespace of type NSTYPE indicated by FD. */
|
||||
extern int setns (int __fd, int __nstype) __THROW;
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* bits/sched.h */
|
63
libc/glibc-include/bits/select.h
Normal file
63
libc/glibc-include/bits/select.h
Normal file
@ -0,0 +1,63 @@
|
||||
/* Copyright (C) 1997-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SELECT_H
|
||||
# error "Never use <bits/select.h> directly; include <sys/select.h> instead."
|
||||
#endif
|
||||
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 2
|
||||
|
||||
# if __WORDSIZE == 64
|
||||
# define __FD_ZERO_STOS "stosq"
|
||||
# else
|
||||
# define __FD_ZERO_STOS "stosl"
|
||||
# endif
|
||||
|
||||
# define __FD_ZERO(fdsp) \
|
||||
do { \
|
||||
int __d0, __d1; \
|
||||
__asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS \
|
||||
: "=c" (__d0), "=D" (__d1) \
|
||||
: "a" (0), "0" (sizeof (fd_set) \
|
||||
/ sizeof (__fd_mask)), \
|
||||
"1" (&__FDS_BITS (fdsp)[0]) \
|
||||
: "memory"); \
|
||||
} while (0)
|
||||
|
||||
#else /* ! GNU CC */
|
||||
|
||||
/* We don't use `memset' because this would require a prototype and
|
||||
the array isn't too big. */
|
||||
# define __FD_ZERO(set) \
|
||||
do { \
|
||||
unsigned int __i; \
|
||||
fd_set *__arr = (set); \
|
||||
for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \
|
||||
__FDS_BITS (__arr)[__i] = 0; \
|
||||
} while (0)
|
||||
|
||||
#endif /* GNU CC */
|
||||
|
||||
#define __FD_SET(d, set) \
|
||||
((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d)))
|
||||
#define __FD_CLR(d, set) \
|
||||
((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d)))
|
||||
#define __FD_ISSET(d, set) \
|
||||
((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0)
|
35
libc/glibc-include/bits/select2.h
Normal file
35
libc/glibc-include/bits/select2.h
Normal file
@ -0,0 +1,35 @@
|
||||
/* Checking macros for select functions.
|
||||
Copyright (C) 2011-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SELECT_H
|
||||
# error "Never include <bits/select2.h> directly; use <sys/select.h> instead."
|
||||
#endif
|
||||
|
||||
/* Helper functions to issue warnings and errors when needed. */
|
||||
extern long int __fdelt_chk (long int __d);
|
||||
extern long int __fdelt_warn (long int __d)
|
||||
__warnattr ("bit outside of fd_set selected");
|
||||
#undef __FD_ELT
|
||||
#define __FD_ELT(d) \
|
||||
__extension__ \
|
||||
({ long int __d = (d); \
|
||||
(__builtin_constant_p (__d) \
|
||||
? (0 <= __d && __d < __FD_SETSIZE \
|
||||
? (__d / __NFDBITS) \
|
||||
: __fdelt_warn (__d)) \
|
||||
: __fdelt_chk (__d)); })
|
24
libc/glibc-include/bits/sem-pad.h
Normal file
24
libc/glibc-include/bits/sem-pad.h
Normal file
@ -0,0 +1,24 @@
|
||||
/* Define where padding goes in struct semid_ds. x86 version.
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SEM_H
|
||||
# error "Never use <bits/sem-pad.h> directly; include <sys/sem.h> instead."
|
||||
#endif
|
||||
|
||||
#define __SEM_PAD_AFTER_TIME 1
|
||||
#define __SEM_PAD_BEFORE_TIME 0
|
97
libc/glibc-include/bits/sem.h
Normal file
97
libc/glibc-include/bits/sem.h
Normal file
@ -0,0 +1,97 @@
|
||||
/* Copyright (C) 1995-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SEM_H
|
||||
# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <bits/sem-pad.h>
|
||||
|
||||
/* Flags for `semop'. */
|
||||
#define SEM_UNDO 0x1000 /* undo the operation on exit */
|
||||
|
||||
/* Commands for `semctl'. */
|
||||
#define GETPID 11 /* get sempid */
|
||||
#define GETVAL 12 /* get semval */
|
||||
#define GETALL 13 /* get all semval's */
|
||||
#define GETNCNT 14 /* get semncnt */
|
||||
#define GETZCNT 15 /* get semzcnt */
|
||||
#define SETVAL 16 /* set semval */
|
||||
#define SETALL 17 /* set all semval's */
|
||||
|
||||
|
||||
#if __SEM_PAD_BEFORE_TIME
|
||||
# define __SEM_PAD_TIME(NAME, RES) \
|
||||
__syscall_ulong_t __glibc_reserved ## RES; __time_t NAME
|
||||
#elif __SEM_PAD_AFTER_TIME
|
||||
# define __SEM_PAD_TIME(NAME, RES) \
|
||||
__time_t NAME; __syscall_ulong_t __glibc_reserved ## RES
|
||||
#else
|
||||
# define __SEM_PAD_TIME(NAME, RES) \
|
||||
__time_t NAME
|
||||
#endif
|
||||
|
||||
/* Data structure describing a set of semaphores. */
|
||||
struct semid_ds
|
||||
{
|
||||
struct ipc_perm sem_perm; /* operation permission struct */
|
||||
__SEM_PAD_TIME (sem_otime, 1); /* last semop() time */
|
||||
__SEM_PAD_TIME (sem_ctime, 2); /* last time changed by semctl() */
|
||||
__syscall_ulong_t sem_nsems; /* number of semaphores in set */
|
||||
__syscall_ulong_t __glibc_reserved3;
|
||||
__syscall_ulong_t __glibc_reserved4;
|
||||
};
|
||||
|
||||
/* The user should define a union like the following to use it for arguments
|
||||
for `semctl'.
|
||||
|
||||
union semun
|
||||
{
|
||||
int val; <= value for SETVAL
|
||||
struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET
|
||||
unsigned short int *array; <= array for GETALL & SETALL
|
||||
struct seminfo *__buf; <= buffer for IPC_INFO
|
||||
};
|
||||
|
||||
Previous versions of this file used to define this union but this is
|
||||
incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether
|
||||
one must define the union or not. */
|
||||
#define _SEM_SEMUN_UNDEFINED 1
|
||||
|
||||
#ifdef __USE_MISC
|
||||
|
||||
/* ipcs ctl cmds */
|
||||
# define SEM_STAT 18
|
||||
# define SEM_INFO 19
|
||||
# define SEM_STAT_ANY 20
|
||||
|
||||
struct seminfo
|
||||
{
|
||||
int semmap;
|
||||
int semmni;
|
||||
int semmns;
|
||||
int semmnu;
|
||||
int semmsl;
|
||||
int semopm;
|
||||
int semume;
|
||||
int semusz;
|
||||
int semvmx;
|
||||
int semaem;
|
||||
};
|
||||
|
||||
#endif /* __USE_MISC */
|
40
libc/glibc-include/bits/semaphore.h
Normal file
40
libc/glibc-include/bits/semaphore.h
Normal file
@ -0,0 +1,40 @@
|
||||
/* Copyright (C) 2002-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SEMAPHORE_H
|
||||
# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
|
||||
#endif
|
||||
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
#if __WORDSIZE == 64
|
||||
# define __SIZEOF_SEM_T 32
|
||||
#else
|
||||
# define __SIZEOF_SEM_T 16
|
||||
#endif
|
||||
|
||||
|
||||
/* Value returned if `sem_open' failed. */
|
||||
#define SEM_FAILED ((sem_t *) 0)
|
||||
|
||||
|
||||
typedef union
|
||||
{
|
||||
char __size[__SIZEOF_SEM_T];
|
||||
long int __align;
|
||||
} sem_t;
|
40
libc/glibc-include/bits/setjmp.h
Normal file
40
libc/glibc-include/bits/setjmp.h
Normal file
@ -0,0 +1,40 @@
|
||||
/* Copyright (C) 2001-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Define the machine-dependent type `jmp_buf'. x86-64 version. */
|
||||
#ifndef _BITS_SETJMP_H
|
||||
#define _BITS_SETJMP_H 1
|
||||
|
||||
#if !defined _SETJMP_H && !defined _PTHREAD_H
|
||||
# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
|
||||
#endif
|
||||
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
#ifndef _ASM
|
||||
|
||||
# if __WORDSIZE == 64
|
||||
typedef long int __jmp_buf[8];
|
||||
# elif defined __x86_64__
|
||||
__extension__ typedef long long int __jmp_buf[8];
|
||||
# else
|
||||
typedef int __jmp_buf[6];
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* bits/setjmp.h */
|
40
libc/glibc-include/bits/setjmp2.h
Normal file
40
libc/glibc-include/bits/setjmp2.h
Normal file
@ -0,0 +1,40 @@
|
||||
/* Checking macros for setjmp functions.
|
||||
Copyright (C) 2009-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SETJMP_H
|
||||
# error "Never include <bits/setjmp2.h> directly; use <setjmp.h> instead."
|
||||
#endif
|
||||
|
||||
/* Variant of the longjmp functions which perform some sanity checking. */
|
||||
#ifdef __REDIRECT_NTH
|
||||
extern void __REDIRECT_NTHNL (longjmp,
|
||||
(struct __jmp_buf_tag __env[1], int __val),
|
||||
__longjmp_chk) __attribute__ ((__noreturn__));
|
||||
extern void __REDIRECT_NTHNL (_longjmp,
|
||||
(struct __jmp_buf_tag __env[1], int __val),
|
||||
__longjmp_chk) __attribute__ ((__noreturn__));
|
||||
extern void __REDIRECT_NTHNL (siglongjmp,
|
||||
(struct __jmp_buf_tag __env[1], int __val),
|
||||
__longjmp_chk) __attribute__ ((__noreturn__));
|
||||
#else
|
||||
extern void __longjmp_chk (struct __jmp_buf_tag __env[1], int __val),
|
||||
__THROWNL __attribute__ ((__noreturn__));
|
||||
# define longjmp __longjmp_chk
|
||||
# define _longjmp __longjmp_chk
|
||||
# define siglongjmp __longjmp_chk
|
||||
#endif
|
37
libc/glibc-include/bits/shm-pad.h
Normal file
37
libc/glibc-include/bits/shm-pad.h
Normal file
@ -0,0 +1,37 @@
|
||||
/* Define where padding goes in struct shmid_ds. Generic version.
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SHM_H
|
||||
# error "Never use <bits/shm-pad.h> directly; include <sys/shm.h> instead."
|
||||
#endif
|
||||
|
||||
#include <bits/timesize.h>
|
||||
|
||||
/* On most architectures, padding goes after time fields for 32-bit
|
||||
systems and is omitted for 64-bit systems. Some architectures pad
|
||||
before time fields instead, or omit padding despite being 32-bit,
|
||||
or include it despite being 64-bit. Furthermore, some
|
||||
architectures place shm_segsz after the time fields rather than
|
||||
before them, with or without padding there. This must match the
|
||||
layout used for struct shmid64_ds in <asm/shmbuf.h>, as glibc does
|
||||
not do layout conversions for this structure. */
|
||||
|
||||
#define __SHM_PAD_AFTER_TIME (__TIMESIZE == 32)
|
||||
#define __SHM_PAD_BEFORE_TIME 0
|
||||
#define __SHM_SEGSZ_AFTER_TIME 0
|
||||
#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0
|
118
libc/glibc-include/bits/shm.h
Normal file
118
libc/glibc-include/bits/shm.h
Normal file
@ -0,0 +1,118 @@
|
||||
/* Copyright (C) 1995-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SHM_H
|
||||
# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
|
||||
#endif
|
||||
|
||||
#include <bits/types.h>
|
||||
#include <bits/wordsize.h>
|
||||
#include <bits/shmlba.h>
|
||||
#include <bits/shm-pad.h>
|
||||
|
||||
/* Permission flag for shmget. */
|
||||
#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
|
||||
#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
|
||||
|
||||
/* Flags for `shmat'. */
|
||||
#define SHM_RDONLY 010000 /* attach read-only else read-write */
|
||||
#define SHM_RND 020000 /* round attach address to SHMLBA */
|
||||
#define SHM_REMAP 040000 /* take-over region on attach */
|
||||
#define SHM_EXEC 0100000 /* execution access */
|
||||
|
||||
/* Commands for `shmctl'. */
|
||||
#define SHM_LOCK 11 /* lock segment (root only) */
|
||||
#define SHM_UNLOCK 12 /* unlock segment (root only) */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Type to count number of attaches. */
|
||||
typedef __syscall_ulong_t shmatt_t;
|
||||
|
||||
#if __SHM_PAD_BEFORE_TIME
|
||||
# define __SHM_PAD_TIME(NAME, RES) \
|
||||
unsigned long int __glibc_reserved ## RES; __time_t NAME
|
||||
#elif __SHM_PAD_AFTER_TIME
|
||||
# define __SHM_PAD_TIME(NAME, RES) \
|
||||
__time_t NAME; unsigned long int __glibc_reserved ## RES
|
||||
#else
|
||||
# define __SHM_PAD_TIME(NAME, RES) \
|
||||
__time_t NAME
|
||||
#endif
|
||||
|
||||
/* Data structure describing a shared memory segment. */
|
||||
struct shmid_ds
|
||||
{
|
||||
struct ipc_perm shm_perm; /* operation permission struct */
|
||||
#if !__SHM_SEGSZ_AFTER_TIME
|
||||
size_t shm_segsz; /* size of segment in bytes */
|
||||
#endif
|
||||
__SHM_PAD_TIME (shm_atime, 1); /* time of last shmat() */
|
||||
__SHM_PAD_TIME (shm_dtime, 2); /* time of last shmdt() */
|
||||
__SHM_PAD_TIME (shm_ctime, 3); /* time of last change by shmctl() */
|
||||
#if __SHM_PAD_BETWEEN_TIME_AND_SEGSZ
|
||||
unsigned long int __glibc_reserved4;
|
||||
#endif
|
||||
#if __SHM_SEGSZ_AFTER_TIME
|
||||
size_t shm_segsz; /* size of segment in bytes */
|
||||
#endif
|
||||
__pid_t shm_cpid; /* pid of creator */
|
||||
__pid_t shm_lpid; /* pid of last shmop */
|
||||
shmatt_t shm_nattch; /* number of current attaches */
|
||||
__syscall_ulong_t __glibc_reserved5;
|
||||
__syscall_ulong_t __glibc_reserved6;
|
||||
};
|
||||
|
||||
#ifdef __USE_MISC
|
||||
|
||||
/* ipcs ctl commands */
|
||||
# define SHM_STAT 13
|
||||
# define SHM_INFO 14
|
||||
# define SHM_STAT_ANY 15
|
||||
|
||||
/* shm_mode upper byte flags */
|
||||
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
|
||||
# define SHM_LOCKED 02000 /* segment will not be swapped */
|
||||
# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */
|
||||
# define SHM_NORESERVE 010000 /* don't check for reservations */
|
||||
|
||||
struct shminfo
|
||||
{
|
||||
__syscall_ulong_t shmmax;
|
||||
__syscall_ulong_t shmmin;
|
||||
__syscall_ulong_t shmmni;
|
||||
__syscall_ulong_t shmseg;
|
||||
__syscall_ulong_t shmall;
|
||||
__syscall_ulong_t __glibc_reserved1;
|
||||
__syscall_ulong_t __glibc_reserved2;
|
||||
__syscall_ulong_t __glibc_reserved3;
|
||||
__syscall_ulong_t __glibc_reserved4;
|
||||
};
|
||||
|
||||
struct shm_info
|
||||
{
|
||||
int used_ids;
|
||||
__syscall_ulong_t shm_tot; /* total allocated shm */
|
||||
__syscall_ulong_t shm_rss; /* total resident shm */
|
||||
__syscall_ulong_t shm_swp; /* total swapped shm */
|
||||
__syscall_ulong_t swap_attempts;
|
||||
__syscall_ulong_t swap_successes;
|
||||
};
|
||||
|
||||
#endif /* __USE_MISC */
|
||||
|
||||
__END_DECLS
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user