From 5107cf1d7d27f17c6de68ec15a8e8d9dd5b471c1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 21 Jun 1997 02:59:26 +0000 Subject: Update. 1997-06-21 02:48 Ulrich Drepper * config.h.in: Add DO_STATIC_NSS. * config.make.in: Add build-static-nss. * elf/eval.c: Use __getdelim instead of __getline. * locale/programs/locale.c: Correct comment. * manual/libc.texinfo: Update copyright and date. Remove A4 option. * sysdeps/libm-ieee754/k_standard.c: Always return HUGE_VAL for gamma overflow. * sysdeps/libm-ieee754/w_gamma.c: Handle SVID and ISO C behaviour. * sysdeps/libm-ieee754/w_gammaf.c: Likewise. * sysdeps/libm-ieee754/w_gammalp.c: Likewise. * po/ko.po: Update. 1997-06-13 10:06 Richard Henderson The Great Bit File Move: * configure.in (AC_INIT): Look in include/ for features.h. (sysnames): Add include as the final search directory. (AC_OUTPUT): Create a bits directory in the build directory. * Makeconfig (CPPFLAGS): Look in include/ for libc-symbols.h. * Makefile: Make sure the target directory exists when installing and . * csu/Makefile: Use $(compile.S) and $(compile.c) instead of invoking $(CC) directly, as the former have the full include path. * ansidecl.h: Removed. * aliases.h: Moved to include/. * alloca.h: Likewise. * argp.h: Likewise. * argz.h: Likewise. * arpa/ftp.h: Likewise. * arpa/inet.h: Likewise. * arpa/nameser.h: Likewise. * arpa/telnet.h: Likewise. * arpa/tftp.h: Likewise. * assert.h: Likewise. * ctype.h: Likewise. * db.h: Likewise. * dirent.h: Likewise. * dlfcn.h: Likewise. * elf.h: Likewise. * endian.h: Likewise. * envz.h: Likewise. * err.h: Likewise. * errno.h: Likewise. * error.h: Likewise. * fcntl.h: Likewise. * features.h: Likewise. * fnmatch.h: Likewise. * ftw.h: Likewise. * getopt.h: Likewise. * glob.h: Likewise. * gnu-versions.h: Likewise. * grp.h: Likewise. * langinfo.h: Likewise. * libc-symbols.h: Likewise. * libgen.h: Likewise. * libintl.h: Likewise. * limits.h: Likewise. * linewrap.h: Likewise. * link.h: Likewise. * locale.h: Likewise. * malloc.h: Likewise. * math.h: Likewise. * mathcalls.h: Likewise. * mcheck.h: Likewise. * memory.h: Likewise. * netdb.h: Likewise. * netgroup.h: Likewise. * netinet/ether.h: Likewise. * netinet/in.h: Likewise. * nlist.h: Likewise. * nss.h: Likewise. * nsswitch.h: Likewise. * obstack.h: Likewise. * poll.h: Likewise. * posix1_lim.h: Likewise. * posix2_lim.h: Likewise. * printf.h: Likewise. * protocols/routed.h: Likewise. * protocols/rwhod.h: Likewise. * protocols/talkd.h: Likewise. * protocols/timed.h: Likewise. * pwd.h: Likewise. * regex.h: Likewise. * resolv.h: Likewise. * rpc/auth_unix.h: Likewise. * rpc/clnt.h: Likewise. * rpc/netdb.h: Likewise. * rpc/pmap_clnt.h: Likewise. * rpc/pmap_prot.h: Likewise. * rpc/pmap_rmt.h: Likewise. * rpc/rpc.h: Likewise. * rpc/rpc_msg.h: Likewise. * rpc/svc.h: Likewise. * rpc/svc_auth.h: Likewise. * rpc/types.h: Likewise. * rpc/xdr.h: Likewise. * sched.h: Likewise. * search.h: Likewise. * set-hooks.h: Likewise. * setjmp.h: Likewise. * sgtty.h: Likewise. * shadow.h: Likewise. * signal.h: Likewise. * stab.def: Likewise. * stab.h: Likewise. * stdio.h: Likewise. * stdlib.h: Likewise. * string.h: Likewise. * strings.h: Likewise. * sys/bitypes.h: Likewise. * sys/cdefs.h: Likewise. * sys/dir.h: Likewise. * sys/errno.h: Likewise. * sys/fcntl.h: Likewise. * sys/file.h: Likewise. * sys/gmon.h: Likewise. * sys/ioctl.h: Likewise. * sys/ipc.h: Likewise. * sys/msg.h: Likewise. * sys/poll.h: Likewise. * sys/queue.h: Likewise. * sys/resource.h: Likewise. * sys/select.h: Likewise. * sys/sem.h: Likewise. * sys/shm.h: Likewise. * sys/signal.h: Likewise. * sys/socket.h: Likewise. * sys/stat.h: Likewise. * sys/statfs.h: Likewise. * sys/syslog.h: Likewise. * sys/termios.h: Likewise. * sys/time.h: Likewise. * sys/timeb.h: Likewise. * sys/times.h: Likewise. * sys/types.h: Likewise. * sys/uio.h: Likewise. * sys/un.h: Likewise. * sys/unistd.h: Likewise. * sys/utsname.h: Likewise. * sys/vlimit.h: Likewise. * sys/vtimes.h: Likewise. * sys/wait.h: Likewise. * syscall.h: Likewise. * syslog.h: Likewise. * tar.h: Likewise. * termios.h: Likewise. * time.h: Likewise. * ttyent.h: Likewise. * unistd.h: Likewise. * utime.h: Likewise. * utmp.h: Likewise. * values.h: Likewise. * wchar.h: Likewise. * wctype.h: Likewise. * wordexp.h: Likewise. * xlocale.h: Likewise. * xopen_lim.h: Likewise. * linuxthreads/sysdeps/alpha/semaphorebits.h: -> .../bits/semaphore.h. * linuxthreads/sysdeps/powerpc/semaphorebits.h: Likewise. * linuxthreads/sysdeps/pthread/cmpxchg/semaphorebits.h: Likewise. * linuxthreads/sysdeps/pthread/no-cmpxchg/semaphorebits.h: Likewise. * linuxthreads/sysdeps/pthread/libc-lock.h: -> bits/ * sysdeps/mach/libc-lock.h: Likewise. * sysdeps/stub/libc-lock.h: Likewise. * linuxthreads/sysdeps/pthread/stdio-lock.h: Likewise. * linuxthreads/sysdeps/unix/sysv/linux/local_lim.h: Likewise. * sysdeps/mach/hurd/local_lim.h: Likewise. * sysdeps/stub/local_lim.h: Likewise. * sysdeps/unix/sysv/linux/local_lim.h: Likewise. * sysdeps/unix/sysv/local_lim.h: Likewise. * sysdeps/unix/sysv/sco3.2/local_lim.h: Likewise. * linuxthreads/sysdeps/unix/sysv/linux/posix_opt.h: Likewise. * sysdeps/mach/hurd/posix_opt.h: Likewise. * sysdeps/stub/posix_opt.h: Likewise. * sysdeps/unix/bsd/posix_opt.h: Likewise. * sysdeps/unix/bsd/ultrix4/posix_opt.h: Likewise. * sysdeps/unix/sysv/linux/posix_opt.h: Likewise. * math/cmathcalls.h: -> bits/ * math/mathcalls.h: Likewise. * misc/stab.def: -> bits/ * posix/posix1_lim.h: -> bits/ * posix/posix2_lim.h: Likewise. * sysdeps/alpha/__math.h: -> .../fpu/bits/mathinline.h * sysdeps/i386/fpu/__math.h: Likewise. * sysdeps/m68k/fpu/__math.h: Likewise. * sysdeps/m68k/fpu/switch/__math.h: Likewise. * sysdeps/powerpc/__math.h: Likewise. * sysdeps/stub/__math.h: Likewise. * sysdeps/alpha/bytesex.h: -> .../bits/endian.h * sysdeps/arm/bytesex.h: Likewise. * sysdeps/i386/bytesex.h: Likewise. * sysdeps/m68k/bytesex.h: Likewise. * sysdeps/mips/bytesex.h: Likewise. * sysdeps/mips/dec/bytesex.h: Likewise. * sysdeps/mips/mipsel/bytesex.h: Likewise. * sysdeps/mips/p40/bytesex.h: Likewise. * sysdeps/sparc/bytesex.h: Likewise. * sysdeps/stub/bytesex.h: Likewise. * sysdeps/alpha/fpu/fenvbits.h: -> .../bits/fenv.h * sysdeps/i386/fpu/fenvbits.h: Likewise. * sysdeps/m68k/fpu/fenvbits.h: Likewise. * sysdeps/powerpc/fenvbits.h: Likewise. * sysdeps/stub/fenvbits.h: Likewise. * sysdeps/alpha/jmp_buf.h: -> .../bits/setenv.h * sysdeps/arm/jmp_buf.h: Likewise. * sysdeps/i386/jmp_buf.h: Likewise. * sysdeps/m68k/jmp_buf.h: Likewise. * sysdeps/mips/jmp_buf.h: Likewise. * sysdeps/sparc/jmp_buf.h: Likewise. * sysdeps/powerpc/jmp_buf.h: Likewise. * sysdeps/stub/jmp_buf.h: Likewise. * sysdeps/vax/jmp_buf.h: Likewise. * sysdeps/generic/confname.h: -> bits/ * sysdeps/unix/sysv/irix4/confname.h: Likewise. * sysdeps/unix/sysv/sco3.2.4/confname.h: Likewise. * sysdeps/generic/gnu/types.h: -> ../bits/types.h * sysdeps/unix/sysv/linux/alpha/gnu/types.h: Likewise. * sysdeps/unix/sysv/linux/gnu/types.h: Likewise. * sysdeps/generic/ioctl-types.h: -> bits/ * sysdeps/unix/sysv/linux/ioctl-types.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/ioctl-types.h: Likewise. * sysdeps/generic/iovec.h: -> .../bits/uio.h * sysdeps/unix/sysv/linux/iovec.h: Likewise. * sysdeps/generic/mathbits.h: -> .../bits/mathdef.h * sysdeps/i386/fpu/mathbits.h: Likewise. * sysdeps/m68k/fpu/mathbits.h: Likewise. * sysdeps/powerpc/mathbits.h: Likewise. * sysdeps/generic/resourcebits.h: -> .../bits/resource.h * sysdeps/unix/bsd/sun/sunos4/resourcebits.h: Likewise. * sysdeps/unix/sysv/linux/resourcebits.h: Likewise. * sysdeps/generic/schedbits.h: -> .../bits/sched.h * sysdeps/unix/sysv/linux/schedbits.h: Likewise. * sysdeps/generic/selectbits.h: -> .../bits/select.h * sysdeps/i386/selectbits.h: Likewise. * sysdeps/generic/sigaction.h: -> bits/ * sysdeps/unix/bsd/osf/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/alpha/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sigaction.h: Likewise. * sysdeps/unix/sysv/minix/sigaction.h: Likewise. * sysdeps/unix/sysv/sco3.2.4/sigaction.h: Likewise. * sysdeps/unix/sysv/sysv4/sigaction.h: Likewise. * sysdeps/generic/sigset.h: -> bits/ * sysdeps/unix/sysv/linux/sigset.h: Likewise. * sysdeps/unix/sysv/sysv4/sigset.h: Likewise. * sysdeps/generic/sockaddrcom.h: -> .../bits/sockaddr.h * sysdeps/unix/bsd/bsd4.4/sockaddrcom.h: Likewise. * sysdeps/generic/socketbits.h: -> .../bits/socket.h * sysdeps/unix/sysv/linux/socketbits.h: Likewise. * sysdeps/generic/statfsbuf.h: -> .../bits/statfs.h * sysdeps/unix/sysv/linux/statfsbuf.h: Likewise. * sysdeps/generic/termbits.h: -> .../bits/termios.h * sysdeps/unix/bsd/sun/sunos4/termbits.h: Likewise. * sysdeps/unix/sysv/linux/alpha/termbits.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/termbits.h: Likewise. * sysdeps/unix/sysv/linux/sparc/termbits.h: Likewise. * sysdeps/unix/sysv/linux/termbits.h: Likewise. * sysdeps/generic/ustatbits.h: -> .../bits/ustat.h * sysdeps/unix/sysv/linux/ustatbits.h: Likewise. * sysdeps/generic/utmpbits.h: -> .../bits/utmp.h * sysdeps/gnu/utmpbits.h: Likewise. * sysdeps/unix/sysv/utmpbits.h: Likewise. * sysdeps/generic/utsnamelen.h: -> .../bits/utsname.h * sysdeps/unix/bsd/sun/sunos4/utsnamelen.h: Likewise. * sysdeps/unix/bsd/ultrix4/utsnamelen.h: Likewise. * sysdeps/unix/sysv/linux/utsnamelen.h: Likewise. * sysdeps/unix/sysv/sysv4/utsnamelen.h: Likewise. * sysdeps/unix/sysv/utsnamelen.h: Likewise. * sysdeps/generic/waitstatus.h: -> bits/ * sysdeps/i386/huge_val.h: -> bits/ * sysdeps/ieee754/huge_val.h: Likewise. * sysdeps/m68k/huge_val.h: Likewise. * sysdeps/stub/huge_val.h: Likewise. * sysdeps/vax/huge_val.h: Likewise. * sysdeps/ieee754/nan.h: Likewise. * sysdeps/stub/nan.h: Likewise. * sysdeps/mach/hurd/alpha/sigcontext.h: -> bits/ * sysdeps/mach/hurd/hppa/sigcontext.h: Likewise. * sysdeps/mach/hurd/i386/sigcontext.h: Likewise. * sysdeps/mach/hurd/mips/sigcontext.h: Likewise. * sysdeps/stub/sigcontext.h: Likewise. * sysdeps/unix/bsd/sun/m68k/sigcontext.h: Likewise. * sysdeps/unix/bsd/sun/sparc/sigcontext.h: Likewise. * sysdeps/unix/bsd/ultrix4/mips/sigcontext.h: Likewise. * sysdeps/unix/sysv/linux/sigcontext.h: Likewise. * sysdeps/mach/hurd/errnos.h: -> .../bits/errno.h * sysdeps/standalone/arm/errnos.h: Likewise. * sysdeps/stub/errnos.h: Likewise. * sysdeps/unix/bsd/bsd4.4/errnos.h: Likewise. * sysdeps/unix/sysv/linux/errnos.h: Likewise. * sysdeps/mach/hurd/fcntlbits.h: -> .../bits/fcntl.h * sysdeps/stub/fcntlbits.h: Likewise. * sysdeps/unix/bsd/bsd4.4/fcntlbits.h: Likewise. * sysdeps/unix/bsd/fcntlbits.h: Likewise. * sysdeps/unix/bsd/sun/sunos4/fcntlbits.h: Likewise. * sysdeps/unix/bsd/ultrix4/fcntlbits.h: Likewise. * sysdeps/unix/common/fcntlbits.h: Likewise. * sysdeps/unix/sysv/fcntlbits.h: Likewise. * sysdeps/unix/sysv/irix4/fcntlbits.h: Likewise. * sysdeps/unix/sysv/linux/alpha/fcntlbits.h: Likewise. * sysdeps/unix/sysv/linux/fcntlbits.h: Likewise. * sysdeps/unix/sysv/linux/sparc/fcntlbits.h: Likewise. * sysdeps/mach/hurd/ioctls.h: -> bits/ * sysdeps/stub/ioctls.h: Likewise. * sysdeps/unix/bsd/bsd4.4/ioctls.h: Likewise. * sysdeps/unix/sysv/linux/alpha/ioctls.h: Likewise. * sysdeps/unix/sysv/linux/ioctls.h: Likewise. * sysdeps/unix/sysv/linux/sparc/ioctls.h: Likewise. * sysdeps/mach/hurd/statbuf.h: -> .../bits/stat.h * sysdeps/stub/statbuf.h: Likewise. * sysdeps/unix/bsd/osf/alpha/statbuf.h: Likewise. * sysdeps/unix/bsd/statbuf.h: Likewise. * sysdeps/unix/sysv/irix4/statbuf.h: Likewise. * sysdeps/unix/sysv/linux/alpha/statbuf.h: Likewise. * sysdeps/unix/sysv/linux/statbuf.h: Likewise. * sysdeps/unix/sysv/statbuf.h: Likewise. * sysdeps/unix/sysv/sysv4/i386/statbuf.h: Likewise. * sysdeps/unix/sysv/sysv4/solaris2/statbuf.h: Likewise. * sysdeps/standalone/stdio_lim.h: -> bits/ * sysdeps/stub/stdio_lim.h: Likewise. * sysdeps/stub/direntry.h: -> ../bits/dirent.h * sysdeps/unix/bsd/bsd4.4/direntry.h: Likewise. * sysdeps/unix/bsd/direntry.h: Likewise. * sysdeps/unix/common/direntry.h: Likewise. * sysdeps/unix/sysv/direntry.h: Likewise. * sysdeps/unix/sysv/linux/direntry.h: Likewise. * sysdeps/stub/elfclass.h: -> bits/ * sysdeps/wordsize-32/elfclass.h: Likewise. * sysdeps/wordsize-64/elfclass.h: Likewise. * sysdeps/stub/signum.h: -> bits/ * sysdeps/unix/bsd/signum.h: Likewise. * sysdeps/unix/bsd/sun/signum.h: Likewise. * sysdeps/unix/sysv/irix4/signum.h: Likewise. * sysdeps/unix/sysv/linux/alpha/signum.h: Likewise. * sysdeps/unix/sysv/linux/signum.h: Likewise. * sysdeps/unix/sysv/linux/sparc/signum.h: Likewise. * sysdeps/unix/sysv/signum.h: Likewise. * sysdeps/unix/sysv/sysv4/signum.h: Likewise. * sysdeps/unix/sysv/sysv4/solaris2/signum.h: Likewise. * sysdeps/stub/sys/ipc_buf.h: -> .../bits/ipc.h * sysdeps/unix/sysv/linux/alpha/sys/ipc_buf.h: Likewise. * sysdeps/unix/sysv/linux/sys/ipc_buf.h: Likewise. * sysdeps/stub/sys/msq_buf.h: -> .../bits/msq.h * sysdeps/unix/sysv/linux/sys/msq_buf.h: Likewise. * sysdeps/stub/sys/sem_buf.h: -> .../bits/sem.h * sysdeps/unix/sysv/linux/sys/sem_buf.h: Likewise. * sysdeps/stub/sys/shm_buf.h: -> .../bits/shm.h * sysdeps/unix/sysv/linux/sys/shm_buf.h: Likewise. * sysdeps/stub/timebits.h: -> .../bits/time.h * sysdeps/unix/sysv/linux/alpha/timebits.h: Likewise. * sysdeps/unix/sysv/linux/timebits.h: Likewise. * sysdeps/stub/waitflags.h: -> bits/ * sysdeps/unix/bsd/waitflags.h: Likewise. * sysdeps/unix/sysv/linux/waitflags.h: Likewise. * sysdeps/unix/sysv/sysv4/waitflags.h: Likewise. * sysdeps/unix/sysv/linux/alpha/sys/kernel_termios.h: -> ../ * sysdeps/unix/sysv/linux/powerpc/sys/kernel_termios.h: Likewise. * sysdeps/unix/sysv/linux/sys/kernel_termios.h: Likewise. * sysdeps/unix/sysv/linux/sys/socketcall.h: -> ../ * argp/argp-fmtstream.h: Standardize the multiple-include protect. * argp/argp.h: Likewise. * catgets/nl_types.h: Likewise. * crypt/sysdeps/unix/crypt.h: Likewise. * ctype/ctype.h: Likewise. * db/db.h: Likewise. * db/mpool.h: Likewise. * db/ndbm.h: Likewise. * dirent/dirent.h: Likewise. * elf/dlfcn.h: Likewise. * elf/elf.h: Likewise. * elf/link.h: Likewise. * gmon/sys/gmon.h: Likewise. * gmon/sys/gmon_out.h: Likewise. * grp/grp.h: Likewise. * inet/aliases.h: Likewise. * inet/arpa/ftp.h: Likewise. * inet/arpa/inet.h: Likewise. * inet/arpa/telnet.h: Likewise. * inet/arpa/tftp.h: Likewise. * inet/netinet/ether.h: Likewise. * inet/netinet/icmp6.h: Likewise. * inet/netinet/in.h: Likewise. * inet/netinet/ip6.h: Likewise. * inet/protocols/routed.h: Likewise. * inet/protocols/rwhod.h: Likewise. * inet/protocols/talkd.h: Likewise. * inet/protocols/timed.h: Likewise. * intl/libintl.h: Likewise. * io/fcntl.h: Likewise. * io/fts.h: Likewise. * io/ftw.h: Likewise. * io/sys/poll.h: Likewise. * io/sys/stat.h: Likewise. * io/sys/statfs.h: Likewise. * io/utime.h: Likewise. * linuxthreads/semaphore.h: Likewise. * linuxthreads/sysdeps/pthread/pthread.h: Likewise. * locale/locale.h: Likewise. * login/pty.h: Likewise. * login/utmp.h: Likewise. * malloc/malloc.h: Likewise. * malloc/obstack.h: Likewise. * math/complex.h: Likewise. * math/fenv.h: Likewise. * math/math.h: Likewise. * md5-crypt/md5.h: Likewise. * misc/ar.h: Likewise. * misc/err.h: Likewise. * misc/error.h: Likewise. * misc/fstab.h: Likewise. * misc/libgen.h: Likewise. * misc/nlist.h: Likewise. * misc/sys/cdefs.h: Likewise. * misc/sys/file.h: Likewise. * misc/sys/ioctl.h: Likewise. * misc/sys/queue.h: Likewise. * misc/sys/select.h: Likewise. * misc/sys/syslog.h: Likewise. * misc/sys/uio.h: Likewise. * misc/sysexits.h: Likewise. * misc/ttyent.h: Likewise. * nss/nss.h: Likewise. * posix/fnmatch.h: Likewise. * posix/getopt.h: Likewise. * posix/glob.h: Likewise. * posix/regex.h: Likewise. * posix/sys/times.h: Likewise. * posix/sys/types.h: Likewise. * posix/sys/utsname.h: Likewise. * posix/sys/wait.h: Likewise. * posix/tar.h: Likewise. * posix/unistd.h: Likewise. * posix/wordexp.h: Likewise. * pwd/pwd.h: Likewise. * resolv/arpa/nameser.h: Likewise. * resolv/netdb.h: Likewise. * resolv/resolv.h: Likewise. * resource/sys/resource.h: Likewise. * resource/sys/vlimit.h: Likewise. * resource/sys/vtimes.h: Likewise. * setjmp/setjmp.h: Likewise. * shadow/shadow.h: Likewise. * socket/sys/socket.h: Likewise. * socket/sys/un.h: Likewise. * stdlib/exit.h: Likewise. * stdlib/fmtmsg.h: Likewise. * stdlib/monetary.h: Likewise. * stdlib/stdlib.h: Likewise. * string/argz.h: Likewise. * string/envz.h: Likewise. * string/memory.h: Likewise. * string/string.h: Likewise. * string/strings.h: Likewise. * sunrpc/rpc/rpc.h: Likewise. * sunrpc/rpc/svc.h: Likewise. * sunrpc/rpc/types.h: Likewise. * sunrpc/rpc/xdr.h: Likewise. * termios/sys/ttychars.h: Likewise. * termios/termios.h: Likewise. * argp/argp-parse.c: -> . * crypt/sysdeps/unix/crypt_util.c: Likewise. * dirent/dirent.h: Likewise. * elf/link.h: Likewise. * grp/fgetgrent.c: Likewise. * grp/grp.h: Likewise. * hurd/hurd/ioctl.h: Likewise. * inet/getnameinfo.c: Likewise. * inet/getnetgrent_r.c: Likewise. * inet/inet_ntoa.c: Likewise. * inet/netinet/in.h: Likewise. * io/fcntl.h: Likewise. * io/ftw.h: Likewise. * io/sys/stat.h: Likewise. * io/sys/statfs.h: Likewise. * io/utime.h: Likewise. * libio/_G_config.h: Likewise. * libio/libio.h: Likewise. * libio/libioP.h: Likewise. * libio/stdio.h: Likewise. * linuxthreads/lockfile.c: Likewise. * linuxthreads/semaphore.h: Likewise. * locale/duplocale.c: Likewise. * locale/freelocale.c: Likewise. * locale/lc-time.c: Likewise. * locale/setlocale.c: Likewise. * login/getutent_r.c: Likewise. * login/getutid_r.c: Likewise. * login/getutline_r.c: Likewise. * login/lastlog.h: Likewise. * login/pty.h: Likewise. * login/utmp.h: Likewise. * login/utmpname.c: Likewise. * malloc/mtrace.c: Likewise. * malloc/thread-m.h: Likewise. * math/complex.h: Likewise. * math/fenv.h: Likewise. * math/libm-test.c: Likewise. * math/math.h: Likewise. * misc/sgtty.h: Likewise. * misc/stab.h: Likewise. * misc/sys/ioctl.h: Likewise. * misc/sys/select.h: Likewise. * misc/sys/uio.h: Likewise. * misc/sys/ustat.h: Likewise. * misc/syslog.c: Likewise. * nis/nss_compat/compat-grp.c: Likewise. * nis/nss_compat/compat-pwd.c: Likewise. * nis/nss_compat/compat-spwd.c: Likewise. * nis/nss_nis/nis-alias.c: Likewise. * nis/nss_nis/nis-ethers.c: Likewise. * nis/nss_nis/nis-grp.c: Likewise. * nis/nss_nis/nis-hosts.c: Likewise. * nis/nss_nis/nis-netgrp.c: Likewise. * nis/nss_nis/nis-network.c: Likewise. * nis/nss_nis/nis-proto.c: Likewise. * nis/nss_nis/nis-publickey.c: Likewise. * nis/nss_nis/nis-pwd.c: Likewise. * nis/nss_nis/nis-rpc.c: Likewise. * nis/nss_nis/nis-service.c: Likewise. * nis/nss_nis/nis-spwd.c: Likewise. * nss_nisplus/nisplus-alias.c: Likewise. * nis/nss_nisplus/nisplus-ethers.c: Likewise. * nis/nss_nisplus/nisplus-grp.c: Likewise. * nis/nss_nisplus/nisplus-hosts.c: Likewise. * nis/nss_nisplus/nisplus-netgrp.c: Likewise. * nis/nss_nisplus/nisplus-netgrp.c: Likewise. * nis/nss_nisplus/nisplus-proto.c: Likewise. * nis/nss_nisplus/nisplus-pwd.c: Likewise. * nis/nss_nisplus/nisplus-rpc.c: Likewise. * nis/nss_nisplus/nisplus-service.c: Likewise. * nis/nss_nisplus/nisplus-spwd.c: Likewise. * nis/ypclnt.c: Likewise. * nss/getXXbyYY.c: Likewise. * nss/getXXent.c: Likewise. * nss/getXXent_r.c: Likewise. * nss/nss_db/db-XXX.c: Likewise. * nss/nss_db/db-alias.c: Likewise. * nss/nss_db/db-netgrp.c: Likewise. * nss/nss_files/files-XXX.c: Likewise. * nss/nss_files/files-alias.c: Likewise. * nss/nsswitch.c: Likewise. * posix/sched.h: Likewise. * posix/sys/types.h: Likewise. * posix/sys/utsname.h: Likewise. * posix/sys/wait.h: Likewise. * posix/unistd.h: Likewise. * pwd/fgetpwent.c: Likewise. * pwd/pwd.h: Likewise. * resource/sys/resource.h: Likewise. * setjmp/setjmp.h: Likewise. * shadow/fgetspent.c: Likewise. * shadow/lckpwdf.c: Likewise. * shadow/sgetspent.c: Likewise. * signal/signal.h: Likewise. * signal/sigsetops.c: Likewise. * socket/sys/socket.h: Likewise. * socket/sys/un.h: Likewise. * stdio/stdio.h: Likewise. * stdio-common/vfprintf.c: Likewise. * stdio-common/vfscanf.c: Likewise. * stdlib/atexit.c: Likewise. * stdlib/fmtmsg.c: Likewise. * stdlib/random.c: Likewise. * string/endian.h: Likewise. * sysdeps/alpha/w_sqrt.S: Likewise. * sysdeps/arm/__longjmp.S: Likewise. * sysdeps/arm/setjmp.S: Likewise. * sysdeps/generic/abort.c: Likewise. * sysdeps/generic/netinet/ip.h: Likewise. * sysdeps/generic/setenv.c: Likewise. * generic/sys/mman.h: Likewise. * sysdeps/i386/__longjmp.S: Likewise. * sysdeps/i386/setjmp.S: Likewise. * sysdeps/mach/hurd/dirstream.h: Likewise. * sysdeps/mach/hurd/jmp-unwind.c: Likewise. * sysdeps/posix/mk-stdiolim.c: Likewise. * sysdeps/powerpc/__longjmp.S: Likewise. * sysdeps/powerpc/setjmp.S: Likewise. * sysdeps/sparc/__longjmp.S: Likewise. * sysdeps/sparc/setjmp.S: Likewise. * sysdeps/standalone/close.c: Likewise. * sysdeps/standalone/filedesc.h: Likewise. * sysdeps/standalone/open.c: Likewise. * sysdeps/unix/bsd/bsd4.4/tcsetattr.c: Likewise. * sysdeps/unix/bsd/m68k/sysdep.S: Likewise. * sysdeps/unix/bsd/osf/sys/mman.h: Likewise. * sysdeps/unix/bsd/sun/m68k/sethostid.S: Likewise. * sysdeps/unix/bsd/sun/sparc/sethostid.S: Likewise. * sysdeps/unix/bsd/sun/sunos4/sys/mman.h: Likewise. * sysdeps/unix/bsd/ultrix4/sys/mman.h: Likewise. * sysdeps/unix/bsd/vax/sysdep.S: Likewise. * sysdeps/unix/dirstream.h: Likewise. * sysdeps/unix/i386/sysdep.S: Likewise. * sysdeps/unix/mips/sysdep.S: Likewise. * sysdeps/unix/mk-local_lim.c: Likewise. * sysdeps/unix/sparc/sysdep.S: Likewise. * sysdeps/unix/sysv/irix4/sys/mman.h: Likewise. * sysdeps/unix/sysv/linux/alpha/brk.S: Likewise. * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise. * sysdeps/unix/sysv/linux/arm/clone.S: Likewise. * sysdeps/unix/sysv/linux/i386/clone.S: Likewise. * sysdeps/unix/sysv/linux/m68k/clone.S: Likewise. * sysdeps/unix/sysv/linux/netinet/ip.h: Likewise. * sysdeps/unix/sysv/linux/netinet/tcp.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/clone.S: Likewise. * sysdeps/unix/sysv/linux/sys/mman.h: Likewise. * sysdeps/unix/sysv/linux/sys/syscall.h: Likewise. * sysdeps/unix/sysv/linux/tcgetattr.c: Likewise. * sysdeps/unix/sysv/sco3.2.4/sysconf.S: Likewise. * sysdeps/unix/sysv/sysv4/i386/sysdep.h: Likewise. * sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.S: Likewise. * sysvipc/sys/ipc.h: Likewise. * sysvipc/sys/msg.h: Likewise. * sysvipc/sys/sem.h: Likewise. * sysvipc/sys/shm.h: Likewise. * termios/termios.h: Likewise. * time/localtime.c: Likewise. * time/sys/time.h: Likewise. * time/time.h: Likewise. * time/tzset.c: Likewise. * sysdeps/unix/sysv/linux/arm/socket.S: socketcall.h change. * sysdeps/unix/sysv/linux/i386/socket.S: Likewise. * sysdeps/unix/sysv/linux/m68k/socket.S: Likewise. * sysdeps/unix/sysv/linux/powerpc/socket.S: Likewise. * sysdeps/unix/sysv/linux/sparc/socket.S: Likewise. * Makefile (headers): foo.h -> bits/foo.h. * dirent/Makefile: Likewise. * elf/Makefile: Likewise. * io/Makefile: Likewise. * linuxthreads/Makefile: Likewise. * linuxthreads/sysdeps/pthread/Makefile: Likewise. * login/Makefile: Likewise. * math/Makefile: Likewise. * misc/Makefile: Likewise. * posix/Makefile: Likewise. * resource/Makefile: Likewise. * setjmp/Makefile: Likewise. * signal/Makefile: Likewise. * socket/Makefile: Likewise. * stdio-common/Makefile: Likewise. * sysdeps/unix/sysv/linux/Makefile: Likewise. * sysvipc/Makefile: Likewise. * termios/Makefile: Likewise. * time/Makefile: Likewise. * sysdeps/generic/Makefile (make_siglist-CFLAGS): Likewise. * sysdeps/posix/Makefile: stdio_lim.h -> bits/stdio_lim.h * sysdeps/unix/Makefile: Likewise with local_lim.h, errnos.h, ioctls.h, termbits.h. * sysdeps/unix/sysv/linux/Dist: sys/kernel_termios.h -> kernel_termios.h, sys/socketcall.h -> socketcall.h * elf/elf.h: Use definitions instead of __attribute__ for getting the proper length on the ELF types to be friendly to non-gcc compilers. * posix/sys/types.h: Notice when int8_t and friends are defined and don't redefine them. * sysdeps/wordsize-32/inttypes.h: Likewise. * sysdeps/wordsize-64/inttypes.h: Likewise. * sysdeps/unix/sysv/linux/arm/profil-counter.h: Get sigcontext via instead. * sysdeps/unix/sysv/linux/i386/profil-counter.h: Likewise. * sysdeps/unix/sysv/linux/sparc/profil-counter.h: Likewise. 1997-06-20 17:59 Kazumoto Kojima * hurd/intr-msg.c: More 64bit changes. * mach/msg-destroy.c: Likewise. * sysdeps/mach/hurd/ioctl.c: Likewise. * sysdeps/mach/hurd/ioctls.h: Likewise. * sysdeps/mach/hurd/select.c: Likewise. * sysdeps/mach/hurd/statbuf.h: Likewise. * sysdeps/mach/hurd/mips/dl-machine.c: Hurd/MIPS64 patches. * sysdeps/mach/hurd/mips/exc2signal.c: Likewise. * sysdeps/mach/hurd/mips/init-fault.c: Likewise. * sysdeps/mach/hurd/mips/init-first.c: Likewise. * sysdeps/mach/hurd/mips/intr-msg.h: Likewise. * sysdeps/mach/hurd/mips/longjmp-ctx.c: Likewise. * sysdeps/mach/hurd/mips/longjmp-ts.c: Likewise. * sysdeps/mach/hurd/mips/sigcontext.h: Likewise. * sysdeps/mach/hurd/mips/sigreturn.c: Likewise. * sysdeps/mach/hurd/mips/trampoline.c: Likewise. * sysdeps/mach/mips/cacheflush.c: Likewise. * sysdeps/mach/mips/machine-lock.h: Likewise. * sysdeps/mach/mips/machine-sp.h: Likewise. * sysdeps/mach/mips/syscall.S: Likewise. * sysdeps/mach/mips/sysdep.h: Likewise. * sysdeps/mach/mips/thread_state.h: Likewise. * sysdeps/mach/start.c: Likewise. * sysdeps/mips/dl-machine.h: MIPS changes. * sysdeps/mips/elf/start.S: Likewise. * sysdeps/mips/init-first.c: Likewise. * sysdeps/mips/fpu_control.h: Likewise. * sysdeps/mips/machine-gmon.h: Likewise. * sysdeps/mips/jmp_buf.h: Likewise. * sysdeps/mips/__longjmp.c: Likewise. * sysdeps/mips/bsd-_setjmp.S: Likewise. * sysdeps/mips/bsd-setjmp.S: Likewise. * sysdeps/mips/setjmp.S: Likewise. * sysdeps/mips/setjmp_aux.c: Likewise. * sysdeps/mips/mips64/gmp-mparam.h: Likewise. * sysdeps/mips/add_n.S: New file. * sysdeps/mips/addmul_1.S: Likewise. * sysdeps/mips/lshift.S: Likewise. * sysdeps/mips/mul_1.S: Likewise. * sysdeps/mips/rshift.S: Likewise. * sysdeps/mips/sub_n.S: Likewise. * sysdeps/mips/submul_1.S: Likewise. * sysdeps/mips/mips64/Implies: Likewise. * sysdeps/mips/mips64/add_n.S: Likewise. * sysdeps/mips/mips64/addmul_1.S: Likewise. * sysdeps/mips/mips64/lshift.S: Likewise. * sysdeps/mips/mips64/mul_1.S: Likewise. * sysdeps/mips/mips64/rshift.S: Likewise. * sysdeps/mips/mips64/sub_n.S: Likewise. * sysdeps/mips/mips64/submul_1.S: Likewise. * sysdeps/mips/add_n.S: Removed. * sysdeps/mips/addmul_1.S: Likewise. * sysdeps/mips/lshift.S: Likewise. * sysdeps/mips/mul_1.S: Likewise. * sysdeps/mips/rshift.S: Likewise. * sysdeps/mips/sub_n.S: Likewise. * sysdeps/mips/submul_1.S: Likewise. * nss/Makefile: Prepare for static NSS. * resolv/Makefile: Likewise. * nss/nsswitch.c: Add code for static NSS. * nss/function.def: Define functions for static NSS. 1997-06-19 11:10 Andreas Schwab * libc.map: Add yet more symbols. 1997-06-19 20:33 Andreas Schwab * elf/dl-lookup.c (_dl_lookup_versioned_symbol): Don't pass NULL as object name to _dl_signal_error. (do_lookup): Skip objects that could not be opened. * sysdeps/m68k/dl-machine.h (elf_machine_rela): Check that the symbol was found. * sysdeps/i386/dl-machine.h (elf_machine_rel): Likewise. * sysdeps/powerpc/dl-machine.h (elf_machine_rela): Likewise. 1997-06-20 03:13 Kazumoto Kojima * ctype/ctype-info.c: Use int32_t where `int' with 4 bytes is assumed. * ctype/ctype.h: Likewise. * math/math_private.h: Likewise. * inet/netinet/in.h: Likewise. * wctype/wctype.h: Likewise. * nss/Makefile: Only inhibit nss_files and nss_db modules if static NSS modules are not enabled. * resolv/Makefile: Likewise for nss_dns. * nss/function.def: New file. List all available lookup functions for static NSS. * nss/nsswitch.c: Add code for static NSS. 1997-06-15 21:15 Andreas Jaeger * math/libm-test.c (gamma_test): Test for _SVID_ and for normal behaviour. 1997-06-15 20:32 Andreas Jaeger * math/libm.map: Add all necessary functions, correct existing entries. 1997-06-20 02:35 a sun * sysdeps/unix/sysv/linux/netipx/ipx.h: Don't use kernel header. 1997-06-19 18:43 Andreas Jaeger * nis/nss_nisplus/nisplus-spwd.c (_nss_nisplus_parse_spent): Compare pointer with NULL. * login/logout.c (logout): Compare pututline result with NULL. * inet/rcmd.c: Correct a few typos. Reported by Erik Troan. --- sysdeps/alpha/__math.h | 44 -- sysdeps/alpha/bits/endian.h | 3 + sysdeps/alpha/bits/setjmp.h | 46 ++ sysdeps/alpha/bytesex.h | 3 - sysdeps/alpha/fpu/bits/fenv.h | 104 ++++ sysdeps/alpha/fpu/bits/mathdef.h | 64 +++ sysdeps/alpha/fpu/bits/mathinline.h | 44 ++ sysdeps/alpha/fpu/fenvbits.h | 107 ---- sysdeps/alpha/jmp_buf.h | 46 -- sysdeps/alpha/w_sqrt.S | 2 +- sysdeps/arm/__longjmp.S | 2 +- sysdeps/arm/bits/endian.h | 3 + sysdeps/arm/bits/setjmp.h | 10 + sysdeps/arm/bytesex.h | 3 - sysdeps/arm/jmp_buf.h | 10 - sysdeps/arm/setjmp.S | 2 +- sysdeps/generic/Makefile | 2 +- sysdeps/generic/abort.c | 2 +- sysdeps/generic/bits/confname.h | 325 +++++++++++ sysdeps/generic/bits/ioctl-types.h | 121 ++++ sysdeps/generic/bits/mathdef.h | 40 ++ sysdeps/generic/bits/resource.h | 146 +++++ sysdeps/generic/bits/sched.h | 35 ++ sysdeps/generic/bits/select.h | 29 + sysdeps/generic/bits/sigaction.h | 50 ++ sysdeps/generic/bits/sigset.h | 81 +++ sysdeps/generic/bits/sockaddr.h | 41 ++ sysdeps/generic/bits/socket.h | 200 +++++++ sysdeps/generic/bits/statfs.h | 52 ++ sysdeps/generic/bits/termios.h | 230 ++++++++ sysdeps/generic/bits/types.h | 94 ++++ sysdeps/generic/bits/uio.h | 32 ++ sysdeps/generic/bits/ustat.h | 30 + sysdeps/generic/bits/utmp.h | 53 ++ sysdeps/generic/bits/utsname.h | 3 + sysdeps/generic/bits/waitstatus.h | 104 ++++ sysdeps/generic/confname.h | 325 ----------- sysdeps/generic/gnu/types.h | 81 --- sysdeps/generic/ioctl-types.h | 117 ---- sysdeps/generic/iovec.h | 9 - sysdeps/generic/mathbits.h | 40 -- sysdeps/generic/netinet/ip.h | 2 +- sysdeps/generic/resourcebits.h | 146 ----- sysdeps/generic/schedbits.h | 35 -- sysdeps/generic/selectbits.h | 29 - sysdeps/generic/setenv.c | 2 +- sysdeps/generic/sigaction.h | 50 -- sysdeps/generic/sigset.h | 81 --- sysdeps/generic/sockaddrcom.h | 37 -- sysdeps/generic/socketbits.h | 200 ------- sysdeps/generic/statfsbuf.h | 49 -- sysdeps/generic/sys/mman.h | 2 +- sysdeps/generic/termbits.h | 229 -------- sysdeps/generic/ustatbits.h | 30 - sysdeps/generic/utmpbits.h | 53 -- sysdeps/generic/utsnamelen.h | 3 - sysdeps/generic/waitstatus.h | 104 ---- sysdeps/gnu/bits/utmp.h | 121 ++++ sysdeps/gnu/utmpbits.h | 121 ---- sysdeps/i386/__longjmp.S | 2 +- sysdeps/i386/bits/endian.h | 3 + sysdeps/i386/bits/huge_val.h | 70 +++ sysdeps/i386/bits/select.h | 57 ++ sysdeps/i386/bits/setjmp.h | 19 + sysdeps/i386/bytesex.h | 3 - sysdeps/i386/dl-machine.h | 4 + sysdeps/i386/fpu/__math.h | 608 --------------------- sysdeps/i386/fpu/bits/fenv.h | 89 +++ sysdeps/i386/fpu/bits/mathdef.h | 41 ++ sysdeps/i386/fpu/bits/mathinline.h | 608 +++++++++++++++++++++ sysdeps/i386/fpu/fenvbits.h | 91 --- sysdeps/i386/fpu/mathbits.h | 41 -- sysdeps/i386/huge_val.h | 70 --- sysdeps/i386/jmp_buf.h | 19 - sysdeps/i386/selectbits.h | 57 -- sysdeps/i386/setjmp.S | 2 +- sysdeps/ieee754/bits/huge_val.h | 89 +++ sysdeps/ieee754/bits/nan.h | 63 +++ sysdeps/ieee754/huge_val.h | 88 --- sysdeps/ieee754/nan.h | 64 --- sysdeps/libm-ieee754/k_standard.c | 88 +-- sysdeps/libm-ieee754/w_gamma.c | 6 +- sysdeps/libm-ieee754/w_gammaf.c | 6 +- sysdeps/libm-ieee754/w_gammal.c | 6 +- sysdeps/m68k/bits/endian.h | 3 + sysdeps/m68k/bits/huge_val.h | 75 +++ sysdeps/m68k/bits/setjmp.h | 19 + sysdeps/m68k/bytesex.h | 3 - sysdeps/m68k/dl-machine.h | 4 + sysdeps/m68k/fpu/__math.h | 464 ---------------- sysdeps/m68k/fpu/bits/fenv.h | 78 +++ sysdeps/m68k/fpu/bits/mathdef.h | 36 ++ sysdeps/m68k/fpu/bits/mathinline.h | 464 ++++++++++++++++ sysdeps/m68k/fpu/fenvbits.h | 80 --- sysdeps/m68k/fpu/mathbits.h | 36 -- sysdeps/m68k/fpu/switch/__math.h | 1 - sysdeps/m68k/fpu/switch/bits/mathinline.h | 1 + sysdeps/m68k/huge_val.h | 75 --- sysdeps/m68k/jmp_buf.h | 19 - sysdeps/mach/bits/libc-lock.h | 90 +++ sysdeps/mach/hurd/alpha/bits/sigcontext.h | 65 +++ sysdeps/mach/hurd/alpha/sigcontext.h | 65 --- sysdeps/mach/hurd/bits/errno.h | 316 +++++++++++ sysdeps/mach/hurd/bits/fcntl.h | 175 ++++++ sysdeps/mach/hurd/bits/ioctls.h | 353 ++++++++++++ sysdeps/mach/hurd/bits/local_lim.h | 39 ++ sysdeps/mach/hurd/bits/posix_opt.h | 21 + sysdeps/mach/hurd/bits/stat.h | 136 +++++ sysdeps/mach/hurd/dirstream.h | 2 +- sysdeps/mach/hurd/errnos.h | 316 ----------- sysdeps/mach/hurd/fcntlbits.h | 179 ------ sysdeps/mach/hurd/hppa/bits/sigcontext.h | 86 +++ sysdeps/mach/hurd/hppa/sigcontext.h | 86 --- sysdeps/mach/hurd/i386/bits/sigcontext.h | 106 ++++ sysdeps/mach/hurd/i386/sigcontext.h | 106 ---- sysdeps/mach/hurd/ioctl.c | 8 +- sysdeps/mach/hurd/ioctls.h | 349 ------------ sysdeps/mach/hurd/jmp-unwind.c | 2 +- sysdeps/mach/hurd/local_lim.h | 39 -- sysdeps/mach/hurd/mips/bits/sigcontext.h | 71 +++ sysdeps/mach/hurd/mips/dl-machine.c | 131 +++++ sysdeps/mach/hurd/mips/exc2signal.c | 65 ++- sysdeps/mach/hurd/mips/init-fault.c | 41 ++ sysdeps/mach/hurd/mips/init-first.c | 407 ++++++++++++++ sysdeps/mach/hurd/mips/intr-msg.h | 127 +++++ sysdeps/mach/hurd/mips/longjmp-ctx.c | 41 ++ sysdeps/mach/hurd/mips/longjmp-ts.c | 34 +- sysdeps/mach/hurd/mips/sigcontext.h | 71 --- sysdeps/mach/hurd/mips/sigreturn.c | 100 +++- sysdeps/mach/hurd/mips/trampoline.c | 217 +++++--- sysdeps/mach/hurd/posix_opt.h | 21 - sysdeps/mach/hurd/select.c | 2 +- sysdeps/mach/hurd/statbuf.h | 131 ----- sysdeps/mach/libc-lock.h | 90 --- sysdeps/mach/mips/cacheflush.c | 30 +- sysdeps/mach/mips/machine-lock.h | 63 ++- sysdeps/mach/mips/machine-sp.h | 34 +- sysdeps/mach/mips/syscall.S | 57 +- sysdeps/mach/mips/sysdep.h | 58 +- sysdeps/mach/mips/thread_state.h | 33 +- sysdeps/mach/start.c | 3 + sysdeps/mips/add_n.S | 121 ++++ sysdeps/mips/add_n.s | 120 ---- sysdeps/mips/addmul_1.S | 98 ++++ sysdeps/mips/addmul_1.s | 97 ---- sysdeps/mips/bits/endian.h | 4 + sysdeps/mips/bits/setjmp.h | 53 ++ sysdeps/mips/bsd-_setjmp.S | 43 +- sysdeps/mips/bsd-setjmp.S | 39 +- sysdeps/mips/bytesex.h | 4 - sysdeps/mips/dec/bits/endian.h | 4 + sysdeps/mips/dec/bytesex.h | 4 - sysdeps/mips/dl-machine.h | 387 ++++++++++--- sysdeps/mips/elf/start.S | 181 ++++++ sysdeps/mips/fpu_control.h | 96 ++++ sysdeps/mips/init-first.c | 64 +++ sysdeps/mips/jmp_buf.h | 53 -- sysdeps/mips/lshift.S | 97 ++++ sysdeps/mips/lshift.s | 95 ---- sysdeps/mips/machine-gmon.h | 57 ++ sysdeps/mips/mips64/Implies | 1 + sysdeps/mips/mips64/__longjmp.c | 85 +++ sysdeps/mips/mips64/add_n.S | 129 +++++ sysdeps/mips/mips64/addmul_1.S | 106 ++++ sysdeps/mips/mips64/bits/setjmp.h | 54 ++ sysdeps/mips/mips64/bsd-_setjmp.S | 36 ++ sysdeps/mips/mips64/bsd-setjmp.S | 36 ++ sysdeps/mips/mips64/gmp-mparam.h | 4 +- sysdeps/mips/mips64/lshift.S | 104 ++++ sysdeps/mips/mips64/mul_1.S | 94 ++++ sysdeps/mips/mips64/rshift.S | 101 ++++ sysdeps/mips/mips64/setjmp.S | 35 ++ sysdeps/mips/mips64/setjmp_aux.c | 67 +++ sysdeps/mips/mips64/sub_n.S | 129 +++++ sysdeps/mips/mips64/submul_1.S | 106 ++++ sysdeps/mips/mipsel/bits/endian.h | 4 + sysdeps/mips/mipsel/bytesex.h | 4 - sysdeps/mips/mul_1.S | 86 +++ sysdeps/mips/mul_1.s | 85 --- sysdeps/mips/p40/bits/endian.h | 4 + sysdeps/mips/p40/bytesex.h | 4 - sysdeps/mips/rshift.S | 94 ++++ sysdeps/mips/rshift.s | 92 ---- sysdeps/mips/setjmp.S | 43 +- sysdeps/mips/setjmp_aux.c | 27 +- sysdeps/mips/sub_n.S | 121 ++++ sysdeps/mips/sub_n.s | 120 ---- sysdeps/mips/submul_1.S | 98 ++++ sysdeps/mips/submul_1.s | 97 ---- sysdeps/posix/Makefile | 12 +- sysdeps/posix/mk-stdiolim.c | 8 +- sysdeps/powerpc/__longjmp.S | 2 +- sysdeps/powerpc/__math.h | 70 --- sysdeps/powerpc/bits/fenv.h | 128 +++++ sysdeps/powerpc/bits/mathdef.h | 72 +++ sysdeps/powerpc/bits/mathinline.h | 70 +++ sysdeps/powerpc/bits/setjmp.h | 19 + sysdeps/powerpc/dl-machine.h | 4 + sysdeps/powerpc/fenvbits.h | 130 ----- sysdeps/powerpc/jmp_buf.h | 19 - sysdeps/powerpc/mathbits.h | 72 --- sysdeps/powerpc/setjmp.S | 2 +- sysdeps/sparc/__longjmp.S | 30 +- sysdeps/sparc/bits/endian.h | 3 + sysdeps/sparc/bits/setjmp.h | 16 + sysdeps/sparc/bytesex.h | 3 - sysdeps/sparc/jmp_buf.h | 16 - sysdeps/sparc/setjmp.S | 2 +- sysdeps/standalone/arm/bits/errno.h | 52 ++ sysdeps/standalone/arm/errnos.h | 52 -- sysdeps/standalone/bits/stdio_lim.h | 27 + sysdeps/standalone/close.c | 2 +- sysdeps/standalone/filedesc.h | 2 +- sysdeps/standalone/open.c | 2 +- sysdeps/standalone/stdio_lim.h | 27 - sysdeps/stub/__math.h | 6 - sysdeps/stub/bits/dirent.h | 24 + sysdeps/stub/bits/elfclass.h | 8 + sysdeps/stub/bits/endian.h | 9 + sysdeps/stub/bits/errno.h | 40 ++ sysdeps/stub/bits/fcntl.h | 85 +++ sysdeps/stub/bits/fenv.h | 61 +++ sysdeps/stub/bits/huge_val.h | 26 + sysdeps/stub/bits/ioctls.h | 1 + sysdeps/stub/bits/ipc.h | 56 ++ sysdeps/stub/bits/libc-lock.h | 83 +++ sysdeps/stub/bits/local_lim.h | 3 + sysdeps/stub/bits/mathinline.h | 6 + sysdeps/stub/bits/msq.h | 47 ++ sysdeps/stub/bits/nan.h | 5 + sysdeps/stub/bits/posix_opt.h | 2 + sysdeps/stub/bits/sem.h | 61 +++ sysdeps/stub/bits/setjmp.h | 3 + sysdeps/stub/bits/shm.h | 53 ++ sysdeps/stub/bits/sigcontext.h | 29 + sysdeps/stub/bits/signum.h | 53 ++ sysdeps/stub/bits/stat.h | 74 +++ sysdeps/stub/bits/stdio_lim.h | 4 + sysdeps/stub/bits/time.h | 44 ++ sysdeps/stub/bits/waitflags.h | 27 + sysdeps/stub/bytesex.h | 9 - sysdeps/stub/direntry.h | 24 - sysdeps/stub/elfclass.h | 8 - sysdeps/stub/errnos.h | 40 -- sysdeps/stub/fcntlbits.h | 88 --- sysdeps/stub/fenvbits.h | 63 --- sysdeps/stub/huge_val.h | 26 - sysdeps/stub/ioctls.h | 1 - sysdeps/stub/jmp_buf.h | 3 - sysdeps/stub/libc-lock.h | 83 --- sysdeps/stub/local_lim.h | 3 - sysdeps/stub/nan.h | 6 - sysdeps/stub/posix_opt.h | 2 - sysdeps/stub/sigcontext.h | 29 - sysdeps/stub/signum.h | 53 -- sysdeps/stub/statbuf.h | 71 --- sysdeps/stub/stdio_lim.h | 4 - sysdeps/stub/sys/ipc_buf.h | 56 -- sysdeps/stub/sys/msq_buf.h | 47 -- sysdeps/stub/sys/sem_buf.h | 61 --- sysdeps/stub/sys/shm_buf.h | 53 -- sysdeps/stub/timebits.h | 40 -- sysdeps/stub/waitflags.h | 28 - sysdeps/unix/Makefile | 49 +- sysdeps/unix/bsd/bits/dirent.h | 29 + sysdeps/unix/bsd/bits/fcntl.h | 114 ++++ sysdeps/unix/bsd/bits/posix_opt.h | 5 + sysdeps/unix/bsd/bits/signum.h | 70 +++ sysdeps/unix/bsd/bits/stat.h | 87 +++ sysdeps/unix/bsd/bits/waitflags.h | 30 + sysdeps/unix/bsd/bsd4.4/bits/dirent.h | 33 ++ sysdeps/unix/bsd/bsd4.4/bits/errno.h | 170 ++++++ sysdeps/unix/bsd/bsd4.4/bits/fcntl.h | 113 ++++ sysdeps/unix/bsd/bsd4.4/bits/ioctls.h | 292 ++++++++++ sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h | 42 ++ sysdeps/unix/bsd/bsd4.4/direntry.h | 33 -- sysdeps/unix/bsd/bsd4.4/errnos.h | 170 ------ sysdeps/unix/bsd/bsd4.4/fcntlbits.h | 116 ---- sysdeps/unix/bsd/bsd4.4/ioctls.h | 292 ---------- sysdeps/unix/bsd/bsd4.4/sockaddrcom.h | 38 -- sysdeps/unix/bsd/bsd4.4/tcgetattr.c | 2 +- sysdeps/unix/bsd/bsd4.4/tcsetattr.c | 2 +- sysdeps/unix/bsd/direntry.h | 29 - sysdeps/unix/bsd/fcntlbits.h | 117 ---- sysdeps/unix/bsd/m68k/sysdep.S | 2 +- sysdeps/unix/bsd/osf/alpha/bits/stat.h | 80 +++ sysdeps/unix/bsd/osf/alpha/statbuf.h | 76 --- sysdeps/unix/bsd/osf/bits/sigaction.h | 46 ++ sysdeps/unix/bsd/osf/sigaction.h | 46 -- sysdeps/unix/bsd/osf/sys/mman.h | 2 +- sysdeps/unix/bsd/posix_opt.h | 5 - sysdeps/unix/bsd/signum.h | 70 --- sysdeps/unix/bsd/statbuf.h | 84 --- sysdeps/unix/bsd/sun/bits/signum.h | 69 +++ sysdeps/unix/bsd/sun/m68k/bits/sigcontext.h | 26 + sysdeps/unix/bsd/sun/m68k/sethostid.S | 2 +- sysdeps/unix/bsd/sun/m68k/sigcontext.h | 26 - sysdeps/unix/bsd/sun/signum.h | 69 --- sysdeps/unix/bsd/sun/sparc/bits/sigcontext.h | 31 ++ sysdeps/unix/bsd/sun/sparc/sethostid.S | 4 +- sysdeps/unix/bsd/sun/sparc/sigcontext.h | 31 -- sysdeps/unix/bsd/sun/sunos4/bits/fcntl.h | 142 +++++ sysdeps/unix/bsd/sun/sunos4/bits/resource.h | 139 +++++ sysdeps/unix/bsd/sun/sunos4/bits/termios.h | 208 +++++++ sysdeps/unix/bsd/sun/sunos4/bits/utsname.h | 2 + sysdeps/unix/bsd/sun/sunos4/fcntlbits.h | 145 ----- sysdeps/unix/bsd/sun/sunos4/resourcebits.h | 139 ----- sysdeps/unix/bsd/sun/sunos4/sys/mman.h | 2 +- sysdeps/unix/bsd/sun/sunos4/termbits.h | 208 ------- sysdeps/unix/bsd/sun/sunos4/utsnamelen.h | 2 - sysdeps/unix/bsd/ultrix4/bits/fcntl.h | 122 +++++ sysdeps/unix/bsd/ultrix4/bits/posix_opt.h | 23 + sysdeps/unix/bsd/ultrix4/bits/utsname.h | 1 + sysdeps/unix/bsd/ultrix4/fcntlbits.h | 125 ----- sysdeps/unix/bsd/ultrix4/mips/bits/sigcontext.h | 60 ++ sysdeps/unix/bsd/ultrix4/mips/sigcontext.h | 60 -- sysdeps/unix/bsd/ultrix4/posix_opt.h | 23 - sysdeps/unix/bsd/ultrix4/sys/mman.h | 2 +- sysdeps/unix/bsd/ultrix4/utsnamelen.h | 1 - sysdeps/unix/bsd/vax/sysdep.S | 2 +- sysdeps/unix/bsd/waitflags.h | 31 -- sysdeps/unix/common/bits/dirent.h | 29 + sysdeps/unix/common/bits/fcntl.h | 119 ++++ sysdeps/unix/common/direntry.h | 29 - sysdeps/unix/common/fcntlbits.h | 122 ----- sysdeps/unix/dirstream.h | 2 +- sysdeps/unix/i386/sysdep.S | 2 +- sysdeps/unix/mips/sysdep.S | 2 +- sysdeps/unix/mk-local_lim.c | 3 +- sysdeps/unix/sparc/sysdep.S | 2 +- sysdeps/unix/sysv/bits/dirent.h | 24 + sysdeps/unix/sysv/bits/fcntl.h | 94 ++++ sysdeps/unix/sysv/bits/local_lim.h | 32 ++ sysdeps/unix/sysv/bits/signum.h | 56 ++ sysdeps/unix/sysv/bits/stat.h | 65 +++ sysdeps/unix/sysv/bits/utmp.h | 57 ++ sysdeps/unix/sysv/bits/utsname.h | 1 + sysdeps/unix/sysv/direntry.h | 24 - sysdeps/unix/sysv/fcntlbits.h | 96 ---- sysdeps/unix/sysv/irix4/bits/confname.h | 80 +++ sysdeps/unix/sysv/irix4/bits/fcntl.h | 107 ++++ sysdeps/unix/sysv/irix4/bits/signum.h | 68 +++ sysdeps/unix/sysv/irix4/bits/stat.h | 65 +++ sysdeps/unix/sysv/irix4/confname.h | 80 --- sysdeps/unix/sysv/irix4/fcntlbits.h | 110 ---- sysdeps/unix/sysv/irix4/signum.h | 68 --- sysdeps/unix/sysv/irix4/statbuf.h | 61 --- sysdeps/unix/sysv/irix4/sys/mman.h | 2 +- sysdeps/unix/sysv/linux/Dist | 4 +- sysdeps/unix/sysv/linux/Makefile | 4 +- sysdeps/unix/sysv/linux/alpha/bits/fcntl.h | 100 ++++ sysdeps/unix/sysv/linux/alpha/bits/ioctls.h | 43 ++ sysdeps/unix/sysv/linux/alpha/bits/ipc.h | 85 +++ sysdeps/unix/sysv/linux/alpha/bits/sigaction.h | 51 ++ sysdeps/unix/sysv/linux/alpha/bits/signum.h | 69 +++ sysdeps/unix/sysv/linux/alpha/bits/stat.h | 78 +++ sysdeps/unix/sysv/linux/alpha/bits/termios.h | 193 +++++++ sysdeps/unix/sysv/linux/alpha/bits/time.h | 54 ++ sysdeps/unix/sysv/linux/alpha/bits/types.h | 95 ++++ sysdeps/unix/sysv/linux/alpha/brk.S | 2 +- sysdeps/unix/sysv/linux/alpha/clone.S | 2 +- sysdeps/unix/sysv/linux/alpha/fcntlbits.h | 100 ---- sysdeps/unix/sysv/linux/alpha/gnu/types.h | 94 ---- sysdeps/unix/sysv/linux/alpha/ioctls.h | 39 -- sysdeps/unix/sysv/linux/alpha/kernel_termios.h | 44 ++ sysdeps/unix/sysv/linux/alpha/sigaction.h | 51 -- sysdeps/unix/sysv/linux/alpha/signum.h | 69 --- sysdeps/unix/sysv/linux/alpha/statbuf.h | 74 --- sysdeps/unix/sysv/linux/alpha/sys/ipc_buf.h | 85 --- sysdeps/unix/sysv/linux/alpha/sys/kernel_termios.h | 25 - sysdeps/unix/sysv/linux/alpha/termbits.h | 193 ------- sysdeps/unix/sysv/linux/alpha/timebits.h | 50 -- sysdeps/unix/sysv/linux/arm/clone.S | 2 +- sysdeps/unix/sysv/linux/arm/profil-counter.h | 2 +- sysdeps/unix/sysv/linux/arm/socket.S | 2 +- sysdeps/unix/sysv/linux/bits/dirent.h | 37 ++ sysdeps/unix/sysv/linux/bits/errno.h | 59 ++ sysdeps/unix/sysv/linux/bits/fcntl.h | 99 ++++ sysdeps/unix/sysv/linux/bits/ioctl-types.h | 74 +++ sysdeps/unix/sysv/linux/bits/ioctls.h | 30 + sysdeps/unix/sysv/linux/bits/ipc.h | 85 +++ sysdeps/unix/sysv/linux/bits/local_lim.h | 21 + sysdeps/unix/sysv/linux/bits/msq.h | 78 +++ sysdeps/unix/sysv/linux/bits/posix_opt.h | 73 +++ sysdeps/unix/sysv/linux/bits/resource.h | 186 +++++++ sysdeps/unix/sysv/linux/bits/sched.h | 54 ++ sysdeps/unix/sysv/linux/bits/sem.h | 88 +++ sysdeps/unix/sysv/linux/bits/shm.h | 92 ++++ sysdeps/unix/sysv/linux/bits/sigaction.h | 54 ++ sysdeps/unix/sysv/linux/bits/sigcontext.h | 28 + sysdeps/unix/sysv/linux/bits/signum.h | 66 +++ sysdeps/unix/sysv/linux/bits/sigset.h | 123 +++++ sysdeps/unix/sysv/linux/bits/socket.h | 205 +++++++ sysdeps/unix/sysv/linux/bits/stat.h | 88 +++ sysdeps/unix/sysv/linux/bits/statfs.h | 42 ++ sysdeps/unix/sysv/linux/bits/termios.h | 189 +++++++ sysdeps/unix/sysv/linux/bits/time.h | 56 ++ sysdeps/unix/sysv/linux/bits/types.h | 103 ++++ sysdeps/unix/sysv/linux/bits/uio.h | 46 ++ sysdeps/unix/sysv/linux/bits/ustat.h | 27 + sysdeps/unix/sysv/linux/bits/utsname.h | 25 + sysdeps/unix/sysv/linux/bits/waitflags.h | 29 + sysdeps/unix/sysv/linux/direntry.h | 37 -- sysdeps/unix/sysv/linux/errnos.h | 59 -- sysdeps/unix/sysv/linux/fcntlbits.h | 99 ---- sysdeps/unix/sysv/linux/gnu/types.h | 89 --- sysdeps/unix/sysv/linux/i386/clone.S | 2 +- sysdeps/unix/sysv/linux/i386/profil-counter.h | 2 +- sysdeps/unix/sysv/linux/i386/socket.S | 2 +- sysdeps/unix/sysv/linux/ioctl-types.h | 70 --- sysdeps/unix/sysv/linux/ioctls.h | 26 - sysdeps/unix/sysv/linux/iovec.h | 47 -- sysdeps/unix/sysv/linux/kernel_termios.h | 38 ++ sysdeps/unix/sysv/linux/local_lim.h | 21 - sysdeps/unix/sysv/linux/m68k/clone.S | 2 +- sysdeps/unix/sysv/linux/m68k/socket.S | 2 +- sysdeps/unix/sysv/linux/netinet/ip.h | 4 +- sysdeps/unix/sysv/linux/netinet/tcp.h | 2 +- sysdeps/unix/sysv/linux/netipx/ipx.h | 90 ++- sysdeps/unix/sysv/linux/posix_opt.h | 69 --- sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h | 1 + sysdeps/unix/sysv/linux/powerpc/bits/termios.h | 280 ++++++++++ sysdeps/unix/sysv/linux/powerpc/clone.S | 2 +- sysdeps/unix/sysv/linux/powerpc/ioctl-types.h | 1 - sysdeps/unix/sysv/linux/powerpc/kernel_termios.h | 26 +- sysdeps/unix/sysv/linux/powerpc/socket.S | 2 +- .../unix/sysv/linux/powerpc/sys/kernel_termios.h | 43 -- sysdeps/unix/sysv/linux/powerpc/termbits.h | 280 ---------- sysdeps/unix/sysv/linux/resourcebits.h | 186 ------- sysdeps/unix/sysv/linux/schedbits.h | 55 -- sysdeps/unix/sysv/linux/sigaction.h | 54 -- sysdeps/unix/sysv/linux/sigcontext.h | 29 - sysdeps/unix/sysv/linux/signum.h | 66 --- sysdeps/unix/sysv/linux/sigset.h | 123 ----- sysdeps/unix/sysv/linux/socketbits.h | 205 ------- sysdeps/unix/sysv/linux/socketcall.h | 48 ++ sysdeps/unix/sysv/linux/sparc/bits/fcntl.h | 96 ++++ sysdeps/unix/sysv/linux/sparc/bits/ioctls.h | 43 ++ sysdeps/unix/sysv/linux/sparc/bits/sigaction.h | 52 ++ sysdeps/unix/sysv/linux/sparc/bits/signum.h | 69 +++ sysdeps/unix/sysv/linux/sparc/bits/termios.h | 217 ++++++++ sysdeps/unix/sysv/linux/sparc/fcntlbits.h | 96 ---- sysdeps/unix/sysv/linux/sparc/ioctls.h | 39 -- sysdeps/unix/sysv/linux/sparc/profil-counter.h | 2 +- sysdeps/unix/sysv/linux/sparc/sigaction.h | 52 -- sysdeps/unix/sysv/linux/sparc/signum.h | 69 --- sysdeps/unix/sysv/linux/sparc/socket.S | 2 +- sysdeps/unix/sysv/linux/sparc/termbits.h | 217 -------- sysdeps/unix/sysv/linux/statbuf.h | 84 --- sysdeps/unix/sysv/linux/statfsbuf.h | 38 -- sysdeps/unix/sysv/linux/sys/ipc_buf.h | 85 --- sysdeps/unix/sysv/linux/sys/kernel_termios.h | 20 - sysdeps/unix/sysv/linux/sys/mman.h | 2 +- sysdeps/unix/sysv/linux/sys/msq_buf.h | 78 --- sysdeps/unix/sysv/linux/sys/sem_buf.h | 88 --- sysdeps/unix/sysv/linux/sys/shm_buf.h | 92 ---- sysdeps/unix/sysv/linux/sys/socketcall.h | 48 -- sysdeps/unix/sysv/linux/sys/syscall.h | 4 +- sysdeps/unix/sysv/linux/tcgetattr.c | 2 +- sysdeps/unix/sysv/linux/tcsetattr.c | 2 +- sysdeps/unix/sysv/linux/termbits.h | 184 ------- sysdeps/unix/sysv/linux/timebits.h | 52 -- sysdeps/unix/sysv/linux/ustatbits.h | 27 - sysdeps/unix/sysv/linux/utsnamelen.h | 25 - sysdeps/unix/sysv/linux/waitflags.h | 30 - sysdeps/unix/sysv/local_lim.h | 32 -- sysdeps/unix/sysv/minix/bits/sigaction.h | 49 ++ sysdeps/unix/sysv/minix/sigaction.h | 49 -- sysdeps/unix/sysv/sco3.2.4/bits/confname.h | 50 ++ sysdeps/unix/sysv/sco3.2.4/bits/sigaction.h | 39 ++ sysdeps/unix/sysv/sco3.2.4/confname.h | 50 -- sysdeps/unix/sysv/sco3.2.4/sigaction.h | 39 -- sysdeps/unix/sysv/sco3.2.4/sysconf.S | 2 +- sysdeps/unix/sysv/sco3.2/bits/local_lim.h | 37 ++ sysdeps/unix/sysv/sco3.2/local_lim.h | 37 -- sysdeps/unix/sysv/signum.h | 56 -- sysdeps/unix/sysv/statbuf.h | 61 --- sysdeps/unix/sysv/sysv4/bits/sigaction.h | 51 ++ sysdeps/unix/sysv/sysv4/bits/signum.h | 66 +++ sysdeps/unix/sysv/sysv4/bits/sigset.h | 96 ++++ sysdeps/unix/sysv/sysv4/bits/utsname.h | 1 + sysdeps/unix/sysv/sysv4/bits/waitflags.h | 34 ++ sysdeps/unix/sysv/sysv4/i386/bits/stat.h | 94 ++++ sysdeps/unix/sysv/sysv4/i386/statbuf.h | 90 --- sysdeps/unix/sysv/sysv4/i386/sysdep.h | 2 +- sysdeps/unix/sysv/sysv4/sigaction.h | 51 -- sysdeps/unix/sysv/sysv4/signum.h | 66 --- sysdeps/unix/sysv/sysv4/sigset.h | 96 ---- sysdeps/unix/sysv/sysv4/solaris2/bits/signum.h | 73 +++ sysdeps/unix/sysv/sysv4/solaris2/bits/stat.h | 87 +++ sysdeps/unix/sysv/sysv4/solaris2/signum.h | 73 --- .../sysv/sysv4/solaris2/sparc/bits/sigcontext.h | 1 + .../unix/sysv/sysv4/solaris2/sparc/sigcontext.h | 1 - sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.S | 2 +- sysdeps/unix/sysv/sysv4/solaris2/statbuf.h | 83 --- sysdeps/unix/sysv/sysv4/utsnamelen.h | 1 - sysdeps/unix/sysv/sysv4/waitflags.h | 35 -- sysdeps/unix/sysv/utmpbits.h | 58 -- sysdeps/unix/sysv/utsnamelen.h | 1 - sysdeps/vax/bits/huge_val.h | 26 + sysdeps/vax/bits/setjmp.h | 7 + sysdeps/vax/huge_val.h | 26 - sysdeps/vax/jmp_buf.h | 7 - sysdeps/wordsize-32/bits/elfclass.h | 5 + sysdeps/wordsize-32/elfclass.h | 5 - sysdeps/wordsize-32/inttypes.h | 5 + sysdeps/wordsize-64/bits/elfclass.h | 5 + sysdeps/wordsize-64/elfclass.h | 5 - sysdeps/wordsize-64/inttypes.h | 5 + 509 files changed, 17728 insertions(+), 14794 deletions(-) delete mode 100644 sysdeps/alpha/__math.h create mode 100644 sysdeps/alpha/bits/endian.h create mode 100644 sysdeps/alpha/bits/setjmp.h delete mode 100644 sysdeps/alpha/bytesex.h create mode 100644 sysdeps/alpha/fpu/bits/fenv.h create mode 100644 sysdeps/alpha/fpu/bits/mathdef.h create mode 100644 sysdeps/alpha/fpu/bits/mathinline.h delete mode 100644 sysdeps/alpha/fpu/fenvbits.h delete mode 100644 sysdeps/alpha/jmp_buf.h create mode 100644 sysdeps/arm/bits/endian.h create mode 100644 sysdeps/arm/bits/setjmp.h delete mode 100644 sysdeps/arm/bytesex.h delete mode 100644 sysdeps/arm/jmp_buf.h create mode 100644 sysdeps/generic/bits/confname.h create mode 100644 sysdeps/generic/bits/ioctl-types.h create mode 100644 sysdeps/generic/bits/mathdef.h create mode 100644 sysdeps/generic/bits/resource.h create mode 100644 sysdeps/generic/bits/sched.h create mode 100644 sysdeps/generic/bits/select.h create mode 100644 sysdeps/generic/bits/sigaction.h create mode 100644 sysdeps/generic/bits/sigset.h create mode 100644 sysdeps/generic/bits/sockaddr.h create mode 100644 sysdeps/generic/bits/socket.h create mode 100644 sysdeps/generic/bits/statfs.h create mode 100644 sysdeps/generic/bits/termios.h create mode 100644 sysdeps/generic/bits/types.h create mode 100644 sysdeps/generic/bits/uio.h create mode 100644 sysdeps/generic/bits/ustat.h create mode 100644 sysdeps/generic/bits/utmp.h create mode 100644 sysdeps/generic/bits/utsname.h create mode 100644 sysdeps/generic/bits/waitstatus.h delete mode 100644 sysdeps/generic/confname.h delete mode 100644 sysdeps/generic/gnu/types.h delete mode 100644 sysdeps/generic/ioctl-types.h delete mode 100644 sysdeps/generic/iovec.h delete mode 100644 sysdeps/generic/mathbits.h delete mode 100644 sysdeps/generic/resourcebits.h delete mode 100644 sysdeps/generic/schedbits.h delete mode 100644 sysdeps/generic/selectbits.h delete mode 100644 sysdeps/generic/sigaction.h delete mode 100644 sysdeps/generic/sigset.h delete mode 100644 sysdeps/generic/sockaddrcom.h delete mode 100644 sysdeps/generic/socketbits.h delete mode 100644 sysdeps/generic/statfsbuf.h delete mode 100644 sysdeps/generic/termbits.h delete mode 100644 sysdeps/generic/ustatbits.h delete mode 100644 sysdeps/generic/utmpbits.h delete mode 100644 sysdeps/generic/utsnamelen.h delete mode 100644 sysdeps/generic/waitstatus.h create mode 100644 sysdeps/gnu/bits/utmp.h delete mode 100644 sysdeps/gnu/utmpbits.h create mode 100644 sysdeps/i386/bits/endian.h create mode 100644 sysdeps/i386/bits/huge_val.h create mode 100644 sysdeps/i386/bits/select.h create mode 100644 sysdeps/i386/bits/setjmp.h delete mode 100644 sysdeps/i386/bytesex.h delete mode 100644 sysdeps/i386/fpu/__math.h create mode 100644 sysdeps/i386/fpu/bits/fenv.h create mode 100644 sysdeps/i386/fpu/bits/mathdef.h create mode 100644 sysdeps/i386/fpu/bits/mathinline.h delete mode 100644 sysdeps/i386/fpu/fenvbits.h delete mode 100644 sysdeps/i386/fpu/mathbits.h delete mode 100644 sysdeps/i386/huge_val.h delete mode 100644 sysdeps/i386/jmp_buf.h delete mode 100644 sysdeps/i386/selectbits.h create mode 100644 sysdeps/ieee754/bits/huge_val.h create mode 100644 sysdeps/ieee754/bits/nan.h delete mode 100644 sysdeps/ieee754/huge_val.h delete mode 100644 sysdeps/ieee754/nan.h create mode 100644 sysdeps/m68k/bits/endian.h create mode 100644 sysdeps/m68k/bits/huge_val.h create mode 100644 sysdeps/m68k/bits/setjmp.h delete mode 100644 sysdeps/m68k/bytesex.h delete mode 100644 sysdeps/m68k/fpu/__math.h create mode 100644 sysdeps/m68k/fpu/bits/fenv.h create mode 100644 sysdeps/m68k/fpu/bits/mathdef.h create mode 100644 sysdeps/m68k/fpu/bits/mathinline.h delete mode 100644 sysdeps/m68k/fpu/fenvbits.h delete mode 100644 sysdeps/m68k/fpu/mathbits.h delete mode 100644 sysdeps/m68k/fpu/switch/__math.h create mode 100644 sysdeps/m68k/fpu/switch/bits/mathinline.h delete mode 100644 sysdeps/m68k/huge_val.h delete mode 100644 sysdeps/m68k/jmp_buf.h create mode 100644 sysdeps/mach/bits/libc-lock.h create mode 100644 sysdeps/mach/hurd/alpha/bits/sigcontext.h delete mode 100644 sysdeps/mach/hurd/alpha/sigcontext.h create mode 100644 sysdeps/mach/hurd/bits/errno.h create mode 100644 sysdeps/mach/hurd/bits/fcntl.h create mode 100644 sysdeps/mach/hurd/bits/ioctls.h create mode 100644 sysdeps/mach/hurd/bits/local_lim.h create mode 100644 sysdeps/mach/hurd/bits/posix_opt.h create mode 100644 sysdeps/mach/hurd/bits/stat.h delete mode 100644 sysdeps/mach/hurd/errnos.h delete mode 100644 sysdeps/mach/hurd/fcntlbits.h create mode 100644 sysdeps/mach/hurd/hppa/bits/sigcontext.h delete mode 100644 sysdeps/mach/hurd/hppa/sigcontext.h create mode 100644 sysdeps/mach/hurd/i386/bits/sigcontext.h delete mode 100644 sysdeps/mach/hurd/i386/sigcontext.h delete mode 100644 sysdeps/mach/hurd/ioctls.h delete mode 100644 sysdeps/mach/hurd/local_lim.h create mode 100644 sysdeps/mach/hurd/mips/bits/sigcontext.h create mode 100644 sysdeps/mach/hurd/mips/dl-machine.c create mode 100644 sysdeps/mach/hurd/mips/init-fault.c create mode 100644 sysdeps/mach/hurd/mips/init-first.c create mode 100644 sysdeps/mach/hurd/mips/intr-msg.h create mode 100644 sysdeps/mach/hurd/mips/longjmp-ctx.c delete mode 100644 sysdeps/mach/hurd/mips/sigcontext.h delete mode 100644 sysdeps/mach/hurd/posix_opt.h delete mode 100644 sysdeps/mach/hurd/statbuf.h delete mode 100644 sysdeps/mach/libc-lock.h create mode 100644 sysdeps/mips/add_n.S delete mode 100644 sysdeps/mips/add_n.s create mode 100644 sysdeps/mips/addmul_1.S delete mode 100644 sysdeps/mips/addmul_1.s create mode 100644 sysdeps/mips/bits/endian.h create mode 100644 sysdeps/mips/bits/setjmp.h delete mode 100644 sysdeps/mips/bytesex.h create mode 100644 sysdeps/mips/dec/bits/endian.h delete mode 100644 sysdeps/mips/dec/bytesex.h create mode 100644 sysdeps/mips/elf/start.S create mode 100644 sysdeps/mips/fpu_control.h create mode 100644 sysdeps/mips/init-first.c delete mode 100644 sysdeps/mips/jmp_buf.h create mode 100644 sysdeps/mips/lshift.S delete mode 100644 sysdeps/mips/lshift.s create mode 100644 sysdeps/mips/machine-gmon.h create mode 100644 sysdeps/mips/mips64/Implies create mode 100644 sysdeps/mips/mips64/__longjmp.c create mode 100644 sysdeps/mips/mips64/add_n.S create mode 100644 sysdeps/mips/mips64/addmul_1.S create mode 100644 sysdeps/mips/mips64/bits/setjmp.h create mode 100644 sysdeps/mips/mips64/bsd-_setjmp.S create mode 100644 sysdeps/mips/mips64/bsd-setjmp.S create mode 100644 sysdeps/mips/mips64/lshift.S create mode 100644 sysdeps/mips/mips64/mul_1.S create mode 100644 sysdeps/mips/mips64/rshift.S create mode 100644 sysdeps/mips/mips64/setjmp.S create mode 100644 sysdeps/mips/mips64/setjmp_aux.c create mode 100644 sysdeps/mips/mips64/sub_n.S create mode 100644 sysdeps/mips/mips64/submul_1.S create mode 100644 sysdeps/mips/mipsel/bits/endian.h delete mode 100644 sysdeps/mips/mipsel/bytesex.h create mode 100644 sysdeps/mips/mul_1.S delete mode 100644 sysdeps/mips/mul_1.s create mode 100644 sysdeps/mips/p40/bits/endian.h delete mode 100644 sysdeps/mips/p40/bytesex.h create mode 100644 sysdeps/mips/rshift.S delete mode 100644 sysdeps/mips/rshift.s create mode 100644 sysdeps/mips/sub_n.S delete mode 100644 sysdeps/mips/sub_n.s create mode 100644 sysdeps/mips/submul_1.S delete mode 100644 sysdeps/mips/submul_1.s delete mode 100644 sysdeps/powerpc/__math.h create mode 100644 sysdeps/powerpc/bits/fenv.h create mode 100644 sysdeps/powerpc/bits/mathdef.h create mode 100644 sysdeps/powerpc/bits/mathinline.h create mode 100644 sysdeps/powerpc/bits/setjmp.h delete mode 100644 sysdeps/powerpc/fenvbits.h delete mode 100644 sysdeps/powerpc/jmp_buf.h delete mode 100644 sysdeps/powerpc/mathbits.h create mode 100644 sysdeps/sparc/bits/endian.h create mode 100644 sysdeps/sparc/bits/setjmp.h delete mode 100644 sysdeps/sparc/bytesex.h delete mode 100644 sysdeps/sparc/jmp_buf.h create mode 100644 sysdeps/standalone/arm/bits/errno.h delete mode 100644 sysdeps/standalone/arm/errnos.h create mode 100644 sysdeps/standalone/bits/stdio_lim.h delete mode 100644 sysdeps/standalone/stdio_lim.h delete mode 100644 sysdeps/stub/__math.h create mode 100644 sysdeps/stub/bits/dirent.h create mode 100644 sysdeps/stub/bits/elfclass.h create mode 100644 sysdeps/stub/bits/endian.h create mode 100644 sysdeps/stub/bits/errno.h create mode 100644 sysdeps/stub/bits/fcntl.h create mode 100644 sysdeps/stub/bits/fenv.h create mode 100644 sysdeps/stub/bits/huge_val.h create mode 100644 sysdeps/stub/bits/ioctls.h create mode 100644 sysdeps/stub/bits/ipc.h create mode 100644 sysdeps/stub/bits/libc-lock.h create mode 100644 sysdeps/stub/bits/local_lim.h create mode 100644 sysdeps/stub/bits/mathinline.h create mode 100644 sysdeps/stub/bits/msq.h create mode 100644 sysdeps/stub/bits/nan.h create mode 100644 sysdeps/stub/bits/posix_opt.h create mode 100644 sysdeps/stub/bits/sem.h create mode 100644 sysdeps/stub/bits/setjmp.h create mode 100644 sysdeps/stub/bits/shm.h create mode 100644 sysdeps/stub/bits/sigcontext.h create mode 100644 sysdeps/stub/bits/signum.h create mode 100644 sysdeps/stub/bits/stat.h create mode 100644 sysdeps/stub/bits/stdio_lim.h create mode 100644 sysdeps/stub/bits/time.h create mode 100644 sysdeps/stub/bits/waitflags.h delete mode 100644 sysdeps/stub/bytesex.h delete mode 100644 sysdeps/stub/direntry.h delete mode 100644 sysdeps/stub/elfclass.h delete mode 100644 sysdeps/stub/errnos.h delete mode 100644 sysdeps/stub/fcntlbits.h delete mode 100644 sysdeps/stub/fenvbits.h delete mode 100644 sysdeps/stub/huge_val.h delete mode 100644 sysdeps/stub/ioctls.h delete mode 100644 sysdeps/stub/jmp_buf.h delete mode 100644 sysdeps/stub/libc-lock.h delete mode 100644 sysdeps/stub/local_lim.h delete mode 100644 sysdeps/stub/nan.h delete mode 100644 sysdeps/stub/posix_opt.h delete mode 100644 sysdeps/stub/sigcontext.h delete mode 100644 sysdeps/stub/signum.h delete mode 100644 sysdeps/stub/statbuf.h delete mode 100644 sysdeps/stub/stdio_lim.h delete mode 100644 sysdeps/stub/sys/ipc_buf.h delete mode 100644 sysdeps/stub/sys/msq_buf.h delete mode 100644 sysdeps/stub/sys/sem_buf.h delete mode 100644 sysdeps/stub/sys/shm_buf.h delete mode 100644 sysdeps/stub/timebits.h delete mode 100644 sysdeps/stub/waitflags.h create mode 100644 sysdeps/unix/bsd/bits/dirent.h create mode 100644 sysdeps/unix/bsd/bits/fcntl.h create mode 100644 sysdeps/unix/bsd/bits/posix_opt.h create mode 100644 sysdeps/unix/bsd/bits/signum.h create mode 100644 sysdeps/unix/bsd/bits/stat.h create mode 100644 sysdeps/unix/bsd/bits/waitflags.h create mode 100644 sysdeps/unix/bsd/bsd4.4/bits/dirent.h create mode 100644 sysdeps/unix/bsd/bsd4.4/bits/errno.h create mode 100644 sysdeps/unix/bsd/bsd4.4/bits/fcntl.h create mode 100644 sysdeps/unix/bsd/bsd4.4/bits/ioctls.h create mode 100644 sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h delete mode 100644 sysdeps/unix/bsd/bsd4.4/direntry.h delete mode 100644 sysdeps/unix/bsd/bsd4.4/errnos.h delete mode 100644 sysdeps/unix/bsd/bsd4.4/fcntlbits.h delete mode 100644 sysdeps/unix/bsd/bsd4.4/ioctls.h delete mode 100644 sysdeps/unix/bsd/bsd4.4/sockaddrcom.h delete mode 100644 sysdeps/unix/bsd/direntry.h delete mode 100644 sysdeps/unix/bsd/fcntlbits.h create mode 100644 sysdeps/unix/bsd/osf/alpha/bits/stat.h delete mode 100644 sysdeps/unix/bsd/osf/alpha/statbuf.h create mode 100644 sysdeps/unix/bsd/osf/bits/sigaction.h delete mode 100644 sysdeps/unix/bsd/osf/sigaction.h delete mode 100644 sysdeps/unix/bsd/posix_opt.h delete mode 100644 sysdeps/unix/bsd/signum.h delete mode 100644 sysdeps/unix/bsd/statbuf.h create mode 100644 sysdeps/unix/bsd/sun/bits/signum.h create mode 100644 sysdeps/unix/bsd/sun/m68k/bits/sigcontext.h delete mode 100644 sysdeps/unix/bsd/sun/m68k/sigcontext.h delete mode 100644 sysdeps/unix/bsd/sun/signum.h create mode 100644 sysdeps/unix/bsd/sun/sparc/bits/sigcontext.h delete mode 100644 sysdeps/unix/bsd/sun/sparc/sigcontext.h create mode 100644 sysdeps/unix/bsd/sun/sunos4/bits/fcntl.h create mode 100644 sysdeps/unix/bsd/sun/sunos4/bits/resource.h create mode 100644 sysdeps/unix/bsd/sun/sunos4/bits/termios.h create mode 100644 sysdeps/unix/bsd/sun/sunos4/bits/utsname.h delete mode 100644 sysdeps/unix/bsd/sun/sunos4/fcntlbits.h delete mode 100644 sysdeps/unix/bsd/sun/sunos4/resourcebits.h delete mode 100644 sysdeps/unix/bsd/sun/sunos4/termbits.h delete mode 100644 sysdeps/unix/bsd/sun/sunos4/utsnamelen.h create mode 100644 sysdeps/unix/bsd/ultrix4/bits/fcntl.h create mode 100644 sysdeps/unix/bsd/ultrix4/bits/posix_opt.h create mode 100644 sysdeps/unix/bsd/ultrix4/bits/utsname.h delete mode 100644 sysdeps/unix/bsd/ultrix4/fcntlbits.h create mode 100644 sysdeps/unix/bsd/ultrix4/mips/bits/sigcontext.h delete mode 100644 sysdeps/unix/bsd/ultrix4/mips/sigcontext.h delete mode 100644 sysdeps/unix/bsd/ultrix4/posix_opt.h delete mode 100644 sysdeps/unix/bsd/ultrix4/utsnamelen.h delete mode 100644 sysdeps/unix/bsd/waitflags.h create mode 100644 sysdeps/unix/common/bits/dirent.h create mode 100644 sysdeps/unix/common/bits/fcntl.h delete mode 100644 sysdeps/unix/common/direntry.h delete mode 100644 sysdeps/unix/common/fcntlbits.h create mode 100644 sysdeps/unix/sysv/bits/dirent.h create mode 100644 sysdeps/unix/sysv/bits/fcntl.h create mode 100644 sysdeps/unix/sysv/bits/local_lim.h create mode 100644 sysdeps/unix/sysv/bits/signum.h create mode 100644 sysdeps/unix/sysv/bits/stat.h create mode 100644 sysdeps/unix/sysv/bits/utmp.h create mode 100644 sysdeps/unix/sysv/bits/utsname.h delete mode 100644 sysdeps/unix/sysv/direntry.h delete mode 100644 sysdeps/unix/sysv/fcntlbits.h create mode 100644 sysdeps/unix/sysv/irix4/bits/confname.h create mode 100644 sysdeps/unix/sysv/irix4/bits/fcntl.h create mode 100644 sysdeps/unix/sysv/irix4/bits/signum.h create mode 100644 sysdeps/unix/sysv/irix4/bits/stat.h delete mode 100644 sysdeps/unix/sysv/irix4/confname.h delete mode 100644 sysdeps/unix/sysv/irix4/fcntlbits.h delete mode 100644 sysdeps/unix/sysv/irix4/signum.h delete mode 100644 sysdeps/unix/sysv/irix4/statbuf.h create mode 100644 sysdeps/unix/sysv/linux/alpha/bits/fcntl.h create mode 100644 sysdeps/unix/sysv/linux/alpha/bits/ioctls.h create mode 100644 sysdeps/unix/sysv/linux/alpha/bits/ipc.h create mode 100644 sysdeps/unix/sysv/linux/alpha/bits/sigaction.h create mode 100644 sysdeps/unix/sysv/linux/alpha/bits/signum.h create mode 100644 sysdeps/unix/sysv/linux/alpha/bits/stat.h create mode 100644 sysdeps/unix/sysv/linux/alpha/bits/termios.h create mode 100644 sysdeps/unix/sysv/linux/alpha/bits/time.h create mode 100644 sysdeps/unix/sysv/linux/alpha/bits/types.h delete mode 100644 sysdeps/unix/sysv/linux/alpha/fcntlbits.h delete mode 100644 sysdeps/unix/sysv/linux/alpha/gnu/types.h delete mode 100644 sysdeps/unix/sysv/linux/alpha/ioctls.h create mode 100644 sysdeps/unix/sysv/linux/alpha/kernel_termios.h delete mode 100644 sysdeps/unix/sysv/linux/alpha/sigaction.h delete mode 100644 sysdeps/unix/sysv/linux/alpha/signum.h delete mode 100644 sysdeps/unix/sysv/linux/alpha/statbuf.h delete mode 100644 sysdeps/unix/sysv/linux/alpha/sys/ipc_buf.h delete mode 100644 sysdeps/unix/sysv/linux/alpha/sys/kernel_termios.h delete mode 100644 sysdeps/unix/sysv/linux/alpha/termbits.h delete mode 100644 sysdeps/unix/sysv/linux/alpha/timebits.h create mode 100644 sysdeps/unix/sysv/linux/bits/dirent.h create mode 100644 sysdeps/unix/sysv/linux/bits/errno.h create mode 100644 sysdeps/unix/sysv/linux/bits/fcntl.h create mode 100644 sysdeps/unix/sysv/linux/bits/ioctl-types.h create mode 100644 sysdeps/unix/sysv/linux/bits/ioctls.h create mode 100644 sysdeps/unix/sysv/linux/bits/ipc.h create mode 100644 sysdeps/unix/sysv/linux/bits/local_lim.h create mode 100644 sysdeps/unix/sysv/linux/bits/msq.h create mode 100644 sysdeps/unix/sysv/linux/bits/posix_opt.h create mode 100644 sysdeps/unix/sysv/linux/bits/resource.h create mode 100644 sysdeps/unix/sysv/linux/bits/sched.h create mode 100644 sysdeps/unix/sysv/linux/bits/sem.h create mode 100644 sysdeps/unix/sysv/linux/bits/shm.h create mode 100644 sysdeps/unix/sysv/linux/bits/sigaction.h create mode 100644 sysdeps/unix/sysv/linux/bits/sigcontext.h create mode 100644 sysdeps/unix/sysv/linux/bits/signum.h create mode 100644 sysdeps/unix/sysv/linux/bits/sigset.h create mode 100644 sysdeps/unix/sysv/linux/bits/socket.h create mode 100644 sysdeps/unix/sysv/linux/bits/stat.h create mode 100644 sysdeps/unix/sysv/linux/bits/statfs.h create mode 100644 sysdeps/unix/sysv/linux/bits/termios.h create mode 100644 sysdeps/unix/sysv/linux/bits/time.h create mode 100644 sysdeps/unix/sysv/linux/bits/types.h create mode 100644 sysdeps/unix/sysv/linux/bits/uio.h create mode 100644 sysdeps/unix/sysv/linux/bits/ustat.h create mode 100644 sysdeps/unix/sysv/linux/bits/utsname.h create mode 100644 sysdeps/unix/sysv/linux/bits/waitflags.h delete mode 100644 sysdeps/unix/sysv/linux/direntry.h delete mode 100644 sysdeps/unix/sysv/linux/errnos.h delete mode 100644 sysdeps/unix/sysv/linux/fcntlbits.h delete mode 100644 sysdeps/unix/sysv/linux/gnu/types.h delete mode 100644 sysdeps/unix/sysv/linux/ioctl-types.h delete mode 100644 sysdeps/unix/sysv/linux/ioctls.h delete mode 100644 sysdeps/unix/sysv/linux/iovec.h create mode 100644 sysdeps/unix/sysv/linux/kernel_termios.h delete mode 100644 sysdeps/unix/sysv/linux/local_lim.h delete mode 100644 sysdeps/unix/sysv/linux/posix_opt.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/termios.h delete mode 100644 sysdeps/unix/sysv/linux/powerpc/ioctl-types.h delete mode 100644 sysdeps/unix/sysv/linux/powerpc/sys/kernel_termios.h delete mode 100644 sysdeps/unix/sysv/linux/powerpc/termbits.h delete mode 100644 sysdeps/unix/sysv/linux/resourcebits.h delete mode 100644 sysdeps/unix/sysv/linux/schedbits.h delete mode 100644 sysdeps/unix/sysv/linux/sigaction.h delete mode 100644 sysdeps/unix/sysv/linux/sigcontext.h delete mode 100644 sysdeps/unix/sysv/linux/signum.h delete mode 100644 sysdeps/unix/sysv/linux/sigset.h delete mode 100644 sysdeps/unix/sysv/linux/socketbits.h create mode 100644 sysdeps/unix/sysv/linux/socketcall.h create mode 100644 sysdeps/unix/sysv/linux/sparc/bits/fcntl.h create mode 100644 sysdeps/unix/sysv/linux/sparc/bits/ioctls.h create mode 100644 sysdeps/unix/sysv/linux/sparc/bits/sigaction.h create mode 100644 sysdeps/unix/sysv/linux/sparc/bits/signum.h create mode 100644 sysdeps/unix/sysv/linux/sparc/bits/termios.h delete mode 100644 sysdeps/unix/sysv/linux/sparc/fcntlbits.h delete mode 100644 sysdeps/unix/sysv/linux/sparc/ioctls.h delete mode 100644 sysdeps/unix/sysv/linux/sparc/sigaction.h delete mode 100644 sysdeps/unix/sysv/linux/sparc/signum.h delete mode 100644 sysdeps/unix/sysv/linux/sparc/termbits.h delete mode 100644 sysdeps/unix/sysv/linux/statbuf.h delete mode 100644 sysdeps/unix/sysv/linux/statfsbuf.h delete mode 100644 sysdeps/unix/sysv/linux/sys/ipc_buf.h delete mode 100644 sysdeps/unix/sysv/linux/sys/kernel_termios.h delete mode 100644 sysdeps/unix/sysv/linux/sys/msq_buf.h delete mode 100644 sysdeps/unix/sysv/linux/sys/sem_buf.h delete mode 100644 sysdeps/unix/sysv/linux/sys/shm_buf.h delete mode 100644 sysdeps/unix/sysv/linux/sys/socketcall.h delete mode 100644 sysdeps/unix/sysv/linux/termbits.h delete mode 100644 sysdeps/unix/sysv/linux/timebits.h delete mode 100644 sysdeps/unix/sysv/linux/ustatbits.h delete mode 100644 sysdeps/unix/sysv/linux/utsnamelen.h delete mode 100644 sysdeps/unix/sysv/linux/waitflags.h delete mode 100644 sysdeps/unix/sysv/local_lim.h create mode 100644 sysdeps/unix/sysv/minix/bits/sigaction.h delete mode 100644 sysdeps/unix/sysv/minix/sigaction.h create mode 100644 sysdeps/unix/sysv/sco3.2.4/bits/confname.h create mode 100644 sysdeps/unix/sysv/sco3.2.4/bits/sigaction.h delete mode 100644 sysdeps/unix/sysv/sco3.2.4/confname.h delete mode 100644 sysdeps/unix/sysv/sco3.2.4/sigaction.h create mode 100644 sysdeps/unix/sysv/sco3.2/bits/local_lim.h delete mode 100644 sysdeps/unix/sysv/sco3.2/local_lim.h delete mode 100644 sysdeps/unix/sysv/signum.h delete mode 100644 sysdeps/unix/sysv/statbuf.h create mode 100644 sysdeps/unix/sysv/sysv4/bits/sigaction.h create mode 100644 sysdeps/unix/sysv/sysv4/bits/signum.h create mode 100644 sysdeps/unix/sysv/sysv4/bits/sigset.h create mode 100644 sysdeps/unix/sysv/sysv4/bits/utsname.h create mode 100644 sysdeps/unix/sysv/sysv4/bits/waitflags.h create mode 100644 sysdeps/unix/sysv/sysv4/i386/bits/stat.h delete mode 100644 sysdeps/unix/sysv/sysv4/i386/statbuf.h delete mode 100644 sysdeps/unix/sysv/sysv4/sigaction.h delete mode 100644 sysdeps/unix/sysv/sysv4/signum.h delete mode 100644 sysdeps/unix/sysv/sysv4/sigset.h create mode 100644 sysdeps/unix/sysv/sysv4/solaris2/bits/signum.h create mode 100644 sysdeps/unix/sysv/sysv4/solaris2/bits/stat.h delete mode 100644 sysdeps/unix/sysv/sysv4/solaris2/signum.h create mode 100644 sysdeps/unix/sysv/sysv4/solaris2/sparc/bits/sigcontext.h delete mode 100644 sysdeps/unix/sysv/sysv4/solaris2/sparc/sigcontext.h delete mode 100644 sysdeps/unix/sysv/sysv4/solaris2/statbuf.h delete mode 100644 sysdeps/unix/sysv/sysv4/utsnamelen.h delete mode 100644 sysdeps/unix/sysv/sysv4/waitflags.h delete mode 100644 sysdeps/unix/sysv/utmpbits.h delete mode 100644 sysdeps/unix/sysv/utsnamelen.h create mode 100644 sysdeps/vax/bits/huge_val.h create mode 100644 sysdeps/vax/bits/setjmp.h delete mode 100644 sysdeps/vax/huge_val.h delete mode 100644 sysdeps/vax/jmp_buf.h create mode 100644 sysdeps/wordsize-32/bits/elfclass.h delete mode 100644 sysdeps/wordsize-32/elfclass.h create mode 100644 sysdeps/wordsize-64/bits/elfclass.h delete mode 100644 sysdeps/wordsize-64/elfclass.h (limited to 'sysdeps') diff --git a/sysdeps/alpha/__math.h b/sysdeps/alpha/__math.h deleted file mode 100644 index 0f76027..0000000 --- a/sysdeps/alpha/__math.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Inline math functions for Alpha. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Mosberger-Tang. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#if defined (__GNUC__) && !defined (__NO_MATH_INLINES) - -extern __inline double -__copysign (double __x, double __y) -{ - __asm ("cpys %1, %2, %0" : "=f" (__x) : "f" (__y), "f" (__x)); - return __x; -} - -extern __inline double -fabs (double __x) -{ - __asm ("cpys $f31, %1, %0" : "=f" (__x) : "f" (__x)); - return __x; -} - -extern __inline double -atan (double __x) -{ - extern double __atan2 (double, double); - return __atan2 (__x, 1.0); -} - -#endif diff --git a/sysdeps/alpha/bits/endian.h b/sysdeps/alpha/bits/endian.h new file mode 100644 index 0000000..e873d21 --- /dev/null +++ b/sysdeps/alpha/bits/endian.h @@ -0,0 +1,3 @@ +/* Alpha is little-endian. */ + +#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/sysdeps/alpha/bits/setjmp.h b/sysdeps/alpha/bits/setjmp.h new file mode 100644 index 0000000..6e6f6b4 --- /dev/null +++ b/sysdeps/alpha/bits/setjmp.h @@ -0,0 +1,46 @@ +/* Define the machine-dependent type `jmp_buf'. Alpha version. +Copyright (C) 1992 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 Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +typedef struct + { + /* Integer registers: + $0 is the return value; + $1-$8, $22-$25, $28 are call-used; + $9-$14 we save here; + $15 is the FP and we save it here; + $16-$21 are input arguments (call-used); + $26 is the return PC and we save it here; + $27 is the procedure value (i.e., the address of __setjmp); + $29 is the global pointer, which the caller will reconstruct + from the return address restored in $26; + $30 is the stack pointer and we save it here; + $31 is always zero. */ + long int __9, __10, __11, __12, __13, __14; + long int *__pc, *__fp, *__sp; + +#if 1 /* XXX need predefine for TARGET_FPREGS */ + /* Floating-point registers: + $f0 is the floating return value; + $f1, $f10-$f15, $f22-$f30 are call-used; + $f2-$f9 we save here; + $f16-$21 are input args (call-used); + $f31 is always zero. */ + double __f2, __f3, __f4, __f5, __f6, __f7, __f8, __f9; +#endif /* Have FP regs. */ + } __jmp_buf[1]; diff --git a/sysdeps/alpha/bytesex.h b/sysdeps/alpha/bytesex.h deleted file mode 100644 index e873d21..0000000 --- a/sysdeps/alpha/bytesex.h +++ /dev/null @@ -1,3 +0,0 @@ -/* Alpha is little-endian. */ - -#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/sysdeps/alpha/fpu/bits/fenv.h b/sysdeps/alpha/fpu/bits/fenv.h new file mode 100644 index 0000000..7cb0e3e --- /dev/null +++ b/sysdeps/alpha/fpu/bits/fenv.h @@ -0,0 +1,104 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson , 1997 + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FENV_H +#error "Never use directly; include instead." +#endif + + +/* Define the bits representing the exception. + + Note that these are the bit positions as defined by the OSF/1 + ieee_{get,set}_control_word interface and not by the hardware fpcr. + + See the Alpha Architecture Handbook section 4.7.7.3 for details, + but in summary, trap shadows mean the hardware register can acquire + extra exception bits so for proper IEEE support the tracking has to + be done in software -- in this case with kernel support. + + As to why the system call interface isn't in the same format as + the hardware register, only those crazy folks at DEC can tell you. */ + +enum + { + FE_INEXACT = 1UL << 21, +#define FE_INEXACT FE_INEXACT + + FE_UNDERFLOW = 1UL << 20, +#define FE_UNDERFLOW FE_UNDERFLOW + + FE_OVERFLOW = 1UL << 19, +#define FE_OVERFLOW FE_OVERFLOW + + FE_DIVBYZERO = 1UL << 18, +#define FE_DIVBYZERO FE_DIVBYZERO + + FE_INVALID = 1UL << 17, +#define FE_INVALID FE_INVALID + + FE_ALL_EXCEPT = + (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) +#define FE_ALL_EXCEPT FE_ALL_EXCEPT + }; + + +/* Alpha chips support all four defined rouding modes. + + Note that code must be compiled to use dynamic rounding (/d) instructions + to see these changes. For gcc this is -mfp-rounding-mode=d; for DEC cc + this is -fprm d. The default for both is static rounding to nearest. + + These are shifted down 58 bits from the hardware fpcr because the + functions are declared to take integers. */ + +enum + { + FE_TOWARDSZERO = 0, +#define FE_TOWARDSZERO FE_TOWARDSZERO + + FE_DOWNWARD = 1, +#define FE_DOWNWARD FE_DOWNWARD + + FE_TONEAREST = 2, +#define FE_TONEAREST FE_TONEAREST + + FE_UPWARD = 3, +#define FE_UPWARD FE_UPWARD + }; + + +/* Type representing exception flags. */ +typedef unsigned long fexcept_t; + +/* Type representing floating-point environment. */ +typedef unsigned long fenv_t; + +/* If the default argument is used we use this value. Note that due to + architecture-specified page mappings, no user-space pointer will ever + have its two high bits set. Co-opt one. */ +#define FE_DFL_ENV ((fenv_t *) 0x8800000000000000UL) + +#ifdef __USE_GNU +/* Floating-point environment where none of the exceptions are masked. */ +# define FE_NOMASK_ENV ((fenv_t *) 0x880000000000003eUL) +#endif + +/* The system calls to talk to the kernel's FP code. */ +extern unsigned long __ieee_get_fp_control(void); +extern void __ieee_set_fp_control(unsigned long); diff --git a/sysdeps/alpha/fpu/bits/mathdef.h b/sysdeps/alpha/fpu/bits/mathdef.h new file mode 100644 index 0000000..0bc9c94 --- /dev/null +++ b/sysdeps/alpha/fpu/bits/mathdef.h @@ -0,0 +1,64 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _MATH_H +#error "Never use directly; include instead" +#endif + +/* FIXME! This file describes properties of the compiler, not the machine; + it should not be part of libc! */ + +#ifdef __GNUC__ +#if __STDC__ == 1 + +/* In GNU or ANSI mode, gcc leaves `float' expressions as-is. */ +typedef float float_t; +typedef double double_t; + +/* Signal that types stay as they were declared. */ +#define FLT_EVAL_METHOD 0 + +/* Define `INFINITY' as value of type `float_t'. */ +#define INFINITY HUGE_VALF + +#else + +/* For `gcc -traditional', `float' expressions are evaluated as `double'. */ +typedef double float_t; +typedef double double_t; + +/* Signal that both types are `double'. */ +#define FLT_EVAL_METHOD 1 + +/* Define `INFINITY' as value of type `float_t'. */ +#define INFINITY HUGE_VAL + +#endif +#else + +/* Wild guess at types for float_t and double_t. */ +typedef double float_t; +typedef double double_t; + +/* Strange compiler, we don't know how it works. */ +#define FLT_EVAL_METHOD -1 + +/* Define `INFINITY' as value of type `float_t'. */ +#define INFINITY HUGE_VAL + +#endif diff --git a/sysdeps/alpha/fpu/bits/mathinline.h b/sysdeps/alpha/fpu/bits/mathinline.h new file mode 100644 index 0000000..0f76027 --- /dev/null +++ b/sysdeps/alpha/fpu/bits/mathinline.h @@ -0,0 +1,44 @@ +/* Inline math functions for Alpha. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger-Tang. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#if defined (__GNUC__) && !defined (__NO_MATH_INLINES) + +extern __inline double +__copysign (double __x, double __y) +{ + __asm ("cpys %1, %2, %0" : "=f" (__x) : "f" (__y), "f" (__x)); + return __x; +} + +extern __inline double +fabs (double __x) +{ + __asm ("cpys $f31, %1, %0" : "=f" (__x) : "f" (__x)); + return __x; +} + +extern __inline double +atan (double __x) +{ + extern double __atan2 (double, double); + return __atan2 (__x, 1.0); +} + +#endif diff --git a/sysdeps/alpha/fpu/fenvbits.h b/sysdeps/alpha/fpu/fenvbits.h deleted file mode 100644 index 02414e4..0000000 --- a/sysdeps/alpha/fpu/fenvbits.h +++ /dev/null @@ -1,107 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Richard Henderson , 1997 - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This file should never be included directly. */ - -#ifndef _FENVBITS_H -#define _FENVBITS_H 1 - -/* Define the bits representing the exception. - - Note that these are the bit positions as defined by the OSF/1 - ieee_{get,set}_control_word interface and not by the hardware fpcr. - - See the Alpha Architecture Handbook section 4.7.7.3 for details, - but in summary, trap shadows mean the hardware register can acquire - extra exception bits so for proper IEEE support the tracking has to - be done in software -- in this case with kernel support. - - As to why the system call interface isn't in the same format as - the hardware register, only those crazy folks at DEC can tell you. */ - -enum - { - FE_INEXACT = 1UL << 21, -#define FE_INEXACT FE_INEXACT - - FE_UNDERFLOW = 1UL << 20, -#define FE_UNDERFLOW FE_UNDERFLOW - - FE_OVERFLOW = 1UL << 19, -#define FE_OVERFLOW FE_OVERFLOW - - FE_DIVBYZERO = 1UL << 18, -#define FE_DIVBYZERO FE_DIVBYZERO - - FE_INVALID = 1UL << 17, -#define FE_INVALID FE_INVALID - - FE_ALL_EXCEPT = - (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) -#define FE_ALL_EXCEPT FE_ALL_EXCEPT - }; - - -/* Alpha chips support all four defined rouding modes. - - Note that code must be compiled to use dynamic rounding (/d) instructions - to see these changes. For gcc this is -mfp-rounding-mode=d; for DEC cc - this is -fprm d. The default for both is static rounding to nearest. - - These are shifted down 58 bits from the hardware fpcr because the - functions are declared to take integers. */ - -enum - { - FE_TOWARDSZERO = 0, -#define FE_TOWARDSZERO FE_TOWARDSZERO - - FE_DOWNWARD = 1, -#define FE_DOWNWARD FE_DOWNWARD - - FE_TONEAREST = 2, -#define FE_TONEAREST FE_TONEAREST - - FE_UPWARD = 3, -#define FE_UPWARD FE_UPWARD - }; - - -/* Type representing exception flags. */ -typedef unsigned long fexcept_t; - -/* Type representing floating-point environment. */ -typedef unsigned long fenv_t; - -/* If the default argument is used we use this value. Note that due to - architecture-specified page mappings, no user-space pointer will ever - have its two high bits set. Co-opt one. */ -#define FE_DFL_ENV ((fenv_t *) 0x8800000000000000UL) - -#ifdef __USE_GNU -/* Floating-point environment where none of the exceptions are masked. */ -# define FE_NOMASK_ENV ((fenv_t *) 0x880000000000003eUL) -#endif - -/* The system calls to talk to the kernel's FP code. */ -extern unsigned long __ieee_get_fp_control(void); -extern void __ieee_set_fp_control(unsigned long); - - -#endif /* fenvbits.h */ diff --git a/sysdeps/alpha/jmp_buf.h b/sysdeps/alpha/jmp_buf.h deleted file mode 100644 index 6e6f6b4..0000000 --- a/sysdeps/alpha/jmp_buf.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Define the machine-dependent type `jmp_buf'. Alpha version. -Copyright (C) 1992 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 Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -typedef struct - { - /* Integer registers: - $0 is the return value; - $1-$8, $22-$25, $28 are call-used; - $9-$14 we save here; - $15 is the FP and we save it here; - $16-$21 are input arguments (call-used); - $26 is the return PC and we save it here; - $27 is the procedure value (i.e., the address of __setjmp); - $29 is the global pointer, which the caller will reconstruct - from the return address restored in $26; - $30 is the stack pointer and we save it here; - $31 is always zero. */ - long int __9, __10, __11, __12, __13, __14; - long int *__pc, *__fp, *__sp; - -#if 1 /* XXX need predefine for TARGET_FPREGS */ - /* Floating-point registers: - $f0 is the floating return value; - $f1, $f10-$f15, $f22-$f30 are call-used; - $f2-$f9 we save here; - $f16-$21 are input args (call-used); - $f31 is always zero. */ - double __f2, __f3, __f4, __f5, __f6, __f7, __f8, __f9; -#endif /* Have FP regs. */ - } __jmp_buf[1]; diff --git a/sysdeps/alpha/w_sqrt.S b/sysdeps/alpha/w_sqrt.S index cf5ae09..32b0688 100644 --- a/sysdeps/alpha/w_sqrt.S +++ b/sysdeps/alpha/w_sqrt.S @@ -25,7 +25,7 @@ #ifndef _IEEE_FP #define _ERRNO_H -#include +#include #include .set noreorder diff --git a/sysdeps/arm/__longjmp.S b/sysdeps/arm/__longjmp.S index 5443761..b027103 100644 --- a/sysdeps/arm/__longjmp.S +++ b/sysdeps/arm/__longjmp.S @@ -19,7 +19,7 @@ #include #define _ASM -#include +#include /* __longjmp(jmpbuf, val) */ diff --git a/sysdeps/arm/bits/endian.h b/sysdeps/arm/bits/endian.h new file mode 100644 index 0000000..32f8489 --- /dev/null +++ b/sysdeps/arm/bits/endian.h @@ -0,0 +1,3 @@ +/* ARM is little-endian. */ + +#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/sysdeps/arm/bits/setjmp.h b/sysdeps/arm/bits/setjmp.h new file mode 100644 index 0000000..93b0f5f --- /dev/null +++ b/sysdeps/arm/bits/setjmp.h @@ -0,0 +1,10 @@ +/* Define the machine-dependent type `jmp_buf'. ARM version. */ + +#ifndef _ASM +/* Jump buffer contains v1-v6, sl, fp, sp, pc and (f4-f7) if we do FP. */ +#if __ARM_USES_FP +typedef int __jmp_buf[22]; +#else +typedef int __jmp_buf[10]; +#endif +#endif diff --git a/sysdeps/arm/bytesex.h b/sysdeps/arm/bytesex.h deleted file mode 100644 index 32f8489..0000000 --- a/sysdeps/arm/bytesex.h +++ /dev/null @@ -1,3 +0,0 @@ -/* ARM is little-endian. */ - -#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/sysdeps/arm/jmp_buf.h b/sysdeps/arm/jmp_buf.h deleted file mode 100644 index 93b0f5f..0000000 --- a/sysdeps/arm/jmp_buf.h +++ /dev/null @@ -1,10 +0,0 @@ -/* Define the machine-dependent type `jmp_buf'. ARM version. */ - -#ifndef _ASM -/* Jump buffer contains v1-v6, sl, fp, sp, pc and (f4-f7) if we do FP. */ -#if __ARM_USES_FP -typedef int __jmp_buf[22]; -#else -typedef int __jmp_buf[10]; -#endif -#endif diff --git a/sysdeps/arm/setjmp.S b/sysdeps/arm/setjmp.S index 5891cb9..8f99e4f 100644 --- a/sysdeps/arm/setjmp.S +++ b/sysdeps/arm/setjmp.S @@ -19,7 +19,7 @@ #include #define _ASM -#include +#include /* Binary compatibility entry point. */ ENTRY (__setjmp) diff --git a/sysdeps/generic/Makefile b/sysdeps/generic/Makefile index 5513ca9..110669c 100644 --- a/sysdeps/generic/Makefile +++ b/sysdeps/generic/Makefile @@ -41,7 +41,7 @@ $(objpfx)siglist.c: $(objpfx)make_siglist mv $@-tmp $@ make_siglist-CFLAGS = -DSIGNUM_H=\"$(shell pwd)/$(firstword $(wildcard \ - $(+sysdep_dirs:%=%/signum.h)))\" + $(+sysdep_dirs:%=%/bits/signum.h)))\" $(objpfx)make_siglist: $(sysdep_dir)/generic/make_siglist.c $(native-compile) diff --git a/sysdeps/generic/abort.c b/sysdeps/generic/abort.c index c1969f4..a38022a 100644 --- a/sysdeps/generic/abort.c +++ b/sysdeps/generic/abort.c @@ -16,7 +16,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include #include #include #include diff --git a/sysdeps/generic/bits/confname.h b/sysdeps/generic/bits/confname.h new file mode 100644 index 0000000..5b5cf74 --- /dev/null +++ b/sysdeps/generic/bits/confname.h @@ -0,0 +1,325 @@ +/* `sysconf', `pathconf', and `confstr' NAME values. Generic version. + Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* 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, + _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 + }; + +/* 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_LIST_MAX _SC_AIO_LIST_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_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 + }; + +#ifdef __USE_POSIX2 +/* Values for the NAME argument to `confstr'. */ +enum + { + _CS_PATH /* The default search path. */ + }; +#endif diff --git a/sysdeps/generic/bits/ioctl-types.h b/sysdeps/generic/bits/ioctl-types.h new file mode 100644 index 0000000..1d5c8a0 --- /dev/null +++ b/sysdeps/generic/bits/ioctl-types.h @@ -0,0 +1,121 @@ +/* Structure types for pre-termios terminal ioctls. Generic Unix version. + Copyright (C) 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_IOCTL_TYPES_H +#define _BITS_IOCTL_TYPES_H 1 + + +#if defined(TIOCGETC) || defined(TIOCSETC) +/* Type of ARG for TIOCGETC and TIOCSETC requests. */ +struct tchars +{ + char t_intrc; /* Interrupt character. */ + char t_quitc; /* Quit character. */ + char t_startc; /* Start-output character. */ + char t_stopc; /* Stop-output character. */ + char t_eofc; /* End-of-file character. */ + char t_brkc; /* Input delimiter character. */ +}; + +#define _IOT_tchars /* Hurd ioctl type field. */ \ + _IOT (_IOTS (char), 6, 0, 0, 0, 0) +#endif + +#if defined(TIOCGLTC) || defined(TIOCSLTC) +/* Type of ARG for TIOCGLTC and TIOCSLTC requests. */ +struct ltchars +{ + char t_suspc; /* Suspend character. */ + char t_dsuspc; /* Delayed suspend character. */ + char t_rprntc; /* Reprint-line character. */ + char t_flushc; /* Flush-output character. */ + char t_werasc; /* Word-erase character. */ + char t_lnextc; /* Literal-next character. */ +}; + +#define _IOT_ltchars /* Hurd ioctl type field. */ \ + _IOT (_IOTS (char), 6, 0, 0, 0, 0) +#endif + +/* Type of ARG for TIOCGETP and TIOCSETP requests (and gtty and stty). */ +struct sgttyb +{ + char sg_ispeed; /* Input speed. */ + char sg_ospeed; /* Output speed. */ + char sg_erase; /* Erase character. */ + char sg_kill; /* Kill character. */ + short int sg_flags; /* Mode flags. */ +}; + +#define _IOT_sgttyb /* Hurd ioctl type field. */ \ + _IOT (_IOTS (char), 6, _IOTS (short int), 1, 0, 0) + +#if defined(TIOCGWINSZ) || defined(TIOCSWINSZ) +/* Type of ARG for TIOCGWINSZ and TIOCSWINSZ requests. */ +struct winsize +{ + unsigned short int ws_row; /* Rows, in characters. */ + unsigned short int ws_col; /* Columns, in characters. */ + + /* These are not actually used. */ + unsigned short int ws_xpixel; /* Horizontal pixels. */ + unsigned short int ws_ypixel; /* Vertical pixels. */ +}; + +#define _IOT_winsize /* Hurd ioctl type field. */ \ + _IOT (_IOTS (unsigned short int), 4, 0, 0, 0, 0) +#endif + +#if defined (TIOCGSIZE) || defined (TIOCSSIZE) +/* The BSD-style ioctl constructor macros use `sizeof', which can't be used + in a preprocessor conditional. Since the commands are always unique + regardless of the size bits, we can safely define away `sizeof' for the + purpose of the conditional. */ +# define sizeof(type) 0 +# if defined (TIOCGWINSZ) && TIOCGSIZE == TIOCGWINSZ +/* Many systems that have TIOCGWINSZ define TIOCGSIZE for source + compatibility with Sun; they define `struct ttysize' to have identical + layout as `struct winsize' and #define TIOCGSIZE to be TIOCGWINSZ + (likewise TIOCSSIZE and TIOCSWINSZ). */ +struct ttysize +{ + unsigned short int ts_lines; + unsigned short int ts_cols; + unsigned short int ts_xxx; + unsigned short int ts_yyy; +}; +#define _IOT_ttysize _IOT_winsize +# else +/* Suns use a different layout for `struct ttysize', and TIOCGSIZE and + TIOCGWINSZ are separate commands that do the same thing with different + structures (likewise TIOCSSIZE and TIOCSWINSZ). */ +struct ttysize +{ + int ts_lines, ts_cols; /* Lines and columns, in characters. */ +}; +# endif +# undef sizeof /* See above. */ +#endif + + +#endif /* bits/ioctl-types.h */ diff --git a/sysdeps/generic/bits/mathdef.h b/sysdeps/generic/bits/mathdef.h new file mode 100644 index 0000000..93b60bd --- /dev/null +++ b/sysdeps/generic/bits/mathdef.h @@ -0,0 +1,40 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _MATH_H +# error "Never use directly; include instead" +#endif + + +/* Normally, there is no long double type and the `float' and `double' + expressions are evaluated as `double'. */ +typedef double float_t; /* `float' expressions are evaluated as + `double'. */ +typedef double double_t; /* `double' expressions are evaluated as + `double'. */ + +/* Signal that both types are `double'. */ +#define FLT_EVAL_METHOD 1 + +/* Define `INFINITY' as value of type `float_t'. */ +#define INFINITY HUGE_VAL + + +/* The values returned by `ilogb' for 0 and NaN respectively. */ +#define FP_ILOGB0 0x80000001 +#define FP_ILOGBNAN 0x7fffffff diff --git a/sysdeps/generic/bits/resource.h b/sysdeps/generic/bits/resource.h new file mode 100644 index 0000000..2c35c12 --- /dev/null +++ b/sysdeps/generic/bits/resource.h @@ -0,0 +1,146 @@ +/* Bit values & structures for resource limits. 4.4 BSD/generic GNU version. + Copyright (C) 1994, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* These are the values for 4.4 BSD and GNU. Earlier BSD systems have a + subset of these kinds of resource limit. In systems where `getrlimit' + and `setrlimit' are not system calls, these are the values used by the C + library to emulate them. */ + +/* Kinds of resource limit. */ +enum __rlimit_resource + { + /* Per-process CPU limit, in seconds. */ + RLIMIT_CPU, +#define RLIMIT_CPU RLIMIT_CPU + /* Largest file that can be created, in bytes. */ + RLIMIT_FSIZE, +#define RLIMIT_FSIZE RLIMIT_FSIZE + /* Maximum size of data segment, in bytes. */ + RLIMIT_DATA, +#define RLIMIT_DATA RLIMIT_DATA + /* Maximum size of stack segment, in bytes. */ + RLIMIT_STACK, +#define RLIMIT_STACK RLIMIT_STACK + /* Largest core file that can be created, in bytes. */ + RLIMIT_CORE, +#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, +#define RLIMIT_RSS RLIMIT_RSS + /* Locked-in-memory address space. */ + RLIMIT_MEMLOCK, +#define RLIMIT_MEMLOCK RLIMIT_MEMLOCK + /* Number of processes. */ + RLIMIT_NPROC, +#define RLIMIT_NPROC RLIMIT_NPROC + /* Number of open files. */ + RLIMIT_OFILE, + RLIMIT_NOFILE = RLIMIT_OFILE, /* Another name for the same thing. */ +#define RLIMIT_OFILE RLIMIT_OFILE +#define RLIMIT_NOFILE RLIMIT_NOFILE + + RLIMIT_NLIMITS, /* Number of limit flavors. */ + RLIM_NLIMITS = RLIMIT_NLIMITS, /* Traditional name for same. */ + + RLIM_INFINITY = 0x7fffffff /* Value to indicate that there is no limit. */ +#define RLIM_INFINITY RLIM_INFINITY + }; + +struct rlimit + { + /* The current (soft) limit. */ + int rlim_cur; + /* The hard limit. */ + int rlim_max; + }; + +/* Whose usage statistics do you want? */ +enum __rusage_who +/* The macro 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. */ + { + /* 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 + }; + +#include /* For `struct timeval'. */ + +/* Structure which says how much of each resource has been used. */ +struct rusage + { + /* Total amount of user time used. */ + struct timeval ru_utime; + /* Total amount of system time used. */ + struct timeval ru_stime; + /* Maximum resident set size (in kilobytes). */ + long int ru_maxrss; + /* Amount of sharing of text segment memory + with other processes (kilobyte-seconds). */ + long int ru_ixrss; + /* Amount of data segment memory used (kilobyte-seconds). */ + long int ru_idrss; + /* Amount of stack memory used (kilobyte-seconds). */ + long int ru_isrss; + /* Number of soft page faults (i.e. those serviced by reclaiming + a page from the list of pages awaiting reallocation. */ + long int ru_minflt; + /* Number of hard page faults (i.e. those that required I/O). */ + long int ru_majflt; + /* Number of times a process was swapped out of physical memory. */ + long int ru_nswap; + /* Number of input operations via the file system. Note: This + and `ru_oublock' do not include operations with the cache. */ + long int ru_inblock; + /* Number of output operations via the file system. */ + long int ru_oublock; + /* Number of IPC messages sent. */ + long int ru_msgsnd; + /* Number of IPC messages received. */ + long int ru_msgrcv; + /* Number of signals delivered. */ + long int ru_nsignals; + /* Number of voluntary context switches, i.e. because the process + gave up the process before it had to (usually to wait for some + resource to be available). */ + long int ru_nvcsw; + /* Number of involuntary context switches, i.e. a higher priority process + became runnable or the current process used up its time slice. */ + long int ru_nivcsw; + }; + +/* 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. */ + PRIO_PGRP = 1, /* WHO is a process group ID. */ + PRIO_USER = 2 /* WHO is a user ID. */ + }; diff --git a/sysdeps/generic/bits/sched.h b/sysdeps/generic/bits/sched.h new file mode 100644 index 0000000..bb5da56 --- /dev/null +++ b/sysdeps/generic/bits/sched.h @@ -0,0 +1,35 @@ +/* Definitions of constants and data structure for POSIX 1003.1b-1993 + scheduling interface. + Copyright (C) 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., 59 Temple Place + Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _SCHED_H +#error "Never use directly; include instead." +#endif + + +/* Scheduling algorithms. */ +#define SCHED_OTHER 0 +#define SCHED_FIFO 1 +#define SCHED_RR 2 + +/* Data structure to describe a process' schedulability. */ +struct sched_param +{ + int sched_priority; +}; diff --git a/sysdeps/generic/bits/select.h b/sysdeps/generic/bits/select.h new file mode 100644 index 0000000..6139195 --- /dev/null +++ b/sysdeps/generic/bits/select.h @@ -0,0 +1,29 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_SELECT_H +#error "Never use directly; include instead." +#endif + + +/* This line MUST be split! Otherwise m4 will not change it. */ +#define __FD_ZERO(set) \ + ((void) memset ((__ptr_t) (set), 0, sizeof (fd_set))) +#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) +#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) +#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) diff --git a/sysdeps/generic/bits/sigaction.h b/sysdeps/generic/bits/sigaction.h new file mode 100644 index 0000000..1676b1c --- /dev/null +++ b/sysdeps/generic/bits/sigaction.h @@ -0,0 +1,50 @@ +/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* These definitions match those used by the 4.4 BSD kernel. + If the operating system has a `sigaction' system call that correctly + implements the POSIX.1 behavior, there should be a system-dependent + version of this file that defines `struct sigaction' and the `SA_*' + constants appropriately. */ + +/* Structure describing the action to be taken when a signal arrives. */ +struct sigaction + { + /* Signal handler. */ + __sighandler_t sa_handler; + + /* Additional set of signals to be blocked. */ + __sigset_t sa_mask; + + /* Special flags. */ + int sa_flags; + }; + +/* Bits in `sa_flags'. */ +#ifdef __USE_BSD +#define SA_ONSTACK 0x1 /* Take signal on signal stack. */ +#define SA_RESTART 0x2 /* Don't restart syscall on signal return. */ +#define SA_DISABLE 0x4 /* Disable alternate signal stack. */ +#endif +#define SA_NOCLDSTOP 0x8 /* Don't send SIGCHLD when children stop. */ + + +/* Values for the HOW argument to `sigprocmask'. */ +#define SIG_BLOCK 1 /* Block signals. */ +#define SIG_UNBLOCK 2 /* Unblock signals. */ +#define SIG_SETMASK 3 /* Set the set of blocked signals. */ diff --git a/sysdeps/generic/bits/sigset.h b/sysdeps/generic/bits/sigset.h new file mode 100644 index 0000000..9fad453 --- /dev/null +++ b/sysdeps/generic/bits/sigset.h @@ -0,0 +1,81 @@ +/* __sig_atomic_t, __sigset_t, and related definitions. Generic/BSD version. + Copyright (C) 1991, 1992, 1994, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SIGSET_H_types +#define _SIGSET_H_types 1 + +typedef int __sig_atomic_t; + +/* A `sigset_t' has a bit for each signal. */ +typedef unsigned long int __sigset_t; + +#endif + + +/* We only want to define these functions if was actually + included; otherwise we were included just to define the types. Since we + are namespace-clean, it wouldn't hurt to define extra macros. But + trouble can be caused by functions being defined (e.g., any global + register vars declared later will cause compilation errors). */ + +#if !defined (_SIGSET_H_fns) && defined (_SIGNAL_H) +#define _SIGSET_H_fns 1 + +#ifndef _EXTERN_INLINE +#define _EXTERN_INLINE extern __inline +#endif + +/* Return a mask that includes SIG only. The cast to `sigset_t' avoids + overflow if `sigset_t' is wider than `int'. */ +#define __sigmask(sig) (((__sigset_t) 1) << ((sig) - 1)) + +#define __sigemptyset(set) ((*(set) = (__sigset_t) 0), 0) +#define __sigfillset(set) ((*(set) = ~(__sigset_t) 0), 0) + +#ifdef _GNU_SOURCE +# define __sigisemptyset(set) (*(set) == (__sigset_t) 0) +# define __sigandset(dest, left, right) \ + ((*(dest) = (*(left) & *(right))), 0) +# define __sigorset(dest, left, right) \ + ((*(dest) = (*(left) | *(right))), 0) +#endif + +/* These functions needn't check for a bogus signal number -- error + checking is done in the non __ versions. */ + +extern int __sigismember (__const __sigset_t *, int); +extern int __sigaddset (__sigset_t *, int); +extern int __sigdelset (__sigset_t *, int); + +#define __SIGSETFN(NAME, BODY, CONST) \ + _EXTERN_INLINE int \ + NAME (CONST __sigset_t *__set, int __sig) \ + { \ + __sigset_t __mask = __sigmask (__sig); \ + return BODY; \ + } + +__SIGSETFN (__sigismember, (*__set & __mask) ? 1 : 0, __const) +__SIGSETFN (__sigaddset, ((*__set |= __mask), 0), ) +__SIGSETFN (__sigdelset, ((*__set &= ~__mask), 0), ) + +#undef __SIGSETFN + + +#endif /* ! _SIGSET_H_fns. */ diff --git a/sysdeps/generic/bits/sockaddr.h b/sysdeps/generic/bits/sockaddr.h new file mode 100644 index 0000000..73a0e26 --- /dev/null +++ b/sysdeps/generic/bits/sockaddr.h @@ -0,0 +1,41 @@ +/* Definition of `struct sockaddr_*' common members. Generic/4.2 BSD version. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_SOCKADDR_H +#define _BITS_SOCKADDR_H 1 + + +/* POSIX.1g specifies this type name for the `sa_family' member. */ +typedef unsigned short int sa_family_t; + +/* This macro is used to declare the initial common members + of the data types used for socket addresses, `struct sockaddr', + `struct sockaddr_in', `struct sockaddr_un', etc. */ + +#define __SOCKADDR_COMMON(sa_prefix) \ + sa_family_t sa_prefix##family + +#define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int)) + + +#endif /* bits/sockaddr.h */ diff --git a/sysdeps/generic/bits/socket.h b/sysdeps/generic/bits/socket.h new file mode 100644 index 0000000..d12d96c --- /dev/null +++ b/sysdeps/generic/bits/socket.h @@ -0,0 +1,200 @@ +/* System-specific socket constants and types. Generic/4.3 BSD version. + Copyright (C) 1991, 92, 94, 95, 96, 97 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_SOCKET_H +#error "Never include directly; use instead." +#endif + + +#include + +__BEGIN_DECLS + +#define __need_size_t +#include + + +/* Types of sockets. */ +enum __socket_type +{ + SOCK_STREAM = 1, /* Sequenced, reliable, connection-based + byte streams. */ +#define SOCK_STREAM SOCK_STREAM + SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams + of fixed maximum length. */ +#define SOCK_DGRAM SOCK_DGRAM + SOCK_RAW = 3, /* Raw protocol interface. */ +#define SOCK_RAW SOCK_RAW + SOCK_RDM = 4, /* Reliably-delivered messages. */ +#define SOCK_RDM SOCK_RDM + SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based, + datagrams of fixed maximum length. */ +#define SOCK_SEQPACKET SOCK_SEQPACKET +}; + +/* Protocol families. */ +#define PF_UNSPEC 0 /* Unspecified. */ +#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */ +#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */ +#define PF_FILE PF_LOCAL /* POSIX name for PF_LOCAL. */ +#define PF_INET 2 /* IP protocol family. */ +#define PF_IMPLINK 3 /* ARPAnet IMP protocol. */ +#define PF_PUP 4 /* PUP protocols. */ +#define PF_CHAOS 5 /* MIT Chaos protocols. */ +#define PF_NS 6 /* Xerox NS protocols. */ +#define PF_ISO 7 /* ISO protocols. */ +#define PF_OSI PF_ISO +#define PF_ECMA 8 /* ECMA protocols. */ +#define PF_DATAKIT 9 /* AT&T Datakit protocols. */ +#define PF_CCITT 10 /* CCITT protocols (X.25 et al). */ +#define PF_SNA 11 /* IBM SNA protocol. */ +#define PF_DECnet 12 /* DECnet protocols. */ +#define PF_DLI 13 /* Direct data link interface. */ +#define PF_LAT 14 /* DEC Local Area Transport protocol. */ +#define PF_HYLINK 15 /* NSC Hyperchannel protocol. */ +#define PF_APPLETALK 16 /* Don't use this. */ +#define PF_ROUTE 17 /* Internal Routing Protocol. */ +#define PF_LINK 18 /* Link layer interface. */ +#define PF_XTP 19 /* eXpress Transfer Protocol (no AF). */ +#define PF_COIP 20 /* Connection-oriented IP, aka ST II. */ +#define PF_CNT 21 /* Computer Network Technology. */ +#define PF_RTIP 22 /* Help Identify RTIP packets. **/ +#define PF_IPX 23 /* Novell Internet Protocol. */ +#define PF_SIP 24 /* Simple Internet Protocol. */ +#define PF_PIP 25 /* Help Identify PIP packets. */ +#define PF_INET6 26 /* IP version 6. */ +#define PF_MAX 27 + +/* Address families. */ +#define AF_UNSPEC PF_UNSPEC +#define AF_LOCAL PF_LOCAL +#define AF_UNIX PF_UNIX +#define AF_FILE PF_FILE +#define AF_INET PF_INET +#define AF_IMPLINK PF_IMPLINK +#define AF_PUP PF_PUP +#define AF_CHAOS PF_CHAOS +#define AF_NS PF_NS +#define AF_ISO PF_ISO +#define AF_OSI PF_OSI +#define AF_ECMA PF_ECMA +#define AF_DATAKIT PF_DATAKIT +#define AF_CCITT PF_CCITT +#define AF_SNA PF_SNA +#define AF_DECnet PF_DECnet +#define AF_DLI PF_DLI +#define AF_LAT PF_LAT +#define AF_HYLINK PF_HYLINK +#define AF_APPLETALK PF_APPLETALK +#define AF_ROUTE PF_ROUTE +#define AF_LINK PF_LINK +#define pseudo_AF_XTP PF_XTP +#define AF_COIP PF_COIP +#define AF_CNT PF_CNT +#define pseudo_AF_RTIP PF_RTIP +#define AF_IPX PF_IPX +#define AF_SIP PF_SIP +#define pseudo_AF_PIP PF_PIP +#define AF_INET6 PF_INET6 +#define AF_MAX PF_MAX + + +/* Get the definition of the macro to define the common sockaddr members. */ +#include + +/* Structure describing a generic socket address. */ +struct sockaddr + { + __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */ + char sa_data[14]; /* Address data. */ + }; + + +/* Bits in the FLAGS argument to `send', `recv', et al. */ +enum + { + MSG_OOB = 0x01, /* Process out-of-band data. */ + MSG_PEEK = 0x02, /* Peek at incoming messages. */ + MSG_DONTROUTE = 0x04, /* Don't use local routing. */ + MSG_EOR = 0x08, /* Data completes record. */ + MSG_TRUNC = 0x10, /* Data discarded before delivery. */ + MSG_CTRUNC = 0x20, /* Control data lost before delivery. */ + MSG_WAITALL = 0x40, /* Wait for full request or error. */ + MSG_DONTWAIT = 0x80, /* This message should be nonblocking. */ + }; + + +/* Structure describing messages sent by + `sendmsg' and received by `recvmsg'. */ +struct msghdr + { + __ptr_t msg_name; /* Address to send to/receive from. */ + size_t msg_namelen; /* Length of address data. */ + + struct iovec *msg_iov; /* Vector of data to send/receive into. */ + size_t msg_iovlen; /* Number of elements in the vector. */ + + __ptr_t msg_accrights; /* Access rights information. */ + size_t msg_accrightslen; /* Length of access rights information. */ + }; + + +/* Protocol number used to manipulate socket-level options + with `getsockopt' and `setsockopt'. */ +#define SOL_SOCKET 0xffff + +/* Socket-level options for `getsockopt' and `setsockopt'. */ +enum + { + SO_DEBUG = 0x0001, /* Record debugging information. */ + SO_ACCEPTCONN = 0x0002, /* Accept connections on socket. */ + SO_REUSEADDR = 0x0004, /* Allow reuse of local addresses. */ + SO_KEEPALIVE = 0x0008, /* Keep connections alive and send + SIGPIPE when they die. */ + SO_DONTROUTE = 0x0010, /* Don't do local routing. */ + SO_BROADCAST = 0x0020, /* Allow transmission of + broadcast messages. */ + SO_USELOOPBACK = 0x0040, /* Use the software loopback to avoid + hardware use when possible. */ + SO_LINGER = 0x0080, /* Block on close of a reliable + socket to transmit pending data. */ + SO_OOBINLINE = 0x0100, /* Receive out-of-band data in-band. */ + + SO_REUSEPORT = 0x0200, /* Allow local address and port reuse. */ + + SO_SNDBUF = 0x1001, /* Send buffer size. */ + SO_RCVBUF = 0x1002, /* Receive buffer. */ + SO_SNDLOWAT = 0x1003, /* Send low-water mark. */ + SO_RCVLOWAT = 0x1004, /* Receive low-water mark. */ + SO_SNDTIMEO = 0x1005, /* Send timeout. */ + SO_RCVTIMEO = 0x1006, /* Receive timeout. */ + + SO_ERROR = 0x1007, /* Get and clear error status. */ + SO_STYLE = 0x1008, /* Get socket connection style. */ + SO_TYPE = SO_STYLE, /* Compatible name for SO_STYLE. */ + }; + +/* Structure used to manipulate the SO_LINGER option. */ +struct linger + { + int l_onoff; /* Nonzero to linger on close. */ + int l_linger; /* Time to linger. */ + }; + +__END_DECLS diff --git a/sysdeps/generic/bits/statfs.h b/sysdeps/generic/bits/statfs.h new file mode 100644 index 0000000..10bc072 --- /dev/null +++ b/sysdeps/generic/bits/statfs.h @@ -0,0 +1,52 @@ +/* Definition of `struct statfs', information about a filesystem. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_STATFS_H +#define _BITS_STATFS_H 1 + +#include + +/* GNU Hurd NOTE: The size of this structure (16 ints) is known in + , since it is used in the `file_statfs' RPC. MiG + does not cope at all well with the passed C structure not being of the + expected size. There are some filler words at the end to allow for + future expansion. To increase the size of the structure used in the RPC + and retain binary compatibility, we would need to assign a new message + number. */ + +struct statfs + { + unsigned int f_type; + unsigned int f_bsize; + unsigned int f_blocks; + unsigned int f_bfree; + unsigned int f_bavail; + unsigned int f_files; + unsigned int f_ffree; + __fsid_t f_fsid; + unsigned int f_namelen; + unsigned int f_spare[6]; + }; + + +#endif /* bits/statfs.h */ diff --git a/sysdeps/generic/bits/termios.h b/sysdeps/generic/bits/termios.h new file mode 100644 index 0000000..9a6aed2 --- /dev/null +++ b/sysdeps/generic/bits/termios.h @@ -0,0 +1,230 @@ +/* termios type and macro definitions. 4.4 BSD/generic GNU version. + Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* These macros are also defined in some files (with + numerically identical values), but this serves to shut up cpp's + complaining. */ +#ifdef __USE_BSD + +#ifdef MDMBUF +#undef MDMBUF +#endif +#ifdef FLUSHO +#undef FLUSHO +#endif +#ifdef PENDIN +#undef PENDIN +#endif + +#endif /* __USE_BSD */ + +#ifdef ECHO +#undef ECHO +#endif +#ifdef TOSTOP +#undef TOSTOP +#endif +#ifdef NOFLSH +#undef NOFLSH +#endif + + +/* These definitions match those used by the 4.4 BSD kernel. + If the operating system has termios system calls or ioctls that + correctly implement the POSIX.1 behavior, there should be a + system-dependent version of this file that defines `struct termios', + `tcflag_t', `cc_t', `speed_t' and the `TC*' constants appropriately. */ + +/* Type of terminal control flag masks. */ +typedef unsigned long int tcflag_t; + +/* Type of control characters. */ +typedef unsigned char cc_t; + +/* Type of baud rate specifiers. */ +typedef long int speed_t; + +/* Terminal control structure. */ +struct termios +{ + /* Input modes. */ + tcflag_t c_iflag; +#define IGNBRK (1 << 0) /* Ignore break condition. */ +#define BRKINT (1 << 1) /* Signal interrupt on break. */ +#define IGNPAR (1 << 2) /* Ignore characters with parity errors. */ +#define PARMRK (1 << 3) /* Mark parity and framing errors. */ +#define INPCK (1 << 4) /* Enable input parity check. */ +#define ISTRIP (1 << 5) /* Strip 8th bit off characters. */ +#define INLCR (1 << 6) /* Map NL to CR on input. */ +#define IGNCR (1 << 7) /* Ignore CR. */ +#define ICRNL (1 << 8) /* Map CR to NL on input. */ +#define IXON (1 << 9) /* Enable start/stop output control. */ +#define IXOFF (1 << 10) /* Enable start/stop input control. */ +#ifdef __USE_BSD +#define IXANY (1 << 11) /* Any character will restart after stop. */ +#define IMAXBEL (1 << 13) /* Ring bell when input queue is full. */ +#endif + + /* Output modes. */ + tcflag_t c_oflag; +#define OPOST (1 << 0) /* Perform output processing. */ +#ifdef __USE_BSD +#define ONLCR (1 << 1) /* Map NL to CR-NL on output. */ +#define OXTABS (1 << 2) /* Expand tabs to spaces. */ +#define ONOEOT (1 << 8) /* Discard EOT (^D) on output. */ +#endif + + /* Control modes. */ + tcflag_t c_cflag; +#ifdef __USE_BSD +#define CIGNORE (1 << 0) /* Ignore these control flags. */ +#endif +#define CSIZE (CS5|CS6|CS7|CS8) /* Number of bits per byte (mask). */ +#define CS5 0 /* 5 bits per byte. */ +#define CS6 (1 << 8) /* 6 bits per byte. */ +#define CS7 (1 << 9) /* 7 bits per byte. */ +#define CS8 (CS6|CS7) /* 8 bits per byte. */ +#define CSTOPB (1 << 10) /* Two stop bits instead of one. */ +#define CREAD (1 << 11) /* Enable receiver. */ +#define PARENB (1 << 12) /* Parity enable. */ +#define PARODD (1 << 13) /* Odd parity instead of even. */ +#define HUPCL (1 << 14) /* Hang up on last close. */ +#define CLOCAL (1 << 15) /* Ignore modem status lines. */ +#ifdef __USE_BSD +#define CCTS_OFLOW (1 << 16) /* CTS flow control of output. */ +#define CRTS_IFLOW (1 << 17) /* RTS flow control of input. */ +#define MDMBUF (1 << 20) /* Carrier flow control of output. */ +#endif + + /* Local modes. */ + tcflag_t c_lflag; +#ifdef __USE_BSD +#define ECHOKE (1 << 0) /* Visual erase for KILL. */ +#endif +#define _ECHOE (1 << 1) /* Visual erase for ERASE. */ +#define ECHOE _ECHOE +#define _ECHOK (1 << 2) /* Echo NL after KILL. */ +#define ECHOK _ECHOK +#define _ECHO (1 << 3) /* Enable echo. */ +#define ECHO _ECHO +#define _ECHONL (1 << 4) /* Echo NL even if ECHO is off. */ +#define ECHONL _ECHONL +#ifdef __USE_BSD +#define ECHOPRT (1 << 5) /* Hardcopy visual erase. */ +#define ECHOCTL (1 << 6) /* Echo control characters as ^X. */ +#endif +#define _ISIG (1 << 7) /* Enable signals. */ +#define ISIG _ISIG +#define _ICANON (1 << 8) /* Do erase and kill processing. */ +#define ICANON _ICANON +#ifdef __USE_BSD +#define ALTWERASE (1 << 9) /* Alternate WERASE algorithm. */ +#endif +#define _IEXTEN (1 << 10) /* Enable DISCARD and LNEXT. */ +#define IEXTEN _IEXTEN +#define EXTPROC (1 << 11) /* External processing. */ +#define _TOSTOP (1 << 22) /* Send SIGTTOU for background output. */ +#define TOSTOP _TOSTOP +#ifdef __USE_BSD +#define FLUSHO (1 << 23) /* Output being flushed (state). */ +#define NOKERNINFO (1 << 25) /* Disable VSTATUS. */ +#define PENDIN (1 << 29) /* Retype pending input (state). */ +#endif +#define _NOFLSH (1 << 31) /* Disable flush after interrupt. */ +#define NOFLSH _NOFLSH + + /* Control characters. */ +#define VEOF 0 /* End-of-file character [ICANON]. */ +#define VEOL 1 /* End-of-line character [ICANON]. */ +#ifdef __USE_BSD +#define VEOL2 2 /* Second EOL character [ICANON]. */ +#endif +#define VERASE 3 /* Erase character [ICANON]. */ +#ifdef __USE_BSD +#define VWERASE 4 /* Word-erase character [ICANON]. */ +#endif +#define VKILL 5 /* Kill-line character [ICANON]. */ +#ifdef __USE_BSD +#define VREPRINT 6 /* Reprint-line character [ICANON]. */ +#endif +#define VINTR 8 /* Interrupt character [ISIG]. */ +#define VQUIT 9 /* Quit character [ISIG]. */ +#define VSUSP 10 /* Suspend character [ISIG]. */ +#ifdef __USE_BSD +#define VDSUSP 11 /* Delayed suspend character [ISIG]. */ +#endif +#define VSTART 12 /* Start (X-ON) character [IXON, IXOFF]. */ +#define VSTOP 13 /* Stop (X-OFF) character [IXON, IXOFF]. */ +#ifdef __USE_BSD +#define VLNEXT 14 /* Literal-next character [IEXTEN]. */ +#define VDISCARD 15 /* Discard character [IEXTEN]. */ +#endif +#define VMIN 16 /* Minimum number of bytes read at once [!ICANON]. */ +#define VTIME 17 /* Time-out value (tenths of a second) [!ICANON]. */ +#ifdef __USE_BSD +#define VSTATUS 18 /* Status character [ICANON]. */ +#endif +#define NCCS 20 /* Value duplicated in . */ + cc_t c_cc[NCCS]; + + /* Input and output baud rates. */ + speed_t __ispeed, __ospeed; +#define B0 0 /* Hang up. */ +#define B50 50 /* 50 baud. */ +#define B75 75 /* 75 baud. */ +#define B110 110 /* 110 baud. */ +#define B134 134 /* 134.5 baud. */ +#define B150 150 /* 150 baud. */ +#define B200 200 /* 200 baud. */ +#define B300 300 /* 300 baud. */ +#define B600 600 /* 600 baud. */ +#define B1200 1200 /* 1200 baud. */ +#define B1800 1800 /* 1800 baud. */ +#define B2400 2400 /* 2400 baud. */ +#define B4800 4800 /* 4800 baud. */ +#define B9600 9600 /* 9600 baud. */ +#define B19200 19200 /* 19200 baud. */ +#define B38400 38400 /* 38400 baud. */ +#ifdef __USE_BSD +#define EXTA 19200 +#define EXTB 38400 +#endif +}; + +#define _IOT_termios /* Hurd ioctl type field. */ \ + _IOT (_IOTS (tcflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) + +/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ +#define TCSANOW 0 /* Change immediately. */ +#define TCSADRAIN 1 /* Change when pending output is written. */ +#define TCSAFLUSH 2 /* Flush pending input before changing. */ +#ifdef __USE_BSD +#define TCSASOFT 0x10 /* Flag: Don't alter hardware state. */ +#endif + +/* Values for the QUEUE_SELECTOR argument to `tcflush'. */ +#define TCIFLUSH 1 /* Discard data received but not yet read. */ +#define TCOFLUSH 2 /* Discard data written but not yet sent. */ +#define TCIOFLUSH 3 /* Discard all pending data. */ + +/* Values for the ACTION argument to `tcflow'. */ +#define TCOOFF 1 /* Suspend output. */ +#define TCOON 2 /* Restart suspended output. */ +#define TCIOFF 3 /* Send a STOP character. */ +#define TCION 4 /* Send a START character. */ diff --git a/sysdeps/generic/bits/types.h b/sysdeps/generic/bits/types.h new file mode 100644 index 0000000..c264adc --- /dev/null +++ b/sysdeps/generic/bits/types.h @@ -0,0 +1,94 @@ +/* Copyright (C) 1991, 92, 94, 95, 96, 97 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_TYPES_H +#define _BITS_TYPES_H 1 + + +/* Convenience types. */ +typedef unsigned char __u_char; +typedef unsigned short __u_short; +typedef unsigned int __u_int; +typedef unsigned long __u_long; +#ifdef __GNUC__ +typedef unsigned long long int __u_quad_t; +typedef long long int __quad_t; +#else +typedef struct +{ + long __val[2]; +} __quad_t; +typedef struct +{ + __u_long __val[2]; +} __u_quad_t; +#endif +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef signed short int __int16_t; +typedef unsigned short int __uint16_t; +typedef signed int __int32_t; +typedef unsigned int __uint32_t; +#ifdef __GNUC__ +typedef signed long long int __int64_t; +typedef unsigned long long int __uint64_t; +#endif +typedef __quad_t *__qaddr_t; +typedef int __dev_t; /* Type of device numbers. */ +typedef unsigned int __uid_t; /* Type of user identifications. */ +typedef unsigned int __gid_t; /* Type of group identifications. */ +typedef unsigned int __ino_t; /* Type of file serial numbers. */ +typedef unsigned int __mode_t; /* Type of file attribute bitmasks. */ +typedef unsigned short int __nlink_t; /* Type of file link counts. */ +typedef long int __off_t; /* Type of file sizes and offsets. */ +typedef __quad_t __loff_t; /* Type of file sizes and offsets. */ +typedef int __pid_t; /* Type of process identifications. */ +typedef int __ssize_t; /* Type of a byte count, or error. */ +typedef __u_quad_t __fsid_t; /* Type of file system IDs. */ +typedef long int __clock_t; /* Type of CPU usage counts. */ + +/* Everythin' else. */ +typedef long int __daddr_t; /* The type of a disk address. */ +typedef char *__caddr_t; +typedef long int __time_t; +typedef long int __swblk_t; /* Type of a swap block maybe? */ +typedef long int __key_t; /* Type of an IPC key */ + +/* fd_set for select. */ + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 256 + +/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ +#define __NFDBITS (sizeof (unsigned long int) * 8) +#define __FDELT(d) ((d) / __NFDBITS) +#define __FDMASK(d) (1 << ((d) % __NFDBITS)) + +typedef struct + { + /* XPG4.2 requires this member name. */ + unsigned long int fds_bits[(__FD_SETSIZE + (__NFDBITS - 1)) / __NFDBITS]; + } __fd_set; + +typedef unsigned long int __fd_mask; + +#endif /* bits/types.h */ diff --git a/sysdeps/generic/bits/uio.h b/sysdeps/generic/bits/uio.h new file mode 100644 index 0000000..1a12697 --- /dev/null +++ b/sysdeps/generic/bits/uio.h @@ -0,0 +1,32 @@ +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_UIO_H +#error "Never use directly; include instead." +#endif + + +/* `struct iovec' -- Structure describing a section of memory. */ + +struct iovec +{ + /* Starting address. */ + __ptr_t iov_base; + /* Length in bytes. */ + size_t iov_len; +}; diff --git a/sysdeps/generic/bits/ustat.h b/sysdeps/generic/bits/ustat.h new file mode 100644 index 0000000..aa5d493 --- /dev/null +++ b/sysdeps/generic/bits/ustat.h @@ -0,0 +1,30 @@ +/* Generic declaration of ustat structure. +Copyright (C) 1994, 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +__BEGIN_DECLS + +struct ustat +{ + __daddr_t f_tfree; /* total free */ + __ino_t f_tinode; /* total inodes free */ + char f_fname[6]; /* filesystem name */ + char f_fpack[6]; /* filesystem pack name */ +}; + +__END_DECLS diff --git a/sysdeps/generic/bits/utmp.h b/sysdeps/generic/bits/utmp.h new file mode 100644 index 0000000..b8decb0 --- /dev/null +++ b/sysdeps/generic/bits/utmp.h @@ -0,0 +1,53 @@ +/* The `struct utmp' type, describing entries in the utmp file. Generic/BSDish + Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _UTMP_H +#error "Never use directly; include instead." +#endif + + +#include + +#include +#include + + +#define UT_NAMESIZE 8 +#define UT_LINESIZE 8 +#define UT_HOSTSIZE 16 + +__BEGIN_DECLS + +struct lastlog { + time_t ll_time; + char ll_line[UT_LINESIZE]; + char ll_host[UT_HOSTSIZE]; +}; + +struct utmp { + char ut_line[UT_LINESIZE]; + char ut_name[UT_NAMESIZE]; + char ut_host[UT_HOSTSIZE]; + long ut_time; +}; + + +#define _HAVE_UT_HOST 1 /* We have the ut_host field. */ + + +__END_DECLS diff --git a/sysdeps/generic/bits/utsname.h b/sysdeps/generic/bits/utsname.h new file mode 100644 index 0000000..5594bcc --- /dev/null +++ b/sysdeps/generic/bits/utsname.h @@ -0,0 +1,3 @@ +/* The size of the character arrays used to hold the information + in a `struct utsname'. Enlarge this as necessary. */ +#define _UTSNAME_LENGTH 1024 diff --git a/sysdeps/generic/bits/waitstatus.h b/sysdeps/generic/bits/waitstatus.h new file mode 100644 index 0000000..8e97f27 --- /dev/null +++ b/sysdeps/generic/bits/waitstatus.h @@ -0,0 +1,104 @@ +/* Definitions of status bits for `wait' et al. + Copyright (C) 1992, 1994, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_WAIT_H +#error "Never use directly; include instead." +#endif + + +/* Everything extant so far uses these same bits. */ + + +/* If WIFEXITED(STATUS), the low-order 8 bits of the status. */ +#define __WEXITSTATUS(status) (((status) & 0xff00) >> 8) + +/* If WIFSIGNALED(STATUS), the terminating signal. */ +#define __WTERMSIG(status) ((status) & 0x7f) + +/* If WIFSTOPPED(STATUS), the signal that stopped the child. */ +#define __WSTOPSIG(status) __WEXITSTATUS(status) + +/* Nonzero if STATUS indicates normal termination. */ +#define __WIFEXITED(status) (__WTERMSIG(status) == 0) + +/* Nonzero if STATUS indicates termination by a signal. */ +#ifdef __GNUC__ +#define __WIFSIGNALED(status) \ + (__extension__ ({ int __status = (status); \ + !__WIFSTOPPED(__status) && !__WIFEXITED(__status); })) +#else /* Not GCC. */ +#define __WIFSIGNALED(status) (!__WIFSTOPPED(status) && !__WIFEXITED(status)) +#endif /* GCC. */ + +/* Nonzero if STATUS indicates the child is stopped. */ +#define __WIFSTOPPED(status) (((status) & 0xff) == 0x7f) + +/* Nonzero if STATUS indicates the child dumped core. */ +#define __WCOREDUMP(status) ((status) & __WCOREFLAG) + +/* Macros for constructing status values. */ +#define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) +#define __W_STOPCODE(sig) ((sig) << 8 | 0x7f) +#define __WCOREFLAG 0x80 + + +#ifdef __USE_BSD + +#include + +union wait + { + int w_status; + struct + { +#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned int __w_termsig:7; /* Terminating signal. */ + unsigned int __w_coredump:1; /* Set if dumped core. */ + unsigned int __w_retcode:8; /* Return code if exited normally. */ + unsigned int:16; +#endif /* Little endian. */ +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int:16; + unsigned int __w_retcode:8; + unsigned int __w_coredump:1; + unsigned int __w_termsig:7; +#endif /* Big endian. */ + } __wait_terminated; + struct + { +#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned int __w_stopval:8; /* W_STOPPED if stopped. */ + unsigned int __w_stopsig:8; /* Stopping signal. */ + unsigned int:16; +#endif /* Little endian. */ +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int:16; + unsigned int __w_stopsig:8; /* Stopping signal. */ + unsigned int __w_stopval:8; /* W_STOPPED if stopped. */ +#endif /* Big endian. */ + } __wait_stopped; + }; + +#define w_termsig __wait_terminated.__w_termsig +#define w_coredump __wait_terminated.__w_coredump +#define w_retcode __wait_terminated.__w_retcode +#define w_stopsig __wait_stopped.__w_stopsig +#define w_stopval __wait_stopped.__w_stopval + +#endif /* Use BSD. */ diff --git a/sysdeps/generic/confname.h b/sysdeps/generic/confname.h deleted file mode 100644 index 5b5cf74..0000000 --- a/sysdeps/generic/confname.h +++ /dev/null @@ -1,325 +0,0 @@ -/* `sysconf', `pathconf', and `confstr' NAME values. Generic version. - Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* 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, - _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 - }; - -/* 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_LIST_MAX _SC_AIO_LIST_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_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 - }; - -#ifdef __USE_POSIX2 -/* Values for the NAME argument to `confstr'. */ -enum - { - _CS_PATH /* The default search path. */ - }; -#endif diff --git a/sysdeps/generic/gnu/types.h b/sysdeps/generic/gnu/types.h deleted file mode 100644 index 85f17a4..0000000 --- a/sysdeps/generic/gnu/types.h +++ /dev/null @@ -1,81 +0,0 @@ -/* Copyright (C) 1991, 92, 94, 95, 96, 97 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _GNU_TYPES_H - -#define _GNU_TYPES_H 1 - - -/* Convenience types. */ -typedef unsigned char __u_char; -typedef unsigned short __u_short; -typedef unsigned int __u_int; -typedef unsigned long __u_long; -#ifdef __GNUC__ -typedef unsigned long long int __u_quad_t; -typedef long long int __quad_t; -#else -typedef struct -{ - long __val[2]; -} __quad_t; -typedef struct -{ - __u_long __val[2]; -} __u_quad_t; -#endif -typedef __quad_t *__qaddr_t; -typedef int __dev_t; /* Type of device numbers. */ -typedef unsigned int __uid_t; /* Type of user identifications. */ -typedef unsigned int __gid_t; /* Type of group identifications. */ -typedef unsigned int __ino_t; /* Type of file serial numbers. */ -typedef unsigned int __mode_t; /* Type of file attribute bitmasks. */ -typedef unsigned short int __nlink_t; /* Type of file link counts. */ -typedef long int __off_t; /* Type of file sizes and offsets. */ -typedef __quad_t __loff_t; /* Type of file sizes and offsets. */ -typedef int __pid_t; /* Type of process identifications. */ -typedef int __ssize_t; /* Type of a byte count, or error. */ -typedef __u_quad_t __fsid_t; /* Type of file system IDs. */ -typedef long int __clock_t; /* Type of CPU usage counts. */ - -/* Everythin' else. */ -typedef long int __daddr_t; /* The type of a disk address. */ -typedef char *__caddr_t; -typedef long int __time_t; -typedef long int __swblk_t; /* Type of a swap block maybe? */ -typedef long int __key_t; /* Type of an IPC key */ - -/* fd_set for select. */ - -/* Number of descriptors that can fit in an `fd_set'. */ -#define __FD_SETSIZE 256 - -/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ -#define __NFDBITS (sizeof (unsigned long int) * 8) -#define __FDELT(d) ((d) / __NFDBITS) -#define __FDMASK(d) (1 << ((d) % __NFDBITS)) - -typedef struct - { - /* XPG4.2 requires this member name. */ - unsigned long int fds_bits[(__FD_SETSIZE + (__NFDBITS - 1)) / __NFDBITS]; - } __fd_set; - -typedef unsigned long int __fd_mask; - -#endif /* gnu/types.h */ diff --git a/sysdeps/generic/ioctl-types.h b/sysdeps/generic/ioctl-types.h deleted file mode 100644 index 50fe19a..0000000 --- a/sysdeps/generic/ioctl-types.h +++ /dev/null @@ -1,117 +0,0 @@ -/* Structure types for pre-termios terminal ioctls. Generic Unix version. - Copyright (C) 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _IOCTL_TYPES_H -#define _IOCTL_TYPES_H 1 - - -#if defined(TIOCGETC) || defined(TIOCSETC) -/* Type of ARG for TIOCGETC and TIOCSETC requests. */ -struct tchars -{ - char t_intrc; /* Interrupt character. */ - char t_quitc; /* Quit character. */ - char t_startc; /* Start-output character. */ - char t_stopc; /* Stop-output character. */ - char t_eofc; /* End-of-file character. */ - char t_brkc; /* Input delimiter character. */ -}; - -#define _IOT_tchars /* Hurd ioctl type field. */ \ - _IOT (_IOTS (char), 6, 0, 0, 0, 0) -#endif - -#if defined(TIOCGLTC) || defined(TIOCSLTC) -/* Type of ARG for TIOCGLTC and TIOCSLTC requests. */ -struct ltchars -{ - char t_suspc; /* Suspend character. */ - char t_dsuspc; /* Delayed suspend character. */ - char t_rprntc; /* Reprint-line character. */ - char t_flushc; /* Flush-output character. */ - char t_werasc; /* Word-erase character. */ - char t_lnextc; /* Literal-next character. */ -}; - -#define _IOT_ltchars /* Hurd ioctl type field. */ \ - _IOT (_IOTS (char), 6, 0, 0, 0, 0) -#endif - -/* Type of ARG for TIOCGETP and TIOCSETP requests (and gtty and stty). */ -struct sgttyb -{ - char sg_ispeed; /* Input speed. */ - char sg_ospeed; /* Output speed. */ - char sg_erase; /* Erase character. */ - char sg_kill; /* Kill character. */ - short int sg_flags; /* Mode flags. */ -}; - -#define _IOT_sgttyb /* Hurd ioctl type field. */ \ - _IOT (_IOTS (char), 6, _IOTS (short int), 1, 0, 0) - -#if defined(TIOCGWINSZ) || defined(TIOCSWINSZ) -/* Type of ARG for TIOCGWINSZ and TIOCSWINSZ requests. */ -struct winsize -{ - unsigned short int ws_row; /* Rows, in characters. */ - unsigned short int ws_col; /* Columns, in characters. */ - - /* These are not actually used. */ - unsigned short int ws_xpixel; /* Horizontal pixels. */ - unsigned short int ws_ypixel; /* Vertical pixels. */ -}; - -#define _IOT_winsize /* Hurd ioctl type field. */ \ - _IOT (_IOTS (unsigned short int), 4, 0, 0, 0, 0) -#endif - -#if defined (TIOCGSIZE) || defined (TIOCSSIZE) -/* The BSD-style ioctl constructor macros use `sizeof', which can't be used - in a preprocessor conditional. Since the commands are always unique - regardless of the size bits, we can safely define away `sizeof' for the - purpose of the conditional. */ -# define sizeof(type) 0 -# if defined (TIOCGWINSZ) && TIOCGSIZE == TIOCGWINSZ -/* Many systems that have TIOCGWINSZ define TIOCGSIZE for source - compatibility with Sun; they define `struct ttysize' to have identical - layout as `struct winsize' and #define TIOCGSIZE to be TIOCGWINSZ - (likewise TIOCSSIZE and TIOCSWINSZ). */ -struct ttysize -{ - unsigned short int ts_lines; - unsigned short int ts_cols; - unsigned short int ts_xxx; - unsigned short int ts_yyy; -}; -#define _IOT_ttysize _IOT_winsize -# else -/* Suns use a different layout for `struct ttysize', and TIOCGSIZE and - TIOCGWINSZ are separate commands that do the same thing with different - structures (likewise TIOCSSIZE and TIOCSWINSZ). */ -struct ttysize -{ - int ts_lines, ts_cols; /* Lines and columns, in characters. */ -}; -# endif -# undef sizeof /* See above. */ -#endif - - -#endif /* ioctl-types.h */ diff --git a/sysdeps/generic/iovec.h b/sysdeps/generic/iovec.h deleted file mode 100644 index 307fc6a..0000000 --- a/sysdeps/generic/iovec.h +++ /dev/null @@ -1,9 +0,0 @@ -/* `struct iovec' -- Structure describing a section of memory. */ - -struct iovec -{ - /* Starting address. */ - __ptr_t iov_base; - /* Length in bytes. */ - size_t iov_len; -}; diff --git a/sysdeps/generic/mathbits.h b/sysdeps/generic/mathbits.h deleted file mode 100644 index b14b52d..0000000 --- a/sysdeps/generic/mathbits.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _MATHBITS_H -#define _MATHBITS_H 1 - -/* Normally, there is no long double type and the `float' and `double' - expressions are evaluated as `double'. */ -typedef double float_t; /* `float' expressions are evaluated as - `double'. */ -typedef double double_t; /* `double' expressions are evaluated as - `double'. */ - -/* Signal that both types are `double'. */ -#define FLT_EVAL_METHOD 1 - -/* Define `INFINITY' as value of type `float_t'. */ -#define INFINITY HUGE_VAL - - -/* The values returned by `ilogb' for 0 and NaN respectively. */ -#define FP_ILOGB0 0x80000001 -#define FP_ILOGBNAN 0x7fffffff - -#endif /* mathbits.h */ diff --git a/sysdeps/generic/netinet/ip.h b/sysdeps/generic/netinet/ip.h index a119c62..84615a5 100644 --- a/sysdeps/generic/netinet/ip.h +++ b/sysdeps/generic/netinet/ip.h @@ -36,7 +36,7 @@ #ifndef _NETINET_IP_H #define _NETINET_IP_H -#include +#include #include #include diff --git a/sysdeps/generic/resourcebits.h b/sysdeps/generic/resourcebits.h deleted file mode 100644 index 2c35c12..0000000 --- a/sysdeps/generic/resourcebits.h +++ /dev/null @@ -1,146 +0,0 @@ -/* Bit values & structures for resource limits. 4.4 BSD/generic GNU version. - Copyright (C) 1994, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* These are the values for 4.4 BSD and GNU. Earlier BSD systems have a - subset of these kinds of resource limit. In systems where `getrlimit' - and `setrlimit' are not system calls, these are the values used by the C - library to emulate them. */ - -/* Kinds of resource limit. */ -enum __rlimit_resource - { - /* Per-process CPU limit, in seconds. */ - RLIMIT_CPU, -#define RLIMIT_CPU RLIMIT_CPU - /* Largest file that can be created, in bytes. */ - RLIMIT_FSIZE, -#define RLIMIT_FSIZE RLIMIT_FSIZE - /* Maximum size of data segment, in bytes. */ - RLIMIT_DATA, -#define RLIMIT_DATA RLIMIT_DATA - /* Maximum size of stack segment, in bytes. */ - RLIMIT_STACK, -#define RLIMIT_STACK RLIMIT_STACK - /* Largest core file that can be created, in bytes. */ - RLIMIT_CORE, -#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, -#define RLIMIT_RSS RLIMIT_RSS - /* Locked-in-memory address space. */ - RLIMIT_MEMLOCK, -#define RLIMIT_MEMLOCK RLIMIT_MEMLOCK - /* Number of processes. */ - RLIMIT_NPROC, -#define RLIMIT_NPROC RLIMIT_NPROC - /* Number of open files. */ - RLIMIT_OFILE, - RLIMIT_NOFILE = RLIMIT_OFILE, /* Another name for the same thing. */ -#define RLIMIT_OFILE RLIMIT_OFILE -#define RLIMIT_NOFILE RLIMIT_NOFILE - - RLIMIT_NLIMITS, /* Number of limit flavors. */ - RLIM_NLIMITS = RLIMIT_NLIMITS, /* Traditional name for same. */ - - RLIM_INFINITY = 0x7fffffff /* Value to indicate that there is no limit. */ -#define RLIM_INFINITY RLIM_INFINITY - }; - -struct rlimit - { - /* The current (soft) limit. */ - int rlim_cur; - /* The hard limit. */ - int rlim_max; - }; - -/* Whose usage statistics do you want? */ -enum __rusage_who -/* The macro 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. */ - { - /* 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 - }; - -#include /* For `struct timeval'. */ - -/* Structure which says how much of each resource has been used. */ -struct rusage - { - /* Total amount of user time used. */ - struct timeval ru_utime; - /* Total amount of system time used. */ - struct timeval ru_stime; - /* Maximum resident set size (in kilobytes). */ - long int ru_maxrss; - /* Amount of sharing of text segment memory - with other processes (kilobyte-seconds). */ - long int ru_ixrss; - /* Amount of data segment memory used (kilobyte-seconds). */ - long int ru_idrss; - /* Amount of stack memory used (kilobyte-seconds). */ - long int ru_isrss; - /* Number of soft page faults (i.e. those serviced by reclaiming - a page from the list of pages awaiting reallocation. */ - long int ru_minflt; - /* Number of hard page faults (i.e. those that required I/O). */ - long int ru_majflt; - /* Number of times a process was swapped out of physical memory. */ - long int ru_nswap; - /* Number of input operations via the file system. Note: This - and `ru_oublock' do not include operations with the cache. */ - long int ru_inblock; - /* Number of output operations via the file system. */ - long int ru_oublock; - /* Number of IPC messages sent. */ - long int ru_msgsnd; - /* Number of IPC messages received. */ - long int ru_msgrcv; - /* Number of signals delivered. */ - long int ru_nsignals; - /* Number of voluntary context switches, i.e. because the process - gave up the process before it had to (usually to wait for some - resource to be available). */ - long int ru_nvcsw; - /* Number of involuntary context switches, i.e. a higher priority process - became runnable or the current process used up its time slice. */ - long int ru_nivcsw; - }; - -/* 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. */ - PRIO_PGRP = 1, /* WHO is a process group ID. */ - PRIO_USER = 2 /* WHO is a user ID. */ - }; diff --git a/sysdeps/generic/schedbits.h b/sysdeps/generic/schedbits.h deleted file mode 100644 index e2cb00e..0000000 --- a/sysdeps/generic/schedbits.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Definitions of constants and data structure for POSIX 1003.1b-1993 - scheduling interface. -Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#ifndef _SCHEDBITS_H -#define _SCHEDBITS_H 1 - -/* Scheduling algorithms. */ -#define SCHED_OTHER 0 -#define SCHED_FIFO 1 -#define SCHED_RR 2 - -/* Data structure to describe a process' schedulability. */ -struct sched_param -{ - int sched_priority; -}; - -#endif /* schedbits.h */ diff --git a/sysdeps/generic/selectbits.h b/sysdeps/generic/selectbits.h deleted file mode 100644 index e2bdf60..0000000 --- a/sysdeps/generic/selectbits.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SELECTBITS_H -#define _SELECTBITS_H 1 - -/* This line MUST be split! Otherwise m4 will not change it. */ -#define __FD_ZERO(set) \ - ((void) memset ((__ptr_t) (set), 0, sizeof (fd_set))) -#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) -#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) -#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) - -#endif /* selectbits.h */ diff --git a/sysdeps/generic/setenv.c b/sysdeps/generic/setenv.c index 11b5906..e740fa9 100644 --- a/sysdeps/generic/setenv.c +++ b/sysdeps/generic/setenv.c @@ -47,7 +47,7 @@ extern char **environ; #if _LIBC /* This lock protects against simultaneous modifications of `environ'. */ -# include +# include __libc_lock_define_initialized (static, envlock) # define LOCK __libc_lock_lock (envlock) # define UNLOCK __libc_lock_unlock (envlock) diff --git a/sysdeps/generic/sigaction.h b/sysdeps/generic/sigaction.h deleted file mode 100644 index 1676b1c..0000000 --- a/sysdeps/generic/sigaction.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* These definitions match those used by the 4.4 BSD kernel. - If the operating system has a `sigaction' system call that correctly - implements the POSIX.1 behavior, there should be a system-dependent - version of this file that defines `struct sigaction' and the `SA_*' - constants appropriately. */ - -/* Structure describing the action to be taken when a signal arrives. */ -struct sigaction - { - /* Signal handler. */ - __sighandler_t sa_handler; - - /* Additional set of signals to be blocked. */ - __sigset_t sa_mask; - - /* Special flags. */ - int sa_flags; - }; - -/* Bits in `sa_flags'. */ -#ifdef __USE_BSD -#define SA_ONSTACK 0x1 /* Take signal on signal stack. */ -#define SA_RESTART 0x2 /* Don't restart syscall on signal return. */ -#define SA_DISABLE 0x4 /* Disable alternate signal stack. */ -#endif -#define SA_NOCLDSTOP 0x8 /* Don't send SIGCHLD when children stop. */ - - -/* Values for the HOW argument to `sigprocmask'. */ -#define SIG_BLOCK 1 /* Block signals. */ -#define SIG_UNBLOCK 2 /* Unblock signals. */ -#define SIG_SETMASK 3 /* Set the set of blocked signals. */ diff --git a/sysdeps/generic/sigset.h b/sysdeps/generic/sigset.h deleted file mode 100644 index 9fad453..0000000 --- a/sysdeps/generic/sigset.h +++ /dev/null @@ -1,81 +0,0 @@ -/* __sig_atomic_t, __sigset_t, and related definitions. Generic/BSD version. - Copyright (C) 1991, 1992, 1994, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SIGSET_H_types -#define _SIGSET_H_types 1 - -typedef int __sig_atomic_t; - -/* A `sigset_t' has a bit for each signal. */ -typedef unsigned long int __sigset_t; - -#endif - - -/* We only want to define these functions if was actually - included; otherwise we were included just to define the types. Since we - are namespace-clean, it wouldn't hurt to define extra macros. But - trouble can be caused by functions being defined (e.g., any global - register vars declared later will cause compilation errors). */ - -#if !defined (_SIGSET_H_fns) && defined (_SIGNAL_H) -#define _SIGSET_H_fns 1 - -#ifndef _EXTERN_INLINE -#define _EXTERN_INLINE extern __inline -#endif - -/* Return a mask that includes SIG only. The cast to `sigset_t' avoids - overflow if `sigset_t' is wider than `int'. */ -#define __sigmask(sig) (((__sigset_t) 1) << ((sig) - 1)) - -#define __sigemptyset(set) ((*(set) = (__sigset_t) 0), 0) -#define __sigfillset(set) ((*(set) = ~(__sigset_t) 0), 0) - -#ifdef _GNU_SOURCE -# define __sigisemptyset(set) (*(set) == (__sigset_t) 0) -# define __sigandset(dest, left, right) \ - ((*(dest) = (*(left) & *(right))), 0) -# define __sigorset(dest, left, right) \ - ((*(dest) = (*(left) | *(right))), 0) -#endif - -/* These functions needn't check for a bogus signal number -- error - checking is done in the non __ versions. */ - -extern int __sigismember (__const __sigset_t *, int); -extern int __sigaddset (__sigset_t *, int); -extern int __sigdelset (__sigset_t *, int); - -#define __SIGSETFN(NAME, BODY, CONST) \ - _EXTERN_INLINE int \ - NAME (CONST __sigset_t *__set, int __sig) \ - { \ - __sigset_t __mask = __sigmask (__sig); \ - return BODY; \ - } - -__SIGSETFN (__sigismember, (*__set & __mask) ? 1 : 0, __const) -__SIGSETFN (__sigaddset, ((*__set |= __mask), 0), ) -__SIGSETFN (__sigdelset, ((*__set &= ~__mask), 0), ) - -#undef __SIGSETFN - - -#endif /* ! _SIGSET_H_fns. */ diff --git a/sysdeps/generic/sockaddrcom.h b/sysdeps/generic/sockaddrcom.h deleted file mode 100644 index 8b1de11..0000000 --- a/sysdeps/generic/sockaddrcom.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Definition of `struct sockaddr_*' common members. Generic/4.2 BSD version. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SOCKADDRCOM_H -#define _SOCKADDRCOM_H 1 - - -/* POSIX.1g specifies this type name for the `sa_family' member. */ -typedef unsigned short int sa_family_t; - -/* This macro is used to declare the initial common members - of the data types used for socket addresses, `struct sockaddr', - `struct sockaddr_in', `struct sockaddr_un', etc. */ - -#define __SOCKADDR_COMMON(sa_prefix) \ - sa_family_t sa_prefix##family - -#define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int)) - - -#endif /* sockaddrcom.h */ diff --git a/sysdeps/generic/socketbits.h b/sysdeps/generic/socketbits.h deleted file mode 100644 index 5d85a8e..0000000 --- a/sysdeps/generic/socketbits.h +++ /dev/null @@ -1,200 +0,0 @@ -/* System-specific socket constants and types. Generic/4.3 BSD version. - Copyright (C) 1991, 92, 94, 95, 96, 97 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SOCKETBITS_H - -#define _SOCKETBITS_H 1 -#include - -__BEGIN_DECLS - -#define __need_size_t -#include - - -/* Types of sockets. */ -enum __socket_type -{ - SOCK_STREAM = 1, /* Sequenced, reliable, connection-based - byte streams. */ -#define SOCK_STREAM SOCK_STREAM - SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams - of fixed maximum length. */ -#define SOCK_DGRAM SOCK_DGRAM - SOCK_RAW = 3, /* Raw protocol interface. */ -#define SOCK_RAW SOCK_RAW - SOCK_RDM = 4, /* Reliably-delivered messages. */ -#define SOCK_RDM SOCK_RDM - SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based, - datagrams of fixed maximum length. */ -#define SOCK_SEQPACKET SOCK_SEQPACKET -}; - -/* Protocol families. */ -#define PF_UNSPEC 0 /* Unspecified. */ -#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */ -#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */ -#define PF_FILE PF_LOCAL /* POSIX name for PF_LOCAL. */ -#define PF_INET 2 /* IP protocol family. */ -#define PF_IMPLINK 3 /* ARPAnet IMP protocol. */ -#define PF_PUP 4 /* PUP protocols. */ -#define PF_CHAOS 5 /* MIT Chaos protocols. */ -#define PF_NS 6 /* Xerox NS protocols. */ -#define PF_ISO 7 /* ISO protocols. */ -#define PF_OSI PF_ISO -#define PF_ECMA 8 /* ECMA protocols. */ -#define PF_DATAKIT 9 /* AT&T Datakit protocols. */ -#define PF_CCITT 10 /* CCITT protocols (X.25 et al). */ -#define PF_SNA 11 /* IBM SNA protocol. */ -#define PF_DECnet 12 /* DECnet protocols. */ -#define PF_DLI 13 /* Direct data link interface. */ -#define PF_LAT 14 /* DEC Local Area Transport protocol. */ -#define PF_HYLINK 15 /* NSC Hyperchannel protocol. */ -#define PF_APPLETALK 16 /* Don't use this. */ -#define PF_ROUTE 17 /* Internal Routing Protocol. */ -#define PF_LINK 18 /* Link layer interface. */ -#define PF_XTP 19 /* eXpress Transfer Protocol (no AF). */ -#define PF_COIP 20 /* Connection-oriented IP, aka ST II. */ -#define PF_CNT 21 /* Computer Network Technology. */ -#define PF_RTIP 22 /* Help Identify RTIP packets. **/ -#define PF_IPX 23 /* Novell Internet Protocol. */ -#define PF_SIP 24 /* Simple Internet Protocol. */ -#define PF_PIP 25 /* Help Identify PIP packets. */ -#define PF_INET6 26 /* IP version 6. */ -#define PF_MAX 27 - -/* Address families. */ -#define AF_UNSPEC PF_UNSPEC -#define AF_LOCAL PF_LOCAL -#define AF_UNIX PF_UNIX -#define AF_FILE PF_FILE -#define AF_INET PF_INET -#define AF_IMPLINK PF_IMPLINK -#define AF_PUP PF_PUP -#define AF_CHAOS PF_CHAOS -#define AF_NS PF_NS -#define AF_ISO PF_ISO -#define AF_OSI PF_OSI -#define AF_ECMA PF_ECMA -#define AF_DATAKIT PF_DATAKIT -#define AF_CCITT PF_CCITT -#define AF_SNA PF_SNA -#define AF_DECnet PF_DECnet -#define AF_DLI PF_DLI -#define AF_LAT PF_LAT -#define AF_HYLINK PF_HYLINK -#define AF_APPLETALK PF_APPLETALK -#define AF_ROUTE PF_ROUTE -#define AF_LINK PF_LINK -#define pseudo_AF_XTP PF_XTP -#define AF_COIP PF_COIP -#define AF_CNT PF_CNT -#define pseudo_AF_RTIP PF_RTIP -#define AF_IPX PF_IPX -#define AF_SIP PF_SIP -#define pseudo_AF_PIP PF_PIP -#define AF_INET6 PF_INET6 -#define AF_MAX PF_MAX - - -/* Get the definition of the macro to define the common sockaddr members. */ -#include - -/* Structure describing a generic socket address. */ -struct sockaddr - { - __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */ - char sa_data[14]; /* Address data. */ - }; - - -/* Bits in the FLAGS argument to `send', `recv', et al. */ -enum - { - MSG_OOB = 0x01, /* Process out-of-band data. */ - MSG_PEEK = 0x02, /* Peek at incoming messages. */ - MSG_DONTROUTE = 0x04, /* Don't use local routing. */ - MSG_EOR = 0x08, /* Data completes record. */ - MSG_TRUNC = 0x10, /* Data discarded before delivery. */ - MSG_CTRUNC = 0x20, /* Control data lost before delivery. */ - MSG_WAITALL = 0x40, /* Wait for full request or error. */ - MSG_DONTWAIT = 0x80, /* This message should be nonblocking. */ - }; - - -/* Structure describing messages sent by - `sendmsg' and received by `recvmsg'. */ -struct msghdr - { - __ptr_t msg_name; /* Address to send to/receive from. */ - size_t msg_namelen; /* Length of address data. */ - - struct iovec *msg_iov; /* Vector of data to send/receive into. */ - size_t msg_iovlen; /* Number of elements in the vector. */ - - __ptr_t msg_accrights; /* Access rights information. */ - size_t msg_accrightslen; /* Length of access rights information. */ - }; - - -/* Protocol number used to manipulate socket-level options - with `getsockopt' and `setsockopt'. */ -#define SOL_SOCKET 0xffff - -/* Socket-level options for `getsockopt' and `setsockopt'. */ -enum - { - SO_DEBUG = 0x0001, /* Record debugging information. */ - SO_ACCEPTCONN = 0x0002, /* Accept connections on socket. */ - SO_REUSEADDR = 0x0004, /* Allow reuse of local addresses. */ - SO_KEEPALIVE = 0x0008, /* Keep connections alive and send - SIGPIPE when they die. */ - SO_DONTROUTE = 0x0010, /* Don't do local routing. */ - SO_BROADCAST = 0x0020, /* Allow transmission of - broadcast messages. */ - SO_USELOOPBACK = 0x0040, /* Use the software loopback to avoid - hardware use when possible. */ - SO_LINGER = 0x0080, /* Block on close of a reliable - socket to transmit pending data. */ - SO_OOBINLINE = 0x0100, /* Receive out-of-band data in-band. */ - - SO_REUSEPORT = 0x0200, /* Allow local address and port reuse. */ - - SO_SNDBUF = 0x1001, /* Send buffer size. */ - SO_RCVBUF = 0x1002, /* Receive buffer. */ - SO_SNDLOWAT = 0x1003, /* Send low-water mark. */ - SO_RCVLOWAT = 0x1004, /* Receive low-water mark. */ - SO_SNDTIMEO = 0x1005, /* Send timeout. */ - SO_RCVTIMEO = 0x1006, /* Receive timeout. */ - - SO_ERROR = 0x1007, /* Get and clear error status. */ - SO_STYLE = 0x1008, /* Get socket connection style. */ - SO_TYPE = SO_STYLE, /* Compatible name for SO_STYLE. */ - }; - -/* Structure used to manipulate the SO_LINGER option. */ -struct linger - { - int l_onoff; /* Nonzero to linger on close. */ - int l_linger; /* Time to linger. */ - }; - -__END_DECLS - -#endif /* socketbits.h */ diff --git a/sysdeps/generic/statfsbuf.h b/sysdeps/generic/statfsbuf.h deleted file mode 100644 index e5c2dd7..0000000 --- a/sysdeps/generic/statfsbuf.h +++ /dev/null @@ -1,49 +0,0 @@ -/* Definition of `struct statfs', information about a filesystem. -Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#ifndef _STATFSBUF_H - -#define _STATFSBUF_H 1 - -#include - -/* GNU Hurd NOTE: The size of this structure (16 ints) is known in - , since it is used in the `file_statfs' RPC. MiG - does not cope at all well with the passed C structure not being of the - expected size. There are some filler words at the end to allow for - future expansion. To increase the size of the structure used in the RPC - and retain binary compatibility, we would need to assign a new message - number. */ - -struct statfs - { - unsigned int f_type; - unsigned int f_bsize; - unsigned int f_blocks; - unsigned int f_bfree; - unsigned int f_bavail; - unsigned int f_files; - unsigned int f_ffree; - __fsid_t f_fsid; - unsigned int f_namelen; - unsigned int f_spare[6]; - }; - - -#endif /* statfsbuf.h */ diff --git a/sysdeps/generic/sys/mman.h b/sysdeps/generic/sys/mman.h index 32b152e..9c2a1b6 100644 --- a/sysdeps/generic/sys/mman.h +++ b/sysdeps/generic/sys/mman.h @@ -26,7 +26,7 @@ #define _SYS_MMAN_H 1 #include -#include +#include #define __need_size_t #include diff --git a/sysdeps/generic/termbits.h b/sysdeps/generic/termbits.h deleted file mode 100644 index adf0ee2..0000000 --- a/sysdeps/generic/termbits.h +++ /dev/null @@ -1,229 +0,0 @@ -/* termios type and macro definitions. 4.4 BSD/generic GNU version. - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* These macros are also defined in some ioctls.h files (with numerically - identical values), but this serves to shut up cpp's complaining. */ -#ifdef __USE_BSD - -#ifdef MDMBUF -#undef MDMBUF -#endif -#ifdef FLUSHO -#undef FLUSHO -#endif -#ifdef PENDIN -#undef PENDIN -#endif - -#endif /* __USE_BSD */ - -#ifdef ECHO -#undef ECHO -#endif -#ifdef TOSTOP -#undef TOSTOP -#endif -#ifdef NOFLSH -#undef NOFLSH -#endif - - -/* These definitions match those used by the 4.4 BSD kernel. - If the operating system has termios system calls or ioctls that - correctly implement the POSIX.1 behavior, there should be a - system-dependent version of this file that defines `struct termios', - `tcflag_t', `cc_t', `speed_t' and the `TC*' constants appropriately. */ - -/* Type of terminal control flag masks. */ -typedef unsigned long int tcflag_t; - -/* Type of control characters. */ -typedef unsigned char cc_t; - -/* Type of baud rate specifiers. */ -typedef long int speed_t; - -/* Terminal control structure. */ -struct termios -{ - /* Input modes. */ - tcflag_t c_iflag; -#define IGNBRK (1 << 0) /* Ignore break condition. */ -#define BRKINT (1 << 1) /* Signal interrupt on break. */ -#define IGNPAR (1 << 2) /* Ignore characters with parity errors. */ -#define PARMRK (1 << 3) /* Mark parity and framing errors. */ -#define INPCK (1 << 4) /* Enable input parity check. */ -#define ISTRIP (1 << 5) /* Strip 8th bit off characters. */ -#define INLCR (1 << 6) /* Map NL to CR on input. */ -#define IGNCR (1 << 7) /* Ignore CR. */ -#define ICRNL (1 << 8) /* Map CR to NL on input. */ -#define IXON (1 << 9) /* Enable start/stop output control. */ -#define IXOFF (1 << 10) /* Enable start/stop input control. */ -#ifdef __USE_BSD -#define IXANY (1 << 11) /* Any character will restart after stop. */ -#define IMAXBEL (1 << 13) /* Ring bell when input queue is full. */ -#endif - - /* Output modes. */ - tcflag_t c_oflag; -#define OPOST (1 << 0) /* Perform output processing. */ -#ifdef __USE_BSD -#define ONLCR (1 << 1) /* Map NL to CR-NL on output. */ -#define OXTABS (1 << 2) /* Expand tabs to spaces. */ -#define ONOEOT (1 << 8) /* Discard EOT (^D) on output. */ -#endif - - /* Control modes. */ - tcflag_t c_cflag; -#ifdef __USE_BSD -#define CIGNORE (1 << 0) /* Ignore these control flags. */ -#endif -#define CSIZE (CS5|CS6|CS7|CS8) /* Number of bits per byte (mask). */ -#define CS5 0 /* 5 bits per byte. */ -#define CS6 (1 << 8) /* 6 bits per byte. */ -#define CS7 (1 << 9) /* 7 bits per byte. */ -#define CS8 (CS6|CS7) /* 8 bits per byte. */ -#define CSTOPB (1 << 10) /* Two stop bits instead of one. */ -#define CREAD (1 << 11) /* Enable receiver. */ -#define PARENB (1 << 12) /* Parity enable. */ -#define PARODD (1 << 13) /* Odd parity instead of even. */ -#define HUPCL (1 << 14) /* Hang up on last close. */ -#define CLOCAL (1 << 15) /* Ignore modem status lines. */ -#ifdef __USE_BSD -#define CCTS_OFLOW (1 << 16) /* CTS flow control of output. */ -#define CRTS_IFLOW (1 << 17) /* RTS flow control of input. */ -#define MDMBUF (1 << 20) /* Carrier flow control of output. */ -#endif - - /* Local modes. */ - tcflag_t c_lflag; -#ifdef __USE_BSD -#define ECHOKE (1 << 0) /* Visual erase for KILL. */ -#endif -#define _ECHOE (1 << 1) /* Visual erase for ERASE. */ -#define ECHOE _ECHOE -#define _ECHOK (1 << 2) /* Echo NL after KILL. */ -#define ECHOK _ECHOK -#define _ECHO (1 << 3) /* Enable echo. */ -#define ECHO _ECHO -#define _ECHONL (1 << 4) /* Echo NL even if ECHO is off. */ -#define ECHONL _ECHONL -#ifdef __USE_BSD -#define ECHOPRT (1 << 5) /* Hardcopy visual erase. */ -#define ECHOCTL (1 << 6) /* Echo control characters as ^X. */ -#endif -#define _ISIG (1 << 7) /* Enable signals. */ -#define ISIG _ISIG -#define _ICANON (1 << 8) /* Do erase and kill processing. */ -#define ICANON _ICANON -#ifdef __USE_BSD -#define ALTWERASE (1 << 9) /* Alternate WERASE algorithm. */ -#endif -#define _IEXTEN (1 << 10) /* Enable DISCARD and LNEXT. */ -#define IEXTEN _IEXTEN -#define EXTPROC (1 << 11) /* External processing. */ -#define _TOSTOP (1 << 22) /* Send SIGTTOU for background output. */ -#define TOSTOP _TOSTOP -#ifdef __USE_BSD -#define FLUSHO (1 << 23) /* Output being flushed (state). */ -#define NOKERNINFO (1 << 25) /* Disable VSTATUS. */ -#define PENDIN (1 << 29) /* Retype pending input (state). */ -#endif -#define _NOFLSH (1 << 31) /* Disable flush after interrupt. */ -#define NOFLSH _NOFLSH - - /* Control characters. */ -#define VEOF 0 /* End-of-file character [ICANON]. */ -#define VEOL 1 /* End-of-line character [ICANON]. */ -#ifdef __USE_BSD -#define VEOL2 2 /* Second EOL character [ICANON]. */ -#endif -#define VERASE 3 /* Erase character [ICANON]. */ -#ifdef __USE_BSD -#define VWERASE 4 /* Word-erase character [ICANON]. */ -#endif -#define VKILL 5 /* Kill-line character [ICANON]. */ -#ifdef __USE_BSD -#define VREPRINT 6 /* Reprint-line character [ICANON]. */ -#endif -#define VINTR 8 /* Interrupt character [ISIG]. */ -#define VQUIT 9 /* Quit character [ISIG]. */ -#define VSUSP 10 /* Suspend character [ISIG]. */ -#ifdef __USE_BSD -#define VDSUSP 11 /* Delayed suspend character [ISIG]. */ -#endif -#define VSTART 12 /* Start (X-ON) character [IXON, IXOFF]. */ -#define VSTOP 13 /* Stop (X-OFF) character [IXON, IXOFF]. */ -#ifdef __USE_BSD -#define VLNEXT 14 /* Literal-next character [IEXTEN]. */ -#define VDISCARD 15 /* Discard character [IEXTEN]. */ -#endif -#define VMIN 16 /* Minimum number of bytes read at once [!ICANON]. */ -#define VTIME 17 /* Time-out value (tenths of a second) [!ICANON]. */ -#ifdef __USE_BSD -#define VSTATUS 18 /* Status character [ICANON]. */ -#endif -#define NCCS 20 /* Value duplicated in . */ - cc_t c_cc[NCCS]; - - /* Input and output baud rates. */ - speed_t __ispeed, __ospeed; -#define B0 0 /* Hang up. */ -#define B50 50 /* 50 baud. */ -#define B75 75 /* 75 baud. */ -#define B110 110 /* 110 baud. */ -#define B134 134 /* 134.5 baud. */ -#define B150 150 /* 150 baud. */ -#define B200 200 /* 200 baud. */ -#define B300 300 /* 300 baud. */ -#define B600 600 /* 600 baud. */ -#define B1200 1200 /* 1200 baud. */ -#define B1800 1800 /* 1800 baud. */ -#define B2400 2400 /* 2400 baud. */ -#define B4800 4800 /* 4800 baud. */ -#define B9600 9600 /* 9600 baud. */ -#define B19200 19200 /* 19200 baud. */ -#define B38400 38400 /* 38400 baud. */ -#ifdef __USE_BSD -#define EXTA 19200 -#define EXTB 38400 -#endif -}; - -#define _IOT_termios /* Hurd ioctl type field. */ \ - _IOT (_IOTS (tcflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) - -/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ -#define TCSANOW 0 /* Change immediately. */ -#define TCSADRAIN 1 /* Change when pending output is written. */ -#define TCSAFLUSH 2 /* Flush pending input before changing. */ -#ifdef __USE_BSD -#define TCSASOFT 0x10 /* Flag: Don't alter hardware state. */ -#endif - -/* Values for the QUEUE_SELECTOR argument to `tcflush'. */ -#define TCIFLUSH 1 /* Discard data received but not yet read. */ -#define TCOFLUSH 2 /* Discard data written but not yet sent. */ -#define TCIOFLUSH 3 /* Discard all pending data. */ - -/* Values for the ACTION argument to `tcflow'. */ -#define TCOOFF 1 /* Suspend output. */ -#define TCOON 2 /* Restart suspended output. */ -#define TCIOFF 3 /* Send a STOP character. */ -#define TCION 4 /* Send a START character. */ diff --git a/sysdeps/generic/ustatbits.h b/sysdeps/generic/ustatbits.h deleted file mode 100644 index aa5d493..0000000 --- a/sysdeps/generic/ustatbits.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Generic declaration of ustat structure. -Copyright (C) 1994, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -__BEGIN_DECLS - -struct ustat -{ - __daddr_t f_tfree; /* total free */ - __ino_t f_tinode; /* total inodes free */ - char f_fname[6]; /* filesystem name */ - char f_fpack[6]; /* filesystem pack name */ -}; - -__END_DECLS diff --git a/sysdeps/generic/utmpbits.h b/sysdeps/generic/utmpbits.h deleted file mode 100644 index cbd3457..0000000 --- a/sysdeps/generic/utmpbits.h +++ /dev/null @@ -1,53 +0,0 @@ -/* The `struct utmp' type, describing entries in the utmp file. Generic/BSDish - Copyright (C) 1993, 1996 Free Software Foundation, Inc. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _UTMPBITS_H - -#define _UTMPBITS_H 1 -#include - -#include -#include - - -#define UT_NAMESIZE 8 -#define UT_LINESIZE 8 -#define UT_HOSTSIZE 16 - -__BEGIN_DECLS - -struct lastlog { - time_t ll_time; - char ll_line[UT_LINESIZE]; - char ll_host[UT_HOSTSIZE]; -}; - -struct utmp { - char ut_line[UT_LINESIZE]; - char ut_name[UT_NAMESIZE]; - char ut_host[UT_HOSTSIZE]; - long ut_time; -}; - - -#define _HAVE_UT_HOST 1 /* We have the ut_host field. */ - - -__END_DECLS - -#endif /* utmpbits.h */ diff --git a/sysdeps/generic/utsnamelen.h b/sysdeps/generic/utsnamelen.h deleted file mode 100644 index 5594bcc..0000000 --- a/sysdeps/generic/utsnamelen.h +++ /dev/null @@ -1,3 +0,0 @@ -/* The size of the character arrays used to hold the information - in a `struct utsname'. Enlarge this as necessary. */ -#define _UTSNAME_LENGTH 1024 diff --git a/sysdeps/generic/waitstatus.h b/sysdeps/generic/waitstatus.h deleted file mode 100644 index 4fbcbe8..0000000 --- a/sysdeps/generic/waitstatus.h +++ /dev/null @@ -1,104 +0,0 @@ -/* Definitions of status bits for `wait' et al. - Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* Everything extant so far uses these same bits. */ - -#ifndef _WAITSTATUS_H -#define _WAITSTATUS_H - -/* If WIFEXITED(STATUS), the low-order 8 bits of the status. */ -#define __WEXITSTATUS(status) (((status) & 0xff00) >> 8) - -/* If WIFSIGNALED(STATUS), the terminating signal. */ -#define __WTERMSIG(status) ((status) & 0x7f) - -/* If WIFSTOPPED(STATUS), the signal that stopped the child. */ -#define __WSTOPSIG(status) __WEXITSTATUS(status) - -/* Nonzero if STATUS indicates normal termination. */ -#define __WIFEXITED(status) (__WTERMSIG(status) == 0) - -/* Nonzero if STATUS indicates termination by a signal. */ -#ifdef __GNUC__ -#define __WIFSIGNALED(status) \ - (__extension__ ({ int __status = (status); \ - !__WIFSTOPPED(__status) && !__WIFEXITED(__status); })) -#else /* Not GCC. */ -#define __WIFSIGNALED(status) (!__WIFSTOPPED(status) && !__WIFEXITED(status)) -#endif /* GCC. */ - -/* Nonzero if STATUS indicates the child is stopped. */ -#define __WIFSTOPPED(status) (((status) & 0xff) == 0x7f) - -/* Nonzero if STATUS indicates the child dumped core. */ -#define __WCOREDUMP(status) ((status) & __WCOREFLAG) - -/* Macros for constructing status values. */ -#define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) -#define __W_STOPCODE(sig) ((sig) << 8 | 0x7f) -#define __WCOREFLAG 0x80 - - -#ifdef __USE_BSD - -#include - -union wait - { - int w_status; - struct - { -#if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned int __w_termsig:7; /* Terminating signal. */ - unsigned int __w_coredump:1; /* Set if dumped core. */ - unsigned int __w_retcode:8; /* Return code if exited normally. */ - unsigned int:16; -#endif /* Little endian. */ -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int:16; - unsigned int __w_retcode:8; - unsigned int __w_coredump:1; - unsigned int __w_termsig:7; -#endif /* Big endian. */ - } __wait_terminated; - struct - { -#if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned int __w_stopval:8; /* W_STOPPED if stopped. */ - unsigned int __w_stopsig:8; /* Stopping signal. */ - unsigned int:16; -#endif /* Little endian. */ -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned int:16; - unsigned int __w_stopsig:8; /* Stopping signal. */ - unsigned int __w_stopval:8; /* W_STOPPED if stopped. */ -#endif /* Big endian. */ - } __wait_stopped; - }; - -#define w_termsig __wait_terminated.__w_termsig -#define w_coredump __wait_terminated.__w_coredump -#define w_retcode __wait_terminated.__w_retcode -#define w_stopsig __wait_stopped.__w_stopsig -#define w_stopval __wait_stopped.__w_stopval - -#endif /* Use BSD. */ - - -#endif /* waitstatus.h */ diff --git a/sysdeps/gnu/bits/utmp.h b/sysdeps/gnu/bits/utmp.h new file mode 100644 index 0000000..db49ac8 --- /dev/null +++ b/sysdeps/gnu/bits/utmp.h @@ -0,0 +1,121 @@ +/* The `struct utmp' type, describing entries in the utmp file. GNU version. + Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _UTMPBITS_H + +#define _UTMPBITS_H 1 +#include + +#include +#include +#include + + +#define UT_UNKNOWN 0 /* for ut_type field */ + +#define RUN_LVL 1 +#define BOOT_TIME 2 +#define NEW_TIME 3 +#define OLD_TIME 4 + +#define INIT_PROCESS 5 +#define LOGIN_PROCESS 6 +#define USER_PROCESS 7 +#define DEAD_PROCESS 8 +#define ACCOUNTING 9 + +#define UT_LINESIZE 32 +#define UT_NAMESIZE 32 +#define UT_HOSTSIZE 256 + +__BEGIN_DECLS + +struct lastlog +{ + time_t ll_time; + char ll_line[UT_LINESIZE]; + char ll_host[UT_HOSTSIZE]; +}; + + +/* XXX We are not ready to use this now. It needs some more research. + Simly copying the behaviour of other implementations is no big + help. */ +#if 0 +/* Which program created the record. */ +enum utlogin +{ + unknown, + X, + local, + rlogin, + telnet, + rsh, + ftp, + screen, + splitvt, + xterm + /* More could be added here. */ +}; +#endif + + +struct exit_status +{ + short int e_termination; /* Process termination status. */ + short int e_exit; /* Process exit status. */ +}; + + +struct utmp +{ + short int ut_type; /* Type of login. */ + pid_t ut_pid; /* Pid of login process. */ + char ut_line[UT_LINESIZE]; /* NUL-terminated devicename of tty. */ + char ut_id[4]; /* Inittab id. */ + char ut_user[UT_NAMESIZE]; /* Username (not NUL terminated). */ +#define ut_name ut_user /* Compatible field name for same. */ + char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */ + struct exit_status ut_exit; /* The exit status of a process marked + as DEAD_PROCESS. */ + long ut_session; /* Session ID, used for windowing. */ + struct timeval ut_tv; /* Time entry was made. */ + int32_t ut_addr_v6[4]; /* Internet address of remote host. */ + char pad[20]; /* Reserved for future use. */ +}; + +/* Backwards compatibility hacks. */ +#ifndef _NO_UT_TIME +/* We have a problem here: `ut_time' is also used otherwise. Define + _NO_UT_TIME if the compiler complains. */ +# define ut_time ut_tv.tv_sec +#endif +#define ut_xtime ut_tv.tv_sec +#define ut_addr ut_addr_v6[0] + +/* Tell the user that we have a modern system with UT_HOST, UT_PID, + UT_TYPE, UT_ID and UT_TV fields. */ +#define _HAVE_UT_TYPE 1 +#define _HAVE_UT_PID 1 +#define _HAVE_UT_ID 1 +#define _HAVE_UT_TV 1 +#define _HAVE_UT_HOST 1 + +__END_DECLS + +#endif /* !_UTMP_H_ */ diff --git a/sysdeps/gnu/utmpbits.h b/sysdeps/gnu/utmpbits.h deleted file mode 100644 index db49ac8..0000000 --- a/sysdeps/gnu/utmpbits.h +++ /dev/null @@ -1,121 +0,0 @@ -/* The `struct utmp' type, describing entries in the utmp file. GNU version. - Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _UTMPBITS_H - -#define _UTMPBITS_H 1 -#include - -#include -#include -#include - - -#define UT_UNKNOWN 0 /* for ut_type field */ - -#define RUN_LVL 1 -#define BOOT_TIME 2 -#define NEW_TIME 3 -#define OLD_TIME 4 - -#define INIT_PROCESS 5 -#define LOGIN_PROCESS 6 -#define USER_PROCESS 7 -#define DEAD_PROCESS 8 -#define ACCOUNTING 9 - -#define UT_LINESIZE 32 -#define UT_NAMESIZE 32 -#define UT_HOSTSIZE 256 - -__BEGIN_DECLS - -struct lastlog -{ - time_t ll_time; - char ll_line[UT_LINESIZE]; - char ll_host[UT_HOSTSIZE]; -}; - - -/* XXX We are not ready to use this now. It needs some more research. - Simly copying the behaviour of other implementations is no big - help. */ -#if 0 -/* Which program created the record. */ -enum utlogin -{ - unknown, - X, - local, - rlogin, - telnet, - rsh, - ftp, - screen, - splitvt, - xterm - /* More could be added here. */ -}; -#endif - - -struct exit_status -{ - short int e_termination; /* Process termination status. */ - short int e_exit; /* Process exit status. */ -}; - - -struct utmp -{ - short int ut_type; /* Type of login. */ - pid_t ut_pid; /* Pid of login process. */ - char ut_line[UT_LINESIZE]; /* NUL-terminated devicename of tty. */ - char ut_id[4]; /* Inittab id. */ - char ut_user[UT_NAMESIZE]; /* Username (not NUL terminated). */ -#define ut_name ut_user /* Compatible field name for same. */ - char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */ - struct exit_status ut_exit; /* The exit status of a process marked - as DEAD_PROCESS. */ - long ut_session; /* Session ID, used for windowing. */ - struct timeval ut_tv; /* Time entry was made. */ - int32_t ut_addr_v6[4]; /* Internet address of remote host. */ - char pad[20]; /* Reserved for future use. */ -}; - -/* Backwards compatibility hacks. */ -#ifndef _NO_UT_TIME -/* We have a problem here: `ut_time' is also used otherwise. Define - _NO_UT_TIME if the compiler complains. */ -# define ut_time ut_tv.tv_sec -#endif -#define ut_xtime ut_tv.tv_sec -#define ut_addr ut_addr_v6[0] - -/* Tell the user that we have a modern system with UT_HOST, UT_PID, - UT_TYPE, UT_ID and UT_TV fields. */ -#define _HAVE_UT_TYPE 1 -#define _HAVE_UT_PID 1 -#define _HAVE_UT_ID 1 -#define _HAVE_UT_TV 1 -#define _HAVE_UT_HOST 1 - -__END_DECLS - -#endif /* !_UTMP_H_ */ diff --git a/sysdeps/i386/__longjmp.S b/sysdeps/i386/__longjmp.S index f6331d4..0ec5d26 100644 --- a/sysdeps/i386/__longjmp.S +++ b/sysdeps/i386/__longjmp.S @@ -19,7 +19,7 @@ #include #define _ASM -#include +#include ENTRY (__longjmp) movl 4(%esp), %ecx /* User's jmp_buf in %ecx. */ diff --git a/sysdeps/i386/bits/endian.h b/sysdeps/i386/bits/endian.h new file mode 100644 index 0000000..a5d6c5e --- /dev/null +++ b/sysdeps/i386/bits/endian.h @@ -0,0 +1,3 @@ +/* i386 is little-endian. */ + +#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/sysdeps/i386/bits/huge_val.h b/sysdeps/i386/bits/huge_val.h new file mode 100644 index 0000000..65a06d8 --- /dev/null +++ b/sysdeps/i386/bits/huge_val.h @@ -0,0 +1,70 @@ +/* `HUGE_VAL' constants for ix86 (where it is infinity). + Used by and functions for overflow. + Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _MATH_H +#error "Never use directly; include instead." +#endif + + +#include +#include + +/* IEEE positive infinity (-HUGE_VAL is negative infinity). */ + +#define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } + +#define __huge_val_t union { unsigned char __c[8]; double __d; } +#ifdef __GNUC__ +#define HUGE_VAL (__extension__ \ + ((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d) +#else /* Not GCC. */ +static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; +#define HUGE_VAL (__huge_val.__d) +#endif /* GCC. */ + + +/* ISO C 9X extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */ + +#ifdef __USE_ISOC9X + +#define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f } + +#define __huge_valf_t union { unsigned char __c[4]; float __f; } +#ifdef __GNUC__ +#define HUGE_VALF (__extension__ \ + ((__huge_valf_t) { __c: __HUGE_VALF_bytes }).__f) +#else /* Not GCC. */ +static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; +#define HUGE_VALF (__huge_valf.__f) +#endif /* GCC. */ + + +#define __HUGE_VALL_bytes { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 } + +#define __huge_vall_t union { unsigned char __c[12]; long double __ld; } +#ifdef __GNUC__ +#define HUGE_VALL (__extension__ \ + ((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld) +#else /* Not GCC. */ +static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes }; +#define HUGE_VALL (__huge_vall.__ld) +#endif /* GCC. */ + +#endif /* __USE_ISOC9X. */ diff --git a/sysdeps/i386/bits/select.h b/sysdeps/i386/bits/select.h new file mode 100644 index 0000000..3912515 --- /dev/null +++ b/sysdeps/i386/bits/select.h @@ -0,0 +1,57 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_SELECT_H +#error "Never use directly; include instead." +#endif + + +#if defined __GNUC__ && __GNUC__ >= 2 + +#define __FD_ZERO(fdsetp) \ + __asm__ __volatile__ ("cld ; rep ; stosl" \ + : "=m" (*(__fd_set *) (fdsetp)) \ + : "a" (0), "c" (sizeof (__fd_set) \ + / sizeof (__fd_mask)), \ + "D" ((__fd_set *) (fdsetp)) \ + :"cx","di") +#define __FD_SET(fd, fdsetp) \ + __asm__ __volatile__ ("btsl %1,%0" \ + : "=m" (*(__fd_set *) (fdsetp)) \ + : "r" ((int) (fd))) +#define __FD_CLR(fd, fdsetp) \ + __asm__ __volatile__ ("btrl %1,%0" \ + : "=m" (*(__fd_set *) (fdsetp)) \ + : "r" ((int) (fd))) +#define __FD_ISSET(fd, fdsetp) \ + (__extension__ \ + ({unsigned char __result; \ + __asm__ __volatile__ ("btl %1,%2 ; setb %0" \ + : "=q" (__result) \ + : "r" ((int) (fd)), "m" (*(__fd_set *) (fdsetp))); \ + __result; })) + +#else /* ! GNU CC */ + +#define __FD_ZERO(set) \ + ((void) memset ((__ptr_t) (set), 0, sizeof (fd_set))) +#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) +#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) +#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) + +#endif /* GNU CC */ diff --git a/sysdeps/i386/bits/setjmp.h b/sysdeps/i386/bits/setjmp.h new file mode 100644 index 0000000..0c03073 --- /dev/null +++ b/sysdeps/i386/bits/setjmp.h @@ -0,0 +1,19 @@ +/* Define the machine-dependent type `jmp_buf'. Intel 386 version. */ + +#if defined (__USE_MISC) || defined (_ASM) +#define JB_BX 0 +#define JB_SI 1 +#define JB_DI 2 +#define JB_BP 3 +#define JB_SP 4 +#define JB_PC 5 +#endif + +#ifndef _ASM +typedef int __jmp_buf[6]; +#endif + +/* Test if longjmp to JMPBUF would unwind the frame + containing a local variable at ADDRESS. */ +#define _JMPBUF_UNWINDS(jmpbuf, address) \ + ((int) (address) < (jmpbuf)[JB_SP]) diff --git a/sysdeps/i386/bytesex.h b/sysdeps/i386/bytesex.h deleted file mode 100644 index a5d6c5e..0000000 --- a/sysdeps/i386/bytesex.h +++ /dev/null @@ -1,3 +0,0 @@ -/* i386 is little-endian. */ - -#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h index 6efa32b..64d36ca 100644 --- a/sysdeps/i386/dl-machine.h +++ b/sysdeps/i386/dl-machine.h @@ -263,6 +263,10 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, switch (ELF32_R_TYPE (reloc->r_info)) { case R_386_COPY: + if (sym == NULL) + /* This can happen in trace mode if an object could not be + found. */ + break; if (sym->st_size > refsym->st_size || (_dl_verbose && sym->st_size < refsym->st_size)) { diff --git a/sysdeps/i386/fpu/__math.h b/sysdeps/i386/fpu/__math.h deleted file mode 100644 index 9e1c23c..0000000 --- a/sysdeps/i386/fpu/__math.h +++ /dev/null @@ -1,608 +0,0 @@ -/* Inline math functions for i387. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by John C. Bowman , 1995. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef __MATH_H -#define __MATH_H 1 - -#if defined __GNUG__ && \ - (__GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ <= 7)) -/* gcc 2.7.2 and 2.7.2.1 have problems with inlining `long double' - functions so we disable this now. */ -#undef __NO_MATH_INLINES -#define __NO_MATH_INLINES -#endif - -#ifdef __GNUC__ -#ifndef __NO_MATH_INLINES - -#ifdef __cplusplus -#define __MATH_INLINE __inline -#else -#define __MATH_INLINE extern __inline -#endif - -__MATH_INLINE double cos (double); -__MATH_INLINE double sin (double); - - -__MATH_INLINE double __expm1 (double __x); -__MATH_INLINE double -__expm1 (double __x) -{ - register double __value, __exponent, __temp; - __asm __volatile__ - ("fldl2e # e^x - 1 = 2^(x * log2(e)) - 1\n\t" - "fmul %%st(1) # x * log2(e)\n\t" - "fstl %%st(1)\n\t" - "frndint # int(x * log2(e))\n\t" - "fxch\n\t" - "fsub %%st(1) # fract(x * log2(e))\n\t" - "f2xm1 # 2^(fract(x * log2(e))) - 1\n\t" - "fscale # 2^(x * log2(e)) - 2^(int(x * log2(e)))\n\t" - : "=t" (__value), "=u" (__exponent) : "0" (__x)); - __asm __volatile__ - ("fscale # 2^int(x * log2(e))\n\t" - : "=t" (__temp) : "0" (1.0), "u" (__exponent)); - __temp -= 1.0; - - return __temp + __value; -} - -__MATH_INLINE double __sgn1 (double __x); -__MATH_INLINE double -__sgn1 (double __x) -{ - return __x >= 0.0 ? 1.0 : -1.0; -} - -__MATH_INLINE double sqrt (double __x); -__MATH_INLINE double -sqrt (double __x) -{ - register double __value; - __asm __volatile__ - ("fsqrt" - : "=t" (__value) : "0" (__x)); - - return __value; -} - -__MATH_INLINE double fabs (double __x); -__MATH_INLINE double -fabs (double __x) -{ - register double __value; - __asm __volatile__ - ("fabs" - : "=t" (__value) : "0" (__x)); - - return __value; -} - -/* The argument range of this inline version is limited. */ -__MATH_INLINE double sin (double __x); -__MATH_INLINE double -sin (double __x) -{ - register double __value; - __asm __volatile__ - ("fsin" - : "=t" (__value) : "0" (__x)); - - return __value; -} - -/* The argument range of this inline version is limited. */ -__MATH_INLINE double cos (double __x); -__MATH_INLINE double -cos (double __x) -{ - register double __value; - __asm __volatile__ - ("fcos" - : "=t" (__value): "0" (__x)); - - return __value; -} - -__MATH_INLINE double tan (double __x); -__MATH_INLINE double -tan (double __x) -{ - register double __value; - register double __value2 __attribute__ ((unused)); - __asm __volatile__ - ("fptan" - : "=t" (__value2), "=u" (__value) : "0" (__x)); - - return __value; -} - -__MATH_INLINE double atan2 (double __y, double __x); -__MATH_INLINE double -atan2 (double __y, double __x) -{ - register double __value; - __asm __volatile__ - ("fpatan\n\t" - "fldl %%st(0)" - : "=t" (__value) : "0" (__x), "u" (__y)); - - return __value; -} - -__MATH_INLINE double asin (double __x); -__MATH_INLINE double -asin (double __x) -{ - return atan2 (__x, sqrt (1.0 - __x * __x)); -} - -__MATH_INLINE double acos (double __x); -__MATH_INLINE double -acos (double __x) -{ - return atan2 (sqrt (1.0 - __x * __x), __x); -} - -__MATH_INLINE double atan (double __x); -__MATH_INLINE double -atan (double __x) -{ - register double __value; - __asm __volatile__ - ("fld1\n\t" - "fpatan" - : "=t" (__value) : "0" (__x)); - - return __value; -} - -__MATH_INLINE double exp (double __x); -__MATH_INLINE double -exp (double __x) -{ - register double __value, __exponent; - __asm __volatile__ - ("fldl2e # e^x = 2^(x * log2(e))\n\t" - "fmul %%st(1) # x * log2(e)\n\t" - "fstl %%st(1)\n\t" - "frndint # int(x * log2(e))\n\t" - "fxch\n\t" - "fsub %%st(1) # fract(x * log2(e))\n\t" - "f2xm1 # 2^(fract(x * log2(e))) - 1\n\t" - : "=t" (__value), "=u" (__exponent) : "0" (__x)); - __value += 1.0; - __asm __volatile__ - ("fscale" - : "=t" (__value) : "0" (__value), "u" (__exponent)); - - return __value; -} - -__MATH_INLINE double sinh (double __x); -__MATH_INLINE double -sinh (double __x) -{ - register double __exm1 = __expm1 (fabs (__x)); - - return 0.5 * (__exm1 / (__exm1 + 1.0) + __exm1) * __sgn1 (__x); -} - -__MATH_INLINE double cosh (double __x); -__MATH_INLINE double -cosh (double __x) -{ - register double __ex = exp (__x); - - return 0.5 * (__ex + 1.0 / __ex); -} - -__MATH_INLINE double tanh (double __x); -__MATH_INLINE double -tanh (double __x) -{ - register double __exm1 = __expm1 (-fabs (__x + __x)); - - return __exm1 / (__exm1 + 2.0) * __sgn1 (-__x); -} - -__MATH_INLINE double log (double __x); -__MATH_INLINE double -log (double __x) -{ - register double __value; - __asm __volatile__ - ("fldln2\n\t" - "fxch\n\t" - "fyl2x" - : "=t" (__value) : "0" (__x)); - - return __value; -} - -__MATH_INLINE double log10 (double __x); -__MATH_INLINE double -log10 (double __x) -{ - register double __value; - __asm __volatile__ - ("fldlg2\n\t" - "fxch\n\t" - "fyl2x" - : "=t" (__value) : "0" (__x)); - - return __value; -} - -__MATH_INLINE double __log2 (double __x); -__MATH_INLINE double -__log2 (double __x) -{ - register double __value; - __asm __volatile__ - ("fld1\n\t" - "fxch\n\t" - "fyl2x" - : "=t" (__value) : "0" (__x)); - - return __value; -} - -__MATH_INLINE double fmod (double __x, double __y); -__MATH_INLINE double -fmod (double __x, double __y) -{ - register double __value; - __asm __volatile__ - ("1: fprem\n\t" - "fstsw %%ax\n\t" - "sahf\n\t" - "jp 1b" - : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc"); - - return __value; -} - -__MATH_INLINE double ldexp (double __x, int __y); -__MATH_INLINE double -ldexp (double __x, int __y) -{ - register double __value; - __asm __volatile__ - ("fscale" - : "=t" (__value) : "0" (__x), "u" ((double) __y)); - - return __value; -} - -__MATH_INLINE double pow (double __x, double __y); -__MATH_INLINE double -pow (double __x, double __y) -{ - register double __value, __exponent; - long __p = (long) __y; - - if (__x == 0.0 && __y > 0.0) - return 0.0; - if (__y == (double) __p) - { - double __r = 1.0; - if (__p == 0) - return 1.0; - if (__p < 0) - { - __p = -__p; - __x = 1.0 / __x; - } - while (1) - { - if (__p & 1) - __r *= __x; - __p >>= 1; - if (__p == 0) - return __r; - __x *= __x; - } - /* NOTREACHED */ - } - __asm __volatile__ - ("fmul %%st(1) # y * log2(x)\n\t" - "fstl %%st(1)\n\t" - "frndint # int(y * log2(x))\n\t" - "fxch\n\t" - "fsub %%st(1) # fract(y * log2(x))\n\t" - "f2xm1 # 2^(fract(y * log2(x))) - 1\n\t" - : "=t" (__value), "=u" (__exponent) : "0" (__log2 (__x)), "1" (__y)); - __value += 1.0; - __asm __volatile__ - ("fscale" - : "=t" (__value) : "0" (__value), "u" (__exponent)); - - return __value; -} - -__MATH_INLINE double floor (double __x); -__MATH_INLINE double -floor (double __x) -{ - register double __value; - __volatile unsigned short int __cw, __cwtmp; - - __asm __volatile ("fnstcw %0" : "=m" (__cw)); - __cwtmp = (__cw & 0xf3ff) | 0x0400; /* rounding down */ - __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); - __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); - __asm __volatile ("fldcw %0" : : "m" (__cw)); - - return __value; -} - -__MATH_INLINE double ceil (double __x); -__MATH_INLINE double -ceil (double __x) -{ - register double __value; - __volatile unsigned short int __cw, __cwtmp; - - __asm __volatile ("fnstcw %0" : "=m" (__cw)); - __cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */ - __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); - __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); - __asm __volatile ("fldcw %0" : : "m" (__cw)); - - return __value; -} - - -/* Optimized versions for some non-standardized functions. */ -#if defined __USE_ISOC9X || defined __USE_MISC - -__MATH_INLINE double hypot (double __x, double __y); -__MATH_INLINE double -hypot (double __x, double __y) -{ - return sqrt (__x * __x + __y * __y); -} - -/* We cannot rely on M_SQRT being defined. So we do it for ourself - here. */ -#define __M_SQRT2 _Mldbl(1.41421356237309504880) /* sqrt(2) */ - -__MATH_INLINE double log1p (double __x); -__MATH_INLINE double -log1p (double __x) -{ - register double __value; - - if (fabs (__x) >= 1.0 - 0.5 * __M_SQRT2) - __value = log (1.0 + __x); - else - __asm __volatile__ - ("fldln2\n\t" - "fxch\n\t" - "fyl2xp1" - : "=t" (__value) : "0" (__x)); - - return __value; -} - -__MATH_INLINE double asinh (double __x); -__MATH_INLINE double -asinh (double __x) -{ - register double __y = fabs (__x); - - return log1p ((__y * __y / (sqrt (__y * __y + 1.0) + 1.0) + __y) - * __sgn1 (__x)); -} - -__MATH_INLINE double acosh (double __x); -__MATH_INLINE double -acosh (double __x) -{ - return log (__x + sqrt (__x - 1.0) * sqrt (__x + 1.0)); -} - -__MATH_INLINE double atanh (double __x); -__MATH_INLINE double -atanh (double __x) -{ - register double __y = fabs (__x); - - return -0.5 * __log1p (-(__y + __y) / (1.0 + __y)) * __sgn1 (__x); -} - -__MATH_INLINE double logb (double __x); -__MATH_INLINE double -logb (double __x) -{ - register double __value, __junk; - __asm __volatile__ - ("fxtract\n\t" - : "=t" (__junk), "=u" (__value) : "0" (__x)); - - return __value; -} - -__MATH_INLINE double drem (double __x, double __y); -__MATH_INLINE double -drem (double __x, double __y) -{ - register double __value; - __asm __volatile__ - ("1: fprem1\n\t" - "fstsw %%ax\n\t" - "sahf\n\t" - "jp 1b" - : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc"); - - return __value; -} - -/* This function is used in the `isfinite' macro. */ -__MATH_INLINE int __finite (double __x); -__MATH_INLINE int -__finite (double __x) -{ - register int __result; - __asm__ __volatile__ - ("orl $0x800fffff, %0\n\t" - "incl %0\n\t" - "shrl $31, %0" - : "=q" (__result) : "0" (((int *) &__x)[1])); - return __result; -} - - -/* ISO C 9X defines some macros to perform unordered comparisons. The - ix87 FPU supports this with special opcodes and we should use them. - These must not be inline functions since we have to be able to handle - all floating-point types. */ -#undef isgreater -#define isgreater(x, y) \ - ({ int result; \ - __asm__ ("fucompp; fnstsw; andb $0x45, %%ah; setz %%al;" \ - "andl $0xff, %0" \ - : "=a" (result) : "t" (x), "u" (y) : "cc"); \ - result; }) - -#undef isgreaterequal -#define isgreaterequal(x, y) \ - ({ int result; \ - __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al;" \ - "andl $0xff, %0" \ - : "=a" (result) : "t" (x), "u" (y) : "cc"); \ - result; }) - -#undef isless -#define isless(x, y) \ - ({ int result; \ - __asm__ ("fucompp; fnstsw; xorb $0x01, %%ah; testb $0x45, %%ah;" \ - "setz %%al; andl $0xff, %0" \ - : "=a" (result) : "t" (x), "u" (y) : "cc"); \ - result; }) - -#undef islessequal -#define islessequal(x, y) \ - ({ int result; \ - __asm__ ("fucompp; fnstsw; xorb $0x01, %%ah; testb $0x05, %%ah;" \ - "setz %%al; andl $0xff, %0" \ - : "=a" (result) : "t" (x), "u" (y) : "cc"); \ - result; }) - -#undef islessgreater -#define islessgreater(x, y) \ - ({ int result; \ - __asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al;" \ - "andl $0xff, %0" \ - : "=a" (result) : "t" (x), "u" (y) : "cc"); \ - result; }) - -#undef isunordered -#define isunordered(x, y) \ - ({ int result; \ - __asm__ ("fucompp; fnstsw; sahf; setp %%al; andl $0xff, %0" \ - : "=a" (result) : "t" (x), "u" (y) : "cc"); \ - result; }) -#endif - - -#ifdef __USE_MISC -__MATH_INLINE double coshm1 (double __x); -__MATH_INLINE double -coshm1 (double __x) -{ - register double __exm1 = __expm1 (fabs (__x)); - - return 0.5 * (__exm1 / (__exm1 + 1.0)) * __exm1; -} - -__MATH_INLINE double acosh1p (double __x); -__MATH_INLINE double -acosh1p (double __x) -{ - return __log1p (__x + sqrt (__x) * sqrt (__x + 2.0)); -} - -__MATH_INLINE void sincos (double __x, double *__sinx, double *__cosx); -__MATH_INLINE void -sincos (double __x, double *__sinx, double *__cosx) -{ - register double __cosr, __sinr; - __asm __volatile__ - ("fsincos\n\t" - "fnstsw %%ax\n\t" - "testl $0x400, %%eax\n\t" - "jz 1f\n\t" - "fldpi\n\t" - "fadd %%st(0)\n\t" - "fxch %%st(1)\n\t" - "2: fprem1\n\t" - "fnstsw %%ax\n\t" - "testl $0x400, %%eax\n\t" - "jnz 2b\n\t" - "fstp %%st(1)\n\t" - "fsincos\n\t" - "1:" - : "=t" (__cosr), "=u" (__sinr) : "0" (__x)); - - *__sinx = __sinr; - *__cosx = __cosr; -} - -__MATH_INLINE double sgn (double __x); -__MATH_INLINE double -sgn (double __x) -{ - return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0); -} - -__MATH_INLINE double pow2 (double __x); -__MATH_INLINE double -pow2 (double __x) -{ - register double __value, __exponent; - long __p = (long) __x; - - if (__x == (double) __p) - return ldexp (1.0, __p); - - __asm __volatile__ - ("fldl %%st(0)\n\t" - "frndint # int(x)\n\t" - "fxch\n\t" - "fsub %%st(1) # fract(x)\n\t" - "f2xm1 # 2^(fract(x)) - 1\n\t" - : "=t" (__value), "=u" (__exponent) : "0" (__x)); - __value += 1.0; - __asm __volatile__ - ("fscale" - : "=t" (__value) : "0" (__value), "u" (__exponent)); - - return __value; -} - -#endif /* __USE_MISC */ - -#endif /* __NO_MATH_INLINES */ -#endif /* __GNUC__ */ - -#endif /* __MATH_H */ diff --git a/sysdeps/i386/fpu/bits/fenv.h b/sysdeps/i386/fpu/bits/fenv.h new file mode 100644 index 0000000..63f3e52 --- /dev/null +++ b/sysdeps/i386/fpu/bits/fenv.h @@ -0,0 +1,89 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FENV_H +#error "Never use directly; include instead." +#endif + + +/* Define bits representing the exception. We use the bit positions + of the appropriate bits in the FPU control word. */ +enum + { + FE_INVALID = 0x01, +#define FE_INVALID FE_INVALID + __FE_DENORM = 0x02, + FE_DIVBYZERO = 0x04, +#define FE_DIVBYZERO FE_DIVBYZERO + FE_OVERFLOW = 0x08, +#define FE_OVERFLOW FE_OVERFLOW + FE_UNDERFLOW = 0x10, +#define FE_UNDERFLOW FE_UNDERFLOW + FE_INEXACT = 0x20 +#define FE_INEXACT 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 = 0, +#define FE_TONEAREST FE_TONEAREST + FE_DOWNWARD = 0x400, +#define FE_DOWNWARD FE_DOWNWARD + FE_UPWARD = 0x800, +#define FE_UPWARD FE_UPWARD + FE_TOWARDSZERO = 0xc00 +#define FE_TOWARDSZERO FE_TOWARDSZERO + }; + + +/* Type representing exception flags. */ +typedef unsigned short int fexcept_t; + + +/* Type representing floating-point environment. This function corresponds to the layout of the block written by the `fstenv'. */ +typedef struct + { + unsigned short int control_word; + unsigned short int __unused1; + unsigned short int status_word; + unsigned short int __unused2; + unsigned short int tags; + unsigned short int __unused3; + unsigned int eip; + unsigned short int cs_selector; + unsigned int opcode:11; + unsigned int __unused4:5; + unsigned int data_offset; + unsigned short int data_selector; + unsigned short int __unused5; + } +fenv_t; + +/* If the default argument is used we use this value. */ +#define FE_DFL_ENV ((fenv_t *) -1) + +#ifdef __USE_GNU +/* Floating-point environment where none of the exception is masked. */ +# define FE_NOMASK_ENV ((fenv_t *) -2) +#endif diff --git a/sysdeps/i386/fpu/bits/mathdef.h b/sysdeps/i386/fpu/bits/mathdef.h new file mode 100644 index 0000000..2387a39 --- /dev/null +++ b/sysdeps/i386/fpu/bits/mathdef.h @@ -0,0 +1,41 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _MATH_H +# error "Never use directly; include instead" +#endif + + +/* The ix87 FPUs evaluate all values in the 80 bit floating-point format + which is also available for the user as `long double'. Therefore + we define: */ +typedef long double float_t; /* `float' expressions are evaluated as + `long double'. */ +typedef long double double_t; /* `double' expressions are evaluated as + `long double'. */ + +/* Signal that both types are `long double'. */ +#define FLT_EVAL_METHOD 2 + +/* Define `INFINITY' as value of type `float_t'. */ +#define INFINITY HUGE_VALL + + +/* The values returned by `ilogb' for 0 and NaN respectively. */ +#define FP_ILOGB0 0x80000000 +#define FP_ILOGBNAN 0x80000000 diff --git a/sysdeps/i386/fpu/bits/mathinline.h b/sysdeps/i386/fpu/bits/mathinline.h new file mode 100644 index 0000000..d5c480a --- /dev/null +++ b/sysdeps/i386/fpu/bits/mathinline.h @@ -0,0 +1,608 @@ +/* Inline math functions for i387. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by John C. Bowman , 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _BITS_MATHINLINE_H +#define _BITS_MATHINLINE_H 1 + +#if defined __GNUG__ && \ + (__GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ <= 7)) +/* gcc 2.7.2 and 2.7.2.1 have problems with inlining `long double' + functions so we disable this now. */ +#undef __NO_MATH_INLINES +#define __NO_MATH_INLINES +#endif + +#ifdef __GNUC__ +#ifndef __NO_MATH_INLINES + +#ifdef __cplusplus +#define __MATH_INLINE __inline +#else +#define __MATH_INLINE extern __inline +#endif + +__MATH_INLINE double cos (double); +__MATH_INLINE double sin (double); + + +__MATH_INLINE double __expm1 (double __x); +__MATH_INLINE double +__expm1 (double __x) +{ + register double __value, __exponent, __temp; + __asm __volatile__ + ("fldl2e # e^x - 1 = 2^(x * log2(e)) - 1\n\t" + "fmul %%st(1) # x * log2(e)\n\t" + "fstl %%st(1)\n\t" + "frndint # int(x * log2(e))\n\t" + "fxch\n\t" + "fsub %%st(1) # fract(x * log2(e))\n\t" + "f2xm1 # 2^(fract(x * log2(e))) - 1\n\t" + "fscale # 2^(x * log2(e)) - 2^(int(x * log2(e)))\n\t" + : "=t" (__value), "=u" (__exponent) : "0" (__x)); + __asm __volatile__ + ("fscale # 2^int(x * log2(e))\n\t" + : "=t" (__temp) : "0" (1.0), "u" (__exponent)); + __temp -= 1.0; + + return __temp + __value; +} + +__MATH_INLINE double __sgn1 (double __x); +__MATH_INLINE double +__sgn1 (double __x) +{ + return __x >= 0.0 ? 1.0 : -1.0; +} + +__MATH_INLINE double sqrt (double __x); +__MATH_INLINE double +sqrt (double __x) +{ + register double __value; + __asm __volatile__ + ("fsqrt" + : "=t" (__value) : "0" (__x)); + + return __value; +} + +__MATH_INLINE double fabs (double __x); +__MATH_INLINE double +fabs (double __x) +{ + register double __value; + __asm __volatile__ + ("fabs" + : "=t" (__value) : "0" (__x)); + + return __value; +} + +/* The argument range of this inline version is limited. */ +__MATH_INLINE double sin (double __x); +__MATH_INLINE double +sin (double __x) +{ + register double __value; + __asm __volatile__ + ("fsin" + : "=t" (__value) : "0" (__x)); + + return __value; +} + +/* The argument range of this inline version is limited. */ +__MATH_INLINE double cos (double __x); +__MATH_INLINE double +cos (double __x) +{ + register double __value; + __asm __volatile__ + ("fcos" + : "=t" (__value): "0" (__x)); + + return __value; +} + +__MATH_INLINE double tan (double __x); +__MATH_INLINE double +tan (double __x) +{ + register double __value; + register double __value2 __attribute__ ((unused)); + __asm __volatile__ + ("fptan" + : "=t" (__value2), "=u" (__value) : "0" (__x)); + + return __value; +} + +__MATH_INLINE double atan2 (double __y, double __x); +__MATH_INLINE double +atan2 (double __y, double __x) +{ + register double __value; + __asm __volatile__ + ("fpatan\n\t" + "fldl %%st(0)" + : "=t" (__value) : "0" (__x), "u" (__y)); + + return __value; +} + +__MATH_INLINE double asin (double __x); +__MATH_INLINE double +asin (double __x) +{ + return atan2 (__x, sqrt (1.0 - __x * __x)); +} + +__MATH_INLINE double acos (double __x); +__MATH_INLINE double +acos (double __x) +{ + return atan2 (sqrt (1.0 - __x * __x), __x); +} + +__MATH_INLINE double atan (double __x); +__MATH_INLINE double +atan (double __x) +{ + register double __value; + __asm __volatile__ + ("fld1\n\t" + "fpatan" + : "=t" (__value) : "0" (__x)); + + return __value; +} + +__MATH_INLINE double exp (double __x); +__MATH_INLINE double +exp (double __x) +{ + register double __value, __exponent; + __asm __volatile__ + ("fldl2e # e^x = 2^(x * log2(e))\n\t" + "fmul %%st(1) # x * log2(e)\n\t" + "fstl %%st(1)\n\t" + "frndint # int(x * log2(e))\n\t" + "fxch\n\t" + "fsub %%st(1) # fract(x * log2(e))\n\t" + "f2xm1 # 2^(fract(x * log2(e))) - 1\n\t" + : "=t" (__value), "=u" (__exponent) : "0" (__x)); + __value += 1.0; + __asm __volatile__ + ("fscale" + : "=t" (__value) : "0" (__value), "u" (__exponent)); + + return __value; +} + +__MATH_INLINE double sinh (double __x); +__MATH_INLINE double +sinh (double __x) +{ + register double __exm1 = __expm1 (fabs (__x)); + + return 0.5 * (__exm1 / (__exm1 + 1.0) + __exm1) * __sgn1 (__x); +} + +__MATH_INLINE double cosh (double __x); +__MATH_INLINE double +cosh (double __x) +{ + register double __ex = exp (__x); + + return 0.5 * (__ex + 1.0 / __ex); +} + +__MATH_INLINE double tanh (double __x); +__MATH_INLINE double +tanh (double __x) +{ + register double __exm1 = __expm1 (-fabs (__x + __x)); + + return __exm1 / (__exm1 + 2.0) * __sgn1 (-__x); +} + +__MATH_INLINE double log (double __x); +__MATH_INLINE double +log (double __x) +{ + register double __value; + __asm __volatile__ + ("fldln2\n\t" + "fxch\n\t" + "fyl2x" + : "=t" (__value) : "0" (__x)); + + return __value; +} + +__MATH_INLINE double log10 (double __x); +__MATH_INLINE double +log10 (double __x) +{ + register double __value; + __asm __volatile__ + ("fldlg2\n\t" + "fxch\n\t" + "fyl2x" + : "=t" (__value) : "0" (__x)); + + return __value; +} + +__MATH_INLINE double __log2 (double __x); +__MATH_INLINE double +__log2 (double __x) +{ + register double __value; + __asm __volatile__ + ("fld1\n\t" + "fxch\n\t" + "fyl2x" + : "=t" (__value) : "0" (__x)); + + return __value; +} + +__MATH_INLINE double fmod (double __x, double __y); +__MATH_INLINE double +fmod (double __x, double __y) +{ + register double __value; + __asm __volatile__ + ("1: fprem\n\t" + "fstsw %%ax\n\t" + "sahf\n\t" + "jp 1b" + : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc"); + + return __value; +} + +__MATH_INLINE double ldexp (double __x, int __y); +__MATH_INLINE double +ldexp (double __x, int __y) +{ + register double __value; + __asm __volatile__ + ("fscale" + : "=t" (__value) : "0" (__x), "u" ((double) __y)); + + return __value; +} + +__MATH_INLINE double pow (double __x, double __y); +__MATH_INLINE double +pow (double __x, double __y) +{ + register double __value, __exponent; + long __p = (long) __y; + + if (__x == 0.0 && __y > 0.0) + return 0.0; + if (__y == (double) __p) + { + double __r = 1.0; + if (__p == 0) + return 1.0; + if (__p < 0) + { + __p = -__p; + __x = 1.0 / __x; + } + while (1) + { + if (__p & 1) + __r *= __x; + __p >>= 1; + if (__p == 0) + return __r; + __x *= __x; + } + /* NOTREACHED */ + } + __asm __volatile__ + ("fmul %%st(1) # y * log2(x)\n\t" + "fstl %%st(1)\n\t" + "frndint # int(y * log2(x))\n\t" + "fxch\n\t" + "fsub %%st(1) # fract(y * log2(x))\n\t" + "f2xm1 # 2^(fract(y * log2(x))) - 1\n\t" + : "=t" (__value), "=u" (__exponent) : "0" (__log2 (__x)), "1" (__y)); + __value += 1.0; + __asm __volatile__ + ("fscale" + : "=t" (__value) : "0" (__value), "u" (__exponent)); + + return __value; +} + +__MATH_INLINE double floor (double __x); +__MATH_INLINE double +floor (double __x) +{ + register double __value; + __volatile unsigned short int __cw, __cwtmp; + + __asm __volatile ("fnstcw %0" : "=m" (__cw)); + __cwtmp = (__cw & 0xf3ff) | 0x0400; /* rounding down */ + __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); + __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); + __asm __volatile ("fldcw %0" : : "m" (__cw)); + + return __value; +} + +__MATH_INLINE double ceil (double __x); +__MATH_INLINE double +ceil (double __x) +{ + register double __value; + __volatile unsigned short int __cw, __cwtmp; + + __asm __volatile ("fnstcw %0" : "=m" (__cw)); + __cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */ + __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); + __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); + __asm __volatile ("fldcw %0" : : "m" (__cw)); + + return __value; +} + + +/* Optimized versions for some non-standardized functions. */ +#if defined __USE_ISOC9X || defined __USE_MISC + +__MATH_INLINE double hypot (double __x, double __y); +__MATH_INLINE double +hypot (double __x, double __y) +{ + return sqrt (__x * __x + __y * __y); +} + +/* We cannot rely on M_SQRT being defined. So we do it for ourself + here. */ +#define __M_SQRT2 _Mldbl(1.41421356237309504880) /* sqrt(2) */ + +__MATH_INLINE double log1p (double __x); +__MATH_INLINE double +log1p (double __x) +{ + register double __value; + + if (fabs (__x) >= 1.0 - 0.5 * __M_SQRT2) + __value = log (1.0 + __x); + else + __asm __volatile__ + ("fldln2\n\t" + "fxch\n\t" + "fyl2xp1" + : "=t" (__value) : "0" (__x)); + + return __value; +} + +__MATH_INLINE double asinh (double __x); +__MATH_INLINE double +asinh (double __x) +{ + register double __y = fabs (__x); + + return log1p ((__y * __y / (sqrt (__y * __y + 1.0) + 1.0) + __y) + * __sgn1 (__x)); +} + +__MATH_INLINE double acosh (double __x); +__MATH_INLINE double +acosh (double __x) +{ + return log (__x + sqrt (__x - 1.0) * sqrt (__x + 1.0)); +} + +__MATH_INLINE double atanh (double __x); +__MATH_INLINE double +atanh (double __x) +{ + register double __y = fabs (__x); + + return -0.5 * __log1p (-(__y + __y) / (1.0 + __y)) * __sgn1 (__x); +} + +__MATH_INLINE double logb (double __x); +__MATH_INLINE double +logb (double __x) +{ + register double __value, __junk; + __asm __volatile__ + ("fxtract\n\t" + : "=t" (__junk), "=u" (__value) : "0" (__x)); + + return __value; +} + +__MATH_INLINE double drem (double __x, double __y); +__MATH_INLINE double +drem (double __x, double __y) +{ + register double __value; + __asm __volatile__ + ("1: fprem1\n\t" + "fstsw %%ax\n\t" + "sahf\n\t" + "jp 1b" + : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc"); + + return __value; +} + +/* This function is used in the `isfinite' macro. */ +__MATH_INLINE int __finite (double __x); +__MATH_INLINE int +__finite (double __x) +{ + register int __result; + __asm__ __volatile__ + ("orl $0x800fffff, %0\n\t" + "incl %0\n\t" + "shrl $31, %0" + : "=q" (__result) : "0" (((int *) &__x)[1])); + return __result; +} + + +/* ISO C 9X defines some macros to perform unordered comparisons. The + ix87 FPU supports this with special opcodes and we should use them. + These must not be inline functions since we have to be able to handle + all floating-point types. */ +#undef isgreater +#define isgreater(x, y) \ + ({ int result; \ + __asm__ ("fucompp; fnstsw; andb $0x45, %%ah; setz %%al;" \ + "andl $0xff, %0" \ + : "=a" (result) : "t" (x), "u" (y) : "cc"); \ + result; }) + +#undef isgreaterequal +#define isgreaterequal(x, y) \ + ({ int result; \ + __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al;" \ + "andl $0xff, %0" \ + : "=a" (result) : "t" (x), "u" (y) : "cc"); \ + result; }) + +#undef isless +#define isless(x, y) \ + ({ int result; \ + __asm__ ("fucompp; fnstsw; xorb $0x01, %%ah; testb $0x45, %%ah;" \ + "setz %%al; andl $0xff, %0" \ + : "=a" (result) : "t" (x), "u" (y) : "cc"); \ + result; }) + +#undef islessequal +#define islessequal(x, y) \ + ({ int result; \ + __asm__ ("fucompp; fnstsw; xorb $0x01, %%ah; testb $0x05, %%ah;" \ + "setz %%al; andl $0xff, %0" \ + : "=a" (result) : "t" (x), "u" (y) : "cc"); \ + result; }) + +#undef islessgreater +#define islessgreater(x, y) \ + ({ int result; \ + __asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al;" \ + "andl $0xff, %0" \ + : "=a" (result) : "t" (x), "u" (y) : "cc"); \ + result; }) + +#undef isunordered +#define isunordered(x, y) \ + ({ int result; \ + __asm__ ("fucompp; fnstsw; sahf; setp %%al; andl $0xff, %0" \ + : "=a" (result) : "t" (x), "u" (y) : "cc"); \ + result; }) +#endif + + +#ifdef __USE_MISC +__MATH_INLINE double coshm1 (double __x); +__MATH_INLINE double +coshm1 (double __x) +{ + register double __exm1 = __expm1 (fabs (__x)); + + return 0.5 * (__exm1 / (__exm1 + 1.0)) * __exm1; +} + +__MATH_INLINE double acosh1p (double __x); +__MATH_INLINE double +acosh1p (double __x) +{ + return __log1p (__x + sqrt (__x) * sqrt (__x + 2.0)); +} + +__MATH_INLINE void sincos (double __x, double *__sinx, double *__cosx); +__MATH_INLINE void +sincos (double __x, double *__sinx, double *__cosx) +{ + register double __cosr, __sinr; + __asm __volatile__ + ("fsincos\n\t" + "fnstsw %%ax\n\t" + "testl $0x400, %%eax\n\t" + "jz 1f\n\t" + "fldpi\n\t" + "fadd %%st(0)\n\t" + "fxch %%st(1)\n\t" + "2: fprem1\n\t" + "fnstsw %%ax\n\t" + "testl $0x400, %%eax\n\t" + "jnz 2b\n\t" + "fstp %%st(1)\n\t" + "fsincos\n\t" + "1:" + : "=t" (__cosr), "=u" (__sinr) : "0" (__x)); + + *__sinx = __sinr; + *__cosx = __cosr; +} + +__MATH_INLINE double sgn (double __x); +__MATH_INLINE double +sgn (double __x) +{ + return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0); +} + +__MATH_INLINE double pow2 (double __x); +__MATH_INLINE double +pow2 (double __x) +{ + register double __value, __exponent; + long __p = (long) __x; + + if (__x == (double) __p) + return ldexp (1.0, __p); + + __asm __volatile__ + ("fldl %%st(0)\n\t" + "frndint # int(x)\n\t" + "fxch\n\t" + "fsub %%st(1) # fract(x)\n\t" + "f2xm1 # 2^(fract(x)) - 1\n\t" + : "=t" (__value), "=u" (__exponent) : "0" (__x)); + __value += 1.0; + __asm __volatile__ + ("fscale" + : "=t" (__value) : "0" (__value), "u" (__exponent)); + + return __value; +} + +#endif /* __USE_MISC */ + +#endif /* __NO_MATH_INLINES */ +#endif /* __GNUC__ */ + +#endif /* _BITS_MATHINLINE_H */ diff --git a/sysdeps/i386/fpu/fenvbits.h b/sysdeps/i386/fpu/fenvbits.h deleted file mode 100644 index bea89a1..0000000 --- a/sysdeps/i386/fpu/fenvbits.h +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This file should never be included directly. */ - -#ifndef _FENVBITS_H -#define _FENVBITS_H 1 - -/* Define bits representing the exception. We use the bit positions - of the appropriate bits in the FPU control word. */ -enum - { - FE_INVALID = 0x01, -#define FE_INVALID FE_INVALID - __FE_DENORM = 0x02, - FE_DIVBYZERO = 0x04, -#define FE_DIVBYZERO FE_DIVBYZERO - FE_OVERFLOW = 0x08, -#define FE_OVERFLOW FE_OVERFLOW - FE_UNDERFLOW = 0x10, -#define FE_UNDERFLOW FE_UNDERFLOW - FE_INEXACT = 0x20 -#define FE_INEXACT 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 = 0, -#define FE_TONEAREST FE_TONEAREST - FE_DOWNWARD = 0x400, -#define FE_DOWNWARD FE_DOWNWARD - FE_UPWARD = 0x800, -#define FE_UPWARD FE_UPWARD - FE_TOWARDSZERO = 0xc00 -#define FE_TOWARDSZERO FE_TOWARDSZERO - }; - - -/* Type representing exception flags. */ -typedef unsigned short int fexcept_t; - - -/* Type representing floating-point environment. This function corresponds to the layout of the block written by the `fstenv'. */ -typedef struct - { - unsigned short int control_word; - unsigned short int __unused1; - unsigned short int status_word; - unsigned short int __unused2; - unsigned short int tags; - unsigned short int __unused3; - unsigned int eip; - unsigned short int cs_selector; - unsigned int opcode:11; - unsigned int __unused4:5; - unsigned int data_offset; - unsigned short int data_selector; - unsigned short int __unused5; - } -fenv_t; - -/* If the default argument is used we use this value. */ -#define FE_DFL_ENV ((fenv_t *) -1) - -#ifdef __USE_GNU -/* Floating-point environment where none of the exception is masked. */ -# define FE_NOMASK_ENV ((fenv_t *) -2) -#endif - -#endif /* fenvbits.h */ diff --git a/sysdeps/i386/fpu/mathbits.h b/sysdeps/i386/fpu/mathbits.h deleted file mode 100644 index f4a22c0..0000000 --- a/sysdeps/i386/fpu/mathbits.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _MATHBITS_H -#define _MATHBITS_H 1 - -/* The ix87 FPUs evaluate all values in the 80 bit floating-point format - which is also available for the user as `long double'. Therefore - we define: */ -typedef long double float_t; /* `float' expressions are evaluated as - `long double'. */ -typedef long double double_t; /* `double' expressions are evaluated as - `long double'. */ - -/* Signal that both types are `long double'. */ -#define FLT_EVAL_METHOD 2 - -/* Define `INFINITY' as value of type `float_t'. */ -#define INFINITY HUGE_VALL - - -/* The values returned by `ilogb' for 0 and NaN respectively. */ -#define FP_ILOGB0 0x80000000 -#define FP_ILOGBNAN 0x80000000 - -#endif /* mathbits.h */ diff --git a/sysdeps/i386/huge_val.h b/sysdeps/i386/huge_val.h deleted file mode 100644 index fa07145..0000000 --- a/sysdeps/i386/huge_val.h +++ /dev/null @@ -1,70 +0,0 @@ -/* `HUGE_VAL' constants for ix86 (where it is infinity). - Used by and functions for overflow. - Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _HUGE_VAL_H -#define _HUGE_VAL_H 1 - -#include -#include - -/* IEEE positive infinity (-HUGE_VAL is negative infinity). */ - -#define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } - -#define __huge_val_t union { unsigned char __c[8]; double __d; } -#ifdef __GNUC__ -#define HUGE_VAL (__extension__ \ - ((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d) -#else /* Not GCC. */ -static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; -#define HUGE_VAL (__huge_val.__d) -#endif /* GCC. */ - - -/* ISO C 9X extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */ - -#ifdef __USE_ISOC9X - -#define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f } - -#define __huge_valf_t union { unsigned char __c[4]; float __f; } -#ifdef __GNUC__ -#define HUGE_VALF (__extension__ \ - ((__huge_valf_t) { __c: __HUGE_VALF_bytes }).__f) -#else /* Not GCC. */ -static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; -#define HUGE_VALF (__huge_valf.__f) -#endif /* GCC. */ - - -#define __HUGE_VALL_bytes { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 } - -#define __huge_vall_t union { unsigned char __c[12]; long double __ld; } -#ifdef __GNUC__ -#define HUGE_VALL (__extension__ \ - ((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld) -#else /* Not GCC. */ -static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes }; -#define HUGE_VALL (__huge_vall.__ld) -#endif /* GCC. */ - -#endif /* __USE_ISOC9X. */ - -#endif /* huge_val.h */ diff --git a/sysdeps/i386/jmp_buf.h b/sysdeps/i386/jmp_buf.h deleted file mode 100644 index 0c03073..0000000 --- a/sysdeps/i386/jmp_buf.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Define the machine-dependent type `jmp_buf'. Intel 386 version. */ - -#if defined (__USE_MISC) || defined (_ASM) -#define JB_BX 0 -#define JB_SI 1 -#define JB_DI 2 -#define JB_BP 3 -#define JB_SP 4 -#define JB_PC 5 -#endif - -#ifndef _ASM -typedef int __jmp_buf[6]; -#endif - -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address) \ - ((int) (address) < (jmpbuf)[JB_SP]) diff --git a/sysdeps/i386/selectbits.h b/sysdeps/i386/selectbits.h deleted file mode 100644 index 973ecad..0000000 --- a/sysdeps/i386/selectbits.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SELECTBITS_H -#define _SELECTBITS_H 1 - -#if defined __GNUC__ && __GNUC__ >= 2 - -#define __FD_ZERO(fdsetp) \ - __asm__ __volatile__ ("cld ; rep ; stosl" \ - : "=m" (*(__fd_set *) (fdsetp)) \ - : "a" (0), "c" (sizeof (__fd_set) \ - / sizeof (__fd_mask)), \ - "D" ((__fd_set *) (fdsetp)) \ - :"cx","di") -#define __FD_SET(fd, fdsetp) \ - __asm__ __volatile__ ("btsl %1,%0" \ - : "=m" (*(__fd_set *) (fdsetp)) \ - : "r" ((int) (fd))) -#define __FD_CLR(fd, fdsetp) \ - __asm__ __volatile__ ("btrl %1,%0" \ - : "=m" (*(__fd_set *) (fdsetp)) \ - : "r" ((int) (fd))) -#define __FD_ISSET(fd, fdsetp) \ - (__extension__ \ - ({unsigned char __result; \ - __asm__ __volatile__ ("btl %1,%2 ; setb %0" \ - : "=q" (__result) \ - : "r" ((int) (fd)), "m" (*(__fd_set *) (fdsetp))); \ - __result; })) - -#else /* ! GNU CC */ - -#define __FD_ZERO(set) \ - ((void) memset ((__ptr_t) (set), 0, sizeof (fd_set))) -#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) -#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) -#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) - -#endif /* GNU CC */ - -#endif /* selectbits.h */ diff --git a/sysdeps/i386/setjmp.S b/sysdeps/i386/setjmp.S index 203c2d1..1ba3fc5 100644 --- a/sysdeps/i386/setjmp.S +++ b/sysdeps/i386/setjmp.S @@ -19,7 +19,7 @@ #include #define _ASM -#include +#include /* Binary compatibility entry point. */ ENTRY (__setjmp) diff --git a/sysdeps/ieee754/bits/huge_val.h b/sysdeps/ieee754/bits/huge_val.h new file mode 100644 index 0000000..fe0144c --- /dev/null +++ b/sysdeps/ieee754/bits/huge_val.h @@ -0,0 +1,89 @@ +/* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity). + Used by and functions for overflow. + Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _MATH_H +#error "Never use directly; include instead." +#endif + + +#include + +/* IEEE positive infinity (-HUGE_VAL is negative infinity). */ + +#ifdef __GNUC__ + +#define HUGE_VAL \ + (__extension__ \ + ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \ + { __l: 0x7ff0000000000000ULL }).__d) + +#else /* not GCC */ + +#include +#include + +typedef union { unsigned char __c[8]; double __d; } __huge_val_t; + +#if __BYTE_ORDER == __BIG_ENDIAN +#define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } +#endif +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } +#endif + +static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; +#define HUGE_VAL (__huge_val.__d) + +#endif /* GCC. */ + + +/* ISO C 9X extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */ + +#ifdef __USE_ISOC9X + +#ifdef __GNUC__ + +#define HUGE_VALF \ + (__extension__ \ + ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ + { __l: 0x7f800000UL }).__d) + +#else /* not GCC */ + +typedef union { unsigned char __c[4]; float __f; } __huge_valf_t; + +#if __BYTE_ORDER == __BIG_ENDIAN +#define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 } +#endif +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f } +#endif + +static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; +#define HUGE_VALF (__huge_valf.__f) + +#endif /* GCC. */ + + +/* Generally there is no separate `long double' format and it is the + same as `double'. */ +#define HUGE_VALL HUGE_VAL + +#endif /* __USE_ISOC9X. */ diff --git a/sysdeps/ieee754/bits/nan.h b/sysdeps/ieee754/bits/nan.h new file mode 100644 index 0000000..94988ce --- /dev/null +++ b/sysdeps/ieee754/bits/nan.h @@ -0,0 +1,63 @@ +/* `NAN' constant for IEEE 754 machines. + Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _MATH_H +# error "Never use directly; include instead." +#endif + + +/* IEEE Not A Number. */ + +#ifdef __GNUC__ + +# define NAN \ + (__extension__ \ + ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \ + { __l: 0x7ff8000000000000ULL }).__d) + +# define NANF \ + (__extension__ \ + ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ + { __l: 0x7fc00000UL }).__d) + +#else + +# include + +# if __BYTE_ORDER == __BIG_ENDIAN +# define __nan_bytes { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 } +# define __nanf_bytes { 0x7f, 0xc0, 0, 0 } +# endif +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define __nan_bytes { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f } +# define __nanf_bytes { 0, 0, 0xc0, 0x7f } +# endif + +static union { unsigned char __c[8]; double __d; } __nan = { __nan_bytes }; +# define NAN (__nan.__d) + +static union { unsigned char __c[4]; double __d; } __nanf = { __nanf_bytes }; +# define NANF (__nanf.__d) + +#endif /* GCC. */ + +/* Generally there is no separate `long double' format and it is the + same as `double'. */ + +#define NANL NAN diff --git a/sysdeps/ieee754/huge_val.h b/sysdeps/ieee754/huge_val.h deleted file mode 100644 index a252085..0000000 --- a/sysdeps/ieee754/huge_val.h +++ /dev/null @@ -1,88 +0,0 @@ -/* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity). - Used by and functions for overflow. - Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _HUGE_VAL_H -#define _HUGE_VAL_H 1 - -#include -#include -#include - -/* IEEE positive infinity (-HUGE_VAL is negative infinity). */ - -#ifdef __GNUC__ - -#define HUGE_VAL \ - (__extension__ \ - ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \ - { __l: 0x7ff0000000000000ULL }).__d) - -#else /* not GCC */ - -typedef union { unsigned char __c[8]; double __d; } __huge_val_t; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } -#endif -#if __BYTE_ORDER == __LITTLE_ENDIAN -#define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } -#endif - -static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; -#define HUGE_VAL (__huge_val.__d) - -#endif /* GCC. */ - - -/* ISO C 9X extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */ - -#ifdef __USE_ISOC9X - -#ifdef __GNUC__ - -#define HUGE_VALF \ - (__extension__ \ - ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ - { __l: 0x7f800000UL }).__d) - -#else /* not GCC */ - -typedef union { unsigned char __c[4]; float __f; } __huge_valf_t; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 } -#endif -#if __BYTE_ORDER == __LITTLE_ENDIAN -#define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f } -#endif - -static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; -#define HUGE_VALF (__huge_valf.__f) - -#endif /* GCC. */ - - -/* Generally there is no separate `long double' format and it is the - same as `double'. */ -#define HUGE_VALL HUGE_VAL - -#endif /* __USE_ISOC9X. */ - -#endif /* huge_val.h */ diff --git a/sysdeps/ieee754/nan.h b/sysdeps/ieee754/nan.h deleted file mode 100644 index 499edba..0000000 --- a/sysdeps/ieee754/nan.h +++ /dev/null @@ -1,64 +0,0 @@ -/* `NAN' constant for IEEE 754 machines. - Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _NAN_H - -#define _NAN_H 1 - -/* IEEE Not A Number. */ - -#ifdef __GNUC__ - -#define NAN \ - (__extension__ \ - ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \ - { __l: 0x7ff8000000000000ULL }).__d) - -#define NANF \ - (__extension__ \ - ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ - { __l: 0x7fc00000UL }).__d) - -#else - -#include - -#if __BYTE_ORDER == __BIG_ENDIAN -#define __nan_bytes { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 } -#define __nanf_bytes { 0x7f, 0xc0, 0, 0 } -#endif -#if __BYTE_ORDER == __LITTLE_ENDIAN -#define __nan_bytes { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f } -#define __nanf_bytes { 0, 0, 0xc0, 0x7f } -#endif - -static union { unsigned char __c[8]; double __d; } __nan = { __nan_bytes }; -#define NAN (__nan.__d) - -static union { unsigned char __c[4]; double __d; } __nanf = { __nanf_bytes }; -#define NANF (__nanf.__d) - -#endif /* GCC. */ - -/* Generally there is no separate `long double' format and it is the - same as `double'. */ - -#define NANL NAN - -#endif /* nan.h */ diff --git a/sysdeps/libm-ieee754/k_standard.c b/sysdeps/libm-ieee754/k_standard.c index ada1df1..d1f8274 100644 --- a/sysdeps/libm-ieee754/k_standard.c +++ b/sysdeps/libm-ieee754/k_standard.c @@ -117,7 +117,7 @@ static double zero = 0.0; /* used as const */ exc.retval = NAN; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if(_LIB_VERSION == _SVID_) { (void) WRITE2("acos: DOMAIN error\n", 19); } @@ -137,7 +137,7 @@ static double zero = 0.0; /* used as const */ exc.retval = NAN; if(_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if(_LIB_VERSION == _SVID_) { (void) WRITE2("asin: DOMAIN error\n", 19); } @@ -157,7 +157,7 @@ static double zero = 0.0; /* used as const */ exc.retval = HUGE; if(_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if(_LIB_VERSION == _SVID_) { (void) WRITE2("atan2: DOMAIN error\n", 20); } @@ -177,7 +177,7 @@ static double zero = 0.0; /* used as const */ exc.retval = HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { __set_errno (ERANGE); } break; @@ -194,7 +194,7 @@ static double zero = 0.0; /* used as const */ exc.retval = HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { __set_errno (ERANGE); } break; @@ -211,7 +211,7 @@ static double zero = 0.0; /* used as const */ exc.retval = HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { __set_errno (ERANGE); } break; @@ -225,7 +225,7 @@ static double zero = 0.0; /* used as const */ exc.retval = zero; if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { __set_errno (ERANGE); } break; @@ -241,7 +241,7 @@ static double zero = 0.0; /* used as const */ exc.retval = -HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("y0: DOMAIN error\n", 17); } @@ -260,7 +260,7 @@ static double zero = 0.0; /* used as const */ exc.retval = -HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("y0: DOMAIN error\n", 17); } @@ -279,7 +279,7 @@ static double zero = 0.0; /* used as const */ exc.retval = -HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("y1: DOMAIN error\n", 17); } @@ -298,7 +298,7 @@ static double zero = 0.0; /* used as const */ exc.retval = -HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("y1: DOMAIN error\n", 17); } @@ -317,7 +317,7 @@ static double zero = 0.0; /* used as const */ exc.retval = -HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("yn: DOMAIN error\n", 17); } @@ -336,7 +336,7 @@ static double zero = 0.0; /* used as const */ exc.retval = -HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("yn: DOMAIN error\n", 17); } @@ -356,7 +356,7 @@ static double zero = 0.0; /* used as const */ exc.retval = HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { __set_errno (ERANGE); } break; @@ -373,7 +373,7 @@ static double zero = 0.0; /* used as const */ exc.retval = HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("lgamma: SING error\n", 19); } @@ -392,7 +392,7 @@ static double zero = 0.0; /* used as const */ exc.retval = -HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("log: SING error\n", 16); } @@ -411,7 +411,7 @@ static double zero = 0.0; /* used as const */ exc.retval = NAN; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("log: DOMAIN error\n", 18); } @@ -431,7 +431,7 @@ static double zero = 0.0; /* used as const */ exc.retval = -HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("log10: SING error\n", 18); } @@ -451,7 +451,7 @@ static double zero = 0.0; /* used as const */ exc.retval = NAN; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("log10: DOMAIN error\n", 20); } @@ -467,7 +467,7 @@ static double zero = 0.0; /* used as const */ exc.name = type < 100 ? "pow" : (type < 200 ? "powf" : "powl"); exc.retval = zero; if (_LIB_VERSION != _SVID_) exc.retval = 1.0; - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { (void) WRITE2("pow(0,0): DOMAIN error\n", 23); __set_errno (EDOM); } @@ -489,7 +489,7 @@ static double zero = 0.0; /* used as const */ } if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { __set_errno (ERANGE); } break; @@ -502,7 +502,7 @@ static double zero = 0.0; /* used as const */ exc.retval = zero; if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { __set_errno (ERANGE); } break; @@ -518,7 +518,7 @@ static double zero = 0.0; /* used as const */ exc.retval = -HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("pow(0,neg): DOMAIN error\n", 25); } @@ -537,7 +537,7 @@ static double zero = 0.0; /* used as const */ exc.retval = HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("pow(0,neg): DOMAIN error\n", 25); } @@ -556,7 +556,7 @@ static double zero = 0.0; /* used as const */ exc.retval = zero/zero; /* X/Open allow NaN */ if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("neg**non-integral: DOMAIN error\n", 32); } @@ -576,7 +576,7 @@ static double zero = 0.0; /* used as const */ exc.retval = ( (x>zero) ? HUGE_VAL : -HUGE_VAL); if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { __set_errno (ERANGE); } break; @@ -593,7 +593,7 @@ static double zero = 0.0; /* used as const */ exc.retval = zero/zero; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("sqrt: DOMAIN error\n", 19); } @@ -613,7 +613,7 @@ static double zero = 0.0; /* used as const */ exc.retval = zero/zero; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("fmod: DOMAIN error\n", 20); } @@ -631,7 +631,7 @@ static double zero = 0.0; /* used as const */ exc.retval = zero/zero; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("remainder: DOMAIN error\n", 24); } @@ -648,7 +648,7 @@ static double zero = 0.0; /* used as const */ exc.retval = zero/zero; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("acosh: DOMAIN error\n", 20); } @@ -665,7 +665,7 @@ static double zero = 0.0; /* used as const */ exc.retval = zero/zero; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("atanh: DOMAIN error\n", 20); } @@ -682,7 +682,7 @@ static double zero = 0.0; /* used as const */ exc.retval = x/zero; /* sign(x)*inf */ if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("atanh: SING error\n", 18); } @@ -699,7 +699,7 @@ static double zero = 0.0; /* used as const */ exc.retval = x > zero ? HUGE_VAL : -HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { __set_errno (ERANGE); } break; @@ -713,7 +713,7 @@ static double zero = 0.0; /* used as const */ exc.retval = __copysign(zero,x); if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { __set_errno (ERANGE); } break; @@ -726,7 +726,7 @@ static double zero = 0.0; /* used as const */ exc.retval = zero; if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2(exc.name, 2); (void) WRITE2(": TLOSS error\n", 14); @@ -743,7 +743,7 @@ static double zero = 0.0; /* used as const */ exc.retval = zero; if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2(exc.name, 2); (void) WRITE2(": TLOSS error\n", 14); @@ -760,7 +760,7 @@ static double zero = 0.0; /* used as const */ exc.retval = zero; if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2(exc.name, 2); (void) WRITE2(": TLOSS error\n", 14); @@ -777,7 +777,7 @@ static double zero = 0.0; /* used as const */ exc.retval = zero; if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2(exc.name, 2); (void) WRITE2(": TLOSS error\n", 14); @@ -794,7 +794,7 @@ static double zero = 0.0; /* used as const */ exc.retval = zero; if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2(exc.name, 2); (void) WRITE2(": TLOSS error\n", 14); @@ -811,7 +811,7 @@ static double zero = 0.0; /* used as const */ exc.retval = zero; if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2(exc.name, 2); (void) WRITE2(": TLOSS error\n", 14); @@ -832,7 +832,7 @@ static double zero = 0.0; /* used as const */ exc.retval = HUGE_VAL; if (_LIB_VERSION == _POSIX_) __set_errno (ERANGE); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { __set_errno (ERANGE); } break; @@ -846,10 +846,10 @@ static double zero = 0.0; /* used as const */ if (_LIB_VERSION == _SVID_) exc.retval = HUGE; else - exc.retval = HUGE_VAL; + exc.retval = NAN; if (_LIB_VERSION == _POSIX_) __set_errno (EDOM); - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { (void) WRITE2("gamma: SING error\n", 18); } @@ -866,7 +866,7 @@ static double zero = 0.0; /* used as const */ exc.retval = x; if (_LIB_VERSION == _IEEE_ || _LIB_VERSION == _POSIX_) exc.retval = 1.0; - else if (!__matherr(&exc)) { + else if (!matherr(&exc)) { __set_errno (EDOM); } break; diff --git a/sysdeps/libm-ieee754/w_gamma.c b/sysdeps/libm-ieee754/w_gamma.c index 87a3408..5c3f27a 100644 --- a/sysdeps/libm-ieee754/w_gamma.c +++ b/sysdeps/libm-ieee754/w_gamma.c @@ -29,14 +29,14 @@ static char rcsid[] = "$NetBSD: w_gamma.c,v 1.7 1995/11/20 22:06:43 jtc Exp $"; double x; #endif { - int signgam; double y; if (_LIB_VERSION == _SVID_) y = __ieee754_lgamma_r(x,&signgam); else { - y = __ieee754_gamma_r(x,&signgam); - if (signgam < 0) y = -y; + int local_signgam; + y = __ieee754_gamma_r(x,&local_signgam); + if (local_signgam < 0) y = -y; #ifdef _IEEE_LIBM return y; #else diff --git a/sysdeps/libm-ieee754/w_gammaf.c b/sysdeps/libm-ieee754/w_gammaf.c index ecde183..5988e54 100644 --- a/sysdeps/libm-ieee754/w_gammaf.c +++ b/sysdeps/libm-ieee754/w_gammaf.c @@ -27,14 +27,14 @@ static char rcsid[] = "$NetBSD: w_gammaf.c,v 1.4 1995/11/20 22:06:48 jtc Exp $"; float x; #endif { - int signgam; float y; if (_LIB_VERSION == _SVID_) y = __ieee754_lgammaf_r(x,&signgam); else { - y = __ieee754_gammaf_r(x,&signgam); - if (signgam < 0) y = -y; + int local_signgam; + y = __ieee754_gammaf_r(x,&local_signgam); + if (local_signgam < 0) y = -y; #ifdef _IEEE_LIBM return y; #else diff --git a/sysdeps/libm-ieee754/w_gammal.c b/sysdeps/libm-ieee754/w_gammal.c index 605a416..0107d55 100644 --- a/sysdeps/libm-ieee754/w_gammal.c +++ b/sysdeps/libm-ieee754/w_gammal.c @@ -33,13 +33,13 @@ static char rcsid[] = "$NetBSD: $"; #endif { long double y; - int signgam; if (_LIB_VERSION == _SVID_) y = __ieee754_lgammal_r(x,&signgam); else { - y = __ieee754_gammal_r(x,&signgam); - if (signgam < 0) y = -y; + int local_signgam; + y = __ieee754_gammal_r(x,&local_signgam); + if (local_signgam < 0) y = -y; #ifdef _IEEE_LIBM return y; #else diff --git a/sysdeps/m68k/bits/endian.h b/sysdeps/m68k/bits/endian.h new file mode 100644 index 0000000..6f98529 --- /dev/null +++ b/sysdeps/m68k/bits/endian.h @@ -0,0 +1,3 @@ +/* m68k is big-endian. */ + +#define __BYTE_ORDER __BIG_ENDIAN diff --git a/sysdeps/m68k/bits/huge_val.h b/sysdeps/m68k/bits/huge_val.h new file mode 100644 index 0000000..822b829 --- /dev/null +++ b/sysdeps/m68k/bits/huge_val.h @@ -0,0 +1,75 @@ +/* `HUGE_VAL' constants for m68k (where it is infinity). + Used by and functions for overflow. + Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _MATH_H +# error "Never use directly; include instead." +#endif + + +#include +#include + +/* IEEE positive infinity (-HUGE_VAL is negative infinity). */ + +#ifdef __GNUC__ + +# define HUGE_VAL \ + (__extension__ \ + ((union { unsigned long long __l; double __d; }) \ + { __l: 0x7ff0000000000000ULL }).__d) + +#else /* not GCC */ + +static union { unsigned char __c[8]; double __d; } __huge_val = + { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } }; +# define HUGE_VAL (__huge_val.__d) + +#endif /* GCC. */ + + +/* ISO C 9X extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */ + +#ifdef __USE_ISOC9X + +# ifdef __GNUC__ + +# define HUGE_VALF \ + (__extension__ \ + ((union { unsigned long __l; float __f; }) \ + { __l: 0x7f800000UL }).__f) + +# define HUGE_VALL \ + (__extension__ \ + ((union { unsigned long __l[3]; long double __ld; }) \ + { __l: { 0x7fff0000UL, 0x80000000UL, 0UL } }).__ld) + +# else /* not GCC */ + +static union { unsigned char __c[4]; float __f; } __huge_valf = + { { 0x7f, 0x80, 0, 0 } }; +# define HUGE_VALF (__huge_valf.__f) + +static union { unsigned char __c[12]; long double __ld; } __huge_vall = + { { 0x7f, 0xff, 0, 0, 0x80, 0, 0, 0, 0, 0, 0, 0 } }; +# define HUGE_VALL (__huge_vall.__ld) + +# endif /* GCC. */ + +#endif /* __USE_ISOC9X. */ diff --git a/sysdeps/m68k/bits/setjmp.h b/sysdeps/m68k/bits/setjmp.h new file mode 100644 index 0000000..96240f0 --- /dev/null +++ b/sysdeps/m68k/bits/setjmp.h @@ -0,0 +1,19 @@ +/* Define the machine-dependent type `jmp_buf'. m68k version. */ + +typedef struct + { + /* There are eight 4-byte data registers, but D0 is not saved. */ + long int __dregs[7]; + + /* There are six 4-byte address registers, plus the FP and SP. */ + int *__aregs[6]; + int * __fp; + int * __sp; + +#if defined(__HAVE_68881__) || defined(__HAVE_FPU__) + /* There are eight floating point registers which + are saved in IEEE 96-bit extended format. */ + char __fpregs[8 * (96 / 8)]; +#endif + + } __jmp_buf[1]; diff --git a/sysdeps/m68k/bytesex.h b/sysdeps/m68k/bytesex.h deleted file mode 100644 index 6f98529..0000000 --- a/sysdeps/m68k/bytesex.h +++ /dev/null @@ -1,3 +0,0 @@ -/* m68k is big-endian. */ - -#define __BYTE_ORDER __BIG_ENDIAN diff --git a/sysdeps/m68k/dl-machine.h b/sysdeps/m68k/dl-machine.h index 1523ddb..e50f773 100644 --- a/sysdeps/m68k/dl-machine.h +++ b/sysdeps/m68k/dl-machine.h @@ -227,6 +227,10 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, switch (ELF32_R_TYPE (reloc->r_info)) { case R_68K_COPY: + if (sym == NULL) + /* This can happen in trace mode if an object could not be + found. */ + break; if (sym->st_size > refsym->st_size || (_dl_verbose && sym->st_size < refsym->st_size)) { diff --git a/sysdeps/m68k/fpu/__math.h b/sysdeps/m68k/fpu/__math.h deleted file mode 100644 index bdeaa9e..0000000 --- a/sysdeps/m68k/fpu/__math.h +++ /dev/null @@ -1,464 +0,0 @@ -/* Definitions of inline math functions implemented by the m68881/2. - Copyright (C) 1991, 92, 93, 94, 96, 97 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef __GNUC__ - -#include - -#ifdef __LIBC_M81_MATH_INLINES -/* This is used when defining the functions themselves. Define them with - __ names, and with `static inline' instead of `extern inline' so the - bodies will always be used, never an external function call. */ -#define __m81_u(x) __CONCAT(__,x) -#define __m81_inline static __inline -#else -#define __m81_u(x) x -#define __m81_inline extern __inline -#define __M81_MATH_INLINES 1 -#endif - -/* Define a const math function. */ -#define __m81_defun(rettype, func, args) \ - __m81_inline rettype __attribute__((__const__)) \ - __m81_u(func) args - -/* Define the three variants of a math function that has a direct - implementation in the m68k fpu. FUNC is the name for C (which will be - suffixed with f and l for the float and long double version, resp). OP - is the name of the fpu operation (without leading f). */ - -#if defined __USE_MISC || defined __USE_ISOC9X -#define __inline_mathop(func, op) \ - __inline_mathop1(double, func, op) \ - __inline_mathop1(float, __CONCAT(func,f), op) \ - __inline_mathop1(long double, __CONCAT(func,l), op) -#else -#define __inline_mathop(func, op) \ - __inline_mathop1(double, func, op) -#endif - -#define __inline_mathop1(float_type,func, op) \ - __m81_defun (float_type, func, (float_type __mathop_x)) \ - { \ - float_type __result; \ - __asm("f" __STRING(op) "%.x %1, %0" : "=f" (__result) : "f" (__mathop_x));\ - return __result; \ - } - -#ifdef __LIBC_M81_MATH_INLINES -/* ieee style elementary functions */ -/* These are internal to the implementation of libm. */ -__inline_mathop(__ieee754_acos, acos) -__inline_mathop(__ieee754_asin, asin) -__inline_mathop(__ieee754_cosh, cosh) -__inline_mathop(__ieee754_sinh, sinh) -__inline_mathop(__ieee754_exp, etox) -__inline_mathop(__ieee754_log10, log10) -__inline_mathop(__ieee754_log, logn) -__inline_mathop(__ieee754_sqrt, sqrt) -__inline_mathop(__ieee754_atanh, atanh) -#endif - -__inline_mathop(__atan, atan) -__inline_mathop(__cos, cos) -__inline_mathop(__sin, sin) -__inline_mathop(__tan, tan) -__inline_mathop(__tanh, tanh) -__inline_mathop(__fabs, abs) - -__inline_mathop(__rint, int) -__inline_mathop(__expm1, etoxm1) -__inline_mathop(__log1p, lognp1) -__inline_mathop(__significand, getman) - -__inline_mathop(__log2, log2) -__inline_mathop(__exp2, twotox) -__inline_mathop(__trunc, intrz) - -#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ - -__inline_mathop(atan, atan) -__inline_mathop(cos, cos) -__inline_mathop(sin, sin) -__inline_mathop(tan, tan) -__inline_mathop(tanh, tanh) - -#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC9X -__inline_mathop(rint, int) -__inline_mathop(expm1, etoxm1) -__inline_mathop(log1p, lognp1) -#endif - -#ifdef __USE_MISC -__inline_mathop(significand, getman) -#endif - -#ifdef __USE_ISOC9X -__inline_mathop(log2, log2) -__inline_mathop(exp2, twotox) -__inline_mathop(trunc, intrz) -#endif - -#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */ - -/* This macro contains the definition for the rest of the inline - functions, using __FLOAT_TYPE as the domain type and __S as the suffix - for the function names. */ - -#ifdef __LIBC_M81_MATH_INLINES -/* Internally used functions. */ -#define __internal_inline_functions(float_type, s) \ -__m81_defun (float_type, __CONCAT(__ieee754_remainder,s), \ - (float_type __x, float_type __y)) \ -{ \ - float_type __result; \ - __asm("frem%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x)); \ - return __result; \ -} \ - \ -__m81_defun (float_type, __CONCAT(__ieee754_fmod,s), \ - (float_type __x, float_type __y)) \ -{ \ - float_type __result; \ - __asm("fmod%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x)); \ - return __result; \ -} \ - \ -__m81_defun (float_type, __CONCAT(__ieee754_scalb,s), \ - (float_type __x, float_type __n)) \ -{ \ - float_type __result; \ - __asm ("fscale%.x %1, %0" : "=f" (__result) : "f" (__n), "0" (__x)); \ - return __result; \ -} - -__internal_inline_functions (double,) -__internal_inline_functions (float,f) -__internal_inline_functions (long double,l) -#undef __internal_inline_functions - -/* Get the m68881 condition codes, to quickly check multiple conditions. */ -static __inline__ unsigned long -__m81_test (long double __val) -{ - unsigned long __fpsr; - __asm ("ftst%.x %1; fmove%.l %/fpsr,%0" : "=dm" (__fpsr) : "f" (__val)); - return __fpsr; -} - -/* Bit values returned by __m81_test. */ -#define __M81_COND_NAN (1 << 24) -#define __M81_COND_INF (2 << 24) -#define __M81_COND_ZERO (4 << 24) -#define __M81_COND_NEG (8 << 24) - -#endif /* __LIBC_M81_MATH_INLINES */ - -/* The rest of the functions are available to the user. */ - -#define __inline_functions(float_type, s) \ -__m81_inline float_type \ -__m81_u(__CONCAT(__frexp,s))(float_type __value, int *__expptr) \ -{ \ - float_type __mantissa, __exponent; \ - int __iexponent; \ - unsigned long __fpsr; \ - __asm("ftst%.x %1\n" \ - "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \ - if (__fpsr & (7 << 24)) \ - { \ - /* Not finite or zero. */ \ - *__expptr = 0; \ - return __value; \ - } \ - __asm("fgetexp%.x %1, %0" : "=f" (__exponent) : "f" (__value)); \ - __iexponent = (int) __exponent + 1; \ - *__expptr = __iexponent; \ - __asm("fscale%.l %2, %0" : "=f" (__mantissa) \ - : "0" (__value), "dmi" (-__iexponent)); \ - return __mantissa; \ -} \ - \ -__m81_defun (float_type, __CONCAT(__floor,s), (float_type __x)) \ -{ \ - float_type __result; \ - unsigned long int __ctrl_reg; \ - __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ - /* Set rounding towards negative infinity. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" ((__ctrl_reg & ~0x10) | 0x20)); \ - /* Convert X to an integer, using -Inf rounding. */ \ - __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ - /* Restore the previous rounding mode. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" (__ctrl_reg)); \ - return __result; \ -} \ - \ -__m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) \ -{ \ - float_type __result; \ - unsigned long int __ctrl_reg; \ - __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ - /* Set rounding towards positive infinity. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" (__ctrl_reg | 0x30)); \ - /* Convert X to an integer, using +Inf rounding. */ \ - __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ - /* Restore the previous rounding mode. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" (__ctrl_reg)); \ - return __result; \ -} \ - \ -__m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \ -{ \ - /* There is no branch-condition for infinity, \ - so we must extract and examine the condition codes manually. */ \ - unsigned long int __fpsr; \ - __asm("ftst%.x %1\n" \ - "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \ - return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0; \ -} \ - \ -__m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) \ -{ \ - char __result; \ - __asm("ftst%.x %1\n" \ - "fsun %0" : "=dm" (__result) : "f" (__value)); \ - return __result; \ -} \ - \ -__m81_defun (int, __CONCAT(__finite,s), (float_type __value)) \ -{ \ - /* There is no branch-condition for infinity, so we must extract and \ - examine the condition codes manually. */ \ - unsigned long int __fpsr; \ - __asm ("ftst%.x %1\n" \ - "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \ - return (__fpsr & (3 << 24)) == 0; \ -} \ - \ -__m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \ -{ \ - /* There is no branch-condition for the sign bit, so we must extract \ - and examine the condition codes manually. */ \ - unsigned long int __fpsr; \ - __asm ("ftst%.x %1\n" \ - "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \ - return (__fpsr >> 27) & 1; \ -} \ - \ -__m81_defun (int, __CONCAT(__ilogb,s), (float_type __x)) \ -{ \ - float_type __result; \ - if (__x == 0.0) \ - return 0x80000001; \ - __asm("fgetexp%.x %1, %0" : "=f" (__result) : "f" (__x)); \ - return (int) __result; \ -} \ - \ -__m81_defun (float_type, __CONCAT(__scalbn,s), (float_type __x, int __n)) \ -{ \ - float_type __result; \ - __asm ("fscale%.l %1, %0" : "=f" (__result) : "dmi" (__n), "0" (__x)); \ - return __result; \ -} \ - \ -__m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x)) \ -{ \ - float_type __result; \ - unsigned long int __ctrl_reg; \ - __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ - /* Temporarily disable the inexact exception. */ \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" (__ctrl_reg & ~0x200)); \ - __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ - __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ - : "dmi" (__ctrl_reg)); \ - return __result; \ -} \ - \ -__m81_inline void \ -__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \ - float_type *__cosx) \ -{ \ - __asm ("fsincos%.x %2,%1:%0" \ - : "=f" (*__sinx), "=f" (*__cosx) : "f" (__x)); \ -} - -/* This defines the three variants of the inline functions. */ -__inline_functions (double,) -__inline_functions (float,f) -__inline_functions (long double,l) -#undef __inline_functions - -__m81_defun (long int, __lrint, (long double __x)) -{ - long int __result; - __asm ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x)); - return __result; -} - -#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ - -/* Define inline versions of the user visible functions. */ - -#define __inline_forward_c(rettype, name, args1, args2) \ -extern __inline rettype __attribute__((__const__)) \ -name args1 \ -{ \ - return __CONCAT(__,name) args2; \ -} - -#define __inline_forward(rettype, name, args1, args2) \ -extern __inline rettype name args1 \ -{ \ - return __CONCAT(__,name) args2; \ -} - -__inline_forward(double,frexp, (double __value, int *__expptr), - (__value, __expptr)) -__inline_forward_c(double,floor, (double __x), (__x)) -__inline_forward_c(double,ceil, (double __x), (__x)) -#ifdef __USE_MISC -__inline_forward_c(int,isinf, (double __value), (__value)) -__inline_forward_c(int,finite, (double __value), (__value)) -__inline_forward_c(double,scalbn, (double __x, int __n), (__x, __n)) -#endif -#if defined __USE_MISC || defined __USE_XOPEN -#ifndef __USE_ISOC9X /* Conflict with macro of same name. */ -__inline_forward_c(int,isnan, (double __value), (__value)) -#endif -__inline_forward_c(int,ilogb, (double __value), (__value)) -#endif -#ifdef __USE_ISOC9X -__inline_forward_c(double,nearbyint, (double __value), (__value)) -#endif -#ifdef __USE_GNU -__inline_forward(void,sincos, (double __x, double *__sinx, double *__cosx), - (__x, __sinx, __cosx)) -#endif - -#if defined __USE_MISC || defined __USE_ISOC9X - -__inline_forward(float,frexpf, (float __value, int *__expptr), - (__value, __expptr)) -__inline_forward_c(float,floorf, (float __x), (__x)) -__inline_forward_c(float,ceilf, (float __x), (__x)) -#ifdef __USE_MISC -__inline_forward_c(int,isinff, (float __value), (__value)) -__inline_forward_c(int,finitef, (float __value), (__value)) -__inline_forward_c(float,scalbnf, (float __x, int __n), (__x, __n)) -__inline_forward_c(int,isnanf, (float __value), (__value)) -__inline_forward_c(int,ilogbf, (float __value), (__value)) -#endif -#ifdef __USE_ISOC9X -__inline_forward_c(float,nearbyintf, (float __value), (__value)) -#endif -#ifdef __USE_GNU -__inline_forward(void,sincosf, (float __x, float *__sinx, float *__cosx), - (__x, __sinx, __cosx)) -#endif - -__inline_forward(long double,frexpl, (long double __value, int *__expptr), - (__value, __expptr)) -__inline_forward_c(long double,floorl, (long double __x), (__x)) -__inline_forward_c(long double,ceill, (long double __x), (__x)) -#ifdef __USE_MISC -__inline_forward_c(int,isinfl, (long double __value), (__value)) -__inline_forward_c(int,finitel, (long double __value), (__value)) -__inline_forward_c(long double,scalbnl, (long double __x, int __n), - (__x, __n)) -__inline_forward_c(int,isnanl, (long double __value), (__value)) -__inline_forward_c(int,ilogbl, (long double __value), (__value)) -#endif -#ifdef __USE_ISOC9X -__inline_forward_c(long double,nearbyintl, (long double __value), (__value)) -__inline_forward_c(long int,lrint, (long double __value), (__value)) -#endif -#ifdef __USE_GNU -__inline_forward(void,sincosl, - (long double __x, long double *__sinx, long double *__cosx), - (__x, __sinx, __cosx)) -#endif - -#endif /* Use misc or ISO C9X */ - -#undef __inline_forward -#undef __inline_forward_c - -#ifdef __USE_ISOC9X - -/* ISO C 9X defines some macros to perform unordered comparisons. The - m68k FPU supports this with special opcodes and we should use them. - These must not be inline functions since we have to be able to handle - all floating-point types. */ -#undef isgreater -#define isgreater(x, y) \ - __extension__ \ - ({ char __result; \ - __asm__ ("fcmp%.x %2,%1; fsogt %0" \ - : "=dm" (__result) : "f" (x), "f" (y)); \ - (int) __result; }) - -#undef isgreaterequal -#define isgreaterequal(x, y) \ - __extension__ \ - ({ char __result; \ - __asm__ ("fcmp%.x %2,%1; fsoge %0" \ - : "=dm" (__result) : "f" (x), "f" (y)); \ - (int) __result; }) - -#undef isless -#define isless(x, y) \ - __extension__ \ - ({ char __result; \ - __asm__ ("fcmp%.x %2,%1; fsolt %0" \ - : "=dm" (__result) : "f" (x), "f" (y)); \ - (int) __result; }) - -#undef islessequal -#define islessequal(x, y) \ - __extension__ \ - ({ char __result; \ - __asm__ ("fcmp%.x %2,%1; fsole %0" \ - : "=dm" (__result) : "f" (x), "f" (y)); \ - (int) __result; }) - -#undef islessgreater -#define islessgreater(x, y) \ - __extension__ \ - ({ char __result; \ - __asm__ ("fcmp%.x %2,%1; fsogl %0" \ - : "=dm" (__result) : "f" (x), "f" (y)); \ - (int) __result; }) - -#undef isunordered -#define isunordered(x, y) \ - __extension__ \ - ({ char __result; \ - __asm__ ("fcmp%.x %2,%1; fsun %0" \ - : "=dm" (__result) : "f" (x), "f" (y)); \ - (int) __result; }) -#endif - -#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */ - -#endif /* GCC. */ diff --git a/sysdeps/m68k/fpu/bits/fenv.h b/sysdeps/m68k/fpu/bits/fenv.h new file mode 100644 index 0000000..ce071b9 --- /dev/null +++ b/sysdeps/m68k/fpu/bits/fenv.h @@ -0,0 +1,78 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FENV_H +#error "Never use directly; include instead." +#endif + + +/* Define bits representing the exception. We use the bit positions of + the appropriate bits in the FPSR Accrued Exception Byte. */ +enum + { + FE_INEXACT = 1 << 3, +#define FE_INEXACT FE_INEXACT + FE_DIVBYZERO = 1 << 4, +#define FE_DIVBYZERO FE_DIVBYZERO + FE_UNDERFLOW = 1 << 5, +#define FE_UNDERFLOW FE_UNDERFLOW + FE_OVERFLOW = 1 << 6, +#define FE_OVERFLOW FE_OVERFLOW + FE_INVALID = 1 << 7 +#define FE_INVALID FE_INVALID + }; + +#define FE_ALL_EXCEPT \ + (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) + +/* The m68k FPU supports all of the four defined rounding modes. We use + the bit positions in the FPCR Mode Control Byte as the values for the + appropriate macros. */ +enum + { + FE_TONEAREST = 0, +#define FE_TONEAREST FE_TONEAREST + FE_TOWARDSZERO = 1 << 4, +#define FE_TOWARDSZERO FE_TOWARDSZERO + FE_DOWNWARD = 2 << 4, +#define FE_DOWNWARD FE_DOWNWARD + FE_UPWARD = 3 << 4 +#define FE_UPWARD FE_UPWARD + }; + + +/* Type representing exception flags. */ +typedef unsigned int fexcept_t; + + +/* Type representing floating-point environment. This structure + corresponds to the layout of the block written by `fmovem'. */ +typedef struct + { + fexcept_t control_register; + fexcept_t status_register; + } +fenv_t; + +/* If the default argument is used we use this value. */ +#define FE_DFL_ENV ((fenv_t *) -1) + +#ifdef __USE_GNU +/* Floating-point environment where none of the exceptions are masked. */ +# define FE_NOMASK_ENV ((fenv_t *) -2) +#endif diff --git a/sysdeps/m68k/fpu/bits/mathdef.h b/sysdeps/m68k/fpu/bits/mathdef.h new file mode 100644 index 0000000..4d07176 --- /dev/null +++ b/sysdeps/m68k/fpu/bits/mathdef.h @@ -0,0 +1,36 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _MATH_H +#error "Never use directly; include instead" +#endif + + +/* The m68k FPUs evaluate all values in the 96 bit floating-point format + which is also available for the user as `long double'. Therefore we + define: */ +typedef long double float_t; /* `float' expressions are evaluated as + `long double'. */ +typedef long double double_t; /* `double' expressions are evaluated as + `long double'. */ + +/* Signal that both types are `long double'. */ +#define FLT_EVAL_METHOD 2 + +/* Define `INFINITY' as value of type `float_t'. */ +#define INFINITY HUGE_VALL diff --git a/sysdeps/m68k/fpu/bits/mathinline.h b/sysdeps/m68k/fpu/bits/mathinline.h new file mode 100644 index 0000000..bdeaa9e --- /dev/null +++ b/sysdeps/m68k/fpu/bits/mathinline.h @@ -0,0 +1,464 @@ +/* Definitions of inline math functions implemented by the m68881/2. + Copyright (C) 1991, 92, 93, 94, 96, 97 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifdef __GNUC__ + +#include + +#ifdef __LIBC_M81_MATH_INLINES +/* This is used when defining the functions themselves. Define them with + __ names, and with `static inline' instead of `extern inline' so the + bodies will always be used, never an external function call. */ +#define __m81_u(x) __CONCAT(__,x) +#define __m81_inline static __inline +#else +#define __m81_u(x) x +#define __m81_inline extern __inline +#define __M81_MATH_INLINES 1 +#endif + +/* Define a const math function. */ +#define __m81_defun(rettype, func, args) \ + __m81_inline rettype __attribute__((__const__)) \ + __m81_u(func) args + +/* Define the three variants of a math function that has a direct + implementation in the m68k fpu. FUNC is the name for C (which will be + suffixed with f and l for the float and long double version, resp). OP + is the name of the fpu operation (without leading f). */ + +#if defined __USE_MISC || defined __USE_ISOC9X +#define __inline_mathop(func, op) \ + __inline_mathop1(double, func, op) \ + __inline_mathop1(float, __CONCAT(func,f), op) \ + __inline_mathop1(long double, __CONCAT(func,l), op) +#else +#define __inline_mathop(func, op) \ + __inline_mathop1(double, func, op) +#endif + +#define __inline_mathop1(float_type,func, op) \ + __m81_defun (float_type, func, (float_type __mathop_x)) \ + { \ + float_type __result; \ + __asm("f" __STRING(op) "%.x %1, %0" : "=f" (__result) : "f" (__mathop_x));\ + return __result; \ + } + +#ifdef __LIBC_M81_MATH_INLINES +/* ieee style elementary functions */ +/* These are internal to the implementation of libm. */ +__inline_mathop(__ieee754_acos, acos) +__inline_mathop(__ieee754_asin, asin) +__inline_mathop(__ieee754_cosh, cosh) +__inline_mathop(__ieee754_sinh, sinh) +__inline_mathop(__ieee754_exp, etox) +__inline_mathop(__ieee754_log10, log10) +__inline_mathop(__ieee754_log, logn) +__inline_mathop(__ieee754_sqrt, sqrt) +__inline_mathop(__ieee754_atanh, atanh) +#endif + +__inline_mathop(__atan, atan) +__inline_mathop(__cos, cos) +__inline_mathop(__sin, sin) +__inline_mathop(__tan, tan) +__inline_mathop(__tanh, tanh) +__inline_mathop(__fabs, abs) + +__inline_mathop(__rint, int) +__inline_mathop(__expm1, etoxm1) +__inline_mathop(__log1p, lognp1) +__inline_mathop(__significand, getman) + +__inline_mathop(__log2, log2) +__inline_mathop(__exp2, twotox) +__inline_mathop(__trunc, intrz) + +#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ + +__inline_mathop(atan, atan) +__inline_mathop(cos, cos) +__inline_mathop(sin, sin) +__inline_mathop(tan, tan) +__inline_mathop(tanh, tanh) + +#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC9X +__inline_mathop(rint, int) +__inline_mathop(expm1, etoxm1) +__inline_mathop(log1p, lognp1) +#endif + +#ifdef __USE_MISC +__inline_mathop(significand, getman) +#endif + +#ifdef __USE_ISOC9X +__inline_mathop(log2, log2) +__inline_mathop(exp2, twotox) +__inline_mathop(trunc, intrz) +#endif + +#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */ + +/* This macro contains the definition for the rest of the inline + functions, using __FLOAT_TYPE as the domain type and __S as the suffix + for the function names. */ + +#ifdef __LIBC_M81_MATH_INLINES +/* Internally used functions. */ +#define __internal_inline_functions(float_type, s) \ +__m81_defun (float_type, __CONCAT(__ieee754_remainder,s), \ + (float_type __x, float_type __y)) \ +{ \ + float_type __result; \ + __asm("frem%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x)); \ + return __result; \ +} \ + \ +__m81_defun (float_type, __CONCAT(__ieee754_fmod,s), \ + (float_type __x, float_type __y)) \ +{ \ + float_type __result; \ + __asm("fmod%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x)); \ + return __result; \ +} \ + \ +__m81_defun (float_type, __CONCAT(__ieee754_scalb,s), \ + (float_type __x, float_type __n)) \ +{ \ + float_type __result; \ + __asm ("fscale%.x %1, %0" : "=f" (__result) : "f" (__n), "0" (__x)); \ + return __result; \ +} + +__internal_inline_functions (double,) +__internal_inline_functions (float,f) +__internal_inline_functions (long double,l) +#undef __internal_inline_functions + +/* Get the m68881 condition codes, to quickly check multiple conditions. */ +static __inline__ unsigned long +__m81_test (long double __val) +{ + unsigned long __fpsr; + __asm ("ftst%.x %1; fmove%.l %/fpsr,%0" : "=dm" (__fpsr) : "f" (__val)); + return __fpsr; +} + +/* Bit values returned by __m81_test. */ +#define __M81_COND_NAN (1 << 24) +#define __M81_COND_INF (2 << 24) +#define __M81_COND_ZERO (4 << 24) +#define __M81_COND_NEG (8 << 24) + +#endif /* __LIBC_M81_MATH_INLINES */ + +/* The rest of the functions are available to the user. */ + +#define __inline_functions(float_type, s) \ +__m81_inline float_type \ +__m81_u(__CONCAT(__frexp,s))(float_type __value, int *__expptr) \ +{ \ + float_type __mantissa, __exponent; \ + int __iexponent; \ + unsigned long __fpsr; \ + __asm("ftst%.x %1\n" \ + "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \ + if (__fpsr & (7 << 24)) \ + { \ + /* Not finite or zero. */ \ + *__expptr = 0; \ + return __value; \ + } \ + __asm("fgetexp%.x %1, %0" : "=f" (__exponent) : "f" (__value)); \ + __iexponent = (int) __exponent + 1; \ + *__expptr = __iexponent; \ + __asm("fscale%.l %2, %0" : "=f" (__mantissa) \ + : "0" (__value), "dmi" (-__iexponent)); \ + return __mantissa; \ +} \ + \ +__m81_defun (float_type, __CONCAT(__floor,s), (float_type __x)) \ +{ \ + float_type __result; \ + unsigned long int __ctrl_reg; \ + __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ + /* Set rounding towards negative infinity. */ \ + __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + : "dmi" ((__ctrl_reg & ~0x10) | 0x20)); \ + /* Convert X to an integer, using -Inf rounding. */ \ + __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ + /* Restore the previous rounding mode. */ \ + __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + : "dmi" (__ctrl_reg)); \ + return __result; \ +} \ + \ +__m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) \ +{ \ + float_type __result; \ + unsigned long int __ctrl_reg; \ + __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ + /* Set rounding towards positive infinity. */ \ + __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + : "dmi" (__ctrl_reg | 0x30)); \ + /* Convert X to an integer, using +Inf rounding. */ \ + __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ + /* Restore the previous rounding mode. */ \ + __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + : "dmi" (__ctrl_reg)); \ + return __result; \ +} \ + \ +__m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \ +{ \ + /* There is no branch-condition for infinity, \ + so we must extract and examine the condition codes manually. */ \ + unsigned long int __fpsr; \ + __asm("ftst%.x %1\n" \ + "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \ + return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0; \ +} \ + \ +__m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) \ +{ \ + char __result; \ + __asm("ftst%.x %1\n" \ + "fsun %0" : "=dm" (__result) : "f" (__value)); \ + return __result; \ +} \ + \ +__m81_defun (int, __CONCAT(__finite,s), (float_type __value)) \ +{ \ + /* There is no branch-condition for infinity, so we must extract and \ + examine the condition codes manually. */ \ + unsigned long int __fpsr; \ + __asm ("ftst%.x %1\n" \ + "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \ + return (__fpsr & (3 << 24)) == 0; \ +} \ + \ +__m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \ +{ \ + /* There is no branch-condition for the sign bit, so we must extract \ + and examine the condition codes manually. */ \ + unsigned long int __fpsr; \ + __asm ("ftst%.x %1\n" \ + "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \ + return (__fpsr >> 27) & 1; \ +} \ + \ +__m81_defun (int, __CONCAT(__ilogb,s), (float_type __x)) \ +{ \ + float_type __result; \ + if (__x == 0.0) \ + return 0x80000001; \ + __asm("fgetexp%.x %1, %0" : "=f" (__result) : "f" (__x)); \ + return (int) __result; \ +} \ + \ +__m81_defun (float_type, __CONCAT(__scalbn,s), (float_type __x, int __n)) \ +{ \ + float_type __result; \ + __asm ("fscale%.l %1, %0" : "=f" (__result) : "dmi" (__n), "0" (__x)); \ + return __result; \ +} \ + \ +__m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x)) \ +{ \ + float_type __result; \ + unsigned long int __ctrl_reg; \ + __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \ + /* Temporarily disable the inexact exception. */ \ + __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + : "dmi" (__ctrl_reg & ~0x200)); \ + __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \ + __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ + : "dmi" (__ctrl_reg)); \ + return __result; \ +} \ + \ +__m81_inline void \ +__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \ + float_type *__cosx) \ +{ \ + __asm ("fsincos%.x %2,%1:%0" \ + : "=f" (*__sinx), "=f" (*__cosx) : "f" (__x)); \ +} + +/* This defines the three variants of the inline functions. */ +__inline_functions (double,) +__inline_functions (float,f) +__inline_functions (long double,l) +#undef __inline_functions + +__m81_defun (long int, __lrint, (long double __x)) +{ + long int __result; + __asm ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x)); + return __result; +} + +#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ + +/* Define inline versions of the user visible functions. */ + +#define __inline_forward_c(rettype, name, args1, args2) \ +extern __inline rettype __attribute__((__const__)) \ +name args1 \ +{ \ + return __CONCAT(__,name) args2; \ +} + +#define __inline_forward(rettype, name, args1, args2) \ +extern __inline rettype name args1 \ +{ \ + return __CONCAT(__,name) args2; \ +} + +__inline_forward(double,frexp, (double __value, int *__expptr), + (__value, __expptr)) +__inline_forward_c(double,floor, (double __x), (__x)) +__inline_forward_c(double,ceil, (double __x), (__x)) +#ifdef __USE_MISC +__inline_forward_c(int,isinf, (double __value), (__value)) +__inline_forward_c(int,finite, (double __value), (__value)) +__inline_forward_c(double,scalbn, (double __x, int __n), (__x, __n)) +#endif +#if defined __USE_MISC || defined __USE_XOPEN +#ifndef __USE_ISOC9X /* Conflict with macro of same name. */ +__inline_forward_c(int,isnan, (double __value), (__value)) +#endif +__inline_forward_c(int,ilogb, (double __value), (__value)) +#endif +#ifdef __USE_ISOC9X +__inline_forward_c(double,nearbyint, (double __value), (__value)) +#endif +#ifdef __USE_GNU +__inline_forward(void,sincos, (double __x, double *__sinx, double *__cosx), + (__x, __sinx, __cosx)) +#endif + +#if defined __USE_MISC || defined __USE_ISOC9X + +__inline_forward(float,frexpf, (float __value, int *__expptr), + (__value, __expptr)) +__inline_forward_c(float,floorf, (float __x), (__x)) +__inline_forward_c(float,ceilf, (float __x), (__x)) +#ifdef __USE_MISC +__inline_forward_c(int,isinff, (float __value), (__value)) +__inline_forward_c(int,finitef, (float __value), (__value)) +__inline_forward_c(float,scalbnf, (float __x, int __n), (__x, __n)) +__inline_forward_c(int,isnanf, (float __value), (__value)) +__inline_forward_c(int,ilogbf, (float __value), (__value)) +#endif +#ifdef __USE_ISOC9X +__inline_forward_c(float,nearbyintf, (float __value), (__value)) +#endif +#ifdef __USE_GNU +__inline_forward(void,sincosf, (float __x, float *__sinx, float *__cosx), + (__x, __sinx, __cosx)) +#endif + +__inline_forward(long double,frexpl, (long double __value, int *__expptr), + (__value, __expptr)) +__inline_forward_c(long double,floorl, (long double __x), (__x)) +__inline_forward_c(long double,ceill, (long double __x), (__x)) +#ifdef __USE_MISC +__inline_forward_c(int,isinfl, (long double __value), (__value)) +__inline_forward_c(int,finitel, (long double __value), (__value)) +__inline_forward_c(long double,scalbnl, (long double __x, int __n), + (__x, __n)) +__inline_forward_c(int,isnanl, (long double __value), (__value)) +__inline_forward_c(int,ilogbl, (long double __value), (__value)) +#endif +#ifdef __USE_ISOC9X +__inline_forward_c(long double,nearbyintl, (long double __value), (__value)) +__inline_forward_c(long int,lrint, (long double __value), (__value)) +#endif +#ifdef __USE_GNU +__inline_forward(void,sincosl, + (long double __x, long double *__sinx, long double *__cosx), + (__x, __sinx, __cosx)) +#endif + +#endif /* Use misc or ISO C9X */ + +#undef __inline_forward +#undef __inline_forward_c + +#ifdef __USE_ISOC9X + +/* ISO C 9X defines some macros to perform unordered comparisons. The + m68k FPU supports this with special opcodes and we should use them. + These must not be inline functions since we have to be able to handle + all floating-point types. */ +#undef isgreater +#define isgreater(x, y) \ + __extension__ \ + ({ char __result; \ + __asm__ ("fcmp%.x %2,%1; fsogt %0" \ + : "=dm" (__result) : "f" (x), "f" (y)); \ + (int) __result; }) + +#undef isgreaterequal +#define isgreaterequal(x, y) \ + __extension__ \ + ({ char __result; \ + __asm__ ("fcmp%.x %2,%1; fsoge %0" \ + : "=dm" (__result) : "f" (x), "f" (y)); \ + (int) __result; }) + +#undef isless +#define isless(x, y) \ + __extension__ \ + ({ char __result; \ + __asm__ ("fcmp%.x %2,%1; fsolt %0" \ + : "=dm" (__result) : "f" (x), "f" (y)); \ + (int) __result; }) + +#undef islessequal +#define islessequal(x, y) \ + __extension__ \ + ({ char __result; \ + __asm__ ("fcmp%.x %2,%1; fsole %0" \ + : "=dm" (__result) : "f" (x), "f" (y)); \ + (int) __result; }) + +#undef islessgreater +#define islessgreater(x, y) \ + __extension__ \ + ({ char __result; \ + __asm__ ("fcmp%.x %2,%1; fsogl %0" \ + : "=dm" (__result) : "f" (x), "f" (y)); \ + (int) __result; }) + +#undef isunordered +#define isunordered(x, y) \ + __extension__ \ + ({ char __result; \ + __asm__ ("fcmp%.x %2,%1; fsun %0" \ + : "=dm" (__result) : "f" (x), "f" (y)); \ + (int) __result; }) +#endif + +#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */ + +#endif /* GCC. */ diff --git a/sysdeps/m68k/fpu/fenvbits.h b/sysdeps/m68k/fpu/fenvbits.h deleted file mode 100644 index b653b1a..0000000 --- a/sysdeps/m68k/fpu/fenvbits.h +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This file should never be included directly. */ - -#ifndef _FENVBITS_H -#define _FENVBITS_H 1 - -/* Define bits representing the exception. We use the bit positions of - the appropriate bits in the FPSR Accrued Exception Byte. */ -enum - { - FE_INEXACT = 1 << 3, -#define FE_INEXACT FE_INEXACT - FE_DIVBYZERO = 1 << 4, -#define FE_DIVBYZERO FE_DIVBYZERO - FE_UNDERFLOW = 1 << 5, -#define FE_UNDERFLOW FE_UNDERFLOW - FE_OVERFLOW = 1 << 6, -#define FE_OVERFLOW FE_OVERFLOW - FE_INVALID = 1 << 7 -#define FE_INVALID FE_INVALID - }; - -#define FE_ALL_EXCEPT \ - (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) - -/* The m68k FPU supports all of the four defined rounding modes. We use - the bit positions in the FPCR Mode Control Byte as the values for the - appropriate macros. */ -enum - { - FE_TONEAREST = 0, -#define FE_TONEAREST FE_TONEAREST - FE_TOWARDSZERO = 1 << 4, -#define FE_TOWARDSZERO FE_TOWARDSZERO - FE_DOWNWARD = 2 << 4, -#define FE_DOWNWARD FE_DOWNWARD - FE_UPWARD = 3 << 4 -#define FE_UPWARD FE_UPWARD - }; - - -/* Type representing exception flags. */ -typedef unsigned int fexcept_t; - - -/* Type representing floating-point environment. This structure - corresponds to the layout of the block written by `fmovem'. */ -typedef struct - { - fexcept_t control_register; - fexcept_t status_register; - } -fenv_t; - -/* If the default argument is used we use this value. */ -#define FE_DFL_ENV ((fenv_t *) -1) - -#ifdef __USE_GNU -/* Floating-point environment where none of the exceptions are masked. */ -# define FE_NOMASK_ENV ((fenv_t *) -2) -#endif - -#endif /* fenvbits.h */ diff --git a/sysdeps/m68k/fpu/mathbits.h b/sysdeps/m68k/fpu/mathbits.h deleted file mode 100644 index 0496623..0000000 --- a/sysdeps/m68k/fpu/mathbits.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _MATHBITS_H -#define _MATHBITS_H 1 - -/* The m68k FPUs evaluate all values in the 96 bit floating-point format - which is also available for the user as `long double'. Therefore we - define: */ -typedef long double float_t; /* `float' expressions are evaluated as - `long double'. */ -typedef long double double_t; /* `double' expressions are evaluated as - `long double'. */ - -/* Signal that both types are `long double'. */ -#define FLT_EVAL_METHOD 2 - -/* Define `INFINITY' as value of type `float_t'. */ -#define INFINITY HUGE_VALL - -#endif /* mathbits.h */ diff --git a/sysdeps/m68k/fpu/switch/__math.h b/sysdeps/m68k/fpu/switch/__math.h deleted file mode 100644 index c0f6966..0000000 --- a/sysdeps/m68k/fpu/switch/__math.h +++ /dev/null @@ -1 +0,0 @@ -/* We don't want any inlines when we might not have a 68881. */ diff --git a/sysdeps/m68k/fpu/switch/bits/mathinline.h b/sysdeps/m68k/fpu/switch/bits/mathinline.h new file mode 100644 index 0000000..c0f6966 --- /dev/null +++ b/sysdeps/m68k/fpu/switch/bits/mathinline.h @@ -0,0 +1 @@ +/* We don't want any inlines when we might not have a 68881. */ diff --git a/sysdeps/m68k/huge_val.h b/sysdeps/m68k/huge_val.h deleted file mode 100644 index c71454e..0000000 --- a/sysdeps/m68k/huge_val.h +++ /dev/null @@ -1,75 +0,0 @@ -/* `HUGE_VAL' constants for m68k (where it is infinity). - Used by and functions for overflow. - Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _HUGE_VAL_H -#define _HUGE_VAL_H 1 - -#include -#include - -/* IEEE positive infinity (-HUGE_VAL is negative infinity). */ - -#ifdef __GNUC__ - -#define HUGE_VAL \ - (__extension__ \ - ((union { unsigned long long __l; double __d; }) \ - { __l: 0x7ff0000000000000ULL }).__d) - -#else /* not GCC */ - -static union { unsigned char __c[8]; double __d; } __huge_val = - { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } }; -#define HUGE_VAL (__huge_val.__d) - -#endif /* GCC. */ - - -/* ISO C 9X extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */ - -#ifdef __USE_ISOC9X - -#ifdef __GNUC__ - -#define HUGE_VALF \ - (__extension__ \ - ((union { unsigned long __l; float __f; }) \ - { __l: 0x7f800000UL }).__f) - -#define HUGE_VALL \ - (__extension__ \ - ((union { unsigned long __l[3]; long double __ld; }) \ - { __l: { 0x7fff0000UL, 0x80000000UL, 0UL } }).__ld) - -#else /* not GCC */ - -static union { unsigned char __c[4]; float __f; } __huge_valf = - { { 0x7f, 0x80, 0, 0 } }; -#define HUGE_VALF (__huge_valf.__f) - -static union { unsigned char __c[12]; long double __ld; } __huge_vall = - { { 0x7f, 0xff, 0, 0, 0x80, 0, 0, 0, 0, 0, 0, 0 } }; -#define HUGE_VALL (__huge_vall.__ld) - -#endif /* GCC. */ - -#endif /* __USE_ISOC9X. */ - -#endif /* huge_val.h */ diff --git a/sysdeps/m68k/jmp_buf.h b/sysdeps/m68k/jmp_buf.h deleted file mode 100644 index 96240f0..0000000 --- a/sysdeps/m68k/jmp_buf.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Define the machine-dependent type `jmp_buf'. m68k version. */ - -typedef struct - { - /* There are eight 4-byte data registers, but D0 is not saved. */ - long int __dregs[7]; - - /* There are six 4-byte address registers, plus the FP and SP. */ - int *__aregs[6]; - int * __fp; - int * __sp; - -#if defined(__HAVE_68881__) || defined(__HAVE_FPU__) - /* There are eight floating point registers which - are saved in IEEE 96-bit extended format. */ - char __fpregs[8 * (96 / 8)]; -#endif - - } __jmp_buf[1]; diff --git a/sysdeps/mach/bits/libc-lock.h b/sysdeps/mach/bits/libc-lock.h new file mode 100644 index 0000000..f3ce23a --- /dev/null +++ b/sysdeps/mach/bits/libc-lock.h @@ -0,0 +1,90 @@ +/* libc-internal interface for mutex locks. Mach cthreads version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _BITS_LIBC_LOCK_H +#define _BITS_LIBC_LOCK_H 1 + +#ifdef _LIBC +#include +#define __libc_lock_t struct mutex +#else +typedef struct __libc_lock_opaque__ __libc_lock_t; +#endif + +/* Define a lock variable NAME with storage class CLASS. The lock must be + initialized with __libc_lock_init before it can be used (or define it + with __libc_lock_define_initialized, below). Use `extern' for CLASS to + declare a lock defined in another module. In public structure + definitions you must use a pointer to the lock structure (i.e., NAME + begins with a `*'), because its storage size will not be known outside + of libc. */ +#define __libc_lock_define(CLASS,NAME) \ + CLASS __libc_lock_t NAME; + +/* Define an initialized lock variable NAME with storage class CLASS. */ +#define __libc_lock_define_initialized(CLASS,NAME) \ + CLASS __libc_lock_t NAME = MUTEX_INITIALIZER; + +/* Initialize the named lock variable, leaving it in a consistent, unlocked + state. */ +#define __libc_lock_init(NAME) __mutex_init (&(NAME)) + +/* Finalize the named lock variable, which must be locked. It cannot be + used again until __libc_lock_init is called again on it. This must be + called on a lock variable before the containing storage is reused. */ +#define __libc_lock_fini(NAME) __mutex_unlock (&(NAME)) + +/* Lock the named lock variable. */ +#define __libc_lock_lock(NAME) __mutex_lock (&(NAME)) + +/* Lock the named lock variable. */ +#define __libc_lock_trylock(NAME) (!__mutex_trylock (&(NAME))) + +/* Unlock the named lock variable. */ +#define __libc_lock_unlock(NAME) __mutex_unlock (&(NAME)) + +/* Start a critical region with a cleanup function */ +#define __libc_cleanup_region_start(FCT, ARG) \ +{ \ + typeof (FCT) __save_FCT = FCT; \ + typeof (ARG) __save_ARG = ARG; \ + /* close brace is in __libc_cleanup_region_end below. */ + +/* End a critical region started with __libc_cleanup_region_start. */ +#define __libc_cleanup_region_end(DOIT) \ + if (DOIT) \ + (*__save_FCT)(__save_ARG); \ +} + + +#ifdef _LIBC +/* We need portable names for some functions. E.g., when they are + used as argument to __libc_cleanup_region_start. */ +#define __libc_mutex_unlock __mutex_unlock +#endif + +/* XXX until cthreads supports recursive locks */ +#define __libc_lock_define_initialized_recursive __libc_lock_define_initialized +#define __libc_lock_init_recursive __libc_lock_init +#define __libc_lock_fini_recursive __libc_lock_fini +#define __libc_lock_trylock_recursive __libc_lock_trylock +#define __libc_lock_unlock_recursive __libc_lock_unlock +#define __libc_lock_lock_recursive __libc_lock_lock + +#endif /* bits/libc-lock.h */ diff --git a/sysdeps/mach/hurd/alpha/bits/sigcontext.h b/sysdeps/mach/hurd/alpha/bits/sigcontext.h new file mode 100644 index 0000000..32e0c94 --- /dev/null +++ b/sysdeps/mach/hurd/alpha/bits/sigcontext.h @@ -0,0 +1,65 @@ +/* Machine-dependent signal context structure for GNU Hurd. Alpha version. +Copyright (C) 1994 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 Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* Signal handlers are actually called: + void handler (int sig, int code, struct sigcontext *scp); */ + +/* State of this thread when the signal was taken. */ +struct sigcontext + { + /* These first members are machine-independent. */ + + long int sc_onstack; /* Nonzero if running on sigstack. */ + __sigset_t sc_mask; /* Blocked signals to restore. */ + + /* MiG reply port this thread is using. */ + unsigned long int sc_reply_port; + + /* Port this thread is doing an interruptible RPC on. */ + unsigned long int sc_intr_port; + + /* Error code associated with this signal (interpreted as `error_t'). */ + int sc_error; + + /* All following members are machine-dependent. The rest of this + structure is written to be laid out identically to: + { + struct alpha_thread_state basic; + struct alpha_exc_state exc; + struct alpha_float_state fpu; + } + trampoline.c knows this, so it must be changed if this changes. */ + +#define sc_alpha_thread_state sc_regs /* Beginning of correspondence. */ + long int sc_regs[31]; /* General registers $0..$30. */ + long int sc_pc; /* Program counter. */ + + /* struct alpha_exc_state */ +#define sc_alpha_exc_state sc_badvaddr + unsigned long int sc_badvaddr; + unsigned int sc_cause; /* Machine-level trap code. */ +#define SC_CAUSE_SET_SSTEP 1 + int sc_used_fpa; /* Nonzero if FPU was used. */ + + /* struct alpha_float_state + This is only filled in if sc_used_fpa is nonzero. */ +#define sc_alpha_float_state sc_fpregs + double sc_fpregs[31]; /* Floating point registers $f0..$f30. */ + long int sc_fpcsr; /* Floating point control/status register. */ + }; diff --git a/sysdeps/mach/hurd/alpha/sigcontext.h b/sysdeps/mach/hurd/alpha/sigcontext.h deleted file mode 100644 index 32e0c94..0000000 --- a/sysdeps/mach/hurd/alpha/sigcontext.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Machine-dependent signal context structure for GNU Hurd. Alpha version. -Copyright (C) 1994 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 Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* Signal handlers are actually called: - void handler (int sig, int code, struct sigcontext *scp); */ - -/* State of this thread when the signal was taken. */ -struct sigcontext - { - /* These first members are machine-independent. */ - - long int sc_onstack; /* Nonzero if running on sigstack. */ - __sigset_t sc_mask; /* Blocked signals to restore. */ - - /* MiG reply port this thread is using. */ - unsigned long int sc_reply_port; - - /* Port this thread is doing an interruptible RPC on. */ - unsigned long int sc_intr_port; - - /* Error code associated with this signal (interpreted as `error_t'). */ - int sc_error; - - /* All following members are machine-dependent. The rest of this - structure is written to be laid out identically to: - { - struct alpha_thread_state basic; - struct alpha_exc_state exc; - struct alpha_float_state fpu; - } - trampoline.c knows this, so it must be changed if this changes. */ - -#define sc_alpha_thread_state sc_regs /* Beginning of correspondence. */ - long int sc_regs[31]; /* General registers $0..$30. */ - long int sc_pc; /* Program counter. */ - - /* struct alpha_exc_state */ -#define sc_alpha_exc_state sc_badvaddr - unsigned long int sc_badvaddr; - unsigned int sc_cause; /* Machine-level trap code. */ -#define SC_CAUSE_SET_SSTEP 1 - int sc_used_fpa; /* Nonzero if FPU was used. */ - - /* struct alpha_float_state - This is only filled in if sc_used_fpa is nonzero. */ -#define sc_alpha_float_state sc_fpregs - double sc_fpregs[31]; /* Floating point registers $f0..$f30. */ - long int sc_fpcsr; /* Floating point control/status register. */ - }; diff --git a/sysdeps/mach/hurd/bits/errno.h b/sysdeps/mach/hurd/bits/errno.h new file mode 100644 index 0000000..beb35ec --- /dev/null +++ b/sysdeps/mach/hurd/bits/errno.h @@ -0,0 +1,316 @@ +/* This file generated by errnos.awk. */ + +/* The Hurd uses Mach error system 0x10, currently only subsystem 0. */ +#ifndef _HURD_ERRNO +#define _HURD_ERRNO(n) ((0x10 << 26) | ((n) & 0x3fff)) +#endif + +#ifdef _ERRNO_H + +enum __error_t_codes +{ +#undef EDOM +#undef ERANGE + EPERM = _HURD_ERRNO (1), +#define EPERM _HURD_ERRNO (1) /* Operation not permitted */ + ENOENT = _HURD_ERRNO (2), +#define ENOENT _HURD_ERRNO (2) /* No such file or directory */ + ESRCH = _HURD_ERRNO (3), +#define ESRCH _HURD_ERRNO (3) /* No such process */ + EINTR = _HURD_ERRNO (4), +#define EINTR _HURD_ERRNO (4) /* Interrupted system call */ + EIO = _HURD_ERRNO (5), +#define EIO _HURD_ERRNO (5) /* Input/output error */ + ENXIO = _HURD_ERRNO (6), +#define ENXIO _HURD_ERRNO (6) /* Device not configured */ + E2BIG = _HURD_ERRNO (7), +#define E2BIG _HURD_ERRNO (7) /* Argument list too long */ + ENOEXEC = _HURD_ERRNO (8), +#define ENOEXEC _HURD_ERRNO (8) /* Exec format error */ + EBADF = _HURD_ERRNO (9), +#define EBADF _HURD_ERRNO (9) /* Bad file descriptor */ + ECHILD = _HURD_ERRNO (10), +#define ECHILD _HURD_ERRNO (10)/* No child processes */ + EDEADLK = _HURD_ERRNO (11), +#define EDEADLK _HURD_ERRNO (11)/* Resource deadlock avoided */ + ENOMEM = _HURD_ERRNO (12), +#define ENOMEM _HURD_ERRNO (12)/* Cannot allocate memory */ + EACCES = _HURD_ERRNO (13), +#define EACCES _HURD_ERRNO (13)/* Permission denied */ + EFAULT = _HURD_ERRNO (14), +#define EFAULT _HURD_ERRNO (14)/* Bad address */ + ENOTBLK = _HURD_ERRNO (15), +#define ENOTBLK _HURD_ERRNO (15)/* Block device required */ + EBUSY = _HURD_ERRNO (16), +#define EBUSY _HURD_ERRNO (16)/* Device or resource busy */ + EEXIST = _HURD_ERRNO (17), +#define EEXIST _HURD_ERRNO (17)/* File exists */ + EXDEV = _HURD_ERRNO (18), +#define EXDEV _HURD_ERRNO (18)/* Invalid cross-device link */ + ENODEV = _HURD_ERRNO (19), +#define ENODEV _HURD_ERRNO (19)/* Operation not supported by device */ + ENOTDIR = _HURD_ERRNO (20), +#define ENOTDIR _HURD_ERRNO (20)/* Not a directory */ + EISDIR = _HURD_ERRNO (21), +#define EISDIR _HURD_ERRNO (21)/* Is a directory */ + EINVAL = _HURD_ERRNO (22), +#define EINVAL _HURD_ERRNO (22)/* Invalid argument */ + EMFILE = _HURD_ERRNO (24), +#define EMFILE _HURD_ERRNO (24)/* Too many open files */ + ENFILE = _HURD_ERRNO (23), +#define ENFILE _HURD_ERRNO (23)/* Too many open files in system */ + ENOTTY = _HURD_ERRNO (25), +#define ENOTTY _HURD_ERRNO (25)/* Inappropriate ioctl for device */ + ETXTBSY = _HURD_ERRNO (26), +#define ETXTBSY _HURD_ERRNO (26)/* Text file busy */ + EFBIG = _HURD_ERRNO (27), +#define EFBIG _HURD_ERRNO (27)/* File too large */ + ENOSPC = _HURD_ERRNO (28), +#define ENOSPC _HURD_ERRNO (28)/* No space left on device */ + ESPIPE = _HURD_ERRNO (29), +#define ESPIPE _HURD_ERRNO (29)/* Illegal seek */ + EROFS = _HURD_ERRNO (30), +#define EROFS _HURD_ERRNO (30)/* Read-only file system */ + EMLINK = _HURD_ERRNO (31), +#define EMLINK _HURD_ERRNO (31)/* Too many links */ + EPIPE = _HURD_ERRNO (32), +#define EPIPE _HURD_ERRNO (32)/* Broken pipe */ + EDOM = _HURD_ERRNO (33), +#define EDOM _HURD_ERRNO (33)/* Numerical argument out of domain */ + ERANGE = _HURD_ERRNO (34), +#define ERANGE _HURD_ERRNO (34)/* Numerical result out of range */ + EAGAIN = _HURD_ERRNO (35), +#define EAGAIN _HURD_ERRNO (35)/* Resource temporarily unavailable */ +#define EWOULDBLOCK EAGAIN /* Operation would block */ + EINPROGRESS = _HURD_ERRNO (36), +#define EINPROGRESS _HURD_ERRNO (36)/* Operation now in progress */ + EALREADY = _HURD_ERRNO (37), +#define EALREADY _HURD_ERRNO (37)/* Operation already in progress */ + ENOTSOCK = _HURD_ERRNO (38), +#define ENOTSOCK _HURD_ERRNO (38)/* Socket operation on non-socket */ + EMSGSIZE = _HURD_ERRNO (40), +#define EMSGSIZE _HURD_ERRNO (40)/* Message too long */ + EPROTOTYPE = _HURD_ERRNO (41), +#define EPROTOTYPE _HURD_ERRNO (41)/* Protocol wrong type for socket */ + ENOPROTOOPT = _HURD_ERRNO (42), +#define ENOPROTOOPT _HURD_ERRNO (42)/* Protocol not available */ + EPROTONOSUPPORT = _HURD_ERRNO (43), +#define EPROTONOSUPPORT _HURD_ERRNO (43)/* Protocol not supported */ + ESOCKTNOSUPPORT = _HURD_ERRNO (44), +#define ESOCKTNOSUPPORT _HURD_ERRNO (44)/* Socket type not supported */ + EOPNOTSUPP = _HURD_ERRNO (45), +#define EOPNOTSUPP _HURD_ERRNO (45)/* Operation not supported */ + EPFNOSUPPORT = _HURD_ERRNO (46), +#define EPFNOSUPPORT _HURD_ERRNO (46)/* Protocol family not supported */ + EAFNOSUPPORT = _HURD_ERRNO (47), +#define EAFNOSUPPORT _HURD_ERRNO (47)/* Address family not supported by protocol */ + EADDRINUSE = _HURD_ERRNO (48), +#define EADDRINUSE _HURD_ERRNO (48)/* Address already in use */ + EADDRNOTAVAIL = _HURD_ERRNO (49), +#define EADDRNOTAVAIL _HURD_ERRNO (49)/* Cannot assign requested address */ + ENETDOWN = _HURD_ERRNO (50), +#define ENETDOWN _HURD_ERRNO (50)/* Network is down */ + ENETUNREACH = _HURD_ERRNO (51), +#define ENETUNREACH _HURD_ERRNO (51)/* Network is unreachable */ + ENETRESET = _HURD_ERRNO (52), +#define ENETRESET _HURD_ERRNO (52)/* Network dropped connection on reset */ + ECONNABORTED = _HURD_ERRNO (53), +#define ECONNABORTED _HURD_ERRNO (53)/* Software caused connection abort */ + ECONNRESET = _HURD_ERRNO (54), +#define ECONNRESET _HURD_ERRNO (54)/* Connection reset by peer */ + ENOBUFS = _HURD_ERRNO (55), +#define ENOBUFS _HURD_ERRNO (55)/* No buffer space available */ + EISCONN = _HURD_ERRNO (56), +#define EISCONN _HURD_ERRNO (56)/* Transport endpoint is already connected */ + ENOTCONN = _HURD_ERRNO (57), +#define ENOTCONN _HURD_ERRNO (57)/* Transport endpoint is not connected */ + EDESTADDRREQ = _HURD_ERRNO (39), +#define EDESTADDRREQ _HURD_ERRNO (39)/* Destination address required */ + ESHUTDOWN = _HURD_ERRNO (58), +#define ESHUTDOWN _HURD_ERRNO (58)/* Cannot send after transport endpoint shutdown */ + ETOOMANYREFS = _HURD_ERRNO (59), +#define ETOOMANYREFS _HURD_ERRNO (59)/* Too many references: cannot splice */ + ETIMEDOUT = _HURD_ERRNO (60), +#define ETIMEDOUT _HURD_ERRNO (60)/* Connection timed out */ + ECONNREFUSED = _HURD_ERRNO (61), +#define ECONNREFUSED _HURD_ERRNO (61)/* Connection refused */ + ELOOP = _HURD_ERRNO (62), +#define ELOOP _HURD_ERRNO (62)/* Too many levels of symbolic links */ + ENAMETOOLONG = _HURD_ERRNO (63), +#define ENAMETOOLONG _HURD_ERRNO (63)/* File name too long */ + EHOSTDOWN = _HURD_ERRNO (64), +#define EHOSTDOWN _HURD_ERRNO (64)/* Host is down */ + EHOSTUNREACH = _HURD_ERRNO (65), +#define EHOSTUNREACH _HURD_ERRNO (65)/* No route to host */ + ENOTEMPTY = _HURD_ERRNO (66), +#define ENOTEMPTY _HURD_ERRNO (66)/* Directory not empty */ + EPROCLIM = _HURD_ERRNO (67), +#define EPROCLIM _HURD_ERRNO (67)/* Too many processes */ + EUSERS = _HURD_ERRNO (68), +#define EUSERS _HURD_ERRNO (68)/* Too many users */ + EDQUOT = _HURD_ERRNO (69), +#define EDQUOT _HURD_ERRNO (69)/* Disc quota exceeded */ + ESTALE = _HURD_ERRNO (70), +#define ESTALE _HURD_ERRNO (70)/* Stale NFS file handle */ + EREMOTE = _HURD_ERRNO (71), +#define EREMOTE _HURD_ERRNO (71)/* Object is remote */ + EBADRPC = _HURD_ERRNO (72), +#define EBADRPC _HURD_ERRNO (72)/* RPC struct is bad */ + ERPCMISMATCH = _HURD_ERRNO (73), +#define ERPCMISMATCH _HURD_ERRNO (73)/* RPC version wrong */ + EPROGUNAVAIL = _HURD_ERRNO (74), +#define EPROGUNAVAIL _HURD_ERRNO (74)/* RPC program not available */ + EPROGMISMATCH = _HURD_ERRNO (75), +#define EPROGMISMATCH _HURD_ERRNO (75)/* RPC program version wrong */ + EPROCUNAVAIL = _HURD_ERRNO (76), +#define EPROCUNAVAIL _HURD_ERRNO (76)/* RPC bad procedure for program */ + ENOLCK = _HURD_ERRNO (77), +#define ENOLCK _HURD_ERRNO (77)/* No locks available */ + EFTYPE = _HURD_ERRNO (79), +#define EFTYPE _HURD_ERRNO (79)/* Inappropriate file type or format */ + EAUTH = _HURD_ERRNO (80), +#define EAUTH _HURD_ERRNO (80)/* Authentication error */ + ENEEDAUTH = _HURD_ERRNO (81), +#define ENEEDAUTH _HURD_ERRNO (81)/* Need authenticator */ + ENOSYS = _HURD_ERRNO (78), +#define ENOSYS _HURD_ERRNO (78)/* Function not implemented */ + EILSEQ = _HURD_ERRNO (106), +#define EILSEQ _HURD_ERRNO (106)/* Invalid or incomplete multibyte or wide character */ + EBACKGROUND = _HURD_ERRNO (100), +#define EBACKGROUND _HURD_ERRNO (100)/* Inappropriate operation for background process */ + EDIED = _HURD_ERRNO (101), +#define EDIED _HURD_ERRNO (101)/* Translator died */ + ED = _HURD_ERRNO (102), +#define ED _HURD_ERRNO (102)/* ? */ + EGREGIOUS = _HURD_ERRNO (103), +#define EGREGIOUS _HURD_ERRNO (103)/* You really blew it this time */ + EIEIO = _HURD_ERRNO (104), +#define EIEIO _HURD_ERRNO (104)/* Computer bought the farm */ + EGRATUITOUS = _HURD_ERRNO (105), +#define EGRATUITOUS _HURD_ERRNO (105)/* Gratuitous error */ + EBADMSG = _HURD_ERRNO (107), +#define EBADMSG _HURD_ERRNO (107)/* Bad message */ + EIDRM = _HURD_ERRNO (108), +#define EIDRM _HURD_ERRNO (108)/* Identifier removed */ + EMULTIHOP = _HURD_ERRNO (109), +#define EMULTIHOP _HURD_ERRNO (109)/* Multihop attempted */ + ENODATA = _HURD_ERRNO (110), +#define ENODATA _HURD_ERRNO (110)/* No data available */ + ENOLINK = _HURD_ERRNO (111), +#define ENOLINK _HURD_ERRNO (111)/* Link has been severed */ + ENOMSG = _HURD_ERRNO (112), +#define ENOMSG _HURD_ERRNO (112)/* No message of desired type */ + ENOSR = _HURD_ERRNO (113), +#define ENOSR _HURD_ERRNO (113)/* Out of streams resources */ + ENOSTR = _HURD_ERRNO (114), +#define ENOSTR _HURD_ERRNO (114)/* Device not a stream */ + EOVERFLOW = _HURD_ERRNO (115), +#define EOVERFLOW _HURD_ERRNO (115)/* Value too large for defined data type */ + EPROTO = _HURD_ERRNO (116), +#define EPROTO _HURD_ERRNO (116)/* Protocol error */ + ETIME = _HURD_ERRNO (117), +#define ETIME _HURD_ERRNO (117)/* Timer expired */ + + /* Errors from . */ + EMACH_SEND_IN_PROGRESS = 0x10000001, + EMACH_SEND_INVALID_DATA = 0x10000002, + EMACH_SEND_INVALID_DEST = 0x10000003, + EMACH_SEND_TIMED_OUT = 0x10000004, + EMACH_SEND_WILL_NOTIFY = 0x10000005, + EMACH_SEND_NOTIFY_IN_PROGRESS = 0x10000006, + EMACH_SEND_INTERRUPTED = 0x10000007, + EMACH_SEND_MSG_TOO_SMALL = 0x10000008, + EMACH_SEND_INVALID_REPLY = 0x10000009, + EMACH_SEND_INVALID_RIGHT = 0x1000000a, + EMACH_SEND_INVALID_NOTIFY = 0x1000000b, + EMACH_SEND_INVALID_MEMORY = 0x1000000c, + EMACH_SEND_NO_BUFFER = 0x1000000d, + EMACH_SEND_NO_NOTIFY = 0x1000000e, + EMACH_SEND_INVALID_TYPE = 0x1000000f, + EMACH_SEND_INVALID_HEADER = 0x10000010, + EMACH_RCV_IN_PROGRESS = 0x10004001, + EMACH_RCV_INVALID_NAME = 0x10004002, + EMACH_RCV_TIMED_OUT = 0x10004003, + EMACH_RCV_TOO_LARGE = 0x10004004, + EMACH_RCV_INTERRUPTED = 0x10004005, + EMACH_RCV_PORT_CHANGED = 0x10004006, + EMACH_RCV_INVALID_NOTIFY = 0x10004007, + EMACH_RCV_INVALID_DATA = 0x10004008, + EMACH_RCV_PORT_DIED = 0x10004009, + EMACH_RCV_IN_SET = 0x1000400a, + EMACH_RCV_HEADER_ERROR = 0x1000400b, + EMACH_RCV_BODY_ERROR = 0x1000400c, + + /* Errors from . */ + EKERN_INVALID_ADDRESS = 1, + EKERN_PROTECTION_FAILURE = 2, + EKERN_NO_SPACE = 3, + EKERN_INVALID_ARGUMENT = 4, + EKERN_FAILURE = 5, + EKERN_RESOURCE_SHORTAGE = 6, + EKERN_NOT_RECEIVER = 7, + EKERN_NO_ACCESS = 8, + EKERN_MEMORY_FAILURE = 9, + EKERN_MEMORY_ERROR = 10, + EKERN_NOT_IN_SET = 12, + EKERN_NAME_EXISTS = 13, + EKERN_ABORTED = 14, + EKERN_INVALID_NAME = 15, + EKERN_INVALID_TASK = 16, + EKERN_INVALID_RIGHT = 17, + EKERN_INVALID_VALUE = 18, + EKERN_UREFS_OVERFLOW = 19, + EKERN_INVALID_CAPABILITY = 20, + EKERN_RIGHT_EXISTS = 21, + EKERN_INVALID_HOST = 22, + EKERN_MEMORY_PRESENT = 23, + EKERN_WRITE_PROTECTION_FAILURE = 24, + EKERN_TERMINATED = 26, + + /* Errors from . */ + EMIG_TYPE_ERROR = -300, /* client type check failure */ + EMIG_REPLY_MISMATCH = -301, /* wrong reply message ID */ + EMIG_REMOTE_ERROR = -302, /* server detected error */ + EMIG_BAD_ID = -303, /* bad request message ID */ + EMIG_BAD_ARGUMENTS = -304, /* server type check failure */ + EMIG_NO_REPLY = -305, /* no reply should be sent */ + EMIG_EXCEPTION = -306, /* server raised exception */ + EMIG_ARRAY_TOO_LARGE = -307, /* array not large enough */ + EMIG_SERVER_DIED = -308, /* server died */ + EMIG_DESTROY_REQUEST = -309, /* destroy request with no reply */ + + /* Errors from . */ + ED_IO_ERROR = 2500, /* hardware IO error */ + ED_WOULD_BLOCK = 2501, /* would block, but D_NOWAIT set */ + ED_NO_SUCH_DEVICE = 2502, /* no such device */ + ED_ALREADY_OPEN = 2503, /* exclusive-use device already open */ + ED_DEVICE_DOWN = 2504, /* device has been shut down */ + ED_INVALID_OPERATION = 2505, /* bad operation for device */ + ED_INVALID_RECNUM = 2506, /* invalid record (block) number */ + ED_INVALID_SIZE = 2507, /* invalid IO size */ + ED_NO_MEMORY = 2508, /* memory allocation failure */ + ED_READ_ONLY = 2509, /* device cannot be written to */ + +}; + +#define _HURD_ERRNOS 118 + +/* User-visible type of error codes. It is ok to use `int' or + `kern_return_t' for these, but with `error_t' the debugger prints + symbolic values. */ +#ifdef __USE_GNU +typedef enum __error_t_codes error_t; +#define __error_t_defined 1 +#endif + +/* errno is a per-thread variable. */ +#include +#define errno (*__hurd_errno_location ()) +#define __set_errno(val) errno = (val) + +#endif /* included. */ + +#if !defined (_ERRNO_H) && defined (__need_Emath) +#define EDOM _HURD_ERRNO (33)/* Numerical argument out of domain */ +#define ERANGE _HURD_ERRNO (34)/* Numerical result out of range */ +#endif /* not included and need math error codes. */ diff --git a/sysdeps/mach/hurd/bits/fcntl.h b/sysdeps/mach/hurd/bits/fcntl.h new file mode 100644 index 0000000..4983b33 --- /dev/null +++ b/sysdeps/mach/hurd/bits/fcntl.h @@ -0,0 +1,175 @@ +/* O_*, F_*, FD_* bit values for GNU. + Copyright (C) 1993, 1994, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FCNTL_H +#error "Never use directly; include instead." +#endif + +/* File access modes. These are understood by io servers; they can be + passed in `dir_lookup', and are returned by `io_get_openmodes'. + Consequently they can be passed to `open', `hurd_file_name_lookup', and + `file_name_lookup'; and are returned by `fcntl' with the F_GETFL + command. */ + +/* In GNU, read and write are bits (unlike BSD). */ +#ifdef __USE_GNU +#define O_READ O_RDONLY /* Open for reading. */ +#define O_WRITE O_WRONLY /* Open for writing. */ +#define O_EXEC 0x0004 /* Open for execution. */ +#define O_NORW 0 /* Open without R/W access. */ +#endif +/* POSIX.1 standard names. */ +#define O_RDONLY 0x0001 /* Open read-only. */ +#define O_WRONLY 0x0002 /* Open write-only. */ +#define O_RDWR (O_RDONLY|O_WRONLY) /* Open for reading and writing. */ +#define O_ACCMODE O_RDWR /* Mask for file access modes. */ + + + +/* File name translation flags. These are understood by io servers; + they can be passed in `dir_lookup', and consequently to `open', + `hurd_file_name_lookup', and `file_name_lookup'. */ + +#define O_CREAT 0x0010 /* Create file if it doesn't exist. */ +#define O_EXCL 0x0020 /* Fail if file already exists. */ +#ifdef __USE_GNU +#define O_NOLINK 0x0040 /* No name mappings on final component. */ +#define O_NOTRANS 0x0080 /* No translator on final component. */ +#endif + + +/* I/O operating modes. These are understood by io servers; they can be + passed in `dir_lookup' and set or fetched with `io_*_openmodes'. + Consequently they can be passed to `open', `hurd_file_name_lookup', + `file_name_lookup', and `fcntl' with the F_SETFL command; and are + returned by `fcntl' with the F_GETFL command. */ + +#define O_APPEND 0x0100 /* Writes always append to the file. */ +#ifdef __USE_BSD +#define O_ASYNC 0x0200 /* Send SIGIO to owner when data is ready. */ +#define O_FSYNC 0x0400 /* Synchronous writes. */ +#define O_SYNC O_FSYNC +#endif +#ifdef __USE_GNU +#define O_NOATIME 0x0800 /* Don't set access time on read (owner). */ +#endif +#ifdef __USE_MISC +#define O_SHLOCK 0x00020000 /* Open with shared file lock. */ +#define O_EXLOCK 0x00040000 /* Open with exclusive file lock. */ +#endif + + +/* The name O_NONBLOCK is unfortunately overloaded; it is both a file name + translation flag and an I/O operating mode. O_NDELAY is the deprecated + BSD name for the same flag, overloaded in the same way. + + When used in `dir_lookup' (and consequently `open', `hurd_file_name_lookup', + or `file_name_lookup'), O_NONBLOCK says the open should return immediately + instead of blocking for any significant length of time (e.g., to wait + for carrier detect on a serial line). It is also saved as an I/O + operating mode, and after open has the following meaning. + + When used in `io_*_openmodes' (and consequently `fcntl' with the F_SETFL + command), the O_NONBLOCK flag means to do nonblocking i/o: any i/o + operation that would block for any significant length of time will instead + fail with EAGAIN. */ + +#define O_NONBLOCK 0x0008 /* Non-blocking open or non-blocking I/O. */ +#ifdef __USE_BSD +#define O_NDELAY O_NONBLOCK /* Deprecated. */ +#endif + + +#ifdef __USE_GNU +/* Mask of bits which are understood by io servers. */ +#define O_HURD (0xffff | O_EXLOCK | O_SHLOCK) +#endif + + +/* Open-time action flags. These are understood by `hurd_file_name_lookup' + and consequently by `open' and `file_name_lookup'. They are not preserved + once the file has been opened. */ + +#define O_TRUNC 0x00010000 /* Truncate file to zero length. */ + + +/* Controlling terminal flags. These are understood only by `open', + and are not preserved once the file has been opened. */ + +#ifdef __USE_GNU +#define O_IGNORE_CTTY 0x00080000 /* Don't do any ctty magic at all. */ +#endif +/* `open' never assigns a controlling terminal in GNU. */ +#define O_NOCTTY 0 /* Don't assign a controlling terminal. */ + + +#ifdef __USE_BSD +/* Bits in the file status flags returned by F_GETFL. */ +#define FREAD O_RDONLY +#define FWRITE O_WRONLY + +/* Traditional BSD names the O_* bits. */ +#define FASYNC O_ASYNC +#define FCREAT O_CREAT +#define FEXCL O_EXCL +#define FTRUNC O_TRUNC +#define FNOCTTY O_NOCTTY +#define FFSYNC O_FSYNC +#define FSYNC O_SYNC +#define FAPPEND O_APPEND +#define FNONBLOCK O_NONBLOCK +#define FNDELAY O_NDELAY +#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. */ +#ifdef __USE_BSD +#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */ +#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */ +#endif +#define F_GETLK 7 /* Get record locking info. */ +#define F_SETLK 8 /* Set record locking info (non-blocking). */ +#define F_SETLKW 9 /* Set record locking info (blocking). */ + +/* File descriptor flags used with F_GETFD and F_SETFD. */ +#define FD_CLOEXEC 1 /* Close on exec. */ + + +#include + +/* The structure describing an advisory lock. This is the type of the third + argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ +struct flock + { + int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + }; + +/* Values for the `l_type' field of a `struct flock'. */ +#define F_RDLCK 1 /* Read lock. */ +#define F_WRLCK 2 /* Write lock. */ +#define F_UNLCK 3 /* Remove lock. */ diff --git a/sysdeps/mach/hurd/bits/ioctls.h b/sysdeps/mach/hurd/bits/ioctls.h new file mode 100644 index 0000000..b04438b --- /dev/null +++ b/sysdeps/mach/hurd/bits/ioctls.h @@ -0,0 +1,353 @@ +/* Copyright (C) 1992, 1993, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_IOCTLS_H +#define _BITS_IOCTLS_H 1 + +/* These macros are also defined in (with numerically + identical values) but this serves to shut up cpp's complaining. */ +#ifdef MDMBUF +#undef MDMBUF +#endif +#ifdef ECHO +#undef ECHO +#endif +#ifdef TOSTOP +#undef TOSTOP +#endif +#ifdef FLUSHO +#undef FLUSHO +#endif +#ifdef PENDIN +#undef PENDIN +#endif +#ifdef NOFLSH +#undef NOFLSH +#endif + +/* Hurd ioctl request are made up of several fields: + + 10987654321098765432109876543210 + IOt0t1t2cc0c0cc1c1cc2ggggccccccc + + bits [31,30]: inout direction (enum __ioctl_dir) + bits [29,11]: type encoding as follows; zero count indicates omitted datum + [29,28]: datum #0 type (enum __ioctl_datum) + [27,26]: datum #1 type (enum __ioctl_datum) + [24,25]: datum #2 type (enum __ioctl_datum) + [23,19]: datum #0 count [0,31] + [18,14]: datum #1 count [0,31] + [13,11]: datum #2 count [0,3] + bits [07,10]: group (letter - 'f': ['f','v']) + bits [00,06]: command [0,127] + + The following macros construct and dissect these fields. */ + +enum __ioctl_dir + { + IOC_VOID = 0, /* No parameters. */ + IOC_OUT = 1, /* Data is written into the user's buffer. */ + IOC_IN = 2, /* Data is read from the user's buffer. */ + IOC_INOUT = (IOC_IN|IOC_OUT) + }; + +enum __ioctl_datum { IOC_8, IOC_16, IOC_32, IOC_64 }; + +/* Construct an ioctl from constructed type plus other fields. */ +#define _IOC(inout, group, num, type) \ + ((num) | ((((group) - 'f') | ((type) | (inout) << 19) << 4) << 7)) + +/* Dissect an ioctl into its component fields. */ +#define _IOC_INOUT(request) (((unsigned int) (request) >> 30) & IOC_INOUT) +#define _IOC_GROUP(request) ('f' + (((unsigned int) (request) >> 7) & 0xf)) +#define _IOC_COMMAND(request) ((unsigned int) (request) & 0x7f) +#define _IOC_TYPE(request) (((unsigned int) (request) >> 11) & 0x7ffff) +#define _IOC_NOTYPE(request) ((unsigned int) (request) & 0x3ff) + +/* Construct a type information field from + the broken-out type and count fields. */ +#define _IOT(t0, c0, t1, c1, t2, c2) \ + ((c2) | (((c1) | ((c0) | ((t2) | ((t1) | (t0) << 2) << 2) << 5) << 5) << 3)) + +/* Dissect a type information field into the type and count fields. */ +#define _IOT_TYPE0(type) (((unsigned int) (type) >> 17) & 3) +#define _IOT_TYPE1(type) (((unsigned int) (type) >> 15) & 3) +#define _IOT_TYPE2(type) (((unsigned int) (type) >> 13) & 3) +#define _IOT_COUNT0(type) (((unsigned int) (type) >> 8) & 0x1f) +#define _IOT_COUNT1(type) (((unsigned int) (type) >> 3) & 0x1f) +#define _IOT_COUNT2(type) (((unsigned int) (type) >> 0) & 7) + +/* Construct an ioctl from all the broken-out fields. */ +#define _IOCT(inout, group, num, t0, c0, t1, c1, t2, c2) \ + _IOC ((inout), (group), (num), _IOT ((t0), (c0), (t1), (c1), (t2), (c2))) + +/* Standard flavors of ioctls. + _IOT_foobar is defined either in this file, + or where struct foobar is defined. */ +#define _IO(g, n) _IOC (IOC_VOID, (g), (n), 0) +#define _IOR(g, n, t) _IOC (IOC_OUT, (g), (n), _IOT_##t) +#define _IOW(g, n, t) _IOC (IOC_IN, (g), (n), _IOT_##t) +#define _IOWR(g, n, t) _IOC (IOC_INOUT, (g), (n), _IOT_##t) + +/* Construct an individual type field for TYPE. */ +#define _IOTS(type) \ + (sizeof (type) == 8 ? IOC_64 : (sizeof (type) >> 1)) + +/* Construct a type information field for + a single argument of the scalar TYPE. */ +#define _IOT_SIMPLE(type) _IOT (_IOTS (type), 1, 0, 0, 0, 0) + +/* Basic C types. */ +#define _IOT_int _IOT_SIMPLE (int) +#define _IOT_char _IOT_SIMPLE (char) +#define _IOT_short _IOT_SIMPLE (short) + + +/* ioctls verbatim from 4.4 , with `struct' keywords removed. */ + +#define TIOCMODG _IOR('t', 3, int) /* get modem control state */ +#define TIOCMODS _IOW('t', 4, int) /* set modem control state */ +#define TIOCM_LE 0001 /* line enable */ +#define TIOCM_DTR 0002 /* data terminal ready */ +#define TIOCM_RTS 0004 /* request to send */ +#define TIOCM_ST 0010 /* secondary transmit */ +#define TIOCM_SR 0020 /* secondary receive */ +#define TIOCM_CTS 0040 /* clear to send */ +#define TIOCM_CAR 0100 /* carrier detect */ +#define TIOCM_CD TIOCM_CAR +#define TIOCM_RNG 0200 /* ring */ +#define TIOCM_RI TIOCM_RNG +#define TIOCM_DSR 0400 /* data set ready */ + /* 8-10 compat */ +#define TIOCEXCL _IO('t', 13) /* set exclusive use of tty */ +#define TIOCNXCL _IO('t', 14) /* reset exclusive use of tty */ + /* 15 unused */ +#define TIOCFLUSH _IOW('t', 16, int) /* flush buffers */ + /* 17-18 compat */ +#define TIOCGETA _IOR('t', 19, termios) /* get termios struct */ +#define TIOCSETA _IOW('t', 20, termios) /* set termios struct */ +#define TIOCSETAW _IOW('t', 21, termios) /* drain output, set */ +#define TIOCSETAF _IOW('t', 22, termios) /* drn out, fls in, set */ +#define TIOCGETD _IOR('t', 26, int) /* get line discipline */ +#define TIOCSETD _IOW('t', 27, int) /* set line discipline */ + /* 127-124 compat */ +#define TIOCSBRK _IO('t', 123) /* set break bit */ +#define TIOCCBRK _IO('t', 122) /* clear break bit */ +#define TIOCSDTR _IO('t', 121) /* set data terminal ready */ +#define TIOCCDTR _IO('t', 120) /* clear data terminal ready */ +#define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */ +#define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */ + /* 117-116 compat */ +#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ +#define TIOCSTI _IOW('t', 114, char) /* simulate terminal input */ +#define TIOCNOTTY _IO('t', 113) /* void tty association */ +#define TIOCPKT _IOW('t', 112, int) /* pty: set/clear packet mode */ +#define TIOCPKT_DATA 0x00 /* data packet */ +#define TIOCPKT_FLUSHREAD 0x01 /* flush packet */ +#define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */ +#define TIOCPKT_STOP 0x04 /* stop output */ +#define TIOCPKT_START 0x08 /* start output */ +#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */ +#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */ +#define TIOCPKT_IOCTL 0x40 /* state change of pty driver */ +#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ +#define TIOCSTART _IO('t', 110) /* start output, like ^Q */ +#define TIOCMSET _IOW('t', 109, int) /* set all modem bits */ +#define TIOCMBIS _IOW('t', 108, int) /* bis modem bits */ +#define TIOCMBIC _IOW('t', 107, int) /* bic modem bits */ +#define TIOCMGET _IOR('t', 106, int) /* get all modem bits */ +#define TIOCREMOTE _IOW('t', 105, int) /* remote input editing */ +#define TIOCGWINSZ _IOR('t', 104, winsize) /* get window size */ +#define TIOCSWINSZ _IOW('t', 103, winsize) /* set window size */ +#define TIOCUCNTL _IOW('t', 102, int) /* pty: set/clr usr cntl mode */ +#define UIOCCMD(n) _IO('u', n) /* usr cntl op "n" */ +#define TIOCCONS _IOW('t', 98, int) /* become virtual console */ +#define TIOCSCTTY _IO('t', 97) /* become controlling tty */ +#define TIOCEXT _IOW('t', 96, int) /* pty: external processing */ +#define TIOCSIG _IO('t', 95) /* pty: generate signal */ +#define TIOCDRAIN _IO('t', 94) /* wait till output drained */ + +#define TTYDISC 0 /* termios tty line discipline */ +#define TABLDISC 3 /* tablet discipline */ +#define SLIPDISC 4 /* serial IP discipline */ + + +#define FIOCLEX _IO('f', 1) /* set close on exec on fd */ +#define FIONCLEX _IO('f', 2) /* remove close on exec */ +#define FIONREAD _IOR('f', 127, int) /* get # bytes to read */ +#define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */ +#define FIOASYNC _IOW('f', 125, int) /* set/clear async i/o */ +#define FIOSETOWN _IOW('f', 124, int) /* set owner */ +#define FIOGETOWN _IOR('f', 123, int) /* get owner */ + +/* socket i/o controls */ +#define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */ +#define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */ +#define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */ +#define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */ +#define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */ +#define SIOCSPGRP _IOW('s', 8, int) /* set process group */ +#define SIOCGPGRP _IOR('s', 9, int) /* get process group */ + +#define SIOCADDRT _IOW('r', 10, ortentry) /* add route */ +#define SIOCDELRT _IOW('r', 11, ortentry) /* delete route */ + +#define SIOCSIFADDR _IOW('i', 12, ifreq) /* set ifnet address */ +#define OSIOCGIFADDR _IOWR('i',13, ifreq) /* get ifnet address */ +#define SIOCGIFADDR _IOWR('i',33, ifreq) /* get ifnet address */ +#define SIOCSIFDSTADDR _IOW('i', 14, ifreq) /* set p-p address */ +#define OSIOCGIFDSTADDR _IOWR('i',15, ifreq) /* get p-p address */ +#define SIOCGIFDSTADDR _IOWR('i',34, ifreq) /* get p-p address */ +#define SIOCSIFFLAGS _IOW('i', 16, ifreq) /* set ifnet flags */ +#define SIOCGIFFLAGS _IOWR('i',17, ifreq) /* get ifnet flags */ +#define OSIOCGIFBRDADDR _IOWR('i',18, ifreq) /* get broadcast addr */ +#define SIOCGIFBRDADDR _IOWR('i',35, ifreq) /* get broadcast addr */ +#define SIOCSIFBRDADDR _IOW('i',19, ifreq) /* set broadcast addr */ +#define OSIOCGIFCONF _IOWR('i',20, ifconf) /* get ifnet list */ +#define SIOCGIFCONF _IOWR('i',36, ifconf) /* get ifnet list */ +#define OSIOCGIFNETMASK _IOWR('i',21, ifreq) /* get net addr mask */ +#define SIOCGIFNETMASK _IOWR('i',37, ifreq) /* get net addr mask */ +#define SIOCSIFNETMASK _IOW('i',22, ifreq) /* set net addr mask */ +#define SIOCGIFMETRIC _IOWR('i',23, ifreq) /* get IF metric */ +#define SIOCSIFMETRIC _IOW('i',24, ifreq) /* set IF metric */ +#define SIOCDIFADDR _IOW('i',25, ifreq) /* delete IF addr */ +#define SIOCAIFADDR _IOW('i',26, ifaliasreq) /* add/chg IF alias */ + +#define SIOCSARP _IOW('i', 30, arpreq) /* set arp entry */ +#define OSIOCGARP _IOWR('i',31, arpreq) /* get arp entry */ +#define SIOCGARP _IOWR('i',38, arpreq) /* get arp entry */ +#define SIOCDARP _IOW('i', 32, arpreq) /* delete arp entry */ + + +/* Compatibility with 4.3 BSD terminal driver. + From 4.4 . */ + +#ifdef USE_OLD_TTY +# undef TIOCGETD +# define TIOCGETD _IOR('t', 0, int) /* get line discipline */ +# undef TIOCSETD +# define TIOCSETD _IOW('t', 1, int) /* set line discipline */ +#else +# define OTIOCGETD _IOR('t', 0, int) /* get line discipline */ +# define OTIOCSETD _IOW('t', 1, int) /* set line discipline */ +#endif +#define TIOCHPCL _IO('t', 2) /* hang up on last close */ +#define TIOCGETP _IOR('t', 8,sgttyb)/* get parameters -- gtty */ +#define TIOCSETP _IOW('t', 9,sgttyb)/* set parameters -- stty */ +#define TIOCSETN _IOW('t',10,sgttyb)/* as above, but no flushtty*/ +#define TIOCSETC _IOW('t',17,tchars)/* set special characters */ +#define TIOCGETC _IOR('t',18,tchars)/* get special characters */ +#define TANDEM 0x00000001 /* send stopc on out q full */ +#define CBREAK 0x00000002 /* half-cooked mode */ +#define LCASE 0x00000004 /* simulate lower case */ +#define ECHO 0x00000008 /* echo input */ +#define CRMOD 0x00000010 /* map \r to \r\n on output */ +#define RAW 0x00000020 /* no i/o processing */ +#define ODDP 0x00000040 /* get/send odd parity */ +#define EVENP 0x00000080 /* get/send even parity */ +#define ANYP 0x000000c0 /* get any parity/send none */ +#define NLDELAY 0x00000300 /* \n delay */ +#define NL0 0x00000000 +#define NL1 0x00000100 /* tty 37 */ +#define NL2 0x00000200 /* vt05 */ +#define NL3 0x00000300 +#define TBDELAY 0x00000c00 /* horizontal tab delay */ +#define TAB0 0x00000000 +#define TAB1 0x00000400 /* tty 37 */ +#define TAB2 0x00000800 +#define XTABS 0x00000c00 /* expand tabs on output */ +#define CRDELAY 0x00003000 /* \r delay */ +#define CR0 0x00000000 +#define CR1 0x00001000 /* tn 300 */ +#define CR2 0x00002000 /* tty 37 */ +#define CR3 0x00003000 /* concept 100 */ +#define VTDELAY 0x00004000 /* vertical tab delay */ +#define FF0 0x00000000 +#define FF1 0x00004000 /* tty 37 */ +#define BSDELAY 0x00008000 /* \b delay */ +#define BS0 0x00000000 +#define BS1 0x00008000 +#define ALLDELAY (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY) +#define CRTBS 0x00010000 /* do backspacing for crt */ +#define PRTERA 0x00020000 /* \ ... / erase */ +#define CRTERA 0x00040000 /* " \b " to wipe out char */ +#define TILDE 0x00080000 /* hazeltine tilde kludge */ +#define MDMBUF 0x00100000 /*start/stop output on carrier*/ +#define LITOUT 0x00200000 /* literal output */ +#define TOSTOP 0x00400000 /*SIGSTOP on background output*/ +#define FLUSHO 0x00800000 /* flush output to terminal */ +#define NOHANG 0x01000000 /* (no-op) was no SIGHUP on carrier drop */ +#define L001000 0x02000000 +#define CRTKIL 0x04000000 /* kill line with " \b " */ +#define PASS8 0x08000000 +#define CTLECH 0x10000000 /* echo control chars as ^X */ +#define PENDIN 0x20000000 /* tp->t_rawq needs reread */ +#define DECCTQ 0x40000000 /* only ^Q starts after ^S */ +#define NOFLSH 0x80000000 /* no output flush on signal */ +#define TIOCLBIS _IOW('t', 127, int) /* bis local mode bits */ +#define TIOCLBIC _IOW('t', 126, int) /* bic local mode bits */ +#define TIOCLSET _IOW('t', 125, int) /* set entire local mode word */ +#define TIOCLGET _IOR('t', 124, int) /* get local modes */ +#define LCRTBS (CRTBS>>16) +#define LPRTERA (PRTERA>>16) +#define LCRTERA (CRTERA>>16) +#define LTILDE (TILDE>>16) +#define LMDMBUF (MDMBUF>>16) +#define LLITOUT (LITOUT>>16) +#define LTOSTOP (TOSTOP>>16) +#define LFLUSHO (FLUSHO>>16) +#define LNOHANG (NOHANG>>16) +#define LCRTKIL (CRTKIL>>16) +#define LPASS8 (PASS8>>16) +#define LCTLECH (CTLECH>>16) +#define LPENDIN (PENDIN>>16) +#define LDECCTQ (DECCTQ>>16) +#define LNOFLSH (NOFLSH>>16) +#define TIOCSLTC _IOW('t',117,ltchars)/* set local special chars*/ +#define TIOCGLTC _IOR('t',116,ltchars)/* get local special chars*/ +#define OTIOCCONS _IO('t', 98) /* for hp300 -- sans int arg */ +#define OTTYDISC 0 +#define NETLDISC 1 +#define NTTYDISC 2 + +/* From 4.4 . */ +#ifdef USE_OLD_TTY +#define B0 0 +#define B50 1 +#define B75 2 +#define B110 3 +#define B134 4 +#define B150 5 +#define B200 6 +#define B300 7 +#define B600 8 +#define B1200 9 +#define B1800 10 +#define B2400 11 +#define B4800 12 +#define B9600 13 +#define EXTA 14 +#define EXTB 15 +#endif /* USE_OLD_TTY */ + + +#endif /* bits/ioctls.h */ diff --git a/sysdeps/mach/hurd/bits/local_lim.h b/sysdeps/mach/hurd/bits/local_lim.h new file mode 100644 index 0000000..e26aa24 --- /dev/null +++ b/sysdeps/mach/hurd/bits/local_lim.h @@ -0,0 +1,39 @@ +/* Minimum guaranteed maximum values for system limits. Hurd version. + Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* GNU has no arbitrary fixed limits on these things, so we don't + define the macros. Some things are unlimited. Some are in fact + limited but the limit is run-time dependent and fetched with + `sysconf' or `pathconf'. + + POSIX.1 requires that we define NGROUPS_MAX (though none of the others + is required). GNU allows any number of supplementary groups, + dynamically allocated. So we pick a number which seems vaguely + suitable, and `sysconf' will return a number at least as large. */ + +#define NGROUPS_MAX 256 + +/* The maximum number of symbolic links that are allowed in a single file + name resolution. When a further link is encountered, the call returns + ELOOP. This name is a GNU extension; POSIX.1 has no such limit, and BSD + calls it MAXSYMLINKS in . */ + +#ifdef __USE_GNU /* 1003.1a defines this */ +#define SYMLOOP_MAX 8 +#endif diff --git a/sysdeps/mach/hurd/bits/posix_opt.h b/sysdeps/mach/hurd/bits/posix_opt.h new file mode 100644 index 0000000..045b4b6 --- /dev/null +++ b/sysdeps/mach/hurd/bits/posix_opt.h @@ -0,0 +1,21 @@ +/* Posix options supported by the GNU Hurd port of GNU libc. */ + +#define _POSIX_JOB_CONTROL 1 +#define _POSIX_SAVED_IDS 1 +#define _POSIX_VDISABLE ((unsigned char) -1) + +/* Different Hurd filesystems might do these differently. */ +#undef _POSIX_CHOWN_RESTRICTED +#undef _POSIX_NO_TRUNC +/* Posix options supported by the GNU Hurd port of GNU libc. */ + +#define _POSIX_JOB_CONTROL 1 +#define _POSIX_SAVED_IDS 1 +#define _POSIX_VDISABLE ((unsigned char) -1) + +/* Different Hurd filesystems might do these differently. */ +#undef _POSIX_CHOWN_RESTRICTED +#undef _POSIX_NO_TRUNC + + + diff --git a/sysdeps/mach/hurd/bits/stat.h b/sysdeps/mach/hurd/bits/stat.h new file mode 100644 index 0000000..2110a73 --- /dev/null +++ b/sysdeps/mach/hurd/bits/stat.h @@ -0,0 +1,136 @@ +/* Copyright (C) 1992, 1993, 1994, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H 1 + +#include + +/* NOTE: The size of this structure (32 ints) is known in + , since it is used in the `io_stat' RPC. MiG + does not cope at all well with the passed C structure not being of + the expected size. There are some filler words at the end to allow + for future expansion. To increase the size of the structure used + in the RPC and retain binary compatibility, we would need to assign + a new message number. */ + +struct stat + { + int st_fstype; /* File system type. */ + __fsid_t st_fsid; /* File system ID. */ +#define st_dev st_fsid + + __ino_t st_ino; /* File number. */ + unsigned int st_gen; /* To detect reuse of file numbers. */ + __dev_t st_rdev; /* Device if special file. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Number of links. */ + + __uid_t st_uid; /* Owner. */ + __gid_t st_gid; /* Owning group. */ + + __off_t st_size; /* Size in bytes. */ + + __time_t st_atime; /* Access time, seconds */ + unsigned long int st_atime_usec; /* and microseconds. */ + __time_t st_mtime; /* Modification time, seconds */ + unsigned long int st_mtime_usec; /* and microseconds. */ + __time_t st_ctime; /* Status change time, seconds */ + unsigned long int st_ctime_usec; /* and microseconds. */ + + unsigned int st_blksize; /* Optimal size for I/O. */ + +#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */ + + unsigned int st_blocks; /* Number of 512-byte blocks allocated. + Not related to `st_blksize'. */ + + __uid_t st_author; /* File author. */ + + unsigned int st_flags; /* User-defined flags. + High 16 bits can be set only by root. */ + +#define _SPARE_SIZE ((sizeof (__fsid_t) == sizeof (int)) ? 12 : 11) + int st_spare[_SPARE_SIZE]; /* Room for future expansion. */ +#undef _SPARE_SIZE + }; + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ +#define __S_IFIFO 0010000 /* FIFO. */ + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 00400 /* Read by owner. */ +#define __S_IWRITE 00200 /* Write by owner. */ +#define __S_IEXEC 00100 /* Execute by owner. */ + + +#ifdef __USE_GNU +/* If set, there is no benefit in caching the contents of this file. */ +#define S_INOCACHE 000000200000 + +/* If the S_IUSEUNK bit is set, then the S_IUNKNOWN bits (see below) + control access for unknown users. If S_IUSEUNK is clear, then unknown + users are treated as "others" for purposes of access control. */ +#define S_IUSEUNK 000000400000 +/* Mask of protection bits for unknown users (no effective IDs at all). */ +#define S_IUNKNOWN 000007000000 +/* Shift S_IREAD, S_IWRITE, S_IEXEC left this many bits to produce the + protection bits for unknown users. */ +#define S_IUNKSHIFT 12 + +/* Read only bits: */ + +/* There is a passive translator set for this file */ +#define S_IPTRANS 000010000000 +/* There is an active translator running on this file */ +#define S_IATRANS 000020000000 +/* This is the root of a filesystem (or single node translator) */ +#define S_IROOT 000040000000 +/* All the bits relevant to translators */ +#define S_ITRANS 000070000000 + +/* ALL the unused bits. */ +#define S_ISPARE (~(S_IFMT|S_ITRANS|S_INOCACHE| \ + S_IUSEUNK|S_IUNKNOWN|07777)) +#endif + +/* Default file creation mask (umask). */ +#ifdef __USE_BSD +#define CMASK 0022 +#endif + + +#endif /* bits/stat.h */ diff --git a/sysdeps/mach/hurd/dirstream.h b/sysdeps/mach/hurd/dirstream.h index c13383d..9eeb7d9a 100644 --- a/sysdeps/mach/hurd/dirstream.h +++ b/sysdeps/mach/hurd/dirstream.h @@ -20,7 +20,7 @@ Cambridge, MA 02139, USA. */ #define _DIRSTREAM_H 1 -#include +#include /* Directory stream type. diff --git a/sysdeps/mach/hurd/errnos.h b/sysdeps/mach/hurd/errnos.h deleted file mode 100644 index beb35ec..0000000 --- a/sysdeps/mach/hurd/errnos.h +++ /dev/null @@ -1,316 +0,0 @@ -/* This file generated by errnos.awk. */ - -/* The Hurd uses Mach error system 0x10, currently only subsystem 0. */ -#ifndef _HURD_ERRNO -#define _HURD_ERRNO(n) ((0x10 << 26) | ((n) & 0x3fff)) -#endif - -#ifdef _ERRNO_H - -enum __error_t_codes -{ -#undef EDOM -#undef ERANGE - EPERM = _HURD_ERRNO (1), -#define EPERM _HURD_ERRNO (1) /* Operation not permitted */ - ENOENT = _HURD_ERRNO (2), -#define ENOENT _HURD_ERRNO (2) /* No such file or directory */ - ESRCH = _HURD_ERRNO (3), -#define ESRCH _HURD_ERRNO (3) /* No such process */ - EINTR = _HURD_ERRNO (4), -#define EINTR _HURD_ERRNO (4) /* Interrupted system call */ - EIO = _HURD_ERRNO (5), -#define EIO _HURD_ERRNO (5) /* Input/output error */ - ENXIO = _HURD_ERRNO (6), -#define ENXIO _HURD_ERRNO (6) /* Device not configured */ - E2BIG = _HURD_ERRNO (7), -#define E2BIG _HURD_ERRNO (7) /* Argument list too long */ - ENOEXEC = _HURD_ERRNO (8), -#define ENOEXEC _HURD_ERRNO (8) /* Exec format error */ - EBADF = _HURD_ERRNO (9), -#define EBADF _HURD_ERRNO (9) /* Bad file descriptor */ - ECHILD = _HURD_ERRNO (10), -#define ECHILD _HURD_ERRNO (10)/* No child processes */ - EDEADLK = _HURD_ERRNO (11), -#define EDEADLK _HURD_ERRNO (11)/* Resource deadlock avoided */ - ENOMEM = _HURD_ERRNO (12), -#define ENOMEM _HURD_ERRNO (12)/* Cannot allocate memory */ - EACCES = _HURD_ERRNO (13), -#define EACCES _HURD_ERRNO (13)/* Permission denied */ - EFAULT = _HURD_ERRNO (14), -#define EFAULT _HURD_ERRNO (14)/* Bad address */ - ENOTBLK = _HURD_ERRNO (15), -#define ENOTBLK _HURD_ERRNO (15)/* Block device required */ - EBUSY = _HURD_ERRNO (16), -#define EBUSY _HURD_ERRNO (16)/* Device or resource busy */ - EEXIST = _HURD_ERRNO (17), -#define EEXIST _HURD_ERRNO (17)/* File exists */ - EXDEV = _HURD_ERRNO (18), -#define EXDEV _HURD_ERRNO (18)/* Invalid cross-device link */ - ENODEV = _HURD_ERRNO (19), -#define ENODEV _HURD_ERRNO (19)/* Operation not supported by device */ - ENOTDIR = _HURD_ERRNO (20), -#define ENOTDIR _HURD_ERRNO (20)/* Not a directory */ - EISDIR = _HURD_ERRNO (21), -#define EISDIR _HURD_ERRNO (21)/* Is a directory */ - EINVAL = _HURD_ERRNO (22), -#define EINVAL _HURD_ERRNO (22)/* Invalid argument */ - EMFILE = _HURD_ERRNO (24), -#define EMFILE _HURD_ERRNO (24)/* Too many open files */ - ENFILE = _HURD_ERRNO (23), -#define ENFILE _HURD_ERRNO (23)/* Too many open files in system */ - ENOTTY = _HURD_ERRNO (25), -#define ENOTTY _HURD_ERRNO (25)/* Inappropriate ioctl for device */ - ETXTBSY = _HURD_ERRNO (26), -#define ETXTBSY _HURD_ERRNO (26)/* Text file busy */ - EFBIG = _HURD_ERRNO (27), -#define EFBIG _HURD_ERRNO (27)/* File too large */ - ENOSPC = _HURD_ERRNO (28), -#define ENOSPC _HURD_ERRNO (28)/* No space left on device */ - ESPIPE = _HURD_ERRNO (29), -#define ESPIPE _HURD_ERRNO (29)/* Illegal seek */ - EROFS = _HURD_ERRNO (30), -#define EROFS _HURD_ERRNO (30)/* Read-only file system */ - EMLINK = _HURD_ERRNO (31), -#define EMLINK _HURD_ERRNO (31)/* Too many links */ - EPIPE = _HURD_ERRNO (32), -#define EPIPE _HURD_ERRNO (32)/* Broken pipe */ - EDOM = _HURD_ERRNO (33), -#define EDOM _HURD_ERRNO (33)/* Numerical argument out of domain */ - ERANGE = _HURD_ERRNO (34), -#define ERANGE _HURD_ERRNO (34)/* Numerical result out of range */ - EAGAIN = _HURD_ERRNO (35), -#define EAGAIN _HURD_ERRNO (35)/* Resource temporarily unavailable */ -#define EWOULDBLOCK EAGAIN /* Operation would block */ - EINPROGRESS = _HURD_ERRNO (36), -#define EINPROGRESS _HURD_ERRNO (36)/* Operation now in progress */ - EALREADY = _HURD_ERRNO (37), -#define EALREADY _HURD_ERRNO (37)/* Operation already in progress */ - ENOTSOCK = _HURD_ERRNO (38), -#define ENOTSOCK _HURD_ERRNO (38)/* Socket operation on non-socket */ - EMSGSIZE = _HURD_ERRNO (40), -#define EMSGSIZE _HURD_ERRNO (40)/* Message too long */ - EPROTOTYPE = _HURD_ERRNO (41), -#define EPROTOTYPE _HURD_ERRNO (41)/* Protocol wrong type for socket */ - ENOPROTOOPT = _HURD_ERRNO (42), -#define ENOPROTOOPT _HURD_ERRNO (42)/* Protocol not available */ - EPROTONOSUPPORT = _HURD_ERRNO (43), -#define EPROTONOSUPPORT _HURD_ERRNO (43)/* Protocol not supported */ - ESOCKTNOSUPPORT = _HURD_ERRNO (44), -#define ESOCKTNOSUPPORT _HURD_ERRNO (44)/* Socket type not supported */ - EOPNOTSUPP = _HURD_ERRNO (45), -#define EOPNOTSUPP _HURD_ERRNO (45)/* Operation not supported */ - EPFNOSUPPORT = _HURD_ERRNO (46), -#define EPFNOSUPPORT _HURD_ERRNO (46)/* Protocol family not supported */ - EAFNOSUPPORT = _HURD_ERRNO (47), -#define EAFNOSUPPORT _HURD_ERRNO (47)/* Address family not supported by protocol */ - EADDRINUSE = _HURD_ERRNO (48), -#define EADDRINUSE _HURD_ERRNO (48)/* Address already in use */ - EADDRNOTAVAIL = _HURD_ERRNO (49), -#define EADDRNOTAVAIL _HURD_ERRNO (49)/* Cannot assign requested address */ - ENETDOWN = _HURD_ERRNO (50), -#define ENETDOWN _HURD_ERRNO (50)/* Network is down */ - ENETUNREACH = _HURD_ERRNO (51), -#define ENETUNREACH _HURD_ERRNO (51)/* Network is unreachable */ - ENETRESET = _HURD_ERRNO (52), -#define ENETRESET _HURD_ERRNO (52)/* Network dropped connection on reset */ - ECONNABORTED = _HURD_ERRNO (53), -#define ECONNABORTED _HURD_ERRNO (53)/* Software caused connection abort */ - ECONNRESET = _HURD_ERRNO (54), -#define ECONNRESET _HURD_ERRNO (54)/* Connection reset by peer */ - ENOBUFS = _HURD_ERRNO (55), -#define ENOBUFS _HURD_ERRNO (55)/* No buffer space available */ - EISCONN = _HURD_ERRNO (56), -#define EISCONN _HURD_ERRNO (56)/* Transport endpoint is already connected */ - ENOTCONN = _HURD_ERRNO (57), -#define ENOTCONN _HURD_ERRNO (57)/* Transport endpoint is not connected */ - EDESTADDRREQ = _HURD_ERRNO (39), -#define EDESTADDRREQ _HURD_ERRNO (39)/* Destination address required */ - ESHUTDOWN = _HURD_ERRNO (58), -#define ESHUTDOWN _HURD_ERRNO (58)/* Cannot send after transport endpoint shutdown */ - ETOOMANYREFS = _HURD_ERRNO (59), -#define ETOOMANYREFS _HURD_ERRNO (59)/* Too many references: cannot splice */ - ETIMEDOUT = _HURD_ERRNO (60), -#define ETIMEDOUT _HURD_ERRNO (60)/* Connection timed out */ - ECONNREFUSED = _HURD_ERRNO (61), -#define ECONNREFUSED _HURD_ERRNO (61)/* Connection refused */ - ELOOP = _HURD_ERRNO (62), -#define ELOOP _HURD_ERRNO (62)/* Too many levels of symbolic links */ - ENAMETOOLONG = _HURD_ERRNO (63), -#define ENAMETOOLONG _HURD_ERRNO (63)/* File name too long */ - EHOSTDOWN = _HURD_ERRNO (64), -#define EHOSTDOWN _HURD_ERRNO (64)/* Host is down */ - EHOSTUNREACH = _HURD_ERRNO (65), -#define EHOSTUNREACH _HURD_ERRNO (65)/* No route to host */ - ENOTEMPTY = _HURD_ERRNO (66), -#define ENOTEMPTY _HURD_ERRNO (66)/* Directory not empty */ - EPROCLIM = _HURD_ERRNO (67), -#define EPROCLIM _HURD_ERRNO (67)/* Too many processes */ - EUSERS = _HURD_ERRNO (68), -#define EUSERS _HURD_ERRNO (68)/* Too many users */ - EDQUOT = _HURD_ERRNO (69), -#define EDQUOT _HURD_ERRNO (69)/* Disc quota exceeded */ - ESTALE = _HURD_ERRNO (70), -#define ESTALE _HURD_ERRNO (70)/* Stale NFS file handle */ - EREMOTE = _HURD_ERRNO (71), -#define EREMOTE _HURD_ERRNO (71)/* Object is remote */ - EBADRPC = _HURD_ERRNO (72), -#define EBADRPC _HURD_ERRNO (72)/* RPC struct is bad */ - ERPCMISMATCH = _HURD_ERRNO (73), -#define ERPCMISMATCH _HURD_ERRNO (73)/* RPC version wrong */ - EPROGUNAVAIL = _HURD_ERRNO (74), -#define EPROGUNAVAIL _HURD_ERRNO (74)/* RPC program not available */ - EPROGMISMATCH = _HURD_ERRNO (75), -#define EPROGMISMATCH _HURD_ERRNO (75)/* RPC program version wrong */ - EPROCUNAVAIL = _HURD_ERRNO (76), -#define EPROCUNAVAIL _HURD_ERRNO (76)/* RPC bad procedure for program */ - ENOLCK = _HURD_ERRNO (77), -#define ENOLCK _HURD_ERRNO (77)/* No locks available */ - EFTYPE = _HURD_ERRNO (79), -#define EFTYPE _HURD_ERRNO (79)/* Inappropriate file type or format */ - EAUTH = _HURD_ERRNO (80), -#define EAUTH _HURD_ERRNO (80)/* Authentication error */ - ENEEDAUTH = _HURD_ERRNO (81), -#define ENEEDAUTH _HURD_ERRNO (81)/* Need authenticator */ - ENOSYS = _HURD_ERRNO (78), -#define ENOSYS _HURD_ERRNO (78)/* Function not implemented */ - EILSEQ = _HURD_ERRNO (106), -#define EILSEQ _HURD_ERRNO (106)/* Invalid or incomplete multibyte or wide character */ - EBACKGROUND = _HURD_ERRNO (100), -#define EBACKGROUND _HURD_ERRNO (100)/* Inappropriate operation for background process */ - EDIED = _HURD_ERRNO (101), -#define EDIED _HURD_ERRNO (101)/* Translator died */ - ED = _HURD_ERRNO (102), -#define ED _HURD_ERRNO (102)/* ? */ - EGREGIOUS = _HURD_ERRNO (103), -#define EGREGIOUS _HURD_ERRNO (103)/* You really blew it this time */ - EIEIO = _HURD_ERRNO (104), -#define EIEIO _HURD_ERRNO (104)/* Computer bought the farm */ - EGRATUITOUS = _HURD_ERRNO (105), -#define EGRATUITOUS _HURD_ERRNO (105)/* Gratuitous error */ - EBADMSG = _HURD_ERRNO (107), -#define EBADMSG _HURD_ERRNO (107)/* Bad message */ - EIDRM = _HURD_ERRNO (108), -#define EIDRM _HURD_ERRNO (108)/* Identifier removed */ - EMULTIHOP = _HURD_ERRNO (109), -#define EMULTIHOP _HURD_ERRNO (109)/* Multihop attempted */ - ENODATA = _HURD_ERRNO (110), -#define ENODATA _HURD_ERRNO (110)/* No data available */ - ENOLINK = _HURD_ERRNO (111), -#define ENOLINK _HURD_ERRNO (111)/* Link has been severed */ - ENOMSG = _HURD_ERRNO (112), -#define ENOMSG _HURD_ERRNO (112)/* No message of desired type */ - ENOSR = _HURD_ERRNO (113), -#define ENOSR _HURD_ERRNO (113)/* Out of streams resources */ - ENOSTR = _HURD_ERRNO (114), -#define ENOSTR _HURD_ERRNO (114)/* Device not a stream */ - EOVERFLOW = _HURD_ERRNO (115), -#define EOVERFLOW _HURD_ERRNO (115)/* Value too large for defined data type */ - EPROTO = _HURD_ERRNO (116), -#define EPROTO _HURD_ERRNO (116)/* Protocol error */ - ETIME = _HURD_ERRNO (117), -#define ETIME _HURD_ERRNO (117)/* Timer expired */ - - /* Errors from . */ - EMACH_SEND_IN_PROGRESS = 0x10000001, - EMACH_SEND_INVALID_DATA = 0x10000002, - EMACH_SEND_INVALID_DEST = 0x10000003, - EMACH_SEND_TIMED_OUT = 0x10000004, - EMACH_SEND_WILL_NOTIFY = 0x10000005, - EMACH_SEND_NOTIFY_IN_PROGRESS = 0x10000006, - EMACH_SEND_INTERRUPTED = 0x10000007, - EMACH_SEND_MSG_TOO_SMALL = 0x10000008, - EMACH_SEND_INVALID_REPLY = 0x10000009, - EMACH_SEND_INVALID_RIGHT = 0x1000000a, - EMACH_SEND_INVALID_NOTIFY = 0x1000000b, - EMACH_SEND_INVALID_MEMORY = 0x1000000c, - EMACH_SEND_NO_BUFFER = 0x1000000d, - EMACH_SEND_NO_NOTIFY = 0x1000000e, - EMACH_SEND_INVALID_TYPE = 0x1000000f, - EMACH_SEND_INVALID_HEADER = 0x10000010, - EMACH_RCV_IN_PROGRESS = 0x10004001, - EMACH_RCV_INVALID_NAME = 0x10004002, - EMACH_RCV_TIMED_OUT = 0x10004003, - EMACH_RCV_TOO_LARGE = 0x10004004, - EMACH_RCV_INTERRUPTED = 0x10004005, - EMACH_RCV_PORT_CHANGED = 0x10004006, - EMACH_RCV_INVALID_NOTIFY = 0x10004007, - EMACH_RCV_INVALID_DATA = 0x10004008, - EMACH_RCV_PORT_DIED = 0x10004009, - EMACH_RCV_IN_SET = 0x1000400a, - EMACH_RCV_HEADER_ERROR = 0x1000400b, - EMACH_RCV_BODY_ERROR = 0x1000400c, - - /* Errors from . */ - EKERN_INVALID_ADDRESS = 1, - EKERN_PROTECTION_FAILURE = 2, - EKERN_NO_SPACE = 3, - EKERN_INVALID_ARGUMENT = 4, - EKERN_FAILURE = 5, - EKERN_RESOURCE_SHORTAGE = 6, - EKERN_NOT_RECEIVER = 7, - EKERN_NO_ACCESS = 8, - EKERN_MEMORY_FAILURE = 9, - EKERN_MEMORY_ERROR = 10, - EKERN_NOT_IN_SET = 12, - EKERN_NAME_EXISTS = 13, - EKERN_ABORTED = 14, - EKERN_INVALID_NAME = 15, - EKERN_INVALID_TASK = 16, - EKERN_INVALID_RIGHT = 17, - EKERN_INVALID_VALUE = 18, - EKERN_UREFS_OVERFLOW = 19, - EKERN_INVALID_CAPABILITY = 20, - EKERN_RIGHT_EXISTS = 21, - EKERN_INVALID_HOST = 22, - EKERN_MEMORY_PRESENT = 23, - EKERN_WRITE_PROTECTION_FAILURE = 24, - EKERN_TERMINATED = 26, - - /* Errors from . */ - EMIG_TYPE_ERROR = -300, /* client type check failure */ - EMIG_REPLY_MISMATCH = -301, /* wrong reply message ID */ - EMIG_REMOTE_ERROR = -302, /* server detected error */ - EMIG_BAD_ID = -303, /* bad request message ID */ - EMIG_BAD_ARGUMENTS = -304, /* server type check failure */ - EMIG_NO_REPLY = -305, /* no reply should be sent */ - EMIG_EXCEPTION = -306, /* server raised exception */ - EMIG_ARRAY_TOO_LARGE = -307, /* array not large enough */ - EMIG_SERVER_DIED = -308, /* server died */ - EMIG_DESTROY_REQUEST = -309, /* destroy request with no reply */ - - /* Errors from . */ - ED_IO_ERROR = 2500, /* hardware IO error */ - ED_WOULD_BLOCK = 2501, /* would block, but D_NOWAIT set */ - ED_NO_SUCH_DEVICE = 2502, /* no such device */ - ED_ALREADY_OPEN = 2503, /* exclusive-use device already open */ - ED_DEVICE_DOWN = 2504, /* device has been shut down */ - ED_INVALID_OPERATION = 2505, /* bad operation for device */ - ED_INVALID_RECNUM = 2506, /* invalid record (block) number */ - ED_INVALID_SIZE = 2507, /* invalid IO size */ - ED_NO_MEMORY = 2508, /* memory allocation failure */ - ED_READ_ONLY = 2509, /* device cannot be written to */ - -}; - -#define _HURD_ERRNOS 118 - -/* User-visible type of error codes. It is ok to use `int' or - `kern_return_t' for these, but with `error_t' the debugger prints - symbolic values. */ -#ifdef __USE_GNU -typedef enum __error_t_codes error_t; -#define __error_t_defined 1 -#endif - -/* errno is a per-thread variable. */ -#include -#define errno (*__hurd_errno_location ()) -#define __set_errno(val) errno = (val) - -#endif /* included. */ - -#if !defined (_ERRNO_H) && defined (__need_Emath) -#define EDOM _HURD_ERRNO (33)/* Numerical argument out of domain */ -#define ERANGE _HURD_ERRNO (34)/* Numerical result out of range */ -#endif /* not included and need math error codes. */ diff --git a/sysdeps/mach/hurd/fcntlbits.h b/sysdeps/mach/hurd/fcntlbits.h deleted file mode 100644 index 9906c97..0000000 --- a/sysdeps/mach/hurd/fcntlbits.h +++ /dev/null @@ -1,179 +0,0 @@ -/* O_*, F_*, FD_* bit values for GNU. - Copyright (C) 1993, 1994, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _FCNTLBITS_H - -#define _FCNTLBITS_H 1 - - -/* File access modes. These are understood by io servers; they can be - passed in `dir_lookup', and are returned by `io_get_openmodes'. - Consequently they can be passed to `open', `hurd_file_name_lookup', and - `file_name_lookup'; and are returned by `fcntl' with the F_GETFL - command. */ - -/* In GNU, read and write are bits (unlike BSD). */ -#ifdef __USE_GNU -#define O_READ O_RDONLY /* Open for reading. */ -#define O_WRITE O_WRONLY /* Open for writing. */ -#define O_EXEC 0x0004 /* Open for execution. */ -#define O_NORW 0 /* Open without R/W access. */ -#endif -/* POSIX.1 standard names. */ -#define O_RDONLY 0x0001 /* Open read-only. */ -#define O_WRONLY 0x0002 /* Open write-only. */ -#define O_RDWR (O_RDONLY|O_WRONLY) /* Open for reading and writing. */ -#define O_ACCMODE O_RDWR /* Mask for file access modes. */ - - - -/* File name translation flags. These are understood by io servers; - they can be passed in `dir_lookup', and consequently to `open', - `hurd_file_name_lookup', and `file_name_lookup'. */ - -#define O_CREAT 0x0010 /* Create file if it doesn't exist. */ -#define O_EXCL 0x0020 /* Fail if file already exists. */ -#ifdef __USE_GNU -#define O_NOLINK 0x0040 /* No name mappings on final component. */ -#define O_NOTRANS 0x0080 /* No translator on final component. */ -#endif - - -/* I/O operating modes. These are understood by io servers; they can be - passed in `dir_lookup' and set or fetched with `io_*_openmodes'. - Consequently they can be passed to `open', `hurd_file_name_lookup', - `file_name_lookup', and `fcntl' with the F_SETFL command; and are - returned by `fcntl' with the F_GETFL command. */ - -#define O_APPEND 0x0100 /* Writes always append to the file. */ -#ifdef __USE_BSD -#define O_ASYNC 0x0200 /* Send SIGIO to owner when data is ready. */ -#define O_FSYNC 0x0400 /* Synchronous writes. */ -#define O_SYNC O_FSYNC -#endif -#ifdef __USE_GNU -#define O_NOATIME 0x0800 /* Don't set access time on read (owner). */ -#endif -#ifdef __USE_MISC -#define O_SHLOCK 0x00020000 /* Open with shared file lock. */ -#define O_EXLOCK 0x00040000 /* Open with exclusive file lock. */ -#endif - - -/* The name O_NONBLOCK is unfortunately overloaded; it is both a file name - translation flag and an I/O operating mode. O_NDELAY is the deprecated - BSD name for the same flag, overloaded in the same way. - - When used in `dir_lookup' (and consequently `open', `hurd_file_name_lookup', - or `file_name_lookup'), O_NONBLOCK says the open should return immediately - instead of blocking for any significant length of time (e.g., to wait - for carrier detect on a serial line). It is also saved as an I/O - operating mode, and after open has the following meaning. - - When used in `io_*_openmodes' (and consequently `fcntl' with the F_SETFL - command), the O_NONBLOCK flag means to do nonblocking i/o: any i/o - operation that would block for any significant length of time will instead - fail with EAGAIN. */ - -#define O_NONBLOCK 0x0008 /* Non-blocking open or non-blocking I/O. */ -#ifdef __USE_BSD -#define O_NDELAY O_NONBLOCK /* Deprecated. */ -#endif - - -#ifdef __USE_GNU -/* Mask of bits which are understood by io servers. */ -#define O_HURD (0xffff | O_EXLOCK | O_SHLOCK) -#endif - - -/* Open-time action flags. These are understood by `hurd_file_name_lookup' - and consequently by `open' and `file_name_lookup'. They are not preserved - once the file has been opened. */ - -#define O_TRUNC 0x00010000 /* Truncate file to zero length. */ - - -/* Controlling terminal flags. These are understood only by `open', - and are not preserved once the file has been opened. */ - -#ifdef __USE_GNU -#define O_IGNORE_CTTY 0x00080000 /* Don't do any ctty magic at all. */ -#endif -/* `open' never assigns a controlling terminal in GNU. */ -#define O_NOCTTY 0 /* Don't assign a controlling terminal. */ - - -#ifdef __USE_BSD -/* Bits in the file status flags returned by F_GETFL. */ -#define FREAD O_RDONLY -#define FWRITE O_WRONLY - -/* Traditional BSD names the O_* bits. */ -#define FASYNC O_ASYNC -#define FCREAT O_CREAT -#define FEXCL O_EXCL -#define FTRUNC O_TRUNC -#define FNOCTTY O_NOCTTY -#define FFSYNC O_FSYNC -#define FSYNC O_SYNC -#define FAPPEND O_APPEND -#define FNONBLOCK O_NONBLOCK -#define FNDELAY O_NDELAY -#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. */ -#ifdef __USE_BSD -#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */ -#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */ -#endif -#define F_GETLK 7 /* Get record locking info. */ -#define F_SETLK 8 /* Set record locking info (non-blocking). */ -#define F_SETLKW 9 /* Set record locking info (blocking). */ - -/* File descriptor flags used with F_GETFD and F_SETFD. */ -#define FD_CLOEXEC 1 /* Close on exec. */ - - -#include - -/* The structure describing an advisory lock. This is the type of the third - argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ -struct flock - { - int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ - int l_whence; /* Where `l_start' is relative to (like `lseek'). */ - __off_t l_start; /* Offset where the lock begins. */ - __off_t l_len; /* Size of the locked area; zero means until EOF. */ - __pid_t l_pid; /* Process holding the lock. */ - }; - -/* Values for the `l_type' field of a `struct flock'. */ -#define F_RDLCK 1 /* Read lock. */ -#define F_WRLCK 2 /* Write lock. */ -#define F_UNLCK 3 /* Remove lock. */ - - -#endif /* fcntlbits.h */ diff --git a/sysdeps/mach/hurd/hppa/bits/sigcontext.h b/sysdeps/mach/hurd/hppa/bits/sigcontext.h new file mode 100644 index 0000000..b616469 --- /dev/null +++ b/sysdeps/mach/hurd/hppa/bits/sigcontext.h @@ -0,0 +1,86 @@ +/* Machine-dependent signal context structure for GNU Hurd. HPPA version. +Copyright (C) 1995 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 Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* Signal handlers are actually called: + void handler (int sig, int code, struct sigcontext *scp); */ + +/* State of this thread when the signal was taken. */ +struct sigcontext + { + /* These first members are machine-independent. */ + + int sc_onstack; /* Nonzero if running on sigstack. */ + __sigset_t sc_mask; /* Blocked signals to restore. */ + + /* MiG reply port this thread is using. */ + unsigned int sc_reply_port; + + /* Port this thread is doing an interruptible RPC on. */ + unsigned int sc_intr_port; + + /* Error code associated with this signal (interpreted as `error_t'). */ + int sc_error; + + /* All following members are machine-dependent. The rest of this + structure is written to be laid out identically to a `struct + parisc_thread_state'. trampoline.c knows this, so it must be + changed if this changes. */ + +#define sc_parisc_thread_state sc_flags /* Beginning of correspondence. */ + /* "General" registers $1..$31. */ + unsigned int sc_regs[31]; + + /* Control registers. */ + unsigned int sc_cr11; /* sar */ + /* These four registers make up the PC. */ + unsigned int iioq_head; + unsigned int iisq_head; + unsigned int iioq_tail; + unsigned int iisq_tail; + unsigned int sc_cr15; + unsigned int sc_cr19; + unsigned int sc_cr20; + unsigned int sc_cr21; + unsigned int sc_cr22; /* ipsw */ + unsigned int sc_bsd_goto; /* unused */ + unsigned int sc_sr4; + unsigned int sc_sr0; + unsigned int sc_sr1; + unsigned int sc_sr2; + unsigned int sc_sr3; + unsigned int sc_sr5; + unsigned int sc_sr6; + unsigned int sc_sr7; + unsigned int sc_cr0; + unsigned int sc_cr8; + unsigned int sc_cr9; + unsigned int sc_cr10; /* unused */ + unsigned int sc_cr12; + unsigned int sc_cr13; + unsigned int sc_cr24; /* unused */ + unsigned int sc_cr25; /* unused */ + unsigned int sc_cr26; /* unused */ + unsigned sc_mpsfu_high; /* unused */ + unsigned sc_mpsfu_low; /* unused */ + unsigned sc_mpsfu_ovflo; /* unused */ + int sc_pad; + + /* Floating point registers $f0..$f31. */ + double sc_fpregs[32]; + }; diff --git a/sysdeps/mach/hurd/hppa/sigcontext.h b/sysdeps/mach/hurd/hppa/sigcontext.h deleted file mode 100644 index b616469..0000000 --- a/sysdeps/mach/hurd/hppa/sigcontext.h +++ /dev/null @@ -1,86 +0,0 @@ -/* Machine-dependent signal context structure for GNU Hurd. HPPA version. -Copyright (C) 1995 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 Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* Signal handlers are actually called: - void handler (int sig, int code, struct sigcontext *scp); */ - -/* State of this thread when the signal was taken. */ -struct sigcontext - { - /* These first members are machine-independent. */ - - int sc_onstack; /* Nonzero if running on sigstack. */ - __sigset_t sc_mask; /* Blocked signals to restore. */ - - /* MiG reply port this thread is using. */ - unsigned int sc_reply_port; - - /* Port this thread is doing an interruptible RPC on. */ - unsigned int sc_intr_port; - - /* Error code associated with this signal (interpreted as `error_t'). */ - int sc_error; - - /* All following members are machine-dependent. The rest of this - structure is written to be laid out identically to a `struct - parisc_thread_state'. trampoline.c knows this, so it must be - changed if this changes. */ - -#define sc_parisc_thread_state sc_flags /* Beginning of correspondence. */ - /* "General" registers $1..$31. */ - unsigned int sc_regs[31]; - - /* Control registers. */ - unsigned int sc_cr11; /* sar */ - /* These four registers make up the PC. */ - unsigned int iioq_head; - unsigned int iisq_head; - unsigned int iioq_tail; - unsigned int iisq_tail; - unsigned int sc_cr15; - unsigned int sc_cr19; - unsigned int sc_cr20; - unsigned int sc_cr21; - unsigned int sc_cr22; /* ipsw */ - unsigned int sc_bsd_goto; /* unused */ - unsigned int sc_sr4; - unsigned int sc_sr0; - unsigned int sc_sr1; - unsigned int sc_sr2; - unsigned int sc_sr3; - unsigned int sc_sr5; - unsigned int sc_sr6; - unsigned int sc_sr7; - unsigned int sc_cr0; - unsigned int sc_cr8; - unsigned int sc_cr9; - unsigned int sc_cr10; /* unused */ - unsigned int sc_cr12; - unsigned int sc_cr13; - unsigned int sc_cr24; /* unused */ - unsigned int sc_cr25; /* unused */ - unsigned int sc_cr26; /* unused */ - unsigned sc_mpsfu_high; /* unused */ - unsigned sc_mpsfu_low; /* unused */ - unsigned sc_mpsfu_ovflo; /* unused */ - int sc_pad; - - /* Floating point registers $f0..$f31. */ - double sc_fpregs[32]; - }; diff --git a/sysdeps/mach/hurd/i386/bits/sigcontext.h b/sysdeps/mach/hurd/i386/bits/sigcontext.h new file mode 100644 index 0000000..b742326 --- /dev/null +++ b/sysdeps/mach/hurd/i386/bits/sigcontext.h @@ -0,0 +1,106 @@ +/* Machine-dependent signal context structure for GNU Hurd. i386 version. +Copyright (C) 1991, 1992, 1994 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 Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* Signal handlers are actually called: + void handler (int sig, int code, struct sigcontext *scp); */ + +#include + +/* State of this thread when the signal was taken. */ +struct sigcontext + { + /* These first members are machine-independent. */ + + int sc_onstack; /* Nonzero if running on sigstack. */ + __sigset_t sc_mask; /* Blocked signals to restore. */ + + /* MiG reply port this thread is using. */ + unsigned int sc_reply_port; + + /* Port this thread is doing an interruptible RPC on. */ + unsigned int sc_intr_port; + + /* Error code associated with this signal (interpreted as `error_t'). */ + int sc_error; + + /* All following members are machine-dependent. The rest of this + structure is written to be laid out identically to: + { + struct i386_thread_state basic; + struct i386_float_state fpu; + } + trampoline.c knows this, so it must be changed if this changes. */ + +#define sc_i386_thread_state sc_gs /* Beginning of correspondence. */ + /* Segment registers. */ + int sc_gs; + int sc_fs; + int sc_es; + int sc_ds; + + /* "General" registers. These members are in the order that the i386 + `pusha' and `popa' instructions use (`popa' ignores %esp). */ + int sc_edi; + int sc_esi; + int sc_ebp; + int sc_esp; /* Not used; sc_uesp is used instead. */ + int sc_ebx; + int sc_edx; + int sc_ecx; + int sc_eax; + + int sc_eip; /* Instruction pointer. */ + int sc_cs; /* Code segment register. */ + + int sc_efl; /* Processor flags. */ + + int sc_uesp; /* This stack pointer is used. */ + int sc_ss; /* Stack segment register. */ + + /* Following mimics struct i386_float_state. Structures and symbolic + values can be found in . */ +#define sc_i386_float_state sc_fpkind + int sc_fpkind; /* FP_NO, FP_387, etc. */ + int sc_fpused; /* If zero, ignore rest of float state. */ + struct i386_fp_save sc_fpsave; + struct i386_fp_regs sc_fpregs; + int sc_fpexcsr; /* FPSR including exception bits. */ + }; + + +/* Codes for SIGFPE. */ +#define FPE_INTOVF_TRAP 0x1 /* integer overflow */ +#define FPE_INTDIV_FAULT 0x2 /* integer divide by zero */ +#define FPE_FLTOVF_FAULT 0x3 /* floating overflow */ +#define FPE_FLTDIV_FAULT 0x4 /* floating divide by zero */ +#define FPE_FLTUND_FAULT 0x5 /* floating underflow */ +#define FPE_SUBRNG_FAULT 0x7 /* BOUNDS instruction failed */ +#define FPE_FLTDNR_FAULT 0x8 /* denormalized operand */ +#define FPE_FLTINX_FAULT 0x9 /* floating loss of precision */ +#define FPE_EMERR_FAULT 0xa /* mysterious emulation error 33 */ +#define FPE_EMBND_FAULT 0xb /* emulation BOUNDS instruction failed */ + +/* Codes for SIGILL. */ +#define ILL_INVOPR_FAULT 0x1 /* invalid operation */ +#define ILL_STACK_FAULT 0x2 /* fault on microkernel stack access */ +#define ILL_FPEOPR_FAULT 0x3 /* invalid floating operation */ + +/* Codes for SIGTRAP. */ +#define DBG_SINGLE_TRAP 0x1 /* single step */ +#define DBG_BRKPNT_FAULT 0x2 /* breakpoint instruction */ diff --git a/sysdeps/mach/hurd/i386/sigcontext.h b/sysdeps/mach/hurd/i386/sigcontext.h deleted file mode 100644 index b742326..0000000 --- a/sysdeps/mach/hurd/i386/sigcontext.h +++ /dev/null @@ -1,106 +0,0 @@ -/* Machine-dependent signal context structure for GNU Hurd. i386 version. -Copyright (C) 1991, 1992, 1994 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 Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* Signal handlers are actually called: - void handler (int sig, int code, struct sigcontext *scp); */ - -#include - -/* State of this thread when the signal was taken. */ -struct sigcontext - { - /* These first members are machine-independent. */ - - int sc_onstack; /* Nonzero if running on sigstack. */ - __sigset_t sc_mask; /* Blocked signals to restore. */ - - /* MiG reply port this thread is using. */ - unsigned int sc_reply_port; - - /* Port this thread is doing an interruptible RPC on. */ - unsigned int sc_intr_port; - - /* Error code associated with this signal (interpreted as `error_t'). */ - int sc_error; - - /* All following members are machine-dependent. The rest of this - structure is written to be laid out identically to: - { - struct i386_thread_state basic; - struct i386_float_state fpu; - } - trampoline.c knows this, so it must be changed if this changes. */ - -#define sc_i386_thread_state sc_gs /* Beginning of correspondence. */ - /* Segment registers. */ - int sc_gs; - int sc_fs; - int sc_es; - int sc_ds; - - /* "General" registers. These members are in the order that the i386 - `pusha' and `popa' instructions use (`popa' ignores %esp). */ - int sc_edi; - int sc_esi; - int sc_ebp; - int sc_esp; /* Not used; sc_uesp is used instead. */ - int sc_ebx; - int sc_edx; - int sc_ecx; - int sc_eax; - - int sc_eip; /* Instruction pointer. */ - int sc_cs; /* Code segment register. */ - - int sc_efl; /* Processor flags. */ - - int sc_uesp; /* This stack pointer is used. */ - int sc_ss; /* Stack segment register. */ - - /* Following mimics struct i386_float_state. Structures and symbolic - values can be found in . */ -#define sc_i386_float_state sc_fpkind - int sc_fpkind; /* FP_NO, FP_387, etc. */ - int sc_fpused; /* If zero, ignore rest of float state. */ - struct i386_fp_save sc_fpsave; - struct i386_fp_regs sc_fpregs; - int sc_fpexcsr; /* FPSR including exception bits. */ - }; - - -/* Codes for SIGFPE. */ -#define FPE_INTOVF_TRAP 0x1 /* integer overflow */ -#define FPE_INTDIV_FAULT 0x2 /* integer divide by zero */ -#define FPE_FLTOVF_FAULT 0x3 /* floating overflow */ -#define FPE_FLTDIV_FAULT 0x4 /* floating divide by zero */ -#define FPE_FLTUND_FAULT 0x5 /* floating underflow */ -#define FPE_SUBRNG_FAULT 0x7 /* BOUNDS instruction failed */ -#define FPE_FLTDNR_FAULT 0x8 /* denormalized operand */ -#define FPE_FLTINX_FAULT 0x9 /* floating loss of precision */ -#define FPE_EMERR_FAULT 0xa /* mysterious emulation error 33 */ -#define FPE_EMBND_FAULT 0xb /* emulation BOUNDS instruction failed */ - -/* Codes for SIGILL. */ -#define ILL_INVOPR_FAULT 0x1 /* invalid operation */ -#define ILL_STACK_FAULT 0x2 /* fault on microkernel stack access */ -#define ILL_FPEOPR_FAULT 0x3 /* invalid floating operation */ - -/* Codes for SIGTRAP. */ -#define DBG_SINGLE_TRAP 0x1 /* single step */ -#define DBG_BRKPNT_FAULT 0x2 /* breakpoint instruction */ diff --git a/sysdeps/mach/hurd/ioctl.c b/sysdeps/mach/hurd/ioctl.c index 4646c42..1a7c42a 100644 --- a/sysdeps/mach/hurd/ioctl.c +++ b/sysdeps/mach/hurd/ioctl.c @@ -39,7 +39,7 @@ __ioctl (int fd, unsigned long int request, ...) /* Map individual type fields to Mach IPC types. */ static const int mach_types[] = { MACH_MSG_TYPE_CHAR, MACH_MSG_TYPE_INTEGER_16, MACH_MSG_TYPE_INTEGER_32, - -1 }; + MACH_MSG_TYPE_INTEGER_64 }; #define io2mach_type(count, type) \ ((mach_msg_type_t) { mach_types[type], typesize (type) * 8, count, 1, 0, 0 }) @@ -47,12 +47,14 @@ __ioctl (int fd, unsigned long int request, ...) unsigned int type = _IOC_TYPE (request); /* Message buffer. */ +#define msg_align(x) \ + (((x) + sizeof (mach_msg_type_t) - 1) & ~(sizeof (mach_msg_type_t) - 1)) struct { mig_reply_header_t header; char data[3 * sizeof (mach_msg_type_t) + - _IOT_COUNT0 (type) * typesize (_IOT_TYPE0 (type)) + - _IOT_COUNT1 (type) * typesize (_IOT_TYPE1 (type)) + + msg_align (_IOT_COUNT0 (type) * typesize (_IOT_TYPE0 (type))) + + msg_align (_IOT_COUNT1 (type) * typesize (_IOT_TYPE1 (type))) + _IOT_COUNT2 (type) * typesize (_IOT_TYPE2 (type))]; } msg; mach_msg_header_t *const m = &msg.header.Head; diff --git a/sysdeps/mach/hurd/ioctls.h b/sysdeps/mach/hurd/ioctls.h deleted file mode 100644 index f6bb4b4..0000000 --- a/sysdeps/mach/hurd/ioctls.h +++ /dev/null @@ -1,349 +0,0 @@ -/* Copyright (C) 1992, 1993, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#ifndef _IOCTLS_H - -#define _IOCTLS_H 1 - -/* These macros are also defined in termbits.h (with numerically - identical values) but this serves to shut up cpp's complaining. */ -#ifdef MDMBUF -#undef MDMBUF -#endif -#ifdef ECHO -#undef ECHO -#endif -#ifdef TOSTOP -#undef TOSTOP -#endif -#ifdef FLUSHO -#undef FLUSHO -#endif -#ifdef PENDIN -#undef PENDIN -#endif -#ifdef NOFLSH -#undef NOFLSH -#endif - -/* Hurd ioctl request are made up of several fields: - - 10987654321098765432109876543210 - IOt0t1t2cc0c0cc1c1cc2ggggccccccc - - bits [31,30]: inout direction (enum __ioctl_dir) - bits [29,11]: type encoding as follows; zero count indicates omitted datum - [29,28]: datum #0 type (enum __ioctl_datum) - [27,26]: datum #1 type (enum __ioctl_datum) - [24,25]: datum #2 type (enum __ioctl_datum) - [23,19]: datum #0 count [0,31] - [18,14]: datum #1 count [0,31] - [13,11]: datum #2 count [0,3] - bits [07,10]: group (letter - 'f': ['f','v']) - bits [00,06]: command [0,127] - - The following macros construct and dissect these fields. */ - -enum __ioctl_dir - { - IOC_VOID = 0, /* No parameters. */ - IOC_OUT = 1, /* Data is written into the user's buffer. */ - IOC_IN = 2, /* Data is read from the user's buffer. */ - IOC_INOUT = (IOC_IN|IOC_OUT) - }; - -enum __ioctl_datum { IOC_8, IOC_16, IOC_32 }; - -/* Construct an ioctl from constructed type plus other fields. */ -#define _IOC(inout, group, num, type) \ - ((num) | ((((group) - 'f') | ((type) | (inout) << 19) << 4) << 7)) - -/* Dissect an ioctl into its component fields. */ -#define _IOC_INOUT(request) (((unsigned int) (request) >> 30) & IOC_INOUT) -#define _IOC_GROUP(request) ('f' + (((unsigned int) (request) >> 7) & 0xf)) -#define _IOC_COMMAND(request) ((unsigned int) (request) & 0x7f) -#define _IOC_TYPE(request) (((unsigned int) (request) >> 11) & 0x7ffff) -#define _IOC_NOTYPE(request) ((unsigned int) (request) & 0x3ff) - -/* Construct a type information field from - the broken-out type and count fields. */ -#define _IOT(t0, c0, t1, c1, t2, c2) \ - ((c2) | (((c1) | ((c0) | ((t2) | ((t1) | (t0) << 2) << 2) << 5) << 5) << 3)) - -/* Dissect a type information field into the type and count fields. */ -#define _IOT_TYPE0(type) (((unsigned int) (type) >> 17) & 3) -#define _IOT_TYPE1(type) (((unsigned int) (type) >> 15) & 3) -#define _IOT_TYPE2(type) (((unsigned int) (type) >> 13) & 3) -#define _IOT_COUNT0(type) (((unsigned int) (type) >> 8) & 0x1f) -#define _IOT_COUNT1(type) (((unsigned int) (type) >> 3) & 0x1f) -#define _IOT_COUNT2(type) (((unsigned int) (type) >> 0) & 7) - -/* Construct an ioctl from all the broken-out fields. */ -#define _IOCT(inout, group, num, t0, c0, t1, c1, t2, c2) \ - _IOC ((inout), (group), (num), _IOT ((t0), (c0), (t1), (c1), (t2), (c2))) - -/* Standard flavors of ioctls. - _IOT_foobar is defined either in this file, - or where struct foobar is defined. */ -#define _IO(g, n) _IOC (IOC_VOID, (g), (n), 0) -#define _IOR(g, n, t) _IOC (IOC_OUT, (g), (n), _IOT_##t) -#define _IOW(g, n, t) _IOC (IOC_IN, (g), (n), _IOT_##t) -#define _IOWR(g, n, t) _IOC (IOC_INOUT, (g), (n), _IOT_##t) - -/* Construct an individual type field for TYPE. */ -#define _IOTS(type) (sizeof (type) >> 1) - -/* Construct a type information field for - a single argument of the scalar TYPE. */ -#define _IOT_SIMPLE(type) _IOT (_IOTS (type), 1, 0, 0, 0, 0) - -/* Basic C types. */ -#define _IOT_int _IOT_SIMPLE (int) -#define _IOT_char _IOT_SIMPLE (char) -#define _IOT_short _IOT_SIMPLE (short) - - -/* ioctls verbatim from 4.4 , with `struct' keywords removed. */ - -#define TIOCMODG _IOR('t', 3, int) /* get modem control state */ -#define TIOCMODS _IOW('t', 4, int) /* set modem control state */ -#define TIOCM_LE 0001 /* line enable */ -#define TIOCM_DTR 0002 /* data terminal ready */ -#define TIOCM_RTS 0004 /* request to send */ -#define TIOCM_ST 0010 /* secondary transmit */ -#define TIOCM_SR 0020 /* secondary receive */ -#define TIOCM_CTS 0040 /* clear to send */ -#define TIOCM_CAR 0100 /* carrier detect */ -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RNG 0200 /* ring */ -#define TIOCM_RI TIOCM_RNG -#define TIOCM_DSR 0400 /* data set ready */ - /* 8-10 compat */ -#define TIOCEXCL _IO('t', 13) /* set exclusive use of tty */ -#define TIOCNXCL _IO('t', 14) /* reset exclusive use of tty */ - /* 15 unused */ -#define TIOCFLUSH _IOW('t', 16, int) /* flush buffers */ - /* 17-18 compat */ -#define TIOCGETA _IOR('t', 19, termios) /* get termios struct */ -#define TIOCSETA _IOW('t', 20, termios) /* set termios struct */ -#define TIOCSETAW _IOW('t', 21, termios) /* drain output, set */ -#define TIOCSETAF _IOW('t', 22, termios) /* drn out, fls in, set */ -#define TIOCGETD _IOR('t', 26, int) /* get line discipline */ -#define TIOCSETD _IOW('t', 27, int) /* set line discipline */ - /* 127-124 compat */ -#define TIOCSBRK _IO('t', 123) /* set break bit */ -#define TIOCCBRK _IO('t', 122) /* clear break bit */ -#define TIOCSDTR _IO('t', 121) /* set data terminal ready */ -#define TIOCCDTR _IO('t', 120) /* clear data terminal ready */ -#define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */ -#define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */ - /* 117-116 compat */ -#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ -#define TIOCSTI _IOW('t', 114, char) /* simulate terminal input */ -#define TIOCNOTTY _IO('t', 113) /* void tty association */ -#define TIOCPKT _IOW('t', 112, int) /* pty: set/clear packet mode */ -#define TIOCPKT_DATA 0x00 /* data packet */ -#define TIOCPKT_FLUSHREAD 0x01 /* flush packet */ -#define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */ -#define TIOCPKT_STOP 0x04 /* stop output */ -#define TIOCPKT_START 0x08 /* start output */ -#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */ -#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */ -#define TIOCPKT_IOCTL 0x40 /* state change of pty driver */ -#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ -#define TIOCSTART _IO('t', 110) /* start output, like ^Q */ -#define TIOCMSET _IOW('t', 109, int) /* set all modem bits */ -#define TIOCMBIS _IOW('t', 108, int) /* bis modem bits */ -#define TIOCMBIC _IOW('t', 107, int) /* bic modem bits */ -#define TIOCMGET _IOR('t', 106, int) /* get all modem bits */ -#define TIOCREMOTE _IOW('t', 105, int) /* remote input editing */ -#define TIOCGWINSZ _IOR('t', 104, winsize) /* get window size */ -#define TIOCSWINSZ _IOW('t', 103, winsize) /* set window size */ -#define TIOCUCNTL _IOW('t', 102, int) /* pty: set/clr usr cntl mode */ -#define UIOCCMD(n) _IO('u', n) /* usr cntl op "n" */ -#define TIOCCONS _IOW('t', 98, int) /* become virtual console */ -#define TIOCSCTTY _IO('t', 97) /* become controlling tty */ -#define TIOCEXT _IOW('t', 96, int) /* pty: external processing */ -#define TIOCSIG _IO('t', 95) /* pty: generate signal */ -#define TIOCDRAIN _IO('t', 94) /* wait till output drained */ - -#define TTYDISC 0 /* termios tty line discipline */ -#define TABLDISC 3 /* tablet discipline */ -#define SLIPDISC 4 /* serial IP discipline */ - - -#define FIOCLEX _IO('f', 1) /* set close on exec on fd */ -#define FIONCLEX _IO('f', 2) /* remove close on exec */ -#define FIONREAD _IOR('f', 127, int) /* get # bytes to read */ -#define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */ -#define FIOASYNC _IOW('f', 125, int) /* set/clear async i/o */ -#define FIOSETOWN _IOW('f', 124, int) /* set owner */ -#define FIOGETOWN _IOR('f', 123, int) /* get owner */ - -/* socket i/o controls */ -#define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */ -#define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */ -#define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */ -#define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */ -#define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */ -#define SIOCSPGRP _IOW('s', 8, int) /* set process group */ -#define SIOCGPGRP _IOR('s', 9, int) /* get process group */ - -#define SIOCADDRT _IOW('r', 10, ortentry) /* add route */ -#define SIOCDELRT _IOW('r', 11, ortentry) /* delete route */ - -#define SIOCSIFADDR _IOW('i', 12, ifreq) /* set ifnet address */ -#define OSIOCGIFADDR _IOWR('i',13, ifreq) /* get ifnet address */ -#define SIOCGIFADDR _IOWR('i',33, ifreq) /* get ifnet address */ -#define SIOCSIFDSTADDR _IOW('i', 14, ifreq) /* set p-p address */ -#define OSIOCGIFDSTADDR _IOWR('i',15, ifreq) /* get p-p address */ -#define SIOCGIFDSTADDR _IOWR('i',34, ifreq) /* get p-p address */ -#define SIOCSIFFLAGS _IOW('i', 16, ifreq) /* set ifnet flags */ -#define SIOCGIFFLAGS _IOWR('i',17, ifreq) /* get ifnet flags */ -#define OSIOCGIFBRDADDR _IOWR('i',18, ifreq) /* get broadcast addr */ -#define SIOCGIFBRDADDR _IOWR('i',35, ifreq) /* get broadcast addr */ -#define SIOCSIFBRDADDR _IOW('i',19, ifreq) /* set broadcast addr */ -#define OSIOCGIFCONF _IOWR('i',20, ifconf) /* get ifnet list */ -#define SIOCGIFCONF _IOWR('i',36, ifconf) /* get ifnet list */ -#define OSIOCGIFNETMASK _IOWR('i',21, ifreq) /* get net addr mask */ -#define SIOCGIFNETMASK _IOWR('i',37, ifreq) /* get net addr mask */ -#define SIOCSIFNETMASK _IOW('i',22, ifreq) /* set net addr mask */ -#define SIOCGIFMETRIC _IOWR('i',23, ifreq) /* get IF metric */ -#define SIOCSIFMETRIC _IOW('i',24, ifreq) /* set IF metric */ -#define SIOCDIFADDR _IOW('i',25, ifreq) /* delete IF addr */ -#define SIOCAIFADDR _IOW('i',26, ifaliasreq) /* add/chg IF alias */ - -#define SIOCSARP _IOW('i', 30, arpreq) /* set arp entry */ -#define OSIOCGARP _IOWR('i',31, arpreq) /* get arp entry */ -#define SIOCGARP _IOWR('i',38, arpreq) /* get arp entry */ -#define SIOCDARP _IOW('i', 32, arpreq) /* delete arp entry */ - - -/* Compatibility with 4.3 BSD terminal driver. - From 4.4 . */ - -#ifdef USE_OLD_TTY -# undef TIOCGETD -# define TIOCGETD _IOR('t', 0, int) /* get line discipline */ -# undef TIOCSETD -# define TIOCSETD _IOW('t', 1, int) /* set line discipline */ -#else -# define OTIOCGETD _IOR('t', 0, int) /* get line discipline */ -# define OTIOCSETD _IOW('t', 1, int) /* set line discipline */ -#endif -#define TIOCHPCL _IO('t', 2) /* hang up on last close */ -#define TIOCGETP _IOR('t', 8,sgttyb)/* get parameters -- gtty */ -#define TIOCSETP _IOW('t', 9,sgttyb)/* set parameters -- stty */ -#define TIOCSETN _IOW('t',10,sgttyb)/* as above, but no flushtty*/ -#define TIOCSETC _IOW('t',17,tchars)/* set special characters */ -#define TIOCGETC _IOR('t',18,tchars)/* get special characters */ -#define TANDEM 0x00000001 /* send stopc on out q full */ -#define CBREAK 0x00000002 /* half-cooked mode */ -#define LCASE 0x00000004 /* simulate lower case */ -#define ECHO 0x00000008 /* echo input */ -#define CRMOD 0x00000010 /* map \r to \r\n on output */ -#define RAW 0x00000020 /* no i/o processing */ -#define ODDP 0x00000040 /* get/send odd parity */ -#define EVENP 0x00000080 /* get/send even parity */ -#define ANYP 0x000000c0 /* get any parity/send none */ -#define NLDELAY 0x00000300 /* \n delay */ -#define NL0 0x00000000 -#define NL1 0x00000100 /* tty 37 */ -#define NL2 0x00000200 /* vt05 */ -#define NL3 0x00000300 -#define TBDELAY 0x00000c00 /* horizontal tab delay */ -#define TAB0 0x00000000 -#define TAB1 0x00000400 /* tty 37 */ -#define TAB2 0x00000800 -#define XTABS 0x00000c00 /* expand tabs on output */ -#define CRDELAY 0x00003000 /* \r delay */ -#define CR0 0x00000000 -#define CR1 0x00001000 /* tn 300 */ -#define CR2 0x00002000 /* tty 37 */ -#define CR3 0x00003000 /* concept 100 */ -#define VTDELAY 0x00004000 /* vertical tab delay */ -#define FF0 0x00000000 -#define FF1 0x00004000 /* tty 37 */ -#define BSDELAY 0x00008000 /* \b delay */ -#define BS0 0x00000000 -#define BS1 0x00008000 -#define ALLDELAY (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY) -#define CRTBS 0x00010000 /* do backspacing for crt */ -#define PRTERA 0x00020000 /* \ ... / erase */ -#define CRTERA 0x00040000 /* " \b " to wipe out char */ -#define TILDE 0x00080000 /* hazeltine tilde kludge */ -#define MDMBUF 0x00100000 /*start/stop output on carrier*/ -#define LITOUT 0x00200000 /* literal output */ -#define TOSTOP 0x00400000 /*SIGSTOP on background output*/ -#define FLUSHO 0x00800000 /* flush output to terminal */ -#define NOHANG 0x01000000 /* (no-op) was no SIGHUP on carrier drop */ -#define L001000 0x02000000 -#define CRTKIL 0x04000000 /* kill line with " \b " */ -#define PASS8 0x08000000 -#define CTLECH 0x10000000 /* echo control chars as ^X */ -#define PENDIN 0x20000000 /* tp->t_rawq needs reread */ -#define DECCTQ 0x40000000 /* only ^Q starts after ^S */ -#define NOFLSH 0x80000000 /* no output flush on signal */ -#define TIOCLBIS _IOW('t', 127, int) /* bis local mode bits */ -#define TIOCLBIC _IOW('t', 126, int) /* bic local mode bits */ -#define TIOCLSET _IOW('t', 125, int) /* set entire local mode word */ -#define TIOCLGET _IOR('t', 124, int) /* get local modes */ -#define LCRTBS (CRTBS>>16) -#define LPRTERA (PRTERA>>16) -#define LCRTERA (CRTERA>>16) -#define LTILDE (TILDE>>16) -#define LMDMBUF (MDMBUF>>16) -#define LLITOUT (LITOUT>>16) -#define LTOSTOP (TOSTOP>>16) -#define LFLUSHO (FLUSHO>>16) -#define LNOHANG (NOHANG>>16) -#define LCRTKIL (CRTKIL>>16) -#define LPASS8 (PASS8>>16) -#define LCTLECH (CTLECH>>16) -#define LPENDIN (PENDIN>>16) -#define LDECCTQ (DECCTQ>>16) -#define LNOFLSH (NOFLSH>>16) -#define TIOCSLTC _IOW('t',117,ltchars)/* set local special chars*/ -#define TIOCGLTC _IOR('t',116,ltchars)/* get local special chars*/ -#define OTIOCCONS _IO('t', 98) /* for hp300 -- sans int arg */ -#define OTTYDISC 0 -#define NETLDISC 1 -#define NTTYDISC 2 - -/* From 4.4 . */ -#ifdef USE_OLD_TTY -#define B0 0 -#define B50 1 -#define B75 2 -#define B110 3 -#define B134 4 -#define B150 5 -#define B200 6 -#define B300 7 -#define B600 8 -#define B1200 9 -#define B1800 10 -#define B2400 11 -#define B4800 12 -#define B9600 13 -#define EXTA 14 -#define EXTB 15 -#endif /* USE_OLD_TTY */ - - -#endif /* ioctls.h */ diff --git a/sysdeps/mach/hurd/jmp-unwind.c b/sysdeps/mach/hurd/jmp-unwind.c index 2d5804c..7b66df3 100644 --- a/sysdeps/mach/hurd/jmp-unwind.c +++ b/sysdeps/mach/hurd/jmp-unwind.c @@ -25,7 +25,7 @@ #ifndef _JMPBUF_UNWINDS - #error "sysdeps/MACHINE/jmp_buf.h fails to define _JMPBUF_UNWINDS" +#error " fails to define _JMPBUF_UNWINDS" #endif /* This function is called by `longjmp' (with its arguments) to restore diff --git a/sysdeps/mach/hurd/local_lim.h b/sysdeps/mach/hurd/local_lim.h deleted file mode 100644 index e26aa24..0000000 --- a/sysdeps/mach/hurd/local_lim.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Minimum guaranteed maximum values for system limits. Hurd version. - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* GNU has no arbitrary fixed limits on these things, so we don't - define the macros. Some things are unlimited. Some are in fact - limited but the limit is run-time dependent and fetched with - `sysconf' or `pathconf'. - - POSIX.1 requires that we define NGROUPS_MAX (though none of the others - is required). GNU allows any number of supplementary groups, - dynamically allocated. So we pick a number which seems vaguely - suitable, and `sysconf' will return a number at least as large. */ - -#define NGROUPS_MAX 256 - -/* The maximum number of symbolic links that are allowed in a single file - name resolution. When a further link is encountered, the call returns - ELOOP. This name is a GNU extension; POSIX.1 has no such limit, and BSD - calls it MAXSYMLINKS in . */ - -#ifdef __USE_GNU /* 1003.1a defines this */ -#define SYMLOOP_MAX 8 -#endif diff --git a/sysdeps/mach/hurd/mips/bits/sigcontext.h b/sysdeps/mach/hurd/mips/bits/sigcontext.h new file mode 100644 index 0000000..81d1f25 --- /dev/null +++ b/sysdeps/mach/hurd/mips/bits/sigcontext.h @@ -0,0 +1,71 @@ +/* Copyright (C) 1994 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 Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* Signal handlers are actually called: + void handler (int sig, int code, struct sigcontext *scp); */ + +/* State of this thread when the signal was taken. */ +struct sigcontext + { + /* These first members are machine-independent. */ + + int sc_onstack; /* Nonzero if running on sigstack. */ + __sigset_t sc_mask; /* Blocked signals to restore. */ + + /* MiG reply port this thread is using. */ + unsigned int sc_reply_port; + + /* Port this thread is doing an interruptible RPC on. */ + unsigned int sc_intr_port; + + /* Error code associated with this signal (interpreted as `error_t'). */ + int sc_error; + + /* All following members are machine-dependent. The rest of this + structure is written to be laid out identically to: + { + struct mips_thread_state ts; + struct mips_exc_state es; + struct mips_float_state fs; + } + trampoline.c knows this, so it must be changed if this changes. */ +#define sc_mips_thread_state sc_gpr /* Beginning of correspondence. */ + int sc_gpr[31]; /* "General" registers; [0] is r1. */ + int sc_mdlo, sc_mdhi; /* Low and high multiplication results. */ + int sc_pc; /* Instruction pointer. */ + + /* struct mips_exc_state */ +#define sc_mips_exc_state sc_cause + unsigned int sc_cause; /* Machine-level trap code. */ +#define SC_CAUSE_SST 0x00000044 + unsigned int sc_badvaddr; + unsigned int sc_coproc_used; /* Which coprocessors the thread has used. */ +#define SC_COPROC_USE_COP0 1 /* (by definition) */ +#define SC_COPROC_USE_COP1 2 /* FPA */ +#define SC_COPROC_USE_FPU SC_COPROC_USE_COP1 +#define SC_COPROC_USE_COP2 4 +#define SC_COPROC_USE_COP3 8 + + /* struct mips_float_state + This is only filled in if the SC_COPROC_USE_FPU bit + is set in sc_coproc_used. */ +#define sc_mips_float_state sc_fpr + int sc_fpr[32]; /* FP registers. */ + int sc_fpcsr; /* FPU status register. */ + int sc_fpeir; /* FP exception instruction register. */ + }; diff --git a/sysdeps/mach/hurd/mips/dl-machine.c b/sysdeps/mach/hurd/mips/dl-machine.c new file mode 100644 index 0000000..18261e1 --- /dev/null +++ b/sysdeps/mach/hurd/mips/dl-machine.c @@ -0,0 +1,131 @@ +/* Operating system support for run-time dynamic linker. MIPS specific + stuffs on Hurd. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../stdio-common/_itoa.h" +#include +#include +#include + +void weak_function +abort (void) +{ + _exit (127); +} + + +#include +#include +#include + +#undef _ +#define _(x) x + +/* Return a string describing the errno code in ERRNUM. */ +char * weak_function +_strerror_internal (int errnum, char *buf, size_t buflen) +{ + int system; + int sub; + int code; + const struct error_system *es; + extern void __mach_error_map_compat (int *); + + __mach_error_map_compat (&errnum); + + system = err_get_system (errnum); + sub = err_get_sub (errnum); + code = err_get_code (errnum); + + if (system > err_max_system || ! __mach_error_systems[system].bad_sub) + { + const char *unk = _("Error in unknown error system: "); + const size_t unklen = strlen (unk); + char *p = buf + buflen; + *--p = '\0'; + p = _itoa (errnum, p, 16, 1); + return memcpy (p - unklen, unk, unklen); + } + + es = &__mach_error_systems[system]; + + if (sub >= es->max_sub) + return (char *) es->bad_sub; + + if (code >= es->subsystem[sub].max_code) + { + const char *unk = _("Unknown error "); + const size_t unklen = strlen (unk); + char *p = buf + buflen; + size_t len = strlen (es->subsystem[sub].subsys_name); + *--p = '\0'; + p = _itoa (errnum, p, 16, 1); + *p-- = ' '; + p = memcpy (p - len, es->subsystem[sub].subsys_name, len); + return memcpy (p - unklen, unk, unklen); + } + + return (char *) _(es->subsystem[sub].codes[code]); +} + +/* Read the whole contents of FILE into new mmap'd space with given + protections. The size of the file is returned in SIZE. */ +void * +_dl_sysdep_read_whole_file (const char *file, size_t *size, int prot) +{ + struct stat stat; + mach_port_t memobj_rd; + void *contents; + error_t err; + + memobj_rd = __open (file, O_RDONLY, 0); + if (memobj_rd) + { + err = __io_stat ((file_t) memobj_rd, &stat); + if (err) + { + __hurd_fail (err); + contents = 0; + } + else + { + /* Map a copy of the file contents. */ + contents = __mmap (0, stat.st_size, prot, MAP_COPY, memobj_rd, 0); + if (contents == (void *)-1) + contents = 0; + else + *size = stat.st_size; + } + + __mach_port_deallocate (__mach_task_self (), memobj_rd); + } + else + contents = 0; + + return contents; +} diff --git a/sysdeps/mach/hurd/mips/exc2signal.c b/sysdeps/mach/hurd/mips/exc2signal.c index f907c89..235b2e2 100644 --- a/sysdeps/mach/hurd/mips/exc2signal.c +++ b/sysdeps/mach/hurd/mips/exc2signal.c @@ -1,21 +1,21 @@ /* Translate Mach exception codes into signal numbers. MIPS version. -Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. + 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 + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include @@ -25,56 +25,55 @@ Cambridge, MA 02139, USA. */ into a signal number and signal subcode. */ void -_hurd_exception2signal (int exception, int code, int subcode, - int *signo, long int *sigcode, int *error) +_hurd_exception2signal (struct hurd_signal_detail *detail, int *signo) { - *error = 0; + detail->error = 0; - switch (exception) + switch (detail->exc) { default: *signo = SIGIOT; - *sigcode = exception; + detail->code = detail->exc; break; case EXC_BAD_ACCESS: - if (code == KERN_PROTECTION_FAILURE) + if (detail->exc_code == KERN_PROTECTION_FAILURE) *signo = SIGSEGV; else *signo = SIGBUS; - *sigcode = subcode; - *error = code; + detail->code = detail->exc_subcode; + detail->error = detail->exc_code; break; case EXC_BAD_INSTRUCTION: *signo = SIGILL; - if (code == EXC_MIPS_II) - *sigcode = code; + if (detail->exc_code == EXC_MIPS_II) + detail->code = detail->exc_subcode; else - *sigcode = 0; + detail->code = 0; break; case EXC_ARITHMETIC: - switch (code) + switch (detail->exc_code) { case EXC_MIPS_OV: /* integer overflow */ *signo = SIGFPE; - *sigcode = EXC_MIPS_FLT_OVERFLOW; + detail->code = detail->exc_subcode; break; default: *signo = SIGFPE; - *sigcode = 0; + detail->code = 0; break; case EXC_MIPS_INT: /* Subcode is the fp_status word saved by the hardware. Give an error code corresponding to the first bit set. */ - if (subcode == EXC_MIPS_FLT_UNIMP) + if (detail->exc_subcode == EXC_MIPS_FLT_UNIMP) *signo = SIGILL; else *signo = SIGFPE; - *sigcode = subcode; + detail->code = detail->exc_subcode; break; } break; @@ -82,17 +81,17 @@ _hurd_exception2signal (int exception, int code, int subcode, case EXC_EMULATION: /* 3.0 doesn't give this one, why, I don't know. */ *signo = SIGEMT; - *sigcode = 0; + detail->code = 0; break; case EXC_SOFTWARE: *signo = SIGEMT; - *sigcode = 0; + detail->code = 0; break; case EXC_BREAKPOINT: *signo = SIGTRAP; - *sigcode = code; + detail->code = 0; break; } } diff --git a/sysdeps/mach/hurd/mips/init-fault.c b/sysdeps/mach/hurd/mips/init-fault.c new file mode 100644 index 0000000..619ef99 --- /dev/null +++ b/sysdeps/mach/hurd/mips/init-fault.c @@ -0,0 +1,41 @@ +/* Set up a thread_state for proc_handle_exceptions. MIPS version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include + +extern jmp_buf _hurd_sigthread_fault_env; + +static char fault_stack[32]; +static volatile void +faulted (void) +{ + __longjmp (_hurd_sigthread_fault_env, 1); +} + +void +_hurd_initialize_fault_recovery_state (void *state) +{ + struct mips_thread_state *ts = state; + memset (ts, 0, sizeof (*ts)); + ts->r29 = (int) &fault_stack[sizeof (fault_stack)]; + ts->pc = (int) &faulted; +} diff --git a/sysdeps/mach/hurd/mips/init-first.c b/sysdeps/mach/hurd/mips/init-first.c new file mode 100644 index 0000000..b057aeb --- /dev/null +++ b/sysdeps/mach/hurd/mips/init-first.c @@ -0,0 +1,407 @@ +/* Initialization code run first thing by the ELF startup code. For Mips/Hurd. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include +#include "hurdstartup.h" +#include "set-hooks.h" +#include "hurdmalloc.h" /* XXX */ + +extern void __mach_init (void); +extern void __libc_init (int, char **, char **); +extern void __getopt_clean_environment (void); +extern void __libc_global_ctors (void); + +unsigned int __hurd_threadvar_max; +unsigned long int __hurd_threadvar_stack_offset; +unsigned long int __hurd_threadvar_stack_mask; + +int __libc_multiple_libcs = 1; + +int __libc_argc; +char **__libc_argv; + +/* We often need the PID. Cache this value. */ +pid_t __libc_pid; + +void *(*_cthread_init_routine) (void); /* Returns new SP to use. */ +void (*_cthread_exit_routine) (int status) __attribute__ ((__noreturn__)); + + +/* Things that want to be run before _hurd_init or much anything else. + Importantly, these are called before anything tries to use malloc. */ +DEFINE_HOOK (_hurd_preinit_hook, (void)); + +static void +init1 (int argc, char *arg0, ...) +{ + char **argv = &arg0; + char **envp = &argv[argc + 1]; + struct hurd_startup_data *d; + + __libc_argc = argc; + __libc_argv = argv; + __environ = envp; + while (*envp) + ++envp; + d = (void *) ++envp; + + /* If we are the bootstrap task started by the kernel, + then after the environment pointers there is no Hurd + data block; the argument strings start there. */ + if ((void *) d != argv[0]) + { + _hurd_init_dtable = d->dtable; + _hurd_init_dtablesize = d->dtablesize; + + { + /* Check if the stack we are now on is different from + the one described by _hurd_stack_{base,size}. */ + + char dummy; + const vm_address_t newsp = (vm_address_t) &dummy; + + if (d->stack_size != 0 && (newsp < d->stack_base || + newsp - d->stack_base > d->stack_size)) + /* The new stack pointer does not intersect with the + stack the exec server set up for us, so free that stack. */ + __vm_deallocate (__mach_task_self (), d->stack_base, d->stack_size); + } + } + + if (__hurd_threadvar_stack_mask == 0) + { + /* We are not using cthreads, so we will have just a single allocated + area for the per-thread variables of the main user thread. */ + unsigned long int i; + __hurd_threadvar_stack_offset + = (unsigned long int) malloc (__hurd_threadvar_max * + sizeof (unsigned long int)); + if (__hurd_threadvar_stack_offset == 0) + __libc_fatal ("Can't allocate single-threaded per-thread variables."); + for (i = 0; i < __hurd_threadvar_max; ++i) + ((unsigned long int *) __hurd_threadvar_stack_offset)[i] = 0; + } + + if ((void *) d != argv[0] && (d->portarray || d->intarray)) + /* Initialize library data structures, start signal processing, etc. */ + _hurd_init (d->flags, argv, + d->portarray, d->portarraysize, + d->intarray, d->intarraysize); + + __libc_init (argc, argv, __environ); + + /* This is a hack to make the special getopt in GNU libc working. */ + __getopt_clean_environment (); + +#ifdef PIC + __libc_global_ctors (); +#endif + + (void) &init1; +} + +static void * +__init (int *data) +{ + int argc = *data; + char **argv = (void *) (data + 1); + char **envp = &argv[argc + 1]; + struct hurd_startup_data *d; + + __environ = envp; + while (*envp) + ++envp; + d = (void *) ++envp; + + /* The user might have defined a value for this, to get more variables. + Otherwise it will be zero on startup. We must make sure it is set + properly before before cthreads initialization, so cthreads can know + how much space to leave for thread variables. */ + if (__hurd_threadvar_max < _HURD_THREADVAR_MAX) + __hurd_threadvar_max = _HURD_THREADVAR_MAX; + + + /* After possibly switching stacks, call `init1' (above) with the user + code as the return address, and the argument data immediately above + that on the stack. */ + + if (_cthread_init_routine) + { + /* Initialize cthreads, which will allocate us a new stack to run on. */ + void *newsp = (*_cthread_init_routine) (); + struct hurd_startup_data *od; + + /* Copy the argdata from the old stack to the new one. */ + newsp = memcpy (newsp - ((char *) &d[1] - (char *) data), data, + (char *) d - (char *) data); + + /* Set up the Hurd startup data block immediately following + the argument and environment pointers on the new stack. */ + od = (newsp + ((char *) d - (char *) data)); + if ((void *) argv[0] == d) + /* We were started up by the kernel with arguments on the stack. + There is no Hurd startup data, so zero the block. */ + memset (od, 0, sizeof *od); + else + /* Copy the Hurd startup data block to the new stack. */ + *od = *d; + + /* Push the user code address on the top of the new stack. It will + be the return address for `init1'; we will jump there with NEWSP + as the stack pointer. */ + return newsp; + } + + /* The argument data is just above the stack frame we will unwind by + returning. */ + return (void *) data; + + (void) &__init; +} + +#ifdef PIC +/* This function is called to initialize the shared C library. + It is called just before the user _start code from mips/elf/start.S, + with the stack set up as that code gets it. */ + +/* NOTE! The linker notices the magical name `_init' and sets the DT_INIT + pointer in the dynamic section based solely on that. It is convention + for this function to be in the `.init' section, but the symbol name is + the only thing that really matters!! */ +/*void _init (int argc, ...) __attribute__ ((unused, section (".init")));*/ + +#if __mips64 +asm ("\ + .section .init,\"ax\",@progbits\n\ + .align 3\n\ + .globl _init\n\ + .type _init,@function\n\ + .ent _init\n\ +_init:\n\ + .set noreorder\n\ + .cpload $25\n\ + .set reorder\n\ + dsubu $29, 8*8\n\ + .cprestore 6*8\n\ + sd $16, 4*8($29)\n\ + sd $31, 5*8($29)\n\ + jal preinit\n\ + sd $28, 6*8($29)\n\ + move $16, $29 # Save the old stack pointer to s0 ($16)\n\ + daddu $4, $29, 4*8 + jal __init\n\ + # Restore saved registers from the old stack.\n\ + ld $28, 6*8($16)\n\ + ld $31, 5*8($16)\n\ + ld $16, 4*8($16)\n\ + move $29, $2 # set new sp to SP\n\ +call_init1:\n\ + ld $4, 0($29)\n\ + ld $5, 1*8($29)\n\ + ld $6, 2*8($29)\n\ + ld $7, 3*8($29)\n\ + dla $25, init1\n\ + jr $25\n\ + .end _init\n\ + .text\n\ +"); +#else +asm ("\ + .section .init,\"ax\",@progbits\n\ + .align 2\n\ + .globl _init\n\ + .type _init,@function\n\ + .ent _init\n\ +_init:\n\ + .set noreorder\n\ + .cpload $25\n\ + .set reorder\n\ + subu $29, 32\n\ + .cprestore 24\n\ + sw $16, 16($29)\n\ + sw $31, 20($29)\n\ + jal preinit\n\ + sw $28, 24($29)\n\ + move $16, $29 # Save the old stack pointer to s0 ($16)\n\ + addu $4, $29, 32 + jal __init\n\ + # Restore saved registers from the old stack.\n\ + lw $28, 24($16)\n\ + lw $31, 20($16)\n\ + lw $16, 16($16)\n\ + move $29, $2 # set new sp to SP\n\ +call_init1:\n\ + lw $4, 0($29)\n\ + lw $5, 4($29)\n\ + lw $6, 8($29)\n\ + lw $7, 12($29)\n\ + la $25, init1\n\ + jr $25\n\ + .end _init\n\ + .text\n\ +"); +#endif + +static void +preinit (void) +{ + /* Initialize data structures so we can do RPCs. */ + __mach_init (); + + RUN_HOOK (_hurd_preinit_hook, ()); + + (void) &preinit; +} + +void __libc_init_first (int argc, ...) +{ +} +#endif + +#ifndef PIC +/* An assembler code wrapping c function __init. */ +#ifdef __mips64 +asm ("\ + .text\n\ + .align 3\n\ +init:\n\ + dsubu $29, 8*8\n\ + sd $16, 4*8($29)\n\ + sd $31, 5*8($29)\n\ + move $16, $29\n\ + jal __init\n\ + ld $31, 5*8($16)\n\ + ld $16, 4*8($16)\n\ + move $29, $2 # set new sp to SP\n\ +call_init1:\n\ + ld $4, 0($29)\n\ + ld $5, 1*8($29)\n\ + ld $6, 2*8($29)\n\ + ld $7, 3*8($29)\n\ + dla $25, init1\n\ + jr $25\n\ +"); +#else +asm ("\ + .text\n\ + .align 2\n\ +init:\n\ + subu $29, 32\n\ + sw $16, 16($29)\n\ + sw $31, 20($29)\n\ + move $16, $29\n\ + jal __init\n\ + lw $31, 20($16)\n\ + lw $16, 16($16)\n\ + move $29, $2 # set new sp to SP\n\ +call_init1:\n\ + lw $4, 0($29)\n\ + lw $5, 4($29)\n\ + lw $6, 8($29)\n\ + lw $7, 12($29)\n\ + la $25, init1\n\ + jr $25\n\ +"); +#endif + +/* An assembler code wrapping c function ___libc_init_first. + ___libc_init_first does an RPC call to flush cache to put doinit + function on the stack, so we should call __mach_init first in + this wrap. */ +#ifdef __mips64 +asm ("\ + .text\n\ + .align 3\n\ + .globl __libc_init_first\n\ +__libc_init_first:\n\ + dsubu $29, 8\n\ + sd $31, 0($29) + jal __mach_init\n\ + ld $4, 0($29) + ld $5, 1*8($29) + ld $6, 2*8($29) + ld $7, 3*8($29) + j ___libc_init_first\n\ +"); +#else +asm ("\ + .text\n\ + .align 2\n\ + .globl __libc_init_first\n\ +__libc_init_first:\n\ + subu $29, 4\n\ + sw $31, 0($29) + jal __mach_init\n\ + lw $4, 0($29) + lw $5, 4($29) + lw $6, 8($29) + lw $7, 12($29) + j ___libc_init_first\n\ +"); +#endif + +static void +___libc_init_first (int return_addr, int argc, ...) +{ + void doinit (int *data) + { +#if 0 + /* This function gets called with the argument data at TOS. */ + void doinit1 (int argc, ...) + { + init (&argc); + } +#endif + extern void init (int *data); + + /* Push the user return address after the argument data, and then + jump to `doinit1' (above), so it is as if __libc_init_first's + caller had called `init' with the argument data already on the + stack. */ + *--data = return_addr; + +#ifdef __mips64 + asm volatile ("ld $31, 0(%0)\n" /* Load the original return address. */ + "daddu $29, %0, 8\n" /* Switch to new outermost stack. */ + "move $4, $29\n" + "jr %1" : : "r" (data), "r" (&init)); +#else + asm volatile ("lw $31, 0(%0)\n" /* Load the original return address. */ + "addu $29, %0, 4\n" /* Switch to new outermost stack. */ + "move $4, $29\n" + "jr %1" : : "r" (data), "r" (&init)); +#endif + /* NOTREACHED */ + } + +#if 0 + /* Initialize data structures so we can do RPCs. */ + __mach_init (); +#endif + + RUN_HOOK (_hurd_preinit_hook, ()); + + _hurd_startup ((void **) &argc, &doinit); + + (void) &___libc_init_first; +} +#endif diff --git a/sysdeps/mach/hurd/mips/intr-msg.h b/sysdeps/mach/hurd/mips/intr-msg.h new file mode 100644 index 0000000..7d155f6 --- /dev/null +++ b/sysdeps/mach/hurd/mips/intr-msg.h @@ -0,0 +1,127 @@ +/* Machine-dependent details of interruptible RPC messaging. Mips version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + +#ifdef __mips64 +#define INTR_MSG_TRAP(msg, option, send_size, rcv_size, rcv_name, timeout, notify) \ +({ \ + error_t err; \ + mach_port_t __rcv_name = (rcv_name); \ + mach_msg_timeout_t __timeout = (timeout); \ + mach_port_t __notify = (notify); \ + asm (".globl _hurd_intr_rpc_msg_do_trap\n" \ + ".globl _hurd_intr_rpc_msg_in_trap\n" \ + " move $4, %1\n" \ + " move $5, %2\n" \ + " move $6, %3\n" \ + " move $7, %4\n" \ + " move $8, %5\n" \ + " move $9, %6\n" \ + " move $10, %7\n" \ + " dli $2, -25\n" \ + "_hurd_intr_rpc_msg_do_trap: syscall\n" \ + "_hurd_intr_rpc_msg_in_trap: move %0, $2\n" \ + : "=r" (err) \ + : "r" (msg), "r" (option), "r" (send_size), "r" (rcv_size), \ + "r" (__rcv_name), "r" (__timeout), "r" (__notify) \ + : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9", "$10", \ + "$11", "$12", "$13", "$14", "$15", "$24", "$25", "$28"); \ + err; \ +}) +#else +#define INTR_MSG_TRAP(msg, option, send_size, rcv_size, rcv_name, timeout, notify) \ +({ \ + error_t err; \ + mach_port_t __rcv_name = (rcv_name); \ + mach_msg_timeout_t __timeout = (timeout); \ + mach_port_t __notify = (notify); \ + asm (".globl _hurd_intr_rpc_msg_do_trap\n" \ + ".globl _hurd_intr_rpc_msg_in_trap\n" \ + " move $4, %1\n" \ + " move $5, %2\n" \ + " move $6, %3\n" \ + " move $7, %4\n" \ + " move $8, %5\n" \ + " move $9, %6\n" \ + " move $10, %7\n" \ + " li $2, -25\n" \ + "_hurd_intr_rpc_msg_do_trap: syscall\n" \ + "_hurd_intr_rpc_msg_in_trap: move %0, $2\n" \ + : "=r" (err) \ + : "r" (msg), "r" (option), "r" (send_size), "r" (rcv_size), \ + "r" (__rcv_name), "r" (__timeout), "r" (__notify) \ + : "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9", "$10", \ + "$11", "$12", "$13", "$14", "$15", "$24", "$25", "$28"); \ + err; \ +}) +#endif + +static inline void +INTR_MSG_BACK_OUT (struct mips_thread_state *state) +{ + return; +} + +#include "hurdfault.h" + +static inline int +SYSCALL_EXAMINE (struct mips_thread_state *state, int *callno) +{ + u_int32_t *p = (void *) (state->pc - 4); + int result; + if (_hurdsig_catch_memory_fault (p)) + return 0; + if (result = (*p == 0x0000000c)) + /* The PC is just after a `syscall' instruction. + This is a system call in progress; v0($2) holds the call number. */ + *callno = state->r2; + _hurdsig_end_catch_fault (); + return result; +} + + +struct mach_msg_trap_args + { + /* This is the order of arguments to mach_msg_trap. */ + mach_msg_header_t *msg; + mach_msg_option_t option; + mach_msg_size_t send_size; + mach_msg_size_t rcv_size; + mach_port_t rcv_name; + mach_msg_timeout_t timeout; + mach_port_t notify; + }; + + +static inline mach_port_t +MSG_EXAMINE (struct mips_thread_state *state, int *msgid) +{ + mach_msg_header_t *msg; + mach_port_t send_port; + + msg = (mach_msg_header_t *) state->r4; + + if (_hurdsig_catch_memory_fault (msg)) + return MACH_PORT_NULL; + send_port = msg->msgh_remote_port; + *msgid = msg->msgh_id; + _hurdsig_end_catch_fault (); + + return send_port; +} diff --git a/sysdeps/mach/hurd/mips/longjmp-ctx.c b/sysdeps/mach/hurd/mips/longjmp-ctx.c new file mode 100644 index 0000000..df04900 --- /dev/null +++ b/sysdeps/mach/hurd/mips/longjmp-ctx.c @@ -0,0 +1,41 @@ +/* Perform a `longjmp' on a `struct sigcontext'. MIPS version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include +#include + +void +_hurd_longjmp_sigcontext (struct sigcontext *scp, jmp_buf env, int retval) +{ + scp->sc_gpr[16] = env[0].__regs[0]; + scp->sc_gpr[17] = env[0].__regs[1]; + scp->sc_gpr[18] = env[0].__regs[2]; + scp->sc_gpr[19] = env[0].__regs[3]; + scp->sc_gpr[20] = env[0].__regs[4]; + scp->sc_gpr[21] = env[0].__regs[5]; + scp->sc_gpr[22] = env[0].__regs[6]; + scp->sc_gpr[23] = env[0].__regs[7]; + + scp->sc_gpr[28] = (int) env[0].__gp; + scp->sc_fp = (int) env[0].__fp; + scp->sc_sp = (int) env[0].__sp; + scp->sc_pc = (int) env[0].__pc; + scp->sc_gpr[2] = retval ?: 1; +} diff --git a/sysdeps/mach/hurd/mips/longjmp-ts.c b/sysdeps/mach/hurd/mips/longjmp-ts.c index 980a2ce..ea62bb1 100644 --- a/sysdeps/mach/hurd/mips/longjmp-ts.c +++ b/sysdeps/mach/hurd/mips/longjmp-ts.c @@ -1,21 +1,21 @@ /* Perform a `longjmp' on a Mach thread_state. MIPS version. -Copyright (C) 1991, 1994 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 Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include diff --git a/sysdeps/mach/hurd/mips/sigcontext.h b/sysdeps/mach/hurd/mips/sigcontext.h deleted file mode 100644 index 81d1f25..0000000 --- a/sysdeps/mach/hurd/mips/sigcontext.h +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright (C) 1994 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 Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* Signal handlers are actually called: - void handler (int sig, int code, struct sigcontext *scp); */ - -/* State of this thread when the signal was taken. */ -struct sigcontext - { - /* These first members are machine-independent. */ - - int sc_onstack; /* Nonzero if running on sigstack. */ - __sigset_t sc_mask; /* Blocked signals to restore. */ - - /* MiG reply port this thread is using. */ - unsigned int sc_reply_port; - - /* Port this thread is doing an interruptible RPC on. */ - unsigned int sc_intr_port; - - /* Error code associated with this signal (interpreted as `error_t'). */ - int sc_error; - - /* All following members are machine-dependent. The rest of this - structure is written to be laid out identically to: - { - struct mips_thread_state ts; - struct mips_exc_state es; - struct mips_float_state fs; - } - trampoline.c knows this, so it must be changed if this changes. */ -#define sc_mips_thread_state sc_gpr /* Beginning of correspondence. */ - int sc_gpr[31]; /* "General" registers; [0] is r1. */ - int sc_mdlo, sc_mdhi; /* Low and high multiplication results. */ - int sc_pc; /* Instruction pointer. */ - - /* struct mips_exc_state */ -#define sc_mips_exc_state sc_cause - unsigned int sc_cause; /* Machine-level trap code. */ -#define SC_CAUSE_SST 0x00000044 - unsigned int sc_badvaddr; - unsigned int sc_coproc_used; /* Which coprocessors the thread has used. */ -#define SC_COPROC_USE_COP0 1 /* (by definition) */ -#define SC_COPROC_USE_COP1 2 /* FPA */ -#define SC_COPROC_USE_FPU SC_COPROC_USE_COP1 -#define SC_COPROC_USE_COP2 4 -#define SC_COPROC_USE_COP3 8 - - /* struct mips_float_state - This is only filled in if the SC_COPROC_USE_FPU bit - is set in sc_coproc_used. */ -#define sc_mips_float_state sc_fpr - int sc_fpr[32]; /* FP registers. */ - int sc_fpcsr; /* FPU status register. */ - int sc_fpeir; /* FP exception instruction register. */ - }; diff --git a/sysdeps/mach/hurd/mips/sigreturn.c b/sysdeps/mach/hurd/mips/sigreturn.c index 7396a8b..fe38fac 100644 --- a/sysdeps/mach/hurd/mips/sigreturn.c +++ b/sysdeps/mach/hurd/mips/sigreturn.c @@ -1,30 +1,32 @@ -/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. + 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 + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include #include #include +#include int __sigreturn (struct sigcontext *scp) { struct hurd_sigstate *ss; + struct hurd_userlink *link = (void *) &scp[1]; mach_port_t *reply_port; if (scp == NULL || (scp->sc_mask & _SIG_CANT_MASK)) @@ -36,6 +38,11 @@ __sigreturn (struct sigcontext *scp) ss = _hurd_self_sigstate (); __spin_lock (&ss->lock); + /* Remove the link on the `active resources' chain added by + _hurd_setup_sighandler. Its purpose was to make sure + that we got called; now we have, it is done. */ + _hurd_userlink_unlink (link); + /* Restore the set of blocked signals, and the intr_port slot. */ ss->blocked = scp->sc_mask; ss->intr_port = scp->sc_intr_port; @@ -48,15 +55,11 @@ __sigreturn (struct sigcontext *scp) the signal thread will notice it if it runs another handler, and arrange to have us called over again in the new reality. */ ss->context = scp; - /* Clear the intr_port slot, since we are not in fact doing - an interruptible RPC right now. If SS->intr_port is not null, - the SCP context is doing an interruptible RPC, but the signal - thread will examine us while we are blocked in the sig_post RPC. */ - ss->intr_port = MACH_PORT_NULL; __spin_unlock (&ss->lock); - __msg_sig_post (_hurd_msgport, 0, __mach_task_self ()); + __msg_sig_post (_hurd_msgport, 0, 0, __mach_task_self ()); /* If a pending signal was handled, sig_post never returned. */ __spin_lock (&ss->lock); + ss->context = NULL; } if (scp->sc_onstack) @@ -73,7 +76,17 @@ __sigreturn (struct sigcontext *scp) reply_port = (mach_port_t *) __hurd_threadvar_location (_HURD_THREADVAR_MIG_REPLY); if (*reply_port) - __mach_port_destroy (__mach_task_self (), *reply_port); + { + mach_port_t port = *reply_port; + + /* Assigning MACH_PORT_DEAD here tells libc's mig_get_reply_port not to + get another reply port, but avoids mig_dealloc_reply_port trying to + deallocate it after the receive fails (which it will, because the + reply port will be bogus, whether we do this or not). */ + *reply_port = MACH_PORT_DEAD; + + __mach_port_destroy (__mach_task_self (), port); + } *reply_port = scp->sc_reply_port; if (scp->sc_coproc_used & SC_COPROC_USE_FPU) @@ -83,30 +96,70 @@ __sigreturn (struct sigcontext *scp) asm volatile ("l.d $f" #n ",%0" : : "m" (scp->sc_fpr[n])) /* Restore floating-point registers. */ +#ifdef __mips64 restore_fpr (0); + restore_fpr (1); restore_fpr (2); + restore_fpr (3); restore_fpr (4); + restore_fpr (5); restore_fpr (6); + restore_fpr (7); restore_fpr (8); + restore_fpr (9); restore_fpr (10); + restore_fpr (11); restore_fpr (12); + restore_fpr (13); restore_fpr (14); + restore_fpr (15); restore_fpr (16); + restore_fpr (17); restore_fpr (18); + restore_fpr (19); restore_fpr (20); + restore_fpr (21); restore_fpr (22); + restore_fpr (23); restore_fpr (24); + restore_fpr (25); restore_fpr (26); + restore_fpr (27); restore_fpr (28); + restore_fpr (29); restore_fpr (30); + restore_fpr (31); +#else + restore_fpr (0); + restore_fpr (2); + restore_fpr (4); + restore_fpr (6); + restore_fpr (8); + restore_fpr (10); + restore_fpr (12); + restore_fpr (14); + restore_fpr (16); + restore_fpr (18); + restore_fpr (20); + restore_fpr (22); + restore_fpr (24); + restore_fpr (26); + restore_fpr (28); + restore_fpr (30); +#endif /* Restore the floating-point control/status register ($f31). */ asm volatile ("ctc1 %0,$f31" : : "r" (scp->sc_fpcsr)); } /* Load all the registers from the sigcontext. */ +#ifdef __mips64 +#define restore_gpr(n) \ + asm volatile ("ld $" #n ",%0" : : "m" (scpreg->sc_gpr[n - 1])) +#else #define restore_gpr(n) \ asm volatile ("lw $" #n ",%0" : : "m" (scpreg->sc_gpr[n - 1])) +#endif { register const struct sigcontext *const scpreg asm ("$1") = scp; @@ -157,9 +210,10 @@ __sigreturn (struct sigcontext *scp) at = &scpreg->sc_pc; /* This is an emulated instruction that will find at the address in $1 two words: the PC value to restore, and the $1 value to restore. */ - asm volatile (".word op_sigreturn"); - + asm volatile (".word %0" : : "i" (op_sigreturn)); asm volatile (".set reorder; .set at;"); + /* NOTREACHED */ + return at; /* To prevent optimization. */ } /* NOTREACHED */ diff --git a/sysdeps/mach/hurd/mips/trampoline.c b/sysdeps/mach/hurd/mips/trampoline.c index 03e3d1d..fbb7df5 100644 --- a/sysdeps/mach/hurd/mips/trampoline.c +++ b/sysdeps/mach/hurd/mips/trampoline.c @@ -1,56 +1,58 @@ /* Set thread_state for sighandler, and sigcontext to recover. MIPS version. -Copyright (C) 1994, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. + 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 + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include +#include #include "thread_state.h" - - -struct mach_msg_trap_args - { - /* This is the order of arguments to mach_msg_trap. */ - mach_msg_header_t *msg; - mach_msg_option_t option; - mach_msg_size_t send_size; - mach_msg_size_t rcv_size; - mach_port_t rcv_name; - mach_msg_timeout_t timeout; - mach_port_t notify; - }; +#include +#include +#include "hurdfault.h" +#include "intr-msg.h" struct sigcontext * _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, - int signo, long int sigcode, - int rpc_wait, + int signo, struct hurd_signal_detail *detail, + volatile int rpc_wait, struct machine_thread_all_state *state) { - - __label__ trampoline, rpc_wait_trampoline; - void *sigsp; + __label__ trampoline, rpc_wait_trampoline, firewall; + void *volatile sigsp; struct sigcontext *scp; + struct + { + int signo; + long int sigcode; + struct sigcontext *scp; /* Points to ctx, below. */ + void *sigreturn_addr; + void *sigreturn_returns_here; + struct sigcontext *return_scp; /* Same; arg to sigreturn. */ + struct sigcontext ctx; + struct hurd_userlink link; + } *stackframe; if (ss->context) { /* We have a previous sigcontext that sigreturn was about to restore when another signal arrived. We will just base our setup on that. */ - if (! setjmp (_hurd_sigthread_fault_env)) + if (! _hurdsig_catch_memory_fault (ss->context)) { memcpy (&state->basic, &ss->context->sc_mips_thread_state, sizeof (state->basic)); @@ -63,24 +65,17 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, sizeof (state->fpu)); state->set |= (1 << MIPS_FLOAT_STATE); } - assert (! rpc_wait); - /* The intr_port slot was cleared before sigreturn sent us the - sig_post that made us notice this pending signal, so - _hurd_internal_post_signal wouldn't do interrupt_operation. - After we return, our caller will set SCP->sc_intr_port (in the - new context) from SS->intr_port and clear SS->intr_port. Now - that we are restoring this old context recorded by sigreturn, - we want to restore its intr_port too; so store it in - SS->intr_port now, so it will end up in SCP->sc_intr_port - later. */ - ss->intr_port = ss->context->sc_intr_port; } - /* If the sigreturn context was bogus, just ignore it. */ - ss->context = NULL; } - else if (! machine_get_basic_state (ss->thread, state)) + + if (! machine_get_basic_state (ss->thread, state)) return NULL; + /* Save the original SP in the gratuitous s0 ($16) slot. + We may need to reset the SP (the `r29' slot) to avoid clobbering an + interrupted RPC frame. */ + state->basic.r16 = state->basic.r29; + if ((ss->actions[signo].sa_flags & SA_ONSTACK) && !(ss->sigaltstack.ss_flags & (SA_DISABLE|SA_ONSTACK))) { @@ -92,13 +87,46 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, else sigsp = (char *) state->basic.r29; - /* Set up the sigcontext structure on the stack. This is all the stack - needs, since the args are passed in registers (below). */ - sigsp -= sizeof (*scp); - scp = sigsp; + /* Push the arguments to call `trampoline' on the stack. */ + sigsp -= sizeof (*stackframe); + stackframe = sigsp; - if (! setjmp (_hurd_sigthread_fault_env)) + if (_hurdsig_catch_memory_fault (stackframe)) { + /* We got a fault trying to write the stack frame. + We cannot set up the signal handler. + Returning NULL tells our caller, who will nuke us with a SIGILL. */ + return NULL; + } + else + { + int ok; + + extern void _hurdsig_longjmp_from_handler (void *, jmp_buf, int); + + /* Add a link to the thread's active-resources list. We mark this as + the only user of the "resource", so the cleanup function will be + called by any longjmp which is unwinding past the signal frame. + The cleanup function (in sigunwind.c) will make sure that all the + appropriate cleanups done by sigreturn are taken care of. */ + stackframe->link.cleanup = &_hurdsig_longjmp_from_handler; + stackframe->link.cleanup_data = &stackframe->ctx; + stackframe->link.resource.next = NULL; + stackframe->link.resource.prevp = NULL; + stackframe->link.thread.next = ss->active_resources; + stackframe->link.thread.prevp = &ss->active_resources; + if (stackframe->link.thread.next) + stackframe->link.thread.next->thread.prevp + = &stackframe->link.thread.next; + ss->active_resources = &stackframe->link; + + /* Set up the arguments for the signal handler. */ + stackframe->signo = signo; + stackframe->sigcode = detail->code; + stackframe->scp = stackframe->return_scp = scp = &stackframe->ctx; + stackframe->sigreturn_addr = &__sigreturn; + stackframe->sigreturn_returns_here = &&firewall; /* Crash on return. */ + /* Set up the sigcontext from the current state of the thread. */ scp->sc_onstack = ss->sigaltstack.ss_flags & SA_ONSTACK ? 1 : 0; @@ -110,24 +138,23 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, /* struct sigcontext is laid out so that starting at sc_cause mimics a struct mips_exc_state. */ - if (! machine_get_state (ss->thread, state, MIPS_EXC_STATE, - &state->exc, &scp->sc_cause, - sizeof (state->exc))) - return NULL; - if ((scp->sc_coproc_used & SC_COPROC_USE_FPU) && - /* struct sigcontext is laid out so that starting at sc_fpr - mimics a struct mips_float_state. This state - is only meaningful if the coprocessor was used. */ - ! machine_get_state (ss->thread, state, MIPS_FLOAT_STATE, - &state->fpu, - &scp->sc_mips_float_state, sizeof (state->fpu))) + ok = machine_get_state (ss->thread, state, MIPS_EXC_STATE, + &state->exc, &scp->sc_cause, + sizeof (state->exc)); + + if (ok && (scp->sc_coproc_used & SC_COPROC_USE_FPU)) + /* struct sigcontext is laid out so that starting at sc_fpr + mimics a struct mips_float_state. This state + is only meaningful if the coprocessor was used. */ + ok = machine_get_state (ss->thread, state, MIPS_FLOAT_STATE, + &state->fpu, &scp->sc_mips_float_state, + sizeof (state->fpu)); + + _hurdsig_end_catch_fault (); + + if (! ok) return NULL; } - else - /* We got a fault trying to write the stack frame. - We cannot set up the signal handler. - Returning NULL tells our caller, who will nuke us with a SIGILL. */ - return NULL; /* Modify the thread state to call the trampoline code on the new stack. */ if (rpc_wait) @@ -145,6 +172,12 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, starting with a0 ($4). */ struct mach_msg_trap_args *args = (void *) &state->basic.r4; + if (_hurdsig_catch_memory_fault (args)) + { + /* Faulted accessing ARGS. Bomb. */ + return NULL; + } + assert (args->option & MACH_RCV_MSG); /* Disable the message-send, since it has already completed. The calls we retry need only wait to receive the reply message. */ @@ -156,17 +189,22 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, args->option |= MACH_RCV_TIMEOUT; args->timeout = _hurd_interrupted_rpc_timeout; + _hurdsig_end_catch_fault (); + state->basic.pc = (int) &&rpc_wait_trampoline; - state->basic.r29 = (int) sigsp; /* $29 is the stack pointer register. */ + /* The reply-receiving trampoline code runs initially on the original + user stack. We pass it the signal stack pointer in s4 ($20). */ + state->basic.r29 = state->basic.r16; /* Restore mach_msg syscall SP. */ + state->basic.r20 = (int) sigsp; /* After doing the message receive, the trampoline code will need to update the v0 ($2) value to be restored by sigreturn. To simplify the assembly code, we pass the address of its slot in SCP to the - trampoline code in v1 ($3). */ - state->basic.r3 = (int) &scp->sc_gpr[1]; + trampoline code in s5 ($21). */ + state->basic.r21 = (int) &scp->sc_gpr[1]; /* We must preserve the mach_msg_trap args in a0..t2 ($4..$10). Pass the handler args to the trampoline code in s1..s3 ($17..$19). */ state->basic.r17 = signo; - state->basic.r18 = sigcode; + state->basic.r18 = detail->code; state->basic.r19 = (int) scp; } else @@ -174,12 +212,12 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, state->basic.pc = (int) &&trampoline; state->basic.r29 = (int) sigsp; state->basic.r4 = signo; - state->basic.r5 = sigcode; + state->basic.r5 = detail->code; state->basic.r6 = (int) scp; } - /* We pass the handler function to the trampoline code in at ($1). */ - state->basic.r1 = (int) handler; + /* We pass the handler function to the trampoline code in s6 ($22). */ + state->basic.r22 = (int) handler; /* In the callee-saved register s0 ($16), we save the SCP value to pass to __sigreturn after the handler returns. */ state->basic.r16 = (int) scp; @@ -197,21 +235,31 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, asm volatile (".set noat; .set noreorder; .set nomacro\n" /* Retry the interrupted mach_msg system call. */ +#ifdef __mips64 + "dli $2, -25\n" /* mach_msg_trap */ +#else "li $2, -25\n" /* mach_msg_trap */ +#endif "syscall\n" /* When the sigcontext was saved, v0 was MACH_RCV_INTERRUPTED. But now the message receive has completed and the original caller of the RPC (i.e. the code running when the signal arrived) needs to see the final return value of the message receive in v0. So store the new v0 value into the sc_gpr[1] member of the sigcontext - (whose address is in v1 to make this code simpler). */ - "sw $2, ($3)\n" + (whose address is in s5 to make this code simpler). */ +#ifdef __mips64 + "sd $2, ($21)\n" +#else + "sw $2, ($21)\n" +#endif /* Since the argument registers needed to have the mach_msg_trap arguments, we've stored the arguments to the handler function in registers s1..s3 ($17..$19). */ "move $4, $17\n" "move $5, $18\n" - "move $6, $19\n"); + "move $6, $19\n" + /* Switch to the signal stack. */ + "move $29, $20\n"); trampoline: /* Entry point for running the handler normally. The arguments to the @@ -222,14 +270,23 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, a2 SCP */ asm volatile - ("jal $1; nop\n" /* Call the handler function. */ + ("move $25, $22\n" /* Copy s6 to t9 for MIPS ABI. */ + "jal $25; nop\n" /* Call the handler function. */ /* Call __sigreturn (SCP); this cannot return. */ - "j %0\n" +#ifdef __mips64 + "dla $1,%0\n" +#else + "la $1,%0\n" +#endif + "j $1\n" "move $4, $16" /* Set up arg from saved SCP in delay slot. */ : : "i" (&__sigreturn)); /* NOTREACHED */ asm volatile (".set reorder; .set at; .set macro"); + firewall: + asm volatile ("hlt: j hlt"); + return NULL; } diff --git a/sysdeps/mach/hurd/posix_opt.h b/sysdeps/mach/hurd/posix_opt.h deleted file mode 100644 index 045b4b6..0000000 --- a/sysdeps/mach/hurd/posix_opt.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Posix options supported by the GNU Hurd port of GNU libc. */ - -#define _POSIX_JOB_CONTROL 1 -#define _POSIX_SAVED_IDS 1 -#define _POSIX_VDISABLE ((unsigned char) -1) - -/* Different Hurd filesystems might do these differently. */ -#undef _POSIX_CHOWN_RESTRICTED -#undef _POSIX_NO_TRUNC -/* Posix options supported by the GNU Hurd port of GNU libc. */ - -#define _POSIX_JOB_CONTROL 1 -#define _POSIX_SAVED_IDS 1 -#define _POSIX_VDISABLE ((unsigned char) -1) - -/* Different Hurd filesystems might do these differently. */ -#undef _POSIX_CHOWN_RESTRICTED -#undef _POSIX_NO_TRUNC - - - diff --git a/sysdeps/mach/hurd/select.c b/sysdeps/mach/hurd/select.c index 391b57b..f8385ff 100644 --- a/sysdeps/mach/hurd/select.c +++ b/sysdeps/mach/hurd/select.c @@ -223,7 +223,7 @@ __select (nfds, readfds, writefds, exceptfds, timeout) /* We got a message. Decode it. */ #define IO_SELECT_REPLY_MSGID (21012 + 100) /* XXX */ const mach_msg_type_t inttype = - { MACH_MSG_TYPE_INTEGER_32, 32, 1, 1, 0, 0 }; + { MACH_MSG_TYPE_INTEGER_T, MACH_MSG_SIZE_INTEGER_T, 1, 1, 0, 0 }; if (msg.head.msgh_id == IO_SELECT_REPLY_MSGID && msg.head.msgh_size >= sizeof msg.error && !(msg.head.msgh_bits & MACH_MSGH_BITS_COMPLEX) && diff --git a/sysdeps/mach/hurd/statbuf.h b/sysdeps/mach/hurd/statbuf.h deleted file mode 100644 index a8f92cb..0000000 --- a/sysdeps/mach/hurd/statbuf.h +++ /dev/null @@ -1,131 +0,0 @@ -/* Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _STATBUF_H - -#define _STATBUF_H 1 - -#include - -/* NOTE: The size of this structure (32 ints) is known in - , since it is used in the `io_stat' RPC. MiG - does not cope at all well with the passed C structure not being of - the expected size. There are some filler words at the end to allow - for future expansion. To increase the size of the structure used - in the RPC and retain binary compatibility, we would need to assign - a new message number. */ - -struct stat - { - int st_fstype; /* File system type. */ - __fsid_t st_fsid; /* File system ID. */ -#define st_dev st_fsid - - __ino_t st_ino; /* File number. */ - unsigned int st_gen; /* To detect reuse of file numbers. */ - __dev_t st_rdev; /* Device if special file. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Number of links. */ - - __uid_t st_uid; /* Owner. */ - __gid_t st_gid; /* Owning group. */ - - __off_t st_size; /* Size in bytes. */ - - __time_t st_atime; /* Access time, seconds */ - unsigned long int st_atime_usec; /* and microseconds. */ - __time_t st_mtime; /* Modification time, seconds */ - unsigned long int st_mtime_usec; /* and microseconds. */ - __time_t st_ctime; /* Status change time, seconds */ - unsigned long int st_ctime_usec; /* and microseconds. */ - - unsigned int st_blksize; /* Optimal size for I/O. */ - -#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */ - - unsigned int st_blocks; /* Number of 512-byte blocks allocated. - Not related to `st_blksize'. */ - - __uid_t st_author; /* File author. */ - - unsigned int st_flags; /* User-defined flags. - High 16 bits can be set only by root. */ - - int st_spare[11]; /* Room for future expansion. */ - }; - -/* Encoding of the file mode. */ - -#define __S_IFMT 0170000 /* These bits determine file type. */ - -/* File types. */ -#define __S_IFDIR 0040000 /* Directory. */ -#define __S_IFCHR 0020000 /* Character device. */ -#define __S_IFBLK 0060000 /* Block device. */ -#define __S_IFREG 0100000 /* Regular file. */ -#define __S_IFLNK 0120000 /* Symbolic link. */ -#define __S_IFSOCK 0140000 /* Socket. */ -#define __S_IFIFO 0010000 /* FIFO. */ - -/* Protection bits. */ - -#define __S_ISUID 04000 /* Set user ID on execution. */ -#define __S_ISGID 02000 /* Set group ID on execution. */ -#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ -#define __S_IREAD 00400 /* Read by owner. */ -#define __S_IWRITE 00200 /* Write by owner. */ -#define __S_IEXEC 00100 /* Execute by owner. */ - - -#ifdef __USE_GNU -/* If set, there is no benefit in caching the contents of this file. */ -#define S_INOCACHE 000000200000 - -/* If the S_IUSEUNK bit is set, then the S_IUNKNOWN bits (see below) - control access for unknown users. If S_IUSEUNK is clear, then unknown - users are treated as "others" for purposes of access control. */ -#define S_IUSEUNK 000000400000 -/* Mask of protection bits for unknown users (no effective IDs at all). */ -#define S_IUNKNOWN 000007000000 -/* Shift S_IREAD, S_IWRITE, S_IEXEC left this many bits to produce the - protection bits for unknown users. */ -#define S_IUNKSHIFT 12 - -/* Read only bits: */ - -/* There is a passive translator set for this file */ -#define S_IPTRANS 000010000000 -/* There is an active translator running on this file */ -#define S_IATRANS 000020000000 -/* This is the root of a filesystem (or single node translator) */ -#define S_IROOT 000040000000 -/* All the bits relevant to translators */ -#define S_ITRANS 000070000000 - -/* ALL the unused bits. */ -#define S_ISPARE (~(S_IFMT|S_ITRANS|S_INOCACHE| \ - S_IUSEUNK|S_IUNKNOWN|07777)) -#endif - -/* Default file creation mask (umask). */ -#ifdef __USE_BSD -#define CMASK 0022 -#endif - - -#endif /* statbuf.h */ diff --git a/sysdeps/mach/libc-lock.h b/sysdeps/mach/libc-lock.h deleted file mode 100644 index cfd1767..0000000 --- a/sysdeps/mach/libc-lock.h +++ /dev/null @@ -1,90 +0,0 @@ -/* libc-internal interface for mutex locks. Mach cthreads version. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _LIBC_LOCK_H -#define _LIBC_LOCK_H 1 - -#ifdef _LIBC -#include -#define __libc_lock_t struct mutex -#else -typedef struct __libc_lock_opaque__ __libc_lock_t; -#endif - -/* Define a lock variable NAME with storage class CLASS. The lock must be - initialized with __libc_lock_init before it can be used (or define it - with __libc_lock_define_initialized, below). Use `extern' for CLASS to - declare a lock defined in another module. In public structure - definitions you must use a pointer to the lock structure (i.e., NAME - begins with a `*'), because its storage size will not be known outside - of libc. */ -#define __libc_lock_define(CLASS,NAME) \ - CLASS __libc_lock_t NAME; - -/* Define an initialized lock variable NAME with storage class CLASS. */ -#define __libc_lock_define_initialized(CLASS,NAME) \ - CLASS __libc_lock_t NAME = MUTEX_INITIALIZER; - -/* Initialize the named lock variable, leaving it in a consistent, unlocked - state. */ -#define __libc_lock_init(NAME) __mutex_init (&(NAME)) - -/* Finalize the named lock variable, which must be locked. It cannot be - used again until __libc_lock_init is called again on it. This must be - called on a lock variable before the containing storage is reused. */ -#define __libc_lock_fini(NAME) __mutex_unlock (&(NAME)) - -/* Lock the named lock variable. */ -#define __libc_lock_lock(NAME) __mutex_lock (&(NAME)) - -/* Lock the named lock variable. */ -#define __libc_lock_trylock(NAME) (!__mutex_trylock (&(NAME))) - -/* Unlock the named lock variable. */ -#define __libc_lock_unlock(NAME) __mutex_unlock (&(NAME)) - -/* Start a critical region with a cleanup function */ -#define __libc_cleanup_region_start(FCT, ARG) \ -{ \ - typeof (FCT) __save_FCT = FCT; \ - typeof (ARG) __save_ARG = ARG; \ - /* close brace is in __libc_cleanup_region_end below. */ - -/* End a critical region started with __libc_cleanup_region_start. */ -#define __libc_cleanup_region_end(DOIT) \ - if (DOIT) \ - (*__save_FCT)(__save_ARG); \ -} - - -#ifdef _LIBC -/* We need portable names for some functions. E.g., when they are - used as argument to __libc_cleanup_region_start. */ -#define __libc_mutex_unlock __mutex_unlock -#endif - -/* XXX until cthreads supports recursive locks */ -#define __libc_lock_define_initialized_recursive __libc_lock_define_initialized -#define __libc_lock_init_recursive __libc_lock_init -#define __libc_lock_fini_recursive __libc_lock_fini -#define __libc_lock_trylock_recursive __libc_lock_trylock -#define __libc_lock_unlock_recursive __libc_lock_unlock -#define __libc_lock_lock_recursive __libc_lock_lock - -#endif /* libc-lock.h */ diff --git a/sysdeps/mach/mips/cacheflush.c b/sysdeps/mach/mips/cacheflush.c index 5325e6f..de2ec58 100644 --- a/sysdeps/mach/mips/cacheflush.c +++ b/sysdeps/mach/mips/cacheflush.c @@ -1,28 +1,28 @@ /* Flush the insn cache after GCC writes a closure on the stack. Mach/MIPS. -Copyright (C) 1994 Free Software Foundation, Inc. -This file is part of the GNU C Library. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. + 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 + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include /* Stupid name, but this is what GCC generates (config/mips/mips.h). */ void -cacheflush (void *addr, size_t size, int flag) +cacheflush (void *addr, unsigned size, int flag) { vm_machine_attribute_val_t val; diff --git a/sysdeps/mach/mips/machine-lock.h b/sysdeps/mach/mips/machine-lock.h index 628aae4..91d39e3 100644 --- a/sysdeps/mach/mips/machine-lock.h +++ b/sysdeps/mach/mips/machine-lock.h @@ -1,25 +1,28 @@ /* Machine-specific definition for spin locks. MIPS version. -Copyright (C) 1994 Free Software Foundation, Inc. -This file is part of the GNU C Library. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. + 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 + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #ifndef _MACHINE_LOCK_H #define _MACHINE_LOCK_H +/* To get the TAS pseudo-instruction. */ +#include + /* The type of a spin lock variable. */ typedef __volatile int __spin_lock_t; @@ -46,19 +49,35 @@ __spin_unlock (__spin_lock_t *__lock) _EXTERN_INLINE int __spin_try_lock (register __spin_lock_t *__lock) { - register int __rtn; +#if (__mips >= 2) + int __rtn; + __asm__ __volatile (".set noreorder"); -#if 0 - __asm__ __volatile ("lw %0,0(%1)": "=r" (__rtn) : "r" (__lock)); - __asm__ __volatile ("sw %0,0(%0)": : "r" (__lock)); - __asm__ __volatile ("xor %0,%1,%0": "=r" (__rtn) : "r" (__lock)); +#if (__mips64) + __asm__ __volatile ("lld %0,0(%1)" : "=r" (__rtn) : "r" (__lock)); #else - /* Use the Mach microkernel's emulated TAS pseudo-instruction. */ - register int __rtn __asm__ ("a0"); - __asm__ __volatile (".word 0xf ! %0 " : "=r" (__rtn) : "0" (__lock)); + __asm__ __volatile ("ll %0,0(%1)" : "=r" (__rtn) : "r" (__lock)); +#endif + if (__rtn) + return 0; + __asm__ __volatile ("move %0,%1" : "=r" (__rtn) : "r" (__lock)); +#if (__mips64) + __asm__ __volatile ("scd %0,0(%1)" : "=r" (__rtn) : "r" (__lock)); +#else + __asm__ __volatile ("sc %0,0(%1)" : "=r" (__rtn) : "r" (__lock)); #endif __asm__ __volatile (".set reorder"); + return __rtn; +#else + register int __rtn __asm__ ("a0"); + + /* Use the Mach microkernel's emulated TAS pseudo-instruction. */ + __asm__ __volatile (".set noreorder"); + __asm__ __volatile (".word %1" : "=r" (__rtn) : "i" (op_tas), "0" (__lock)); + __asm__ __volatile ("nop"); + __asm__ __volatile (".set reorder"); return __rtn ^ (int) __lock; +#endif } /* Return nonzero if LOCK is locked. */ diff --git a/sysdeps/mach/mips/machine-sp.h b/sysdeps/mach/mips/machine-sp.h index 7406658..e1217c3 100644 --- a/sysdeps/mach/mips/machine-sp.h +++ b/sysdeps/mach/mips/machine-sp.h @@ -1,21 +1,21 @@ /* Machine-specific function to return the stack pointer. MIPS version. -Copyright (C) 1994 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 Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #ifndef _MACHINE_SP_H #define _MACHINE_SP_H diff --git a/sysdeps/mach/mips/syscall.S b/sysdeps/mach/mips/syscall.S index bf56b40..9936772 100644 --- a/sysdeps/mach/mips/syscall.S +++ b/sysdeps/mach/mips/syscall.S @@ -1,37 +1,48 @@ -/* Copyright (C) 1994 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. + 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 + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include +#ifdef PIC + .option pic2 +#endif ENTRY (syscall) - .frame sp,0,ra move v0, a0 /* Load system call number from first arg. */ move a0, a1 /* Move the next three args up a register. */ move a1, a2 move a2, a3 /* Load the remaining possible args (up to 11) from the stack. */ - lw t0,16(sp) - lw t1,20(sp) - lw t2,24(sp) - lw t3,28(sp) - lw t4,32(sp) - lw t5,36(sp) - lw t6,40(sp) +#ifdef __mips64 + ld t0,4*8(sp) + ld t1,5*8(sp) + ld t2,6*8(sp) + ld t3,7*8(sp) + ld t4,8*8(sp) + ld t5,9*8(sp) + ld t6,10*8(sp) +#else + lw t0,4*4(sp) + lw t1,5*4(sp) + lw t2,6*4(sp) + lw t3,7*4(sp) + lw t4,8*4(sp) + lw t5,9*4(sp) + lw t6,10*4(sp) +#endif syscall /* Do the system call. */ j ra /* Return to caller. */ - .end syscall diff --git a/sysdeps/mach/mips/sysdep.h b/sysdeps/mach/mips/sysdep.h index 7609be5..a4e6dff 100644 --- a/sysdeps/mach/mips/sysdep.h +++ b/sysdeps/mach/mips/sysdep.h @@ -1,35 +1,40 @@ -/* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. + 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 + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -#define MOVE(x,y) move y , x - -#if 0 #define LOSE asm volatile ("1: b 1b") -#endif +#define START_MACHDEP asm ("\ + .text\n\ + .globl _start\n\ + .ent _start\n\ +_start:\n\ + # Put initial SP in a0.\n\ + move $4, $29\n\ + # Jump to _start0; don't return.\n\ + j _start0\n\ + .end _start\n\ +"); +#define START_ARGS int *entry_sp #define SNARF_ARGS(argc, argv, envp) \ do \ { \ - int *entry_sp; \ register char **p; \ \ - asm ("addu %0,$30,4" : "=r" (entry_sp)); \ - \ argc = *entry_sp; \ argv = (char **) (entry_sp + 1); \ p = argv; \ @@ -44,11 +49,20 @@ Cambridge, MA 02139, USA. */ ({ register int __fn = fn, __sp = (int) sp; \ asm volatile ("move $sp,%0; j %1" : : "r" (__sp), "r" (__fn));}) +#define RETURN_TO(sp, pc, retval) \ + asm volatile ("move $29, %0; move $2, %2; move $25, %1; jr $25" \ + : : "r" (sp), "r" (pc), "r" (retval)) + #define STACK_GROWTH_DOWN -#ifdef P40 #include +#if defined (ASSEMBLER) + +#define ALIGN 2 + +#define MOVE(x,y) move y , x + #define SYSCALL(name, args) \ .globl syscall_error; \ kernel_trap(name,SYS_##name,args); \ diff --git a/sysdeps/mach/mips/thread_state.h b/sysdeps/mach/mips/thread_state.h index f4f4b42..a72848d 100644 --- a/sysdeps/mach/mips/thread_state.h +++ b/sysdeps/mach/mips/thread_state.h @@ -1,25 +1,30 @@ /* Mach thread state definitions for machine-independent code. MIPS version. -Copyright (C) 1994 Free Software Foundation, Inc. -This file is part of the GNU C Library. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. + 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 + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #define MACHINE_THREAD_STATE_FLAVOR MIPS_THREAD_STATE #define MACHINE_THREAD_STATE_COUNT MIPS_THREAD_STATE_COUNT +#ifdef PIC +#define MACHINE_THREAD_STATE_SET_PC(ts, pc) \ + ((ts)->PC = (ts)->r25 = (unsigned long int) (pc)) +#endif + #define machine_thread_state mips_thread_state #define PC pc diff --git a/sysdeps/mach/start.c b/sysdeps/mach/start.c index c2ea3e3..b1d121e 100644 --- a/sysdeps/mach/start.c +++ b/sysdeps/mach/start.c @@ -29,7 +29,9 @@ Cambridge, MA 02139, USA. */ /* The first piece of initialized data. */ int __data_start = 0; +#ifndef _HURD_THREADVAR_H volatile int errno; +#endif extern void __mach_init (void); extern void __libc_init (int argc, char **argv, char **envp); @@ -62,6 +64,7 @@ start1 (void) #ifndef START_ARGS #define START_ARGS void +#endif #ifdef START_MACHDEP START_MACHDEP #define _start _start0 diff --git a/sysdeps/mips/add_n.S b/sysdeps/mips/add_n.S new file mode 100644 index 0000000..df32eec --- /dev/null +++ b/sysdeps/mips/add_n.S @@ -0,0 +1,121 @@ +/* MIPS2 __mpn_add_n -- Add two limb vectors of the same length > 0 and +store sum in a third limb vector. + +Copyright (C) 1995 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Library General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +The GNU MP 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 Library General Public +License for more details. + +You should have received a copy of the GNU Library General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +MA 02111-1307, USA. */ + +#include + +/* INPUT PARAMETERS + res_ptr $4 + s1_ptr $5 + s2_ptr $6 + size $7 +*/ +#ifdef PIC + .option pic2 +#endif +ENTRY (__mpn_add_n) + .set noreorder +#ifdef PIC + .cpload t9 +#endif + .set nomacro + + lw $10,0($5) + lw $11,0($6) + + addiu $7,$7,-1 + and $9,$7,4-1 /* number of limbs in first loop */ + beq $9,$0,.L0 /* if multiple of 4 limbs, skip first loop */ + move $2,$0 + + subu $7,$7,$9 + +.Loop0: addiu $9,$9,-1 + lw $12,4($5) + addu $11,$11,$2 + lw $13,4($6) + sltu $8,$11,$2 + addu $11,$10,$11 + sltu $2,$11,$10 + sw $11,0($4) + or $2,$2,$8 + + addiu $5,$5,4 + addiu $6,$6,4 + move $10,$12 + move $11,$13 + bne $9,$0,.Loop0 + addiu $4,$4,4 + +.L0: beq $7,$0,.Lend + nop + +.Loop: addiu $7,$7,-4 + + lw $12,4($5) + addu $11,$11,$2 + lw $13,4($6) + sltu $8,$11,$2 + addu $11,$10,$11 + sltu $2,$11,$10 + sw $11,0($4) + or $2,$2,$8 + + lw $10,8($5) + addu $13,$13,$2 + lw $11,8($6) + sltu $8,$13,$2 + addu $13,$12,$13 + sltu $2,$13,$12 + sw $13,4($4) + or $2,$2,$8 + + lw $12,12($5) + addu $11,$11,$2 + lw $13,12($6) + sltu $8,$11,$2 + addu $11,$10,$11 + sltu $2,$11,$10 + sw $11,8($4) + or $2,$2,$8 + + lw $10,16($5) + addu $13,$13,$2 + lw $11,16($6) + sltu $8,$13,$2 + addu $13,$12,$13 + sltu $2,$13,$12 + sw $13,12($4) + or $2,$2,$8 + + addiu $5,$5,16 + addiu $6,$6,16 + + bne $7,$0,.Loop + addiu $4,$4,16 + +.Lend: addu $11,$11,$2 + sltu $8,$11,$2 + addu $11,$10,$11 + sltu $2,$11,$10 + sw $11,0($4) + j $31 + or $2,$2,$8 diff --git a/sysdeps/mips/add_n.s b/sysdeps/mips/add_n.s deleted file mode 100644 index f5525ce..0000000 --- a/sysdeps/mips/add_n.s +++ /dev/null @@ -1,120 +0,0 @@ - # MIPS2 __mpn_add_n -- Add two limb vectors of the same length > 0 and - # store sum in a third limb vector. - - # Copyright (C) 1995 Free Software Foundation, Inc. - - # This file is part of the GNU MP Library. - - # The GNU MP Library is free software; you can redistribute it and/or modify - # it under the terms of the GNU Library General Public License as published by - # the Free Software Foundation; either version 2 of the License, or (at your - # option) any later version. - - # The GNU MP 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 Library General Public - # License for more details. - - # You should have received a copy of the GNU Library General Public License - # along with the GNU MP Library; see the file COPYING.LIB. If not, write to - # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - # MA 02111-1307, USA. - - - # INPUT PARAMETERS - # res_ptr $4 - # s1_ptr $5 - # s2_ptr $6 - # size $7 - - .text - .align 2 - .globl __mpn_add_n - .ent __mpn_add_n -__mpn_add_n: - .set noreorder - .set nomacro - - lw $10,0($5) - lw $11,0($6) - - addiu $7,$7,-1 - and $9,$7,4-1 # number of limbs in first loop - beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop - move $2,$0 - - subu $7,$7,$9 - -.Loop0: addiu $9,$9,-1 - lw $12,4($5) - addu $11,$11,$2 - lw $13,4($6) - sltu $8,$11,$2 - addu $11,$10,$11 - sltu $2,$11,$10 - sw $11,0($4) - or $2,$2,$8 - - addiu $5,$5,4 - addiu $6,$6,4 - move $10,$12 - move $11,$13 - bne $9,$0,.Loop0 - addiu $4,$4,4 - -.L0: beq $7,$0,.Lend - nop - -.Loop: addiu $7,$7,-4 - - lw $12,4($5) - addu $11,$11,$2 - lw $13,4($6) - sltu $8,$11,$2 - addu $11,$10,$11 - sltu $2,$11,$10 - sw $11,0($4) - or $2,$2,$8 - - lw $10,8($5) - addu $13,$13,$2 - lw $11,8($6) - sltu $8,$13,$2 - addu $13,$12,$13 - sltu $2,$13,$12 - sw $13,4($4) - or $2,$2,$8 - - lw $12,12($5) - addu $11,$11,$2 - lw $13,12($6) - sltu $8,$11,$2 - addu $11,$10,$11 - sltu $2,$11,$10 - sw $11,8($4) - or $2,$2,$8 - - lw $10,16($5) - addu $13,$13,$2 - lw $11,16($6) - sltu $8,$13,$2 - addu $13,$12,$13 - sltu $2,$13,$12 - sw $13,12($4) - or $2,$2,$8 - - addiu $5,$5,16 - addiu $6,$6,16 - - bne $7,$0,.Loop - addiu $4,$4,16 - -.Lend: addu $11,$11,$2 - sltu $8,$11,$2 - addu $11,$10,$11 - sltu $2,$11,$10 - sw $11,0($4) - j $31 - or $2,$2,$8 - - .end __mpn_add_n diff --git a/sysdeps/mips/addmul_1.S b/sysdeps/mips/addmul_1.S new file mode 100644 index 0000000..dc1dc1b --- /dev/null +++ b/sysdeps/mips/addmul_1.S @@ -0,0 +1,98 @@ +/* MIPS __mpn_addmul_1 -- Multiply a limb vector with a single limb and +add the product to a second limb vector. + +Copyright (C) 1995 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Library General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +The GNU MP 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 Library General Public +License for more details. + +You should have received a copy of the GNU Library General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +MA 02111-1307, USA. */ + +#include + +/* INPUT PARAMETERS + res_ptr $4 + s1_ptr $5 + size $6 + s2_limb $7 +*/ +#ifdef PIC + .option pic2 +#endif +ENTRY (__mpn_addmul_1) + .set noreorder +#ifdef PIC + .cpload t9 +#endif + .set nomacro + + /* warm up phase 0 */ + lw $8,0($5) + + /* warm up phase 1 */ + addiu $5,$5,4 + multu $8,$7 + + addiu $6,$6,-1 + beq $6,$0,$LC0 + move $2,$0 /* zero cy2 */ + + addiu $6,$6,-1 + beq $6,$0,$LC1 + lw $8,0($5) /* load new s1 limb as early as possible */ + +Loop: lw $10,0($4) + mflo $3 + mfhi $9 + addiu $5,$5,4 + addu $3,$3,$2 /* add old carry limb to low product limb */ + multu $8,$7 + lw $8,0($5) /* load new s1 limb as early as possible */ + addiu $6,$6,-1 /* decrement loop counter */ + sltu $2,$3,$2 /* carry from previous addition -> $2 */ + addu $3,$10,$3 + sltu $10,$3,$10 + addu $2,$2,$10 + sw $3,0($4) + addiu $4,$4,4 + bne $6,$0,Loop /* should be "bnel" */ + addu $2,$9,$2 /* add high product limb and carry from addition */ + + /* cool down phase 1 */ +$LC1: lw $10,0($4) + mflo $3 + mfhi $9 + addu $3,$3,$2 + sltu $2,$3,$2 + multu $8,$7 + addu $3,$10,$3 + sltu $10,$3,$10 + addu $2,$2,$10 + sw $3,0($4) + addiu $4,$4,4 + addu $2,$9,$2 /* add high product limb and carry from addition */ + + /* cool down phase 0 */ +$LC0: lw $10,0($4) + mflo $3 + mfhi $9 + addu $3,$3,$2 + sltu $2,$3,$2 + addu $3,$10,$3 + sltu $10,$3,$10 + addu $2,$2,$10 + sw $3,0($4) + j $31 + addu $2,$9,$2 /* add high product limb and carry from addition */ diff --git a/sysdeps/mips/addmul_1.s b/sysdeps/mips/addmul_1.s deleted file mode 100644 index 6145771..0000000 --- a/sysdeps/mips/addmul_1.s +++ /dev/null @@ -1,97 +0,0 @@ - # MIPS __mpn_addmul_1 -- Multiply a limb vector with a single limb and - # add the product to a second limb vector. - - # Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc. - - # This file is part of the GNU MP Library. - - # The GNU MP Library is free software; you can redistribute it and/or modify - # it under the terms of the GNU Library General Public License as published by - # the Free Software Foundation; either version 2 of the License, or (at your - # option) any later version. - - # The GNU MP 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 Library General Public - # License for more details. - - # You should have received a copy of the GNU Library General Public License - # along with the GNU MP Library; see the file COPYING.LIB. If not, write to - # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - # MA 02111-1307, USA. - - - # INPUT PARAMETERS - # res_ptr $4 - # s1_ptr $5 - # size $6 - # s2_limb $7 - - .text - .align 4 - .globl __mpn_addmul_1 - .ent __mpn_addmul_1 -__mpn_addmul_1: - .set noreorder - .set nomacro - - # warm up phase 0 - lw $8,0($5) - - # warm up phase 1 - addiu $5,$5,4 - multu $8,$7 - - addiu $6,$6,-1 - beq $6,$0,$LC0 - move $2,$0 # zero cy2 - - addiu $6,$6,-1 - beq $6,$0,$LC1 - lw $8,0($5) # load new s1 limb as early as possible - -Loop: lw $10,0($4) - mflo $3 - mfhi $9 - addiu $5,$5,4 - addu $3,$3,$2 # add old carry limb to low product limb - multu $8,$7 - lw $8,0($5) # load new s1 limb as early as possible - addiu $6,$6,-1 # decrement loop counter - sltu $2,$3,$2 # carry from previous addition -> $2 - addu $3,$10,$3 - sltu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - addiu $4,$4,4 - bne $6,$0,Loop - addu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 1 -$LC1: lw $10,0($4) - mflo $3 - mfhi $9 - addu $3,$3,$2 - sltu $2,$3,$2 - multu $8,$7 - addu $3,$10,$3 - sltu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - addiu $4,$4,4 - addu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 0 -$LC0: lw $10,0($4) - mflo $3 - mfhi $9 - addu $3,$3,$2 - sltu $2,$3,$2 - addu $3,$10,$3 - sltu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - j $31 - addu $2,$9,$2 # add high product limb and carry from addition - - .end __mpn_addmul_1 diff --git a/sysdeps/mips/bits/endian.h b/sysdeps/mips/bits/endian.h new file mode 100644 index 0000000..ba555cd --- /dev/null +++ b/sysdeps/mips/bits/endian.h @@ -0,0 +1,4 @@ +/* The MIPS architecture has selectable endianness. + This file is for a machine using big-endian mode. */ + +#define __BYTE_ORDER __BIG_ENDIAN diff --git a/sysdeps/mips/bits/setjmp.h b/sysdeps/mips/bits/setjmp.h new file mode 100644 index 0000000..7e570c6 --- /dev/null +++ b/sysdeps/mips/bits/setjmp.h @@ -0,0 +1,53 @@ +/* Define the machine-dependent type `jmp_buf'. MIPS version. + Copyright (C) 1992, 1993, 1995, 1997 Free Software Foundation, Inc. + Contributed by Brendan Kehoe (brendan@zen.org). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +typedef struct + { + /* Program counter. */ + __ptr_t __pc; + + /* Stack pointer. */ + __ptr_t __sp; + + /* Callee-saved registers s0 through s7. */ + int __regs[8]; + + /* The frame pointer. */ + __ptr_t __fp; + + /* The global pointer. */ + __ptr_t __gp; + + /* Floating point status register. */ + int __fpc_csr; + + /* Callee-saved floating point registers. */ + double __fpregs[6]; + } __jmp_buf[1]; + +#ifdef __USE_MISC +/* Offset to the program counter in `jmp_buf'. */ +# define JB_PC 0 +#endif + + +/* Test if longjmp to JMPBUF would unwind the frame + containing a local variable at ADDRESS. */ +#define _JMPBUF_UNWINDS(jmpbuf, address) \ + ((__ptr_t) (address) < (jmpbuf)[0].__sp) diff --git a/sysdeps/mips/bsd-_setjmp.S b/sysdeps/mips/bsd-_setjmp.S index 78776cd..f519f19 100644 --- a/sysdeps/mips/bsd-_setjmp.S +++ b/sysdeps/mips/bsd-_setjmp.S @@ -1,21 +1,21 @@ /* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. MIPS version. -Copyright (C) 1994, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. + 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 + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ /* This just does a tail-call to `__sigsetjmp (ARG, 0)'. We cannot do it in C because it must be a tail-call, so frame-unwinding @@ -23,7 +23,14 @@ Cambridge, MA 02139, USA. */ #include -ENTRY (setjmp) - j C_SYMBOL_NAME (__sigsetjmp) - li a1, $0 /* Pass a second argument of zero. */ - .end setjmp +#ifdef PIC + .option pic2 +#endif +ENTRY (_setjmp) +#ifdef PIC + .cpload t9 +#endif + la t9, C_SYMBOL_NAME (__sigsetjmp) + nop + jr t9 + li a1, 0 /* Pass a second argument of zero. */ diff --git a/sysdeps/mips/bsd-setjmp.S b/sysdeps/mips/bsd-setjmp.S index 4742462..9a22700 100644 --- a/sysdeps/mips/bsd-setjmp.S +++ b/sysdeps/mips/bsd-setjmp.S @@ -1,21 +1,21 @@ /* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. MIPS version. -Copyright (C) 1994, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. + 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 + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ /* This just does a tail-call to `__sigsetjmp (ARG, 1)'. We cannot do it in C because it must be a tail-call, so frame-unwinding @@ -23,7 +23,14 @@ Cambridge, MA 02139, USA. */ #include +#ifdef PIC + .option pic2 +#endif ENTRY (setjmp) - j C_SYMBOL_NAME (__sigsetjmp) +#ifdef PIC + .cpload t9 +#endif + la t9, C_SYMBOL_NAME (__sigsetjmp) + nop + jr t9 li a1, 1 /* Pass a second argument of one. */ - .end setjmp diff --git a/sysdeps/mips/bytesex.h b/sysdeps/mips/bytesex.h deleted file mode 100644 index ba555cd..0000000 --- a/sysdeps/mips/bytesex.h +++ /dev/null @@ -1,4 +0,0 @@ -/* The MIPS architecture has selectable endianness. - This file is for a machine using big-endian mode. */ - -#define __BYTE_ORDER __BIG_ENDIAN diff --git a/sysdeps/mips/dec/bits/endian.h b/sysdeps/mips/dec/bits/endian.h new file mode 100644 index 0000000..157bc44 --- /dev/null +++ b/sysdeps/mips/dec/bits/endian.h @@ -0,0 +1,4 @@ +/* The MIPS architecture has selectable endianness. + The DECstation uses little-endian mode. */ + +#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/sysdeps/mips/dec/bytesex.h b/sysdeps/mips/dec/bytesex.h deleted file mode 100644 index 157bc44..0000000 --- a/sysdeps/mips/dec/bytesex.h +++ /dev/null @@ -1,4 +0,0 @@ -/* The MIPS architecture has selectable endianness. - The DECstation uses little-endian mode. */ - -#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h index 422179c..ff7d371 100644 --- a/sysdeps/mips/dl-machine.h +++ b/sysdeps/mips/dl-machine.h @@ -18,30 +18,25 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef dl_machine_h +#define dl_machine_h + #define ELF_MACHINE_NAME "MIPS" #include -#include -#include -#include -#include -#include /* Translate a processor specific dynamic tag to the index in l_info array. */ #define DT_MIPS(x) (DT_MIPS_##x - DT_LOPROC + DT_NUM) -#if 1 -/* XXX If FLAGS has the MAP_ALIGN bit, we need 64k alignment. */ -#ifndef MAP_ALIGN -#define MAP_ALIGN 0x1000 -#endif -#define ELF_MACHINE_ALIGN_MASK(flags) ((flags & MAP_ALIGN) ? 0xffff : 0) +#if 0 +/* We may need 64k alignment. */ +#define ELF_MACHINE_ALIGN_MASK 0xffff #endif /* If there is a DT_MIPS_RLD_MAP entry in the dynamic section, fill it in with the run-time address of the r_debug structure */ -#define ELF_MACHINE_SET_DEBUG(l,r) \ +#define ELF_MACHINE_DEBUG_SETUP(l,r) \ do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \ *(ElfW(Addr) *)((l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) = \ (ElfW(Addr)) (r); \ @@ -67,14 +62,16 @@ elf_mips_got_from_gpreg (ElfW(Addr) gpreg) /* FIXME: the offset of gp from GOT may be system-dependent. */ return (ElfW(Addr) *) (gpreg - 0x7ff0); } -/* Return the link-time address of _DYNAMIC. Conveniently, this is the - first element of the GOT. This must be inlined in a function which - uses global data. */ -static inline ElfW(Addr) -elf_machine_dynamic (void) + +/* Return the run-time address of the _GLOBAL_OFFSET_TABLE_. + Must be inlined in a function which uses global data. */ +static inline ElfW(Addr) * +elf_machine_got (void) { - register ElfW(Addr) gp asm ("$28"); - return * (ElfW(Addr) *) (gp - 0x7ff0); + ElfW(Addr) gp; + + __asm__ __volatile__("move %0, $28\n\t" : "=r" (gp)); + return elf_mips_got_from_gpreg (gp); } @@ -83,6 +80,15 @@ static inline ElfW(Addr) elf_machine_load_address (void) { ElfW(Addr) addr; +#ifdef __mips64 + asm (" .set noreorder\n" + " dla %0, here\n" + " bltzal $0, here\n" + " nop\n" + "here: dsubu %0, $31, %0\n" + " .set reorder\n" + : "=r" (addr)); +#else asm (" .set noreorder\n" " la %0, here\n" " bltzal $0, here\n" @@ -90,6 +96,7 @@ elf_machine_load_address (void) "here: subu %0, $31, %0\n" " .set reorder\n" : "=r" (addr)); +#endif return addr; } @@ -97,7 +104,7 @@ elf_machine_load_address (void) #define ELF_MIPS_GNU_GOT1_MASK 0x80000000 /* Relocate GOT. */ -static void +static inline void elf_machine_got_rel (struct link_map *map) { ElfW(Addr) *got; @@ -107,14 +114,14 @@ elf_machine_got_rel (struct link_map *map) const char *strtab = ((void *) map->l_addr + map->l_info[DT_STRTAB]->d_un.d_ptr); - ElfW(Addr) resolve (const ElfW(Sym) *sym) - { - const ElfW(Sym) *ref = sym; - ElfW(Addr) sym_loadaddr; - sym_loadaddr = _dl_lookup_symbol (strtab + sym->st_name, &ref, scope, - map->l_name, 0, 1); - return (ref)? sym_loadaddr + ref->st_value: 0; - } +#define RESOLVE_GOTSYM(sym) \ + ({ \ + const ElfW(Sym) *ref = sym; \ + ElfW(Addr) sym_loadaddr; \ + sym_loadaddr = _dl_lookup_symbol (strtab + sym->st_name, &ref, scope, \ + map->l_name, DL_LOOKUP_NOPLT); \ + (ref)? sym_loadaddr + ref->st_value: 0; \ + }) got = (ElfW(Addr) *) ((void *) map->l_addr + map->l_info[DT_PLTGOT]->d_un.d_ptr); @@ -147,39 +154,35 @@ elf_machine_got_rel (struct link_map *map) if (sym->st_value /* && maybe_stub (sym->st_value) */) *got = sym->st_value + map->l_addr; else - *got = resolve (sym); + *got = RESOLVE_GOTSYM (sym); } else /* if (*got == 0 || *got == QS) */ - *got = resolve (sym); + *got = RESOLVE_GOTSYM (sym); } else if (sym->st_shndx == SHN_COMMON) - *got = resolve (sym); + *got = RESOLVE_GOTSYM (sym); else if (ELFW(ST_TYPE) (sym->st_info) == STT_FUNC && *got != sym->st_value /* && maybe_stub (*got) */) *got += map->l_addr; - else if (ELFW(ST_TYPE) (sym->st_info) == STT_SECTION - && ELFW(ST_BIND) (sym->st_info) == STB_GLOBAL) + else if (ELFW(ST_TYPE) (sym->st_info) == STT_SECTION) { - if (sym->st_other == 0 && sym->st_shndx == SHN_ABS) - *got = sym->st_value + map->l_addr; /* only for _gp_disp */ - /* else SGI stuff ignored */ + if (sym->st_other == 0) + *got += map->l_addr; } else - *got = resolve (sym); + *got = RESOLVE_GOTSYM (sym); got++; sym++; } +#undef RESOLVE_GOTSYM *_dl_global_scope_end = NULL; return; } -/* The MIPS never uses Elfxx_Rela relocations. */ -#define ELF_MACHINE_NO_RELA 1 - /* Set up the loaded object described by L so its stub function will jump to the on-demand fixup code in dl-runtime.c. */ @@ -188,6 +191,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy) { ElfW(Addr) *got; extern void _dl_runtime_resolve (ElfW(Word)); + extern int _dl_mips_gnu_objects; if (lazy) { @@ -208,7 +212,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy) if ((got[1] & ELF_MIPS_GNU_GOT1_MASK) != 0) got[1] = (ElfW(Addr)) ((unsigned) l | ELF_MIPS_GNU_GOT1_MASK); else - ; /* Do nothing. */ + _dl_mips_gnu_objects = 0; } /* Relocate global offset table. */ @@ -219,29 +223,64 @@ elf_machine_runtime_setup (struct link_map *l, int lazy) /* Get link_map for this object. */ static inline struct link_map * -elf_machine_runtime_link_map (ElfW(Addr) gpreg) +elf_machine_runtime_link_map (ElfW(Addr) gpreg, ElfW(Addr) stub_pc) { - ElfW(Addr) *got = elf_mips_got_from_gpreg (gpreg); - ElfW(Word) g1; - - g1 = ((ElfW(Word) *) got)[1]; + extern int _dl_mips_gnu_objects; /* got[1] is reserved to keep its link map address for the shared - object generated by gnu linker. If not so, we must search GOT - in object list slowly. XXX */ - if ((g1 & ELF_MIPS_GNU_GOT1_MASK) != 0) - return (struct link_map *) (g1 & ~ELF_MIPS_GNU_GOT1_MASK); - else + object generated by gnu linker. If all are such object, we can + find link map from current GPREG simply. If not so, get link map + for callers object containing STUB_PC. */ + + if (_dl_mips_gnu_objects) + { + ElfW(Addr) *got = elf_mips_got_from_gpreg (gpreg); + ElfW(Word) g1; + + g1 = ((ElfW(Word) *) got)[1]; + + if ((g1 & ELF_MIPS_GNU_GOT1_MASK) != 0) + return (struct link_map *) (g1 & ~ELF_MIPS_GNU_GOT1_MASK); + } + { struct link_map *l = _dl_loaded; + struct link_map *ret = 0; + ElfW(Addr) candidate = 0; + while (l) { - if (got == (ElfW(Addr) *) ((void *) l->l_addr - + l->l_info[DT_PLTGOT]->d_un.d_ptr)) - return l; + ElfW(Addr) base = 0; + const ElfW(Phdr) *p = l->l_phdr; + ElfW(Half) this, nent = l->l_phnum; + + /* Get the base. */ + for (this = 0; this < nent; this++) + if (p[this].p_type == PT_LOAD) + { + base = p[this].p_vaddr + l->l_addr; + break; + } + if (! base) + { + l = l->l_next; + continue; + } + + /* Find closest link base addr. */ + if ((base < stub_pc) && (candidate < base)) + { + candidate = base; + ret = l; + } l = l->l_next; } + if (candidate && ret && (candidate < stub_pc)) + return ret; + else if (!candidate) + return _dl_loaded; } + _dl_signal_error (0, NULL, "cannot find runtime link map"); } @@ -255,17 +294,117 @@ elf_machine_runtime_link_map (ElfW(Addr) gpreg) t8 index for this function symbol in .dynsym to usual c arguments. */ +#ifdef __mips64 +#define ELF_MACHINE_RUNTIME_TRAMPOLINE \ +/* The flag _dl_mips_gnu_objects is set if all dynamic objects are \ + generated by the gnu linker. */\ +int _dl_mips_gnu_objects = 1;\ +\ +/* This is called from assembly stubs below which the compiler can't see. */ \ +static ElfW(Addr) \ +__dl_runtime_resolve (ElfW(Word), ElfW(Word), ElfW(Addr), ElfW(Addr)) \ + __attribute__ ((unused)); \ +\ +static ElfW(Addr) \ +__dl_runtime_resolve (ElfW(Word) sym_index,\ + ElfW(Word) return_address,\ + ElfW(Addr) old_gpreg,\ + ElfW(Addr) stub_pc)\ +{\ + struct link_map *l = elf_machine_runtime_link_map (old_gpreg, stub_pc);\ + const ElfW(Sym) *const symtab\ + = (const ElfW(Sym) *) (l->l_addr + l->l_info[DT_SYMTAB]->d_un.d_ptr);\ + const char *strtab\ + = (void *) (l->l_addr + l->l_info[DT_STRTAB]->d_un.d_ptr);\ + const ElfW(Addr) *got\ + = (const ElfW(Addr) *) (l->l_addr + l->l_info[DT_PLTGOT]->d_un.d_ptr);\ + const ElfW(Word) local_gotno\ + = (const ElfW(Word)) l->l_info[DT_MIPS (LOCAL_GOTNO)]->d_un.d_val;\ + const ElfW(Word) gotsym\ + = (const ElfW(Word)) l->l_info[DT_MIPS (GOTSYM)]->d_un.d_val;\ + const ElfW(Sym) *definer;\ + ElfW(Addr) loadbase;\ + ElfW(Addr) funcaddr;\ + struct link_map **scope;\ +\ + /* Look up the symbol's run-time value. */\ + scope = _dl_object_relocation_scope (l);\ + definer = &symtab[sym_index];\ +\ + loadbase = _dl_lookup_symbol (strtab + definer->st_name, &definer,\ + scope, l->l_name, DL_LOOKUP_NOPLT);\ +\ + *_dl_global_scope_end = NULL;\ +\ + /* Apply the relocation with that value. */\ + funcaddr = loadbase + definer->st_value;\ + *(got + local_gotno + sym_index - gotsym) = funcaddr;\ +\ + return funcaddr;\ +}\ +\ +asm ("\n\ + .text\n\ + .align 3\n\ + .globl _dl_runtime_resolve\n\ + .type _dl_runtime_resolve,@function\n\ + .ent _dl_runtime_resolve\n\ +_dl_runtime_resolve:\n\ + .set noreorder\n\ + # Save old GP to $3.\n\ + move $3,$28\n\ + # Modify t9 ($25) so as to point .cpload instruction.\n\ + daddu $25,2*8\n\ + # Compute GP.\n\ + .cpload $25\n\ + .set reorder\n\ + # Save slot call pc.\n\ + move $2, $31\n\ + # Save arguments and sp value in stack.\n\ + dsubu $29, 10*8\n\ + .cprestore 8*8\n\ + sd $15, 9*8($29)\n\ + sd $4, 3*8($29)\n\ + sd $5, 4*8($29)\n\ + sd $6, 5*8($29)\n\ + sd $7, 6*8($29)\n\ + sd $16, 7*8($29)\n\ + move $16, $29\n\ + move $4, $24\n\ + move $5, $15\n\ + move $6, $3\n\ + move $7, $2\n\ + jal __dl_runtime_resolve\n\ + move $29, $16\n\ + ld $31, 9*8($29)\n\ + ld $4, 3*8($29)\n\ + ld $5, 4*8($29)\n\ + ld $6, 5*8($29)\n\ + ld $7, 6*8($29)\n\ + ld $16, 7*8($29)\n\ + daddu $29, 10*8\n\ + move $25, $2\n\ + jr $25\n\ + .end _dl_runtime_resolve\n\ +"); +#else #define ELF_MACHINE_RUNTIME_TRAMPOLINE \ +/* The flag _dl_mips_gnu_objects is set if all dynamic objects are \ + generated by the gnu linker. */\ +int _dl_mips_gnu_objects = 1;\ +\ /* This is called from assembly stubs below which the compiler can't see. */ \ -static ElfW(Addr) __dl_runtime_resolve (ElfW(Word), ElfW(Word), ElfW(Addr)) \ +static ElfW(Addr) \ +__dl_runtime_resolve (ElfW(Word), ElfW(Word), ElfW(Addr), ElfW(Addr)) \ __attribute__ ((unused)); \ \ static ElfW(Addr) \ __dl_runtime_resolve (ElfW(Word) sym_index,\ ElfW(Word) return_address,\ - ElfW(Addr) old_gpreg)\ + ElfW(Addr) old_gpreg,\ + ElfW(Addr) stub_pc)\ {\ - struct link_map *l = elf_machine_runtime_link_map (old_gpreg);\ + struct link_map *l = elf_machine_runtime_link_map (old_gpreg, stub_pc);\ const ElfW(Sym) *const symtab\ = (const ElfW(Sym) *) (l->l_addr + l->l_info[DT_SYMTAB]->d_un.d_ptr);\ const char *strtab\ @@ -286,7 +425,7 @@ __dl_runtime_resolve (ElfW(Word) sym_index,\ definer = &symtab[sym_index];\ \ loadbase = _dl_lookup_symbol (strtab + definer->st_name, &definer,\ - scope, l->l_name, 0, 1);\ + scope, l->l_name, DL_LOOKUP_NOPLT);\ \ *_dl_global_scope_end = NULL;\ \ @@ -312,6 +451,8 @@ _dl_runtime_resolve:\n\ # Compute GP.\n\ .cpload $25\n\ .set reorder\n\ + # Save slot call pc.\n\ + move $2, $31\n\ # Save arguments and sp value in stack.\n\ subu $29, 40\n\ .cprestore 32\n\ @@ -325,6 +466,7 @@ _dl_runtime_resolve:\n\ move $4, $24\n\ move $5, $15\n\ move $6, $3\n\ + move $7, $2\n\ jal __dl_runtime_resolve\n\ move $29, $16\n\ lw $31, 36($29)\n\ @@ -338,15 +480,91 @@ _dl_runtime_resolve:\n\ jr $25\n\ .end _dl_runtime_resolve\n\ "); +#endif /* Mask identifying addresses reserved for the user program, where the dynamic linker should not map anything. */ #define ELF_MACHINE_USER_ADDRESS_MASK 0x00000000UL + + /* Initial entry point code for the dynamic linker. The C function `_dl_start' is the real entry point; its return value is the user program's entry point. */ +#ifdef __mips64 +#define RTLD_START asm ("\ + .text\n\ + .align 3\n\ + .globl _start\n\ + .globl _dl_start_user\n\ + .ent _start\n\ +_start:\n\ + .set noreorder\n\ + bltzal $0, 0f\n\ + nop\n\ +0: .cpload $31\n\ + .set reorder\n\ + # i386 ABI book says that the first entry of GOT holds\n\ + # the address of the dynamic structure. Though MIPS ABI\n\ + # doesn't say nothing about this, I emulate this here.\n\ + dla $4, _DYNAMIC\n\ + sd $4, -0x7ff0($28)\n\ + move $4, $29\n\ + jal _dl_start\n\ + # Get the value of label '_dl_start_user' in t9 ($25).\n\ + dla $25, _dl_start_user\n\ +_dl_start_user:\n\ + .set noreorder\n\ + .cpload $25\n\ + .set reorder\n\ + move $16, $28\n\ + # Save the user entry point address in saved register.\n\ + move $17, $2\n\ + # See if we were run as a command with the executable file\n\ + # name as an extra leading argument.\n\ + ld $2, _dl_skip_args\n\ + beq $2, $0, 1f\n\ + # Load the original argument count.\n\ + ld $4, 0($29)\n\ + # Subtract _dl_skip_args from it.\n\ + dsubu $4, $2\n\ + # Adjust the stack pointer to skip _dl_skip_args words.\n\ + dsll $2,2\n\ + daddu $29, $2\n\ + # Save back the modified argument count.\n\ + sd $4, 0($29)\n\ + # Get _dl_default_scope[2] as argument in _dl_init_next call below.\n\ +1: dla $2, _dl_default_scope\n\ + ld $4, 2*8($2)\n\ + # Call _dl_init_next to return the address of an initializer\n\ + # function to run.\n\ + jal _dl_init_next\n\ + move $28, $16\n\ + # Check for zero return, when out of initializers.\n\ + beq $2, $0, 2f\n\ + # Call the shared object initializer function.\n\ + move $25, $2\n\ + ld $4, 0($29)\n\ + ld $5, 1*8($29)\n\ + ld $6, 2*8($29)\n\ + ld $7, 3*8($29)\n\ + jalr $25\n\ + move $28, $16\n\ + # Loop to call _dl_init_next for the next initializer.\n\ + b 1b\n\ + # Pass our finalizer function to the user in ra.\n\ +2: dla $31, _dl_fini\n\ + # Jump to the user entry point.\n\ + move $25, $17\n\ + ld $4, 0($29)\n\ + ld $5, 1*8($29)\n\ + ld $6, 2*8$29)\n\ + ld $7, 3*8($29)\n\ + jr $25\n\ + .end _start\n\ +"); +#else #define RTLD_START asm ("\ .text\n\ .globl _start\n\ @@ -417,6 +635,12 @@ _dl_start_user:\n\ jr $25\n\ .end _start\n\ "); +#endif + +/* The MIPS never uses Elfxx_Rela relocations. */ +#define ELF_MACHINE_NO_RELA 1 + +#endif /* !dl_machine_h */ #ifdef RESOLVE @@ -428,34 +652,37 @@ elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc, const ElfW(Sym) *sym, const struct r_found_version *version) { ElfW(Addr) *const reloc_addr = (void *) (map->l_addr + reloc->r_offset); - ElfW(Addr) loadbase, undo; + ElfW(Addr) loadbase; + ElfW(Addr) undo __attribute__ ((unused)); switch (ELFW(R_TYPE) (reloc->r_info)) { case R_MIPS_REL32: - if (ELFW(ST_BIND) (sym->st_info) == STB_LOCAL - && (ELFW(ST_TYPE) (sym->st_info) == STT_SECTION - || ELFW(ST_TYPE) (sym->st_info) == STT_NOTYPE)) - *reloc_addr += map->l_addr; - else - { + { + ElfW(Addr) undo = 0; + + if (ELFW(ST_BIND) (sym->st_info) == STB_LOCAL + && (ELFW(ST_TYPE) (sym->st_info) == STT_SECTION + || ELFW(ST_TYPE) (sym->st_info) == STT_NOTYPE)) + { + *reloc_addr += map->l_addr; + break; + } #ifndef RTLD_BOOTSTRAP - /* This is defined in rtld.c, but nowhere in the static libc.a; - make the reference weak so static programs can still link. This - declaration cannot be done when compiling rtld.c (i.e. #ifdef - RTLD_BOOTSTRAP) because rtld.c contains the common defn for - _dl_rtld_map, which is incompatible with a weak decl in the same - file. */ - weak_extern (_dl_rtld_map); - if (map == &_dl_rtld_map) - /* Undo the relocation done here during bootstrapping. Now we will - relocate it anew, possibly using a binding found in the user - program or a loaded library rather than the dynamic linker's - built-in definitions used while loading those libraries. */ - undo = map->l_addr + sym->st_value; - else + /* This is defined in rtld.c, but nowhere in the static libc.a; + make the reference weak so static programs can still link. This + declaration cannot be done when compiling rtld.c (i.e. #ifdef + RTLD_BOOTSTRAP) because rtld.c contains the common defn for + _dl_rtld_map, which is incompatible with a weak decl in the same + file. */ + weak_extern (_dl_rtld_map); + if (map == &_dl_rtld_map) + /* Undo the relocation done here during bootstrapping. Now we will + relocate it anew, possibly using a binding found in the user + program or a loaded library rather than the dynamic linker's + built-in definitions used while loading those libraries. */ + undo = map->l_addr + sym->st_value; #endif - undo = 0; loadbase = RESOLVE (&sym, version, 0); *reloc_addr += (sym ? (loadbase + sym->st_value) : 0) - undo; } diff --git a/sysdeps/mips/elf/start.S b/sysdeps/mips/elf/start.S new file mode 100644 index 0000000..0db3a04 --- /dev/null +++ b/sysdeps/mips/elf/start.S @@ -0,0 +1,181 @@ +/* Startup code compliant to the ELF Mips ABI. +Copyright (C) 1995 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 Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* This is the canonical entry point, usually the first thing in the text + segment. The SVR4/Mips ABI (pages 3-31, 3-32) says that when the entry + point runs, most registers' values are unspecified, except for: + + v1 ($2) Contains a function pointer to be registered with `atexit'. + This is how the dynamic linker arranges to have DT_FINI + functions called for shared libraries that have been loaded + before this code runs. + + sp ($29) The stack contains the arguments and environment: + 0(%esp) argc + 4(%esp) argv[0] + ... + (4*argc)(%esp) NULL + (4*(argc+1))(%esp) envp[0] + ... + NULL + ra ($31) The return address register is set to zero so that programs + that search backword through stack frames recognize the last + stack frame. +*/ + +#ifdef PIC +/* A macro to (re)initialize gp. We can get the run time address of 0f in + ra ($31) by blezal instruction. In this early phase, we can't save gp + in stack and .cprestore doesn't work properly. So we set gp by using + this macro. */ +#define SET_GP \ + .set noreorder; \ + bltzal $0,0f; \ + nop; \ +0: .cpload $31; \ + .set reorder; +#endif + + .text + .globl _start +_start: +#ifdef PIC + SET_GP +#endif + move $31, $0 + + /* $2 contains the address of the shared library termination + function, which we will register with `atexit' to be called by + `exit'. I suspect that on some systems, and when statically + linked, this will not be set by anything to any function + pointer; hopefully it will be zero so we don't try to call + random pointers. */ + beq $2, $0, nofini + move $4, $2 + jal atexit +#ifdef PIC + SET_GP +#endif +nofini: + + /* Do essential libc initialization. In statically linked + programs under the GNU Hurd, this is what sets up the + arguments on the stack for the code below. Since the argument + registers (a0 - a3) saved to the first 4 stack entries by + the prologue of __libc_init_first, we preload them to + prevent clobbering the stack tops. In Hurd case, stack pointer + ($29) may be VM_MAX_ADDRESS here. If so, we must modify it. */ +#if (__mips64) + dli $4, 0x10000000000 + bne $29, $4, 1f + dsubu $29, 32 + sd $0, 0($29) + sd $0, 8($29) + sd $0, 16($29) + sd $0, 24($29) +1: + ld $4, 0($29) + ld $5, 8($29) + ld $6, 16($29) + ld $7, 24($29) +#else /* __mips64 */ + li $4, 0x80000000 + bne $29, $4, 1f + subu $29, 16 + sw $0, 0($29) + sw $0, 4($29) + sw $0, 8($29) + sw $0, 12($29) +1: + lw $4, 0($29) + lw $5, 4($29) + lw $6, 8($29) + lw $7, 12($29) +#endif /* __mips64 */ + + jal __libc_init_first +#ifdef PIC + SET_GP +#endif +#if (__mips64) + ld $4, 0($29) + ld $5, 8($29) + ld $6, 16($29) + ld $7, 24($29) +#else /* __mips64 */ + lw $4, 0($29) + lw $5, 4($29) + lw $6, 8($29) + lw $7, 12($29) +#endif /* __mips64 */ + + /* Call `_init', which is the entry point to our own `.init' + section; and register with `atexit' to have `exit' call + `_fini', which is the entry point to our own `.fini' section. */ + jal _init +#ifdef PIC + SET_GP +#endif +#if (__mips64) + dla $4, _fini +#else /* __mips64 */ + la $4, _fini +#endif /* __mips64 */ + + jal atexit +#ifdef PIC + SET_GP +#endif + + /* Extract the arguments and environment as encoded on the stack + and set up the arguments for `main': argc, argv, envp. */ +#if (__mips64) + ld $4, 0($29) /* argc */ + daddu $5, $29, 8 /* argv */ + dsll $6, $4, 3 + daddu $6, $6, 8 + daddu $6, $5, $6 /* envp = &argv[argc + 1] */ +#else /* __mips64 */ + lw $4, 0($29) /* argc */ + addu $5, $29, 4 /* argv */ + sll $6, $4, 2 + addu $6, $6, 4 + addu $6, $5, $6 /* envp = &argv[argc + 1] */ +#endif /* __mips64 */ + + /* Call the user's main function, and exit with its value. */ + jal main +#ifdef PIC + SET_GP +#endif + move $4, $2 + jal exit /* This should never return. */ +hlt: b hlt /* Crash if somehow it does return. */ + +/* Define a symbol for the first piece of initialized data. */ + .data + .globl __data_start +__data_start: +#if (__mips64) + .dword 0 +#else /* __mips64 */ + .word 0 +#endif /* __mips64 */ + .weak data_start + data_start = __data_start diff --git a/sysdeps/mips/fpu_control.h b/sysdeps/mips/fpu_control.h new file mode 100644 index 0000000..36e05a4 --- /dev/null +++ b/sysdeps/mips/fpu_control.h @@ -0,0 +1,96 @@ +/* FPU control word bits. Mips version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Olaf Flebbe. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FPU_CONTROL_H +#define _FPU_CONTROL_H + +/* FP control/status register bit assignments. + * + * 31-25 24 23 22-18 17-12 11-7 6-2 1-0 + * (cause) (enables) (flags) + * | reserved | FS | C | reserved | E V Z O U I | V Z O U I | V Z O U I | RM + * + * FS: When set, denormalized results are flushed to zero instead of + * causing an unimplemented operation exception. + * C: Condition bit. + * E: Unimplemented Operation. + * V: Invalid Operation. + * Z: Division by zero. + * O: Overflow. + * U: Underflow. + * I: Inexact Operation + * RM: Rounding mode bits + * 00 (RN) - rounding to nearest + * 01 (RZ) - rounding toward zero + * 10 (RP) - rounding down (toward - infinity) + * 11 (RM) - rounding up (toward + infinity) + * + */ + +#include + +/* masking of interrupts */ +#define _FPU_MASK_IM (1 << 11) +#define _FPU_MASK_DM (1 << 24) /* XXX */ +#define _FPU_MASK_ZM (1 << 10) +#define _FPU_MASK_OM (1 << 9) +#define _FPU_MASK_UM (1 << 8) +#define _FPU_MASK_PM (1 << 7) + +/* precision control */ +#define _FPU_EXTENDED 0 +#define _FPU_DOUBLE 0 +#define _FPU_SINGLE 0 + +/* rounding control */ +#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */ +#define _FPU_RC_DOWN 0x2 +#define _FPU_RC_UP 0x3 +#define _FPU_RC_ZERO 0x1 + +#define _FPU_RESERVED 0xfe7c0000 /* Reserved bits */ + + +/* The fdlibm code requires strict IEEE double precision arithmetic, + and no interrupts for exceptions, rounding to nearest. */ + +#define _FPU_DEFAULT 0x0 + +/* IEEE: same as above, but exceptions */ +#define _FPU_IEEE (0x1f << 7) + +/* Type of the control word. */ +typedef unsigned int fpu_control_t; + +/* Macros for accessing the hardware control word. */ +#define _FPU_GETCW(cw) __asm__ ("cfc1 %0, $31; nop; nop" : "=r" (cw)) +#define _FPU_SETCW(cw) __asm__ ("ctc1 %0, $31; nop; nop" : : "r" (cw)) + +/* Default control word set at startup. */ +extern fpu_control_t __fpu_control; + +__BEGIN_DECLS + +/* Called at startup. It can be used to manipulate fpu control register. */ +extern void __setfpucw __P ((fpu_control_t)); + +__END_DECLS + +#endif /* fpu_control.h */ diff --git a/sysdeps/mips/init-first.c b/sysdeps/mips/init-first.c new file mode 100644 index 0000000..3fc4b7b --- /dev/null +++ b/sysdeps/mips/init-first.c @@ -0,0 +1,64 @@ +/* Initialization code run first thing by the ELF startup code. For mips/Unix. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +extern void __libc_init (int, char **, char **); +extern void __libc_global_ctors (void); + + +static void +init (int *data) +{ + int argc = *data; + char **argv = (void *) (data + 1); + char **envp = &argv[argc + 1]; + + __environ = envp; + __libc_init (argc, argv, envp); +} + +#ifdef PIC +/* This function is called to initialize the shared C library. + It is called just before the user _start code from mips/elf/start.S, + with the stack set up as that code gets it. */ + +/* NOTE! The linker notices the magical name `_init' and sets the DT_INIT + pointer in the dynamic section based solely on that. It is convention + for this function to be in the `.init' section, but the symbol name is + the only thing that really matters!! */ +/*void _init (int argc, ...) __attribute__ ((unused, section (".init")));*/ + +void +_init (int argc, ...) +{ + init (&argc); + + __libc_global_ctors (); +} +#endif + + +void +__libc_init_first (int argc __attribute__ ((unused)), ...) +{ +#ifndef PIC + init (&argc); +#endif +} diff --git a/sysdeps/mips/jmp_buf.h b/sysdeps/mips/jmp_buf.h deleted file mode 100644 index 102a019..0000000 --- a/sysdeps/mips/jmp_buf.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Define the machine-dependent type `jmp_buf'. MIPS version. - Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc. - Contributed by Brendan Kehoe (brendan@zen.org). - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -typedef struct - { - /* Program counter. */ - __ptr_t __pc; - - /* Stack pointer. */ - __ptr_t __sp; - - /* Callee-saved registers s0 through s7. */ - int __regs[8]; - - /* The frame pointer. */ - __ptr_t __fp; - - /* The global pointer. */ - __ptr_t __gp; - - /* Floating point status register. */ - int __fpc_csr; - - /* Callee-saved floating point registers. */ - double __fpregs[6]; - } __jmp_buf[1]; - -#ifdef __USE_MISC -/* Offset to the program counter in `jmp_buf'. */ -#define JB_PC 0 -#endif - - -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address) \ - ((__ptr_t) (address) < (jmpbuf)[0].__sp) diff --git a/sysdeps/mips/lshift.S b/sysdeps/mips/lshift.S new file mode 100644 index 0000000..e766303 --- /dev/null +++ b/sysdeps/mips/lshift.S @@ -0,0 +1,97 @@ +/* MIPS2 __mpn_lshift -- + +Copyright (C) 1995 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Library General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +The GNU MP 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 Library General Public +License for more details. + +You should have received a copy of the GNU Library General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +MA 02111-1307, USA. */ + +#include + +/* INPUT PARAMETERS + res_ptr $4 + src_ptr $5 + size $6 + cnt $7 +*/ +#ifdef PIC + .option pic2 +#endif +ENTRY (__mpn_lshift) + .set noreorder +#ifdef PIC + .cpload t9 +#endif + .set nomacro + + sll $2,$6,2 + addu $5,$5,$2 /* make r5 point at end of src */ + lw $10,-4($5) /* load first limb */ + subu $13,$0,$7 + addu $4,$4,$2 /* make r4 point at end of res */ + addiu $6,$6,-1 + and $9,$6,4-1 /* number of limbs in first loop */ + beq $9,$0,.L0 /* if multiple of 4 limbs, skip first loop */ + srl $2,$10,$13 /* compute function result */ + + subu $6,$6,$9 + +.Loop0: lw $3,-8($5) + addiu $4,$4,-4 + addiu $5,$5,-4 + addiu $9,$9,-1 + sll $11,$10,$7 + srl $12,$3,$13 + move $10,$3 + or $8,$11,$12 + bne $9,$0,.Loop0 + sw $8,0($4) + +.L0: beq $6,$0,.Lend + nop + +.Loop: lw $3,-8($5) + addiu $4,$4,-16 + addiu $6,$6,-4 + sll $11,$10,$7 + srl $12,$3,$13 + + lw $10,-12($5) + sll $14,$3,$7 + or $8,$11,$12 + sw $8,12($4) + srl $9,$10,$13 + + lw $3,-16($5) + sll $11,$10,$7 + or $8,$14,$9 + sw $8,8($4) + srl $12,$3,$13 + + lw $10,-20($5) + sll $14,$3,$7 + or $8,$11,$12 + sw $8,4($4) + srl $9,$10,$13 + + addiu $5,$5,-16 + or $8,$14,$9 + bgtz $6,.Loop + sw $8,0($4) + +.Lend: sll $8,$10,$7 + j $31 + sw $8,-4($4) diff --git a/sysdeps/mips/lshift.s b/sysdeps/mips/lshift.s deleted file mode 100644 index ee92d79..0000000 --- a/sysdeps/mips/lshift.s +++ /dev/null @@ -1,95 +0,0 @@ - # MIPS2 __mpn_lshift -- - - # Copyright (C) 1995 Free Software Foundation, Inc. - - # This file is part of the GNU MP Library. - - # The GNU MP Library is free software; you can redistribute it and/or modify - # it under the terms of the GNU Library General Public License as published by - # the Free Software Foundation; either version 2 of the License, or (at your - # option) any later version. - - # The GNU MP 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 Library General Public - # License for more details. - - # You should have received a copy of the GNU Library General Public License - # along with the GNU MP Library; see the file COPYING.LIB. If not, write to - # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - # MA 02111-1307, USA. - - - # INPUT PARAMETERS - # res_ptr $4 - # src_ptr $5 - # size $6 - # cnt $7 - - .text - .align 2 - .globl __mpn_lshift - .ent __mpn_lshift -__mpn_lshift: - .set noreorder - .set nomacro - - sll $2,$6,2 - addu $5,$5,$2 # make r5 point at end of src - lw $10,-4($5) # load first limb - subu $13,$0,$7 - addu $4,$4,$2 # make r4 point at end of res - addiu $6,$6,-1 - and $9,$6,4-1 # number of limbs in first loop - beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop - srl $2,$10,$13 # compute function result - - subu $6,$6,$9 - -.Loop0: lw $3,-8($5) - addiu $4,$4,-4 - addiu $5,$5,-4 - addiu $9,$9,-1 - sll $11,$10,$7 - srl $12,$3,$13 - move $10,$3 - or $8,$11,$12 - bne $9,$0,.Loop0 - sw $8,0($4) - -.L0: beq $6,$0,.Lend - nop - -.Loop: lw $3,-8($5) - addiu $4,$4,-16 - addiu $6,$6,-4 - sll $11,$10,$7 - srl $12,$3,$13 - - lw $10,-12($5) - sll $14,$3,$7 - or $8,$11,$12 - sw $8,12($4) - srl $9,$10,$13 - - lw $3,-16($5) - sll $11,$10,$7 - or $8,$14,$9 - sw $8,8($4) - srl $12,$3,$13 - - lw $10,-20($5) - sll $14,$3,$7 - or $8,$11,$12 - sw $8,4($4) - srl $9,$10,$13 - - addiu $5,$5,-16 - or $8,$14,$9 - bgtz $6,.Loop - sw $8,0($4) - -.Lend: sll $8,$10,$7 - j $31 - sw $8,-4($4) - .end __mpn_lshift diff --git a/sysdeps/mips/machine-gmon.h b/sysdeps/mips/machine-gmon.h new file mode 100644 index 0000000..a01b174 --- /dev/null +++ b/sysdeps/mips/machine-gmon.h @@ -0,0 +1,57 @@ +/* Machine-specific calling sequence for `mcount' profiling function. MIPS + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#define _MCOUNT_DECL static void __mcount + +/* Call __mcount with our the return PC for our caller, + and the return PC our caller will return to. */ +#ifdef PIC +#define CPLOAD ".cpload $25;" +#else +#define CPLOAD +#endif + +#define MCOUNT asm(\ + ".globl _mcount;" \ + ".align 2;" \ + ".type _mcount,@function;" \ + "_mcount:;" \ + ".set noreorder;" \ + ".set noat;" \ + CPLOAD \ + "sw $4,8($29);" \ + "sw $5,12($29);" \ + "sw $6,16($29);" \ + "sw $7,20($29);" \ + "sw $1,0($29);" \ + "sw $31,4($29);" \ + "move $5,$31;" \ + "jal __mcount;" \ + "move $4,$1;" \ + "lw $4,8($29);" \ + "lw $5,12($29);" \ + "lw $6,16($29);" \ + "lw $7,20($29);" \ + "lw $31,4($29);" \ + "lw $1,0($29);" \ + "addu $29,$29,8;" \ + "j $31;" \ + "move $31,$1;" \ + ".set reorder;" \ + ".set at"); diff --git a/sysdeps/mips/mips64/Implies b/sysdeps/mips/mips64/Implies new file mode 100644 index 0000000..a8cae95 --- /dev/null +++ b/sysdeps/mips/mips64/Implies @@ -0,0 +1 @@ +wordsize-64 diff --git a/sysdeps/mips/mips64/__longjmp.c b/sysdeps/mips/mips64/__longjmp.c new file mode 100644 index 0000000..551daa4 --- /dev/null +++ b/sysdeps/mips/mips64/__longjmp.c @@ -0,0 +1,85 @@ +/* Copyright (C) 1992, 1995, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Brendan Kehoe (brendan@zen.org). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include + +#undef __longjmp + +#ifndef __GNUC__ + #error This file uses GNU C extensions; you must compile with GCC. +#endif + +void +__longjmp (env, val_arg) + __jmp_buf env; + int val_arg; +{ + /* gcc 1.39.19 miscompiled the longjmp routine (as it did setjmp before + the hack around it); force it to use $a1 for the longjmp value. + Without this it saves $a1 in a register which gets clobbered + along the way. */ + register int val asm ("a1"); + + /* Pull back the floating point callee-saved registers. */ + asm volatile ("l.d $f24, %0" : : "m" (env[0].__fpregs[0])); + asm volatile ("l.d $f25, %0" : : "m" (env[0].__fpregs[1])); + asm volatile ("l.d $f26, %0" : : "m" (env[0].__fpregs[2])); + asm volatile ("l.d $f27, %0" : : "m" (env[0].__fpregs[3])); + asm volatile ("l.d $f28, %0" : : "m" (env[0].__fpregs[4])); + asm volatile ("l.d $f29, %0" : : "m" (env[0].__fpregs[5])); + asm volatile ("l.d $f30, %0" : : "m" (env[0].__fpregs[6])); + asm volatile ("l.d $f31, %0" : : "m" (env[0].__fpregs[7])); + + /* Restore the stack pointer. */ + asm volatile ("ld $29, %0" : : "m" (env[0].__sp)); + + /* Get and reconstruct the floating point csr. */ + asm volatile ("lw $2, %0" : : "m" (env[0].__fpc_csr)); + asm volatile ("ctc1 $2, $31"); + + /* Get the FP. */ + asm volatile ("ld $30, %0" : : "m" (env[0].__fp)); + + /* Get the GP. */ + asm volatile ("ld $gp, %0" : : "m" (env[0].__gp)); + + /* Get the callee-saved registers. */ + asm volatile ("ld $16, %0" : : "m" (env[0].__regs[0])); + asm volatile ("ld $17, %0" : : "m" (env[0].__regs[1])); + asm volatile ("ld $18, %0" : : "m" (env[0].__regs[2])); + asm volatile ("ld $19, %0" : : "m" (env[0].__regs[3])); + asm volatile ("ld $20, %0" : : "m" (env[0].__regs[4])); + asm volatile ("ld $21, %0" : : "m" (env[0].__regs[5])); + asm volatile ("ld $22, %0" : : "m" (env[0].__regs[6])); + asm volatile ("ld $23, %0" : : "m" (env[0].__regs[7])); + + /* Get the PC. */ + asm volatile ("ld $31, %0" : : "m" (env[0].__pc)); + + /* Give setjmp 1 if given a 0, or what they gave us if non-zero. */ + if (val == 0) + asm volatile ("dli $2, 1"); + else + asm volatile ("move $2, %0" : : "r" (val)); + + asm volatile ("j $31"); + + abort (); +} diff --git a/sysdeps/mips/mips64/add_n.S b/sysdeps/mips/mips64/add_n.S new file mode 100644 index 0000000..ad93d9d --- /dev/null +++ b/sysdeps/mips/mips64/add_n.S @@ -0,0 +1,129 @@ +/* MIPS3 __mpn_add_n -- Add two limb vectors of the same length > 0 and + * store sum in a third limb vector. + * + * Copyright (C) 1995 Free Software Foundation, Inc. + * + * This file is part of the GNU MP Library. + * + * The GNU MP Library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The GNU MP 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 Library General Public + * License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with the GNU MP Library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + +#include + +/* + * INPUT PARAMETERS + * res_ptr $4 + * s1_ptr $5 + * s2_ptr $6 + * size $7 + */ +#ifdef PIC + .option pic2 +#endif + .text + .align 2 + .globl __mpn_add_n + .ent __mpn_add_n +__mpn_add_n: + .set noreorder +#ifdef PIC + .cpload t9 +#endif + .set nomacro + + ld $10,0($5) + ld $11,0($6) + + daddiu $7,$7,-1 + and $9,$7,4-1 # number of limbs in first loop + beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop + move $2,$0 + + dsubu $7,$7,$9 + +.Loop0: daddiu $9,$9,-1 + ld $12,8($5) + daddu $11,$11,$2 + ld $13,8($6) + sltu $8,$11,$2 + daddu $11,$10,$11 + sltu $2,$11,$10 + sd $11,0($4) + or $2,$2,$8 + + daddiu $5,$5,8 + daddiu $6,$6,8 + move $10,$12 + move $11,$13 + bne $9,$0,.Loop0 + daddiu $4,$4,8 + +.L0: beq $7,$0,.Lend + nop + +.Loop: daddiu $7,$7,-4 + + ld $12,8($5) + daddu $11,$11,$2 + ld $13,8($6) + sltu $8,$11,$2 + daddu $11,$10,$11 + sltu $2,$11,$10 + sd $11,0($4) + or $2,$2,$8 + + ld $10,16($5) + daddu $13,$13,$2 + ld $11,16($6) + sltu $8,$13,$2 + daddu $13,$12,$13 + sltu $2,$13,$12 + sd $13,8($4) + or $2,$2,$8 + + ld $12,24($5) + daddu $11,$11,$2 + ld $13,24($6) + sltu $8,$11,$2 + daddu $11,$10,$11 + sltu $2,$11,$10 + sd $11,16($4) + or $2,$2,$8 + + ld $10,32($5) + daddu $13,$13,$2 + ld $11,32($6) + sltu $8,$13,$2 + daddu $13,$12,$13 + sltu $2,$13,$12 + sd $13,24($4) + or $2,$2,$8 + + daddiu $5,$5,32 + daddiu $6,$6,32 + + bne $7,$0,.Loop + daddiu $4,$4,32 + +.Lend: daddu $11,$11,$2 + sltu $8,$11,$2 + daddu $11,$10,$11 + sltu $2,$11,$10 + sd $11,0($4) + j $31 + or $2,$2,$8 + + .end __mpn_add_n diff --git a/sysdeps/mips/mips64/addmul_1.S b/sysdeps/mips/mips64/addmul_1.S new file mode 100644 index 0000000..58eff8c --- /dev/null +++ b/sysdeps/mips/mips64/addmul_1.S @@ -0,0 +1,106 @@ +/* MIPS3 __mpn_addmul_1 -- Multiply a limb vector with a single limb and + * add the product to a second limb vector. + * + * Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc. + * + * This file is part of the GNU MP Library. + * + * The GNU MP Library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The GNU MP 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 Library General Public + * License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with the GNU MP Library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + +#include + +/* INPUT PARAMETERS + * res_ptr $4 + * s1_ptr $5 + * size $6 + * s2_limb $7 + */ + +#ifdef PIC + .option pic2 +#endif + .text + .align 4 + .globl __mpn_addmul_1 + .ent __mpn_addmul_1 +__mpn_addmul_1: + .set noreorder +#ifdef PIC + .cpload t9 +#endif + .set nomacro + + # warm up phase 0 + ld $8,0($5) + + # warm up phase 1 + daddiu $5,$5,8 + dmultu $8,$7 + + daddiu $6,$6,-1 + beq $6,$0,$LC0 + move $2,$0 # zero cy2 + + daddiu $6,$6,-1 + beq $6,$0,$LC1 + ld $8,0($5) # load new s1 limb as early as possible + +Loop: ld $10,0($4) + mflo $3 + mfhi $9 + daddiu $5,$5,8 + daddu $3,$3,$2 # add old carry limb to low product limb + dmultu $8,$7 + ld $8,0($5) # load new s1 limb as early as possible + daddiu $6,$6,-1 # decrement loop counter + sltu $2,$3,$2 # carry from previous addition -> $2 + daddu $3,$10,$3 + sltu $10,$3,$10 + daddu $2,$2,$10 + sd $3,0($4) + daddiu $4,$4,8 + bne $6,$0,Loop + daddu $2,$9,$2 # add high product limb and carry from addition + + # cool down phase 1 +$LC1: ld $10,0($4) + mflo $3 + mfhi $9 + daddu $3,$3,$2 + sltu $2,$3,$2 + dmultu $8,$7 + daddu $3,$10,$3 + sltu $10,$3,$10 + daddu $2,$2,$10 + sd $3,0($4) + daddiu $4,$4,8 + daddu $2,$9,$2 # add high product limb and carry from addition + + # cool down phase 0 +$LC0: ld $10,0($4) + mflo $3 + mfhi $9 + daddu $3,$3,$2 + sltu $2,$3,$2 + daddu $3,$10,$3 + sltu $10,$3,$10 + daddu $2,$2,$10 + sd $3,0($4) + j $31 + daddu $2,$9,$2 # add high product limb and carry from addition + + .end __mpn_addmul_1 diff --git a/sysdeps/mips/mips64/bits/setjmp.h b/sysdeps/mips/mips64/bits/setjmp.h new file mode 100644 index 0000000..b108540 --- /dev/null +++ b/sysdeps/mips/mips64/bits/setjmp.h @@ -0,0 +1,54 @@ +/* Define the machine-dependent type `jmp_buf'. MIPS version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Brendan Kehoe (brendan@zen.org). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +typedef struct + { + /* Program counter. */ + __ptr_t __pc; + + /* Stack pointer. */ + __ptr_t __sp; + + /* Callee-saved registers s0 through s7. */ + int __regs[8]; + + /* The frame pointer. */ + __ptr_t __fp; + + /* The global pointer. */ + __ptr_t __gp; + + /* Floating point status register. */ + int __fpc_csr; + + /* Callee-saved floating point registers. */ + double __fpregs[8]; + } __jmp_buf[1]; + +#ifdef __USE_MISC +/* Offset to the program counter in `jmp_buf'. */ +# define JB_PC 0 +#endif + + +/* Test if longjmp to JMPBUF would unwind the frame + containing a local variable at ADDRESS. */ +#define _JMPBUF_UNWINDS(jmpbuf, address) \ + ((__ptr_t) (address) < (jmpbuf)[0].__sp) diff --git a/sysdeps/mips/mips64/bsd-_setjmp.S b/sysdeps/mips/mips64/bsd-_setjmp.S new file mode 100644 index 0000000..cd6ec3e --- /dev/null +++ b/sysdeps/mips/mips64/bsd-_setjmp.S @@ -0,0 +1,36 @@ +/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. MIPS64 version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* This just does a tail-call to `__sigsetjmp (ARG, 0)'. + We cannot do it in C because it must be a tail-call, so frame-unwinding + in setjmp doesn't clobber the state restored by longjmp. */ + +#include + +#ifdef PIC + .option pic2 +#endif +ENTRY (_setjmp) +#ifdef PIC + .cpload t9 +#endif + dla t9, C_SYMBOL_NAME (__sigsetjmp) + nop + jr t9 + dli a1, 0 /* Pass a second argument of zero. */ diff --git a/sysdeps/mips/mips64/bsd-setjmp.S b/sysdeps/mips/mips64/bsd-setjmp.S new file mode 100644 index 0000000..b370316 --- /dev/null +++ b/sysdeps/mips/mips64/bsd-setjmp.S @@ -0,0 +1,36 @@ +/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. MIPS64 version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* This just does a tail-call to `__sigsetjmp (ARG, 1)'. + We cannot do it in C because it must be a tail-call, so frame-unwinding + in setjmp doesn't clobber the state restored by longjmp. */ + +#include + +#ifdef PIC + .option pic2 +#endif +ENTRY (setjmp) +#ifdef PIC + .cpload t9 +#endif + dla t9, C_SYMBOL_NAME (__sigsetjmp) + nop + jr t9 + dli a1, 1 /* Pass a second argument of one. */ diff --git a/sysdeps/mips/mips64/gmp-mparam.h b/sysdeps/mips/mips64/gmp-mparam.h index a801b35..38872ec 100644 --- a/sysdeps/mips/mips64/gmp-mparam.h +++ b/sysdeps/mips/mips64/gmp-mparam.h @@ -20,7 +20,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define BITS_PER_MP_LIMB 64 #define BYTES_PER_MP_LIMB 8 -#define BITS_PER_LONGINT 32 -#define BITS_PER_INT 32 +#define BITS_PER_LONGINT 64 +#define BITS_PER_INT 64 #define BITS_PER_SHORTINT 16 #define BITS_PER_CHAR 8 diff --git a/sysdeps/mips/mips64/lshift.S b/sysdeps/mips/mips64/lshift.S new file mode 100644 index 0000000..ef403ec --- /dev/null +++ b/sysdeps/mips/mips64/lshift.S @@ -0,0 +1,104 @@ +/* MIPS3 __mpn_lshift -- + * + * Copyright (C) 1995 Free Software Foundation, Inc. + * + * This file is part of the GNU MP Library. + * + * The GNU MP Library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The GNU MP 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 Library General Public + * License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with the GNU MP Library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + +#include + +/* INPUT PARAMETERS + * res_ptr $4 + * src_ptr $5 + * size $6 + * cnt $7 + */ + +#ifdef PIC + .option pic2 +#endif + .text + .align 2 + .globl __mpn_lshift + .ent __mpn_lshift +__mpn_lshift: + .set noreorder +#ifdef PIC + .cpload t9 +#endif + .set nomacro + + dsll $2,$6,3 + daddu $5,$5,$2 # make r5 point at end of src + ld $10,-8($5) # load first limb + dsubu $13,$0,$7 + daddu $4,$4,$2 # make r4 point at end of res + daddiu $6,$6,-1 + and $9,$6,4-1 # number of limbs in first loop + beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop + dsrl $2,$10,$13 # compute function result + + dsubu $6,$6,$9 + +.Loop0: ld $3,-16($5) + daddiu $4,$4,-8 + daddiu $5,$5,-8 + daddiu $9,$9,-1 + dsll $11,$10,$7 + dsrl $12,$3,$13 + move $10,$3 + or $8,$11,$12 + bne $9,$0,.Loop0 + sd $8,0($4) + +.L0: beq $6,$0,.Lend + nop + +.Loop: ld $3,-16($5) + daddiu $4,$4,-32 + daddiu $6,$6,-4 + dsll $11,$10,$7 + dsrl $12,$3,$13 + + ld $10,-24($5) + dsll $14,$3,$7 + or $8,$11,$12 + sd $8,24($4) + dsrl $9,$10,$13 + + ld $3,-32($5) + dsll $11,$10,$7 + or $8,$14,$9 + sd $8,16($4) + dsrl $12,$3,$13 + + ld $10,-40($5) + dsll $14,$3,$7 + or $8,$11,$12 + sd $8,8($4) + dsrl $9,$10,$13 + + daddiu $5,$5,-32 + or $8,$14,$9 + bgtz $6,.Loop + sd $8,0($4) + +.Lend: dsll $8,$10,$7 + j $31 + sd $8,-8($4) + .end __mpn_lshift diff --git a/sysdeps/mips/mips64/mul_1.S b/sysdeps/mips/mips64/mul_1.S new file mode 100644 index 0000000..ef0cf36 --- /dev/null +++ b/sysdeps/mips/mips64/mul_1.S @@ -0,0 +1,94 @@ +/* MIPS3 __mpn_mul_1 -- Multiply a limb vector with a single limb and + * store the product in a second limb vector. + * + * Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc. + * + * This file is part of the GNU MP Library. + * + * The GNU MP Library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The GNU MP 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 Library General Public + * License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with the GNU MP Library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + +#include + +/* INPUT PARAMETERS + * res_ptr $4 + * s1_ptr $5 + * size $6 + * s2_limb $7 + */ + +#ifdef PIC + .option pic2 +#endif + .text + .align 4 + .globl __mpn_mul_1 + .ent __mpn_mul_1 +__mpn_mul_1: + .set noreorder +#ifdef PIC + .cpload t9 +#endif + .set nomacro + + # warm up phase 0 + ld $8,0($5) + + # warm up phase 1 + daddiu $5,$5,8 + dmultu $8,$7 + + daddiu $6,$6,-1 + beq $6,$0,$LC0 + move $2,$0 # zero cy2 + + daddiu $6,$6,-1 + beq $6,$0,$LC1 + ld $8,0($5) # load new s1 limb as early as possible + +Loop: mflo $10 + mfhi $9 + daddiu $5,$5,8 + daddu $10,$10,$2 # add old carry limb to low product limb + dmultu $8,$7 + ld $8,0($5) # load new s1 limb as early as possible + daddiu $6,$6,-1 # decrement loop counter + sltu $2,$10,$2 # carry from previous addition -> $2 + sd $10,0($4) + daddiu $4,$4,8 + bne $6,$0,Loop + daddu $2,$9,$2 # add high product limb and carry from addition + + # cool down phase 1 +$LC1: mflo $10 + mfhi $9 + daddu $10,$10,$2 + sltu $2,$10,$2 + dmultu $8,$7 + sd $10,0($4) + daddiu $4,$4,8 + daddu $2,$9,$2 # add high product limb and carry from addition + + # cool down phase 0 +$LC0: mflo $10 + mfhi $9 + daddu $10,$10,$2 + sltu $2,$10,$2 + sd $10,0($4) + j $31 + daddu $2,$9,$2 # add high product limb and carry from addition + + .end __mpn_mul_1 diff --git a/sysdeps/mips/mips64/rshift.S b/sysdeps/mips/mips64/rshift.S new file mode 100644 index 0000000..bc26f3f --- /dev/null +++ b/sysdeps/mips/mips64/rshift.S @@ -0,0 +1,101 @@ +/* MIPS3 __mpn_rshift -- + * + * Copyright (C) 1995 Free Software Foundation, Inc. + * + * This file is part of the GNU MP Library. + * + * The GNU MP Library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The GNU MP 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 Library General Public + * License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with the GNU MP Library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + +#include + +/* INPUT PARAMETERS + * res_ptr $4 + * src_ptr $5 + * size $6 + * cnt $7 + */ + +#ifdef PIC + .option pic2 +#endif + .text + .align 2 + .globl __mpn_rshift + .ent __mpn_rshift +__mpn_rshift: + .set noreorder +#ifdef PIC + .cpload t9 +#endif + .set nomacro + + ld $10,0($5) # load first limb + dsubu $13,$0,$7 + daddiu $6,$6,-1 + and $9,$6,4-1 # number of limbs in first loop + beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop + dsll $2,$10,$13 # compute function result + + dsubu $6,$6,$9 + +.Loop0: ld $3,8($5) + daddiu $4,$4,8 + daddiu $5,$5,8 + daddiu $9,$9,-1 + dsrl $11,$10,$7 + dsll $12,$3,$13 + move $10,$3 + or $8,$11,$12 + bne $9,$0,.Loop0 + sd $8,-8($4) + +.L0: beq $6,$0,.Lend + nop + +.Loop: ld $3,8($5) + daddiu $4,$4,32 + daddiu $6,$6,-4 + dsrl $11,$10,$7 + dsll $12,$3,$13 + + ld $10,16($5) + dsrl $14,$3,$7 + or $8,$11,$12 + sd $8,-32($4) + dsll $9,$10,$13 + + ld $3,24($5) + dsrl $11,$10,$7 + or $8,$14,$9 + sd $8,-24($4) + dsll $12,$3,$13 + + ld $10,32($5) + dsrl $14,$3,$7 + or $8,$11,$12 + sd $8,-16($4) + dsll $9,$10,$13 + + daddiu $5,$5,32 + or $8,$14,$9 + bgtz $6,.Loop + sd $8,-8($4) + +.Lend: dsrl $8,$10,$7 + j $31 + sd $8,0($4) + .end __mpn_rshift diff --git a/sysdeps/mips/mips64/setjmp.S b/sysdeps/mips/mips64/setjmp.S new file mode 100644 index 0000000..7421429 --- /dev/null +++ b/sysdeps/mips/mips64/setjmp.S @@ -0,0 +1,35 @@ +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +/* The function __sigsetjmp_aux saves all the registers, but it can't + reliably access the stack or frame pointers, so we pass them in as + extra arguments. */ +#ifdef PIC + .option pic2 +#endif +ENTRY (__sigsetjmp) +#ifdef PIC + .cpload t9 +#endif + move a2, sp + move a3, fp + dla t9, __sigsetjmp_aux + nop + jr t9 diff --git a/sysdeps/mips/mips64/setjmp_aux.c b/sysdeps/mips/mips64/setjmp_aux.c new file mode 100644 index 0000000..19d06e9 --- /dev/null +++ b/sysdeps/mips/mips64/setjmp_aux.c @@ -0,0 +1,67 @@ +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Brendan Kehoe (brendan@zen.org). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +/* This function is only called via the assembly language routine + __sigsetjmp, which arranges to pass in the stack pointer and the frame + pointer. We do things this way because it's difficult to reliably + access them in C. */ + +int +__sigsetjmp_aux (jmp_buf env, int savemask, int sp, int fp) +{ + /* Store the floating point callee-saved registers... */ + asm volatile ("s.d $f24, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[0])); + asm volatile ("s.d $f25, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[1])); + asm volatile ("s.d $f26, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[2])); + asm volatile ("s.d $f27, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[3])); + asm volatile ("s.d $f28, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[4])); + asm volatile ("s.d $f29, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[5])); + asm volatile ("s.d $f30, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[6])); + asm volatile ("s.d $f31, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[7])); + + /* .. and the PC; */ + asm volatile ("sd $31, %0" : : "m" (env[0].__jmpbuf[0].__pc)); + + /* .. and the stack pointer; */ + env[0].__jmpbuf[0].__sp = sp; + + /* .. and the FP; it'll be in s8. */ + env[0].__jmpbuf[0].__fp = fp; + + /* .. and the GP; */ + asm volatile ("sd $gp, %0" : : "m" (env[0].__jmpbuf[0].__gp)); + + /* .. and the callee-saved registers; */ + asm volatile ("sd $16, %0" : : "m" (env[0].__jmpbuf[0].__regs[0])); + asm volatile ("sd $17, %0" : : "m" (env[0].__jmpbuf[0].__regs[1])); + asm volatile ("sd $18, %0" : : "m" (env[0].__jmpbuf[0].__regs[2])); + asm volatile ("sd $19, %0" : : "m" (env[0].__jmpbuf[0].__regs[3])); + asm volatile ("sd $20, %0" : : "m" (env[0].__jmpbuf[0].__regs[4])); + asm volatile ("sd $21, %0" : : "m" (env[0].__jmpbuf[0].__regs[5])); + asm volatile ("sd $22, %0" : : "m" (env[0].__jmpbuf[0].__regs[6])); + asm volatile ("sd $23, %0" : : "m" (env[0].__jmpbuf[0].__regs[7])); + + /* .. and finally get and reconstruct the floating point csr. */ + asm ("cfc1 %0, $31" : "=r" (env[0].__jmpbuf[0].__fpc_csr)); + + /* Save the signal mask if requested. */ + return __sigjmp_save (env, savemask); +} diff --git a/sysdeps/mips/mips64/sub_n.S b/sysdeps/mips/mips64/sub_n.S new file mode 100644 index 0000000..bfcba95 --- /dev/null +++ b/sysdeps/mips/mips64/sub_n.S @@ -0,0 +1,129 @@ +/* MIPS3 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and + * store difference in a third limb vector. + * + * Copyright (C) 1995 Free Software Foundation, Inc. + * + * This file is part of the GNU MP Library. + * + * The GNU MP Library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The GNU MP 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 Library General Public + * License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with the GNU MP Library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + +#include + +/* INPUT PARAMETERS + * res_ptr $4 + * s1_ptr $5 + * s2_ptr $6 + * size $7 + */ + +#ifdef PIC + .option pic2 +#endif + .text + .align 2 + .globl __mpn_sub_n + .ent __mpn_sub_n +__mpn_sub_n: + .set noreorder +#ifdef PIC + .cpload t9 +#endif + .set nomacro + + ld $10,0($5) + ld $11,0($6) + + daddiu $7,$7,-1 + and $9,$7,4-1 # number of limbs in first loop + beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop + move $2,$0 + + dsubu $7,$7,$9 + +.Loop0: daddiu $9,$9,-1 + ld $12,8($5) + daddu $11,$11,$2 + ld $13,8($6) + sltu $8,$11,$2 + dsubu $11,$10,$11 + sltu $2,$10,$11 + sd $11,0($4) + or $2,$2,$8 + + daddiu $5,$5,8 + daddiu $6,$6,8 + move $10,$12 + move $11,$13 + bne $9,$0,.Loop0 + daddiu $4,$4,8 + +.L0: beq $7,$0,.Lend + nop + +.Loop: daddiu $7,$7,-4 + + ld $12,8($5) + daddu $11,$11,$2 + ld $13,8($6) + sltu $8,$11,$2 + dsubu $11,$10,$11 + sltu $2,$10,$11 + sd $11,0($4) + or $2,$2,$8 + + ld $10,16($5) + daddu $13,$13,$2 + ld $11,16($6) + sltu $8,$13,$2 + dsubu $13,$12,$13 + sltu $2,$12,$13 + sd $13,8($4) + or $2,$2,$8 + + ld $12,24($5) + daddu $11,$11,$2 + ld $13,24($6) + sltu $8,$11,$2 + dsubu $11,$10,$11 + sltu $2,$10,$11 + sd $11,16($4) + or $2,$2,$8 + + ld $10,32($5) + daddu $13,$13,$2 + ld $11,32($6) + sltu $8,$13,$2 + dsubu $13,$12,$13 + sltu $2,$12,$13 + sd $13,24($4) + or $2,$2,$8 + + daddiu $5,$5,32 + daddiu $6,$6,32 + + bne $7,$0,.Loop + daddiu $4,$4,32 + +.Lend: daddu $11,$11,$2 + sltu $8,$11,$2 + dsubu $11,$10,$11 + sltu $2,$10,$11 + sd $11,0($4) + j $31 + or $2,$2,$8 + + .end __mpn_sub_n diff --git a/sysdeps/mips/mips64/submul_1.S b/sysdeps/mips/mips64/submul_1.S new file mode 100644 index 0000000..66e634e --- /dev/null +++ b/sysdeps/mips/mips64/submul_1.S @@ -0,0 +1,106 @@ +/* MIPS3 __mpn_submul_1 -- Multiply a limb vector with a single limb and + * subtract the product from a second limb vector. + * + * Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc. + * + * This file is part of the GNU MP Library. + * + * The GNU MP Library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The GNU MP 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 Library General Public + * License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with the GNU MP Library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + +#include + +/* INPUT PARAMETERS + * res_ptr $4 + * s1_ptr $5 + * size $6 + * s2_limb $7 + */ + +#ifdef PIC + .option pic2 +#endif + .text + .align 4 + .globl __mpn_submul_1 + .ent __mpn_submul_1 +__mpn_submul_1: + .set noreorder +#ifdef PIC + .cpload t9 +#endif + .set nomacro + + # warm up phase 0 + ld $8,0($5) + + # warm up phase 1 + daddiu $5,$5,8 + dmultu $8,$7 + + daddiu $6,$6,-1 + beq $6,$0,$LC0 + move $2,$0 # zero cy2 + + daddiu $6,$6,-1 + beq $6,$0,$LC1 + ld $8,0($5) # load new s1 limb as early as possible + +Loop: ld $10,0($4) + mflo $3 + mfhi $9 + daddiu $5,$5,8 + daddu $3,$3,$2 # add old carry limb to low product limb + dmultu $8,$7 + ld $8,0($5) # load new s1 limb as early as possible + daddiu $6,$6,-1 # decrement loop counter + sltu $2,$3,$2 # carry from previous addition -> $2 + dsubu $3,$10,$3 + sgtu $10,$3,$10 + daddu $2,$2,$10 + sd $3,0($4) + daddiu $4,$4,8 + bne $6,$0,Loop + daddu $2,$9,$2 # add high product limb and carry from addition + + # cool down phase 1 +$LC1: ld $10,0($4) + mflo $3 + mfhi $9 + daddu $3,$3,$2 + sltu $2,$3,$2 + dmultu $8,$7 + dsubu $3,$10,$3 + sgtu $10,$3,$10 + daddu $2,$2,$10 + sd $3,0($4) + daddiu $4,$4,8 + daddu $2,$9,$2 # add high product limb and carry from addition + + # cool down phase 0 +$LC0: ld $10,0($4) + mflo $3 + mfhi $9 + daddu $3,$3,$2 + sltu $2,$3,$2 + dsubu $3,$10,$3 + sgtu $10,$3,$10 + daddu $2,$2,$10 + sd $3,0($4) + j $31 + daddu $2,$9,$2 # add high product limb and carry from addition + + .end __mpn_submul_1 diff --git a/sysdeps/mips/mipsel/bits/endian.h b/sysdeps/mips/mipsel/bits/endian.h new file mode 100644 index 0000000..5da5965 --- /dev/null +++ b/sysdeps/mips/mipsel/bits/endian.h @@ -0,0 +1,4 @@ +/* The MIPS architecture has selectable endianness. + This file is for a machine using little-endian mode. */ + +#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/sysdeps/mips/mipsel/bytesex.h b/sysdeps/mips/mipsel/bytesex.h deleted file mode 100644 index 5da5965..0000000 --- a/sysdeps/mips/mipsel/bytesex.h +++ /dev/null @@ -1,4 +0,0 @@ -/* The MIPS architecture has selectable endianness. - This file is for a machine using little-endian mode. */ - -#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/sysdeps/mips/mul_1.S b/sysdeps/mips/mul_1.S new file mode 100644 index 0000000..184aae6 --- /dev/null +++ b/sysdeps/mips/mul_1.S @@ -0,0 +1,86 @@ +/* MIPS __mpn_mul_1 -- Multiply a limb vector with a single limb and +store the product in a second limb vector. + +Copyright (C) 1995 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Library General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +The GNU MP 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 Library General Public +License for more details. + +You should have received a copy of the GNU Library General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +MA 02111-1307, USA. */ + +#include + +/* INPUT PARAMETERS + res_ptr $4 + s1_ptr $5 + size $6 + s2_limb $7 +*/ +#ifdef PIC + .option pic2 +#endif +ENTRY (__mpn_mul_1) + .set noreorder +#ifdef PIC + .cpload t9 +#endif + .set nomacro + + /* warm up phase 0 */ + lw $8,0($5) + + /* warm up phase 1 */ + addiu $5,$5,4 + multu $8,$7 + + addiu $6,$6,-1 + beq $6,$0,$LC0 + move $2,$0 /* zero cy2 */ + + addiu $6,$6,-1 + beq $6,$0,$LC1 + lw $8,0($5) /* load new s1 limb as early as possible */ + +Loop: mflo $10 + mfhi $9 + addiu $5,$5,4 + addu $10,$10,$2 /* add old carry limb to low product limb */ + multu $8,$7 + lw $8,0($5) /* load new s1 limb as early as possible */ + addiu $6,$6,-1 /* decrement loop counter */ + sltu $2,$10,$2 /* carry from previous addition -> $2 */ + sw $10,0($4) + addiu $4,$4,4 + bne $6,$0,Loop /* should be "bnel" */ + addu $2,$9,$2 /* add high product limb and carry from addition */ + + /* cool down phase 1 */ +$LC1: mflo $10 + mfhi $9 + addu $10,$10,$2 + sltu $2,$10,$2 + multu $8,$7 + sw $10,0($4) + addiu $4,$4,4 + addu $2,$9,$2 /* add high product limb and carry from addition + + /* cool down phase 0 */ +$LC0: mflo $10 + mfhi $9 + addu $10,$10,$2 + sltu $2,$10,$2 + sw $10,0($4) + j $31 + addu $2,$9,$2 /* add high product limb and carry from addition */ diff --git a/sysdeps/mips/mul_1.s b/sysdeps/mips/mul_1.s deleted file mode 100644 index d006fa1..0000000 --- a/sysdeps/mips/mul_1.s +++ /dev/null @@ -1,85 +0,0 @@ - # MIPS __mpn_mul_1 -- Multiply a limb vector with a single limb and - # store the product in a second limb vector. - - # Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc. - - # This file is part of the GNU MP Library. - - # The GNU MP Library is free software; you can redistribute it and/or modify - # it under the terms of the GNU Library General Public License as published by - # the Free Software Foundation; either version 2 of the License, or (at your - # option) any later version. - - # The GNU MP 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 Library General Public - # License for more details. - - # You should have received a copy of the GNU Library General Public License - # along with the GNU MP Library; see the file COPYING.LIB. If not, write to - # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - # MA 02111-1307, USA. - - - # INPUT PARAMETERS - # res_ptr $4 - # s1_ptr $5 - # size $6 - # s2_limb $7 - - .text - .align 4 - .globl __mpn_mul_1 - .ent __mpn_mul_1 -__mpn_mul_1: - .set noreorder - .set nomacro - - # warm up phase 0 - lw $8,0($5) - - # warm up phase 1 - addiu $5,$5,4 - multu $8,$7 - - addiu $6,$6,-1 - beq $6,$0,$LC0 - move $2,$0 # zero cy2 - - addiu $6,$6,-1 - beq $6,$0,$LC1 - lw $8,0($5) # load new s1 limb as early as possible - -Loop: mflo $10 - mfhi $9 - addiu $5,$5,4 - addu $10,$10,$2 # add old carry limb to low product limb - multu $8,$7 - lw $8,0($5) # load new s1 limb as early as possible - addiu $6,$6,-1 # decrement loop counter - sltu $2,$10,$2 # carry from previous addition -> $2 - sw $10,0($4) - addiu $4,$4,4 - bne $6,$0,Loop - addu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 1 -$LC1: mflo $10 - mfhi $9 - addu $10,$10,$2 - sltu $2,$10,$2 - multu $8,$7 - sw $10,0($4) - addiu $4,$4,4 - addu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 0 -$LC0: mflo $10 - mfhi $9 - addu $10,$10,$2 - sltu $2,$10,$2 - sw $10,0($4) - j $31 - addu $2,$9,$2 # add high product limb and carry from addition - - .end __mpn_mul_1 diff --git a/sysdeps/mips/p40/bits/endian.h b/sysdeps/mips/p40/bits/endian.h new file mode 100644 index 0000000..e4b0119 --- /dev/null +++ b/sysdeps/mips/p40/bits/endian.h @@ -0,0 +1,4 @@ +/* The MIPS has selectable endianness. + The Japanese homebrew P40 architecture uses big-endian mode. */ + +#define __BYTE_ORDER __BIG_ENDIAN diff --git a/sysdeps/mips/p40/bytesex.h b/sysdeps/mips/p40/bytesex.h deleted file mode 100644 index e4b0119..0000000 --- a/sysdeps/mips/p40/bytesex.h +++ /dev/null @@ -1,4 +0,0 @@ -/* The MIPS has selectable endianness. - The Japanese homebrew P40 architecture uses big-endian mode. */ - -#define __BYTE_ORDER __BIG_ENDIAN diff --git a/sysdeps/mips/rshift.S b/sysdeps/mips/rshift.S new file mode 100644 index 0000000..37bde2f --- /dev/null +++ b/sysdeps/mips/rshift.S @@ -0,0 +1,94 @@ +/* MIPS2 __mpn_rshift -- + +Copyright (C) 1995 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Library General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +The GNU MP 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 Library General Public +License for more details. + +You should have received a copy of the GNU Library General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +MA 02111-1307, USA. */ + +#include + +/* INPUT PARAMETERS + res_ptr $4 + src_ptr $5 + size $6 + cnt $7 +*/ +#ifdef PIC + .option pic2 +#endif +ENTRY (__mpn_rshift) + .set noreorder +#ifdef PIC + .cpload t9 +#endif + .set nomacro + + lw $10,0($5) /* load first limb */ + subu $13,$0,$7 + addiu $6,$6,-1 + and $9,$6,4-1 /* number of limbs in first loop */ + beq $9,$0,.L0 /* if multiple of 4 limbs, skip first loop*/ + sll $2,$10,$13 /* compute function result */ + + subu $6,$6,$9 + +.Loop0: lw $3,4($5) + addiu $4,$4,4 + addiu $5,$5,4 + addiu $9,$9,-1 + srl $11,$10,$7 + sll $12,$3,$13 + move $10,$3 + or $8,$11,$12 + bne $9,$0,.Loop0 + sw $8,-4($4) + +.L0: beq $6,$0,.Lend + nop + +.Loop: lw $3,4($5) + addiu $4,$4,16 + addiu $6,$6,-4 + srl $11,$10,$7 + sll $12,$3,$13 + + lw $10,8($5) + srl $14,$3,$7 + or $8,$11,$12 + sw $8,-16($4) + sll $9,$10,$13 + + lw $3,12($5) + srl $11,$10,$7 + or $8,$14,$9 + sw $8,-12($4) + sll $12,$3,$13 + + lw $10,16($5) + srl $14,$3,$7 + or $8,$11,$12 + sw $8,-8($4) + sll $9,$10,$13 + + addiu $5,$5,16 + or $8,$14,$9 + bgtz $6,.Loop + sw $8,-4($4) + +.Lend: srl $8,$10,$7 + j $31 + sw $8,0($4) diff --git a/sysdeps/mips/rshift.s b/sysdeps/mips/rshift.s deleted file mode 100644 index a8beb40..0000000 --- a/sysdeps/mips/rshift.s +++ /dev/null @@ -1,92 +0,0 @@ - # MIPS2 __mpn_rshift -- - - # Copyright (C) 1995 Free Software Foundation, Inc. - - # This file is part of the GNU MP Library. - - # The GNU MP Library is free software; you can redistribute it and/or modify - # it under the terms of the GNU Library General Public License as published by - # the Free Software Foundation; either version 2 of the License, or (at your - # option) any later version. - - # The GNU MP 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 Library General Public - # License for more details. - - # You should have received a copy of the GNU Library General Public License - # along with the GNU MP Library; see the file COPYING.LIB. If not, write to - # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - # MA 02111-1307, USA. - - - # INPUT PARAMETERS - # res_ptr $4 - # src_ptr $5 - # size $6 - # cnt $7 - - .text - .align 2 - .globl __mpn_rshift - .ent __mpn_rshift -__mpn_rshift: - .set noreorder - .set nomacro - - lw $10,0($5) # load first limb - subu $13,$0,$7 - addiu $6,$6,-1 - and $9,$6,4-1 # number of limbs in first loop - beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop - sll $2,$10,$13 # compute function result - - subu $6,$6,$9 - -.Loop0: lw $3,4($5) - addiu $4,$4,4 - addiu $5,$5,4 - addiu $9,$9,-1 - srl $11,$10,$7 - sll $12,$3,$13 - move $10,$3 - or $8,$11,$12 - bne $9,$0,.Loop0 - sw $8,-4($4) - -.L0: beq $6,$0,.Lend - nop - -.Loop: lw $3,4($5) - addiu $4,$4,16 - addiu $6,$6,-4 - srl $11,$10,$7 - sll $12,$3,$13 - - lw $10,8($5) - srl $14,$3,$7 - or $8,$11,$12 - sw $8,-16($4) - sll $9,$10,$13 - - lw $3,12($5) - srl $11,$10,$7 - or $8,$14,$9 - sw $8,-12($4) - sll $12,$3,$13 - - lw $10,16($5) - srl $14,$3,$7 - or $8,$11,$12 - sw $8,-8($4) - sll $9,$10,$13 - - addiu $5,$5,16 - or $8,$14,$9 - bgtz $6,.Loop - sw $8,-4($4) - -.Lend: srl $8,$10,$7 - j $31 - sw $8,0($4) - .end __mpn_rshift diff --git a/sysdeps/mips/setjmp.S b/sysdeps/mips/setjmp.S index 0f5dba3..bc42dcb 100644 --- a/sysdeps/mips/setjmp.S +++ b/sysdeps/mips/setjmp.S @@ -1,32 +1,35 @@ -/* Copyright (C) 1992, 1994 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. + 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 + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include /* The function __sigsetjmp_aux saves all the registers, but it can't reliably access the stack or frame pointers, so we pass them in as extra arguments. */ +#ifdef PIC + .option pic2 +#endif ENTRY (__sigsetjmp) +#ifdef PIC + .cpload t9 +#endif move a2, sp -#ifdef __sgi__ move a3, fp -#else - move a3, $fp -#endif - j __sigsetjmp_aux - .end __sigsetjmp + la t9, __sigsetjmp_aux + nop + jr t9 diff --git a/sysdeps/mips/setjmp_aux.c b/sysdeps/mips/setjmp_aux.c index d478e3f..d06732e 100644 --- a/sysdeps/mips/setjmp_aux.c +++ b/sysdeps/mips/setjmp_aux.c @@ -1,20 +1,21 @@ -/* Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. Contributed by Brendan Kehoe (brendan@zen.org). -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. + 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 + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include diff --git a/sysdeps/mips/sub_n.S b/sysdeps/mips/sub_n.S new file mode 100644 index 0000000..09fbf7e --- /dev/null +++ b/sysdeps/mips/sub_n.S @@ -0,0 +1,121 @@ +/* MIPS2 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and +store difference in a third limb vector. + +Copyright (C) 1995 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Library General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +The GNU MP 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 Library General Public +License for more details. + +You should have received a copy of the GNU Library General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +MA 02111-1307, USA. */ + +#include + +/* INPUT PARAMETERS + res_ptr $4 + s1_ptr $5 + s2_ptr $6 + size $7 +*/ +#ifdef PIC + .option pic2 +#endif +ENTRY (__mpn_sub_n) + .set noreorder +#ifdef PIC + .cpload t9 +#endif + .set nomacro + + lw $10,0($5) + lw $11,0($6) + + addiu $7,$7,-1 + and $9,$7,4-1 /* number of limbs in first loop */ + beq $9,$0,.L0 /* if multiple of 4 limbs, skip first loop */ + move $2,$0 + + subu $7,$7,$9 + +.Loop0: addiu $9,$9,-1 + lw $12,4($5) + addu $11,$11,$2 + lw $13,4($6) + sltu $8,$11,$2 + subu $11,$10,$11 + sltu $2,$10,$11 + sw $11,0($4) + or $2,$2,$8 + + addiu $5,$5,4 + addiu $6,$6,4 + move $10,$12 + move $11,$13 + bne $9,$0,.Loop0 + addiu $4,$4,4 + +.L0: beq $7,$0,.Lend + nop + +.Loop: addiu $7,$7,-4 + + lw $12,4($5) + addu $11,$11,$2 + lw $13,4($6) + sltu $8,$11,$2 + subu $11,$10,$11 + sltu $2,$10,$11 + sw $11,0($4) + or $2,$2,$8 + + lw $10,8($5) + addu $13,$13,$2 + lw $11,8($6) + sltu $8,$13,$2 + subu $13,$12,$13 + sltu $2,$12,$13 + sw $13,4($4) + or $2,$2,$8 + + lw $12,12($5) + addu $11,$11,$2 + lw $13,12($6) + sltu $8,$11,$2 + subu $11,$10,$11 + sltu $2,$10,$11 + sw $11,8($4) + or $2,$2,$8 + + lw $10,16($5) + addu $13,$13,$2 + lw $11,16($6) + sltu $8,$13,$2 + subu $13,$12,$13 + sltu $2,$12,$13 + sw $13,12($4) + or $2,$2,$8 + + addiu $5,$5,16 + addiu $6,$6,16 + + bne $7,$0,.Loop + addiu $4,$4,16 + +.Lend: addu $11,$11,$2 + sltu $8,$11,$2 + subu $11,$10,$11 + sltu $2,$10,$11 + sw $11,0($4) + j $31 + or $2,$2,$8 diff --git a/sysdeps/mips/sub_n.s b/sysdeps/mips/sub_n.s deleted file mode 100644 index 3368ef2..0000000 --- a/sysdeps/mips/sub_n.s +++ /dev/null @@ -1,120 +0,0 @@ - # MIPS2 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and - # store difference in a third limb vector. - - # Copyright (C) 1995 Free Software Foundation, Inc. - - # This file is part of the GNU MP Library. - - # The GNU MP Library is free software; you can redistribute it and/or modify - # it under the terms of the GNU Library General Public License as published by - # the Free Software Foundation; either version 2 of the License, or (at your - # option) any later version. - - # The GNU MP 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 Library General Public - # License for more details. - - # You should have received a copy of the GNU Library General Public License - # along with the GNU MP Library; see the file COPYING.LIB. If not, write to - # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - # MA 02111-1307, USA. - - - # INPUT PARAMETERS - # res_ptr $4 - # s1_ptr $5 - # s2_ptr $6 - # size $7 - - .text - .align 2 - .globl __mpn_sub_n - .ent __mpn_sub_n -__mpn_sub_n: - .set noreorder - .set nomacro - - lw $10,0($5) - lw $11,0($6) - - addiu $7,$7,-1 - and $9,$7,4-1 # number of limbs in first loop - beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop - move $2,$0 - - subu $7,$7,$9 - -.Loop0: addiu $9,$9,-1 - lw $12,4($5) - addu $11,$11,$2 - lw $13,4($6) - sltu $8,$11,$2 - subu $11,$10,$11 - sltu $2,$10,$11 - sw $11,0($4) - or $2,$2,$8 - - addiu $5,$5,4 - addiu $6,$6,4 - move $10,$12 - move $11,$13 - bne $9,$0,.Loop0 - addiu $4,$4,4 - -.L0: beq $7,$0,.Lend - nop - -.Loop: addiu $7,$7,-4 - - lw $12,4($5) - addu $11,$11,$2 - lw $13,4($6) - sltu $8,$11,$2 - subu $11,$10,$11 - sltu $2,$10,$11 - sw $11,0($4) - or $2,$2,$8 - - lw $10,8($5) - addu $13,$13,$2 - lw $11,8($6) - sltu $8,$13,$2 - subu $13,$12,$13 - sltu $2,$12,$13 - sw $13,4($4) - or $2,$2,$8 - - lw $12,12($5) - addu $11,$11,$2 - lw $13,12($6) - sltu $8,$11,$2 - subu $11,$10,$11 - sltu $2,$10,$11 - sw $11,8($4) - or $2,$2,$8 - - lw $10,16($5) - addu $13,$13,$2 - lw $11,16($6) - sltu $8,$13,$2 - subu $13,$12,$13 - sltu $2,$12,$13 - sw $13,12($4) - or $2,$2,$8 - - addiu $5,$5,16 - addiu $6,$6,16 - - bne $7,$0,.Loop - addiu $4,$4,16 - -.Lend: addu $11,$11,$2 - sltu $8,$11,$2 - subu $11,$10,$11 - sltu $2,$10,$11 - sw $11,0($4) - j $31 - or $2,$2,$8 - - .end __mpn_sub_n diff --git a/sysdeps/mips/submul_1.S b/sysdeps/mips/submul_1.S new file mode 100644 index 0000000..eae8ebb --- /dev/null +++ b/sysdeps/mips/submul_1.S @@ -0,0 +1,98 @@ +/* MIPS __mpn_submul_1 -- Multiply a limb vector with a single limb and +subtract the product from a second limb vector. + +Copyright (C) 1995 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Library General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +The GNU MP 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 Library General Public +License for more details. + +You should have received a copy of the GNU Library General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +MA 02111-1307, USA. */ + +#include + +/* INPUT PARAMETERS + res_ptr $4 + s1_ptr $5 + size $6 + s2_limb $7 +*/ +#ifdef PIC + .option pic2 +#endif +ENTRY (__mpn_submul_1) + .set noreorder +#ifdef PIC + .cpload t9 +#endif + .set nomacro + + /* warm up phase 0 */ + lw $8,0($5) + + /* warm up phase 1 */ + addiu $5,$5,4 + multu $8,$7 + + addiu $6,$6,-1 + beq $6,$0,$LC0 + move $2,$0 /* zero cy2 */ + + addiu $6,$6,-1 + beq $6,$0,$LC1 + lw $8,0($5) /* load new s1 limb as early as possible */ + +Loop: lw $10,0($4) + mflo $3 + mfhi $9 + addiu $5,$5,4 + addu $3,$3,$2 /* add old carry limb to low product limb */ + multu $8,$7 + lw $8,0($5) /* load new s1 limb as early as possible */ + addiu $6,$6,-1 /* decrement loop counter */ + sltu $2,$3,$2 /* carry from previous addition -> $2 */ + subu $3,$10,$3 + sgtu $10,$3,$10 + addu $2,$2,$10 + sw $3,0($4) + addiu $4,$4,4 + bne $6,$0,Loop /* should be "bnel" */ + addu $2,$9,$2 /* add high product limb and carry from addition */ + + /* cool down phase 1 */ +$LC1: lw $10,0($4) + mflo $3 + mfhi $9 + addu $3,$3,$2 + sltu $2,$3,$2 + multu $8,$7 + subu $3,$10,$3 + sgtu $10,$3,$10 + addu $2,$2,$10 + sw $3,0($4) + addiu $4,$4,4 + addu $2,$9,$2 /* add high product limb and carry from addition */ + + /* cool down phase 0 */ +$LC0: lw $10,0($4) + mflo $3 + mfhi $9 + addu $3,$3,$2 + sltu $2,$3,$2 + subu $3,$10,$3 + sgtu $10,$3,$10 + addu $2,$2,$10 + sw $3,0($4) + j $31 + addu $2,$9,$2 /* add high product limb and carry from addition */ diff --git a/sysdeps/mips/submul_1.s b/sysdeps/mips/submul_1.s deleted file mode 100644 index 1324b66..0000000 --- a/sysdeps/mips/submul_1.s +++ /dev/null @@ -1,97 +0,0 @@ - # MIPS __mpn_submul_1 -- Multiply a limb vector with a single limb and - # subtract the product from a second limb vector. - - # Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc. - - # This file is part of the GNU MP Library. - - # The GNU MP Library is free software; you can redistribute it and/or modify - # it under the terms of the GNU Library General Public License as published by - # the Free Software Foundation; either version 2 of the License, or (at your - # option) any later version. - - # The GNU MP 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 Library General Public - # License for more details. - - # You should have received a copy of the GNU Library General Public License - # along with the GNU MP Library; see the file COPYING.LIB. If not, write to - # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - # MA 02111-1307, USA. - - - # INPUT PARAMETERS - # res_ptr $4 - # s1_ptr $5 - # size $6 - # s2_limb $7 - - .text - .align 4 - .globl __mpn_submul_1 - .ent __mpn_submul_1 -__mpn_submul_1: - .set noreorder - .set nomacro - - # warm up phase 0 - lw $8,0($5) - - # warm up phase 1 - addiu $5,$5,4 - multu $8,$7 - - addiu $6,$6,-1 - beq $6,$0,$LC0 - move $2,$0 # zero cy2 - - addiu $6,$6,-1 - beq $6,$0,$LC1 - lw $8,0($5) # load new s1 limb as early as possible - -Loop: lw $10,0($4) - mflo $3 - mfhi $9 - addiu $5,$5,4 - addu $3,$3,$2 # add old carry limb to low product limb - multu $8,$7 - lw $8,0($5) # load new s1 limb as early as possible - addiu $6,$6,-1 # decrement loop counter - sltu $2,$3,$2 # carry from previous addition -> $2 - subu $3,$10,$3 - sgtu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - addiu $4,$4,4 - bne $6,$0,Loop - addu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 1 -$LC1: lw $10,0($4) - mflo $3 - mfhi $9 - addu $3,$3,$2 - sltu $2,$3,$2 - multu $8,$7 - subu $3,$10,$3 - sgtu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - addiu $4,$4,4 - addu $2,$9,$2 # add high product limb and carry from addition - - # cool down phase 0 -$LC0: lw $10,0($4) - mflo $3 - mfhi $9 - addu $3,$3,$2 - sltu $2,$3,$2 - subu $3,$10,$3 - sgtu $10,$3,$10 - addu $2,$2,$10 - sw $3,0($4) - j $31 - addu $2,$9,$2 # add high product limb and carry from addition - - .end __mpn_submul_1 diff --git a/sysdeps/posix/Makefile b/sysdeps/posix/Makefile index a47f77a..358114a 100644 --- a/sysdeps/posix/Makefile +++ b/sysdeps/posix/Makefile @@ -20,13 +20,13 @@ ifneq (yes,$(inhibit-stdio_lim)) # Disable these rules if we generate stdio_lim.h by other means. ifeq (yes,$(cross-compiling)) -$(common-objpfx)stdio_lim.h: +$(common-objpfx)bits/stdio_lim.h: @echo - @echo "You must build stdio_lim.h by hand. Stop." + @echo "You must build by hand. Stop." @echo @exit 1 else -$(common-objpfx)stdio_lim.h: $(common-objpfx)mk-stdiolim +$(common-objpfx)bits/stdio_lim.h: $(common-objpfx)mk-stdiolim $(dir $<)$(notdir $<) > $@-t mv $@-t $@ endif @@ -36,10 +36,10 @@ mk-stdiolim-CFLAGS = $(patsubst -I$(shell pwd)//%,-I/%,\ $(patsubst -I%,-I$(shell pwd)/%,$(+includes))) # $(ALL_BUILD_CFLAGS) needs to come last because it contains unwanted -Is. $(common-objpfx)mk-stdiolim: $(sysdep_dir)/posix/mk-stdiolim.c \ - $(..)posix/posix1_lim.h local_lim.h + $(..)posix/bits/posix1_lim.h bits/local_lim.h $(common-objdir-compile) -common-generated := $(common-generated) stdio_lim.h mk-stdiolim -before-compile := $(before-compile) $(common-objpfx)stdio_lim.h +common-generated := $(common-generated) bits/stdio_lim.h mk-stdiolim +before-compile := $(before-compile) $(common-objpfx)bits/stdio_lim.h endif # inhibit-stdio_lim diff --git a/sysdeps/posix/mk-stdiolim.c b/sysdeps/posix/mk-stdiolim.c index 5df460e..a129f2b 100644 --- a/sysdeps/posix/mk-stdiolim.c +++ b/sysdeps/posix/mk-stdiolim.c @@ -16,7 +16,7 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include +#include int main() @@ -32,9 +32,9 @@ main() puts ("#endif"); /* POSIX does not require that OPEN_MAX and PATH_MAX be defined, so - will not define them if they are run-time variant (which - is the case in the Hurd). ANSI still requires that FOPEN_MAX and - FILENAME_MAX be defined, however. */ + will not define them if they are run-time + variant (which is the case in the Hurd). ANSI still requires + that FOPEN_MAX and FILENAME_MAX be defined, however. */ printf("#define FOPEN_MAX %u\n", #ifdef OPEN_MAX diff --git a/sysdeps/powerpc/__longjmp.S b/sysdeps/powerpc/__longjmp.S index 02292a0..4a22fb8 100644 --- a/sysdeps/powerpc/__longjmp.S +++ b/sysdeps/powerpc/__longjmp.S @@ -19,7 +19,7 @@ #include #define _ASM -#include +#include ENTRY (__longjmp) lwz %r1,(JB_GPR1*4)(%r3) diff --git a/sysdeps/powerpc/__math.h b/sysdeps/powerpc/__math.h deleted file mode 100644 index db9688c..0000000 --- a/sysdeps/powerpc/__math.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Inline math functions for powerpc. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef __MATH_H -#define __MATH_H - -#ifdef __GNUC__ -#ifndef __NO_MATH_INLINES - -#ifdef __cplusplus -#define __MATH_INLINE __inline -#else -#define __MATH_INLINE extern __inline -#endif - -__MATH_INLINE double __sgn1 (double __x); -__MATH_INLINE double -__sgn1 (double __x) -{ - return __x >= 0.0 ? 1.0 : -1.0; -} - -/* We'd want to use this if it was implemented in hardware, but - how can we tell? */ -#if 0 -__MATH_INLINE double sqrt (double __x); -__MATH_INLINE double -sqrt (double __x) -{ - register double __value; - __asm - ("fsqrt %0,%1" - : "=f" (__value) : "f" (__x)); - - return __value; -} -#endif - -__MATH_INLINE double fabs (double __x); -__MATH_INLINE double -fabs (double __x) -{ - register double __value; - __asm - ("fabs %0,%1" - : "=f" (__value) : "f" (__x)); - - return __value; -} - -#endif /* __NO_MATH_INLINES */ -#endif /* __GNUC__ */ - -#endif /* __MATH_H */ diff --git a/sysdeps/powerpc/bits/fenv.h b/sysdeps/powerpc/bits/fenv.h new file mode 100644 index 0000000..9158a54 --- /dev/null +++ b/sysdeps/powerpc/bits/fenv.h @@ -0,0 +1,128 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FENV_H +# error "Never use directly; include instead." +#endif + + +/* Define bits representing the exception. We use the bit positions of + the appropriate bits in the FPSCR... */ +enum + { + FE_INEXACT = 1 << 31-6, +#define FE_INEXACT FE_INEXACT + FE_DIVBYZERO = 1 << 31-5, +#define FE_DIVBYZERO FE_DIVBYZERO + FE_UNDERFLOW = 1 << 31-4, +#define FE_UNDERFLOW FE_UNDERFLOW + FE_OVERFLOW = 1 << 31-3, +#define FE_OVERFLOW FE_OVERFLOW + + /* ... except for FE_INVALID, for which we use bit 31. FE_INVALID + actually corresponds to bits 7 through 12 and 21 through 23 + in the FPSCR, but we can't use that because the current draft + says that it must be a power of 2. Instead we use bit 24 which + is the enable bit for all the FE_INVALID exceptions. */ + FE_INVALID = 1 << 31-24, +#define FE_INVALID FE_INVALID + +#ifdef __USE_GNU + /* Breakdown of the FE_INVALID bits. Setting FE_INVALID on an + input to a routine is equivalent to setting all of these bits; + FE_INVALID will be set on output from a routine iff one of + these bits is set. Note, though, that you can't disable or + enable these exceptions individually. */ + + /* Operation with SNaN. */ + FE_INVALID_SNAN = 1 << 31-7, +#define FE_INVALID_SNAN FE_INVALID_SNAN + + /* Inf - Inf */ + FE_INVALID_ISI = 1 << 31-8, +#define FE_INVALID_ISI FE_INVALID_ISI + + /* Inf / Inf */ + FE_INVALID_IDI = 1 << 31-9, +#define FE_INVALID_IDI FE_INVALID_IDI + + /* 0 / 0 */ + FE_INVALID_ZDZ = 1 << 31-10, +#define FE_INVALID_ZDZ FE_INVALID_ZDZ + + /* Inf * 0 */ + FE_INVALID_IMZ = 1 << 31-11, +#define FE_INVALID_IMZ FE_INVALID_IMZ + + /* Comparison with NaN or SNaN. */ + FE_INVALID_COMPARE = 1 << 31-12, +#define FE_INVALID_COMPARE FE_INVALID_COMPARE + + /* Invalid operation flag for software (not set by hardware). */ + FE_INVALID_SOFTWARE = 1 << 31-21, +#define FE_INVALID_SOFTWARE FE_INVALID_SOFTWARE + + /* Square root of negative number (including -Inf). */ + FE_INVALID_SQRT = 1 << 31-22, +#define FE_INVALID_SQRT FE_INVALID_SQRT + + /* Conversion-to-integer of a NaN or a number too large or too small. */ + FE_INVALID_INTEGER_CONVERSION = 1 << 31-23, +#define FE_INVALID_INTEGER_CONVERSION FE_INVALID_INTEGER_CONVERSION + +#define FE_ALL_INVALID \ + (FE_INVALID_SNAN | FE_INVALID_ISI | FE_INVALID_IDI | FE_INVALID_ZDZ \ + | FE_INVALID_IMZ | FE_INVALID_COMPARE | FE_INVALID_SOFTWARE \ + | FE_INVALID_SQRT | FE_INVALID_INTEGER_CONVERSION) +#endif + }; + +#define FE_ALL_EXCEPT \ + (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) + +/* PowerPC chips support all of the four defined rounding modes. We + use the bit pattern in the FPSCR as the values for the + appropriate macros. */ +enum + { + FE_TONEAREST = 0, +#define FE_TONEAREST FE_TONEAREST + FE_TOWARDSZERO = 1, +#define FE_TOWARDSZERO FE_TOWARDSZERO + FE_UPWARD = 2, +#define FE_UPWARD FE_UPWARD + FE_DOWNWARD = 3, +#define FE_DOWNWARD FE_DOWNWARD + }; + +/* Type representing exception flags. */ +typedef unsigned int fexcept_t; + +/* Type representing floating-point environment. We leave it as 'double' + for efficiency reasons (rather than writing it to a 32-bit integer). */ +typedef double fenv_t; + +/* If the default argument is used we use this value. */ +extern const fenv_t __fe_dfl_env; +#define FE_DFL_ENV (&__fe_dfl_env); + +#ifdef __USE_GNU +/* Floating-point environment where none of the exceptions are masked. */ +extern const fenv_t __fe_nomask_env; +# define FE_NOMASK_ENV (&__fe_nomask_env); +#endif diff --git a/sysdeps/powerpc/bits/mathdef.h b/sysdeps/powerpc/bits/mathdef.h new file mode 100644 index 0000000..c0e6caa --- /dev/null +++ b/sysdeps/powerpc/bits/mathdef.h @@ -0,0 +1,72 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _MATH_H +#error "Never use directly; include instead" +#endif + + +/* FIXME! This file describes properties of the compiler, not the machine; + it should not be part of libc! + + FIXME! This file does not deal with the -fshort-double option of + gcc! */ + +#ifdef __GNUC__ +#if __STDC__ == 1 + +/* In GNU or ANSI mode, gcc leaves `float' expressions as-is, I think. */ +typedef float float_t; /* `float' expressions are evaluated as + `float'. */ +typedef double double_t; /* `double' expressions are evaluated as + `double'. */ + +/* Signal that types stay as they were declared. */ +#define FLT_EVAL_METHOD 0 + +/* Define `INFINITY' as value of type `float_t'. */ +#define INFINITY HUGE_VALF + +#else + +/* For `gcc -traditional', `float' expressions are evaluated as `double'. */ +typedef double float_t; /* `float' expressions are evaluated as + `double'. */ +typedef double double_t; /* `double' expressions are evaluated as + `double'. */ + +/* Signal that both types are `double'. */ +#define FLT_EVAL_METHOD 1 + +/* Define `INFINITY' as value of type `float_t'. */ +#define INFINITY HUGE_VAL + +#endif +#else + +/* Wild guess at types for float_t and double_t. */ +typedef double float_t; +typedef double double_t; + +/* Strange compiler, we don't know how it works. */ +#define FLT_EVAL_METHOD -1 + +/* Define `INFINITY' as value of type `float_t'. */ +#define INFINITY HUGE_VAL + +#endif diff --git a/sysdeps/powerpc/bits/mathinline.h b/sysdeps/powerpc/bits/mathinline.h new file mode 100644 index 0000000..db9688c --- /dev/null +++ b/sysdeps/powerpc/bits/mathinline.h @@ -0,0 +1,70 @@ +/* Inline math functions for powerpc. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef __MATH_H +#define __MATH_H + +#ifdef __GNUC__ +#ifndef __NO_MATH_INLINES + +#ifdef __cplusplus +#define __MATH_INLINE __inline +#else +#define __MATH_INLINE extern __inline +#endif + +__MATH_INLINE double __sgn1 (double __x); +__MATH_INLINE double +__sgn1 (double __x) +{ + return __x >= 0.0 ? 1.0 : -1.0; +} + +/* We'd want to use this if it was implemented in hardware, but + how can we tell? */ +#if 0 +__MATH_INLINE double sqrt (double __x); +__MATH_INLINE double +sqrt (double __x) +{ + register double __value; + __asm + ("fsqrt %0,%1" + : "=f" (__value) : "f" (__x)); + + return __value; +} +#endif + +__MATH_INLINE double fabs (double __x); +__MATH_INLINE double +fabs (double __x) +{ + register double __value; + __asm + ("fabs %0,%1" + : "=f" (__value) : "f" (__x)); + + return __value; +} + +#endif /* __NO_MATH_INLINES */ +#endif /* __GNUC__ */ + +#endif /* __MATH_H */ diff --git a/sysdeps/powerpc/bits/setjmp.h b/sysdeps/powerpc/bits/setjmp.h new file mode 100644 index 0000000..a9cab03 --- /dev/null +++ b/sysdeps/powerpc/bits/setjmp.h @@ -0,0 +1,19 @@ +/* Define the machine-dependent type `jmp_buf'. PowerPC version. */ + +/* The previous bits/setjmp.h had __jmp_buf defined as a structure. + We use an array of 'long int' instead, to make writing the + assembler easier. Naturally, user code should not depend on + either representation. */ + +#if defined (__USE_MISC) || defined (_ASM) +#define JB_GPR1 0 /* also known as the stack pointer */ +#define JB_GPR2 1 +#define JB_LR 2 +#define JB_GPRS 3 /* GPRs 14 through 31 are saved, 18 in total */ +#define JB_UNUSED 21 /* it's sometimes faster to store doubles word-aligned */ +#define JB_FPRS 22 /* FPRs 14 through 31 are saved, 18*2 words total */ +#endif + +#ifndef _ASM +typedef long int __jmp_buf[58]; +#endif diff --git a/sysdeps/powerpc/dl-machine.h b/sysdeps/powerpc/dl-machine.h index 17e8d9a..6ddbea5 100644 --- a/sysdeps/powerpc/dl-machine.h +++ b/sysdeps/powerpc/dl-machine.h @@ -591,6 +591,10 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, } else if (rinfo == R_PPC_COPY) { + if (sym == NULL) + /* This can happen in trace mode when an object could not be + found. */ + return; if (sym->st_size > refsym->st_size || (_dl_verbose && sym->st_size < refsym->st_size)) { diff --git a/sysdeps/powerpc/fenvbits.h b/sysdeps/powerpc/fenvbits.h deleted file mode 100644 index 8acd0ab..0000000 --- a/sysdeps/powerpc/fenvbits.h +++ /dev/null @@ -1,130 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This file should never be included directly. */ - -#ifndef _FENVBITS_H -#define _FENVBITS_H 1 - -/* Define bits representing the exception. We use the bit positions of - the appropriate bits in the FPSCR... */ -enum - { - FE_INEXACT = 1 << 31-6, -#define FE_INEXACT FE_INEXACT - FE_DIVBYZERO = 1 << 31-5, -#define FE_DIVBYZERO FE_DIVBYZERO - FE_UNDERFLOW = 1 << 31-4, -#define FE_UNDERFLOW FE_UNDERFLOW - FE_OVERFLOW = 1 << 31-3, -#define FE_OVERFLOW FE_OVERFLOW - - /* ... except for FE_INVALID, for which we use bit 31. FE_INVALID - actually corresponds to bits 7 through 12 and 21 through 23 - in the FPSCR, but we can't use that because the current draft - says that it must be a power of 2. Instead we use bit 24 which - is the enable bit for all the FE_INVALID exceptions. */ - FE_INVALID = 1 << 31-24, -#define FE_INVALID FE_INVALID - -#ifdef __USE_GNU - /* Breakdown of the FE_INVALID bits. Setting FE_INVALID on an - input to a routine is equivalent to setting all of these bits; - FE_INVALID will be set on output from a routine iff one of - these bits is set. Note, though, that you can't disable or - enable these exceptions individually. */ - - /* Operation with SNaN. */ - FE_INVALID_SNAN = 1 << 31-7, -#define FE_INVALID_SNAN FE_INVALID_SNAN - - /* Inf - Inf */ - FE_INVALID_ISI = 1 << 31-8, -#define FE_INVALID_ISI FE_INVALID_ISI - - /* Inf / Inf */ - FE_INVALID_IDI = 1 << 31-9, -#define FE_INVALID_IDI FE_INVALID_IDI - - /* 0 / 0 */ - FE_INVALID_ZDZ = 1 << 31-10, -#define FE_INVALID_ZDZ FE_INVALID_ZDZ - - /* Inf * 0 */ - FE_INVALID_IMZ = 1 << 31-11, -#define FE_INVALID_IMZ FE_INVALID_IMZ - - /* Comparison with NaN or SNaN. */ - FE_INVALID_COMPARE = 1 << 31-12, -#define FE_INVALID_COMPARE FE_INVALID_COMPARE - - /* Invalid operation flag for software (not set by hardware). */ - FE_INVALID_SOFTWARE = 1 << 31-21, -#define FE_INVALID_SOFTWARE FE_INVALID_SOFTWARE - - /* Square root of negative number (including -Inf). */ - FE_INVALID_SQRT = 1 << 31-22, -#define FE_INVALID_SQRT FE_INVALID_SQRT - - /* Conversion-to-integer of a NaN or a number too large or too small. */ - FE_INVALID_INTEGER_CONVERSION = 1 << 31-23, -#define FE_INVALID_INTEGER_CONVERSION FE_INVALID_INTEGER_CONVERSION - -#define FE_ALL_INVALID \ - (FE_INVALID_SNAN | FE_INVALID_ISI | FE_INVALID_IDI | FE_INVALID_ZDZ \ - | FE_INVALID_IMZ | FE_INVALID_COMPARE | FE_INVALID_SOFTWARE \ - | FE_INVALID_SQRT | FE_INVALID_INTEGER_CONVERSION) -#endif - }; - -#define FE_ALL_EXCEPT \ - (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) - -/* PowerPC chips support all of the four defined rounding modes. We - use the bit pattern in the FPSCR as the values for the - appropriate macros. */ -enum - { - FE_TONEAREST = 0, -#define FE_TONEAREST FE_TONEAREST - FE_TOWARDSZERO = 1, -#define FE_TOWARDSZERO FE_TOWARDSZERO - FE_UPWARD = 2, -#define FE_UPWARD FE_UPWARD - FE_DOWNWARD = 3, -#define FE_DOWNWARD FE_DOWNWARD - }; - -/* Type representing exception flags. */ -typedef unsigned int fexcept_t; - -/* Type representing floating-point environment. We leave it as 'double' - for efficiency reasons (rather than writing it to a 32-bit integer). */ -typedef double fenv_t; - -/* If the default argument is used we use this value. */ -extern const fenv_t __fe_dfl_env; -#define FE_DFL_ENV (&__fe_dfl_env); - -#ifdef __USE_GNU -/* Floating-point environment where none of the exceptions are masked. */ -extern const fenv_t __fe_nomask_env; -# define FE_NOMASK_ENV (&__fe_nomask_env); -#endif - -#endif /* fenvbits.h */ diff --git a/sysdeps/powerpc/jmp_buf.h b/sysdeps/powerpc/jmp_buf.h deleted file mode 100644 index df832b1..0000000 --- a/sysdeps/powerpc/jmp_buf.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Define the machine-dependent type `jmp_buf'. PowerPC version. */ - -/* The previous jmp_buf.h had __jmp_buf defined as a structure. - We use an array of 'long int' instead, to make writing the - assembler easier. Naturally, user code should not depend on - either representation. */ - -#if defined (__USE_MISC) || defined (_ASM) -#define JB_GPR1 0 /* also known as the stack pointer */ -#define JB_GPR2 1 -#define JB_LR 2 -#define JB_GPRS 3 /* GPRs 14 through 31 are saved, 18 in total */ -#define JB_UNUSED 21 /* it's sometimes faster to store doubles word-aligned */ -#define JB_FPRS 22 /* FPRs 14 through 31 are saved, 18*2 words total */ -#endif - -#ifndef _ASM -typedef long int __jmp_buf[58]; -#endif diff --git a/sysdeps/powerpc/mathbits.h b/sysdeps/powerpc/mathbits.h deleted file mode 100644 index 2cecb6f..0000000 --- a/sysdeps/powerpc/mathbits.h +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _MATHBITS_H -#define _MATHBITS_H 1 - -/* FIXME! This file describes properties of the compiler, not the machine; - it should not be part of libc! - - FIXME! This file does not deal with the -fshort-double option of - gcc! */ - -#ifdef __GNUC__ -#if __STDC__ == 1 - -/* In GNU or ANSI mode, gcc leaves `float' expressions as-is, I think. */ -typedef float float_t; /* `float' expressions are evaluated as - `float'. */ -typedef double double_t; /* `double' expressions are evaluated as - `double'. */ - -/* Signal that types stay as they were declared. */ -#define FLT_EVAL_METHOD 0 - -/* Define `INFINITY' as value of type `float_t'. */ -#define INFINITY HUGE_VALF - -#else - -/* For `gcc -traditional', `float' expressions are evaluated as `double'. */ -typedef double float_t; /* `float' expressions are evaluated as - `double'. */ -typedef double double_t; /* `double' expressions are evaluated as - `double'. */ - -/* Signal that both types are `double'. */ -#define FLT_EVAL_METHOD 1 - -/* Define `INFINITY' as value of type `float_t'. */ -#define INFINITY HUGE_VAL - -#endif -#else - -/* Wild guess at types for float_t and double_t. */ -typedef double float_t; -typedef double double_t; - -/* Strange compiler, we don't know how it works. */ -#define FLT_EVAL_METHOD -1 - -/* Define `INFINITY' as value of type `float_t'. */ -#define INFINITY HUGE_VAL - -#endif - -#endif /* mathbits.h */ diff --git a/sysdeps/powerpc/setjmp.S b/sysdeps/powerpc/setjmp.S index af10581..ddfea7e 100644 --- a/sysdeps/powerpc/setjmp.S +++ b/sysdeps/powerpc/setjmp.S @@ -19,7 +19,7 @@ #include #define _ASM -#include +#include ENTRY (__sigsetjmp) stw %r1,(JB_GPR1*4)(3) diff --git a/sysdeps/sparc/__longjmp.S b/sysdeps/sparc/__longjmp.S index 5424300..36e1c17 100644 --- a/sysdeps/sparc/__longjmp.S +++ b/sysdeps/sparc/__longjmp.S @@ -1,25 +1,25 @@ -/* Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1993, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. + 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 + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #define _ASM 1 -#include +#include #define ENV(reg) [%g1 + (reg * 4)] ENTRY (__longjmp) diff --git a/sysdeps/sparc/bits/endian.h b/sysdeps/sparc/bits/endian.h new file mode 100644 index 0000000..f1a75c0 --- /dev/null +++ b/sysdeps/sparc/bits/endian.h @@ -0,0 +1,3 @@ +/* SPARC is big-endian. */ + +#define __BYTE_ORDER __BIG_ENDIAN diff --git a/sysdeps/sparc/bits/setjmp.h b/sysdeps/sparc/bits/setjmp.h new file mode 100644 index 0000000..43bae1a --- /dev/null +++ b/sysdeps/sparc/bits/setjmp.h @@ -0,0 +1,16 @@ +/* Define the machine-dependent type `jmp_buf'. SPARC version. */ + +#if defined (__USE_MISC) || defined (_ASM) +#define JB_SP 0 +#define JB_FP 1 +#define JB_PC 2 +#endif + +#ifndef _ASM +typedef int __jmp_buf[3]; +#endif + +/* Test if longjmp to JMPBUF would unwind the frame + containing a local variable at ADDRESS. */ +#define _JMPBUF_UNWINDS(jmpbuf, address) \ + ((int) (address) < (jmpbuf)[JB_SP]) diff --git a/sysdeps/sparc/bytesex.h b/sysdeps/sparc/bytesex.h deleted file mode 100644 index f1a75c0..0000000 --- a/sysdeps/sparc/bytesex.h +++ /dev/null @@ -1,3 +0,0 @@ -/* SPARC is big-endian. */ - -#define __BYTE_ORDER __BIG_ENDIAN diff --git a/sysdeps/sparc/jmp_buf.h b/sysdeps/sparc/jmp_buf.h deleted file mode 100644 index 43bae1a..0000000 --- a/sysdeps/sparc/jmp_buf.h +++ /dev/null @@ -1,16 +0,0 @@ -/* Define the machine-dependent type `jmp_buf'. SPARC version. */ - -#if defined (__USE_MISC) || defined (_ASM) -#define JB_SP 0 -#define JB_FP 1 -#define JB_PC 2 -#endif - -#ifndef _ASM -typedef int __jmp_buf[3]; -#endif - -/* Test if longjmp to JMPBUF would unwind the frame - containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address) \ - ((int) (address) < (jmpbuf)[JB_SP]) diff --git a/sysdeps/sparc/setjmp.S b/sysdeps/sparc/setjmp.S index 84c6354..b80a830 100644 --- a/sysdeps/sparc/setjmp.S +++ b/sysdeps/sparc/setjmp.S @@ -19,7 +19,7 @@ #include #define _ASM 1 -#include +#include ENTRY (__sigsetjmp) /* Save our SP and FP; in the delay slot of the jump, save our diff --git a/sysdeps/standalone/arm/bits/errno.h b/sysdeps/standalone/arm/bits/errno.h new file mode 100644 index 0000000..8090a80 --- /dev/null +++ b/sysdeps/standalone/arm/bits/errno.h @@ -0,0 +1,52 @@ +/* Copyright (C) 1991, 1994, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* This file defines the `errno' constants for standalone ARM machines. + These constants are essentially arbitrary. */ + +#if !defined(__Emath_defined) && (defined(_ERRNO_H) || defined(__need_Emath)) +#undef __need_Emath +#define __Emath_defined 1 + +#define EDOM 1 +#define ERANGE 2 +#endif + +#ifdef _ERRNO_H +#define ENOSYS 3 +#define EINVAL 4 +#define ESPIPE 5 +#define EBADF 6 +#define ENOMEM 7 +#define EACCES 8 +#define ENFILE 9 +#define EMFILE 10 +#define ENAMETOOLONG 11 /* File name too long */ +#define ELOOP 12 /* Too many symbolic links encountered */ +#define ENOMSG 13 /* No message of desired type */ +#define E2BIG 14 /* Arg list too long */ +#define EINTR 15 +#define EILSEQ 16 +#define ENOEXEC 17 +#define ENOENT 18 +#define EPROTOTYPE 19 +#define ESRCH 20 +#define EPERM 21 +#endif + +#define __set_errno(val) errno = (val) diff --git a/sysdeps/standalone/arm/errnos.h b/sysdeps/standalone/arm/errnos.h deleted file mode 100644 index 8090a80..0000000 --- a/sysdeps/standalone/arm/errnos.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (C) 1991, 1994, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This file defines the `errno' constants for standalone ARM machines. - These constants are essentially arbitrary. */ - -#if !defined(__Emath_defined) && (defined(_ERRNO_H) || defined(__need_Emath)) -#undef __need_Emath -#define __Emath_defined 1 - -#define EDOM 1 -#define ERANGE 2 -#endif - -#ifdef _ERRNO_H -#define ENOSYS 3 -#define EINVAL 4 -#define ESPIPE 5 -#define EBADF 6 -#define ENOMEM 7 -#define EACCES 8 -#define ENFILE 9 -#define EMFILE 10 -#define ENAMETOOLONG 11 /* File name too long */ -#define ELOOP 12 /* Too many symbolic links encountered */ -#define ENOMSG 13 /* No message of desired type */ -#define E2BIG 14 /* Arg list too long */ -#define EINTR 15 -#define EILSEQ 16 -#define ENOEXEC 17 -#define ENOENT 18 -#define EPROTOTYPE 19 -#define ESRCH 20 -#define EPERM 21 -#endif - -#define __set_errno(val) errno = (val) diff --git a/sysdeps/standalone/bits/stdio_lim.h b/sysdeps/standalone/bits/stdio_lim.h new file mode 100644 index 0000000..5552bc4 --- /dev/null +++ b/sysdeps/standalone/bits/stdio_lim.h @@ -0,0 +1,27 @@ +/* Copyright (C) 1994 Free Software Foundation, Inc. + Ported to standalone by Joel Sherrill jsherril@redstone-emh2.army.mil, + On-Line Applications Research Corporation. + +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 Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#define L_tmpnam 1 +#define TMPMAX 0 +#define L_ctermid 1 +#define L_cuserid 1 +#define FOPEN_MAX 16 +#define FILENAME_MAX 14 diff --git a/sysdeps/standalone/close.c b/sysdeps/standalone/close.c index 7ef1a5f..2d92937 100644 --- a/sysdeps/standalone/close.c +++ b/sysdeps/standalone/close.c @@ -22,7 +22,7 @@ Cambridge, MA 02139, USA. */ #include #include -#include +#include #include "filedesc.h" /* Close the file descriptor FD. */ diff --git a/sysdeps/standalone/filedesc.h b/sysdeps/standalone/filedesc.h index bf3b6a9..e4b8d65 100644 --- a/sysdeps/standalone/filedesc.h +++ b/sysdeps/standalone/filedesc.h @@ -27,7 +27,7 @@ Cambridge, MA 02139, USA. */ #ifndef __FILEDESC_h #define __FILEDESC_h -#include +#include #ifndef __DECLARE_FILE_DESCRIPTORS__ #define FILEDESC_EXTERN extern diff --git a/sysdeps/standalone/open.c b/sysdeps/standalone/open.c index 87097d9..b61b729 100644 --- a/sysdeps/standalone/open.c +++ b/sysdeps/standalone/open.c @@ -25,7 +25,7 @@ Cambridge, MA 02139, USA. */ #include #include -#include +#include #include #define __DECLARE_FILE_DESCRIPTORS__ diff --git a/sysdeps/standalone/stdio_lim.h b/sysdeps/standalone/stdio_lim.h deleted file mode 100644 index 5552bc4..0000000 --- a/sysdeps/standalone/stdio_lim.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (C) 1994 Free Software Foundation, Inc. - Ported to standalone by Joel Sherrill jsherril@redstone-emh2.army.mil, - On-Line Applications Research Corporation. - -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 Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#define L_tmpnam 1 -#define TMPMAX 0 -#define L_ctermid 1 -#define L_cuserid 1 -#define FOPEN_MAX 16 -#define FILENAME_MAX 14 diff --git a/sysdeps/stub/__math.h b/sysdeps/stub/__math.h deleted file mode 100644 index 8159c89..0000000 --- a/sysdeps/stub/__math.h +++ /dev/null @@ -1,6 +0,0 @@ -/* 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. */ diff --git a/sysdeps/stub/bits/dirent.h b/sysdeps/stub/bits/dirent.h new file mode 100644 index 0000000..2f7dca7 --- /dev/null +++ b/sysdeps/stub/bits/dirent.h @@ -0,0 +1,24 @@ +/* Directory entry structure `struct dirent'. Stub version. + Copyright (C) 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +struct dirent + { + char d_name[1]; /* Variable length. */ + int d_fileno; + }; diff --git a/sysdeps/stub/bits/elfclass.h b/sysdeps/stub/bits/elfclass.h new file mode 100644 index 0000000..1ad1295 --- /dev/null +++ b/sysdeps/stub/bits/elfclass.h @@ -0,0 +1,8 @@ +/* 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. */ + +#define __ELF_NATIVE_CLASS ?? + +/* This file goes in sysdeps/wordsize-?? and sysdeps/MACHINE/Implies lists + wordsize-?? for MACHINE's wordsize. */ diff --git a/sysdeps/stub/bits/endian.h b/sysdeps/stub/bits/endian.h new file mode 100644 index 0000000..597f079 --- /dev/null +++ b/sysdeps/stub/bits/endian.h @@ -0,0 +1,9 @@ +/* This file should define __BYTE_ORDER as appropriate for the machine + in question. See string/endian.h for how to define it. + + If only the stub bits/endian.h applies to a particular configuration, + bytesex.h is generated by running a program on the host machine. + So if cross-compiling to a machine with a different byte order, + the bits/endian.h file for that machine must exist. */ + +#error Machine byte order unknown. diff --git a/sysdeps/stub/bits/errno.h b/sysdeps/stub/bits/errno.h new file mode 100644 index 0000000..0a0f80a --- /dev/null +++ b/sysdeps/stub/bits/errno.h @@ -0,0 +1,40 @@ +/* Copyright (C) 1991, 1994, 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* This file defines the `errno' constants. */ + +#if !defined(__Emath_defined) && (defined(_ERRNO_H) || defined(__need_Emath)) +#undef __need_Emath +#define __Emath_defined 1 + +#define EDOM 1 +#define ERANGE 2 +#endif + +#ifdef _ERRNO_H +#define ENOSYS 3 +#define EINVAL 4 +#define ESPIPE 5 +#define EBADF 6 +#define ENOMEM 7 +#define EACCES 8 +#define ENFILE 9 +#define EMFILE 10 +#endif + +#define __set_errno(val) errno = (val) diff --git a/sysdeps/stub/bits/fcntl.h b/sysdeps/stub/bits/fcntl.h new file mode 100644 index 0000000..24a1c38 --- /dev/null +++ b/sysdeps/stub/bits/fcntl.h @@ -0,0 +1,85 @@ +/* O_*, F_*, FD_* bit values for stub configuration. + Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* These values should be changed as appropriate for your system. */ + +#ifndef _FCNTL_H +#error "Never use directly; include instead." +#endif + + +/* File access modes for `open' and `fcntl'. */ +#define O_RDONLY 0 /* Open read-only. */ +#define O_WRONLY 1 /* Open write-only. */ +#define O_RDWR 2 /* Open read/write. */ + + +/* Bits OR'd into the second argument to open. */ +#define O_CREAT 0x0200 /* Create file if it doesn't exist. */ +#define O_EXCL 0x0800 /* Fail if file already exists. */ +#define O_TRUNC 0x0400 /* Truncate file to zero length. */ +#define O_NOCTTY 0x0100 /* Don't assign a controlling terminal. */ + +/* File status flags for `open' and `fcntl'. */ +#define O_APPEND 0x0008 /* Writes append to the file. */ +#define O_NONBLOCK 0x0004 /* Non-blocking I/O. */ + +#ifdef __USE_BSD +#define O_NDELAY O_NONBLOCK +#endif + +/* Mask for file access modes. This is system-dependent in case + some system ever wants to define some other flavor of access. */ +#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) + +/* 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. */ +#ifdef __USE_BSD +#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */ +#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */ +#endif +#define F_GETLK 7 /* Get record locking info. */ +#define F_SETLK 8 /* Set record locking info. */ +#define F_SETLKW 9 /* Set record locking info, wait. */ + +/* File descriptor flags used with F_GETFD and F_SETFD. */ +#define FD_CLOEXEC 1 /* Close on exec. */ + + +#include + +/* The structure describing an advisory lock. This is the type of the third + argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + }; + +/* Values for the `l_type' field of a `struct flock'. */ +#define F_RDLCK 1 /* Read lock. */ +#define F_WRLCK 2 /* Write lock. */ +#define F_UNLCK 3 /* Remove lock. */ diff --git a/sysdeps/stub/bits/fenv.h b/sysdeps/stub/bits/fenv.h new file mode 100644 index 0000000..f45deb0 --- /dev/null +++ b/sysdeps/stub/bits/fenv.h @@ -0,0 +1,61 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FENV_H +#error "Never use directly; include instead." +#endif + + +/* Here should be the exception be defined: + FE_INVALID + FE_DIVBYZERO + FE_OVERFLOW + FE_UNDERFLOW + FE_INEXACT + We define no macro which signals no exception is supported. */ + +#define FE_ALL_EXCEPT 0 + + +/* Here should the rounding modes be defined: + FE_TONEAREST + FE_DOWNWARD + FE_UPWARD + FE_TOWARDSZERO + We define no macro which signals no rounding mode is selectable. */ + + +/* Type representing exception flags. + XXX Probably we should also include the signal handler here. */ +typedef struct + { + unsigned int flags; + } +fexcept_t; + + +/* Type representing floating-point environment. */ +typedef struct + { + fexcept_t excepts; + /* XXX I don't know what else we should save. */ + } +fenv_t; + +/* If the default argument is used we use this value. */ +#define FE_DFL_ENV ((fenv_t *) -1l) diff --git a/sysdeps/stub/bits/huge_val.h b/sysdeps/stub/bits/huge_val.h new file mode 100644 index 0000000..8f137d1 --- /dev/null +++ b/sysdeps/stub/bits/huge_val.h @@ -0,0 +1,26 @@ +/* Stub `HUGE_VAL' constant. + Used by and functions for overflow. + Copyright (C) 1992, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _MATH_H +#error "Never use directly; include instead." +#endif + + +#define HUGE_VAL 1e37 diff --git a/sysdeps/stub/bits/ioctls.h b/sysdeps/stub/bits/ioctls.h new file mode 100644 index 0000000..3b6178b --- /dev/null +++ b/sysdeps/stub/bits/ioctls.h @@ -0,0 +1 @@ +/* This space intentionally left blank. */ diff --git a/sysdeps/stub/bits/ipc.h b/sysdeps/stub/bits/ipc.h new file mode 100644 index 0000000..a5ecbd9 --- /dev/null +++ b/sysdeps/stub/bits/ipc.h @@ -0,0 +1,56 @@ +/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , August 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_IPC_BUF_H + +#define _SYS_IPC_BUF_H 1 +#include + +#include + +/* 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 */ + + +__BEGIN_DECLS + +/* Special key values. */ +#define IPC_PRIVATE ((key_t) 0) /* private key */ + + +/* Data structure used to pass permission information to IPC operations. */ +struct ipc_perm +{ + __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 */ + __mode_t mode; /* read/write permission */ +}; + +__END_DECLS + +#endif /* _SYS_IPC_BUF_H */ diff --git a/sysdeps/stub/bits/libc-lock.h b/sysdeps/stub/bits/libc-lock.h new file mode 100644 index 0000000..4261728 --- /dev/null +++ b/sysdeps/stub/bits/libc-lock.h @@ -0,0 +1,83 @@ +/* libc-internal interface for mutex locks. Stub version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _BITS_LIBC_LOCK_H +#define _BITS_LIBC_LOCK_H 1 + + +/* Define a lock variable NAME with storage class CLASS. The lock must be + initialized with __libc_lock_init before it can be used (or define it + with __libc_lock_define_initialized, below). Use `extern' for CLASS to + declare a lock defined in another module. In public structure + definitions you must use a pointer to the lock structure (i.e., NAME + begins with a `*'), because its storage size will not be known outside + of libc. */ +#define __libc_lock_define(CLASS,NAME) + +/* Define an initialized lock variable NAME with storage class CLASS. */ +#define __libc_lock_define_initialized(CLASS,NAME) + +/* Define an initialized recursive lock variable NAME with storage + class CLASS. */ +#define __libc_lock_define_initialized_recursive(CLASS,NAME) + +/* Initialize the named lock variable, leaving it in a consistent, unlocked + state. */ +#define __libc_lock_init(NAME) + +/* Same as last but this time we initialize a recursive mutex. */ +#define __libc_lock_init_recursive(NAME) + +/* Finalize the named lock variable, which must be locked. It cannot be + used again until __libc_lock_init is called again on it. This must be + called on a lock variable before the containing storage is reused. */ +#define __libc_lock_fini(NAME) + +/* Finalize recursive named lock. */ +#define __libc_lock_fini_recursive(NAME) + +/* Lock the named lock variable. */ +#define __libc_lock_lock(NAME) + +/* Lock the recursive named lock variable. */ +#define __libc_lock_lock_recursive(NAME) + +/* Try to lock the named lock variable. */ +#define __libc_lock_trylock(NAME) 0 + +/* Try to lock the recursive named lock variable. */ +#define __libc_lock_trylock_recursive(NAME) 0 + +/* Unlock the named lock variable. */ +#define __libc_lock_unlock(NAME) + +/* Unlock the recursive named lock variable. */ +#define __libc_lock_unlock_recursive(NAME) + +/* Start critical region with cleanup. */ +#define __libc_cleanup_region_start(FCT, ARG) + +/* End critical region with cleanup. */ +#define __libc_cleanup_region_end(DOIT) + + +/* We need portable names for some of the functions. */ +#define __libc_mutex_unlock + +#endif /* bits/libc-lock.h */ diff --git a/sysdeps/stub/bits/local_lim.h b/sysdeps/stub/bits/local_lim.h new file mode 100644 index 0000000..42cc7eb --- /dev/null +++ b/sysdeps/stub/bits/local_lim.h @@ -0,0 +1,3 @@ +/* This file should define the implementation-specific limits described + in posix[12]_lim.h. If there are no useful values to give a limit, + don't define it. */ diff --git a/sysdeps/stub/bits/mathinline.h b/sysdeps/stub/bits/mathinline.h new file mode 100644 index 0000000..8159c89 --- /dev/null +++ b/sysdeps/stub/bits/mathinline.h @@ -0,0 +1,6 @@ +/* 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. */ diff --git a/sysdeps/stub/bits/msq.h b/sysdeps/stub/bits/msq.h new file mode 100644 index 0000000..37daa9b --- /dev/null +++ b/sysdeps/stub/bits/msq.h @@ -0,0 +1,47 @@ +/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , August 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_MSG_H +#error "Never use directly; include instead." +#endif + + +#include +#include + +/* Define options for message queue functions. */ +#define MSG_NOERROR 010000 /* no error if message is too big */ + +__BEGIN_DECLS + +/* 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 */ + __time_t msg_stime; /* time of last msgsnd command */ + __time_t msg_rtime; /* time of last msgrcv command */ + __time_t msg_ctime; /* time of last change */ + unsigned short int msg_qnum; /* number of messages currently on queue */ + unsigned short int 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() */ +}; + +__END_DECLS diff --git a/sysdeps/stub/bits/nan.h b/sysdeps/stub/bits/nan.h new file mode 100644 index 0000000..ab38168 --- /dev/null +++ b/sysdeps/stub/bits/nan.h @@ -0,0 +1,5 @@ +#ifndef _MATH_H +#error "Never use directly; include instead." +#endif + +/* This file should define `NAN' on machines that have such things. */ diff --git a/sysdeps/stub/bits/posix_opt.h b/sysdeps/stub/bits/posix_opt.h new file mode 100644 index 0000000..54f5a79 --- /dev/null +++ b/sysdeps/stub/bits/posix_opt.h @@ -0,0 +1,2 @@ +/* This file should define the POSIX options described in , + or leave them undefined, as appropriate. */ diff --git a/sysdeps/stub/bits/sem.h b/sysdeps/stub/bits/sem.h new file mode 100644 index 0000000..1d3e41b --- /dev/null +++ b/sysdeps/stub/bits/sem.h @@ -0,0 +1,61 @@ +/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , August 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_SEM_H +#error "Never use directly; include instead." +#endif + + +#include +#include + +/* 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 */ + + +__BEGIN_DECLS + +/* Data structure describing a set of semaphores. */ +struct semid_ds +{ + struct ipc_perm sem_perm; /* operation permission struct */ + __time_t sem_otime; /* last semop() time */ + __time_t sem_ctime; /* last time changed by semctl() */ + unsigned short int sem_nsems; /* number of semaphores in set */ +}; + +/* Union used for argument 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 */ + }; + +__END_DECLS diff --git a/sysdeps/stub/bits/setjmp.h b/sysdeps/stub/bits/setjmp.h new file mode 100644 index 0000000..6620e5a --- /dev/null +++ b/sysdeps/stub/bits/setjmp.h @@ -0,0 +1,3 @@ +/* Define the machine-dependent type `jmp_buf'. Stub version. */ + +typedef int __jmp_buf[1]; diff --git a/sysdeps/stub/bits/shm.h b/sysdeps/stub/bits/shm.h new file mode 100644 index 0000000..b41d0c1 --- /dev/null +++ b/sysdeps/stub/bits/shm.h @@ -0,0 +1,53 @@ +/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , August 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_SHM_H +#error "Never use directly; include instead." +#endif + + +#include +#include + +/* 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 */ + +/* Commands for `shmctl'. */ +#define SHM_LOCK 11 /* lock segment (root only) */ +#define SHM_UNLOCK 12 /* unlock segment (root only) */ + + +__BEGIN_DECLS + +/* Data structure describing a set of semaphores. */ +struct shmid_ds +{ + struct ipc_perm sem_perm; /* operation permission struct */ + int shm_segsz; /* size of segment in bytes */ + __time_t sem_atime; /* time of last shmat() */ + __time_t sem_dtime; /* time of last shmdt() */ + __time_t sem_ctime; /* time of last change by shmctl() */ + __pid_t shm_cpid; /* pid of creator */ + __pid_t shm_lpid; /* pid of last shmop */ + unsigned short int shm_nattch; /* number of current attaches */ +}; + +__END_DECLS diff --git a/sysdeps/stub/bits/sigcontext.h b/sysdeps/stub/bits/sigcontext.h new file mode 100644 index 0000000..18d599f --- /dev/null +++ b/sysdeps/stub/bits/sigcontext.h @@ -0,0 +1,29 @@ +/* Structure describing state saved while handling a signal. Stub version. +Copyright (C) 1991, 1994 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 Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* State of this thread when the signal was taken. */ +struct sigcontext + { + int sc_onstack; + __sigset_t sc_mask; + + /* Registers and such. */ + }; + +/* Signal subcodes should be defined here. */ diff --git a/sysdeps/stub/bits/signum.h b/sysdeps/stub/bits/signum.h new file mode 100644 index 0000000..6b4693f --- /dev/null +++ b/sysdeps/stub/bits/signum.h @@ -0,0 +1,53 @@ +/* Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifdef _SIGNAL_H + +/* Fake signal functions. */ +extern void _sig_ign __P ((int sig)); +extern void _sig_dfl __P ((int sig)); + +#define SIG_ERR ((__sighandler_t) 0) /* Error return. */ +#define SIG_DFL _sig_dfl /* Default action. */ +#define SIG_IGN _sig_ign /* Ignore signal. */ + + +/* ANSI signals. */ +#define SIGABRT 1 /* Abnormal termination. */ +#define SIGFPE 2 /* Erroneous arithmetic operation. */ +#define SIGILL 3 /* Illegal instruction. */ +#define SIGINT 3 /* Interactive attention signal. */ +#define SIGSEGV 4 /* Invalid access to storage. */ +#define SIGTERM 5 /* Termination request. */ + +/* POSIX signals. */ +#define SIGHUP 6 /* Hangup. */ +#define SIGQUIT 7 /* Quit. */ +#define SIGPIPE 8 /* Broken pipe. */ +#define SIGKILL 9 /* Kill (cannot be blocked, caught, or ignored). */ +#define SIGALRM 10 /* Alarm clock. */ +#define SIGSTOP 11 /* Stop (cannot be blocked, caught, or ignored). */ +#define SIGTSTP 12 /* Keyboard stop. */ +#define SIGCONT 13 /* Continue. */ +#define SIGCHLD 14 /* Child terminated or stopped. */ +#define SIGTTIN 15 /* Background read from control terminal. */ +#define SIGTTOU 16 /* Background write to control terminal. */ + +#endif /* included. */ + +#define _NSIG 17 diff --git a/sysdeps/stub/bits/stat.h b/sysdeps/stub/bits/stat.h new file mode 100644 index 0000000..dab0cd0 --- /dev/null +++ b/sysdeps/stub/bits/stat.h @@ -0,0 +1,74 @@ +/* Copyright (C) 1992, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +/* This structure needs to be defined in accordance with the + implementation of __stat, __fstat, and __lstat. */ + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H 1 + +#include + +/* Structure describing file characteristics. */ +struct stat + { + /* These are the members that POSIX.1 requires. */ + + __mode_t st_mode; /* File mode. */ + __ino_t st_ino; /* File serial number. */ + __dev_t st_dev; /* Device containing the file. */ + __nlink_t st_nlink; /* Link count. */ + + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group. */ + __off_t st_size; /* Size of file, in bytes. */ + + __time_t st_atime; /* Time of last access. */ + __time_t st_mtime; /* Time of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + + /* This should be defined if there is a `st_blksize' member. */ +#undef _STATBUF_ST_BLKSIZE + }; + +/* Encoding of the file mode. These are the standard Unix values, + but POSIX.1 does not specify what values should be used. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFIFO 0010000 /* FIFO. */ + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + + +#endif /* bits/stat.h */ diff --git a/sysdeps/stub/bits/stdio_lim.h b/sysdeps/stub/bits/stdio_lim.h new file mode 100644 index 0000000..59b6a40 --- /dev/null +++ b/sysdeps/stub/bits/stdio_lim.h @@ -0,0 +1,4 @@ +#define L_tmpnam 1 +#define TMPMAX 0 +#define FOPEN_MAX 16 +#define FILENAME_MAX 14 diff --git a/sysdeps/stub/bits/time.h b/sysdeps/stub/bits/time.h new file mode 100644 index 0000000..e41a991 --- /dev/null +++ b/sysdeps/stub/bits/time.h @@ -0,0 +1,44 @@ +/* System-dependent timing definitions. Stub version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifdef __need_timeval +# undef __need_timeval +# ifndef _STRUCT_TIMEVAL +# define _STRUCT_TIMEVAL 1 +/* A time value that is accurate to the nearest + microsecond but also has a range of years. */ +struct timeval + { + time_t tv_sec; /* Seconds. */ + time_t tv_usec; /* Microseconds. */ + }; +# endif /* struct timeval */ +#endif /* need timeval */ + + +#ifndef _BITS_TIME_H +#define _BITS_TIME_H 1 + +#define CLOCKS_PER_SEC 60 + +#endif /* bits/time.h */ diff --git a/sysdeps/stub/bits/waitflags.h b/sysdeps/stub/bits/waitflags.h new file mode 100644 index 0000000..127eb6c --- /dev/null +++ b/sysdeps/stub/bits/waitflags.h @@ -0,0 +1,27 @@ +/* Definitions of flag bits for `waitpid' et al. + Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_WAIT_H +#error "Never use directly; include instead." +#endif + + +/* Bits in the third argument to `waitpid'. */ +#define WNOHANG 1 /* Don't block waiting. */ +#define WUNTRACED 2 /* Report status of stopped children. */ diff --git a/sysdeps/stub/bytesex.h b/sysdeps/stub/bytesex.h deleted file mode 100644 index 238a082..0000000 --- a/sysdeps/stub/bytesex.h +++ /dev/null @@ -1,9 +0,0 @@ -/* This file should define __BYTE_ORDER as appropriate for the machine - in question. See string/endian.h for how to define it. - - If only the stub bytesex.h applies to a particular configuration, - bytesex.h is generated by running a program on the host machine. - So if cross-compiling to a machine with a different byte order, - the bytesex.h file for that machine must exist. */ - -#error Machine byte order unknown. diff --git a/sysdeps/stub/direntry.h b/sysdeps/stub/direntry.h deleted file mode 100644 index 2f7dca7..0000000 --- a/sysdeps/stub/direntry.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Directory entry structure `struct dirent'. Stub version. - Copyright (C) 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -struct dirent - { - char d_name[1]; /* Variable length. */ - int d_fileno; - }; diff --git a/sysdeps/stub/elfclass.h b/sysdeps/stub/elfclass.h deleted file mode 100644 index 1ad1295..0000000 --- a/sysdeps/stub/elfclass.h +++ /dev/null @@ -1,8 +0,0 @@ -/* 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. */ - -#define __ELF_NATIVE_CLASS ?? - -/* This file goes in sysdeps/wordsize-?? and sysdeps/MACHINE/Implies lists - wordsize-?? for MACHINE's wordsize. */ diff --git a/sysdeps/stub/errnos.h b/sysdeps/stub/errnos.h deleted file mode 100644 index 0a0f80a..0000000 --- a/sysdeps/stub/errnos.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 1991, 1994, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* This file defines the `errno' constants. */ - -#if !defined(__Emath_defined) && (defined(_ERRNO_H) || defined(__need_Emath)) -#undef __need_Emath -#define __Emath_defined 1 - -#define EDOM 1 -#define ERANGE 2 -#endif - -#ifdef _ERRNO_H -#define ENOSYS 3 -#define EINVAL 4 -#define ESPIPE 5 -#define EBADF 6 -#define ENOMEM 7 -#define EACCES 8 -#define ENFILE 9 -#define EMFILE 10 -#endif - -#define __set_errno(val) errno = (val) diff --git a/sysdeps/stub/fcntlbits.h b/sysdeps/stub/fcntlbits.h deleted file mode 100644 index 48237f5..0000000 --- a/sysdeps/stub/fcntlbits.h +++ /dev/null @@ -1,88 +0,0 @@ -/* O_*, F_*, FD_* bit values for stub configuration. - Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* These values should be changed as appropriate for your system. */ - -#ifndef _FCNTLBITS_H - -#define _FCNTLBITS_H 1 - - -/* File access modes for `open' and `fcntl'. */ -#define O_RDONLY 0 /* Open read-only. */ -#define O_WRONLY 1 /* Open write-only. */ -#define O_RDWR 2 /* Open read/write. */ - - -/* Bits OR'd into the second argument to open. */ -#define O_CREAT 0x0200 /* Create file if it doesn't exist. */ -#define O_EXCL 0x0800 /* Fail if file already exists. */ -#define O_TRUNC 0x0400 /* Truncate file to zero length. */ -#define O_NOCTTY 0x0100 /* Don't assign a controlling terminal. */ - -/* File status flags for `open' and `fcntl'. */ -#define O_APPEND 0x0008 /* Writes append to the file. */ -#define O_NONBLOCK 0x0004 /* Non-blocking I/O. */ - -#ifdef __USE_BSD -#define O_NDELAY O_NONBLOCK -#endif - -/* Mask for file access modes. This is system-dependent in case - some system ever wants to define some other flavor of access. */ -#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) - -/* 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. */ -#ifdef __USE_BSD -#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */ -#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */ -#endif -#define F_GETLK 7 /* Get record locking info. */ -#define F_SETLK 8 /* Set record locking info. */ -#define F_SETLKW 9 /* Set record locking info, wait. */ - -/* File descriptor flags used with F_GETFD and F_SETFD. */ -#define FD_CLOEXEC 1 /* Close on exec. */ - - -#include - -/* The structure describing an advisory lock. This is the type of the third - argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ -struct flock - { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ - short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ - __off_t l_start; /* Offset where the lock begins. */ - __off_t l_len; /* Size of the locked area; zero means until EOF. */ - __pid_t l_pid; /* Process holding the lock. */ - }; - -/* Values for the `l_type' field of a `struct flock'. */ -#define F_RDLCK 1 /* Read lock. */ -#define F_WRLCK 2 /* Write lock. */ -#define F_UNLCK 3 /* Remove lock. */ - - -#endif /* fcntlbits.h */ diff --git a/sysdeps/stub/fenvbits.h b/sysdeps/stub/fenvbits.h deleted file mode 100644 index cb8868c..0000000 --- a/sysdeps/stub/fenvbits.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This file should never be included directly. */ - -#ifndef _FENVBITS_H -#define _FENVBITS_H 1 - -/* Here should be the exception be defined: - FE_INVALID - FE_DIVBYZERO - FE_OVERFLOW - FE_UNDERFLOW - FE_INEXACT - We define no macro which signals no exception is supported. */ - -#define FE_ALL_EXCEPT 0 - - -/* Here should the rounding modes be defined: - FE_TONEAREST - FE_DOWNWARD - FE_UPWARD - FE_TOWARDSZERO - We define no macro which signals no rounding mode is selectable. */ - - -/* Type representing exception flags. - XXX Probably we should also include the signal handler here. */ -typedef struct - { - unsigned int flags; - } -fexcept_t; - - -/* Type representing floating-point environment. */ -typedef struct - { - fexcept_t excepts; - /* XXX I don't know what else we should save. */ - } -fenv_t; - -/* If the default argument is used we use this value. */ -#define FE_DFL_ENV ((fenv_t *) -1l) - -#endif /* fenvbits.h */ diff --git a/sysdeps/stub/huge_val.h b/sysdeps/stub/huge_val.h deleted file mode 100644 index 18e96b1..0000000 --- a/sysdeps/stub/huge_val.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Stub `HUGE_VAL' constant. - Used by and functions for overflow. - Copyright (C) 1992, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _HUGE_VAL_H -#define _HUGE_VAL_H 1 - -#define HUGE_VAL 1e37 - -#endif /* huge_val.h */ diff --git a/sysdeps/stub/ioctls.h b/sysdeps/stub/ioctls.h deleted file mode 100644 index 3b6178b..0000000 --- a/sysdeps/stub/ioctls.h +++ /dev/null @@ -1 +0,0 @@ -/* This space intentionally left blank. */ diff --git a/sysdeps/stub/jmp_buf.h b/sysdeps/stub/jmp_buf.h deleted file mode 100644 index 6620e5a..0000000 --- a/sysdeps/stub/jmp_buf.h +++ /dev/null @@ -1,3 +0,0 @@ -/* Define the machine-dependent type `jmp_buf'. Stub version. */ - -typedef int __jmp_buf[1]; diff --git a/sysdeps/stub/libc-lock.h b/sysdeps/stub/libc-lock.h deleted file mode 100644 index 724b6e5..0000000 --- a/sysdeps/stub/libc-lock.h +++ /dev/null @@ -1,83 +0,0 @@ -/* libc-internal interface for mutex locks. Stub version. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _LIBC_LOCK_H -#define _LIBC_LOCK_H 1 - - -/* Define a lock variable NAME with storage class CLASS. The lock must be - initialized with __libc_lock_init before it can be used (or define it - with __libc_lock_define_initialized, below). Use `extern' for CLASS to - declare a lock defined in another module. In public structure - definitions you must use a pointer to the lock structure (i.e., NAME - begins with a `*'), because its storage size will not be known outside - of libc. */ -#define __libc_lock_define(CLASS,NAME) - -/* Define an initialized lock variable NAME with storage class CLASS. */ -#define __libc_lock_define_initialized(CLASS,NAME) - -/* Define an initialized recursive lock variable NAME with storage - class CLASS. */ -#define __libc_lock_define_initialized_recursive(CLASS,NAME) - -/* Initialize the named lock variable, leaving it in a consistent, unlocked - state. */ -#define __libc_lock_init(NAME) - -/* Same as last but this time we initialize a recursive mutex. */ -#define __libc_lock_init_recursive(NAME) - -/* Finalize the named lock variable, which must be locked. It cannot be - used again until __libc_lock_init is called again on it. This must be - called on a lock variable before the containing storage is reused. */ -#define __libc_lock_fini(NAME) - -/* Finalize recursive named lock. */ -#define __libc_lock_fini_recursive(NAME) - -/* Lock the named lock variable. */ -#define __libc_lock_lock(NAME) - -/* Lock the recursive named lock variable. */ -#define __libc_lock_lock_recursive(NAME) - -/* Try to lock the named lock variable. */ -#define __libc_lock_trylock(NAME) 0 - -/* Try to lock the recursive named lock variable. */ -#define __libc_lock_trylock_recursive(NAME) 0 - -/* Unlock the named lock variable. */ -#define __libc_lock_unlock(NAME) - -/* Unlock the recursive named lock variable. */ -#define __libc_lock_unlock_recursive(NAME) - -/* Start critical region with cleanup. */ -#define __libc_cleanup_region_start(FCT, ARG) - -/* End critical region with cleanup. */ -#define __libc_cleanup_region_end(DOIT) - - -/* We need portable names for some of the functions. */ -#define __libc_mutex_unlock - -#endif /* libc-lock.h */ diff --git a/sysdeps/stub/local_lim.h b/sysdeps/stub/local_lim.h deleted file mode 100644 index 42cc7eb..0000000 --- a/sysdeps/stub/local_lim.h +++ /dev/null @@ -1,3 +0,0 @@ -/* This file should define the implementation-specific limits described - in posix[12]_lim.h. If there are no useful values to give a limit, - don't define it. */ diff --git a/sysdeps/stub/nan.h b/sysdeps/stub/nan.h deleted file mode 100644 index 9dd5341..0000000 --- a/sysdeps/stub/nan.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _NAN_H -#define _NAN_H 1 - -/* This file should define `NAN' on machines that have such things. */ - -#endif /* nan.h */ diff --git a/sysdeps/stub/posix_opt.h b/sysdeps/stub/posix_opt.h deleted file mode 100644 index 54f5a79..0000000 --- a/sysdeps/stub/posix_opt.h +++ /dev/null @@ -1,2 +0,0 @@ -/* This file should define the POSIX options described in , - or leave them undefined, as appropriate. */ diff --git a/sysdeps/stub/sigcontext.h b/sysdeps/stub/sigcontext.h deleted file mode 100644 index 18d599f..0000000 --- a/sysdeps/stub/sigcontext.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Structure describing state saved while handling a signal. Stub version. -Copyright (C) 1991, 1994 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 Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* State of this thread when the signal was taken. */ -struct sigcontext - { - int sc_onstack; - __sigset_t sc_mask; - - /* Registers and such. */ - }; - -/* Signal subcodes should be defined here. */ diff --git a/sysdeps/stub/signum.h b/sysdeps/stub/signum.h deleted file mode 100644 index 6b4693f..0000000 --- a/sysdeps/stub/signum.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef _SIGNAL_H - -/* Fake signal functions. */ -extern void _sig_ign __P ((int sig)); -extern void _sig_dfl __P ((int sig)); - -#define SIG_ERR ((__sighandler_t) 0) /* Error return. */ -#define SIG_DFL _sig_dfl /* Default action. */ -#define SIG_IGN _sig_ign /* Ignore signal. */ - - -/* ANSI signals. */ -#define SIGABRT 1 /* Abnormal termination. */ -#define SIGFPE 2 /* Erroneous arithmetic operation. */ -#define SIGILL 3 /* Illegal instruction. */ -#define SIGINT 3 /* Interactive attention signal. */ -#define SIGSEGV 4 /* Invalid access to storage. */ -#define SIGTERM 5 /* Termination request. */ - -/* POSIX signals. */ -#define SIGHUP 6 /* Hangup. */ -#define SIGQUIT 7 /* Quit. */ -#define SIGPIPE 8 /* Broken pipe. */ -#define SIGKILL 9 /* Kill (cannot be blocked, caught, or ignored). */ -#define SIGALRM 10 /* Alarm clock. */ -#define SIGSTOP 11 /* Stop (cannot be blocked, caught, or ignored). */ -#define SIGTSTP 12 /* Keyboard stop. */ -#define SIGCONT 13 /* Continue. */ -#define SIGCHLD 14 /* Child terminated or stopped. */ -#define SIGTTIN 15 /* Background read from control terminal. */ -#define SIGTTOU 16 /* Background write to control terminal. */ - -#endif /* included. */ - -#define _NSIG 17 diff --git a/sysdeps/stub/statbuf.h b/sysdeps/stub/statbuf.h deleted file mode 100644 index ab14e23..0000000 --- a/sysdeps/stub/statbuf.h +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright (C) 1992, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This structure needs to be defined in accordance with the - implementation of __stat, __fstat, and __lstat. */ - -#ifndef _STATBUF_H - -#define _STATBUF_H 1 - -#include - -/* Structure describing file characteristics. */ -struct stat - { - /* These are the members that POSIX.1 requires. */ - - __mode_t st_mode; /* File mode. */ - __ino_t st_ino; /* File serial number. */ - __dev_t st_dev; /* Device containing the file. */ - __nlink_t st_nlink; /* Link count. */ - - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group. */ - __off_t st_size; /* Size of file, in bytes. */ - - __time_t st_atime; /* Time of last access. */ - __time_t st_mtime; /* Time of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - - /* This should be defined if there is a `st_blksize' member. */ -#undef _STATBUF_ST_BLKSIZE - }; - -/* Encoding of the file mode. These are the standard Unix values, - but POSIX.1 does not specify what values should be used. */ - -#define __S_IFMT 0170000 /* These bits determine file type. */ - -/* File types. */ -#define __S_IFDIR 0040000 /* Directory. */ -#define __S_IFCHR 0020000 /* Character device. */ -#define __S_IFBLK 0060000 /* Block device. */ -#define __S_IFREG 0100000 /* Regular file. */ -#define __S_IFIFO 0010000 /* FIFO. */ - -/* Protection bits. */ - -#define __S_ISUID 04000 /* Set user ID on execution. */ -#define __S_ISGID 02000 /* Set group ID on execution. */ -#define __S_IREAD 0400 /* Read by owner. */ -#define __S_IWRITE 0200 /* Write by owner. */ -#define __S_IEXEC 0100 /* Execute by owner. */ - - -#endif /* statbuf.h */ diff --git a/sysdeps/stub/stdio_lim.h b/sysdeps/stub/stdio_lim.h deleted file mode 100644 index 59b6a40..0000000 --- a/sysdeps/stub/stdio_lim.h +++ /dev/null @@ -1,4 +0,0 @@ -#define L_tmpnam 1 -#define TMPMAX 0 -#define FOPEN_MAX 16 -#define FILENAME_MAX 14 diff --git a/sysdeps/stub/sys/ipc_buf.h b/sysdeps/stub/sys/ipc_buf.h deleted file mode 100644 index a5ecbd9..0000000 --- a/sysdeps/stub/sys/ipc_buf.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , August 1995. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SYS_IPC_BUF_H - -#define _SYS_IPC_BUF_H 1 -#include - -#include - -/* 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 */ - - -__BEGIN_DECLS - -/* Special key values. */ -#define IPC_PRIVATE ((key_t) 0) /* private key */ - - -/* Data structure used to pass permission information to IPC operations. */ -struct ipc_perm -{ - __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 */ - __mode_t mode; /* read/write permission */ -}; - -__END_DECLS - -#endif /* _SYS_IPC_BUF_H */ diff --git a/sysdeps/stub/sys/msq_buf.h b/sysdeps/stub/sys/msq_buf.h deleted file mode 100644 index 0222a65..0000000 --- a/sysdeps/stub/sys/msq_buf.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (C) 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. -Contributed by Ulrich Drepper , August 1995. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#ifndef _SYS_MSQ_BUF_H -#define _SYS_MSQ_BUF_H - -#include -#include - -/* Define options for message queue functions. */ -#define MSG_NOERROR 010000 /* no error if message is too big */ - -__BEGIN_DECLS - -/* 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 */ - __time_t msg_stime; /* time of last msgsnd command */ - __time_t msg_rtime; /* time of last msgrcv command */ - __time_t msg_ctime; /* time of last change */ - unsigned short int msg_qnum; /* number of messages currently on queue */ - unsigned short int 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() */ -}; - -__END_DECLS - -#endif /* sys/msq_buf.h */ diff --git a/sysdeps/stub/sys/sem_buf.h b/sysdeps/stub/sys/sem_buf.h deleted file mode 100644 index 278cdeb..0000000 --- a/sysdeps/stub/sys/sem_buf.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , August 1995. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SYS_SEM_BUF_H -#define _SYS_SEM_BUF_H - -#include -#include - -/* 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 */ - - -__BEGIN_DECLS - -/* Data structure describing a set of semaphores. */ -struct semid_ds -{ - struct ipc_perm sem_perm; /* operation permission struct */ - __time_t sem_otime; /* last semop() time */ - __time_t sem_ctime; /* last time changed by semctl() */ - unsigned short int sem_nsems; /* number of semaphores in set */ -}; - -/* Union used for argument 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 */ - }; - -__END_DECLS - -#endif /* sys/sem_buf.h */ diff --git a/sysdeps/stub/sys/shm_buf.h b/sysdeps/stub/sys/shm_buf.h deleted file mode 100644 index 45147d4..0000000 --- a/sysdeps/stub/sys/shm_buf.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , August 1995. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SYS_SHM_BUF_H -#define _SYS_SHM_BUF_H - -#include -#include - -/* 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 */ - -/* Commands for `shmctl'. */ -#define SHM_LOCK 11 /* lock segment (root only) */ -#define SHM_UNLOCK 12 /* unlock segment (root only) */ - - -__BEGIN_DECLS - -/* Data structure describing a set of semaphores. */ -struct shmid_ds -{ - struct ipc_perm sem_perm; /* operation permission struct */ - int shm_segsz; /* size of segment in bytes */ - __time_t sem_atime; /* time of last shmat() */ - __time_t sem_dtime; /* time of last shmdt() */ - __time_t sem_ctime; /* time of last change by shmctl() */ - __pid_t shm_cpid; /* pid of creator */ - __pid_t shm_lpid; /* pid of last shmop */ - unsigned short int shm_nattch; /* number of current attaches */ -}; - -__END_DECLS - -#endif /* sys/shm_buf.h */ diff --git a/sysdeps/stub/timebits.h b/sysdeps/stub/timebits.h deleted file mode 100644 index 45185cc..0000000 --- a/sysdeps/stub/timebits.h +++ /dev/null @@ -1,40 +0,0 @@ -/* System-dependent timing definitions. Stub version. - Copyright (C) 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef __need_timeval -# undef __need_timeval -# ifndef _STRUCT_TIMEVAL -# define _STRUCT_TIMEVAL 1 -/* A time value that is accurate to the nearest - microsecond but also has a range of years. */ -struct timeval - { - time_t tv_sec; /* Seconds. */ - time_t tv_usec; /* Microseconds. */ - }; -# endif /* struct timeval */ -#endif /* need timeval */ - - -#ifndef _TIMEBITS_H -#define _TIMEBITS_H 1 - -#define CLOCKS_PER_SEC 60 - -#endif /* timebits.h */ diff --git a/sysdeps/stub/waitflags.h b/sysdeps/stub/waitflags.h deleted file mode 100644 index e8c9843..0000000 --- a/sysdeps/stub/waitflags.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Definitions of flag bits for `waitpid' et al. - Copyright (C) 1992, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _WAITFLAGS_H - -#define _WAITFLAGS_H 1 - -/* Bits in the third argument to `waitpid'. */ -#define WNOHANG 1 /* Don't block waiting. */ -#define WUNTRACED 2 /* Report status of stopped children. */ - -#endif /* waitflags.h */ diff --git a/sysdeps/unix/Makefile b/sysdeps/unix/Makefile index f51dc50..0e837ca 100644 --- a/sysdeps/unix/Makefile +++ b/sysdeps/unix/Makefile @@ -20,7 +20,7 @@ config-generated := $(config-generated) $(unix-generated) ifeq (,$(filter-out $(sysdep_dir)/stub/ $(common-objpfx),\ - $(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/local_lim.h)))))) + $(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/bits/local_lim.h)))))) ifneq (,$(wildcard $(sysincludedir)/sys/param.h)) mk-local_lim-CFLAGS += -DHAVE_SYS_PARAM_H @@ -32,13 +32,13 @@ ifneq (,$(wildcard $(sysincludedir)/limits.h)) mk-local_lim-CFLAGS += -DHAVE_LIMITS_H endif -$(common-objpfx)local_lim.h: $(common-objpfx)mk-local_lim +$(common-objpfx)bits/local_lim.h: $(common-objpfx)mk-local_lim $(dir $<)$(notdir $<) > $@-t mv -f $@-t $@ $(common-objpfx)mk-local_lim: $(sysdep_dir)/unix/mk-local_lim.c $(common-objdir-compile) -before-compile := $(before-compile) $(common-objpfx)local_lim.h +before-compile := $(before-compile) $(common-objpfx)bits/local_lim.h common-generated := $(common-generated) local_lim.h mk-local_lim endif @@ -51,8 +51,8 @@ before-compile := $(before-compile) $(common-objpfx)sys/param.h $(common-objpfx)sys/param.h: $(sysincludedir)/sys/param.h $(make-target-directory) - (echo '#ifndef _GNU_SYS_PARAM_H'; \ - echo '#define _GNU_SYS_PARAM_H 1'; \ + (echo '#ifndef _SYS_PARAM_H'; \ + echo '#define _SYS_PARAM_H 1'; \ echo '#include '; \ awk < $< \ '/^#define[ ]*NULL/ { print "#ifndef NULL"; \ @@ -127,13 +127,13 @@ endif # misc endif # No sysdep sys/param.h. ifeq (,$(filter-out $(sysdep_dir)/stub/ $(common-objpfx),\ - $(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/errnos.h)))))) + $(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/bits/errno.h)))))) # These need to exist before any compiling is done, # so cpp doesn't instead find the stub versions. -before-compile := $(before-compile) $(common-objpfx)errnos.h +before-compile := $(before-compile) $(common-objpfx)bits/errno.h -$(common-objpfx)errnos.h: $(common-objpfx)make-errnos +$(common-objpfx)bits/errno.h: $(common-objpfx)make-errnos $(dir $<)$(notdir $<) > $@-tmp mv $@-tmp $@ @@ -156,11 +156,11 @@ common-generated := $(common-generated) \ endif ifeq (,$(filter-out $(sysdep_dir)/stub/ $(common-objpfx),\ - $(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/ioctls.h)))))) + $(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/bits/ioctls.h)))))) -before-compile := $(before-compile) $(common-objpfx)ioctls.h +before-compile := $(before-compile) $(common-objpfx)bits/ioctls.h -$(common-objpfx)ioctls.h: $(common-objpfx)make-ioctls +$(common-objpfx)bits/ioctls.h: $(common-objpfx)make-ioctls $(dir $<)$(notdir $<) > $@-tmp mv $@-tmp $@ @@ -180,25 +180,26 @@ $(common-objpfx)make-ioctls.c: $(sysdep_dir)/unix/ioctls-tmpl.c \ mv $@T $@ -termbits.h := $(firstword $(wildcard $(+sysdep_dirs:%=%/termbits.h))) -ifeq ($(termbits.h),$(sysdep_dir)/generic/termbits.h) -termbits.h := # Ignore the generic version. +bits_termios.h := $(firstword $(wildcard $(+sysdep_dirs:%=%/bits/termios.h))) +ifeq ($(bits_termios.h),$(sysdep_dir)/generic/bits/termios.h) +bits_termios.h := # Ignore the generic version. endif -# If there is a system-specific file, we want to omit all the -# symbols it defines from ioctls. Otherwise, both ioctls.h and termbits.h -# would define them. The system-specific file presumably -# defines them with the same values as we find from the system's headers. -# We also want to omit from ioctls the symbols defined in our own +# If there is a system-specific file, we want to omit +# all the symbols it defines from ioctls. Otherwise, both +# and would define them. The +# system-specific file presumably defines them with +# the same values as we find from the system's headers. We also want +# to omit from ioctls the symbols defined in our own # , to avoid multiple definition conflicts. We use -# snarf-ioctls on these files to find what symbols we want to omit. fgrep -# -xv gives all lines which do not match in their entirety; without -x, -# CSTOP's presence elided TIOCSTOP. +# snarf-ioctls on these files to find what symbols we want to omit. +# fgrep -xv gives all lines which do not match in their entirety; +# without -x, CSTOP's presence elided TIOCSTOP. $(common-objpfx)ioctls: $(sysdep_dir)/unix/snarf-ioctls \ $(sysincludedir)/sys/ioctl.h $(ioctl-includes) $(dir $<)$(notdir $<) $(filter-out $<,$^) \ - | fgrep -xv "`($(dir $<)$(notdir $<) $(termbits.h) \ + | fgrep -xv "`($(dir $<)$(notdir $<) $(bits_termios.h) \ $(..)sysdeps/generic/sys/ttydefaults.h; \ echo NULL) \ | sort | uniq`" \ @@ -206,7 +207,7 @@ $(common-objpfx)ioctls: $(sysdep_dir)/unix/snarf-ioctls \ mv $@-tmp $@ common-generated := $(common-generated) \ - ioctls.h ioctls make-ioctls make-ioctls.c + bits/ioctls.h ioctls make-ioctls make-ioctls.c endif ifeq ($(subdir),stdio-common) diff --git a/sysdeps/unix/bsd/bits/dirent.h b/sysdeps/unix/bsd/bits/dirent.h new file mode 100644 index 0000000..2f563ec --- /dev/null +++ b/sysdeps/unix/bsd/bits/dirent.h @@ -0,0 +1,29 @@ +/* Directory entry structure `struct dirent'. 4.2BSD version. +Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +struct dirent + { + unsigned int d_fileno; /* 32 bits. */ + unsigned short int d_reclen; /* 16 bits. */ + unsigned short int d_namlen; /* 16 bits. */ + char d_name[1]; /* Variable length. */ + }; + +#define _DIRENT_HAVE_D_RECLEN 1 +#define _DIRENT_HAVE_D_NAMLEN 1 diff --git a/sysdeps/unix/bsd/bits/fcntl.h b/sysdeps/unix/bsd/bits/fcntl.h new file mode 100644 index 0000000..3d9bcb5 --- /dev/null +++ b/sysdeps/unix/bsd/bits/fcntl.h @@ -0,0 +1,114 @@ +/* O_*, F_*, FD_* bit values for 4.3 BSD. + Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FCNTL_H +#error "Never use directly; include instead." +#endif + + +/* File access modes for `open' and `fcntl'. */ +#define O_RDONLY 0 /* Open read-only. */ +#define O_WRONLY 1 /* Open write-only. */ +#define O_RDWR 2 /* Open read/write. */ + + +/* Bits OR'd into the second argument to open. */ +#define O_CREAT 0x0200 /* Create file if it doesn't exist. */ +#define O_EXCL 0x0800 /* Fail if file already exists. */ +#define O_TRUNC 0x0400 /* Truncate file to zero length. */ +/* Apparently not assigning a controlling terminal is the default + behavior in BSD, so no bit is required to request that behavior. */ +#define O_NOCTTY 0 /* Don't assign a controlling terminal. */ +#if defined (__USE_BSD) || defined (__USE_SVID) +#define O_ASYNC 0x0040 /* Send SIGIO to owner when data is ready. */ +#define O_FSYNC 0x2000 /* Synchronous writes. */ +#define O_SYNC O_FSYNC +#endif + +/* File status flags for `open' and `fcntl'. */ +#define O_APPEND 0x0008 /* Writes append to the file. */ +#define O_NONBLOCK 0x0004 /* Non-blocking I/O. */ + +#ifdef __USE_BSD +/* BSD before 4.4 doesn't support POSIX.1 O_NONBLOCK, + but O_NDELAY is close. */ +#define O_NDELAY O_NONBLOCK +#endif + +#ifdef __USE_BSD +/* Bits in the file status flags returned by F_GETFL. + These are all the O_* flags, plus FREAD and FWRITE, which are + independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was + given to `open'. */ +#define FREAD 1 +#define FWRITE 2 + +/* Traditional BSD names the O_* bits. */ +#define FASYNC O_ASYNC +#define FCREAT O_CREAT +#define FEXCL O_EXCL +#define FTRUNC O_TRUNC +#define FNOCTTY O_NOCTTY +#define FFSYNC O_FSYNC +#define FSYNC O_SYNC +#define FAPPEND O_APPEND +#define FNONBLOCK O_NONBLOCK +#define FNDELAY O_NDELAY +#endif + +/* Mask for file access modes. This is system-dependent in case + some system ever wants to define some other flavor of access. */ +#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) + +/* 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. */ +#ifdef __USE_BSD +#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */ +#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */ +#endif +#define F_GETLK 7 /* Get record locking info. */ +#define F_SETLK 8 /* Set record locking info (non-blocking). */ +#define F_SETLKW 9 /* Set record locking info (blocking). */ + +/* File descriptor flags used with F_GETFD and F_SETFD. */ +#define FD_CLOEXEC 1 /* Close on exec. */ + + +#include + +/* The structure describing an advisory lock. This is the type of the third + argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ + short int l_pid; /* Process holding the lock. */ + short int l_xxx; /* Reserved for future use. */ + }; + +/* Values for the `l_type' field of a `struct flock'. */ +#define F_RDLCK 1 /* Read lock. */ +#define F_WRLCK 2 /* Write lock. */ +#define F_UNLCK 3 /* Remove lock. */ diff --git a/sysdeps/unix/bsd/bits/posix_opt.h b/sysdeps/unix/bsd/bits/posix_opt.h new file mode 100644 index 0000000..7d5e578 --- /dev/null +++ b/sysdeps/unix/bsd/bits/posix_opt.h @@ -0,0 +1,5 @@ +#define _POSIX_JOB_CONTROL 1 +#undef _POSIX_SAVED_IDS +#define _POSIX_CHOWN_RESTRICTED 1 +#define _POSIX_NO_TRUNC -1 +#define _POSIX_VDISABLE ((unsigned char) -1) diff --git a/sysdeps/unix/bsd/bits/signum.h b/sysdeps/unix/bsd/bits/signum.h new file mode 100644 index 0000000..775240f --- /dev/null +++ b/sysdeps/unix/bsd/bits/signum.h @@ -0,0 +1,70 @@ +/* Signal number definitions. BSD version. + Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifdef _SIGNAL_H + +/* This file defines the fake signal functions and signal + number constants for 4.2 or 4.3 BSD-derived Unix system. */ + +/* Fake signal functions. */ +#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ +#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ +#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ + + +/* Signals. */ +#define SIGHUP 1 /* Hangup (POSIX). */ +#define SIGINT 2 /* Interrupt (ANSI). */ +#define SIGQUIT 3 /* Quit (POSIX). */ +#define SIGILL 4 /* Illegal instruction (ANSI). */ +#define SIGABRT SIGIOT /* Abort (ANSI). */ +#define SIGTRAP 5 /* Trace trap (POSIX). */ +#define SIGIOT 6 /* IOT trap (4.2 BSD). */ +#define SIGEMT 7 /* EMT trap (4.2 BSD). */ +#define SIGFPE 8 /* Floating-point exception (ANSI). */ +#define SIGKILL 9 /* Kill, unblockable (POSIX). */ +#define SIGBUS 10 /* Bus error (4.2 BSD). */ +#define SIGSEGV 11 /* Segmentation violation (ANSI). */ +#define SIGSYS 12 /* Bad argument to system call (4.2 BSD). */ +#define SIGPIPE 13 /* Broken pipe (POSIX). */ +#define SIGALRM 14 /* Alarm clock (POSIX). */ +#define SIGTERM 15 /* Termination (ANSI). */ +#define SIGURG 16 /* Urgent condition on socket (4.2 BSD). */ +#define SIGSTOP 17 /* Stop, unblockable (POSIX). */ +#define SIGTSTP 18 /* Keyboard stop (POSIX). */ +#define SIGCONT 19 /* Continue (POSIX). */ +#define SIGCHLD 20 /* Child status has changed (POSIX). */ +#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ +#define SIGTTIN 21 /* Background read from tty (POSIX). */ +#define SIGTTOU 22 /* Background write to tty (POSIX). */ +#define SIGIO 23 /* I/O now possible (4.2 BSD). */ +#define SIGPOLL SIGIO /* Same as SIGIO? (SVID). */ +#define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */ +#define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */ +#define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */ +#define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */ +#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ +#define SIGINFO 29 /* Information request (4.4 BSD). */ +#define SIGUSR1 30 /* User-defined signal 1 (POSIX). */ +#define SIGUSR2 31 /* User-defined signal 2 (POSIX). */ +#define SIGLOST 32 /* Resource lost (Sun); server died (GNU). */ + +#endif /* included. */ + +#define _NSIG 33 /* Biggest signal number + 1. */ diff --git a/sysdeps/unix/bsd/bits/stat.h b/sysdeps/unix/bsd/bits/stat.h new file mode 100644 index 0000000..037433f --- /dev/null +++ b/sysdeps/unix/bsd/bits/stat.h @@ -0,0 +1,87 @@ +/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _STATBUF_H +#define _STATBUF_H 1 + +#include + +/* Structure describing file characteristics. */ +struct stat + { + /* This is a short instead of dev_t for compatibility with 4.3. */ + short int st_dev; /* Device containing the file. */ + __ino_t st_ino; /* File serial number. */ + + /* This is a short instead of mode_t for compatibility with 4.3. */ + unsigned short int st_mode; /* File mode. */ + + __nlink_t st_nlink; /* Link count. */ + + /* These are shorts instead of uid_t/gid_t for compatibility with 4.3. */ + unsigned short int st_uid; /* User ID of the file's owner. */ + unsigned short int st_gid; /* Group ID of the file's group.*/ + + /* This is a short instead of dev_t for compatibility with 4.3. */ + short int st_rdev; /* Device number, if device. */ + + __off_t st_size; /* Size of file, in bytes. */ + + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atime_usec; + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtime_usec; + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctime_usec; + + unsigned long int st_blksize; /* Optimal block size for I/O. */ +#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */ + + unsigned long int st_blocks; /* Number of 512-byte blocks allocated. */ + + long int st_spare[2]; + }; + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ +#define __S_IFIFO 0010000 /* FIFO. */ + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + + +#endif /* bits/stat.h */ diff --git a/sysdeps/unix/bsd/bits/waitflags.h b/sysdeps/unix/bsd/bits/waitflags.h new file mode 100644 index 0000000..ca952f9 --- /dev/null +++ b/sysdeps/unix/bsd/bits/waitflags.h @@ -0,0 +1,30 @@ +/* Definitions of flag bits for `waitpid' et al. Hurd version. + Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_WAIT_H +#error "Never use directly; include instead." +#endif + + +/* Bits in the third argument to `waitpid'. */ +#define WNOHANG 1 /* Don't block waiting. */ +#define WUNTRACED 2 /* Report status of stopped children. */ +#ifdef __USE_GNU +#define WNOREAP 4 /* Don't remove record of child reported. */ +#endif diff --git a/sysdeps/unix/bsd/bsd4.4/bits/dirent.h b/sysdeps/unix/bsd/bsd4.4/bits/dirent.h new file mode 100644 index 0000000..b9e0d72 --- /dev/null +++ b/sysdeps/unix/bsd/bsd4.4/bits/dirent.h @@ -0,0 +1,33 @@ +/* Directory entry structure `struct dirent'. 4.4BSD version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +struct dirent + { + __ino_t d_fileno; /* File serial number. */ + unsigned short int d_reclen; /* Length of the whole `struct dirent'. */ + unsigned char d_type; /* File type, possibly unknown. */ + unsigned char d_namlen; /* Length of the file name. */ + + /* Only this member is in the POSIX standard. */ + char d_name[1]; /* File name (actually longer). */ + }; + +#define _DIRENT_HAVE_D_RECLEN 1 +#define _DIRENT_HAVE_D_NAMLEN 1 +#define _DIRENT_HAVE_D_TYPE 1 diff --git a/sysdeps/unix/bsd/bsd4.4/bits/errno.h b/sysdeps/unix/bsd/bsd4.4/bits/errno.h new file mode 100644 index 0000000..c2a9c08 --- /dev/null +++ b/sysdeps/unix/bsd/bsd4.4/bits/errno.h @@ -0,0 +1,170 @@ +/* + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 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. + * + * @(#)errno.h 8.5 (Berkeley) 1/21/94 + */ + +#ifdef _ERRNO_H + +#define EPERM 1 /* Operation not permitted */ +#define ENOENT 2 /* No such file or directory */ +#define ESRCH 3 /* No such process */ +#define EINTR 4 /* Interrupted system call */ +#define EIO 5 /* Input/output error */ +#define ENXIO 6 /* Device not configured */ +#define E2BIG 7 /* Argument list too long */ +#define ENOEXEC 8 /* Exec format error */ +#define EBADF 9 /* Bad file descriptor */ +#define ECHILD 10 /* No child processes */ +#define EDEADLK 11 /* Resource deadlock avoided */ + /* 11 was EAGAIN */ +#define ENOMEM 12 /* Cannot allocate memory */ +#define EACCES 13 /* Permission denied */ +#define EFAULT 14 /* Bad address */ +#ifdef __USE_BSD +#define ENOTBLK 15 /* Block device required */ +#endif +#define EBUSY 16 /* Device busy */ +#define EEXIST 17 /* File exists */ +#define EXDEV 18 /* Cross-device link */ +#define ENODEV 19 /* Operation not supported by device */ +#define ENOTDIR 20 /* Not a directory */ +#define EISDIR 21 /* Is a directory */ +#define EINVAL 22 /* Invalid argument */ +#define ENFILE 23 /* Too many open files in system */ +#define EMFILE 24 /* Too many open files */ +#define ENOTTY 25 /* Inappropriate ioctl for device */ +#ifdef __USE_BSD +#define ETXTBSY 26 /* Text file busy */ +#endif +#define EFBIG 27 /* File too large */ +#define ENOSPC 28 /* No space left on device */ +#define ESPIPE 29 /* Illegal seek */ +#define EROFS 30 /* Read-only file system */ +#define EMLINK 31 /* Too many links */ +#define EPIPE 32 /* Broken pipe */ + +#endif /* included. */ + +/* math software */ + +#if !defined(__Emath_defined) && (defined(_ERRNO_H) || defined(__need_Emath)) +#define EDOM 33 /* Numerical argument out of domain */ +#endif /* Emath not defined and included or need Emath. */ +#if !defined(__Emath_defined) && (defined(_ERRNO_H) || defined(__need_Emath)) +#define ERANGE 34 /* Result too large */ +#endif /* Emath not defined and included or need Emath. */ + +#ifdef _ERRNO_H + +/* non-blocking and interrupt i/o */ +#define EAGAIN 35 /* Resource temporarily unavailable */ +#ifdef __USE_BSD +#define EWOULDBLOCK EAGAIN /* Operation would block */ +#define EINPROGRESS 36 /* Operation now in progress */ +#define EALREADY 37 /* Operation already in progress */ + +/* ipc/network software -- argument errors */ +#define ENOTSOCK 38 /* Socket operation on non-socket */ +#define EDESTADDRREQ 39 /* Destination address required */ +#define EMSGSIZE 40 /* Message too long */ +#define EPROTOTYPE 41 /* Protocol wrong type for socket */ +#define ENOPROTOOPT 42 /* Protocol not available */ +#define EPROTONOSUPPORT 43 /* Protocol not supported */ +#define ESOCKTNOSUPPORT 44 /* Socket type not supported */ +#define EOPNOTSUPP 45 /* Operation not supported */ +#define EPFNOSUPPORT 46 /* Protocol family not supported */ +#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */ +#define EADDRINUSE 48 /* Address already in use */ +#define EADDRNOTAVAIL 49 /* Can't assign requested address */ + +/* ipc/network software -- operational errors */ +#define ENETDOWN 50 /* Network is down */ +#define ENETUNREACH 51 /* Network is unreachable */ +#define ENETRESET 52 /* Network dropped connection on reset */ +#define ECONNABORTED 53 /* Software caused connection abort */ +#define ECONNRESET 54 /* Connection reset by peer */ +#define ENOBUFS 55 /* No buffer space available */ +#define EISCONN 56 /* Socket is already connected */ +#define ENOTCONN 57 /* Socket is not connected */ +#define ESHUTDOWN 58 /* Can't send after socket shutdown */ +#define ETOOMANYREFS 59 /* Too many references: can't splice */ +#define ETIMEDOUT 60 /* Operation timed out */ +#define ECONNREFUSED 61 /* Connection refused */ + +#define ELOOP 62 /* Too many levels of symbolic links */ +#endif /* __USE_BSD */ +#define ENAMETOOLONG 63 /* File name too long */ + +/* should be rearranged */ +#ifdef __USE_BSD +#define EHOSTDOWN 64 /* Host is down */ +#define EHOSTUNREACH 65 /* No route to host */ +#endif /* __USE_BSD */ +#define ENOTEMPTY 66 /* Directory not empty */ + +/* quotas & mush */ +#ifdef __USE_BSD +#define EPROCLIM 67 /* Too many processes */ +#define EUSERS 68 /* Too many users */ +#define EDQUOT 69 /* Disc quota exceeded */ + +/* Network File System */ +#define ESTALE 70 /* Stale NFS file handle */ +#define EREMOTE 71 /* Too many levels of remote in path */ +#define EBADRPC 72 /* RPC struct is bad */ +#define ERPCMISMATCH 73 /* RPC version wrong */ +#define EPROGUNAVAIL 74 /* RPC prog. not avail */ +#define EPROGMISMATCH 75 /* Program version wrong */ +#define EPROCUNAVAIL 76 /* Bad procedure for program */ +#endif /* __USE_BSD */ + +#define ENOLCK 77 /* No locks available */ +#define ENOSYS 78 /* Function not implemented */ + +#define EFTYPE 79 /* Inappropriate file type or format */ + +#ifdef __USE_BSD +#define EAUTH 80 /* Authentication error */ +#define ENEEDAUTH 81 /* Need authenticator */ +#define ELAST 81 /* Must be equal largest errno */ +#endif /* __USE_BSD */ + + +#define __set_errno(val) errno = (val) + +#endif /* included. */ diff --git a/sysdeps/unix/bsd/bsd4.4/bits/fcntl.h b/sysdeps/unix/bsd/bsd4.4/bits/fcntl.h new file mode 100644 index 0000000..c00a0e8 --- /dev/null +++ b/sysdeps/unix/bsd/bsd4.4/bits/fcntl.h @@ -0,0 +1,113 @@ +/* O_*, F_*, FD_* bit values for 4.4 BSD. + Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FCNTL_H +#error "Never use directly; include instead." +#endif + + +/* File access modes for `open' and `fcntl'. */ +#define O_RDONLY 0 /* Open read-only. */ +#define O_WRONLY 1 /* Open write-only. */ +#define O_RDWR 2 /* Open read/write. */ + + +/* Bits OR'd into the second argument to open. */ +#define O_CREAT 0x0200 /* Create file if it doesn't exist. */ +#define O_EXCL 0x0800 /* Fail if file already exists. */ +#define O_TRUNC 0x0400 /* Truncate file to zero length. */ +/* Apparently not assigning a controlling terminal is the default + behavior in BSD, so no bit is required to request that behavior. */ +#define O_NOCTTY 0 /* Don't assign a controlling terminal. */ +#ifdef __USE_MISC +#define O_ASYNC 0x0040 /* Send SIGIO to owner when data is ready. */ +#define O_FSYNC 0x0080 /* Synchronous writes. */ +#define O_SYNC O_FSYNC +#define O_SHLOCK 0x0010 /* Open with shared file lock. */ +#define O_EXLOCK 0x0020 /* Open with shared exclusive lock. */ +#endif + +/* File status flags for `open' and `fcntl'. */ +#define O_APPEND 0x0008 /* Writes append to the file. */ +#define O_NONBLOCK 0x0004 /* Non-blocking I/O. */ + +#ifdef __USE_BSD +#define O_NDELAY O_NONBLOCK +#endif + +#ifdef __USE_BSD +/* Bits in the file status flags returned by F_GETFL. + These are all the O_* flags, plus FREAD and FWRITE, which are + independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was + given to `open'. */ +#define FREAD 1 +#define FWRITE 2 + +/* Traditional BSD names the O_* bits. */ +#define FASYNC O_ASYNC +#define FCREAT O_CREAT +#define FEXCL O_EXCL +#define FTRUNC O_TRUNC +#define FNOCTTY O_NOCTTY +#define FFSYNC O_FSYNC +#define FSYNC O_SYNC +#define FAPPEND O_APPEND +#define FNONBLOCK O_NONBLOCK +#define FNDELAY O_NDELAY +#endif + +/* Mask for file access modes. This is system-dependent in case + some system ever wants to define some other flavor of access. */ +#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) + +/* 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. */ +#ifdef __USE_BSD +#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */ +#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */ +#endif +#define F_GETLK 7 /* Get record locking info. */ +#define F_SETLK 8 /* Set record locking info (non-blocking). */ +#define F_SETLKW 9 /* Set record locking info (blocking). */ + +/* File descriptor flags used with F_GETFD and F_SETFD. */ +#define FD_CLOEXEC 1 /* Close on exec. */ + + +#include + +/* The structure describing an advisory lock. This is the type of the third + argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ + short int l_pid; /* Process holding the lock. */ + }; + +/* Values for the `l_type' field of a `struct flock'. */ +#define F_RDLCK 1 /* Read lock. */ +#define F_WRLCK 2 /* Write lock. */ +#define F_UNLCK 3 /* Remove lock. */ diff --git a/sysdeps/unix/bsd/bsd4.4/bits/ioctls.h b/sysdeps/unix/bsd/bsd4.4/bits/ioctls.h new file mode 100644 index 0000000..6c351f4 --- /dev/null +++ b/sysdeps/unix/bsd/bsd4.4/bits/ioctls.h @@ -0,0 +1,292 @@ +/*- + * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 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. + * + * @(#)ioctl.h 7.19 (Berkeley) 6/26/91 + */ + +#ifndef _IOCTLS_H_ +#define _IOCTLS_H_ + +#define TIOCGSIZE TIOCGWINSZ +#define TIOCSSIZE TIOCSWINSZ + +/* + * Ioctl's have the command encoded in the lower word, and the size of + * any in or out parameters in the upper word. The high 3 bits of the + * upper word are used to encode the in/out status of the parameter. + */ +#define IOCPARM_MASK 0x1fff /* parameter length, at most 13 bits */ +#define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK) +#define IOCBASECMD(x) ((x) & ~IOCPARM_MASK) +#define IOCGROUP(x) (((x) >> 8) & 0xff) + +#define IOCPARM_MAX NBPG /* max size of ioctl, mult. of NBPG */ +#define IOC_VOID 0x20000000 /* no parameters */ +#define IOC_OUT 0x40000000 /* copy out parameters */ +#define IOC_IN 0x80000000 /* copy in parameters */ +#define IOC_INOUT (IOC_IN|IOC_OUT) +#define IOC_DIRMASK 0xe0000000 /* mask for IN/OUT/VOID */ + +#define _IOC(inout,group,num,len) \ + (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num)) +#define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0) +#define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t)) +#define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t)) +/* this should be _IORW, but stdio got there first */ +#define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t)) + +#define TIOCMODG _IOR('t', 3, int) /* get modem control state */ +#define TIOCMODS _IOW('t', 4, int) /* set modem control state */ +#define TIOCM_LE 0001 /* line enable */ +#define TIOCM_DTR 0002 /* data terminal ready */ +#define TIOCM_RTS 0004 /* request to send */ +#define TIOCM_ST 0010 /* secondary transmit */ +#define TIOCM_SR 0020 /* secondary receive */ +#define TIOCM_CTS 0040 /* clear to send */ +#define TIOCM_CAR 0100 /* carrier detect */ +#define TIOCM_CD TIOCM_CAR +#define TIOCM_RNG 0200 /* ring */ +#define TIOCM_RI TIOCM_RNG +#define TIOCM_DSR 0400 /* data set ready */ + /* 8-10 compat */ +#define TIOCEXCL _IO('t', 13) /* set exclusive use of tty */ +#define TIOCNXCL _IO('t', 14) /* reset exclusive use of tty */ + /* 15 unused */ +#define TIOCFLUSH _IOW('t', 16, int) /* flush buffers */ + /* 17-18 compat */ +#define TIOCGETA _IOR('t', 19, struct termios) /* get termios struct */ +#define TIOCSETA _IOW('t', 20, struct termios) /* set termios struct */ +#define TIOCSETAW _IOW('t', 21, struct termios) /* drain output, set */ +#define TIOCSETAF _IOW('t', 22, struct termios) /* drn out, fls in, set */ +#define TIOCGETD _IOR('t', 26, int) /* get line discipline */ +#define TIOCSETD _IOW('t', 27, int) /* set line discipline */ + /* 127-124 compat */ +#define TIOCSBRK _IO('t', 123) /* set break bit */ +#define TIOCCBRK _IO('t', 122) /* clear break bit */ +#define TIOCSDTR _IO('t', 121) /* set data terminal ready */ +#define TIOCCDTR _IO('t', 120) /* clear data terminal ready */ +#define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */ +#define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */ + /* 117-116 compat */ +#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ +#define TIOCSTI _IOW('t', 114, char) /* simulate terminal input */ +#define TIOCNOTTY _IO('t', 113) /* void tty association */ +#define TIOCPKT _IOW('t', 112, int) /* pty: set/clear packet mode */ +#define TIOCPKT_DATA 0x00 /* data packet */ +#define TIOCPKT_FLUSHREAD 0x01 /* flush packet */ +#define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */ +#define TIOCPKT_STOP 0x04 /* stop output */ +#define TIOCPKT_START 0x08 /* start output */ +#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */ +#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */ +#define TIOCPKT_IOCTL 0x40 /* state change of pty driver */ +#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ +#define TIOCSTART _IO('t', 110) /* start output, like ^Q */ +#define TIOCMSET _IOW('t', 109, int) /* set all modem bits */ +#define TIOCMBIS _IOW('t', 108, int) /* bis modem bits */ +#define TIOCMBIC _IOW('t', 107, int) /* bic modem bits */ +#define TIOCMGET _IOR('t', 106, int) /* get all modem bits */ +#define TIOCREMOTE _IOW('t', 105, int) /* remote input editing */ +#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */ +#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */ +#define TIOCUCNTL _IOW('t', 102, int) /* pty: set/clr usr cntl mode */ +#define UIOCCMD(n) _IO('u', n) /* usr cntl op "n" */ +#define TIOCCONS _IOW('t', 98, int) /* become virtual console */ +#define TIOCSCTTY _IO('t', 97) /* become controlling tty */ +#define TIOCEXT _IOW('t', 96, int) /* pty: external processing */ +#define TIOCSIG _IO('t', 95) /* pty: generate signal */ +#define TIOCDRAIN _IO('t', 94) /* wait till output drained */ + +#define TTYDISC 0 /* termios tty line discipline */ +#define TABLDISC 3 /* tablet discipline */ +#define SLIPDISC 4 /* serial IP discipline */ + + +#define FIOCLEX _IO('f', 1) /* set close on exec on fd */ +#define FIONCLEX _IO('f', 2) /* remove close on exec */ +#define FIONREAD _IOR('f', 127, int) /* get # bytes to read */ +#define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */ +#define FIOASYNC _IOW('f', 125, int) /* set/clear async i/o */ +#define FIOSETOWN _IOW('f', 124, int) /* set owner */ +#define FIOGETOWN _IOR('f', 123, int) /* get owner */ + +/* socket i/o controls */ +#define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */ +#define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */ +#define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */ +#define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */ +#define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */ +#define SIOCSPGRP _IOW('s', 8, int) /* set process group */ +#define SIOCGPGRP _IOR('s', 9, int) /* get process group */ + +#define SIOCADDRT _IOW('r', 10, struct ortentry) /* add route */ +#define SIOCDELRT _IOW('r', 11, struct ortentry) /* delete route */ + +#define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */ +#define OSIOCGIFADDR _IOWR('i',13, struct ifreq) /* get ifnet address */ +#define SIOCGIFADDR _IOWR('i',33, struct ifreq) /* get ifnet address */ +#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */ +#define OSIOCGIFDSTADDR _IOWR('i',15, struct ifreq) /* get p-p address */ +#define SIOCGIFDSTADDR _IOWR('i',34, struct ifreq) /* get p-p address */ +#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */ +#define SIOCGIFFLAGS _IOWR('i',17, struct ifreq) /* get ifnet flags */ +#define OSIOCGIFBRDADDR _IOWR('i',18, struct ifreq) /* get broadcast addr */ +#define SIOCGIFBRDADDR _IOWR('i',35, struct ifreq) /* get broadcast addr */ +#define SIOCSIFBRDADDR _IOW('i',19, struct ifreq) /* set broadcast addr */ +#define OSIOCGIFCONF _IOWR('i',20, struct ifconf) /* get ifnet list */ +#define SIOCGIFCONF _IOWR('i',36, struct ifconf) /* get ifnet list */ +#define OSIOCGIFNETMASK _IOWR('i',21, struct ifreq) /* get net addr mask */ +#define SIOCGIFNETMASK _IOWR('i',37, struct ifreq) /* get net addr mask */ +#define SIOCSIFNETMASK _IOW('i',22, struct ifreq) /* set net addr mask */ +#define SIOCGIFMETRIC _IOWR('i',23, struct ifreq) /* get IF metric */ +#define SIOCSIFMETRIC _IOW('i',24, struct ifreq) /* set IF metric */ +#define SIOCDIFADDR _IOW('i',25, struct ifreq) /* delete IF addr */ +#define SIOCAIFADDR _IOW('i',26, struct ifaliasreq) /* add/chg IF alias */ + +#define SIOCSARP _IOW('i', 30, struct arpreq) /* set arp entry */ +#define OSIOCGARP _IOWR('i',31, struct arpreq) /* get arp entry */ +#define SIOCGARP _IOWR('i',38, struct arpreq) /* get arp entry */ +#define SIOCDARP _IOW('i', 32, struct arpreq) /* delete arp entry */ + + +/* Compatibility with 4.3 BSD terminal driver. + From 4.4 . */ + +#ifdef USE_OLD_TTY +# undef TIOCGETD +# define TIOCGETD _IOR('t', 0, int) /* get line discipline */ +# undef TIOCSETD +# define TIOCSETD _IOW('t', 1, int) /* set line discipline */ +#else +# define OTIOCGETD _IOR('t', 0, int) /* get line discipline */ +# define OTIOCSETD _IOW('t', 1, int) /* set line discipline */ +#endif +#define TIOCHPCL _IO('t', 2) /* hang up on last close */ +#define TIOCGETP _IOR('t', 8,struct sgttyb)/* get parameters -- gtty */ +#define TIOCSETP _IOW('t', 9,struct sgttyb)/* set parameters -- stty */ +#define TIOCSETN _IOW('t',10,struct sgttyb)/* as above, but no flushtty*/ +#define TIOCSETC _IOW('t',17,struct tchars)/* set special characters */ +#define TIOCGETC _IOR('t',18,struct tchars)/* get special characters */ +#define TANDEM 0x00000001 /* send stopc on out q full */ +#define CBREAK 0x00000002 /* half-cooked mode */ +#define LCASE 0x00000004 /* simulate lower case */ +#define ECHO 0x00000008 /* echo input */ +#define CRMOD 0x00000010 /* map \r to \r\n on output */ +#define RAW 0x00000020 /* no i/o processing */ +#define ODDP 0x00000040 /* get/send odd parity */ +#define EVENP 0x00000080 /* get/send even parity */ +#define ANYP 0x000000c0 /* get any parity/send none */ +#define NLDELAY 0x00000300 /* \n delay */ +#define NL0 0x00000000 +#define NL1 0x00000100 /* tty 37 */ +#define NL2 0x00000200 /* vt05 */ +#define NL3 0x00000300 +#define TBDELAY 0x00000c00 /* horizontal tab delay */ +#define TAB0 0x00000000 +#define TAB1 0x00000400 /* tty 37 */ +#define TAB2 0x00000800 +#define XTABS 0x00000c00 /* expand tabs on output */ +#define CRDELAY 0x00003000 /* \r delay */ +#define CR0 0x00000000 +#define CR1 0x00001000 /* tn 300 */ +#define CR2 0x00002000 /* tty 37 */ +#define CR3 0x00003000 /* concept 100 */ +#define VTDELAY 0x00004000 /* vertical tab delay */ +#define FF0 0x00000000 +#define FF1 0x00004000 /* tty 37 */ +#define BSDELAY 0x00008000 /* \b delay */ +#define BS0 0x00000000 +#define BS1 0x00008000 +#define ALLDELAY (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY) +#define CRTBS 0x00010000 /* do backspacing for crt */ +#define PRTERA 0x00020000 /* \ ... / erase */ +#define CRTERA 0x00040000 /* " \b " to wipe out char */ +#define TILDE 0x00080000 /* hazeltine tilde kludge */ +#define MDMBUF 0x00100000 /*start/stop output on carrier*/ +#define LITOUT 0x00200000 /* literal output */ +#define TOSTOP 0x00400000 /*SIGSTOP on background output*/ +#define FLUSHO 0x00800000 /* flush output to terminal */ +#define NOHANG 0x01000000 /* (no-op) was no SIGHUP on carrier drop */ +#define L001000 0x02000000 +#define CRTKIL 0x04000000 /* kill line with " \b " */ +#define PASS8 0x08000000 +#define CTLECH 0x10000000 /* echo control chars as ^X */ +#define PENDIN 0x20000000 /* tp->t_rawq needs reread */ +#define DECCTQ 0x40000000 /* only ^Q starts after ^S */ +#define NOFLSH 0x80000000 /* no output flush on signal */ +#define TIOCLBIS _IOW('t', 127, int) /* bis local mode bits */ +#define TIOCLBIC _IOW('t', 126, int) /* bic local mode bits */ +#define TIOCLSET _IOW('t', 125, int) /* set entire local mode word */ +#define TIOCLGET _IOR('t', 124, int) /* get local modes */ +#define LCRTBS (CRTBS>>16) +#define LPRTERA (PRTERA>>16) +#define LCRTERA (CRTERA>>16) +#define LTILDE (TILDE>>16) +#define LMDMBUF (MDMBUF>>16) +#define LLITOUT (LITOUT>>16) +#define LTOSTOP (TOSTOP>>16) +#define LFLUSHO (FLUSHO>>16) +#define LNOHANG (NOHANG>>16) +#define LCRTKIL (CRTKIL>>16) +#define LPASS8 (PASS8>>16) +#define LCTLECH (CTLECH>>16) +#define LPENDIN (PENDIN>>16) +#define LDECCTQ (DECCTQ>>16) +#define LNOFLSH (NOFLSH>>16) +#define TIOCSLTC _IOW('t',117,struct ltchars)/* set local special chars*/ +#define TIOCGLTC _IOR('t',116,struct ltchars)/* get local special chars*/ +#define OTIOCCONS _IO('t', 98) /* for hp300 -- sans int arg */ +#define OTTYDISC 0 +#define NETLDISC 1 +#define NTTYDISC 2 + +/* From 4.4 . */ +#ifdef USE_OLD_TTY +#define B0 0 +#define B50 1 +#define B75 2 +#define B110 3 +#define B134 4 +#define B150 5 +#define B200 6 +#define B300 7 +#define B600 8 +#define B1200 9 +#define B1800 10 +#define B2400 11 +#define B4800 12 +#define B9600 13 +#define EXTA 14 +#define EXTB 15 +#endif /* USE_OLD_TTY */ + +#endif /* !_IOCTLS_H_ */ diff --git a/sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h b/sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h new file mode 100644 index 0000000..d70dfe4 --- /dev/null +++ b/sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h @@ -0,0 +1,42 @@ +/* Definition of `struct sockaddr_*' common members. 4.4 BSD version. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_SOCKADDR_H +#define _BITS_SOCKADDR_H 1 + + +/* POSIX.1g specifies this type name for the `sa_family' member. */ +typedef unsigned char sa_family_t; + +/* This macro is used to declare the initial common members + of the data types used for socket addresses, `struct sockaddr', + `struct sockaddr_in', `struct sockaddr_un', etc. */ + +#define __SOCKADDR_COMMON(sa_prefix) \ + unsigned char sa_prefix##len; \ + sa_family_t sa_prefix##family + +#define __SOCKADDR_COMMON_SIZE (2 * sizeof (unsigned char)) + + +#endif /* bits/sockaddr.h */ diff --git a/sysdeps/unix/bsd/bsd4.4/direntry.h b/sysdeps/unix/bsd/bsd4.4/direntry.h deleted file mode 100644 index b9e0d72..0000000 --- a/sysdeps/unix/bsd/bsd4.4/direntry.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Directory entry structure `struct dirent'. 4.4BSD version. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -struct dirent - { - __ino_t d_fileno; /* File serial number. */ - unsigned short int d_reclen; /* Length of the whole `struct dirent'. */ - unsigned char d_type; /* File type, possibly unknown. */ - unsigned char d_namlen; /* Length of the file name. */ - - /* Only this member is in the POSIX standard. */ - char d_name[1]; /* File name (actually longer). */ - }; - -#define _DIRENT_HAVE_D_RECLEN 1 -#define _DIRENT_HAVE_D_NAMLEN 1 -#define _DIRENT_HAVE_D_TYPE 1 diff --git a/sysdeps/unix/bsd/bsd4.4/errnos.h b/sysdeps/unix/bsd/bsd4.4/errnos.h deleted file mode 100644 index c2a9c08..0000000 --- a/sysdeps/unix/bsd/bsd4.4/errnos.h +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) 1982, 1986, 1989, 1993 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 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. - * - * @(#)errno.h 8.5 (Berkeley) 1/21/94 - */ - -#ifdef _ERRNO_H - -#define EPERM 1 /* Operation not permitted */ -#define ENOENT 2 /* No such file or directory */ -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted system call */ -#define EIO 5 /* Input/output error */ -#define ENXIO 6 /* Device not configured */ -#define E2BIG 7 /* Argument list too long */ -#define ENOEXEC 8 /* Exec format error */ -#define EBADF 9 /* Bad file descriptor */ -#define ECHILD 10 /* No child processes */ -#define EDEADLK 11 /* Resource deadlock avoided */ - /* 11 was EAGAIN */ -#define ENOMEM 12 /* Cannot allocate memory */ -#define EACCES 13 /* Permission denied */ -#define EFAULT 14 /* Bad address */ -#ifdef __USE_BSD -#define ENOTBLK 15 /* Block device required */ -#endif -#define EBUSY 16 /* Device busy */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Cross-device link */ -#define ENODEV 19 /* Operation not supported by device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENFILE 23 /* Too many open files in system */ -#define EMFILE 24 /* Too many open files */ -#define ENOTTY 25 /* Inappropriate ioctl for device */ -#ifdef __USE_BSD -#define ETXTBSY 26 /* Text file busy */ -#endif -#define EFBIG 27 /* File too large */ -#define ENOSPC 28 /* No space left on device */ -#define ESPIPE 29 /* Illegal seek */ -#define EROFS 30 /* Read-only file system */ -#define EMLINK 31 /* Too many links */ -#define EPIPE 32 /* Broken pipe */ - -#endif /* included. */ - -/* math software */ - -#if !defined(__Emath_defined) && (defined(_ERRNO_H) || defined(__need_Emath)) -#define EDOM 33 /* Numerical argument out of domain */ -#endif /* Emath not defined and included or need Emath. */ -#if !defined(__Emath_defined) && (defined(_ERRNO_H) || defined(__need_Emath)) -#define ERANGE 34 /* Result too large */ -#endif /* Emath not defined and included or need Emath. */ - -#ifdef _ERRNO_H - -/* non-blocking and interrupt i/o */ -#define EAGAIN 35 /* Resource temporarily unavailable */ -#ifdef __USE_BSD -#define EWOULDBLOCK EAGAIN /* Operation would block */ -#define EINPROGRESS 36 /* Operation now in progress */ -#define EALREADY 37 /* Operation already in progress */ - -/* ipc/network software -- argument errors */ -#define ENOTSOCK 38 /* Socket operation on non-socket */ -#define EDESTADDRREQ 39 /* Destination address required */ -#define EMSGSIZE 40 /* Message too long */ -#define EPROTOTYPE 41 /* Protocol wrong type for socket */ -#define ENOPROTOOPT 42 /* Protocol not available */ -#define EPROTONOSUPPORT 43 /* Protocol not supported */ -#define ESOCKTNOSUPPORT 44 /* Socket type not supported */ -#define EOPNOTSUPP 45 /* Operation not supported */ -#define EPFNOSUPPORT 46 /* Protocol family not supported */ -#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */ -#define EADDRINUSE 48 /* Address already in use */ -#define EADDRNOTAVAIL 49 /* Can't assign requested address */ - -/* ipc/network software -- operational errors */ -#define ENETDOWN 50 /* Network is down */ -#define ENETUNREACH 51 /* Network is unreachable */ -#define ENETRESET 52 /* Network dropped connection on reset */ -#define ECONNABORTED 53 /* Software caused connection abort */ -#define ECONNRESET 54 /* Connection reset by peer */ -#define ENOBUFS 55 /* No buffer space available */ -#define EISCONN 56 /* Socket is already connected */ -#define ENOTCONN 57 /* Socket is not connected */ -#define ESHUTDOWN 58 /* Can't send after socket shutdown */ -#define ETOOMANYREFS 59 /* Too many references: can't splice */ -#define ETIMEDOUT 60 /* Operation timed out */ -#define ECONNREFUSED 61 /* Connection refused */ - -#define ELOOP 62 /* Too many levels of symbolic links */ -#endif /* __USE_BSD */ -#define ENAMETOOLONG 63 /* File name too long */ - -/* should be rearranged */ -#ifdef __USE_BSD -#define EHOSTDOWN 64 /* Host is down */ -#define EHOSTUNREACH 65 /* No route to host */ -#endif /* __USE_BSD */ -#define ENOTEMPTY 66 /* Directory not empty */ - -/* quotas & mush */ -#ifdef __USE_BSD -#define EPROCLIM 67 /* Too many processes */ -#define EUSERS 68 /* Too many users */ -#define EDQUOT 69 /* Disc quota exceeded */ - -/* Network File System */ -#define ESTALE 70 /* Stale NFS file handle */ -#define EREMOTE 71 /* Too many levels of remote in path */ -#define EBADRPC 72 /* RPC struct is bad */ -#define ERPCMISMATCH 73 /* RPC version wrong */ -#define EPROGUNAVAIL 74 /* RPC prog. not avail */ -#define EPROGMISMATCH 75 /* Program version wrong */ -#define EPROCUNAVAIL 76 /* Bad procedure for program */ -#endif /* __USE_BSD */ - -#define ENOLCK 77 /* No locks available */ -#define ENOSYS 78 /* Function not implemented */ - -#define EFTYPE 79 /* Inappropriate file type or format */ - -#ifdef __USE_BSD -#define EAUTH 80 /* Authentication error */ -#define ENEEDAUTH 81 /* Need authenticator */ -#define ELAST 81 /* Must be equal largest errno */ -#endif /* __USE_BSD */ - - -#define __set_errno(val) errno = (val) - -#endif /* included. */ diff --git a/sysdeps/unix/bsd/bsd4.4/fcntlbits.h b/sysdeps/unix/bsd/bsd4.4/fcntlbits.h deleted file mode 100644 index 3ab2bf0..0000000 --- a/sysdeps/unix/bsd/bsd4.4/fcntlbits.h +++ /dev/null @@ -1,116 +0,0 @@ -/* O_*, F_*, FD_* bit values for 4.4 BSD. - Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _FCNTLBITS_H - -#define _FCNTLBITS_H 1 - - -/* File access modes for `open' and `fcntl'. */ -#define O_RDONLY 0 /* Open read-only. */ -#define O_WRONLY 1 /* Open write-only. */ -#define O_RDWR 2 /* Open read/write. */ - - -/* Bits OR'd into the second argument to open. */ -#define O_CREAT 0x0200 /* Create file if it doesn't exist. */ -#define O_EXCL 0x0800 /* Fail if file already exists. */ -#define O_TRUNC 0x0400 /* Truncate file to zero length. */ -/* Apparently not assigning a controlling terminal is the default - behavior in BSD, so no bit is required to request that behavior. */ -#define O_NOCTTY 0 /* Don't assign a controlling terminal. */ -#ifdef __USE_MISC -#define O_ASYNC 0x0040 /* Send SIGIO to owner when data is ready. */ -#define O_FSYNC 0x0080 /* Synchronous writes. */ -#define O_SYNC O_FSYNC -#define O_SHLOCK 0x0010 /* Open with shared file lock. */ -#define O_EXLOCK 0x0020 /* Open with shared exclusive lock. */ -#endif - -/* File status flags for `open' and `fcntl'. */ -#define O_APPEND 0x0008 /* Writes append to the file. */ -#define O_NONBLOCK 0x0004 /* Non-blocking I/O. */ - -#ifdef __USE_BSD -#define O_NDELAY O_NONBLOCK -#endif - -#ifdef __USE_BSD -/* Bits in the file status flags returned by F_GETFL. - These are all the O_* flags, plus FREAD and FWRITE, which are - independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was - given to `open'. */ -#define FREAD 1 -#define FWRITE 2 - -/* Traditional BSD names the O_* bits. */ -#define FASYNC O_ASYNC -#define FCREAT O_CREAT -#define FEXCL O_EXCL -#define FTRUNC O_TRUNC -#define FNOCTTY O_NOCTTY -#define FFSYNC O_FSYNC -#define FSYNC O_SYNC -#define FAPPEND O_APPEND -#define FNONBLOCK O_NONBLOCK -#define FNDELAY O_NDELAY -#endif - -/* Mask for file access modes. This is system-dependent in case - some system ever wants to define some other flavor of access. */ -#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) - -/* 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. */ -#ifdef __USE_BSD -#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */ -#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */ -#endif -#define F_GETLK 7 /* Get record locking info. */ -#define F_SETLK 8 /* Set record locking info (non-blocking). */ -#define F_SETLKW 9 /* Set record locking info (blocking). */ - -/* File descriptor flags used with F_GETFD and F_SETFD. */ -#define FD_CLOEXEC 1 /* Close on exec. */ - - -#include - -/* The structure describing an advisory lock. This is the type of the third - argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ -struct flock - { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ - short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ - __off_t l_start; /* Offset where the lock begins. */ - __off_t l_len; /* Size of the locked area; zero means until EOF. */ - short int l_pid; /* Process holding the lock. */ - }; - -/* Values for the `l_type' field of a `struct flock'. */ -#define F_RDLCK 1 /* Read lock. */ -#define F_WRLCK 2 /* Write lock. */ -#define F_UNLCK 3 /* Remove lock. */ - - -#endif /* fcntlbits.h */ diff --git a/sysdeps/unix/bsd/bsd4.4/ioctls.h b/sysdeps/unix/bsd/bsd4.4/ioctls.h deleted file mode 100644 index 6c351f4..0000000 --- a/sysdeps/unix/bsd/bsd4.4/ioctls.h +++ /dev/null @@ -1,292 +0,0 @@ -/*- - * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 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. - * - * @(#)ioctl.h 7.19 (Berkeley) 6/26/91 - */ - -#ifndef _IOCTLS_H_ -#define _IOCTLS_H_ - -#define TIOCGSIZE TIOCGWINSZ -#define TIOCSSIZE TIOCSWINSZ - -/* - * Ioctl's have the command encoded in the lower word, and the size of - * any in or out parameters in the upper word. The high 3 bits of the - * upper word are used to encode the in/out status of the parameter. - */ -#define IOCPARM_MASK 0x1fff /* parameter length, at most 13 bits */ -#define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK) -#define IOCBASECMD(x) ((x) & ~IOCPARM_MASK) -#define IOCGROUP(x) (((x) >> 8) & 0xff) - -#define IOCPARM_MAX NBPG /* max size of ioctl, mult. of NBPG */ -#define IOC_VOID 0x20000000 /* no parameters */ -#define IOC_OUT 0x40000000 /* copy out parameters */ -#define IOC_IN 0x80000000 /* copy in parameters */ -#define IOC_INOUT (IOC_IN|IOC_OUT) -#define IOC_DIRMASK 0xe0000000 /* mask for IN/OUT/VOID */ - -#define _IOC(inout,group,num,len) \ - (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num)) -#define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0) -#define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t)) -#define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t)) -/* this should be _IORW, but stdio got there first */ -#define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t)) - -#define TIOCMODG _IOR('t', 3, int) /* get modem control state */ -#define TIOCMODS _IOW('t', 4, int) /* set modem control state */ -#define TIOCM_LE 0001 /* line enable */ -#define TIOCM_DTR 0002 /* data terminal ready */ -#define TIOCM_RTS 0004 /* request to send */ -#define TIOCM_ST 0010 /* secondary transmit */ -#define TIOCM_SR 0020 /* secondary receive */ -#define TIOCM_CTS 0040 /* clear to send */ -#define TIOCM_CAR 0100 /* carrier detect */ -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RNG 0200 /* ring */ -#define TIOCM_RI TIOCM_RNG -#define TIOCM_DSR 0400 /* data set ready */ - /* 8-10 compat */ -#define TIOCEXCL _IO('t', 13) /* set exclusive use of tty */ -#define TIOCNXCL _IO('t', 14) /* reset exclusive use of tty */ - /* 15 unused */ -#define TIOCFLUSH _IOW('t', 16, int) /* flush buffers */ - /* 17-18 compat */ -#define TIOCGETA _IOR('t', 19, struct termios) /* get termios struct */ -#define TIOCSETA _IOW('t', 20, struct termios) /* set termios struct */ -#define TIOCSETAW _IOW('t', 21, struct termios) /* drain output, set */ -#define TIOCSETAF _IOW('t', 22, struct termios) /* drn out, fls in, set */ -#define TIOCGETD _IOR('t', 26, int) /* get line discipline */ -#define TIOCSETD _IOW('t', 27, int) /* set line discipline */ - /* 127-124 compat */ -#define TIOCSBRK _IO('t', 123) /* set break bit */ -#define TIOCCBRK _IO('t', 122) /* clear break bit */ -#define TIOCSDTR _IO('t', 121) /* set data terminal ready */ -#define TIOCCDTR _IO('t', 120) /* clear data terminal ready */ -#define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */ -#define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */ - /* 117-116 compat */ -#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ -#define TIOCSTI _IOW('t', 114, char) /* simulate terminal input */ -#define TIOCNOTTY _IO('t', 113) /* void tty association */ -#define TIOCPKT _IOW('t', 112, int) /* pty: set/clear packet mode */ -#define TIOCPKT_DATA 0x00 /* data packet */ -#define TIOCPKT_FLUSHREAD 0x01 /* flush packet */ -#define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */ -#define TIOCPKT_STOP 0x04 /* stop output */ -#define TIOCPKT_START 0x08 /* start output */ -#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */ -#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */ -#define TIOCPKT_IOCTL 0x40 /* state change of pty driver */ -#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ -#define TIOCSTART _IO('t', 110) /* start output, like ^Q */ -#define TIOCMSET _IOW('t', 109, int) /* set all modem bits */ -#define TIOCMBIS _IOW('t', 108, int) /* bis modem bits */ -#define TIOCMBIC _IOW('t', 107, int) /* bic modem bits */ -#define TIOCMGET _IOR('t', 106, int) /* get all modem bits */ -#define TIOCREMOTE _IOW('t', 105, int) /* remote input editing */ -#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */ -#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */ -#define TIOCUCNTL _IOW('t', 102, int) /* pty: set/clr usr cntl mode */ -#define UIOCCMD(n) _IO('u', n) /* usr cntl op "n" */ -#define TIOCCONS _IOW('t', 98, int) /* become virtual console */ -#define TIOCSCTTY _IO('t', 97) /* become controlling tty */ -#define TIOCEXT _IOW('t', 96, int) /* pty: external processing */ -#define TIOCSIG _IO('t', 95) /* pty: generate signal */ -#define TIOCDRAIN _IO('t', 94) /* wait till output drained */ - -#define TTYDISC 0 /* termios tty line discipline */ -#define TABLDISC 3 /* tablet discipline */ -#define SLIPDISC 4 /* serial IP discipline */ - - -#define FIOCLEX _IO('f', 1) /* set close on exec on fd */ -#define FIONCLEX _IO('f', 2) /* remove close on exec */ -#define FIONREAD _IOR('f', 127, int) /* get # bytes to read */ -#define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */ -#define FIOASYNC _IOW('f', 125, int) /* set/clear async i/o */ -#define FIOSETOWN _IOW('f', 124, int) /* set owner */ -#define FIOGETOWN _IOR('f', 123, int) /* get owner */ - -/* socket i/o controls */ -#define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */ -#define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */ -#define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */ -#define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */ -#define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */ -#define SIOCSPGRP _IOW('s', 8, int) /* set process group */ -#define SIOCGPGRP _IOR('s', 9, int) /* get process group */ - -#define SIOCADDRT _IOW('r', 10, struct ortentry) /* add route */ -#define SIOCDELRT _IOW('r', 11, struct ortentry) /* delete route */ - -#define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */ -#define OSIOCGIFADDR _IOWR('i',13, struct ifreq) /* get ifnet address */ -#define SIOCGIFADDR _IOWR('i',33, struct ifreq) /* get ifnet address */ -#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */ -#define OSIOCGIFDSTADDR _IOWR('i',15, struct ifreq) /* get p-p address */ -#define SIOCGIFDSTADDR _IOWR('i',34, struct ifreq) /* get p-p address */ -#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */ -#define SIOCGIFFLAGS _IOWR('i',17, struct ifreq) /* get ifnet flags */ -#define OSIOCGIFBRDADDR _IOWR('i',18, struct ifreq) /* get broadcast addr */ -#define SIOCGIFBRDADDR _IOWR('i',35, struct ifreq) /* get broadcast addr */ -#define SIOCSIFBRDADDR _IOW('i',19, struct ifreq) /* set broadcast addr */ -#define OSIOCGIFCONF _IOWR('i',20, struct ifconf) /* get ifnet list */ -#define SIOCGIFCONF _IOWR('i',36, struct ifconf) /* get ifnet list */ -#define OSIOCGIFNETMASK _IOWR('i',21, struct ifreq) /* get net addr mask */ -#define SIOCGIFNETMASK _IOWR('i',37, struct ifreq) /* get net addr mask */ -#define SIOCSIFNETMASK _IOW('i',22, struct ifreq) /* set net addr mask */ -#define SIOCGIFMETRIC _IOWR('i',23, struct ifreq) /* get IF metric */ -#define SIOCSIFMETRIC _IOW('i',24, struct ifreq) /* set IF metric */ -#define SIOCDIFADDR _IOW('i',25, struct ifreq) /* delete IF addr */ -#define SIOCAIFADDR _IOW('i',26, struct ifaliasreq) /* add/chg IF alias */ - -#define SIOCSARP _IOW('i', 30, struct arpreq) /* set arp entry */ -#define OSIOCGARP _IOWR('i',31, struct arpreq) /* get arp entry */ -#define SIOCGARP _IOWR('i',38, struct arpreq) /* get arp entry */ -#define SIOCDARP _IOW('i', 32, struct arpreq) /* delete arp entry */ - - -/* Compatibility with 4.3 BSD terminal driver. - From 4.4 . */ - -#ifdef USE_OLD_TTY -# undef TIOCGETD -# define TIOCGETD _IOR('t', 0, int) /* get line discipline */ -# undef TIOCSETD -# define TIOCSETD _IOW('t', 1, int) /* set line discipline */ -#else -# define OTIOCGETD _IOR('t', 0, int) /* get line discipline */ -# define OTIOCSETD _IOW('t', 1, int) /* set line discipline */ -#endif -#define TIOCHPCL _IO('t', 2) /* hang up on last close */ -#define TIOCGETP _IOR('t', 8,struct sgttyb)/* get parameters -- gtty */ -#define TIOCSETP _IOW('t', 9,struct sgttyb)/* set parameters -- stty */ -#define TIOCSETN _IOW('t',10,struct sgttyb)/* as above, but no flushtty*/ -#define TIOCSETC _IOW('t',17,struct tchars)/* set special characters */ -#define TIOCGETC _IOR('t',18,struct tchars)/* get special characters */ -#define TANDEM 0x00000001 /* send stopc on out q full */ -#define CBREAK 0x00000002 /* half-cooked mode */ -#define LCASE 0x00000004 /* simulate lower case */ -#define ECHO 0x00000008 /* echo input */ -#define CRMOD 0x00000010 /* map \r to \r\n on output */ -#define RAW 0x00000020 /* no i/o processing */ -#define ODDP 0x00000040 /* get/send odd parity */ -#define EVENP 0x00000080 /* get/send even parity */ -#define ANYP 0x000000c0 /* get any parity/send none */ -#define NLDELAY 0x00000300 /* \n delay */ -#define NL0 0x00000000 -#define NL1 0x00000100 /* tty 37 */ -#define NL2 0x00000200 /* vt05 */ -#define NL3 0x00000300 -#define TBDELAY 0x00000c00 /* horizontal tab delay */ -#define TAB0 0x00000000 -#define TAB1 0x00000400 /* tty 37 */ -#define TAB2 0x00000800 -#define XTABS 0x00000c00 /* expand tabs on output */ -#define CRDELAY 0x00003000 /* \r delay */ -#define CR0 0x00000000 -#define CR1 0x00001000 /* tn 300 */ -#define CR2 0x00002000 /* tty 37 */ -#define CR3 0x00003000 /* concept 100 */ -#define VTDELAY 0x00004000 /* vertical tab delay */ -#define FF0 0x00000000 -#define FF1 0x00004000 /* tty 37 */ -#define BSDELAY 0x00008000 /* \b delay */ -#define BS0 0x00000000 -#define BS1 0x00008000 -#define ALLDELAY (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY) -#define CRTBS 0x00010000 /* do backspacing for crt */ -#define PRTERA 0x00020000 /* \ ... / erase */ -#define CRTERA 0x00040000 /* " \b " to wipe out char */ -#define TILDE 0x00080000 /* hazeltine tilde kludge */ -#define MDMBUF 0x00100000 /*start/stop output on carrier*/ -#define LITOUT 0x00200000 /* literal output */ -#define TOSTOP 0x00400000 /*SIGSTOP on background output*/ -#define FLUSHO 0x00800000 /* flush output to terminal */ -#define NOHANG 0x01000000 /* (no-op) was no SIGHUP on carrier drop */ -#define L001000 0x02000000 -#define CRTKIL 0x04000000 /* kill line with " \b " */ -#define PASS8 0x08000000 -#define CTLECH 0x10000000 /* echo control chars as ^X */ -#define PENDIN 0x20000000 /* tp->t_rawq needs reread */ -#define DECCTQ 0x40000000 /* only ^Q starts after ^S */ -#define NOFLSH 0x80000000 /* no output flush on signal */ -#define TIOCLBIS _IOW('t', 127, int) /* bis local mode bits */ -#define TIOCLBIC _IOW('t', 126, int) /* bic local mode bits */ -#define TIOCLSET _IOW('t', 125, int) /* set entire local mode word */ -#define TIOCLGET _IOR('t', 124, int) /* get local modes */ -#define LCRTBS (CRTBS>>16) -#define LPRTERA (PRTERA>>16) -#define LCRTERA (CRTERA>>16) -#define LTILDE (TILDE>>16) -#define LMDMBUF (MDMBUF>>16) -#define LLITOUT (LITOUT>>16) -#define LTOSTOP (TOSTOP>>16) -#define LFLUSHO (FLUSHO>>16) -#define LNOHANG (NOHANG>>16) -#define LCRTKIL (CRTKIL>>16) -#define LPASS8 (PASS8>>16) -#define LCTLECH (CTLECH>>16) -#define LPENDIN (PENDIN>>16) -#define LDECCTQ (DECCTQ>>16) -#define LNOFLSH (NOFLSH>>16) -#define TIOCSLTC _IOW('t',117,struct ltchars)/* set local special chars*/ -#define TIOCGLTC _IOR('t',116,struct ltchars)/* get local special chars*/ -#define OTIOCCONS _IO('t', 98) /* for hp300 -- sans int arg */ -#define OTTYDISC 0 -#define NETLDISC 1 -#define NTTYDISC 2 - -/* From 4.4 . */ -#ifdef USE_OLD_TTY -#define B0 0 -#define B50 1 -#define B75 2 -#define B110 3 -#define B134 4 -#define B150 5 -#define B200 6 -#define B300 7 -#define B600 8 -#define B1200 9 -#define B1800 10 -#define B2400 11 -#define B4800 12 -#define B9600 13 -#define EXTA 14 -#define EXTB 15 -#endif /* USE_OLD_TTY */ - -#endif /* !_IOCTLS_H_ */ diff --git a/sysdeps/unix/bsd/bsd4.4/sockaddrcom.h b/sysdeps/unix/bsd/bsd4.4/sockaddrcom.h deleted file mode 100644 index 87da37d..0000000 --- a/sysdeps/unix/bsd/bsd4.4/sockaddrcom.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Definition of `struct sockaddr_*' common members. 4.4 BSD version. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SOCKADDRCOM_H -#define _SOCKADDRCOM_H 1 - - -/* POSIX.1g specifies this type name for the `sa_family' member. */ -typedef unsigned char sa_family_t; - -/* This macro is used to declare the initial common members - of the data types used for socket addresses, `struct sockaddr', - `struct sockaddr_in', `struct sockaddr_un', etc. */ - -#define __SOCKADDR_COMMON(sa_prefix) \ - unsigned char sa_prefix##len; \ - sa_family_t sa_prefix##family - -#define __SOCKADDR_COMMON_SIZE (2 * sizeof (unsigned char)) - - -#endif /* sockaddrcom.h */ diff --git a/sysdeps/unix/bsd/bsd4.4/tcgetattr.c b/sysdeps/unix/bsd/bsd4.4/tcgetattr.c index d47443a..29c7e28 100644 --- a/sysdeps/unix/bsd/bsd4.4/tcgetattr.c +++ b/sysdeps/unix/bsd/bsd4.4/tcgetattr.c @@ -19,7 +19,7 @@ #include #include -/* These are defined both in termbits.h and in ioctls.h. +/* These are defined both in and in . They should have the same values, but perhaps not written the same way. */ #undef ECHO #undef MDMBUF diff --git a/sysdeps/unix/bsd/bsd4.4/tcsetattr.c b/sysdeps/unix/bsd/bsd4.4/tcsetattr.c index 7c09f90..2e4b00b 100644 --- a/sysdeps/unix/bsd/bsd4.4/tcsetattr.c +++ b/sysdeps/unix/bsd/bsd4.4/tcsetattr.c @@ -20,7 +20,7 @@ #include #include -/* These are defined both in termbits.h and in ioctls.h. +/* These are defined both in and in . They should have the same values, but perhaps not written the same way. */ #undef ECHO #undef MDMBUF diff --git a/sysdeps/unix/bsd/direntry.h b/sysdeps/unix/bsd/direntry.h deleted file mode 100644 index 2f563ec..0000000 --- a/sysdeps/unix/bsd/direntry.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Directory entry structure `struct dirent'. 4.2BSD version. -Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -struct dirent - { - unsigned int d_fileno; /* 32 bits. */ - unsigned short int d_reclen; /* 16 bits. */ - unsigned short int d_namlen; /* 16 bits. */ - char d_name[1]; /* Variable length. */ - }; - -#define _DIRENT_HAVE_D_RECLEN 1 -#define _DIRENT_HAVE_D_NAMLEN 1 diff --git a/sysdeps/unix/bsd/fcntlbits.h b/sysdeps/unix/bsd/fcntlbits.h deleted file mode 100644 index 1e87a37..0000000 --- a/sysdeps/unix/bsd/fcntlbits.h +++ /dev/null @@ -1,117 +0,0 @@ -/* O_*, F_*, FD_* bit values for 4.3 BSD. - Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _FCNTLBITS_H - -#define _FCNTLBITS_H 1 - - -/* File access modes for `open' and `fcntl'. */ -#define O_RDONLY 0 /* Open read-only. */ -#define O_WRONLY 1 /* Open write-only. */ -#define O_RDWR 2 /* Open read/write. */ - - -/* Bits OR'd into the second argument to open. */ -#define O_CREAT 0x0200 /* Create file if it doesn't exist. */ -#define O_EXCL 0x0800 /* Fail if file already exists. */ -#define O_TRUNC 0x0400 /* Truncate file to zero length. */ -/* Apparently not assigning a controlling terminal is the default - behavior in BSD, so no bit is required to request that behavior. */ -#define O_NOCTTY 0 /* Don't assign a controlling terminal. */ -#if defined (__USE_BSD) || defined (__USE_SVID) -#define O_ASYNC 0x0040 /* Send SIGIO to owner when data is ready. */ -#define O_FSYNC 0x2000 /* Synchronous writes. */ -#define O_SYNC O_FSYNC -#endif - -/* File status flags for `open' and `fcntl'. */ -#define O_APPEND 0x0008 /* Writes append to the file. */ -#define O_NONBLOCK 0x0004 /* Non-blocking I/O. */ - -#ifdef __USE_BSD -/* BSD before 4.4 doesn't support POSIX.1 O_NONBLOCK, - but O_NDELAY is close. */ -#define O_NDELAY O_NONBLOCK -#endif - -#ifdef __USE_BSD -/* Bits in the file status flags returned by F_GETFL. - These are all the O_* flags, plus FREAD and FWRITE, which are - independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was - given to `open'. */ -#define FREAD 1 -#define FWRITE 2 - -/* Traditional BSD names the O_* bits. */ -#define FASYNC O_ASYNC -#define FCREAT O_CREAT -#define FEXCL O_EXCL -#define FTRUNC O_TRUNC -#define FNOCTTY O_NOCTTY -#define FFSYNC O_FSYNC -#define FSYNC O_SYNC -#define FAPPEND O_APPEND -#define FNONBLOCK O_NONBLOCK -#define FNDELAY O_NDELAY -#endif - -/* Mask for file access modes. This is system-dependent in case - some system ever wants to define some other flavor of access. */ -#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) - -/* 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. */ -#ifdef __USE_BSD -#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */ -#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */ -#endif -#define F_GETLK 7 /* Get record locking info. */ -#define F_SETLK 8 /* Set record locking info (non-blocking). */ -#define F_SETLKW 9 /* Set record locking info (blocking). */ - -/* File descriptor flags used with F_GETFD and F_SETFD. */ -#define FD_CLOEXEC 1 /* Close on exec. */ - - -#include - -/* The structure describing an advisory lock. This is the type of the third - argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ -struct flock - { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ - short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ - __off_t l_start; /* Offset where the lock begins. */ - __off_t l_len; /* Size of the locked area; zero means until EOF. */ - short int l_pid; /* Process holding the lock. */ - short int l_xxx; /* Reserved for future use. */ - }; - -/* Values for the `l_type' field of a `struct flock'. */ -#define F_RDLCK 1 /* Read lock. */ -#define F_WRLCK 2 /* Write lock. */ -#define F_UNLCK 3 /* Remove lock. */ - - -#endif /* fcntlbits.h */ diff --git a/sysdeps/unix/bsd/m68k/sysdep.S b/sysdeps/unix/bsd/m68k/sysdep.S index cef8990..1be2d5a 100644 --- a/sysdeps/unix/bsd/m68k/sysdep.S +++ b/sysdeps/unix/bsd/m68k/sysdep.S @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define _ERRNO_H -#include +#include .globl syscall_error syscall_error: diff --git a/sysdeps/unix/bsd/osf/alpha/bits/stat.h b/sysdeps/unix/bsd/osf/alpha/bits/stat.h new file mode 100644 index 0000000..752d4ee --- /dev/null +++ b/sysdeps/unix/bsd/osf/alpha/bits/stat.h @@ -0,0 +1,80 @@ +/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Brendan Kehoe (brendan@zen.org). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H + +#include + +/* Structure describing file characteristics. */ +struct stat + { + int st_dev; /* Device. */ + unsigned int st_ino; /* File serial number. */ + unsigned int st_mode; /* File mode. */ + unsigned short st_nlink; /* Link count. */ + unsigned int st_uid; /* User ID of the file's owner. */ + unsigned int st_gid; /* Group ID of the file's group.*/ + int st_rdev; /* Device number, if device. */ + + long st_size; /* Size of file, in bytes. */ + + int st_atime; /* Time of last access. */ + int st_atime_usec; + int st_mtime; /* Time of last modification. */ + int st_mtime_usec; + int st_ctime; /* Time of last status change. */ + int st_ctime_usec; + + unsigned int st_blksize; /* Optimal block size for I/O. */ +#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */ + + int st_blocks; /* Number of 512-byte blocks allocated. */ + unsigned int st_flags; + unsigned int st_gen; + }; + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFIFO 0010000 /* FIFO. */ + +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + +#endif /* bits/stat.h */ diff --git a/sysdeps/unix/bsd/osf/alpha/statbuf.h b/sysdeps/unix/bsd/osf/alpha/statbuf.h deleted file mode 100644 index 8541922..0000000 --- a/sysdeps/unix/bsd/osf/alpha/statbuf.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (C) 1993, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _STATBUF_H -#define _STATBUF_H - -#include - -/* Structure describing file characteristics. */ -struct stat - { - int st_dev; /* Device. */ - unsigned int st_ino; /* File serial number. */ - unsigned int st_mode; /* File mode. */ - unsigned short st_nlink; /* Link count. */ - unsigned int st_uid; /* User ID of the file's owner. */ - unsigned int st_gid; /* Group ID of the file's group.*/ - int st_rdev; /* Device number, if device. */ - - long st_size; /* Size of file, in bytes. */ - - int st_atime; /* Time of last access. */ - int st_atime_usec; - int st_mtime; /* Time of last modification. */ - int st_mtime_usec; - int st_ctime; /* Time of last status change. */ - int st_ctime_usec; - - unsigned int st_blksize; /* Optimal block size for I/O. */ -#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */ - - int st_blocks; /* Number of 512-byte blocks allocated. */ - unsigned int st_flags; - unsigned int st_gen; - }; - -/* Encoding of the file mode. */ - -#define __S_IFMT 0170000 /* These bits determine file type. */ - -/* File types. */ -#define __S_IFDIR 0040000 /* Directory. */ -#define __S_IFCHR 0020000 /* Character device. */ -#define __S_IFBLK 0060000 /* Block device. */ -#define __S_IFREG 0100000 /* Regular file. */ -#define __S_IFIFO 0010000 /* FIFO. */ - -#define __S_IFLNK 0120000 /* Symbolic link. */ -#define __S_IFSOCK 0140000 /* Socket. */ - -/* Protection bits. */ - -#define __S_ISUID 04000 /* Set user ID on execution. */ -#define __S_ISGID 02000 /* Set group ID on execution. */ -#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ -#define __S_IREAD 0400 /* Read by owner. */ -#define __S_IWRITE 0200 /* Write by owner. */ -#define __S_IEXEC 0100 /* Execute by owner. */ - -#endif /* statbuf.h */ diff --git a/sysdeps/unix/bsd/osf/bits/sigaction.h b/sysdeps/unix/bsd/osf/bits/sigaction.h new file mode 100644 index 0000000..df400d4 --- /dev/null +++ b/sysdeps/unix/bsd/osf/bits/sigaction.h @@ -0,0 +1,46 @@ +/* Structure and constant definitions for sigaction et al. OSF/1 version. + Copyright (C) 1993, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Brendan Kehoe (brendan@zen.org). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Structure describing the action to be taken when a signal arrives. */ +struct sigaction + { + /* Signal handler. */ + __sighandler_t sa_handler; + + /* Additional set of signals to be blocked. */ + __sigset_t sa_mask; + + /* Special flags. */ + int sa_flags; + }; + +/* Bits in `sa_flags'. */ +#ifdef __USE_BSD +#define SA_ONSTACK 0x1 /* Take signal on signal stack. */ +#define SA_RESTART 0x2 /* Don't restart syscall on signal return. */ +#define SA_DISABLE 0x4 /* Disable alternate signal stack. */ +#endif +#define SA_NOCLDSTOP 0x4 /* Don't send SIGCHLD when children stop. */ + + +/* Values for the HOW argument to `sigprocmask'. */ +#define SIG_BLOCK 1 /* Block signals. */ +#define SIG_UNBLOCK 2 /* Unblock signals. */ +#define SIG_SETMASK 3 /* Set the set of blocked signals. */ diff --git a/sysdeps/unix/bsd/osf/sigaction.h b/sysdeps/unix/bsd/osf/sigaction.h deleted file mode 100644 index df400d4..0000000 --- a/sysdeps/unix/bsd/osf/sigaction.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Structure and constant definitions for sigaction et al. OSF/1 version. - Copyright (C) 1993, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* Structure describing the action to be taken when a signal arrives. */ -struct sigaction - { - /* Signal handler. */ - __sighandler_t sa_handler; - - /* Additional set of signals to be blocked. */ - __sigset_t sa_mask; - - /* Special flags. */ - int sa_flags; - }; - -/* Bits in `sa_flags'. */ -#ifdef __USE_BSD -#define SA_ONSTACK 0x1 /* Take signal on signal stack. */ -#define SA_RESTART 0x2 /* Don't restart syscall on signal return. */ -#define SA_DISABLE 0x4 /* Disable alternate signal stack. */ -#endif -#define SA_NOCLDSTOP 0x4 /* Don't send SIGCHLD when children stop. */ - - -/* Values for the HOW argument to `sigprocmask'. */ -#define SIG_BLOCK 1 /* Block signals. */ -#define SIG_UNBLOCK 2 /* Unblock signals. */ -#define SIG_SETMASK 3 /* Set the set of blocked signals. */ diff --git a/sysdeps/unix/bsd/osf/sys/mman.h b/sysdeps/unix/bsd/osf/sys/mman.h index 6dc3e4e..7284619 100644 --- a/sysdeps/unix/bsd/osf/sys/mman.h +++ b/sysdeps/unix/bsd/osf/sys/mman.h @@ -22,7 +22,7 @@ #define _SYS_MMAN_H 1 #include -#include +#include #define __need_size_t #include diff --git a/sysdeps/unix/bsd/posix_opt.h b/sysdeps/unix/bsd/posix_opt.h deleted file mode 100644 index 7d5e578..0000000 --- a/sysdeps/unix/bsd/posix_opt.h +++ /dev/null @@ -1,5 +0,0 @@ -#define _POSIX_JOB_CONTROL 1 -#undef _POSIX_SAVED_IDS -#define _POSIX_CHOWN_RESTRICTED 1 -#define _POSIX_NO_TRUNC -1 -#define _POSIX_VDISABLE ((unsigned char) -1) diff --git a/sysdeps/unix/bsd/signum.h b/sysdeps/unix/bsd/signum.h deleted file mode 100644 index 775240f..0000000 --- a/sysdeps/unix/bsd/signum.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Signal number definitions. BSD version. - Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef _SIGNAL_H - -/* This file defines the fake signal functions and signal - number constants for 4.2 or 4.3 BSD-derived Unix system. */ - -/* Fake signal functions. */ -#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ -#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ -#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ - - -/* Signals. */ -#define SIGHUP 1 /* Hangup (POSIX). */ -#define SIGINT 2 /* Interrupt (ANSI). */ -#define SIGQUIT 3 /* Quit (POSIX). */ -#define SIGILL 4 /* Illegal instruction (ANSI). */ -#define SIGABRT SIGIOT /* Abort (ANSI). */ -#define SIGTRAP 5 /* Trace trap (POSIX). */ -#define SIGIOT 6 /* IOT trap (4.2 BSD). */ -#define SIGEMT 7 /* EMT trap (4.2 BSD). */ -#define SIGFPE 8 /* Floating-point exception (ANSI). */ -#define SIGKILL 9 /* Kill, unblockable (POSIX). */ -#define SIGBUS 10 /* Bus error (4.2 BSD). */ -#define SIGSEGV 11 /* Segmentation violation (ANSI). */ -#define SIGSYS 12 /* Bad argument to system call (4.2 BSD). */ -#define SIGPIPE 13 /* Broken pipe (POSIX). */ -#define SIGALRM 14 /* Alarm clock (POSIX). */ -#define SIGTERM 15 /* Termination (ANSI). */ -#define SIGURG 16 /* Urgent condition on socket (4.2 BSD). */ -#define SIGSTOP 17 /* Stop, unblockable (POSIX). */ -#define SIGTSTP 18 /* Keyboard stop (POSIX). */ -#define SIGCONT 19 /* Continue (POSIX). */ -#define SIGCHLD 20 /* Child status has changed (POSIX). */ -#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ -#define SIGTTIN 21 /* Background read from tty (POSIX). */ -#define SIGTTOU 22 /* Background write to tty (POSIX). */ -#define SIGIO 23 /* I/O now possible (4.2 BSD). */ -#define SIGPOLL SIGIO /* Same as SIGIO? (SVID). */ -#define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */ -#define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */ -#define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */ -#define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */ -#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ -#define SIGINFO 29 /* Information request (4.4 BSD). */ -#define SIGUSR1 30 /* User-defined signal 1 (POSIX). */ -#define SIGUSR2 31 /* User-defined signal 2 (POSIX). */ -#define SIGLOST 32 /* Resource lost (Sun); server died (GNU). */ - -#endif /* included. */ - -#define _NSIG 33 /* Biggest signal number + 1. */ diff --git a/sysdeps/unix/bsd/statbuf.h b/sysdeps/unix/bsd/statbuf.h deleted file mode 100644 index c4a4e09..0000000 --- a/sysdeps/unix/bsd/statbuf.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _STATBUF_H - -#define _STATBUF_H 1 - -#include - -/* Structure describing file characteristics. */ -struct stat - { - /* This is a short instead of dev_t for compatibility with 4.3. */ - short int st_dev; /* Device containing the file. */ - __ino_t st_ino; /* File serial number. */ - - /* This is a short instead of mode_t for compatibility with 4.3. */ - unsigned short int st_mode; /* File mode. */ - - __nlink_t st_nlink; /* Link count. */ - - /* These are shorts instead of uid_t/gid_t for compatibility with 4.3. */ - unsigned short int st_uid; /* User ID of the file's owner. */ - unsigned short int st_gid; /* Group ID of the file's group.*/ - - /* This is a short instead of dev_t for compatibility with 4.3. */ - short int st_rdev; /* Device number, if device. */ - - __off_t st_size; /* Size of file, in bytes. */ - - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atime_usec; - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtime_usec; - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctime_usec; - - unsigned long int st_blksize; /* Optimal block size for I/O. */ -#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */ - - unsigned long int st_blocks; /* Number of 512-byte blocks allocated. */ - - long int st_spare[2]; - }; - -/* Encoding of the file mode. */ - -#define __S_IFMT 0170000 /* These bits determine file type. */ - -/* File types. */ -#define __S_IFDIR 0040000 /* Directory. */ -#define __S_IFCHR 0020000 /* Character device. */ -#define __S_IFBLK 0060000 /* Block device. */ -#define __S_IFREG 0100000 /* Regular file. */ -#define __S_IFLNK 0120000 /* Symbolic link. */ -#define __S_IFSOCK 0140000 /* Socket. */ -#define __S_IFIFO 0010000 /* FIFO. */ - -/* Protection bits. */ - -#define __S_ISUID 04000 /* Set user ID on execution. */ -#define __S_ISGID 02000 /* Set group ID on execution. */ -#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ -#define __S_IREAD 0400 /* Read by owner. */ -#define __S_IWRITE 0200 /* Write by owner. */ -#define __S_IEXEC 0100 /* Execute by owner. */ - - -#endif /* statbuf.h */ diff --git a/sysdeps/unix/bsd/sun/bits/signum.h b/sysdeps/unix/bsd/sun/bits/signum.h new file mode 100644 index 0000000..a327401 --- /dev/null +++ b/sysdeps/unix/bsd/sun/bits/signum.h @@ -0,0 +1,69 @@ +/* Signal number definitions. SunOS version. + Copyright (C) 1994, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifdef _SIGNAL_H + +/* This file defines the fake signal functions and signal + number constants for SunOS 3 and 4 Unix systems. */ + +/* Fake signal functions. */ +#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ +#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ +#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ + + +/* Signals. */ +#define SIGHUP 1 /* Hangup (POSIX). */ +#define SIGINT 2 /* Interrupt (ANSI). */ +#define SIGQUIT 3 /* Quit (POSIX). */ +#define SIGILL 4 /* Illegal instruction (ANSI). */ +#define SIGABRT SIGIOT /* Abort (ANSI). */ +#define SIGTRAP 5 /* Trace trap (POSIX). */ +#define SIGIOT 6 /* IOT trap (4.2 BSD). */ +#define SIGEMT 7 /* EMT trap (4.2 BSD). */ +#define SIGFPE 8 /* Floating-point exception (ANSI). */ +#define SIGKILL 9 /* Kill, unblockable (POSIX). */ +#define SIGBUS 10 /* Bus error (4.2 BSD). */ +#define SIGSEGV 11 /* Segmentation violation (ANSI). */ +#define SIGSYS 12 /* Bad argument to system call (4.2 BSD). */ +#define SIGPIPE 13 /* Broken pipe (POSIX). */ +#define SIGALRM 14 /* Alarm clock (POSIX). */ +#define SIGTERM 15 /* Termination (ANSI). */ +#define SIGURG 16 /* Urgent condition on socket (4.2 BSD). */ +#define SIGSTOP 17 /* Stop, unblockable (POSIX). */ +#define SIGTSTP 18 /* Keyboard stop (POSIX). */ +#define SIGCONT 19 /* Continue (POSIX). */ +#define SIGCHLD 20 /* Child status has changed (POSIX). */ +#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ +#define SIGTTIN 21 /* Background read from tty (POSIX). */ +#define SIGTTOU 22 /* Background write to tty (POSIX). */ +#define SIGIO 23 /* I/O now possible (4.2 BSD). */ +#define SIGPOLL SIGIO /* Same as SIGIO? (SVID). */ +#define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */ +#define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */ +#define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */ +#define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */ +#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ +#define SIGLOST 29 /* Resource lost (Sun). */ +#define SIGUSR1 30 /* User-defined signal 1 (POSIX). */ +#define SIGUSR2 31 /* User-defined signal 2 (POSIX). */ + +#endif /* included. */ + +#define _NSIG 32 /* Biggest signal number + 1. */ diff --git a/sysdeps/unix/bsd/sun/m68k/bits/sigcontext.h b/sysdeps/unix/bsd/sun/m68k/bits/sigcontext.h new file mode 100644 index 0000000..471b516 --- /dev/null +++ b/sysdeps/unix/bsd/sun/m68k/bits/sigcontext.h @@ -0,0 +1,26 @@ +/* Structure describing state saved while handling a signal. Sun 3 version. +Copyright (C) 1993, 1994 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 Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +struct sigcontext + { + int sc_onstack; + __sigset_t sc_mask; + + int sc_sp, sc_pc, sc_ps; + }; diff --git a/sysdeps/unix/bsd/sun/m68k/sethostid.S b/sysdeps/unix/bsd/sun/m68k/sethostid.S index 8b30f3f..ab76d75 100644 --- a/sysdeps/unix/bsd/sun/m68k/sethostid.S +++ b/sysdeps/unix/bsd/sun/m68k/sethostid.S @@ -25,7 +25,7 @@ SYSCALL (sethostid, 1) #else -#include +#include .globl _sethostid .even diff --git a/sysdeps/unix/bsd/sun/m68k/sigcontext.h b/sysdeps/unix/bsd/sun/m68k/sigcontext.h deleted file mode 100644 index 471b516..0000000 --- a/sysdeps/unix/bsd/sun/m68k/sigcontext.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Structure describing state saved while handling a signal. Sun 3 version. -Copyright (C) 1993, 1994 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 Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -struct sigcontext - { - int sc_onstack; - __sigset_t sc_mask; - - int sc_sp, sc_pc, sc_ps; - }; diff --git a/sysdeps/unix/bsd/sun/signum.h b/sysdeps/unix/bsd/sun/signum.h deleted file mode 100644 index a327401..0000000 --- a/sysdeps/unix/bsd/sun/signum.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Signal number definitions. SunOS version. - Copyright (C) 1994, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef _SIGNAL_H - -/* This file defines the fake signal functions and signal - number constants for SunOS 3 and 4 Unix systems. */ - -/* Fake signal functions. */ -#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ -#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ -#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ - - -/* Signals. */ -#define SIGHUP 1 /* Hangup (POSIX). */ -#define SIGINT 2 /* Interrupt (ANSI). */ -#define SIGQUIT 3 /* Quit (POSIX). */ -#define SIGILL 4 /* Illegal instruction (ANSI). */ -#define SIGABRT SIGIOT /* Abort (ANSI). */ -#define SIGTRAP 5 /* Trace trap (POSIX). */ -#define SIGIOT 6 /* IOT trap (4.2 BSD). */ -#define SIGEMT 7 /* EMT trap (4.2 BSD). */ -#define SIGFPE 8 /* Floating-point exception (ANSI). */ -#define SIGKILL 9 /* Kill, unblockable (POSIX). */ -#define SIGBUS 10 /* Bus error (4.2 BSD). */ -#define SIGSEGV 11 /* Segmentation violation (ANSI). */ -#define SIGSYS 12 /* Bad argument to system call (4.2 BSD). */ -#define SIGPIPE 13 /* Broken pipe (POSIX). */ -#define SIGALRM 14 /* Alarm clock (POSIX). */ -#define SIGTERM 15 /* Termination (ANSI). */ -#define SIGURG 16 /* Urgent condition on socket (4.2 BSD). */ -#define SIGSTOP 17 /* Stop, unblockable (POSIX). */ -#define SIGTSTP 18 /* Keyboard stop (POSIX). */ -#define SIGCONT 19 /* Continue (POSIX). */ -#define SIGCHLD 20 /* Child status has changed (POSIX). */ -#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ -#define SIGTTIN 21 /* Background read from tty (POSIX). */ -#define SIGTTOU 22 /* Background write to tty (POSIX). */ -#define SIGIO 23 /* I/O now possible (4.2 BSD). */ -#define SIGPOLL SIGIO /* Same as SIGIO? (SVID). */ -#define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */ -#define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */ -#define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */ -#define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */ -#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ -#define SIGLOST 29 /* Resource lost (Sun). */ -#define SIGUSR1 30 /* User-defined signal 1 (POSIX). */ -#define SIGUSR2 31 /* User-defined signal 2 (POSIX). */ - -#endif /* included. */ - -#define _NSIG 32 /* Biggest signal number + 1. */ diff --git a/sysdeps/unix/bsd/sun/sparc/bits/sigcontext.h b/sysdeps/unix/bsd/sun/sparc/bits/sigcontext.h new file mode 100644 index 0000000..290bf81 --- /dev/null +++ b/sysdeps/unix/bsd/sun/sparc/bits/sigcontext.h @@ -0,0 +1,31 @@ +/* Structure describing state saved while handling a signal. Sparc version. +Copyright (C) 1992, 1994 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 Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +struct sigcontext + { + int sc_onstack; + __sigset_t sc_mask; + +#define SPARC_MAXREGWINDOW 31 /* Maximum usable register windows. */ + int sc_sp, sc_pc, sc_npc, sc_psr, sc_g1, sc_o0; + int sc_wbcnt; /* Number of outstanding windows. */ + __ptr_t sc_spbuf[SPARC_MAXREGWINDOW]; /* SP's for each window. */ + int sc_wbuf[SPARC_MAXREGWINDOW][16]; /* Saved register windows. */ + }; + diff --git a/sysdeps/unix/bsd/sun/sparc/sethostid.S b/sysdeps/unix/bsd/sun/sparc/sethostid.S index fbafba5..f8ee805 100644 --- a/sysdeps/unix/bsd/sun/sparc/sethostid.S +++ b/sysdeps/unix/bsd/sun/sparc/sethostid.S @@ -25,9 +25,9 @@ SYSCALL (sethostid, 1) #else -/* only defines E* #ifdef _ERRNO_H. */ +/* only defines E* #ifdef _ERRNO_H. */ #define _ERRNO_H -#include +#include ENTRY (sethostid) mov ENOSYS, %o0 diff --git a/sysdeps/unix/bsd/sun/sparc/sigcontext.h b/sysdeps/unix/bsd/sun/sparc/sigcontext.h deleted file mode 100644 index 290bf81..0000000 --- a/sysdeps/unix/bsd/sun/sparc/sigcontext.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Structure describing state saved while handling a signal. Sparc version. -Copyright (C) 1992, 1994 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 Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -struct sigcontext - { - int sc_onstack; - __sigset_t sc_mask; - -#define SPARC_MAXREGWINDOW 31 /* Maximum usable register windows. */ - int sc_sp, sc_pc, sc_npc, sc_psr, sc_g1, sc_o0; - int sc_wbcnt; /* Number of outstanding windows. */ - __ptr_t sc_spbuf[SPARC_MAXREGWINDOW]; /* SP's for each window. */ - int sc_wbuf[SPARC_MAXREGWINDOW][16]; /* Saved register windows. */ - }; - diff --git a/sysdeps/unix/bsd/sun/sunos4/bits/fcntl.h b/sysdeps/unix/bsd/sun/sunos4/bits/fcntl.h new file mode 100644 index 0000000..b74c80e --- /dev/null +++ b/sysdeps/unix/bsd/sun/sunos4/bits/fcntl.h @@ -0,0 +1,142 @@ +/* O_*, F_*, FD_* bit values for SunOS 4. + Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FCNTL_H +#error "Never use directly; include instead." +#endif + + +/* File access modes for `open' and `fcntl'. */ +#define O_RDONLY 0 /* Open read-only. */ +#define O_WRONLY 1 /* Open write-only. */ +#define O_RDWR 2 /* Open read/write. */ + + +/* Bits OR'd into the second argument to open. */ +#define O_CREAT 0x0200 /* Create file if it doesn't exist. */ +#define O_EXCL 0x0800 /* Fail if file already exists. */ +#define O_TRUNC 0x0400 /* Truncate file to zero length. */ +#define O_NOCTTY 0x8000 /* Don't assign a controlling terminal. */ +#if defined __USE_BSD || defined __USE_SVID +#define O_ASYNC 0x0040 /* Send SIGIO to owner when data is ready. */ +#define O_FSYNC 0x2000 /* Synchronous writes. */ +#define O_SYNC O_FSYNC +#endif + +/* File status flags for `open' and `fcntl'. */ +#define O_APPEND 0x0008 /* Writes append to the file. */ +#define O_NONBLOCK 0x4000 /* Non-blocking I/O. */ + +/* Sun defines O_NDELAY one way for BSD behavior and another for System V + behavior. In the GNU C library, you get the BSD behavior unless you + define _USG_SOURCE without also defining _BSD_SOURCE or _GNU_SOURCE. */ +#ifdef __USE_BSD +#define O_NDELAY 0x0004 +#endif +#if !defined (O_NDELAY) && defined (__USE_SVID) +#define O_NDELAY 0x1000 +#endif + +#ifdef __USE_BSD +/* Bits in the file status flags returned by F_GETFL. + These are all the O_* flags, plus FREAD and FWRITE, which are + independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was + given to `open'. */ +#define FREAD 1 +#define FWRITE 2 + +/* Traditional Unix names the O_* bits. */ +#define FASYNC O_ASYNC +#define FCREAT O_CREAT +#define FEXCL O_EXCL +#define FTRUNC O_TRUNC +#define FNOCTTY O_NOCTTY +#define FFSYNC O_FSYNC +#define FSYNC O_SYNC +#define FAPPEND O_APPEND +#define FNONBLOCK O_NONBLOCK +#define FNONBIO O_NONBLOCK +#define FNDELAY 0x0004 /* BSD O_NDELAY. */ +#define FNBIO 0x1000 /* System V O_NDELAY. */ +#endif + +/* Mask for file access modes. This is system-dependent in case + some system ever wants to define some other flavor of access. */ +#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) + +/* 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. */ +#ifdef __USE_BSD +#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */ +#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */ +#endif +#define F_GETLK 7 /* Get record locking info. */ +#define F_SETLK 8 /* Set record locking info (non-blocking). */ +#define F_SETLKW 9 /* Set record locking info (blocking). */ +#ifdef __USE_BSD +#define F_RGETLK 10 /* Get remote record locking info. */ +#define F_RSETLK 11 /* Set remote locking info (non-blocking). */ +#define F_CNVT 12 /* Convert a fhandle to an open fd. */ +#define F_RSETLKW 13 /* Set remote locking info (blocking). */ +#endif + +/* File descriptor flags used with F_GETFD and F_SETFD. */ +#define FD_CLOEXEC 1 /* Close on exec. */ + + +#include + +/* The structure describing an advisory lock. This is the type of the third + argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ + short int l_pid; /* Process holding the lock. */ + short int l_xxx; /* Reserved for future use. */ + }; + +#ifdef __USE_BSD +/* The structure describing a remote advisory lock. This is the type of the + third arg to `fcntl' for the F_RGETLK, F_RSETLK, and F_RSETLKW requests. */ +struct eflock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ + short int l_pid; /* Process holding the lock. */ + short int l_xxx; /* Reserved for future use. */ + long int l_rpid; /* Remote process ID wanting this lock. */ + long int l_rsys; /* Remote system ID wanting this lock. */ + }; + +#endif + + +/* Values for the `l_type' field of a `struct flock'. */ +#define F_RDLCK 1 /* Read lock. */ +#define F_WRLCK 2 /* Write lock. */ +#define F_UNLCK 3 /* Remove lock. */ diff --git a/sysdeps/unix/bsd/sun/sunos4/bits/resource.h b/sysdeps/unix/bsd/sun/sunos4/bits/resource.h new file mode 100644 index 0000000..ff55773 --- /dev/null +++ b/sysdeps/unix/bsd/sun/sunos4/bits/resource.h @@ -0,0 +1,139 @@ +/* Bit values for resource limits. SunOS 4 version. + Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* These are the values for 4.4 BSD and GNU. Earlier BSD systems have a + subset of these kinds of resource limit. In systems where `getrlimit' + and `setrlimit' are not system calls, these are the values used by the C + library to emulate them. */ + +/* Kinds of resource limit. */ +enum __rlimit_resource + { + /* Per-process CPU limit, in seconds. */ + RLIMIT_CPU, +#define RLIMIT_CPU RLIMIT_CPU + /* Largest file that can be created, in bytes. */ + RLIMIT_FSIZE, +#define RLIMIT_FSIZE RLIMIT_FSIZE + /* Maximum size of data segment, in bytes. */ + RLIMIT_DATA, +#define RLIMIT_DATA RLIMIT_DATA + /* Maximum size of stack segment, in bytes. */ + RLIMIT_STACK, +#define RLIMIT_STACK RLIMIT_STACK + /* Largest core file that can be created, in bytes. */ + RLIMIT_CORE, +#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, +#define RLIMIT_RSS RLIMIT_RSS + /* Number of open files. */ + RLIMIT_NOFILE, + RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ +#define RLIMIT_NOFILE RLIMIT_NOFILE +#define RLIMIT_OFILE RLIMIT_OFILE + + RLIM_NLIMITS, + + RLIM_INFINITY = 0x7fffffff /* Value to indicate that there is no limit. */ +#define RLIM_INFINITY RLIM_INFINITY + }; + +struct rlimit + { + /* The current (soft) limit. */ + int rlim_cur; + /* The hard limit. */ + int rlim_max; + }; + +/* Whose usage statistics do you want? */ +enum __rusage_who +/* The macro 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. */ + { + /* 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 + }; + +#include /* For `struct timeval'. */ + +/* Structure which says how much of each resource has been used. */ +struct rusage + { + /* Total amount of user time used. */ + struct timeval ru_utime; + /* Total amount of system time used. */ + struct timeval ru_stime; + /* Maximum resident set size (in kilobytes). */ + long int ru_maxrss; + /* Amount of sharing of text segment memory + with other processes (kilobyte-seconds). */ + long int ru_ixrss; + /* Amount of data segment memory used (kilobyte-seconds). */ + long int ru_idrss; + /* Amount of stack memory used (kilobyte-seconds). */ + long int ru_isrss; + /* Number of soft page faults (i.e. those serviced by reclaiming + a page from the list of pages awaiting reallocation. */ + long int ru_minflt; + /* Number of hard page faults (i.e. those that required I/O). */ + long int ru_majflt; + /* Number of times a process was swapped out of physical memory. */ + long int ru_nswap; + /* Number of input operations via the file system. Note: This + and `ru_oublock' do not include operations with the cache. */ + long int ru_inblock; + /* Number of output operations via the file system. */ + long int ru_oublock; + /* Number of IPC messages sent. */ + long int ru_msgsnd; + /* Number of IPC messages received. */ + long int ru_msgrcv; + /* Number of signals delivered. */ + long int ru_nsignals; + /* Number of voluntary context switches, i.e. because the process + gave up the process before it had to (usually to wait for some + resource to be available). */ + long int ru_nvcsw; + /* Number of involuntary context switches, i.e. a higher priority process + became runnable or the current process used up its time slice. */ + long int ru_nivcsw; + }; + +/* 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. */ + PRIO_PGRP = 1, /* WHO is a process group ID. */ + PRIO_USER = 2 /* WHO is a user ID. */ + }; diff --git a/sysdeps/unix/bsd/sun/sunos4/bits/termios.h b/sysdeps/unix/bsd/sun/sunos4/bits/termios.h new file mode 100644 index 0000000..dc0a007 --- /dev/null +++ b/sysdeps/unix/bsd/sun/sunos4/bits/termios.h @@ -0,0 +1,208 @@ +/* termios type and macro definitions. SunOS 4 version. + Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Type of terminal control flag masks. */ +typedef unsigned long int tcflag_t; + +/* Type of control characters. */ +typedef unsigned char cc_t; + +/* Type of baud rate specifiers. */ +typedef unsigned int speed_t; + +/* Terminal control structure. */ +struct termios +{ + /* Input modes. */ + tcflag_t c_iflag; +#define IGNBRK 0x0001 /* Ignore break condition. */ +#define BRKINT 0x0002 /* Signal interrupt on break. */ +#define IGNPAR 0x0004 /* Ignore characters with parity errors. */ +#define PARMRK 0x0008 /* Mark parity and framing errors. */ +#define INPCK 0x0010 /* Enable input parity check. */ +#define ISTRIP 0x0020 /* Strip 8th bit off characters. */ +#define INLCR 0x0040 /* Map NL to CR on input. */ +#define IGNCR 0x0080 /* Ignore CR. */ +#define ICRNL 0x0100 /* Map CR to NL on input. */ +#ifdef __USE_BSD +#define IUCLC 0x0200 /* Map upper case to lower case on input. */ +#endif +#define IXON 0x0400 /* Enable start/stop output control. */ +#define IXOFF 0x1000 /* Enable start/stop input control. */ +#ifdef __USE_BSD +#define IXANY 0x0800 /* Any character will restart after stop. */ +#define IMAXBEL 0x2000 /* Ring bell when input queue is full. */ +#endif + + /* Output modes. */ + tcflag_t c_oflag; +#define OPOST 0x0001 /* Perform output processing. */ +#ifdef __USE_BSD +#define OLCUC 0x00000002 /* Map lower case to upper case on output. */ +#define ONLCR 0x00000004 /* Map NL to CR-NL on output. */ +#define OCRNL 0x00000008 +#define ONOCR 0x00000010 +#define ONLRET 0x00000020 +#define OFILL 0x00000040 +#define OFDEL 0x00000080 +#define NLDLY 0x00000100 +#define NL0 0 +#define NL1 0x00000100 +#define CRDLY 0x00000600 +#define CR0 0 +#define CR1 0x00000200 +#define CR2 0x00000400 +#define CR3 0x00000600 +#define TABDLY 0x00001800 +#define TAB0 0 +#define TAB1 0x00000800 +#define TAB2 0x00001000 +#define XTABS 0x00001800 +#define TAB3 XTABS +#define BSDLY 0x00002000 +#define BS0 0 +#define BS1 0x00002000 +#define VTDLY 0x00004000 +#define VT0 0 +#define VT1 0x00004000 +#define FFDLY 0x00008000 +#define FF0 0 +#define FF1 0x00008000 +#define PAGEOUT 0x00010000 +#define WRAP 0x00020000 +#endif + + /* Control modes. */ + tcflag_t c_cflag; +#define CSIZE (CS5|CS6|CS7|CS8) /* Number of bits per byte (mask). */ +#define CS5 0 /* 5 bits per byte. */ +#define CS6 0x00000010 /* 6 bits per byte. */ +#define CS7 0x00000020 /* 7 bits per byte. */ +#define CS8 0x00000030 /* 8 bits per byte. */ +#define CSTOPB 0x00000040 /* Two stop bits instead of one. */ +#define CREAD 0x00000080 /* Enable receiver. */ +#define PARENB 0x00000100 /* Parity enable. */ +#define PARODD 0x00000200 /* Odd parity instead of even. */ +#define HUPCL 0x00000400 /* Hang up on last close. */ +#define CLOCAL 0x00000800 /* Ignore modem status lines. */ +#ifdef __USE_BSD +#define LOBLK 0x00001000 +#define CRTSCTS 0x80000000 +#define CIBAUD 0x000f0000 /* Mask for input speed from c_cflag. */ +#define CBAUD 0x0000000f /* Mask for output speed from c_cflag. */ +#define IBSHIFT 16 /* Bits to shift for input speed. */ +#endif + + /* Input and output baud rates. These are encoded in c_cflag. */ +#define B0 0 +#define B50 1 +#define B75 2 +#define B110 3 +#define B134 4 +#define B150 5 +#define B200 6 +#define B300 7 +#define B600 8 +#define B1200 9 +#define B1800 10 +#define B2400 11 +#define B4800 12 +#define B9600 13 +#define B19200 14 +#define B38400 15 +#ifdef __USE_BSD +#define EXTA 14 +#define EXTB 15 +#endif + + /* Local modes. */ + tcflag_t c_lflag; +#ifdef __USE_BSD +#define ECHOKE 0x00000800 /* Visual erase for KILL. */ +#endif +#define ECHOE 0x00000010 /* Visual erase for ERASE. */ +#define ECHOK 0x00000020 /* Echo NL after KILL. */ +#define ECHO 0x00000008 /* Enable echo. */ +#define ECHONL 0x00000040 /* Echo NL even if ECHO is off. */ +#ifdef __USE_BSD +#define ECHOPRT 0x00000400 /* Hardcopy visual erase. */ +#define ECHOCTL 0x00000200 /* Echo control characters as ^X. */ +#endif +#define ISIG 0x00000001 /* Enable signals. */ +#define ICANON 0x00000002 /* Do erase and kill processing. */ +#define IEXTEN 0x00008000 /* Enable DISCARD and LNEXT. */ +#define TOSTOP 0x00000100 /* Send SIGTTOU for background output. */ +#ifdef __USE_BSD +#define PENDIN 0x00004000 /* Retype pending input (state). */ +#endif +#define NOFLSH 0x00000080 /* Disable flush after interrupt. */ + + char c_line; /* Line discipline (?) */ + + /* Control characters. */ +#define VEOF 4 /* End-of-file character [ICANON]. */ +#define VEOL 5 /* End-of-line character [ICANON]. */ +#ifdef __USE_BSD +#define VEOL2 6 /* Second EOL character [ICANON]. */ +#define VSWTCH 7 /* ??? */ +#endif +#define VERASE 2 /* Erase character [ICANON]. */ +#ifdef __USE_BSD +#define VWERASE 14 /* Word-erase character [ICANON]. */ +#endif +#define VKILL 3 /* Kill-line character [ICANON]. */ +#ifdef __USE_BSD +#define VREPRINT 12 /* Reprint-line character [ICANON]. */ +#endif +#define VINTR 0 /* Interrupt character [ISIG]. */ +#define VQUIT 1 /* Quit character [ISIG]. */ +#define VSUSP 10 /* Suspend character [ISIG]. */ +#ifdef __USE_BSD +#define VDSUSP 11 /* Delayed suspend character [ISIG]. */ +#endif +#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */ +#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */ +#ifdef __USE_BSD +#define VLNEXT 15 /* Literal-next character [IEXTEN]. */ +#define VDISCARD 13 /* Discard character [IEXTEN]. */ +#endif +#define VMIN VEOF /* Minimum number of bytes read at once [!ICANON]. */ +#define VTIME VEOL /* Time-out value (tenths of a second) [!ICANON]. */ +#define NCCS 17 + cc_t c_cc[NCCS]; +}; + +#define _IOT_termios /* Hurd ioctl type field. */ \ + _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) + +/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ +#define TCSANOW 0 /* Change immediately. */ +#define TCSADRAIN 1 /* Change when pending output is written. */ +#define TCSAFLUSH 2 /* Flush pending input before changing. */ + +/* Values for the QUEUE_SELECTOR argument to `tcflush'. */ +#define TCIFLUSH 0 /* Discard data received but not yet read. */ +#define TCOFLUSH 1 /* Discard data written but not yet sent. */ +#define TCIOFLUSH 2 /* Discard all pending data. */ + +/* Values for the ACTION argument to `tcflow'. */ +#define TCOOFF 0 /* Suspend output. */ +#define TCOON 1 /* Restart suspended output. */ +#define TCIOFF 2 /* Send a STOP character. */ +#define TCION 3 /* Send a START character. */ diff --git a/sysdeps/unix/bsd/sun/sunos4/bits/utsname.h b/sysdeps/unix/bsd/sun/sunos4/bits/utsname.h new file mode 100644 index 0000000..e9111b6 --- /dev/null +++ b/sysdeps/unix/bsd/sun/sunos4/bits/utsname.h @@ -0,0 +1,2 @@ +#define _UTSNAME_LENGTH 9 +#define _UTSNAME_NODENAME_LENGTH 65 diff --git a/sysdeps/unix/bsd/sun/sunos4/fcntlbits.h b/sysdeps/unix/bsd/sun/sunos4/fcntlbits.h deleted file mode 100644 index a9f66c4..0000000 --- a/sysdeps/unix/bsd/sun/sunos4/fcntlbits.h +++ /dev/null @@ -1,145 +0,0 @@ -/* O_*, F_*, FD_* bit values for SunOS 4. - Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _FCNTLBITS_H - -#define _FCNTLBITS_H 1 - - -/* File access modes for `open' and `fcntl'. */ -#define O_RDONLY 0 /* Open read-only. */ -#define O_WRONLY 1 /* Open write-only. */ -#define O_RDWR 2 /* Open read/write. */ - - -/* Bits OR'd into the second argument to open. */ -#define O_CREAT 0x0200 /* Create file if it doesn't exist. */ -#define O_EXCL 0x0800 /* Fail if file already exists. */ -#define O_TRUNC 0x0400 /* Truncate file to zero length. */ -#define O_NOCTTY 0x8000 /* Don't assign a controlling terminal. */ -#if defined __USE_BSD || defined __USE_SVID -#define O_ASYNC 0x0040 /* Send SIGIO to owner when data is ready. */ -#define O_FSYNC 0x2000 /* Synchronous writes. */ -#define O_SYNC O_FSYNC -#endif - -/* File status flags for `open' and `fcntl'. */ -#define O_APPEND 0x0008 /* Writes append to the file. */ -#define O_NONBLOCK 0x4000 /* Non-blocking I/O. */ - -/* Sun defines O_NDELAY one way for BSD behavior and another for System V - behavior. In the GNU C library, you get the BSD behavior unless you - define _USG_SOURCE without also defining _BSD_SOURCE or _GNU_SOURCE. */ -#ifdef __USE_BSD -#define O_NDELAY 0x0004 -#endif -#if !defined (O_NDELAY) && defined (__USE_SVID) -#define O_NDELAY 0x1000 -#endif - -#ifdef __USE_BSD -/* Bits in the file status flags returned by F_GETFL. - These are all the O_* flags, plus FREAD and FWRITE, which are - independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was - given to `open'. */ -#define FREAD 1 -#define FWRITE 2 - -/* Traditional Unix names the O_* bits. */ -#define FASYNC O_ASYNC -#define FCREAT O_CREAT -#define FEXCL O_EXCL -#define FTRUNC O_TRUNC -#define FNOCTTY O_NOCTTY -#define FFSYNC O_FSYNC -#define FSYNC O_SYNC -#define FAPPEND O_APPEND -#define FNONBLOCK O_NONBLOCK -#define FNONBIO O_NONBLOCK -#define FNDELAY 0x0004 /* BSD O_NDELAY. */ -#define FNBIO 0x1000 /* System V O_NDELAY. */ -#endif - -/* Mask for file access modes. This is system-dependent in case - some system ever wants to define some other flavor of access. */ -#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) - -/* 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. */ -#ifdef __USE_BSD -#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */ -#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */ -#endif -#define F_GETLK 7 /* Get record locking info. */ -#define F_SETLK 8 /* Set record locking info (non-blocking). */ -#define F_SETLKW 9 /* Set record locking info (blocking). */ -#ifdef __USE_BSD -#define F_RGETLK 10 /* Get remote record locking info. */ -#define F_RSETLK 11 /* Set remote locking info (non-blocking). */ -#define F_CNVT 12 /* Convert a fhandle to an open fd. */ -#define F_RSETLKW 13 /* Set remote locking info (blocking). */ -#endif - -/* File descriptor flags used with F_GETFD and F_SETFD. */ -#define FD_CLOEXEC 1 /* Close on exec. */ - - -#include - -/* The structure describing an advisory lock. This is the type of the third - argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ -struct flock - { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ - short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ - __off_t l_start; /* Offset where the lock begins. */ - __off_t l_len; /* Size of the locked area; zero means until EOF. */ - short int l_pid; /* Process holding the lock. */ - short int l_xxx; /* Reserved for future use. */ - }; - -#ifdef __USE_BSD -/* The structure describing a remote advisory lock. This is the type of the - third arg to `fcntl' for the F_RGETLK, F_RSETLK, and F_RSETLKW requests. */ -struct eflock - { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ - short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ - __off_t l_start; /* Offset where the lock begins. */ - __off_t l_len; /* Size of the locked area; zero means until EOF. */ - short int l_pid; /* Process holding the lock. */ - short int l_xxx; /* Reserved for future use. */ - long int l_rpid; /* Remote process ID wanting this lock. */ - long int l_rsys; /* Remote system ID wanting this lock. */ - }; - -#endif - - -/* Values for the `l_type' field of a `struct flock'. */ -#define F_RDLCK 1 /* Read lock. */ -#define F_WRLCK 2 /* Write lock. */ -#define F_UNLCK 3 /* Remove lock. */ - - -#endif /* fcntlbits.h */ diff --git a/sysdeps/unix/bsd/sun/sunos4/resourcebits.h b/sysdeps/unix/bsd/sun/sunos4/resourcebits.h deleted file mode 100644 index ff55773..0000000 --- a/sysdeps/unix/bsd/sun/sunos4/resourcebits.h +++ /dev/null @@ -1,139 +0,0 @@ -/* Bit values for resource limits. SunOS 4 version. - Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* These are the values for 4.4 BSD and GNU. Earlier BSD systems have a - subset of these kinds of resource limit. In systems where `getrlimit' - and `setrlimit' are not system calls, these are the values used by the C - library to emulate them. */ - -/* Kinds of resource limit. */ -enum __rlimit_resource - { - /* Per-process CPU limit, in seconds. */ - RLIMIT_CPU, -#define RLIMIT_CPU RLIMIT_CPU - /* Largest file that can be created, in bytes. */ - RLIMIT_FSIZE, -#define RLIMIT_FSIZE RLIMIT_FSIZE - /* Maximum size of data segment, in bytes. */ - RLIMIT_DATA, -#define RLIMIT_DATA RLIMIT_DATA - /* Maximum size of stack segment, in bytes. */ - RLIMIT_STACK, -#define RLIMIT_STACK RLIMIT_STACK - /* Largest core file that can be created, in bytes. */ - RLIMIT_CORE, -#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, -#define RLIMIT_RSS RLIMIT_RSS - /* Number of open files. */ - RLIMIT_NOFILE, - RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ -#define RLIMIT_NOFILE RLIMIT_NOFILE -#define RLIMIT_OFILE RLIMIT_OFILE - - RLIM_NLIMITS, - - RLIM_INFINITY = 0x7fffffff /* Value to indicate that there is no limit. */ -#define RLIM_INFINITY RLIM_INFINITY - }; - -struct rlimit - { - /* The current (soft) limit. */ - int rlim_cur; - /* The hard limit. */ - int rlim_max; - }; - -/* Whose usage statistics do you want? */ -enum __rusage_who -/* The macro 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. */ - { - /* 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 - }; - -#include /* For `struct timeval'. */ - -/* Structure which says how much of each resource has been used. */ -struct rusage - { - /* Total amount of user time used. */ - struct timeval ru_utime; - /* Total amount of system time used. */ - struct timeval ru_stime; - /* Maximum resident set size (in kilobytes). */ - long int ru_maxrss; - /* Amount of sharing of text segment memory - with other processes (kilobyte-seconds). */ - long int ru_ixrss; - /* Amount of data segment memory used (kilobyte-seconds). */ - long int ru_idrss; - /* Amount of stack memory used (kilobyte-seconds). */ - long int ru_isrss; - /* Number of soft page faults (i.e. those serviced by reclaiming - a page from the list of pages awaiting reallocation. */ - long int ru_minflt; - /* Number of hard page faults (i.e. those that required I/O). */ - long int ru_majflt; - /* Number of times a process was swapped out of physical memory. */ - long int ru_nswap; - /* Number of input operations via the file system. Note: This - and `ru_oublock' do not include operations with the cache. */ - long int ru_inblock; - /* Number of output operations via the file system. */ - long int ru_oublock; - /* Number of IPC messages sent. */ - long int ru_msgsnd; - /* Number of IPC messages received. */ - long int ru_msgrcv; - /* Number of signals delivered. */ - long int ru_nsignals; - /* Number of voluntary context switches, i.e. because the process - gave up the process before it had to (usually to wait for some - resource to be available). */ - long int ru_nvcsw; - /* Number of involuntary context switches, i.e. a higher priority process - became runnable or the current process used up its time slice. */ - long int ru_nivcsw; - }; - -/* 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. */ - PRIO_PGRP = 1, /* WHO is a process group ID. */ - PRIO_USER = 2 /* WHO is a user ID. */ - }; diff --git a/sysdeps/unix/bsd/sun/sunos4/sys/mman.h b/sysdeps/unix/bsd/sun/sunos4/sys/mman.h index fb38c34..65771a2 100644 --- a/sysdeps/unix/bsd/sun/sunos4/sys/mman.h +++ b/sysdeps/unix/bsd/sun/sunos4/sys/mman.h @@ -22,7 +22,7 @@ #define _SYS_MMAN_H 1 #include -#include +#include #define __need_size_t #include diff --git a/sysdeps/unix/bsd/sun/sunos4/termbits.h b/sysdeps/unix/bsd/sun/sunos4/termbits.h deleted file mode 100644 index dc0a007..0000000 --- a/sysdeps/unix/bsd/sun/sunos4/termbits.h +++ /dev/null @@ -1,208 +0,0 @@ -/* termios type and macro definitions. SunOS 4 version. - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* Type of terminal control flag masks. */ -typedef unsigned long int tcflag_t; - -/* Type of control characters. */ -typedef unsigned char cc_t; - -/* Type of baud rate specifiers. */ -typedef unsigned int speed_t; - -/* Terminal control structure. */ -struct termios -{ - /* Input modes. */ - tcflag_t c_iflag; -#define IGNBRK 0x0001 /* Ignore break condition. */ -#define BRKINT 0x0002 /* Signal interrupt on break. */ -#define IGNPAR 0x0004 /* Ignore characters with parity errors. */ -#define PARMRK 0x0008 /* Mark parity and framing errors. */ -#define INPCK 0x0010 /* Enable input parity check. */ -#define ISTRIP 0x0020 /* Strip 8th bit off characters. */ -#define INLCR 0x0040 /* Map NL to CR on input. */ -#define IGNCR 0x0080 /* Ignore CR. */ -#define ICRNL 0x0100 /* Map CR to NL on input. */ -#ifdef __USE_BSD -#define IUCLC 0x0200 /* Map upper case to lower case on input. */ -#endif -#define IXON 0x0400 /* Enable start/stop output control. */ -#define IXOFF 0x1000 /* Enable start/stop input control. */ -#ifdef __USE_BSD -#define IXANY 0x0800 /* Any character will restart after stop. */ -#define IMAXBEL 0x2000 /* Ring bell when input queue is full. */ -#endif - - /* Output modes. */ - tcflag_t c_oflag; -#define OPOST 0x0001 /* Perform output processing. */ -#ifdef __USE_BSD -#define OLCUC 0x00000002 /* Map lower case to upper case on output. */ -#define ONLCR 0x00000004 /* Map NL to CR-NL on output. */ -#define OCRNL 0x00000008 -#define ONOCR 0x00000010 -#define ONLRET 0x00000020 -#define OFILL 0x00000040 -#define OFDEL 0x00000080 -#define NLDLY 0x00000100 -#define NL0 0 -#define NL1 0x00000100 -#define CRDLY 0x00000600 -#define CR0 0 -#define CR1 0x00000200 -#define CR2 0x00000400 -#define CR3 0x00000600 -#define TABDLY 0x00001800 -#define TAB0 0 -#define TAB1 0x00000800 -#define TAB2 0x00001000 -#define XTABS 0x00001800 -#define TAB3 XTABS -#define BSDLY 0x00002000 -#define BS0 0 -#define BS1 0x00002000 -#define VTDLY 0x00004000 -#define VT0 0 -#define VT1 0x00004000 -#define FFDLY 0x00008000 -#define FF0 0 -#define FF1 0x00008000 -#define PAGEOUT 0x00010000 -#define WRAP 0x00020000 -#endif - - /* Control modes. */ - tcflag_t c_cflag; -#define CSIZE (CS5|CS6|CS7|CS8) /* Number of bits per byte (mask). */ -#define CS5 0 /* 5 bits per byte. */ -#define CS6 0x00000010 /* 6 bits per byte. */ -#define CS7 0x00000020 /* 7 bits per byte. */ -#define CS8 0x00000030 /* 8 bits per byte. */ -#define CSTOPB 0x00000040 /* Two stop bits instead of one. */ -#define CREAD 0x00000080 /* Enable receiver. */ -#define PARENB 0x00000100 /* Parity enable. */ -#define PARODD 0x00000200 /* Odd parity instead of even. */ -#define HUPCL 0x00000400 /* Hang up on last close. */ -#define CLOCAL 0x00000800 /* Ignore modem status lines. */ -#ifdef __USE_BSD -#define LOBLK 0x00001000 -#define CRTSCTS 0x80000000 -#define CIBAUD 0x000f0000 /* Mask for input speed from c_cflag. */ -#define CBAUD 0x0000000f /* Mask for output speed from c_cflag. */ -#define IBSHIFT 16 /* Bits to shift for input speed. */ -#endif - - /* Input and output baud rates. These are encoded in c_cflag. */ -#define B0 0 -#define B50 1 -#define B75 2 -#define B110 3 -#define B134 4 -#define B150 5 -#define B200 6 -#define B300 7 -#define B600 8 -#define B1200 9 -#define B1800 10 -#define B2400 11 -#define B4800 12 -#define B9600 13 -#define B19200 14 -#define B38400 15 -#ifdef __USE_BSD -#define EXTA 14 -#define EXTB 15 -#endif - - /* Local modes. */ - tcflag_t c_lflag; -#ifdef __USE_BSD -#define ECHOKE 0x00000800 /* Visual erase for KILL. */ -#endif -#define ECHOE 0x00000010 /* Visual erase for ERASE. */ -#define ECHOK 0x00000020 /* Echo NL after KILL. */ -#define ECHO 0x00000008 /* Enable echo. */ -#define ECHONL 0x00000040 /* Echo NL even if ECHO is off. */ -#ifdef __USE_BSD -#define ECHOPRT 0x00000400 /* Hardcopy visual erase. */ -#define ECHOCTL 0x00000200 /* Echo control characters as ^X. */ -#endif -#define ISIG 0x00000001 /* Enable signals. */ -#define ICANON 0x00000002 /* Do erase and kill processing. */ -#define IEXTEN 0x00008000 /* Enable DISCARD and LNEXT. */ -#define TOSTOP 0x00000100 /* Send SIGTTOU for background output. */ -#ifdef __USE_BSD -#define PENDIN 0x00004000 /* Retype pending input (state). */ -#endif -#define NOFLSH 0x00000080 /* Disable flush after interrupt. */ - - char c_line; /* Line discipline (?) */ - - /* Control characters. */ -#define VEOF 4 /* End-of-file character [ICANON]. */ -#define VEOL 5 /* End-of-line character [ICANON]. */ -#ifdef __USE_BSD -#define VEOL2 6 /* Second EOL character [ICANON]. */ -#define VSWTCH 7 /* ??? */ -#endif -#define VERASE 2 /* Erase character [ICANON]. */ -#ifdef __USE_BSD -#define VWERASE 14 /* Word-erase character [ICANON]. */ -#endif -#define VKILL 3 /* Kill-line character [ICANON]. */ -#ifdef __USE_BSD -#define VREPRINT 12 /* Reprint-line character [ICANON]. */ -#endif -#define VINTR 0 /* Interrupt character [ISIG]. */ -#define VQUIT 1 /* Quit character [ISIG]. */ -#define VSUSP 10 /* Suspend character [ISIG]. */ -#ifdef __USE_BSD -#define VDSUSP 11 /* Delayed suspend character [ISIG]. */ -#endif -#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */ -#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */ -#ifdef __USE_BSD -#define VLNEXT 15 /* Literal-next character [IEXTEN]. */ -#define VDISCARD 13 /* Discard character [IEXTEN]. */ -#endif -#define VMIN VEOF /* Minimum number of bytes read at once [!ICANON]. */ -#define VTIME VEOL /* Time-out value (tenths of a second) [!ICANON]. */ -#define NCCS 17 - cc_t c_cc[NCCS]; -}; - -#define _IOT_termios /* Hurd ioctl type field. */ \ - _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) - -/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ -#define TCSANOW 0 /* Change immediately. */ -#define TCSADRAIN 1 /* Change when pending output is written. */ -#define TCSAFLUSH 2 /* Flush pending input before changing. */ - -/* Values for the QUEUE_SELECTOR argument to `tcflush'. */ -#define TCIFLUSH 0 /* Discard data received but not yet read. */ -#define TCOFLUSH 1 /* Discard data written but not yet sent. */ -#define TCIOFLUSH 2 /* Discard all pending data. */ - -/* Values for the ACTION argument to `tcflow'. */ -#define TCOOFF 0 /* Suspend output. */ -#define TCOON 1 /* Restart suspended output. */ -#define TCIOFF 2 /* Send a STOP character. */ -#define TCION 3 /* Send a START character. */ diff --git a/sysdeps/unix/bsd/sun/sunos4/utsnamelen.h b/sysdeps/unix/bsd/sun/sunos4/utsnamelen.h deleted file mode 100644 index e9111b6..0000000 --- a/sysdeps/unix/bsd/sun/sunos4/utsnamelen.h +++ /dev/null @@ -1,2 +0,0 @@ -#define _UTSNAME_LENGTH 9 -#define _UTSNAME_NODENAME_LENGTH 65 diff --git a/sysdeps/unix/bsd/ultrix4/bits/fcntl.h b/sysdeps/unix/bsd/ultrix4/bits/fcntl.h new file mode 100644 index 0000000..1398b81 --- /dev/null +++ b/sysdeps/unix/bsd/ultrix4/bits/fcntl.h @@ -0,0 +1,122 @@ +/* O_*, F_*, FD_* bit values for Ultrix 4. + Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FCNTL_H +#error "Never use directly; include instead." +#endif + + +/* File access modes for `open' and `fcntl'. */ +#define O_RDONLY 0 /* Open read-only. */ +#define O_WRONLY 1 /* Open write-only. */ +#define O_RDWR 2 /* Open read/write. */ + + +/* Bits OR'd into the second argument to open. */ +#define O_CREAT 0x0200 /* Create file if it doesn't exist. */ +#define O_EXCL 0x0800 /* Fail if file already exists. */ +#define O_TRUNC 0x0400 /* Truncate file to zero length. */ +#ifdef __USE_MISC +#define O_ASYNC 0x0040 /* Send SIGIO to owner when data is ready. */ +#define O_FSYNC 0x8000 /* Synchronous writes. */ +#define O_SYNC O_FSYNC +#define O_BLKINUSE 0x1000 /* Block if "in use". */ +#define O_BLKANDSET 0x3000 /* Block, test and set "in use" flag. */ +#define O_TERMIO 0x40000 /* "termio style program". */ +#endif +#define O_NOCTTY 0x80000 /* Don't assign a controlling terminal. */ + +/* File status flags for `open' and `fcntl'. */ +#define O_APPEND 0x0008 /* Writes append to the file. */ +#define O_NONBLOCK 0x20000 /* Non-blocking I/O. */ + +#ifdef __USE_BSD +#define O_NDELAY 0x0004 +#endif + +#ifdef __USE_BSD +/* Bits in the file status flags returned by F_GETFL. + These are all the O_* flags, plus FREAD and FWRITE, which are + independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was + given to `open'. */ +#define FREAD 1 +#define FWRITE 2 + +/* Traditional BSD names the O_* bits. */ +#define FASYNC O_ASYNC +#define FCREAT O_CREAT +#define FEXCL O_EXCL +#define FTRUNC O_TRUNC +#define FNOCTTY O_NOCTTY +#define FFSYNC O_FSYNC +#define FSYNC O_SYNC +#define FAPPEND O_APPEND +#define FNONBLOCK O_NONBLOCK +#define FNDELAY O_NDELAY +#define FNBLOCK O_NONBLOCK +#define FTERMIO O_TERMIO +#define FNOCTTY O_NOCTTY +#define FSYNCRON O_FSYNC +#define FBLKINUSE O_BLKINUSE +#define FBLKANDSET O_BLKANDSET +#endif + +/* Mask for file access modes. This is system-dependent in case + some system ever wants to define some other flavor of access. */ +#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) + +/* 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. */ +#ifdef __USE_BSD +#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */ +#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */ +#endif +#define F_GETLK 7 /* Get record locking info. */ +#define F_SETLK 8 /* Set record locking info (non-blocking). */ +#define F_SETLKW 9 /* Set record locking info (blocking). */ +#ifdef __USE_MISC +#define F_SETSYN 10 /* Set synchronous writing. */ +#define F_CLRSYN 10 /* Clear synchronous writing. */ +#endif + +/* File descriptor flags used with F_GETFD and F_SETFD. */ +#define FD_CLOEXEC 1 /* Close on exec. */ + + +#include + +/* The structure describing an advisory lock. This is the type of the third + argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + }; + +/* Values for the `l_type' field of a `struct flock'. */ +#define F_RDLCK 1 /* Read lock. */ +#define F_WRLCK 2 /* Write lock. */ +#define F_UNLCK 3 /* Remove lock. */ diff --git a/sysdeps/unix/bsd/ultrix4/bits/posix_opt.h b/sysdeps/unix/bsd/ultrix4/bits/posix_opt.h new file mode 100644 index 0000000..ecd04d1 --- /dev/null +++ b/sysdeps/unix/bsd/ultrix4/bits/posix_opt.h @@ -0,0 +1,23 @@ +/* Copyright (C) 1992 Free Software Foundation, Inc. + Contributed by Ian Lance Taylor (ian@airs.com). + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#define _POSIX_JOB_CONTROL 1 +#define _POSIX_SAVED_IDS 1 +#define _POSIX_CHOWN_RESTRICTED 1 +#define _POSIX_NO_TRUNC 1 +#define _POSIX_VDISABLE ((unsigned char) -1) diff --git a/sysdeps/unix/bsd/ultrix4/bits/utsname.h b/sysdeps/unix/bsd/ultrix4/bits/utsname.h new file mode 100644 index 0000000..ad4389a --- /dev/null +++ b/sysdeps/unix/bsd/ultrix4/bits/utsname.h @@ -0,0 +1 @@ +#define _UTSNAME_LENGTH 32 diff --git a/sysdeps/unix/bsd/ultrix4/fcntlbits.h b/sysdeps/unix/bsd/ultrix4/fcntlbits.h deleted file mode 100644 index ba736e4..0000000 --- a/sysdeps/unix/bsd/ultrix4/fcntlbits.h +++ /dev/null @@ -1,125 +0,0 @@ -/* O_*, F_*, FD_* bit values for Ultrix 4. - Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _FCNTLBITS_H - -#define _FCNTLBITS_H 1 - - -/* File access modes for `open' and `fcntl'. */ -#define O_RDONLY 0 /* Open read-only. */ -#define O_WRONLY 1 /* Open write-only. */ -#define O_RDWR 2 /* Open read/write. */ - - -/* Bits OR'd into the second argument to open. */ -#define O_CREAT 0x0200 /* Create file if it doesn't exist. */ -#define O_EXCL 0x0800 /* Fail if file already exists. */ -#define O_TRUNC 0x0400 /* Truncate file to zero length. */ -#ifdef __USE_MISC -#define O_ASYNC 0x0040 /* Send SIGIO to owner when data is ready. */ -#define O_FSYNC 0x8000 /* Synchronous writes. */ -#define O_SYNC O_FSYNC -#define O_BLKINUSE 0x1000 /* Block if "in use". */ -#define O_BLKANDSET 0x3000 /* Block, test and set "in use" flag. */ -#define O_TERMIO 0x40000 /* "termio style program". */ -#endif -#define O_NOCTTY 0x80000 /* Don't assign a controlling terminal. */ - -/* File status flags for `open' and `fcntl'. */ -#define O_APPEND 0x0008 /* Writes append to the file. */ -#define O_NONBLOCK 0x20000 /* Non-blocking I/O. */ - -#ifdef __USE_BSD -#define O_NDELAY 0x0004 -#endif - -#ifdef __USE_BSD -/* Bits in the file status flags returned by F_GETFL. - These are all the O_* flags, plus FREAD and FWRITE, which are - independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was - given to `open'. */ -#define FREAD 1 -#define FWRITE 2 - -/* Traditional BSD names the O_* bits. */ -#define FASYNC O_ASYNC -#define FCREAT O_CREAT -#define FEXCL O_EXCL -#define FTRUNC O_TRUNC -#define FNOCTTY O_NOCTTY -#define FFSYNC O_FSYNC -#define FSYNC O_SYNC -#define FAPPEND O_APPEND -#define FNONBLOCK O_NONBLOCK -#define FNDELAY O_NDELAY -#define FNBLOCK O_NONBLOCK -#define FTERMIO O_TERMIO -#define FNOCTTY O_NOCTTY -#define FSYNCRON O_FSYNC -#define FBLKINUSE O_BLKINUSE -#define FBLKANDSET O_BLKANDSET -#endif - -/* Mask for file access modes. This is system-dependent in case - some system ever wants to define some other flavor of access. */ -#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) - -/* 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. */ -#ifdef __USE_BSD -#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */ -#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */ -#endif -#define F_GETLK 7 /* Get record locking info. */ -#define F_SETLK 8 /* Set record locking info (non-blocking). */ -#define F_SETLKW 9 /* Set record locking info (blocking). */ -#ifdef __USE_MISC -#define F_SETSYN 10 /* Set synchronous writing. */ -#define F_CLRSYN 10 /* Clear synchronous writing. */ -#endif - -/* File descriptor flags used with F_GETFD and F_SETFD. */ -#define FD_CLOEXEC 1 /* Close on exec. */ - - -#include - -/* The structure describing an advisory lock. This is the type of the third - argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ -struct flock - { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ - short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ - __off_t l_start; /* Offset where the lock begins. */ - __off_t l_len; /* Size of the locked area; zero means until EOF. */ - __pid_t l_pid; /* Process holding the lock. */ - }; - -/* Values for the `l_type' field of a `struct flock'. */ -#define F_RDLCK 1 /* Read lock. */ -#define F_WRLCK 2 /* Write lock. */ -#define F_UNLCK 3 /* Remove lock. */ - - -#endif /* fcntlbits.h */ diff --git a/sysdeps/unix/bsd/ultrix4/mips/bits/sigcontext.h b/sysdeps/unix/bsd/ultrix4/mips/bits/sigcontext.h new file mode 100644 index 0000000..4bddcf2 --- /dev/null +++ b/sysdeps/unix/bsd/ultrix4/mips/bits/sigcontext.h @@ -0,0 +1,60 @@ +/* Copyright (C) 1992, 1994 Free Software Foundation, Inc. + Contributed by Brendan Kehoe (brendan@zen.org). + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* Note that ANY change to this instantly implies a change to __handler.S. */ + +struct sigcontext + { + /* Nonzero if running on signal stack. */ + int sc_onstack; + + /* Signal mask to restore. */ + __sigset_t sc_mask; + + /* Program counter when the signal hit. */ + __ptr_t sc_pc; + + /* Registers 0 through 31. */ + int sc_regs[32]; + + /* mul/div low and hi; these aren't part of a jmp_buf, but are part of the + sigcontext and are referenced from the signal trampoline code. */ + int sc_mdlo; + int sc_mdhi; + + /* Flag to see if the FP's been used. */ + int sc_ownedfp; + + /* Floating point registers 0 to 31. */ + int sc_fpregs[32]; + /* Control & status register for FP. */ + int sc_fpc_csr; + + /* Exception instruction register for FP. */ + int sc_fpc_eir; + + /* The coprocessor's cause register. */ + int sc_cause; + + /* CPU bad virtual address. */ + __ptr_t sc_badvaddr; + + /* CPU board bad physical address. */ + __ptr_t sc_badpaddr; + }; + diff --git a/sysdeps/unix/bsd/ultrix4/mips/sigcontext.h b/sysdeps/unix/bsd/ultrix4/mips/sigcontext.h deleted file mode 100644 index 4bddcf2..0000000 --- a/sysdeps/unix/bsd/ultrix4/mips/sigcontext.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 1992, 1994 Free Software Foundation, Inc. - Contributed by Brendan Kehoe (brendan@zen.org). - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* Note that ANY change to this instantly implies a change to __handler.S. */ - -struct sigcontext - { - /* Nonzero if running on signal stack. */ - int sc_onstack; - - /* Signal mask to restore. */ - __sigset_t sc_mask; - - /* Program counter when the signal hit. */ - __ptr_t sc_pc; - - /* Registers 0 through 31. */ - int sc_regs[32]; - - /* mul/div low and hi; these aren't part of a jmp_buf, but are part of the - sigcontext and are referenced from the signal trampoline code. */ - int sc_mdlo; - int sc_mdhi; - - /* Flag to see if the FP's been used. */ - int sc_ownedfp; - - /* Floating point registers 0 to 31. */ - int sc_fpregs[32]; - /* Control & status register for FP. */ - int sc_fpc_csr; - - /* Exception instruction register for FP. */ - int sc_fpc_eir; - - /* The coprocessor's cause register. */ - int sc_cause; - - /* CPU bad virtual address. */ - __ptr_t sc_badvaddr; - - /* CPU board bad physical address. */ - __ptr_t sc_badpaddr; - }; - diff --git a/sysdeps/unix/bsd/ultrix4/posix_opt.h b/sysdeps/unix/bsd/ultrix4/posix_opt.h deleted file mode 100644 index ecd04d1..0000000 --- a/sysdeps/unix/bsd/ultrix4/posix_opt.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright (C) 1992 Free Software Foundation, Inc. - Contributed by Ian Lance Taylor (ian@airs.com). - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#define _POSIX_JOB_CONTROL 1 -#define _POSIX_SAVED_IDS 1 -#define _POSIX_CHOWN_RESTRICTED 1 -#define _POSIX_NO_TRUNC 1 -#define _POSIX_VDISABLE ((unsigned char) -1) diff --git a/sysdeps/unix/bsd/ultrix4/sys/mman.h b/sysdeps/unix/bsd/ultrix4/sys/mman.h index 2d3c8fe..989bf21 100644 --- a/sysdeps/unix/bsd/ultrix4/sys/mman.h +++ b/sysdeps/unix/bsd/ultrix4/sys/mman.h @@ -22,7 +22,7 @@ #define _SYS_MMAN_H 1 #include -#include +#include #define __need_size_t #include diff --git a/sysdeps/unix/bsd/ultrix4/utsnamelen.h b/sysdeps/unix/bsd/ultrix4/utsnamelen.h deleted file mode 100644 index ad4389a..0000000 --- a/sysdeps/unix/bsd/ultrix4/utsnamelen.h +++ /dev/null @@ -1 +0,0 @@ -#define _UTSNAME_LENGTH 32 diff --git a/sysdeps/unix/bsd/vax/sysdep.S b/sysdeps/unix/bsd/vax/sysdep.S index 618d889..b5b76aa 100644 --- a/sysdeps/unix/bsd/vax/sysdep.S +++ b/sysdeps/unix/bsd/vax/sysdep.S @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define _ERRNO_H -#include +#include .globl _errno .globl syscall_error diff --git a/sysdeps/unix/bsd/waitflags.h b/sysdeps/unix/bsd/waitflags.h deleted file mode 100644 index 00a1520..0000000 --- a/sysdeps/unix/bsd/waitflags.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Definitions of flag bits for `waitpid' et al. Hurd version. - Copyright (C) 1992, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _WAITFLAGS_H - -#define _WAITFLAGS_H 1 - -/* Bits in the third argument to `waitpid'. */ -#define WNOHANG 1 /* Don't block waiting. */ -#define WUNTRACED 2 /* Report status of stopped children. */ -#ifdef __USE_GNU -#define WNOREAP 4 /* Don't remove record of child reported. */ -#endif - -#endif /* waitflags.h */ diff --git a/sysdeps/unix/common/bits/dirent.h b/sysdeps/unix/common/bits/dirent.h new file mode 100644 index 0000000..aa06547 --- /dev/null +++ b/sysdeps/unix/common/bits/dirent.h @@ -0,0 +1,29 @@ +/* Directory entry structure `struct dirent'. SVR4/Linux version. +Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +struct dirent + { + unsigned int d_fileno; + int d_off; /* Position in directory of following entry. */ + unsigned short int d_reclen; + char d_name[1]; /* Variable length. */ + }; + +#define _DIRENT_HAVE_D_RECLEN 1 +#define _DIRENT_HAVE_D_OFF 1 diff --git a/sysdeps/unix/common/bits/fcntl.h b/sysdeps/unix/common/bits/fcntl.h new file mode 100644 index 0000000..31f213e --- /dev/null +++ b/sysdeps/unix/common/bits/fcntl.h @@ -0,0 +1,119 @@ +/* O_*, F_*, FD_* bit values for general Unix system. + Copyright (C) 1991, 1992, 1995, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FCNTL_H +#error "Never use directly; include instead." +#endif + + +/* File access modes for `open' and `fcntl'. */ +#define O_RDONLY 0 /* Open read-only. */ +#define O_WRONLY 1 /* Open write-only. */ +#define O_RDWR 2 /* Open read/write. */ + + +/* Bits OR'd into the second argument to open. */ +#define O_CREAT 0x0100 /* Create file if it doesn't exist. */ +#define O_EXCL 0x0400 /* Fail if file already exists. */ +#define O_TRUNC 0x0200 /* Truncate file to zero length. */ +#define O_NOCTTY 0x0800 /* Don't assign a controlling terminal. */ +#ifdef __USE_MISC +#define O_ASYNC 0x0040 /* Send SIGIO to owner when data is ready. */ +#define O_FSYNC 0x0010 /* Synchronous writes. */ +#define O_SYNC O_FSYNC +#endif + +/* File status flags for `open' and `fcntl'. */ +#define O_APPEND 0x0008 /* Writes append to the file. */ +#define O_NONBLOCK 0x0080 /* Non-blocking I/O. */ + +#ifdef __USE_MISC +#define O_NDELAY 0x0004 +#endif + +#ifdef __USE_MISC +/* Bits in the file status flags returned by F_GETFL. + These are all the O_* flags, plus FREAD and FWRITE, which are + independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was + given to `open'. */ +#define FREAD 1 +#define FWRITE 2 + +/* Traditional Unix names the O_* bits. */ +#define FASYNC O_ASYNC +#define FCREAT O_CREAT +#define FEXCL O_EXCL +#define FTRUNC O_TRUNC +#define FNOCTTY O_NOCTTY +#define FFSYNC O_FSYNC +#define FSYNC O_SYNC +#define FAPPEND O_APPEND +#define FNONBLOCK O_NONBLOCK +#define FNONBIO O_NONBLOCK +#define FNDELAY O_NDELAY +#endif + +/* Mask for file access modes. This is system-dependent in case + some system ever wants to define some other flavor of access. */ +#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) + +/* 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. */ +#ifdef __USE_BSD +#define F_GETOWN 23 /* Get owner (receiver of SIGIO). */ +#define F_SETOWN 24 /* Set owner (receiver of SIGIO). */ +#endif +#define F_GETLK 14 /* Get record locking info. */ +#define F_SETLK 6 /* Set record locking info (non-blocking). */ +#define F_SETLKW 7 /* Set record locking info (blocking). */ +#ifdef __USE_SVID +#define F_ALLOCSP 10 /* Allocate space in the file. */ +#define F_FREESP 11 /* Free space in the file. */ +#define F_RGETLK 20 /* Get remote record locking info. */ +#define F_RSETLK 21 /* Set remote locking info (non-blocking). */ +#define F_RSETLKW 22 /* Set remote locking info (blocking). */ +#endif + +/* File descriptor flags used with F_GETFD and F_SETFD. */ +#define FD_CLOEXEC 1 /* Close on exec. */ + + +#include + +/* The structure describing an advisory lock. This is the type of the third + argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ + long int l_sysid; /* System ID where locking process resides. */ + __pid_t l_pid; /* Process holding the lock. */ + long int pad[4]; /* Reserved for future use. */ + }; + +/* Values for the `l_type' field of a `struct flock'. */ +#define F_RDLCK 1 /* Read lock. */ +#define F_WRLCK 2 /* Write lock. */ +#define F_UNLCK 3 /* Remove lock. */ diff --git a/sysdeps/unix/common/direntry.h b/sysdeps/unix/common/direntry.h deleted file mode 100644 index aa06547..0000000 --- a/sysdeps/unix/common/direntry.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Directory entry structure `struct dirent'. SVR4/Linux version. -Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -struct dirent - { - unsigned int d_fileno; - int d_off; /* Position in directory of following entry. */ - unsigned short int d_reclen; - char d_name[1]; /* Variable length. */ - }; - -#define _DIRENT_HAVE_D_RECLEN 1 -#define _DIRENT_HAVE_D_OFF 1 diff --git a/sysdeps/unix/common/fcntlbits.h b/sysdeps/unix/common/fcntlbits.h deleted file mode 100644 index e416e0d..0000000 --- a/sysdeps/unix/common/fcntlbits.h +++ /dev/null @@ -1,122 +0,0 @@ -/* O_*, F_*, FD_* bit values for general Unix system. - Copyright (C) 1991, 1992, 1995, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _FCNTLBITS_H - -#define _FCNTLBITS_H 1 - - -/* File access modes for `open' and `fcntl'. */ -#define O_RDONLY 0 /* Open read-only. */ -#define O_WRONLY 1 /* Open write-only. */ -#define O_RDWR 2 /* Open read/write. */ - - -/* Bits OR'd into the second argument to open. */ -#define O_CREAT 0x0100 /* Create file if it doesn't exist. */ -#define O_EXCL 0x0400 /* Fail if file already exists. */ -#define O_TRUNC 0x0200 /* Truncate file to zero length. */ -#define O_NOCTTY 0x0800 /* Don't assign a controlling terminal. */ -#ifdef __USE_MISC -#define O_ASYNC 0x0040 /* Send SIGIO to owner when data is ready. */ -#define O_FSYNC 0x0010 /* Synchronous writes. */ -#define O_SYNC O_FSYNC -#endif - -/* File status flags for `open' and `fcntl'. */ -#define O_APPEND 0x0008 /* Writes append to the file. */ -#define O_NONBLOCK 0x0080 /* Non-blocking I/O. */ - -#ifdef __USE_MISC -#define O_NDELAY 0x0004 -#endif - -#ifdef __USE_MISC -/* Bits in the file status flags returned by F_GETFL. - These are all the O_* flags, plus FREAD and FWRITE, which are - independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was - given to `open'. */ -#define FREAD 1 -#define FWRITE 2 - -/* Traditional Unix names the O_* bits. */ -#define FASYNC O_ASYNC -#define FCREAT O_CREAT -#define FEXCL O_EXCL -#define FTRUNC O_TRUNC -#define FNOCTTY O_NOCTTY -#define FFSYNC O_FSYNC -#define FSYNC O_SYNC -#define FAPPEND O_APPEND -#define FNONBLOCK O_NONBLOCK -#define FNONBIO O_NONBLOCK -#define FNDELAY O_NDELAY -#endif - -/* Mask for file access modes. This is system-dependent in case - some system ever wants to define some other flavor of access. */ -#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) - -/* 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. */ -#ifdef __USE_BSD -#define F_GETOWN 23 /* Get owner (receiver of SIGIO). */ -#define F_SETOWN 24 /* Set owner (receiver of SIGIO). */ -#endif -#define F_GETLK 14 /* Get record locking info. */ -#define F_SETLK 6 /* Set record locking info (non-blocking). */ -#define F_SETLKW 7 /* Set record locking info (blocking). */ -#ifdef __USE_SVID -#define F_ALLOCSP 10 /* Allocate space in the file. */ -#define F_FREESP 11 /* Free space in the file. */ -#define F_RGETLK 20 /* Get remote record locking info. */ -#define F_RSETLK 21 /* Set remote locking info (non-blocking). */ -#define F_RSETLKW 22 /* Set remote locking info (blocking). */ -#endif - -/* File descriptor flags used with F_GETFD and F_SETFD. */ -#define FD_CLOEXEC 1 /* Close on exec. */ - - -#include - -/* The structure describing an advisory lock. This is the type of the third - argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ -struct flock - { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ - short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ - __off_t l_start; /* Offset where the lock begins. */ - __off_t l_len; /* Size of the locked area; zero means until EOF. */ - long int l_sysid; /* System ID where locking process resides. */ - __pid_t l_pid; /* Process holding the lock. */ - long int pad[4]; /* Reserved for future use. */ - }; - -/* Values for the `l_type' field of a `struct flock'. */ -#define F_RDLCK 1 /* Read lock. */ -#define F_WRLCK 2 /* Write lock. */ -#define F_UNLCK 3 /* Remove lock. */ - - -#endif /* fcntlbits.h */ diff --git a/sysdeps/unix/dirstream.h b/sysdeps/unix/dirstream.h index cbbdb6b..424627e 100644 --- a/sysdeps/unix/dirstream.h +++ b/sysdeps/unix/dirstream.h @@ -22,7 +22,7 @@ #include -#include +#include /* Directory stream type. diff --git a/sysdeps/unix/i386/sysdep.S b/sysdeps/unix/i386/sysdep.S index a65589d..b296bb7 100644 --- a/sysdeps/unix/i386/sysdep.S +++ b/sysdeps/unix/i386/sysdep.S @@ -18,7 +18,7 @@ #include #define _ERRNO_H -#include +#include .globl C_SYMBOL_NAME(errno) .globl syscall_error diff --git a/sysdeps/unix/mips/sysdep.S b/sysdeps/unix/mips/sysdep.S index f17ba44..1791801 100644 --- a/sysdeps/unix/mips/sysdep.S +++ b/sysdeps/unix/mips/sysdep.S @@ -18,7 +18,7 @@ Cambridge, MA 02139, USA. */ #include #define _ERRNO_H -#include +#include /* .globl errno */ .set noreorder diff --git a/sysdeps/unix/mk-local_lim.c b/sysdeps/unix/mk-local_lim.c index b2212ee..27dfbc2 100644 --- a/sysdeps/unix/mk-local_lim.c +++ b/sysdeps/unix/mk-local_lim.c @@ -31,7 +31,8 @@ Cambridge, MA 02139, USA. */ #include #endif -/* Generate local_lim.h from the values defined in the system's headers. */ +/* Generate bits/local_lim.h from the values defined in the system's + headers. */ struct param { diff --git a/sysdeps/unix/sparc/sysdep.S b/sysdeps/unix/sparc/sysdep.S index d04a778..5eea069 100644 --- a/sysdeps/unix/sparc/sysdep.S +++ b/sysdeps/unix/sparc/sysdep.S @@ -18,7 +18,7 @@ Cambridge, MA 02139, USA. */ #include #define _ERRNO_H -#include +#include .global C_SYMBOL_NAME(errno) .global syscall_error diff --git a/sysdeps/unix/sysv/bits/dirent.h b/sysdeps/unix/sysv/bits/dirent.h new file mode 100644 index 0000000..5035f14 --- /dev/null +++ b/sysdeps/unix/sysv/bits/dirent.h @@ -0,0 +1,24 @@ +/* Directory entry structure `struct dirent'. Old System V version. +Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +struct dirent + { + unsigned short int d_fileno; + char d_name[14]; + }; diff --git a/sysdeps/unix/sysv/bits/fcntl.h b/sysdeps/unix/sysv/bits/fcntl.h new file mode 100644 index 0000000..22863ff --- /dev/null +++ b/sysdeps/unix/sysv/bits/fcntl.h @@ -0,0 +1,94 @@ +/* O_*, F_*, FD_* bit values for System V. + Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FCNTL_H +#error "Never use directly; include instead." +#endif + + +/* File access modes for `open' and `fcntl'. */ +#define O_RDONLY 0 /* Open read-only. */ +#define O_WRONLY 1 /* Open write-only. */ +#define O_RDWR 2 /* Open read/write. */ + + +/* Bits OR'd into the second argument to open. */ +#define O_CREAT 00400 /* Create file if it doesn't exist. */ +#define O_EXCL 02000 /* Fail if file already exists. */ +#define O_TRUNC 01000 /* Truncate file to zero length. */ +#if defined __USE_BSD || defined __USE_SVID +#define O_SYNC 00020 /* Synchronous writes. */ +#define O_FSYNC O_SYNC +#endif + +/* File status flags for `open' and `fcntl'. */ +#define O_APPEND 000010 /* Writes append to the file. */ +#define O_NONBLOCK 000004 /* Non-blocking I/O. */ + +#ifdef __USE_BSD +/* System V doesn't support POSIX.1 O_NONBLOCK, but O_NDELAY is close. */ +#define O_NDELAY O_NONBLOCK +#endif + +/* Mask for file access modes. This is system-dependent in case + some system ever wants to define some other flavor of access. */ +#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) + +/* 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. */ +#define F_GETLK 5 /* Get record locking info. */ +#define F_SETLK 6 /* Set record locking info. */ +#define F_SETLKW 7 /* Set record locking info, wait. */ + +/* File descriptor flags used with F_GETFD and F_SETFD. */ +#define FD_CLOEXEC 1 /* Close on exec. */ + + +#include + +/* The structure describing an advisory lock. This is the type of the third + argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ + short int l_sysid; /* System ID where locking process resides. */ + short int l_pid; /* Process holding the lock. */ + }; + +/* Values for the `l_type' field of a `struct flock'. */ +#define F_RDLCK 1 /* Read lock. */ +#define F_WRLCK 2 /* Write lock. */ +#define F_UNLCK 3 /* Remove lock. */ + + +/* Define some more compatibility macros to be backward compatible with + BSD systems which did not managed to hide these kernel macros. */ +#ifdef __USE_BSD +#define FAPPEND O_APPEND +#define FFSYNC O_FSYNC +#define FNONBLOCK O_NONBLOCK +#define FNDELAY O_NDELAY +#endif /* Use BSD. */ diff --git a/sysdeps/unix/sysv/bits/local_lim.h b/sysdeps/unix/sysv/bits/local_lim.h new file mode 100644 index 0000000..a370928 --- /dev/null +++ b/sysdeps/unix/sysv/bits/local_lim.h @@ -0,0 +1,32 @@ +/* Copyright (C) 1992, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#define NGROUPS_MAX 0 /* No supplementary groups. */ +#define ARG_MAX 5120 +#define CHILD_MAX 25 +#define OPEN_MAX 60 +#define LINK_MAX 1000 +#define MAX_CANON 256 + +/* For SVR3, this is 14. For SVR4, it is 255, at least on ufs + file systems, even though the System V limits.h incorrectly + defines it as 14. Giving it a value which is too large + is harmless (it is a maximum). */ +#define NAME_MAX 255 + +#define PATH_MAX 1024 diff --git a/sysdeps/unix/sysv/bits/signum.h b/sysdeps/unix/sysv/bits/signum.h new file mode 100644 index 0000000..088ca2a --- /dev/null +++ b/sysdeps/unix/sysv/bits/signum.h @@ -0,0 +1,56 @@ +/* Signal number definitions. System V version. + Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifdef _SIGNAL_H + +/* This file defines the fake signal functions and signal + number constants for System V release 3. */ + +/* Fake signal functions. */ +#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ +#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ +#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ + + +/* Signals. */ +#define SIGHUP 1 /* Hangup (POSIX). */ +#define SIGINT 2 /* Interrupt (ANSI). */ +#define SIGQUIT 3 /* Quit (POSIX). */ +#define SIGILL 4 /* Illegal instruction (ANSI). */ +#define SIGABRT SIGIOT /* Abort (ANSI). */ +#define SIGTRAP 5 /* Trace trap (POSIX). */ +#define SIGIOT 6 /* IOT trap (4.2 BSD). */ +#define SIGEMT 7 /* EMT trap (4.2 BSD). */ +#define SIGFPE 8 /* Floating-point exception (ANSI). */ +#define SIGKILL 9 /* Kill, unblockable (POSIX). */ +#define SIGBUS 10 /* Bus error (4.2 BSD). */ +#define SIGSEGV 11 /* Segmentation violation (ANSI). */ +#define SIGSYS 12 /* Bad argument to system call (4.2 BSD)*/ +#define SIGPIPE 13 /* Broken pipe (POSIX). */ +#define SIGALRM 14 /* Alarm clock (POSIX). */ +#define SIGTERM 15 /* Termination (ANSI). */ +#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */ +#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */ +#define SIGCHLD 18 /* Child status has changed (POSIX). */ +#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ +#define SIGPWR 19 /* Power failure restart (System V). */ + +#endif /* included. */ + +#define _NSIG 20 /* Biggest signal number + 1. */ diff --git a/sysdeps/unix/sysv/bits/stat.h b/sysdeps/unix/sysv/bits/stat.h new file mode 100644 index 0000000..56f4544 --- /dev/null +++ b/sysdeps/unix/sysv/bits/stat.h @@ -0,0 +1,65 @@ +/* Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H 1 + +struct stat + { + short int st_dev; + unsigned short int st_ino; + unsigned short int st_mode; + short int st_nlink; + unsigned short int st_uid; + unsigned short int st_gid; + short int st_rdev; + long int st_size; + long int st_atime; + long int st_mtime; + long int st_ctime; + }; + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFIFO 0010000 /* FIFO. */ + +/* These don't actually exist on System V, but having them doesn't hurt. */ +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + +#endif /* bits/stat.h */ diff --git a/sysdeps/unix/sysv/bits/utmp.h b/sysdeps/unix/sysv/bits/utmp.h new file mode 100644 index 0000000..1bb1a55 --- /dev/null +++ b/sysdeps/unix/sysv/bits/utmp.h @@ -0,0 +1,57 @@ +/* The `struct utmp' type, describing entries in the utmp file. System V. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _UTMP_H +#error "Never use directly; include instead." +#endif + + +#include + +#define _PATH_UTMP "/var/adm/utmp" +#define _PATH_WTMP "/var/adm/wtmp" +#define _PATH_LASTLOG "/var/adm/lastlog" + +__BEGIN_DECLS + +struct utmp + { +#define ut_name ut_user + char ut_user[8]; + char ut_id[4]; + char ut_line[12]; + short ut_pid; + short ut_type; + struct exit_status + { + short e_termination; + short e_exit; + } ut_exit; + time_t ut_time; + }; + + +/* Tell the user that we have a modern system with UT_HOST, UT_TYPE, UT_ID + and UT_TV fields. */ +#define _HAVE_UT_TYPE 1 +#define _HAVE_UT_ID 1 +#define _HAVE_UT_TV 1 +#define _HAVE_UT_HOST 1 + +__END_DECLS diff --git a/sysdeps/unix/sysv/bits/utsname.h b/sysdeps/unix/sysv/bits/utsname.h new file mode 100644 index 0000000..31473cf --- /dev/null +++ b/sysdeps/unix/sysv/bits/utsname.h @@ -0,0 +1 @@ +#define _UTSNAME_LENGTH 9 diff --git a/sysdeps/unix/sysv/direntry.h b/sysdeps/unix/sysv/direntry.h deleted file mode 100644 index 5035f14..0000000 --- a/sysdeps/unix/sysv/direntry.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Directory entry structure `struct dirent'. Old System V version. -Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -struct dirent - { - unsigned short int d_fileno; - char d_name[14]; - }; diff --git a/sysdeps/unix/sysv/fcntlbits.h b/sysdeps/unix/sysv/fcntlbits.h deleted file mode 100644 index 7f38422..0000000 --- a/sysdeps/unix/sysv/fcntlbits.h +++ /dev/null @@ -1,96 +0,0 @@ -/* O_*, F_*, FD_* bit values for System V. - Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _FCNTLBITS_H - -#define _FCNTLBITS_H 1 - - -/* File access modes for `open' and `fcntl'. */ -#define O_RDONLY 0 /* Open read-only. */ -#define O_WRONLY 1 /* Open write-only. */ -#define O_RDWR 2 /* Open read/write. */ - - -/* Bits OR'd into the second argument to open. */ -#define O_CREAT 00400 /* Create file if it doesn't exist. */ -#define O_EXCL 02000 /* Fail if file already exists. */ -#define O_TRUNC 01000 /* Truncate file to zero length. */ -#if defined __USE_BSD || defined __USE_SVID -#define O_SYNC 00020 /* Synchronous writes. */ -#define O_FSYNC O_SYNC -#endif - -/* File status flags for `open' and `fcntl'. */ -#define O_APPEND 000010 /* Writes append to the file. */ -#define O_NONBLOCK 000004 /* Non-blocking I/O. */ - -#ifdef __USE_BSD -/* System V doesn't support POSIX.1 O_NONBLOCK, but O_NDELAY is close. */ -#define O_NDELAY O_NONBLOCK -#endif - -/* Mask for file access modes. This is system-dependent in case - some system ever wants to define some other flavor of access. */ -#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) - -/* 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. */ -#define F_GETLK 5 /* Get record locking info. */ -#define F_SETLK 6 /* Set record locking info. */ -#define F_SETLKW 7 /* Set record locking info, wait. */ - -/* File descriptor flags used with F_GETFD and F_SETFD. */ -#define FD_CLOEXEC 1 /* Close on exec. */ - - -#include - -/* The structure describing an advisory lock. This is the type of the third - argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ -struct flock - { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ - short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ - __off_t l_start; /* Offset where the lock begins. */ - __off_t l_len; /* Size of the locked area; zero means until EOF. */ - short int l_sysid; /* System ID where locking process resides. */ - short int l_pid; /* Process holding the lock. */ - }; - -/* Values for the `l_type' field of a `struct flock'. */ -#define F_RDLCK 1 /* Read lock. */ -#define F_WRLCK 2 /* Write lock. */ -#define F_UNLCK 3 /* Remove lock. */ - - -/* Define some more compatibility macros to be backward compatible with - BSD systems which did not managed to hide these kernel macros. */ -#ifdef __USE_BSD -#define FAPPEND O_APPEND -#define FFSYNC O_FSYNC -#define FNONBLOCK O_NONBLOCK -#define FNDELAY O_NDELAY -#endif /* Use BSD. */ - -#endif /* fcntlbits.h */ diff --git a/sysdeps/unix/sysv/irix4/bits/confname.h b/sysdeps/unix/sysv/irix4/bits/confname.h new file mode 100644 index 0000000..49d2f9c --- /dev/null +++ b/sysdeps/unix/sysv/irix4/bits/confname.h @@ -0,0 +1,80 @@ +/* `sysconf', `pathconf', and `confstr' NAME values. Irix 4 version. +Copyright (C) 1994 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 Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* Values for the NAME argument to `pathconf' and `fpathconf'. */ +enum + { + _PC_LINK_MAX = 1, + _PC_MAX_CANON, + _PC_MAX_INPUT, + _PC_NAME_MAX, + _PC_PATH_MAX, + _PC_PIPE_BUF, + _PC_CHOWN_RESTRICTED, + _PC_NO_TRUNC, + _PC_VDISABLE + }; + +/* Values for the argument to `sysconf'. */ +enum + { + _SC_ARG_MAX = 1, + _SC_CHILD_MAX, + _SC_CLK_TCK, + _SC_NGROUPS_MAX, + _SC_OPEN_MAX, + _SC_JOB_CONTROL, + _SC_SAVED_IDS, + _SC_VERSION, + + /* Above are done by the Irix system call. + The rest are done by the C library (or are not really implemented). */ + + _SC_STREAM_MAX, + _SC_TZNAME_MAX, + _SC_PAGESIZE, + + /* Values for the argument to `sysconf' + corresponding to _POSIX2_* symbols. */ + _SC_BC_BASE_MAX, + _SC_BC_DIM_MAX, + _SC_BC_SCALE_MAX, + _SC_BC_STRING_MAX, + _SC_COLL_WEIGHTS_MAX, + _SC_EQUIV_CLASS_MAX, + _SC_EXPR_NEST_MAX, + _SC_LINE_MAX, + _SC_RE_DUP_MAX, + + _SC_2_VERSION, + _SC_2_C_BIND, + _SC_2_C_DEV, + _SC_2_FORT_DEV, + _SC_2_FORT_RUN, + _SC_2_SW_DEV, + _SC_2_LOCALEDEF + }; + +#ifdef __USE_POSIX2 +/* Values for the NAME argument to `confstr'. */ +enum + { + _CS_PATH /* The default search path. */ + }; +#endif diff --git a/sysdeps/unix/sysv/irix4/bits/fcntl.h b/sysdeps/unix/sysv/irix4/bits/fcntl.h new file mode 100644 index 0000000..a926d04 --- /dev/null +++ b/sysdeps/unix/sysv/irix4/bits/fcntl.h @@ -0,0 +1,107 @@ +/* O_*, F_*, FD_* bit values for SGI Irix 4. + Copyright (C) 1994, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FCNTL_H +#error "Never use directly; include instead." +#endif + + +/* File access modes for `open' and `fcntl'. */ +#define O_RDONLY 0 /* Open read-only. */ +#define O_WRONLY 1 /* Open write-only. */ +#define O_RDWR 2 /* Open read/write. */ + + +/* Bits OR'd into the second argument to open. */ +#define O_CREAT 00400 /* Create file if it doesn't exist. */ +#define O_EXCL 02000 /* Fail if file already exists. */ +#define O_TRUNC 01000 /* Truncate file to zero length. */ +#ifdef __USE_MISC +#define O_SYNC 00020 /* Synchronous writes. */ +#define O_FSYNC O_SYNC +#define O_ASYNC 00100 /* Send SIGIO to owner when data is ready. */ +#endif + +/* File status flags for `open' and `fcntl'. */ +#define O_APPEND 000010 /* Writes append to the file. */ +#ifdef __USE_BSD +#define O_NDELAY 000004 /* Non-blocking I/O. */ +#endif +#define O_NONBLOCK 000200 /* POSIX.1 non-blocking I/O. */ + +/* Mask for file access modes. This is system-dependent in case + some system ever wants to define some other flavor of access. */ +#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) + +/* 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. */ +#define F_GETLK 5 /* Get record locking info. */ +#define F_SETLK 6 /* Set record locking info. */ +#define F_SETLKW 7 /* Set record locking info, wait. */ +#ifdef __USE_MISC +#define F_CHKFL 8 /* Check legality of file flag changes. */ +#define F_ALLOCSP 10 +#define F_FREESP 11 +#define F_SETBSDLK 12 /* Set Berkeley record lock. */ +#define F_SETBSDLKW 13 /* Set Berkeley record lock and wait. */ +#define F_RGETLK 20 /* Get info on a remote lock. */ +#define F_RSETLK 21 /* Set or unlock a remote lock. */ +#define F_RSETLKW 22 /* Set or unlock a remote lock and wait. */ +#define F_GETOWN 10 /* Get owner; only works on sockets. */ +#define F_SETOWN 11 /* Set owner; only works on sockets. */ +#endif + + +/* File descriptor flags used with F_GETFD and F_SETFD. */ +#define FD_CLOEXEC 1 /* Close on exec. */ + + +#include + +/* The structure describing an advisory lock. This is the type of the third + argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ + short int l_sysid; /* System ID where locking process resides. */ + short int l_pid; /* Process holding the lock. */ + }; + +/* Values for the `l_type' field of a `struct flock'. */ +#define F_RDLCK 1 /* Read lock. */ +#define F_WRLCK 2 /* Write lock. */ +#define F_UNLCK 3 /* Remove lock. */ + + +/* Define some more compatibility macros to be backward compatible with + BSD systems which did not managed to hide these kernel macros. */ +#ifdef __USE_BSD +#define FAPPEND O_APPEND +#define FFSYNC O_FSYNC +#define FASYNC O_ASYNC +#define FNONBLOCK O_NONBLOCK +#define FNDELAY O_NDELAY +#endif /* Use BSD. */ diff --git a/sysdeps/unix/sysv/irix4/bits/signum.h b/sysdeps/unix/sysv/irix4/bits/signum.h new file mode 100644 index 0000000..13314cf --- /dev/null +++ b/sysdeps/unix/sysv/irix4/bits/signum.h @@ -0,0 +1,68 @@ +/* Signal number definitions. Irix4 version. + Copyright (C) 1994, 1996 Free Software Foundation, Inc. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifdef _SIGNAL_H + +/* This file defines the fake signal functions and signal + number constants for SGI Irix 4. */ + +/* Fake signal functions. */ +#define SIG_ERR ((__sighandler_t) -1) +#define SIG_DFL ((__sighandler_t) 0) +#define SIG_IGN ((__sighandler_t) 1) + + +/* Signals. */ +#define SIGHUP 1 /* Hangup (POSIX). */ +#define SIGINT 2 /* Interrupt (ANSI). */ +#define SIGQUIT 3 /* Quit (POSIX). */ +#define SIGILL 4 /* Illegal instruction (ANSI). */ +#define SIGABRT SIGIOT /* Abort (ANSI). */ +#define SIGTRAP 5 /* Trace trap (POSIX). */ +#define SIGIOT 6 /* IOT trap. */ +#define SIGEMT 7 /* EMT trap. */ +#define SIGFPE 8 /* Floating-point exception (ANSI). */ +#define SIGKILL 9 /* Kill, unblockable (POSIX). */ +#define SIGBUS 10 /* Bus error. */ +#define SIGSEGV 11 /* Segmentation violation (ANSI). */ +#define SIGSYS 12 /* Bad argument to system call*/ +#define SIGPIPE 13 /* Broken pipe (POSIX). */ +#define SIGALRM 14 /* Alarm clock (POSIX). */ +#define SIGTERM 15 /* Termination (ANSI). */ +#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */ +#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */ +#define SIGCHLD 18 /* Child status has changed (POSIX). */ +#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ +#define SIGPWR 19 /* Power going down. */ +#define SIGSTOP 20 /* Stop, unblockable (POSIX). */ +#define SIGTSTP 21 /* Keyboard stop (POSIX). */ +#define SIGPOLL 22 /* Same as SIGIO? (SVID). */ +#define SIGIO 23 /* I/O now possible. */ +#define SIGURG 24 /* Urgent condition on socket.*/ +#define SIGWINCH 25 /* Window size change. */ +#define SIGVTALRM 26 /* Virtual alarm clock. */ +#define SIGPROF 27 /* Profiling alarm clock. */ +#define SIGCONT 28 /* Continue (POSIX). */ +#define SIGTTIN 29 /* Background read from tty (POSIX). */ +#define SIGTTOU 30 /* Background write to tty (POSIX). */ +#define SIGXCPU 31 /* CPU limit exceeded. */ +#define SIGXFSZ 32 /* File size limit exceeded. */ + +#endif /* included. */ + +#define _NSIG 33 /* Biggest signal number + 1. */ diff --git a/sysdeps/unix/sysv/irix4/bits/stat.h b/sysdeps/unix/sysv/irix4/bits/stat.h new file mode 100644 index 0000000..0dab45c --- /dev/null +++ b/sysdeps/unix/sysv/irix4/bits/stat.h @@ -0,0 +1,65 @@ +/* Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H 1 + +struct stat + { + unsigned long st_ino; + short int st_dev; + unsigned short int st_mode; + short int st_nlink; + unsigned short int st_uid; + unsigned short int st_gid; + short int st_rdev; + long int st_size; + long int st_atime; + long int st_mtime; + long int st_ctime; + }; + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFIFO 0010000 /* FIFO. */ + +/* These don't actually exist on System V, but having them doesn't hurt. */ +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + +#endif /* bits/stat.h */ diff --git a/sysdeps/unix/sysv/irix4/confname.h b/sysdeps/unix/sysv/irix4/confname.h deleted file mode 100644 index 49d2f9c..0000000 --- a/sysdeps/unix/sysv/irix4/confname.h +++ /dev/null @@ -1,80 +0,0 @@ -/* `sysconf', `pathconf', and `confstr' NAME values. Irix 4 version. -Copyright (C) 1994 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 Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* Values for the NAME argument to `pathconf' and `fpathconf'. */ -enum - { - _PC_LINK_MAX = 1, - _PC_MAX_CANON, - _PC_MAX_INPUT, - _PC_NAME_MAX, - _PC_PATH_MAX, - _PC_PIPE_BUF, - _PC_CHOWN_RESTRICTED, - _PC_NO_TRUNC, - _PC_VDISABLE - }; - -/* Values for the argument to `sysconf'. */ -enum - { - _SC_ARG_MAX = 1, - _SC_CHILD_MAX, - _SC_CLK_TCK, - _SC_NGROUPS_MAX, - _SC_OPEN_MAX, - _SC_JOB_CONTROL, - _SC_SAVED_IDS, - _SC_VERSION, - - /* Above are done by the Irix system call. - The rest are done by the C library (or are not really implemented). */ - - _SC_STREAM_MAX, - _SC_TZNAME_MAX, - _SC_PAGESIZE, - - /* Values for the argument to `sysconf' - corresponding to _POSIX2_* symbols. */ - _SC_BC_BASE_MAX, - _SC_BC_DIM_MAX, - _SC_BC_SCALE_MAX, - _SC_BC_STRING_MAX, - _SC_COLL_WEIGHTS_MAX, - _SC_EQUIV_CLASS_MAX, - _SC_EXPR_NEST_MAX, - _SC_LINE_MAX, - _SC_RE_DUP_MAX, - - _SC_2_VERSION, - _SC_2_C_BIND, - _SC_2_C_DEV, - _SC_2_FORT_DEV, - _SC_2_FORT_RUN, - _SC_2_SW_DEV, - _SC_2_LOCALEDEF - }; - -#ifdef __USE_POSIX2 -/* Values for the NAME argument to `confstr'. */ -enum - { - _CS_PATH /* The default search path. */ - }; -#endif diff --git a/sysdeps/unix/sysv/irix4/fcntlbits.h b/sysdeps/unix/sysv/irix4/fcntlbits.h deleted file mode 100644 index 318e483..0000000 --- a/sysdeps/unix/sysv/irix4/fcntlbits.h +++ /dev/null @@ -1,110 +0,0 @@ -/* O_*, F_*, FD_* bit values for SGI Irix 4. - Copyright (C) 1994, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _FCNTLBITS_H - -#define _FCNTLBITS_H 1 - - -/* File access modes for `open' and `fcntl'. */ -#define O_RDONLY 0 /* Open read-only. */ -#define O_WRONLY 1 /* Open write-only. */ -#define O_RDWR 2 /* Open read/write. */ - - -/* Bits OR'd into the second argument to open. */ -#define O_CREAT 00400 /* Create file if it doesn't exist. */ -#define O_EXCL 02000 /* Fail if file already exists. */ -#define O_TRUNC 01000 /* Truncate file to zero length. */ -#ifdef __USE_MISC -#define O_SYNC 00020 /* Synchronous writes. */ -#define O_FSYNC O_SYNC -#define O_ASYNC 00100 /* Send SIGIO to owner when data is ready. */ -#endif - -/* File status flags for `open' and `fcntl'. */ -#define O_APPEND 000010 /* Writes append to the file. */ -#ifdef __USE_BSD -#define O_NDELAY 000004 /* Non-blocking I/O. */ -#endif -#define O_NONBLOCK 000200 /* POSIX.1 non-blocking I/O. */ - -/* Mask for file access modes. This is system-dependent in case - some system ever wants to define some other flavor of access. */ -#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) - -/* 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. */ -#define F_GETLK 5 /* Get record locking info. */ -#define F_SETLK 6 /* Set record locking info. */ -#define F_SETLKW 7 /* Set record locking info, wait. */ -#ifdef __USE_MISC -#define F_CHKFL 8 /* Check legality of file flag changes. */ -#define F_ALLOCSP 10 -#define F_FREESP 11 -#define F_SETBSDLK 12 /* Set Berkeley record lock. */ -#define F_SETBSDLKW 13 /* Set Berkeley record lock and wait. */ -#define F_RGETLK 20 /* Get info on a remote lock. */ -#define F_RSETLK 21 /* Set or unlock a remote lock. */ -#define F_RSETLKW 22 /* Set or unlock a remote lock and wait. */ -#define F_GETOWN 10 /* Get owner; only works on sockets. */ -#define F_SETOWN 11 /* Set owner; only works on sockets. */ -#endif - - -/* File descriptor flags used with F_GETFD and F_SETFD. */ -#define FD_CLOEXEC 1 /* Close on exec. */ - - -#include - -/* The structure describing an advisory lock. This is the type of the third - argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ -struct flock - { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ - short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ - __off_t l_start; /* Offset where the lock begins. */ - __off_t l_len; /* Size of the locked area; zero means until EOF. */ - short int l_sysid; /* System ID where locking process resides. */ - short int l_pid; /* Process holding the lock. */ - }; - -/* Values for the `l_type' field of a `struct flock'. */ -#define F_RDLCK 1 /* Read lock. */ -#define F_WRLCK 2 /* Write lock. */ -#define F_UNLCK 3 /* Remove lock. */ - - -/* Define some more compatibility macros to be backward compatible with - BSD systems which did not managed to hide these kernel macros. */ -#ifdef __USE_BSD -#define FAPPEND O_APPEND -#define FFSYNC O_FSYNC -#define FASYNC O_ASYNC -#define FNONBLOCK O_NONBLOCK -#define FNDELAY O_NDELAY -#endif /* Use BSD. */ - - -#endif /* fcntlbits.h */ diff --git a/sysdeps/unix/sysv/irix4/signum.h b/sysdeps/unix/sysv/irix4/signum.h deleted file mode 100644 index 13314cf..0000000 --- a/sysdeps/unix/sysv/irix4/signum.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Signal number definitions. Irix4 version. - Copyright (C) 1994, 1996 Free Software Foundation, Inc. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef _SIGNAL_H - -/* This file defines the fake signal functions and signal - number constants for SGI Irix 4. */ - -/* Fake signal functions. */ -#define SIG_ERR ((__sighandler_t) -1) -#define SIG_DFL ((__sighandler_t) 0) -#define SIG_IGN ((__sighandler_t) 1) - - -/* Signals. */ -#define SIGHUP 1 /* Hangup (POSIX). */ -#define SIGINT 2 /* Interrupt (ANSI). */ -#define SIGQUIT 3 /* Quit (POSIX). */ -#define SIGILL 4 /* Illegal instruction (ANSI). */ -#define SIGABRT SIGIOT /* Abort (ANSI). */ -#define SIGTRAP 5 /* Trace trap (POSIX). */ -#define SIGIOT 6 /* IOT trap. */ -#define SIGEMT 7 /* EMT trap. */ -#define SIGFPE 8 /* Floating-point exception (ANSI). */ -#define SIGKILL 9 /* Kill, unblockable (POSIX). */ -#define SIGBUS 10 /* Bus error. */ -#define SIGSEGV 11 /* Segmentation violation (ANSI). */ -#define SIGSYS 12 /* Bad argument to system call*/ -#define SIGPIPE 13 /* Broken pipe (POSIX). */ -#define SIGALRM 14 /* Alarm clock (POSIX). */ -#define SIGTERM 15 /* Termination (ANSI). */ -#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */ -#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */ -#define SIGCHLD 18 /* Child status has changed (POSIX). */ -#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ -#define SIGPWR 19 /* Power going down. */ -#define SIGSTOP 20 /* Stop, unblockable (POSIX). */ -#define SIGTSTP 21 /* Keyboard stop (POSIX). */ -#define SIGPOLL 22 /* Same as SIGIO? (SVID). */ -#define SIGIO 23 /* I/O now possible. */ -#define SIGURG 24 /* Urgent condition on socket.*/ -#define SIGWINCH 25 /* Window size change. */ -#define SIGVTALRM 26 /* Virtual alarm clock. */ -#define SIGPROF 27 /* Profiling alarm clock. */ -#define SIGCONT 28 /* Continue (POSIX). */ -#define SIGTTIN 29 /* Background read from tty (POSIX). */ -#define SIGTTOU 30 /* Background write to tty (POSIX). */ -#define SIGXCPU 31 /* CPU limit exceeded. */ -#define SIGXFSZ 32 /* File size limit exceeded. */ - -#endif /* included. */ - -#define _NSIG 33 /* Biggest signal number + 1. */ diff --git a/sysdeps/unix/sysv/irix4/statbuf.h b/sysdeps/unix/sysv/irix4/statbuf.h deleted file mode 100644 index 579ccec..0000000 --- a/sysdeps/unix/sysv/irix4/statbuf.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (C) 1992, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _STATBUF_H -#define _STATBUF_H 1 - -struct stat - { - unsigned long st_ino; - short int st_dev; - unsigned short int st_mode; - short int st_nlink; - unsigned short int st_uid; - unsigned short int st_gid; - short int st_rdev; - long int st_size; - long int st_atime; - long int st_mtime; - long int st_ctime; - }; - -/* Encoding of the file mode. */ - -#define __S_IFMT 0170000 /* These bits determine file type. */ - -/* File types. */ -#define __S_IFDIR 0040000 /* Directory. */ -#define __S_IFCHR 0020000 /* Character device. */ -#define __S_IFBLK 0060000 /* Block device. */ -#define __S_IFREG 0100000 /* Regular file. */ -#define __S_IFIFO 0010000 /* FIFO. */ - -/* These don't actually exist on System V, but having them doesn't hurt. */ -#define __S_IFLNK 0120000 /* Symbolic link. */ -#define __S_IFSOCK 0140000 /* Socket. */ - -/* Protection bits. */ - -#define __S_ISUID 04000 /* Set user ID on execution. */ -#define __S_ISGID 02000 /* Set group ID on execution. */ -#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ -#define __S_IREAD 0400 /* Read by owner. */ -#define __S_IWRITE 0200 /* Write by owner. */ -#define __S_IEXEC 0100 /* Execute by owner. */ - -#endif /* statbuf.h */ diff --git a/sysdeps/unix/sysv/irix4/sys/mman.h b/sysdeps/unix/sysv/irix4/sys/mman.h index 9ceca1f..f42a9f6 100644 --- a/sysdeps/unix/sysv/irix4/sys/mman.h +++ b/sysdeps/unix/sysv/irix4/sys/mman.h @@ -22,7 +22,7 @@ #define _SYS_MMAN_H 1 #include -#include +#include #define __need_size_t #include diff --git a/sysdeps/unix/sysv/linux/Dist b/sysdeps/unix/sysv/linux/Dist index ae79600..5370085 100644 --- a/sysdeps/unix/sysv/linux/Dist +++ b/sysdeps/unix/sysv/linux/Dist @@ -2,8 +2,10 @@ cmsg_nxthdr.c init-first.h kernel_sigaction.h kernel_stat.h +kernel_termios.h llseek.c siglist.h +socketcall.h sysctl.c termio.h net/ethernet.h @@ -30,14 +32,12 @@ sys/debugreg.h sys/io.h sys/kd.h sys/kdaemon.h -sys/kernel_termios.h sys/klog.h sys/module.h sys/mount.h sys/mtio.h sys/procfs.h sys/quota.h -sys/socketcall.h sys/socketvar.h sys/soundcard.h sys/sysctl.h diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 7255a69..42f6463 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -36,7 +36,7 @@ sysdep_headers += sys/timex.h endif ifeq ($(subdir),socket) -sysdep_headers += sys/socketcall.h net/if.h net/if_ppp.h net/ppp-comp.h \ +sysdep_headers += net/if.h net/if_ppp.h net/ppp-comp.h \ net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \ net/if_slip.h sysdep_routines += cmsg_nxthdr @@ -47,7 +47,7 @@ sysdep_headers += nfs/nfs.h endif ifeq ($(subdir),termios) -sysdep_headers += termio.h sys/kernel_termios.h +sysdep_headers += termio.h endif ifeq ($(subdir),stdio-common) diff --git a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h new file mode 100644 index 0000000..b70502f --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h @@ -0,0 +1,100 @@ +/* O_*, F_*, FD_* bit values for Linux. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FCNTL_H +#error "Never use directly; include instead." +#endif + + +#include + + +/* In GNU, read and write are bits (unlike BSD). */ +#ifdef __USE_GNU +#define O_READ O_RDONLY /* Open for reading. */ +#define O_WRITE O_WRONLY /* Open for writing. */ +#endif +/* open/fcntl - O_SYNC is only implemented on blocks devices and on files + located on an ext2 file system */ +#define O_ACCMODE 0003 +#define O_RDONLY 00 +#define O_WRONLY 01 +#define O_RDWR 02 +#define O_CREAT 01000 /* not fcntl */ +#define O_TRUNC 02000 /* not fcntl */ +#define O_EXCL 04000 /* not fcntl */ +#define O_NOCTTY 010000 /* not fcntl */ + +#define O_NONBLOCK 00004 +#define O_APPEND 00010 +#define O_NDELAY O_NONBLOCK +#define O_SYNC 040000 +#define O_FSYNC O_SYNC +#define O_ASYNC 020000 /* fcntl, for BSD compatibility */ + +#define F_DUPFD 0 /* dup */ +#define F_GETFD 1 /* get f_flags */ +#define F_SETFD 2 /* set f_flags */ +#define F_GETFL 3 /* more flags (cloexec) */ +#define F_SETFL 4 +#define F_GETLK 7 +#define F_SETLK 8 +#define F_SETLKW 9 + +#define F_SETOWN 5 /* for sockets. */ +#define F_GETOWN 6 /* for sockets. */ + +/* for F_[GET|SET]FL */ +#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ + +/* for posix fcntl() and lockf() */ +#define F_RDLCK 1 +#define F_WRLCK 2 +#define F_UNLCK 8 + +/* for old implementation of bsd flock () */ +#define F_EXLCK 16 /* or 3 */ +#define F_SHLCK 32 /* or 4 */ + +/* 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 */ + +struct flock + { + short int l_type; + short int l_whence; + __off_t l_start; + __off_t l_len; + __pid_t l_pid; + }; + + +/* Define some more compatibility macros to be backward compatible with + BSD systems which did not managed to hide these kernel macros. */ +#ifdef __USE_BSD +#define FAPPEND O_APPEND +#define FFSYNC O_FSYNC +#define FASYNC O_ASYNC +#define FNONBLOCK O_NONBLOCK +#define FNDELAY O_NDELAY +#endif /* Use BSD. */ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/ioctls.h b/sysdeps/unix/sysv/linux/alpha/bits/ioctls.h new file mode 100644 index 0000000..8a14f99 --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/bits/ioctls.h @@ -0,0 +1,43 @@ +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_IOCTLS_H +#define _BITS_IOCTLS_H 1 + +/* Use the definitions from the kernel header files. */ +#include +#include + +/* Oh well, this is necessary since the kernel data structure is + different from the user-level version. */ +#undef TCGETS +#undef TCSETS +#undef TCSETSW +#undef TCSETSF +#define TCGETS _IOR ('t', 19, struct __kernel_termios) +#define TCSETS _IOW ('t', 20, struct __kernel_termios) +#define TCSETSW _IOW ('t', 21, struct __kernel_termios) +#define TCSETSF _IOW ('t', 22, struct __kernel_termios) + +#include + +#endif /* bits/ioctls.h */ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/ipc.h b/sysdeps/unix/sysv/linux/alpha/bits/ipc.h new file mode 100644 index 0000000..57830da --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/bits/ipc.h @@ -0,0 +1,85 @@ +/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , August 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_IPC_BUF_H + +#define _SYS_IPC_BUF_H 1 +#include + +#include + +/* 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. */ +#define IPC_INFO 3 /* See ipcs. */ + + +__BEGIN_DECLS + +/* 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. */ + unsigned int uid; /* Owner's user ID. */ + unsigned int gid; /* Owner's group ID. */ + unsigned int cuid; /* Creator's user ID. */ + unsigned int cgid; /* Creator's group ID. */ + unsigned int mode; /* Read/write permission. */ + unsigned short int __seq; /* Sequence number. */ + }; + + +/* Kludge to work around Linux' restriction of only up to five + arguments to a system call. */ +struct ipc_kludge + { + void *msgp; + long int msgtyp; + }; + +/* The actual system call: all functions are multiplexed by this. */ +extern int __ipc __P ((int __call, int __first, int __second, int __third, + void *__ptr)); + +/* The codes for the functions to use the multiplexer `__ipc'. */ +#define IPCOP_semop 1 +#define IPCOP_semget 2 +#define IPCOP_semctl 3 +#define IPCOP_msgsnd 11 +#define IPCOP_msgrcv 12 +#define IPCOP_msgget 13 +#define IPCOP_msgctl 14 +#define IPCOP_shmat 21 +#define IPCOP_shmdt 22 +#define IPCOP_shmget 23 +#define IPCOP_shmctl 24 + +__END_DECLS + +#endif /* _SYS_IPC_BUF_H */ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h b/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h new file mode 100644 index 0000000..57ce5e6 --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h @@ -0,0 +1,51 @@ +/* The proper definitions for Linux/Alpha sigaction. +Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Structure describing the action to be taken when a signal arrives. */ +struct sigaction + { + /* Signal handler. */ + __sighandler_t sa_handler; + + /* Additional set of signals to be blocked. */ + __sigset_t sa_mask; + + /* Special flags. */ + unsigned int sa_flags; + }; + +/* Bits in `sa_flags'. */ +#define SA_NOCLDSTOP 0x00000004 /* Don't send SIGCHLD when children stop. */ +#ifdef __USE_MISC +#define SA_STACK 0x00000001 /* Use signal stack by using `sa_restorer'. */ +#define SA_RESTART 0x00000002 /* Don't restart syscall on signal return. */ +#define SA_INTERRUPT 0x20000000 /* Historical no-op. */ +#define SA_NOMASK 0x00000008 /* Don't automatically block the signal when + its handler is being executed. */ +#define SA_ONESHOT 0x00000010 /* Reset to SIG_DFL on entry to handler. */ + +/* Some aliases for the SA_ constants. */ +#define SA_NODEFER SA_NOMASK +#define SA_RESETHAND SA_ONESHOT +#endif + +/* Values for the HOW argument to `sigprocmask'. */ +#define SIG_BLOCK 1 /* Block signals. */ +#define SIG_UNBLOCK 2 /* Unblock signals. */ +#define SIG_SETMASK 3 /* Set the set of blocked signals. */ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/signum.h b/sysdeps/unix/sysv/linux/alpha/bits/signum.h new file mode 100644 index 0000000..be6132d --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/bits/signum.h @@ -0,0 +1,69 @@ +/* Signal number definitions. Linux/Alpha version. +Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#ifdef _SIGNAL_H + +/* Fake signal functions. */ +#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ +#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ +#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ + +/* + * Linux/AXP has different signal numbers that Linux/i386: I'm trying + * to make it OSF/1 binary compatible, at least for normal binaries. + */ +#define SIGHUP 1 +#define SIGINT 2 +#define SIGQUIT 3 +#define SIGILL 4 +#define SIGTRAP 5 +#define SIGABRT 6 +#define SIGEMT 7 +#define SIGFPE 8 +#define SIGKILL 9 +#define SIGBUS 10 +#define SIGSEGV 11 +#define SIGSYS 12 +#define SIGPIPE 13 +#define SIGALRM 14 +#define SIGTERM 15 +#define SIGURG 16 +#define SIGSTOP 17 +#define SIGTSTP 18 +#define SIGCONT 19 +#define SIGCHLD 20 +#define SIGTTIN 21 +#define SIGTTOU 22 +#define SIGIO 23 +#define SIGXCPU 24 +#define SIGXFSZ 25 +#define SIGVTALRM 26 +#define SIGPROF 27 +#define SIGWINCH 28 +#define SIGINFO 29 +#define SIGUSR1 30 +#define SIGUSR2 31 + +#define SIGPOLL SIGIO +#define SIGPWR SIGINFO +#define SIGIOT SIGABRT + +#define _NSIG 32 /* Biggest signal number + 1. */ + +#endif /* included. */ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/stat.h b/sysdeps/unix/sysv/linux/alpha/bits/stat.h new file mode 100644 index 0000000..768b819 --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/bits/stat.h @@ -0,0 +1,78 @@ +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H 1 + +/* Versions of the `struct stat' data structure. */ +#define _STAT_VER_LINUX_OLD 0 +#define _STAT_VER_LINUX 1 +#define _STAT_VER _STAT_VER_LINUX + +/* Versions of the `xmknod' interface. */ +#define _MKNOD_VER_LINUX 0 + +struct stat + { + __dev_t st_dev; /* Device. */ + __ino_t st_ino; /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + __off_t st_size; /* Size of file, in bytes. */ + __time_t st_atime; /* Time of last access. */ + __time_t st_mtime; /* Time of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned int st_blksize; /* Optimal block size for I/O. */ +#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */ + int st_blocks; /* Nr. of 512-byte blocks allocated. */ + unsigned int st_flags; + unsigned int st_gen; + }; + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFIFO 0010000 /* FIFO. */ + +/* These don't actually exist on System V, but having them doesn't hurt. */ +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + +#endif /* bits/stat.h */ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/sysdeps/unix/sysv/linux/alpha/bits/termios.h new file mode 100644 index 0000000..d0932c1 --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios.h @@ -0,0 +1,193 @@ +/* termios type and macro definitions. Linux version. + Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _TERMBITS_H +#define _TERMBITS_H 1 + +typedef unsigned char cc_t; +typedef unsigned int speed_t; +typedef unsigned int tcflag_t; + +#define NCCS 32 +struct termios + { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_cc[NCCS]; /* control characters */ + cc_t c_line; /* line discipline (== c_cc[33]) */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ + }; + +/* c_cc characters */ +#define VEOF 0 +#define VEOL 1 +#define VEOL2 2 +#define VERASE 3 +#define VWERASE 4 +#define VKILL 5 +#define VREPRINT 6 +#define VSWTC 7 +#define VINTR 8 +#define VQUIT 9 +#define VSUSP 10 +#define VSTART 12 +#define VSTOP 13 +#define VLNEXT 14 +#define VDISCARD 15 +#define VMIN 16 +#define VTIME 17 + +/* c_iflag bits */ +#define IGNBRK 0000001 +#define BRKINT 0000002 +#define IGNPAR 0000004 +#define PARMRK 0000010 +#define INPCK 0000020 +#define ISTRIP 0000040 +#define INLCR 0000100 +#define IGNCR 0000200 +#define ICRNL 0000400 +#define IXON 0001000 +#define IXOFF 0002000 +#ifdef __USE_BSD + /* POSIX.1 doesn't want these... */ +# define IXANY 0004000 +# define IUCLC 0010000 +# define IMAXBEL 0020000 +#endif + +/* c_oflag bits */ +#define OPOST 0000001 +#define ONLCR 0000002 +#define OLCUC 0000004 + +#define OCRNL 0000010 +#define ONOCR 0000020 +#define ONLRET 0000040 + +#define OFILL 00000100 +#define OFDEL 00000200 +#define NLDLY 00001400 +#define NL0 00000000 +#define NL1 00000400 +#define NL2 00001000 +#define NL3 00001400 +#define TABDLY 00006000 +#define TAB0 00000000 +#define TAB1 00002000 +#define TAB2 00004000 +#define TAB3 00006000 +#define CRDLY 00030000 +#define CR0 00000000 +#define CR1 00010000 +#define CR2 00020000 +#define CR3 00030000 +#define FFDLY 00040000 +#define FF0 00000000 +#define FF1 00040000 +#define BSDLY 00100000 +#define BS0 00000000 +#define BS1 00100000 +#define VTDLY 00200000 +#define VT0 00000000 +#define VT1 00200000 +#define XTABS 01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */ + +/* c_cflag bit meaning */ +#define CBAUD 0000037 +#define B0 0000000 /* hang up */ +#define B50 0000001 +#define B75 0000002 +#define B110 0000003 +#define B134 0000004 +#define B150 0000005 +#define B200 0000006 +#define B300 0000007 +#define B600 0000010 +#define B1200 0000011 +#define B1800 0000012 +#define B2400 0000013 +#define B4800 0000014 +#define B9600 0000015 +#define B19200 0000016 +#define B38400 0000017 +#define EXTA B19200 +#define EXTB B38400 +#define CBAUDEX 0000000 +#define B57600 00020 +#define B115200 00021 +#define B230400 00022 +#define B460800 00023 + +#define CSIZE 00001400 +#define CS5 00000000 +#define CS6 00000400 +#define CS7 00001000 +#define CS8 00001400 + +#define CSTOPB 00002000 +#define CREAD 00004000 +#define PARENB 00010000 +#define PARODD 00020000 +#define HUPCL 00040000 + +#define CLOCAL 00100000 +#define CRTSCTS 020000000000 /* flow control */ + +/* c_lflag bits */ +#define ISIG 0x00000080 +#define ICANON 0x00000100 +#define XCASE 0x00004000 +#define ECHO 0x00000008 +#define ECHOE 0x00000002 +#define ECHOK 0x00000004 +#define ECHONL 0x00000010 +#define NOFLSH 0x80000000 +#define TOSTOP 0x00400000 +#define ECHOCTL 0x00000040 +#define ECHOPRT 0x00000020 +#define ECHOKE 0x00000001 +#define FLUSHO 0x00800000 +#define PENDIN 0x20000000 +#define IEXTEN 0x00000400 + +/* Values for the ACTION argument to `tcflow'. */ +#define TCOOFF 0 +#define TCOON 1 +#define TCIOFF 2 +#define TCION 3 + +/* Values for the QUEUE_SELECTOR argument to `tcflush'. */ +#define TCIFLUSH 0 +#define TCOFLUSH 1 +#define TCIOFLUSH 2 + +/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ +#define TCSANOW 0 +#define TCSADRAIN 1 +#define TCSAFLUSH 2 + + +#define _IOT_termios /* Hurd ioctl type field. */ \ + _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) + +#endif /* _TERMBITS_H */ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/time.h b/sysdeps/unix/sysv/linux/alpha/bits/time.h new file mode 100644 index 0000000..7475b68 --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/bits/time.h @@ -0,0 +1,54 @@ +/* System-dependent timing definitions. Linux/Alpha version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifdef __need_timeval +# undef __need_timeval +# ifndef _STRUCT_TIMEVAL +# define _STRUCT_TIMEVAL 1 +/* A time value that is accurate to the nearest + microsecond but also has a range of years. */ +struct timeval + { + int tv_sec; /* Seconds. */ + int tv_usec; /* Microseconds. */ + }; +# endif /* struct timeval */ +#endif /* need timeval */ + + +#ifndef _BITS_TIME_H +#define _BITS_TIME_H 1 + +/* ISO/IEC 9899:1990 7.12.1: + The macro `CLOCKS_PER_SEC' is the number per second of the value + returned by the `clock' function. */ +/* CAE XSH, Issue 4, Version 2: + The value of CLOCKS_PER_SEC is required to be 1 million on all + XSI-conformant systems. */ +# define CLOCKS_PER_SEC 1000000 + +/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK + presents the real value for clock ticks per second for the system. */ +# define CLK_TCK 1024 + +#endif /* bits/time.h */ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/types.h b/sysdeps/unix/sysv/linux/alpha/bits/types.h new file mode 100644 index 0000000..9a4666a --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/bits/types.h @@ -0,0 +1,95 @@ +/* Copyright (C) 1991, 92, 94, 95, 96, 97 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_TYPES_H +#define _BITS_TYPES_H 1 + +#include + +/* Convenience types. */ +typedef unsigned char __u_char; +typedef unsigned short __u_short; +typedef unsigned int __u_int; +typedef unsigned long __u_long; +typedef unsigned long int __u_quad_t; +typedef long int __quad_t; +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef signed short int __int16_t; +typedef unsigned short int __uint16_t; +typedef signed int __int32_t; +typedef unsigned int __uint32_t; +typedef signed long int __int64_t; +typedef unsigned long int __uint64_t; +typedef __quad_t *__qaddr_t; + +typedef __u_long __dev_t; /* Type of device numbers. */ +typedef __u_int __uid_t; /* Type of user identifications. */ +typedef __u_int __gid_t; /* Type of group identifications. */ +typedef __u_int __ino_t; /* Type of file serial numbers. */ +typedef __u_int __mode_t; /* Type of file attribute bitmasks. */ +typedef __u_int __nlink_t; /* Type of file link counts. */ +typedef long int __off_t; /* Type of file sizes and offsets. */ +typedef __quad_t __loff_t; /* Type of file sizes and offsets. */ +typedef int __pid_t; /* Type of process identifications. */ +typedef long int __ssize_t; /* Type of a byte count, or error. */ + +typedef struct + { + int __val[2]; + } __fsid_t; /* Type of file system IDs. */ + +/* Everythin' else. */ +typedef int __daddr_t; /* The type of a disk address. */ +typedef char *__caddr_t; +typedef long int __time_t; +typedef long int __swblk_t; /* Type of a swap block maybe? */ + +typedef long int __clock_t; + +/* One element in the file descriptor mask array. */ +typedef unsigned long int __fd_mask; + +/* Due to incaution, we may have gotten these from a kernel header file. */ +#undef __FD_SETSIZE +#undef __NFDBITS +#undef __FDMASK + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + +/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ +#define __NFDBITS (8 * sizeof (__fd_mask)) +#define __FDELT(d) ((d) / __NFDBITS) +#define __FDMASK(d) (1 << ((d) % __NFDBITS)) + +/* fd_set for select and pselect. */ +typedef struct + { + /* XPG4.2 requires this member name. */ + __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS]; + } __fd_set; + + +typedef int __key_t; + +#endif /* bits/types.h */ diff --git a/sysdeps/unix/sysv/linux/alpha/brk.S b/sysdeps/unix/sysv/linux/alpha/brk.S index be0539b..6f99493 100644 --- a/sysdeps/unix/sysv/linux/alpha/brk.S +++ b/sysdeps/unix/sysv/linux/alpha/brk.S @@ -23,7 +23,7 @@ #include #define _ERRNO_H -#include +#include #ifdef PIC .section .bss diff --git a/sysdeps/unix/sysv/linux/alpha/clone.S b/sysdeps/unix/sysv/linux/alpha/clone.S index aab4e59..3f097fe 100644 --- a/sysdeps/unix/sysv/linux/alpha/clone.S +++ b/sysdeps/unix/sysv/linux/alpha/clone.S @@ -22,7 +22,7 @@ #include #define _ERRNO_H 1 -#include +#include /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */ diff --git a/sysdeps/unix/sysv/linux/alpha/fcntlbits.h b/sysdeps/unix/sysv/linux/alpha/fcntlbits.h deleted file mode 100644 index 6e1c843..0000000 --- a/sysdeps/unix/sysv/linux/alpha/fcntlbits.h +++ /dev/null @@ -1,100 +0,0 @@ -/* O_*, F_*, FD_* bit values for Linux. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _FCNTLBITS_H -#define _FCNTLBITS_H 1 - -#include - - -/* In GNU, read and write are bits (unlike BSD). */ -#ifdef __USE_GNU -#define O_READ O_RDONLY /* Open for reading. */ -#define O_WRITE O_WRONLY /* Open for writing. */ -#endif -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 -#define O_CREAT 01000 /* not fcntl */ -#define O_TRUNC 02000 /* not fcntl */ -#define O_EXCL 04000 /* not fcntl */ -#define O_NOCTTY 010000 /* not fcntl */ - -#define O_NONBLOCK 00004 -#define O_APPEND 00010 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 040000 -#define O_FSYNC O_SYNC -#define O_ASYNC 020000 /* fcntl, for BSD compatibility */ - -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get f_flags */ -#define F_SETFD 2 /* set f_flags */ -#define F_GETFL 3 /* more flags (cloexec) */ -#define F_SETFL 4 -#define F_GETLK 7 -#define F_SETLK 8 -#define F_SETLKW 9 - -#define F_SETOWN 5 /* for sockets. */ -#define F_GETOWN 6 /* for sockets. */ - -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - -/* for posix fcntl() and lockf() */ -#define F_RDLCK 1 -#define F_WRLCK 2 -#define F_UNLCK 8 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 16 /* or 3 */ -#define F_SHLCK 32 /* or 4 */ - -/* 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 */ - -struct flock - { - short int l_type; - short int l_whence; - __off_t l_start; - __off_t l_len; - __pid_t l_pid; - }; - - -/* Define some more compatibility macros to be backward compatible with - BSD systems which did not managed to hide these kernel macros. */ -#ifdef __USE_BSD -#define FAPPEND O_APPEND -#define FFSYNC O_FSYNC -#define FASYNC O_ASYNC -#define FNONBLOCK O_NONBLOCK -#define FNDELAY O_NDELAY -#endif /* Use BSD. */ - -#endif /* fcntlbits.h */ diff --git a/sysdeps/unix/sysv/linux/alpha/gnu/types.h b/sysdeps/unix/sysv/linux/alpha/gnu/types.h deleted file mode 100644 index 2af77f7..0000000 --- a/sysdeps/unix/sysv/linux/alpha/gnu/types.h +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (C) 1991, 92, 94, 95, 96, 97 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _GNU_TYPES_H -#define _GNU_TYPES_H 1 - -#include - -/* Convenience types. */ -typedef unsigned char __u_char; -typedef unsigned short __u_short; -typedef unsigned int __u_int; -typedef unsigned long __u_long; -#ifdef __GNUC__ -typedef unsigned long long int __u_quad_t; -typedef long long int __quad_t; -#else -typedef struct - { - long int __val[2]; - } __quad_t; -typedef struct - { - __u_long __val[2]; - } __u_quad_t; -#endif -typedef __quad_t *__qaddr_t; - -typedef __u_long __dev_t; /* Type of device numbers. */ -typedef __u_int __uid_t; /* Type of user identifications. */ -typedef __u_int __gid_t; /* Type of group identifications. */ -typedef __u_int __ino_t; /* Type of file serial numbers. */ -typedef __u_int __mode_t; /* Type of file attribute bitmasks. */ -typedef __u_int __nlink_t; /* Type of file link counts. */ -typedef long int __off_t; /* Type of file sizes and offsets. */ -typedef __quad_t __loff_t; /* Type of file sizes and offsets. */ -typedef int __pid_t; /* Type of process identifications. */ -typedef long int __ssize_t; /* Type of a byte count, or error. */ - -typedef struct - { - int __val[2]; - } __fsid_t; /* Type of file system IDs. */ - -/* Everythin' else. */ -typedef int __daddr_t; /* The type of a disk address. */ -typedef char *__caddr_t; -typedef long int __time_t; -typedef long int __swblk_t; /* Type of a swap block maybe? */ - -typedef long int __clock_t; - -/* One element in the file descriptor mask array. */ -typedef unsigned long int __fd_mask; - -/* Due to incaution, we may have gotten these from a kernel header file. */ -#undef __FD_SETSIZE -#undef __NFDBITS -#undef __FDMASK - -/* Number of descriptors that can fit in an `fd_set'. */ -#define __FD_SETSIZE 1024 - -/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ -#define __NFDBITS (8 * sizeof (__fd_mask)) -#define __FDELT(d) ((d) / __NFDBITS) -#define __FDMASK(d) (1 << ((d) % __NFDBITS)) - -/* fd_set for select and pselect. */ -typedef struct - { - /* XPG4.2 requires this member name. */ - __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS]; - } __fd_set; - - -typedef int __key_t; - -#endif /* gnu/types.h */ diff --git a/sysdeps/unix/sysv/linux/alpha/ioctls.h b/sysdeps/unix/sysv/linux/alpha/ioctls.h deleted file mode 100644 index 80b2e62..0000000 --- a/sysdeps/unix/sysv/linux/alpha/ioctls.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _IOCTLS_H -#define _IOCTLS_H 1 - -/* Use the definitions from the kernel header files. */ -#include -#include - -/* Oh well, this is necessary since the kernel data structure is - different from the user-level version. */ -#undef TCGETS -#undef TCSETS -#undef TCSETSW -#undef TCSETSF -#define TCGETS _IOR ('t', 19, struct __kernel_termios) -#define TCSETS _IOW ('t', 20, struct __kernel_termios) -#define TCSETSW _IOW ('t', 21, struct __kernel_termios) -#define TCSETSF _IOW ('t', 22, struct __kernel_termios) - -#include - -#endif /* ioctls.h */ diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_termios.h b/sysdeps/unix/sysv/linux/alpha/kernel_termios.h new file mode 100644 index 0000000..093ac25 --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/kernel_termios.h @@ -0,0 +1,44 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _KERNEL_TERMIOS_H +#define _KERNEL_TERMIOS_H 1 + +/* The following corresponds to the values from the Linux 2.1.20 kernel. */ + +/* We need the definition of tcflag_t, cc_t, and speed_t. */ +#include + +#define __KERNEL_NCCS 19 + +struct __kernel_termios + { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_cc[__KERNEL_NCCS]; /* control characters */ + cc_t c_line; /* line discipline */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ + }; + +#define _HAVE_C_ISPEED 1 +#define _HAVE_C_OSPEED 1 + +#endif /* kernel_termios.h */ diff --git a/sysdeps/unix/sysv/linux/alpha/sigaction.h b/sysdeps/unix/sysv/linux/alpha/sigaction.h deleted file mode 100644 index 57ce5e6..0000000 --- a/sysdeps/unix/sysv/linux/alpha/sigaction.h +++ /dev/null @@ -1,51 +0,0 @@ -/* The proper definitions for Linux/Alpha sigaction. -Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Structure describing the action to be taken when a signal arrives. */ -struct sigaction - { - /* Signal handler. */ - __sighandler_t sa_handler; - - /* Additional set of signals to be blocked. */ - __sigset_t sa_mask; - - /* Special flags. */ - unsigned int sa_flags; - }; - -/* Bits in `sa_flags'. */ -#define SA_NOCLDSTOP 0x00000004 /* Don't send SIGCHLD when children stop. */ -#ifdef __USE_MISC -#define SA_STACK 0x00000001 /* Use signal stack by using `sa_restorer'. */ -#define SA_RESTART 0x00000002 /* Don't restart syscall on signal return. */ -#define SA_INTERRUPT 0x20000000 /* Historical no-op. */ -#define SA_NOMASK 0x00000008 /* Don't automatically block the signal when - its handler is being executed. */ -#define SA_ONESHOT 0x00000010 /* Reset to SIG_DFL on entry to handler. */ - -/* Some aliases for the SA_ constants. */ -#define SA_NODEFER SA_NOMASK -#define SA_RESETHAND SA_ONESHOT -#endif - -/* Values for the HOW argument to `sigprocmask'. */ -#define SIG_BLOCK 1 /* Block signals. */ -#define SIG_UNBLOCK 2 /* Unblock signals. */ -#define SIG_SETMASK 3 /* Set the set of blocked signals. */ diff --git a/sysdeps/unix/sysv/linux/alpha/signum.h b/sysdeps/unix/sysv/linux/alpha/signum.h deleted file mode 100644 index be6132d..0000000 --- a/sysdeps/unix/sysv/linux/alpha/signum.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Signal number definitions. Linux/Alpha version. -Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#ifdef _SIGNAL_H - -/* Fake signal functions. */ -#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ -#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ -#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ - -/* - * Linux/AXP has different signal numbers that Linux/i386: I'm trying - * to make it OSF/1 binary compatible, at least for normal binaries. - */ -#define SIGHUP 1 -#define SIGINT 2 -#define SIGQUIT 3 -#define SIGILL 4 -#define SIGTRAP 5 -#define SIGABRT 6 -#define SIGEMT 7 -#define SIGFPE 8 -#define SIGKILL 9 -#define SIGBUS 10 -#define SIGSEGV 11 -#define SIGSYS 12 -#define SIGPIPE 13 -#define SIGALRM 14 -#define SIGTERM 15 -#define SIGURG 16 -#define SIGSTOP 17 -#define SIGTSTP 18 -#define SIGCONT 19 -#define SIGCHLD 20 -#define SIGTTIN 21 -#define SIGTTOU 22 -#define SIGIO 23 -#define SIGXCPU 24 -#define SIGXFSZ 25 -#define SIGVTALRM 26 -#define SIGPROF 27 -#define SIGWINCH 28 -#define SIGINFO 29 -#define SIGUSR1 30 -#define SIGUSR2 31 - -#define SIGPOLL SIGIO -#define SIGPWR SIGINFO -#define SIGIOT SIGABRT - -#define _NSIG 32 /* Biggest signal number + 1. */ - -#endif /* included. */ diff --git a/sysdeps/unix/sysv/linux/alpha/statbuf.h b/sysdeps/unix/sysv/linux/alpha/statbuf.h deleted file mode 100644 index 207fa0c..0000000 --- a/sysdeps/unix/sysv/linux/alpha/statbuf.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _STATBUF_H -#define _STATBUF_H 1 - -/* Versions of the `struct stat' data structure. */ -#define _STAT_VER_LINUX_OLD 0 -#define _STAT_VER_LINUX 1 -#define _STAT_VER _STAT_VER_LINUX - -/* Versions of the `xmknod' interface. */ -#define _MKNOD_VER_LINUX 0 - -struct stat - { - __dev_t st_dev; /* Device. */ - __ino_t st_ino; /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - __off_t st_size; /* Size of file, in bytes. */ - __time_t st_atime; /* Time of last access. */ - __time_t st_mtime; /* Time of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned int st_blksize; /* Optimal block size for I/O. */ -#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */ - int st_blocks; /* Nr. of 512-byte blocks allocated. */ - unsigned int st_flags; - unsigned int st_gen; - }; - -/* Encoding of the file mode. */ - -#define __S_IFMT 0170000 /* These bits determine file type. */ - -/* File types. */ -#define __S_IFDIR 0040000 /* Directory. */ -#define __S_IFCHR 0020000 /* Character device. */ -#define __S_IFBLK 0060000 /* Block device. */ -#define __S_IFREG 0100000 /* Regular file. */ -#define __S_IFIFO 0010000 /* FIFO. */ - -/* These don't actually exist on System V, but having them doesn't hurt. */ -#define __S_IFLNK 0120000 /* Symbolic link. */ -#define __S_IFSOCK 0140000 /* Socket. */ - -/* Protection bits. */ - -#define __S_ISUID 04000 /* Set user ID on execution. */ -#define __S_ISGID 02000 /* Set group ID on execution. */ -#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ -#define __S_IREAD 0400 /* Read by owner. */ -#define __S_IWRITE 0200 /* Write by owner. */ -#define __S_IEXEC 0100 /* Execute by owner. */ - -#endif /* statbuf.h */ diff --git a/sysdeps/unix/sysv/linux/alpha/sys/ipc_buf.h b/sysdeps/unix/sysv/linux/alpha/sys/ipc_buf.h deleted file mode 100644 index 57830da..0000000 --- a/sysdeps/unix/sysv/linux/alpha/sys/ipc_buf.h +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , August 1995. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SYS_IPC_BUF_H - -#define _SYS_IPC_BUF_H 1 -#include - -#include - -/* 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. */ -#define IPC_INFO 3 /* See ipcs. */ - - -__BEGIN_DECLS - -/* 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. */ - unsigned int uid; /* Owner's user ID. */ - unsigned int gid; /* Owner's group ID. */ - unsigned int cuid; /* Creator's user ID. */ - unsigned int cgid; /* Creator's group ID. */ - unsigned int mode; /* Read/write permission. */ - unsigned short int __seq; /* Sequence number. */ - }; - - -/* Kludge to work around Linux' restriction of only up to five - arguments to a system call. */ -struct ipc_kludge - { - void *msgp; - long int msgtyp; - }; - -/* The actual system call: all functions are multiplexed by this. */ -extern int __ipc __P ((int __call, int __first, int __second, int __third, - void *__ptr)); - -/* The codes for the functions to use the multiplexer `__ipc'. */ -#define IPCOP_semop 1 -#define IPCOP_semget 2 -#define IPCOP_semctl 3 -#define IPCOP_msgsnd 11 -#define IPCOP_msgrcv 12 -#define IPCOP_msgget 13 -#define IPCOP_msgctl 14 -#define IPCOP_shmat 21 -#define IPCOP_shmdt 22 -#define IPCOP_shmget 23 -#define IPCOP_shmctl 24 - -__END_DECLS - -#endif /* _SYS_IPC_BUF_H */ diff --git a/sysdeps/unix/sysv/linux/alpha/sys/kernel_termios.h b/sysdeps/unix/sysv/linux/alpha/sys/kernel_termios.h deleted file mode 100644 index 4be759a..0000000 --- a/sysdeps/unix/sysv/linux/alpha/sys/kernel_termios.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _SYS_KERNEL_TERMIOS_H -#define _SYS_KERNEL_TERMIOS_H 1 -/* The following corresponds to the values from the Linux 2.1.20 kernel. */ - -/* We need the definition of tcflag_t, cc_t, and speed_t. */ -#include - -#define __KERNEL_NCCS 19 - -struct __kernel_termios - { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_cc[__KERNEL_NCCS]; /* control characters */ - cc_t c_line; /* line discipline */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ - }; - -#define _HAVE_C_ISPEED 1 -#define _HAVE_C_OSPEED 1 - -#endif /* sys/kernel_termios.h */ diff --git a/sysdeps/unix/sysv/linux/alpha/termbits.h b/sysdeps/unix/sysv/linux/alpha/termbits.h deleted file mode 100644 index d0932c1..0000000 --- a/sysdeps/unix/sysv/linux/alpha/termbits.h +++ /dev/null @@ -1,193 +0,0 @@ -/* termios type and macro definitions. Linux version. - Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _TERMBITS_H -#define _TERMBITS_H 1 - -typedef unsigned char cc_t; -typedef unsigned int speed_t; -typedef unsigned int tcflag_t; - -#define NCCS 32 -struct termios - { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_cc[NCCS]; /* control characters */ - cc_t c_line; /* line discipline (== c_cc[33]) */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ - }; - -/* c_cc characters */ -#define VEOF 0 -#define VEOL 1 -#define VEOL2 2 -#define VERASE 3 -#define VWERASE 4 -#define VKILL 5 -#define VREPRINT 6 -#define VSWTC 7 -#define VINTR 8 -#define VQUIT 9 -#define VSUSP 10 -#define VSTART 12 -#define VSTOP 13 -#define VLNEXT 14 -#define VDISCARD 15 -#define VMIN 16 -#define VTIME 17 - -/* c_iflag bits */ -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IXON 0001000 -#define IXOFF 0002000 -#ifdef __USE_BSD - /* POSIX.1 doesn't want these... */ -# define IXANY 0004000 -# define IUCLC 0010000 -# define IMAXBEL 0020000 -#endif - -/* c_oflag bits */ -#define OPOST 0000001 -#define ONLCR 0000002 -#define OLCUC 0000004 - -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 - -#define OFILL 00000100 -#define OFDEL 00000200 -#define NLDLY 00001400 -#define NL0 00000000 -#define NL1 00000400 -#define NL2 00001000 -#define NL3 00001400 -#define TABDLY 00006000 -#define TAB0 00000000 -#define TAB1 00002000 -#define TAB2 00004000 -#define TAB3 00006000 -#define CRDLY 00030000 -#define CR0 00000000 -#define CR1 00010000 -#define CR2 00020000 -#define CR3 00030000 -#define FFDLY 00040000 -#define FF0 00000000 -#define FF1 00040000 -#define BSDLY 00100000 -#define BS0 00000000 -#define BS1 00100000 -#define VTDLY 00200000 -#define VT0 00000000 -#define VT1 00200000 -#define XTABS 01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */ - -/* c_cflag bit meaning */ -#define CBAUD 0000037 -#define B0 0000000 /* hang up */ -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 -#define EXTA B19200 -#define EXTB B38400 -#define CBAUDEX 0000000 -#define B57600 00020 -#define B115200 00021 -#define B230400 00022 -#define B460800 00023 - -#define CSIZE 00001400 -#define CS5 00000000 -#define CS6 00000400 -#define CS7 00001000 -#define CS8 00001400 - -#define CSTOPB 00002000 -#define CREAD 00004000 -#define PARENB 00010000 -#define PARODD 00020000 -#define HUPCL 00040000 - -#define CLOCAL 00100000 -#define CRTSCTS 020000000000 /* flow control */ - -/* c_lflag bits */ -#define ISIG 0x00000080 -#define ICANON 0x00000100 -#define XCASE 0x00004000 -#define ECHO 0x00000008 -#define ECHOE 0x00000002 -#define ECHOK 0x00000004 -#define ECHONL 0x00000010 -#define NOFLSH 0x80000000 -#define TOSTOP 0x00400000 -#define ECHOCTL 0x00000040 -#define ECHOPRT 0x00000020 -#define ECHOKE 0x00000001 -#define FLUSHO 0x00800000 -#define PENDIN 0x20000000 -#define IEXTEN 0x00000400 - -/* Values for the ACTION argument to `tcflow'. */ -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -/* Values for the QUEUE_SELECTOR argument to `tcflush'. */ -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - - -#define _IOT_termios /* Hurd ioctl type field. */ \ - _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) - -#endif /* _TERMBITS_H */ diff --git a/sysdeps/unix/sysv/linux/alpha/timebits.h b/sysdeps/unix/sysv/linux/alpha/timebits.h deleted file mode 100644 index 1ad0df8..0000000 --- a/sysdeps/unix/sysv/linux/alpha/timebits.h +++ /dev/null @@ -1,50 +0,0 @@ -/* System-dependent timing definitions. Linux/Alpha version. - Copyright (C) 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef __need_timeval -# undef __need_timeval -# ifndef _STRUCT_TIMEVAL -# define _STRUCT_TIMEVAL 1 -/* A time value that is accurate to the nearest - microsecond but also has a range of years. */ -struct timeval - { - int tv_sec; /* Seconds. */ - int tv_usec; /* Microseconds. */ - }; -# endif /* struct timeval */ -#endif /* need timeval */ - - -#ifndef _TIMEBITS_H -# define _TIMEBITS_H 1 - -/* ISO/IEC 9899:1990 7.12.1: - The macro `CLOCKS_PER_SEC' is the number per second of the value - returned by the `clock' function. */ -/* CAE XSH, Issue 4, Version 2: - The value of CLOCKS_PER_SEC is required to be 1 million on all - XSI-conformant systems. */ -# define CLOCKS_PER_SEC 1000000 - -/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK - presents the real value for clock ticks per second for the system. */ -# define CLK_TCK 1024 - -#endif /* timebits.h */ diff --git a/sysdeps/unix/sysv/linux/arm/clone.S b/sysdeps/unix/sysv/linux/arm/clone.S index c7e7aed..8125ebf 100644 --- a/sysdeps/unix/sysv/linux/arm/clone.S +++ b/sysdeps/unix/sysv/linux/arm/clone.S @@ -21,7 +21,7 @@ #include #define _ERRNO_H 1 -#include +#include /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ diff --git a/sysdeps/unix/sysv/linux/arm/profil-counter.h b/sysdeps/unix/sysv/linux/arm/profil-counter.h index a915da7..802cbd5 100644 --- a/sysdeps/unix/sysv/linux/arm/profil-counter.h +++ b/sysdeps/unix/sysv/linux/arm/profil-counter.h @@ -17,7 +17,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include void profil_counter (int signo, struct sigcontext sc) diff --git a/sysdeps/unix/sysv/linux/arm/socket.S b/sysdeps/unix/sysv/linux/arm/socket.S index e8db072..4d877e5 100644 --- a/sysdeps/unix/sysv/linux/arm/socket.S +++ b/sysdeps/unix/sysv/linux/arm/socket.S @@ -17,7 +17,7 @@ Boston, MA 02111-1307, USA. */ #include -#include +#include #define P(a, b) P2(a, b) #define P2(a, b) a##b diff --git a/sysdeps/unix/sysv/linux/bits/dirent.h b/sysdeps/unix/sysv/linux/bits/dirent.h new file mode 100644 index 0000000..ccf5080 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/dirent.h @@ -0,0 +1,37 @@ +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _DIRENTRY_H +#define _DIRENTRY_H 1 + +struct dirent + { + long int d_ino; + __off_t d_off; + unsigned short int d_reclen; + unsigned char d_type; + char d_name[256]; /* We must not include limits.h! */ + }; +#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 + +#endif /* _DIRENTRY_H */ diff --git a/sysdeps/unix/sysv/linux/bits/errno.h b/sysdeps/unix/sysv/linux/bits/errno.h new file mode 100644 index 0000000..f676d35 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/errno.h @@ -0,0 +1,59 @@ +/* Error constants. Linux specific version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifdef _ERRNO_H + +# undef EDOM +# undef ERANGE +# include + +# ifndef __ASSEMBLER__ +/* We now need a declaration of the `errno' variable. */ +extern int errno; + +/* Function to get address of global `errno' variable. */ +extern int *__errno_location __P ((void)) __attribute__ ((__const__)); + +# if defined _LIBC +# ifdef _LIBC_REENTRANT +static inline int +__set_errno (int __err) +{ + return *__errno_location () = errno = __err; +} +# define __set_errno __set_errno +# else /* !_LIBC_REENTRANT */ +# define __set_errno(val) errno = (val) +# endif /* _LIBC_REENTRANT */ +# endif /* _LIBC */ + +# if !defined _LIBC || defined _LIBC_REENTRANT +/* When using threads, errno is a per-thread value. */ +# define errno (*__errno_location ()) +# endif +# endif /* !__ASSEMBLER__ */ +#endif /* _ERRNO_H */ + +#if !defined (_ERRNO_H) && defined (__need_Emath) +/* This is ugly but the kernel header is not clean enough. We must + define only the values EDOM and ERANGE in case __need_Emath is + defined. The value is the same for all Linux ports. */ +# define EDOM 33 /* Math argument out of domain of function. */ +# define ERANGE 34 /* Math result not representable. */ +#endif /* !_ERRNO_H && __need_Emath */ diff --git a/sysdeps/unix/sysv/linux/bits/fcntl.h b/sysdeps/unix/sysv/linux/bits/fcntl.h new file mode 100644 index 0000000..62c3052 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/fcntl.h @@ -0,0 +1,99 @@ +/* O_*, F_*, FD_* bit values for Linux. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FCNTL_H +#error "Never use directly; include instead." +#endif + + +#include + + +/* In GNU, read and write are bits (unlike BSD). */ +#ifdef __USE_GNU +#define O_READ O_RDONLY /* Open for reading. */ +#define O_WRITE O_WRONLY /* Open for writing. */ +#endif +/* open/fcntl - O_SYNC is only implemented on blocks devices and on files + located on an ext2 file system */ +#define O_ACCMODE 0003 +#define O_RDONLY 00 +#define O_WRONLY 01 +#define O_RDWR 02 +#define O_CREAT 0100 /* not fcntl */ +#define O_EXCL 0200 /* not fcntl */ +#define O_NOCTTY 0400 /* not fcntl */ +#define O_TRUNC 01000 /* not fcntl */ +#define O_APPEND 02000 +#define O_NONBLOCK 04000 +#define O_NDELAY O_NONBLOCK +#define O_SYNC 010000 +#define O_FSYNC O_SYNC +#define O_ASYNC 020000 + +#define F_DUPFD 0 /* dup */ +#define F_GETFD 1 /* get f_flags */ +#define F_SETFD 2 /* set f_flags */ +#define F_GETFL 3 /* more flags (cloexec) */ +#define F_SETFL 4 +#define F_GETLK 5 +#define F_SETLK 6 +#define F_SETLKW 7 + +#define F_SETOWN 8 /* for sockets. */ +#define F_GETOWN 9 /* for sockets. */ + +/* for F_[GET|SET]FL */ +#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ + +/* for posix fcntl() and lockf() */ +#define F_RDLCK 0 +#define F_WRLCK 1 +#define F_UNLCK 2 + +/* for old implementation of bsd flock () */ +#define F_EXLCK 4 /* or 3 */ +#define F_SHLCK 8 /* or 4 */ + +/* 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 */ + +struct flock + { + short int l_type; + short int l_whence; + __off_t l_start; + __off_t l_len; + __pid_t l_pid; + }; + + +/* Define some more compatibility macros to be backward compatible with + BSD systems which did not managed to hide these kernel macros. */ +#ifdef __USE_BSD +#define FAPPEND O_APPEND +#define FFSYNC O_FSYNC +#define FASYNC O_ASYNC +#define FNONBLOCK O_NONBLOCK +#define FNDELAY O_NDELAY +#endif /* Use BSD. */ diff --git a/sysdeps/unix/sysv/linux/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/bits/ioctl-types.h new file mode 100644 index 0000000..af988a3 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/ioctl-types.h @@ -0,0 +1,74 @@ +/* Structure types for pre-termios terminal ioctls. Linux version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_IOCTL_TYPES_H +#define _BITS_IOCTL_TYPES_H 1 + +/* Get definition of constants for use with `ioctl'. */ +#include + + +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 + + +#endif /* bits/ioctl-types.h */ diff --git a/sysdeps/unix/sysv/linux/bits/ioctls.h b/sysdeps/unix/sysv/linux/bits/ioctls.h new file mode 100644 index 0000000..265c857 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/ioctls.h @@ -0,0 +1,30 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_IOCTLS_H +#define _BITS_IOCTLS_H 1 + +/* Use the definitions from the kernel header files. */ +#include +#include + +#endif /* bits/ioctls.h */ diff --git a/sysdeps/unix/sysv/linux/bits/ipc.h b/sysdeps/unix/sysv/linux/bits/ipc.h new file mode 100644 index 0000000..f5fea0d --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/ipc.h @@ -0,0 +1,85 @@ +/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , August 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_IPC_BUF_H + +#define _SYS_IPC_BUF_H 1 +#include + +#include + +/* 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. */ +#define IPC_INFO 3 /* See ipcs. */ + + +__BEGIN_DECLS + +/* 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. */ + unsigned short int uid; /* Owner's user ID. */ + unsigned short int gid; /* Owner's group ID. */ + unsigned short int cuid; /* Creator's user ID. */ + unsigned short int cgid; /* Creator's group ID. */ + unsigned short int mode; /* Read/write permission. */ + unsigned short int __seq; /* Sequence number. */ + }; + + +/* Kludge to work around Linux' restriction of only up to five + arguments to a system call. */ +struct ipc_kludge + { + void *msgp; + long int msgtyp; + }; + +/* The actual system call: all functions are multiplexed by this. */ +extern int __ipc __P ((int __call, int __first, int __second, int __third, + void *__ptr)); + +/* The codes for the functions to use the multiplexer `__ipc'. */ +#define IPCOP_semop 1 +#define IPCOP_semget 2 +#define IPCOP_semctl 3 +#define IPCOP_msgsnd 11 +#define IPCOP_msgrcv 12 +#define IPCOP_msgget 13 +#define IPCOP_msgctl 14 +#define IPCOP_shmat 21 +#define IPCOP_shmdt 22 +#define IPCOP_shmget 23 +#define IPCOP_shmctl 24 + +__END_DECLS + +#endif /* _SYS_IPC_BUF_H */ diff --git a/sysdeps/unix/sysv/linux/bits/local_lim.h b/sysdeps/unix/sysv/linux/bits/local_lim.h new file mode 100644 index 0000000..7ce4230 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/local_lim.h @@ -0,0 +1,21 @@ +/* Minimum guaranteed maximum values for system limits. Linux version. + Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* The kernel sources contain a file with all the needed information. */ +#include diff --git a/sysdeps/unix/sysv/linux/bits/msq.h b/sysdeps/unix/sysv/linux/bits/msq.h new file mode 100644 index 0000000..0abc10f --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/msq.h @@ -0,0 +1,78 @@ +/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , August 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_MSQ_BUF_H + +#define _SYS_MSQ_BUF_H 1 +#include + +#include + +/* Define options for message queue functions. */ +#define MSG_NOERROR 010000 /* no error if message is too big */ +#define MSG_EXCEPT 020000 /* recv any msg except of specified type */ + + +__BEGIN_DECLS + +/* 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 */ + struct msg *__msg_first; /* pointer to first message on queue */ + struct msg *__msg_last; /* pointer to last message on queue */ + __time_t msg_stime; /* time of last msgsnd command */ + __time_t msg_rtime; /* time of last msgrcv command */ + __time_t msg_ctime; /* time of last change */ + struct wait_queue *__wwait; /* ??? */ + struct wait_queue *__rwait; /* ??? */ + unsigned short int __msg_cbytes;/* current number of bytes on queue */ + unsigned short int msg_qnum; /* number of messages currently on queue */ + unsigned short int msg_qbytes;/* max number of bytes allowed on queue */ + int msg_lspid; /* pid of last msgsnd() */ + int msg_lrpid; /* pid of last msgrcv() */ +}; + +#ifdef __USE_MISC + +#define msg_cbytes __msg_cbytes + +/* ipcs ctl commands */ +#define MSG_STAT 11 +#define MSG_INFO 12 + +/* buffer for msgctl calls IPC_INFO, MSG_INFO */ +struct msginfo +{ + int msgpool; + int msgmap; + int msgmax; + int msgmnb; + int msgmni; + int msgssz; + int msgtql; + ushort msgseg; +}; + +#endif /* __USE_MISC */ + +__END_DECLS + +#endif /* _SYS_MSQ_BUF_H */ diff --git a/sysdeps/unix/sysv/linux/bits/posix_opt.h b/sysdeps/unix/sysv/linux/bits/posix_opt.h new file mode 100644 index 0000000..e9f8b7f --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/posix_opt.h @@ -0,0 +1,73 @@ +/* Define POSIX options for Linux. + Copyright (C) 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#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 1 + +/* Synchronizing file data is supported. */ +#define _POSIX_SYNCHRONIZED_IO 1 + +/* The fsync function is present. */ +#define _POSIX_FSYNC 1 + +/* Mapping of files to memory is supported. */ +#define _POSIX_MAPPED_FILES 1 + +/* Locking of all memory is supported. */ +#define _POSIX_MEMLOCK 1 + +/* Locking of ranges of memory is supported. */ +#define _POSIX_MEMLOCK_RANGE 1 + +/* Setting of memory protections is supported. */ +#define _POSIX_MEMORY_PROTECTION 1 + +/* Implementation supports `poll' function. */ +#define _POSIX_POLL 1 + +/* Implementation supports `select' and `pselect' functions. */ +#define _POSIX_SELECT 1 + +/* Only root can change owner of file. */ +#define _POSIX_CHOWN_RESTRICTED 1 + +/* `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 + +/* XPG4.2 shared memory is supported. */ +#define _XOPEN_SHM 1 + +#endif /* bits/posix_opt.h */ diff --git a/sysdeps/unix/sysv/linux/bits/resource.h b/sysdeps/unix/sysv/linux/bits/resource.h new file mode 100644 index 0000000..05cae83 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/resource.h @@ -0,0 +1,186 @@ +/* Bit values & structures for resource limits. Linux version. + Copyright (C) 1994, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +/* 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 = RLIMIT_CPU, +#undef RLIMIT_CPU + RLIMIT_CPU = _RLIMIT_CPU, +#define RLIMIT_CPU RLIMIT_CPU + + /* Largest file that can be created, in bytes. */ + _RLIMIT_FSIZE = RLIMIT_FSIZE, +#undef RLIMIT_FSIZE + RLIMIT_FSIZE = _RLIMIT_FSIZE, +#define RLIMIT_FSIZE RLIMIT_FSIZE + + /* Maximum size of data segment, in bytes. */ + _RLIMIT_DATA = RLIMIT_DATA, +#undef RLIMIT_DATA + RLIMIT_DATA = _RLIMIT_DATA, +#define RLIMIT_DATA RLIMIT_DATA + + /* Maximum size of stack segment, in bytes. */ + _RLIMIT_STACK = RLIMIT_STACK, +#undef RLIMIT_STACK + RLIMIT_STACK = _RLIMIT_STACK, +#define RLIMIT_STACK RLIMIT_STACK + + /* Largest core file that can be created, in bytes. */ + _RLIMIT_CORE = RLIMIT_CORE, +#undef RLIMIT_CORE + RLIMIT_CORE = _RLIMIT_CORE, +#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 = RLIMIT_RSS, +#undef RLIMIT_RSS + RLIMIT_RSS = _RLIMIT_RSS, +#define RLIMIT_RSS RLIMIT_RSS + + /* Number of open files. */ + _RLIMIT_NOFILE = RLIMIT_NOFILE, +#undef RLIMIT_NOFILE + RLIMIT_NOFILE = _RLIMIT_NOFILE, + RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ +#define RLIMIT_NOFILE RLIMIT_NOFILE +#define RLIMIT_OFILE RLIMIT_OFILE + + /* Address space limit (?) */ + _RLIMIT_AS = RLIMIT_AS, +#undef RLIMIT_AS + RLIMIT_AS = _RLIMIT_AS, +#define RLIMIT_AS RLIMIT_AS + + /* Number of processes. */ + _RLIMIT_NPROC = RLIMIT_NPROC, +#undef RLIMIT_NPROC + RLIMIT_NPROC = _RLIMIT_NPROC, +#define RLIMIT_NPROC RLIMIT_NPROC + + /* Locked-in-memory address space. */ + _RLIMIT_MEMLOCK = RLIMIT_MEMLOCK, +#undef RLIMIT_MEMLOCK + RLIMIT_MEMLOCK = _RLIMIT_MEMLOCK, +#define RLIMIT_MEMLOCK RLIMIT_MEMLOCK + + RLIMIT_NLIMITS = RLIM_NLIMITS, +#undef RLIM_NLIMITS + RLIM_NLIMITS = RLIMIT_NLIMITS, +#define RLIMIT_NLIMITS RLIMIT_NLIMITS +#define RLIM_NLIMITS RLIM_NLIMITS + + /* Value to indicate that there is no limit. */ + RLIM_INFINITY = (long int)(~0UL >> 1) +#define RLIM_INFINITY RLIM_INFINITY +}; + +struct rlimit +{ + /* The current (soft) limit. */ + long int rlim_cur; + /* The hard limit. */ + long int rlim_max; +}; + +/* 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 + + /* Both. */ + RUSAGE_BOTH = -2 +#define RUSAGE_BOTH RUSAGE_BOTH +}; + +#include /* For `struct timeval'. */ + +/* Structure which says how much of each resource has been used. */ +struct rusage +{ + /* Total amount of user time used. */ + struct timeval ru_utime; + /* Total amount of system time used. */ + struct timeval ru_stime; + /* Maximum resident set size (in kilobytes). */ + long int ru_maxrss; + /* Amount of sharing of text segment memory + with other processes (kilobyte-seconds). */ + long int ru_ixrss; + /* Amount of data segment memory used (kilobyte-seconds). */ + long int ru_idrss; + /* Amount of stack memory used (kilobyte-seconds). */ + long int ru_isrss; + /* Number of soft page faults (i.e. those serviced by reclaiming + a page from the list of pages awaiting reallocation. */ + long int ru_minflt; + /* Number of hard page faults (i.e. those that required I/O). */ + long int ru_majflt; + /* Number of times a process was swapped out of physical memory. */ + long int ru_nswap; + /* Number of input operations via the file system. Note: This + and `ru_oublock' do not include operations with the cache. */ + long int ru_inblock; + /* Number of output operations via the file system. */ + long int ru_oublock; + /* Number of IPC messages sent. */ + long int ru_msgsnd; + /* Number of IPC messages received. */ + long int ru_msgrcv; + /* Number of signals delivered. */ + long int ru_nsignals; + /* Number of voluntary context switches, i.e. because the process + gave up the process before it had to (usually to wait for some + resource to be available). */ + long int ru_nvcsw; + /* Number of involuntary context switches, i.e. a higher priority process + became runnable or the current process used up its time slice. */ + long int ru_nivcsw; +}; + +/* 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. */ + PRIO_PGRP = 1, /* WHO is a process group ID. */ + PRIO_USER = 2 /* WHO is a user ID. */ +}; diff --git a/sysdeps/unix/sysv/linux/bits/sched.h b/sysdeps/unix/sysv/linux/bits/sched.h new file mode 100644 index 0000000..521bbb7 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/sched.h @@ -0,0 +1,54 @@ +/* Definitions of constants and data structure for POSIX 1003.1b-1993 + scheduling interface. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SCHED_H +#error "Never use directly; include instead." +#endif + + +#include + +/* Scheduling algorithms. */ +#define SCHED_OTHER 0 +#define SCHED_FIFO 1 +#define SCHED_RR 2 + +/* Data structure to describe a process' schedulability. */ +struct sched_param + { + int sched_priority; + }; + +/* 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_PID 0x00001000 /* Set if pid shared. */ + + +/* Clone current process. */ +extern int __clone __P ((int (*__fn) (void *__arg), void *__child_stack, + int __flags, void *__arg)); +#ifdef __USE_MISC +extern int clone __P ((int (*__fn) (void *__arg), void *__child_stack, + int __flags, void *__arg)); +#endif diff --git a/sysdeps/unix/sysv/linux/bits/sem.h b/sysdeps/unix/sysv/linux/bits/sem.h new file mode 100644 index 0000000..049a71b --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/sem.h @@ -0,0 +1,88 @@ +/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , August 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_SEM_BUF_H + +#define _SYS_SEM_BUF_H 1 +#include + +#include + +/* 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 */ + + +__BEGIN_DECLS + +/* Data structure describing a set of semaphores. */ +struct semid_ds +{ + struct ipc_perm sem_perm; /* operation permission struct */ + __time_t sem_otime; /* last semop() time */ + __time_t sem_ctime; /* last time changed by semctl() */ + struct sem *__sembase; /* ptr to first semaphore in array */ + struct sem_queue *__sem_pending; /* pending operations */ + struct sem_queue *__sem_pending_last; /* last pending operation */ + struct sem_undo *__undo; /* ondo requests on this array */ + unsigned short int sem_nsems; /* number of semaphores in set */ +}; + +/* Union used for argument 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 */ +}; + +#ifdef __USE_MISC + +/* ipcs ctl cmds */ +#define SEM_STAT 18 +#define SEM_INFO 19 + +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 */ + +__END_DECLS + +#endif /* _SYS_SEM_BUF_H */ diff --git a/sysdeps/unix/sysv/linux/bits/shm.h b/sysdeps/unix/sysv/linux/bits/shm.h new file mode 100644 index 0000000..642b7bd --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/shm.h @@ -0,0 +1,92 @@ +/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , August 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_SHM_BUF_H + +#define _SYS_SHM_BUF_H 1 +#include + +#include + +/* Permission flag for shmget. */ +#define SHM_R 0400 /* or S_IRUGO from */ +#define SHM_W 0200 /* or S_IWUGO from */ + +/* 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 */ + +/* Commands for `shmctl'. */ +#define SHM_LOCK 11 /* lock segment (root only) */ +#define SHM_UNLOCK 12 /* unlock segment (root only) */ + + +__BEGIN_DECLS + +/* Data structure describing a set of semaphores. */ +struct shmid_ds +{ + struct ipc_perm shm_perm; /* operation permission struct */ + int shm_segsz; /* size of segment in bytes */ + __time_t shm_atime; /* time of last shmat() */ + __time_t shm_dtime; /* time of last shmdt() */ + __time_t shm_ctime; /* time of last change by shmctl() */ + int shm_cpid; /* pid of creator */ + int shm_lpid; /* pid of last shmop */ + unsigned short int shm_nattch; /* number of current attaches */ + unsigned short int __shm_npages; /* size of segment (pages) */ + unsigned long int *__shm_pages; /* array of ptrs to frames -> SHMMAX */ + struct vm_area_struct *__attaches; /* descriptors for attaches */ +}; + +#ifdef __USE_MISC + +/* ipcs ctl commands */ +#define SHM_STAT 13 +#define SHM_INFO 14 + +/* 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 */ + +struct shminfo +{ + int shmmax; + int shmmin; + int shmmni; + int shmseg; + int shmall; +}; + +struct shm_info +{ + int used_ids; + ulong shm_tot; /* total allocated shm */ + ulong shm_rss; /* total resident shm */ + ulong shm_swp; /* total swapped shm */ + ulong swap_attempts; + ulong swap_successes; +}; + +#endif /* __USE_MISC */ + +__END_DECLS + +#endif /* _SYS_SHM_BUF_H */ diff --git a/sysdeps/unix/sysv/linux/bits/sigaction.h b/sysdeps/unix/sysv/linux/bits/sigaction.h new file mode 100644 index 0000000..13a6a03 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/sigaction.h @@ -0,0 +1,54 @@ +/* The proper definitions for Linux's sigaction. + Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Structure describing the action to be taken when a signal arrives. */ +struct sigaction + { + /* Signal handler. */ + __sighandler_t sa_handler; + + /* Additional set of signals to be blocked. */ + __sigset_t sa_mask; + + /* Special flags. */ + int sa_flags; + + /* Restore handler. */ + void (*sa_restorer) __P ((void)); + }; + +/* Bits in `sa_flags'. */ +#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */ +#ifdef __USE_MISC +#define SA_STACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ +#define SA_RESTART 0x10000000 /* Don't restart syscall on signal return. */ +#define SA_INTERRUPT 0x20000000 /* Historical no-op. */ +#define SA_NODEFER 0x40000000 /* Don't automatically block the signal when + its handler is being executed. */ +#define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ + +/* Some aliases for the SA_ constants. */ +#define SA_NOMASK SA_NODEFER +#define SA_ONESHOT SA_RESETHAND +#endif + +/* Values for the HOW argument to `sigprocmask'. */ +#define SIG_BLOCK 0 /* Block signals. */ +#define SIG_UNBLOCK 1 /* Unblock signals. */ +#define SIG_SETMASK 2 /* Set the set of blocked signals. */ diff --git a/sysdeps/unix/sysv/linux/bits/sigcontext.h b/sysdeps/unix/sysv/linux/bits/sigcontext.h new file mode 100644 index 0000000..fb8bc5f --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/sigcontext.h @@ -0,0 +1,28 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SIGNAL_H +#error "Never use directly; include instead." +#endif + + +/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but + we need sigcontext. */ +#define sigcontext_struct sigcontext + +#include diff --git a/sysdeps/unix/sysv/linux/bits/signum.h b/sysdeps/unix/sysv/linux/bits/signum.h new file mode 100644 index 0000000..d8a716f --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/signum.h @@ -0,0 +1,66 @@ +/* Signal number definitions. Linux version. + Copyright (C) 1995, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifdef _SIGNAL_H + +/* Fake signal functions. */ +#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ +#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ +#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ + + +/* Signals. */ +#define SIGHUP 1 /* Hangup (POSIX). */ +#define SIGINT 2 /* Interrupt (ANSI). */ +#define SIGQUIT 3 /* Quit (POSIX). */ +#define SIGILL 4 /* Illegal instruction (ANSI). */ +#define SIGTRAP 5 /* Trace trap (POSIX). */ +#define SIGABRT 6 /* Abort (ANSI). */ +#define SIGIOT 6 /* IOT trap (4.2 BSD). */ +#define SIGBUS 7 /* BUS error (4.2 BSD). */ +#define SIGFPE 8 /* Floating-point exception (ANSI). */ +#define SIGKILL 9 /* Kill, unblockable (POSIX). */ +#define SIGUSR1 10 /* User-defined signal 1 (POSIX). */ +#define SIGSEGV 11 /* Segmentation violation (ANSI). */ +#define SIGUSR2 12 /* User-defined signal 2 (POSIX). */ +#define SIGPIPE 13 /* Broken pipe (POSIX). */ +#define SIGALRM 14 /* Alarm clock (POSIX). */ +#define SIGTERM 15 /* Termination (ANSI). */ +#define SIGSTKFLT 16 /* ??? */ +#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ +#define SIGCHLD 17 /* Child status has changed (POSIX). */ +#define SIGCONT 18 /* Continue (POSIX). */ +#define SIGSTOP 19 /* Stop, unblockable (POSIX). */ +#define SIGTSTP 20 /* Keyboard stop (POSIX). */ +#define SIGTTIN 21 /* Background read from tty (POSIX). */ +#define SIGTTOU 22 /* Background write to tty (POSIX). */ +#define SIGURG 23 /* Urgent condition on socket (4.2 BSD). */ +#define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */ +#define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */ +#define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */ +#define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */ +#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ +#define SIGPOLL SIGIO /* Pollable event occurred (System V). */ +#define SIGIO 29 /* I/O now possible (4.2 BSD). */ +#define SIGPWR 30 /* Power failure restart (System V). */ +#define SIGUNUSED 31 + +#define _NSIG 32 /* Biggest signal number + 1. */ + +#endif /* included. */ diff --git a/sysdeps/unix/sysv/linux/bits/sigset.h b/sysdeps/unix/sysv/linux/bits/sigset.h new file mode 100644 index 0000000..741ff9a --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/sigset.h @@ -0,0 +1,123 @@ +/* __sig_atomic_t, __sigset_t, and related definitions. Linux version. + Copyright (C) 1991, 1992, 1994, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SIGSET_H_types +#define _SIGSET_H_types 1 + +typedef int __sig_atomic_t; + +/* A `sigset_t' has a bit for each signal. */ + +#define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) +typedef struct + { + unsigned long int __val[_SIGSET_NWORDS]; + } __sigset_t; + +#endif + + +/* We only want to define these functions if was actually + included; otherwise we were included just to define the types. Since we + are namespace-clean, it wouldn't hurt to define extra macros. But + trouble can be caused by functions being defined (e.g., any global + register vars declared later will cause compilation errors). */ + +#if !defined (_SIGSET_H_fns) && defined (_SIGNAL_H) +#define _SIGSET_H_fns 1 + +#ifndef _EXTERN_INLINE +#define _EXTERN_INLINE extern __inline +#endif + +/* Return a mask that includes the bit for SIG only. */ +#define __sigmask(sig) \ + (((unsigned long) 1) << (((sig) - 1) % (8 * sizeof (unsigned long int)))) + +/* Return the word index for SIG. */ +#define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int))) + +#if defined __GNUC__ && __GNUC__ >= 2 +# define __sigemptyset(set) \ + (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ + sigset_t *__set = (set); \ + while (--__cnt >= 0) __set->__val[__cnt] = 0; \ + 0; })) +# define __sigfillset(set) \ + (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ + sigset_t *__set = (set); \ + while (--__cnt >= 0) __set->__val[__cnt] = ~0UL; \ + 0; })) + +# ifdef _GNU_SOURCE +/* The POSIX does not specify for handling the whole signal set in one + command. This is often wanted and so we define three more functions + here. */ +# define __sigisemptyset(set) \ + (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ + const sigset_t *__set = (set); \ + int __ret = __set->__val[--__cnt]; \ + while (!__ret && --__cnt >= 0) \ + __ret = __set->__val[__cnt]; \ + __ret == 0; })) +# define __sigandset(dest, left, right) \ + (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ + sigset_t *__dest = (dest); \ + const sigset_t *__left = (left); \ + const sigset_t *__right = (right); \ + while (--__cnt >= 0) \ + __dest->__val[__cnt] = (__left->__val[__cnt] \ + & __right->__val[__cnt]); \ + 0; })) +# define __sigorset(dest, left, right) \ + (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ + sigset_t *__dest = (dest); \ + const sigset_t *__left = (left); \ + const sigset_t *__right = (right); \ + while (--__cnt >= 0) \ + __dest->__val[__cnt] = (__left->__val[__cnt] \ + | __right->__val[__cnt]); \ + 0; })) +# endif +#endif + +/* These functions needn't check for a bogus signal number -- error + checking is done in the non __ versions. */ + +extern int __sigismember (__const __sigset_t *, int); +extern int __sigaddset (__sigset_t *, int); +extern int __sigdelset (__sigset_t *, int); + +#define __SIGSETFN(NAME, BODY, CONST) \ + _EXTERN_INLINE int \ + NAME (CONST __sigset_t *__set, int __sig) \ + { \ + unsigned long int __mask = __sigmask (__sig); \ + unsigned long int __word = __sigword (__sig); \ + return BODY; \ + } + +__SIGSETFN (__sigismember, (__set->__val[__word] & __mask) ? 1 : 0, __const) +__SIGSETFN (__sigaddset, ((__set->__val[__word] |= __mask), 0), ) +__SIGSETFN (__sigdelset, ((__set->__val[__word] &= ~__mask), 0), ) + +#undef __SIGSETFN + + +#endif /* ! _SIGSET_H_fns. */ diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h new file mode 100644 index 0000000..e3f53a9 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/socket.h @@ -0,0 +1,205 @@ +/* System-specific socket constants and types. Linux version. + Copyright (C) 1991, 92, 94, 95, 96, 97 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_SOCKET_H +#error "Never include directly; use instead." +#endif + + +#include + +#define __need_size_t +#define __need_NULL +#include + + +__BEGIN_DECLS + +/* Types of sockets. */ +enum __socket_type +{ + SOCK_STREAM = 1, /* Sequenced, reliable, connection-based + byte streams. */ +#define SOCK_STREAM SOCK_STREAM + SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams + of fixed maximum length. */ +#define SOCK_DGRAM SOCK_DGRAM + SOCK_RAW = 3, /* Raw protocol interface. */ +#define SOCK_RAW SOCK_RAW + SOCK_RDM = 4, /* Reliably-delivered messages. */ +#define SOCK_RDM SOCK_RDM + SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based, + datagrams of fixed maximum length. */ +#define SOCK_SEQPACKET SOCK_SEQPACKET + SOCK_PACKET = 10 /* Linux specific way of getting packets + at the dev level. For writing rarp and + other similar things on the user level. */ +#define SOCK_PACKET SOCK_PACKET +}; + +/* Protocol families. */ +#define PF_UNSPEC 0 /* Unspecified. */ +#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */ +#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */ +#define PF_FILE PF_LOCAL /* POSIX name for PF_LOCAL. */ +#define PF_INET 2 /* IP protocol family. */ +#define PF_AX25 3 /* Amateur Radio AX.25. */ +#define PF_IPX 4 /* Novell Internet Protocol. */ +#define PF_APPLETALK 5 /* Don't use this. */ +#define PF_NETROM 6 /* Amateur radio NetROM. */ +#define PF_BRIDGE 7 /* Multiprotocol bridge. */ +#define PF_AAL5 8 /* Reserved for Werner's ATM. */ +#define PF_X25 9 /* Reserved for X.25 project. */ +#define PF_INET6 10 /* IP version 6. */ +#define PF_MAX 12 /* For now.. */ + +/* Address families. */ +#define AF_UNSPEC PF_UNSPEC +#define AF_LOCAL PF_LOCAL +#define AF_UNIX PF_UNIX +#define AF_FILE PF_FILE +#define AF_INET PF_INET +#define AF_AX25 PF_AX25 +#define AF_IPX PF_IPX +#define AF_APPLETALK PF_APPLETALK +#define AF_NETROM PF_NETROM +#define AF_BRIDGE PF_BRIDGE +#define AF_AAL5 PF_AAL5 +#define AF_X25 PF_X25 +#define AF_INET6 PF_INET6 +#define AF_MAX PF_MAX + +/* Socket level values. Others are defined in the appropriate headers. + + XXX These definitions also should go into the appropriate headers as + far as they are available. */ +#define SOL_IPV6 41 +#define SOL_ICMPV6 58 +#define SOL_RAW 255 +#define SOL_AX25 257 +#define SOL_ATALK 258 +#define SOL_NETROM 259 +#define SOL_ROSE 260 +#define SOL_DECNET 261 +#define SOL_X25 262 + +/* Maximum queue length specifiable by listen. */ +#define SOMAXCONN 128 + +/* Get the definition of the macro to define the common sockaddr members. */ +#include + +/* Structure describing a generic socket address. */ +struct sockaddr + { + __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */ + char sa_data[14]; /* Address data. */ + }; + + +/* Bits in the FLAGS argument to `send', `recv', et al. */ +enum + { + MSG_OOB = 0x01, /* Process out-of-band data. */ + MSG_PEEK = 0x02, /* Peek at incoming messages. */ + MSG_DONTROUTE = 0x04, /* Don't use local routing. */ + MSG_CTRUNC = 0x08, /* Control data lost before delivery. */ + MSG_PROXY = 0x10 /* Supply or ask second address. */ + }; + + +/* Structure describing messages sent by + `sendmsg' and received by `recvmsg'. */ +struct msghdr + { + __ptr_t msg_name; /* Address to send to/receive from. */ + int msg_namelen; /* Length of address data. */ + /* XXX Should be type `size_t' according to POSIX.1g. */ + + struct iovec *msg_iov; /* Vector of data to send/receive into. */ + size_t msg_iovlen; /* Number of elements in the vector. */ + + __ptr_t msg_control; /* Ancillary data (eg BSD filedesc passing). */ + size_t msg_controllen; /* Ancillary data buffer length. */ + int msg_flags; /* Flags on received message. */ + }; + +/* Structure used for storage of ancillary data object information. */ +struct cmsghdr + { + size_t cmsg_len; /* Length of data in cmsg_data plus length + of cmsghdr structure. */ + int cmsg_level; /* Originating protocol. */ + int cmsg_type; /* Protocol specific type. */ +#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2 + unsigned char __cmsg_data[0]; /* Ancillary data. */ +#endif + }; + +/* Ancillary data object manipulation macros. */ +#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2 +# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data) +#else +# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1)) +#endif +#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg) +#define CMSG_FIRSTHDR(mhdr) \ + ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \ + ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL) +#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \ + & ~(sizeof (size_t) - 1)) +#define CMSG_SPACE(len) (CMSG_ALIGN (len) \ + + CMSG_ALIGN (sizeof (struct cmsghdr))) +#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len)) + +#ifndef _EXTERN_INLINE +# define _EXTERN_INLINE extern __inline +#endif +extern struct cmsghdr *__cmsg_nxthdr __P ((struct msghdr *__mhdr, + struct cmsghdr *__cmsg)); +_EXTERN_INLINE struct cmsghdr * +__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) +{ + unsigned char *__p; + + if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr)) + /* The kernel header does this so there may be a reason. */ + return NULL; + + __p = (((unsigned char *) __cmsg) + + ((__cmsg->cmsg_len + sizeof (long int) - 1) & ~sizeof (long int))); + if (__p >= (unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen) + /* No more entries. */ + return NULL; + return (struct cmsghdr *) __p; +} + + +/* Get socket manipulation related informations from kernel headers. */ +#include + + +/* Structure used to manipulate the SO_LINGER option. */ +struct linger + { + int l_onoff; /* Nonzero to linger on close. */ + int l_linger; /* Time to linger. */ + }; + +__END_DECLS diff --git a/sysdeps/unix/sysv/linux/bits/stat.h b/sysdeps/unix/sysv/linux/bits/stat.h new file mode 100644 index 0000000..1c6e5f8 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/stat.h @@ -0,0 +1,88 @@ +/* Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H 1 + +/* Versions of the `struct stat' data structure. */ +#define _STAT_VER_LINUX_OLD 1 +#define _STAT_VER_SVR4 2 +#define _STAT_VER_LINUX 3 +#define _STAT_VER _STAT_VER_LINUX /* The one defined below. */ + +/* Versions of the `xmknod' interface. */ +#define _MKNOD_VER_LINUX 1 +#define _MKNOD_VER_SVR4 2 +#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ + + +struct stat + { + __dev_t st_dev; /* Device. */ + unsigned short int __pad1; + __ino_t st_ino; /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + unsigned short int __pad2; + __off_t st_size; /* Size of file, in bytes. */ + unsigned long int st_blksize; /* Optimal block size for I/O. */ +#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */ + + unsigned long int st_blocks; /* Number of 512-byte blocks allocated. */ + __time_t st_atime; /* Time of last access. */ + unsigned long int __unused1; + __time_t st_mtime; /* Time of last modification. */ + unsigned long int __unused2; + __time_t st_ctime; /* Time of last status change. */ + unsigned long int __unused3; + unsigned long int __unused4; + unsigned long int __unused5; + }; + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFIFO 0010000 /* FIFO. */ + +/* These don't actually exist on System V, but having them doesn't hurt. */ +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + +#endif /* bits/stat.h */ diff --git a/sysdeps/unix/sysv/linux/bits/statfs.h b/sysdeps/unix/sysv/linux/bits/statfs.h new file mode 100644 index 0000000..8b95014 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/statfs.h @@ -0,0 +1,42 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_STATFS_H +#define _BITS_STATFS_H + +#include /* for __fsid_t */ + +struct statfs + { + int f_type; + int f_bsize; + int f_blocks; + int f_bfree; + int f_bavail; + int f_files; + int f_ffree; + __fsid_t f_fsid; + int f_namelen; + int f_spare[6]; + }; + +#endif /* bits/statfs.h */ diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h new file mode 100644 index 0000000..dd42012 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/termios.h @@ -0,0 +1,189 @@ +/* termios type and macro definitions. Linux version. + Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + + +#ifndef _BITS_TERMIOS_H +#define _BITS_TERMIOS_H 1 + +typedef unsigned char cc_t; +typedef unsigned int speed_t; +typedef unsigned int tcflag_t; + +#define NCCS 32 +struct termios + { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_line; /* line discipline */ + cc_t c_cc[NCCS]; /* control characters */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ + }; + +/* c_cc characters */ +#define VINTR 0 +#define VQUIT 1 +#define VERASE 2 +#define VKILL 3 +#define VEOF 4 +#define VTIME 5 +#define VMIN 6 +#define VSWTC 7 +#define VSTART 8 +#define VSTOP 9 +#define VSUSP 10 +#define VEOL 11 +#define VREPRINT 12 +#define VDISCARD 13 +#define VWERASE 14 +#define VLNEXT 15 +#define VEOL2 16 + +/* c_iflag bits */ +#define IGNBRK 0000001 +#define BRKINT 0000002 +#define IGNPAR 0000004 +#define PARMRK 0000010 +#define INPCK 0000020 +#define ISTRIP 0000040 +#define INLCR 0000100 +#define IGNCR 0000200 +#define ICRNL 0000400 +#define IUCLC 0001000 +#define IXON 0002000 +#define IXANY 0004000 +#define IXOFF 0010000 +#define IMAXBEL 0020000 + +/* c_oflag bits */ +#define OPOST 0000001 +#define OLCUC 0000002 +#define ONLCR 0000004 +#define OCRNL 0000010 +#define ONOCR 0000020 +#define ONLRET 0000040 +#define OFILL 0000100 +#define OFDEL 0000200 +#define NLDLY 0000400 +#define NL0 0000000 +#define NL1 0000400 +#define CRDLY 0003000 +#define CR0 0000000 +#define CR1 0001000 +#define CR2 0002000 +#define CR3 0003000 +#define TABDLY 0014000 +#define TAB0 0000000 +#define TAB1 0004000 +#define TAB2 0010000 +#define TAB3 0014000 +#define XTABS 0014000 +#define BSDLY 0020000 +#define BS0 0000000 +#define BS1 0020000 +#define VTDLY 0040000 +#define VT0 0000000 +#define VT1 0040000 +#define FFDLY 0100000 +#define FF0 0000000 +#define FF1 0100000 + +/* c_cflag bit meaning */ +#define CBAUD 0010017 +#define B0 0000000 /* hang up */ +#define B50 0000001 +#define B75 0000002 +#define B110 0000003 +#define B134 0000004 +#define B150 0000005 +#define B200 0000006 +#define B300 0000007 +#define B600 0000010 +#define B1200 0000011 +#define B1800 0000012 +#define B2400 0000013 +#define B4800 0000014 +#define B9600 0000015 +#define B19200 0000016 +#define B38400 0000017 +#define EXTA B19200 +#define EXTB B38400 +#define CSIZE 0000060 +#define CS5 0000000 +#define CS6 0000020 +#define CS7 0000040 +#define CS8 0000060 +#define CSTOPB 0000100 +#define CREAD 0000200 +#define PARENB 0000400 +#define PARODD 0001000 +#define HUPCL 0002000 +#define CLOCAL 0004000 +#define CBAUDEX 0010000 +#define B57600 0010001 +#define B115200 0010002 +#define B230400 0010003 +#define B460800 0010004 +#define CIBAUD 002003600000 /* input baud rate (not used) */ +#define CRTSCTS 020000000000 /* flow control */ + +/* c_lflag bits */ +#define ISIG 0000001 +#define ICANON 0000002 +#define XCASE 0000004 +#define ECHO 0000010 +#define ECHOE 0000020 +#define ECHOK 0000040 +#define ECHONL 0000100 +#define NOFLSH 0000200 +#define TOSTOP 0000400 +#define ECHOCTL 0001000 +#define ECHOPRT 0002000 +#define ECHOKE 0004000 +#define FLUSHO 0010000 +#define PENDIN 0040000 +#define IEXTEN 0100000 + +/* tcflow() and TCXONC use these */ +#define TCOOFF 0 +#define TCOON 1 +#define TCIOFF 2 +#define TCION 3 + +/* tcflush() and TCFLSH use these */ +#define TCIFLUSH 0 +#define TCOFLUSH 1 +#define TCIOFLUSH 2 + +/* tcsetattr uses these */ +#define TCSANOW 0 +#define TCSADRAIN 1 +#define TCSAFLUSH 2 + + +#define _IOT_termios /* Hurd ioctl type field. */ \ + _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) + +#endif /* bits/termios.h */ diff --git a/sysdeps/unix/sysv/linux/bits/time.h b/sysdeps/unix/sysv/linux/bits/time.h new file mode 100644 index 0000000..509cb2c --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/time.h @@ -0,0 +1,56 @@ +/* System-dependent timing definitions. Linux version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifdef __need_timeval +# undef __need_timeval +# ifndef _STRUCT_TIMEVAL +# define _STRUCT_TIMEVAL 1 +/* A time value that is accurate to the nearest + microsecond but also has a range of years. */ +struct timeval + { + time_t tv_sec; /* Seconds. */ + time_t tv_usec; /* Microseconds. */ + }; +# endif /* struct timeval */ +#endif /* need timeval */ + + +#ifndef _BITS_TIME_H +#define _BITS_TIME_H 1 + +/* ISO/IEC 9899:1990 7.12.1: + The macro `CLOCKS_PER_SEC' is the number per second of the value + returned by the `clock' function. */ +/* CAE XSH, Issue 4, Version 2: + The value of CLOCKS_PER_SEC is required to be 1 million on all + XSI-conformant systems. */ +# define CLOCKS_PER_SEC 1000000 + +# ifndef __STRICT_ANSI__ +/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK + presents the real value for clock ticks per second for the system. */ +# define CLK_TCK 100 +# endif + +#endif /* bits/time.h */ diff --git a/sysdeps/unix/sysv/linux/bits/types.h b/sysdeps/unix/sysv/linux/bits/types.h new file mode 100644 index 0000000..34f4682 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/types.h @@ -0,0 +1,103 @@ +/* Copyright (C) 1991, 92, 94, 95, 96, 97 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_TYPES_H +#define _BITS_TYPES_H 1 + +#include + +/* Convenience types. */ +typedef unsigned char __u_char; +typedef unsigned short __u_short; +typedef unsigned int __u_int; +typedef unsigned long __u_long; +#ifdef __GNUC__ +typedef unsigned long long int __u_quad_t; +typedef long long int __quad_t; +#else +typedef struct + { + long int __val[2]; + } __quad_t; +typedef struct + { + __u_long __val[2]; + } __u_quad_t; +#endif +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef signed short int __int16_t; +typedef unsigned short int __uint16_t; +typedef signed int __int32_t; +typedef unsigned int __uint32_t; +#ifdef __GNUC__ +typedef signed long long int __int64_t; +typedef unsigned long long int __uint64_t; +#endif +typedef __quad_t *__qaddr_t; + +typedef __u_quad_t __dev_t; /* Type of device numbers. */ +typedef __u_int __uid_t; /* Type of user identifications. */ +typedef __u_int __gid_t; /* Type of group identifications. */ +typedef __u_long __ino_t; /* Type of file serial numbers. */ +typedef __u_int __mode_t; /* Type of file attribute bitmasks. */ +typedef __u_int __nlink_t; /* Type of file link counts. */ +typedef long int __off_t; /* Type of file sizes and offsets. */ +typedef __quad_t __loff_t; /* Type of file sizes and offsets. */ +typedef int __pid_t; /* Type of process identifications. */ +typedef int __ssize_t; /* Type of a byte count, or error. */ + +typedef struct + { + int __val[2]; + } __fsid_t; /* Type of file system IDs. */ + +/* Everythin' else. */ +typedef int __daddr_t; /* The type of a disk address. */ +typedef char *__caddr_t; +typedef long int __time_t; +typedef long int __swblk_t; /* Type of a swap block maybe? */ + +typedef long int __clock_t; + +/* One element in the file descriptor mask array. */ +typedef unsigned long int __fd_mask; + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + +/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ +#define __NFDBITS (8 * sizeof (__fd_mask)) +#define __FDELT(d) ((d) / __NFDBITS) +#define __FDMASK(d) (1 << ((d) % __NFDBITS)) + +/* fd_set for select and pselect. */ +typedef struct + { + /* XPG4.2 requires this member name. */ + __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS]; + } __fd_set; + + +typedef int __key_t; + +#endif /* bits/types.h */ diff --git a/sysdeps/unix/sysv/linux/bits/uio.h b/sysdeps/unix/sysv/linux/bits/uio.h new file mode 100644 index 0000000..3f1dc01 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/uio.h @@ -0,0 +1,46 @@ +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_UIO_H +#error "Never use directly; include instead." +#endif + + +#include + + +/* We should normally use the Linux kernel header file to define this + type and macros but this calls for trouble because of the header + includes other kernel headers. */ + +/* Size of object which can be written atomically. + + This macro has different values in different kernel versions. The + latest versions of ther kernel use 1024 and this is good choice. Since + the C library implementation of readv/writev is able to emulate the + functionality even if the currently running kernel does not support + this large value the readv/writev call will not fail because of this. */ +#define UIO_MAXIOV 1024 + + +/* Structure for scatter/gather I/O. */ +struct iovec + { + void *iov_base; /* Pointer to data. */ + size_t iov_len; /* Length of data. */ + }; diff --git a/sysdeps/unix/sysv/linux/bits/ustat.h b/sysdeps/unix/sysv/linux/bits/ustat.h new file mode 100644 index 0000000..526069a --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/ustat.h @@ -0,0 +1,27 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +struct ustat + { + __daddr_t f_tfree; + __ino_t f_tinode; + char f_fname[6]; + char f_fpack[6]; + }; diff --git a/sysdeps/unix/sysv/linux/bits/utsname.h b/sysdeps/unix/sysv/linux/bits/utsname.h new file mode 100644 index 0000000..64e2ab5 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/utsname.h @@ -0,0 +1,25 @@ +/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Length of the entries in `struct utsname' is 65. */ +#define _UTSNAME_LENGTH 65 + +/* Linux provides as additional information in the `struct utsname' + the name of the current domain. Define _UTSNAME_DOMAIN_LENGTH + to a value != 0 to activate this entry. */ +#define _UTSNAME_DOMAIN_LENGTH _UTSNAME_LENGTH diff --git a/sysdeps/unix/sysv/linux/bits/waitflags.h b/sysdeps/unix/sysv/linux/bits/waitflags.h new file mode 100644 index 0000000..ba3528b --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/waitflags.h @@ -0,0 +1,29 @@ +/* Definitions of flag bits for `waitpid' et al. + Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_WAIT_H +#error "Never use directly; include instead." +#endif + + +/* Bits in the third argument to `waitpid'. */ +#define WNOHANG 1 /* Don't block waiting. */ +#define WUNTRACED 2 /* Report status of stopped children. */ + +#define __WCLONE 0x80000000 /* Wait for cloned process. */ diff --git a/sysdeps/unix/sysv/linux/direntry.h b/sysdeps/unix/sysv/linux/direntry.h deleted file mode 100644 index ccf5080..0000000 --- a/sysdeps/unix/sysv/linux/direntry.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _DIRENTRY_H -#define _DIRENTRY_H 1 - -struct dirent - { - long int d_ino; - __off_t d_off; - unsigned short int d_reclen; - unsigned char d_type; - char d_name[256]; /* We must not include limits.h! */ - }; -#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 - -#endif /* _DIRENTRY_H */ diff --git a/sysdeps/unix/sysv/linux/errnos.h b/sysdeps/unix/sysv/linux/errnos.h deleted file mode 100644 index f676d35..0000000 --- a/sysdeps/unix/sysv/linux/errnos.h +++ /dev/null @@ -1,59 +0,0 @@ -/* Error constants. Linux specific version. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef _ERRNO_H - -# undef EDOM -# undef ERANGE -# include - -# ifndef __ASSEMBLER__ -/* We now need a declaration of the `errno' variable. */ -extern int errno; - -/* Function to get address of global `errno' variable. */ -extern int *__errno_location __P ((void)) __attribute__ ((__const__)); - -# if defined _LIBC -# ifdef _LIBC_REENTRANT -static inline int -__set_errno (int __err) -{ - return *__errno_location () = errno = __err; -} -# define __set_errno __set_errno -# else /* !_LIBC_REENTRANT */ -# define __set_errno(val) errno = (val) -# endif /* _LIBC_REENTRANT */ -# endif /* _LIBC */ - -# if !defined _LIBC || defined _LIBC_REENTRANT -/* When using threads, errno is a per-thread value. */ -# define errno (*__errno_location ()) -# endif -# endif /* !__ASSEMBLER__ */ -#endif /* _ERRNO_H */ - -#if !defined (_ERRNO_H) && defined (__need_Emath) -/* This is ugly but the kernel header is not clean enough. We must - define only the values EDOM and ERANGE in case __need_Emath is - defined. The value is the same for all Linux ports. */ -# define EDOM 33 /* Math argument out of domain of function. */ -# define ERANGE 34 /* Math result not representable. */ -#endif /* !_ERRNO_H && __need_Emath */ diff --git a/sysdeps/unix/sysv/linux/fcntlbits.h b/sysdeps/unix/sysv/linux/fcntlbits.h deleted file mode 100644 index f6ba880..0000000 --- a/sysdeps/unix/sysv/linux/fcntlbits.h +++ /dev/null @@ -1,99 +0,0 @@ -/* O_*, F_*, FD_* bit values for Linux. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _FCNTLBITS_H -#define _FCNTLBITS_H 1 - -#include - - -/* In GNU, read and write are bits (unlike BSD). */ -#ifdef __USE_GNU -#define O_READ O_RDONLY /* Open for reading. */ -#define O_WRITE O_WRONLY /* Open for writing. */ -#endif -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define O_FSYNC O_SYNC -#define O_ASYNC 020000 - -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get f_flags */ -#define F_SETFD 2 /* set f_flags */ -#define F_GETFL 3 /* more flags (cloexec) */ -#define F_SETFL 4 -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ - -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* 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 */ - -struct flock - { - short int l_type; - short int l_whence; - __off_t l_start; - __off_t l_len; - __pid_t l_pid; - }; - - -/* Define some more compatibility macros to be backward compatible with - BSD systems which did not managed to hide these kernel macros. */ -#ifdef __USE_BSD -#define FAPPEND O_APPEND -#define FFSYNC O_FSYNC -#define FASYNC O_ASYNC -#define FNONBLOCK O_NONBLOCK -#define FNDELAY O_NDELAY -#endif /* Use BSD. */ - -#endif /* fcntlbits.h */ diff --git a/sysdeps/unix/sysv/linux/gnu/types.h b/sysdeps/unix/sysv/linux/gnu/types.h deleted file mode 100644 index 872fc4e..0000000 --- a/sysdeps/unix/sysv/linux/gnu/types.h +++ /dev/null @@ -1,89 +0,0 @@ -/* Copyright (C) 1991, 92, 94, 95, 96, 97 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _GNU_TYPES_H -#define _GNU_TYPES_H 1 - -#include - -/* Convenience types. */ -typedef unsigned char __u_char; -typedef unsigned short __u_short; -typedef unsigned int __u_int; -typedef unsigned long __u_long; -#ifdef __GNUC__ -typedef unsigned long long int __u_quad_t; -typedef long long int __quad_t; -#else -typedef struct - { - long int __val[2]; - } __quad_t; -typedef struct - { - __u_long __val[2]; - } __u_quad_t; -#endif -typedef __quad_t *__qaddr_t; - -typedef __u_quad_t __dev_t; /* Type of device numbers. */ -typedef __u_int __uid_t; /* Type of user identifications. */ -typedef __u_int __gid_t; /* Type of group identifications. */ -typedef __u_long __ino_t; /* Type of file serial numbers. */ -typedef __u_int __mode_t; /* Type of file attribute bitmasks. */ -typedef __u_int __nlink_t; /* Type of file link counts. */ -typedef long int __off_t; /* Type of file sizes and offsets. */ -typedef __quad_t __loff_t; /* Type of file sizes and offsets. */ -typedef int __pid_t; /* Type of process identifications. */ -typedef int __ssize_t; /* Type of a byte count, or error. */ - -typedef struct - { - int __val[2]; - } __fsid_t; /* Type of file system IDs. */ - -/* Everythin' else. */ -typedef int __daddr_t; /* The type of a disk address. */ -typedef char *__caddr_t; -typedef long int __time_t; -typedef long int __swblk_t; /* Type of a swap block maybe? */ - -typedef long int __clock_t; - -/* One element in the file descriptor mask array. */ -typedef unsigned long int __fd_mask; - -/* Number of descriptors that can fit in an `fd_set'. */ -#define __FD_SETSIZE 1024 - -/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ -#define __NFDBITS (8 * sizeof (__fd_mask)) -#define __FDELT(d) ((d) / __NFDBITS) -#define __FDMASK(d) (1 << ((d) % __NFDBITS)) - -/* fd_set for select and pselect. */ -typedef struct - { - /* XPG4.2 requires this member name. */ - __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS]; - } __fd_set; - - -typedef int __key_t; - -#endif /* gnu/types.h */ diff --git a/sysdeps/unix/sysv/linux/i386/clone.S b/sysdeps/unix/sysv/linux/i386/clone.S index 3cdd2dc..7f758a5 100644 --- a/sysdeps/unix/sysv/linux/i386/clone.S +++ b/sysdeps/unix/sysv/linux/i386/clone.S @@ -22,7 +22,7 @@ #include #define _ERRNO_H 1 -#include +#include /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ diff --git a/sysdeps/unix/sysv/linux/i386/profil-counter.h b/sysdeps/unix/sysv/linux/i386/profil-counter.h index 96b38e2..5675474 100644 --- a/sysdeps/unix/sysv/linux/i386/profil-counter.h +++ b/sysdeps/unix/sysv/linux/i386/profil-counter.h @@ -17,7 +17,7 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include +#include void profil_counter (int signo, struct sigcontext sc) diff --git a/sysdeps/unix/sysv/linux/i386/socket.S b/sysdeps/unix/sysv/linux/i386/socket.S index 441c143..7c539e1 100644 --- a/sysdeps/unix/sysv/linux/i386/socket.S +++ b/sysdeps/unix/sysv/linux/i386/socket.S @@ -17,7 +17,7 @@ Boston, MA 02111-1307, USA. */ #include -#include +#include #define P(a, b) P2(a, b) #define P2(a, b) a##b diff --git a/sysdeps/unix/sysv/linux/ioctl-types.h b/sysdeps/unix/sysv/linux/ioctl-types.h deleted file mode 100644 index 91fcc26..0000000 --- a/sysdeps/unix/sysv/linux/ioctl-types.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Structure types for pre-termios terminal ioctls. Linux version. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _IOCTL_TYPES_H -#define _IOCTL_TYPES_H 1 - -/* Get definition of constants for use with `ioctl'. */ -#include - - -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 - - -#endif /* ioctl-types.h */ diff --git a/sysdeps/unix/sysv/linux/ioctls.h b/sysdeps/unix/sysv/linux/ioctls.h deleted file mode 100644 index 8b53269..0000000 --- a/sysdeps/unix/sysv/linux/ioctls.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _IOCTLS_H -#define _IOCTLS_H 1 - -/* Use the definitions from the kernel header files. */ -#include -#include - -#endif /* ioctls.h */ diff --git a/sysdeps/unix/sysv/linux/iovec.h b/sysdeps/unix/sysv/linux/iovec.h deleted file mode 100644 index 430edfc..0000000 --- a/sysdeps/unix/sysv/linux/iovec.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _IOVEC_H - -#define _IOVEC_H 1 - -#include - - -/* We should normally use the Linux kernel header file to define this - type and macros but this calls for trouble because of the header - includes other kernel headers. */ - -/* Size of object which can be written atomically. - - This macro has different values in different kernel versions. The - latest versions of ther kernel use 1024 and this is good choice. Since - the C library implementation of readv/writev is able to emulate the - functionality even if the currently running kernel does not support - this large value the readv/writev call will not fail because of this. */ -#define UIO_MAXIOV 1024 - - -/* Structure for scatter/gather I/O. */ -struct iovec - { - void *iov_base; /* Pointer to data. */ - size_t iov_len; /* Length of data. */ - }; - -#endif /* iovec.h */ diff --git a/sysdeps/unix/sysv/linux/kernel_termios.h b/sysdeps/unix/sysv/linux/kernel_termios.h new file mode 100644 index 0000000..78c6f4a --- /dev/null +++ b/sysdeps/unix/sysv/linux/kernel_termios.h @@ -0,0 +1,38 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _KERNEL_TERMIOS_H +#define _KERNEL_TERMIOS_H 1 +/* The following corresponds to the values from the Linux 2.1.20 kernel. */ + +/* We need the definition of tcflag_t, cc_t, and speed_t. */ +#include + +#define __KERNEL_NCCS 19 + +struct __kernel_termios + { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_line; /* line discipline */ + cc_t c_cc[__KERNEL_NCCS]; /* control characters */ + }; + +#endif /* kernel_termios.h */ diff --git a/sysdeps/unix/sysv/linux/local_lim.h b/sysdeps/unix/sysv/linux/local_lim.h deleted file mode 100644 index 7ce4230..0000000 --- a/sysdeps/unix/sysv/linux/local_lim.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Minimum guaranteed maximum values for system limits. Linux version. - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* The kernel sources contain a file with all the needed information. */ -#include diff --git a/sysdeps/unix/sysv/linux/m68k/clone.S b/sysdeps/unix/sysv/linux/m68k/clone.S index ef9716d..d553ab7 100644 --- a/sysdeps/unix/sysv/linux/m68k/clone.S +++ b/sysdeps/unix/sysv/linux/m68k/clone.S @@ -21,7 +21,7 @@ #include #define _ERRNO_H 1 -#include +#include /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ diff --git a/sysdeps/unix/sysv/linux/m68k/socket.S b/sysdeps/unix/sysv/linux/m68k/socket.S index d0741af..1508b87 100644 --- a/sysdeps/unix/sysv/linux/m68k/socket.S +++ b/sysdeps/unix/sysv/linux/m68k/socket.S @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include -#include +#include #define P(a, b) P2(a, b) #define P2(a, b) a##b diff --git a/sysdeps/unix/sysv/linux/netinet/ip.h b/sysdeps/unix/sysv/linux/netinet/ip.h index 6d50bb4..bf4e016 100644 --- a/sysdeps/unix/sysv/linux/netinet/ip.h +++ b/sysdeps/unix/sysv/linux/netinet/ip.h @@ -37,7 +37,7 @@ struct timestamp u_int8_t overflow:4; u_int8_t flags:4; #else -#error "Please fix " +#error "Please fix " #endif u_int32_t data[9]; }; @@ -72,7 +72,7 @@ struct iphdr u_int8_t version:4; u_int8_t ihl:4; #else -#error "Please fix " +#error "Please fix " #endif u_int8_t tos; u_int16_t tot_len; diff --git a/sysdeps/unix/sysv/linux/netinet/tcp.h b/sysdeps/unix/sysv/linux/netinet/tcp.h index b7bf085..60e67c5 100644 --- a/sysdeps/unix/sysv/linux/netinet/tcp.h +++ b/sysdeps/unix/sysv/linux/netinet/tcp.h @@ -99,7 +99,7 @@ struct tcphdr { syn:1, fin:1; #else -#error "Adjust your defines" +#error "Adjust your defines" #endif u_int16_t window; u_int16_t check; diff --git a/sysdeps/unix/sysv/linux/netipx/ipx.h b/sysdeps/unix/sysv/linux/netipx/ipx.h index 170dfdf..ec93c81 100644 --- a/sysdeps/unix/sysv/linux/netipx/ipx.h +++ b/sysdeps/unix/sysv/linux/netipx/ipx.h @@ -19,10 +19,94 @@ #ifndef __NETIPX_IPX_H #define __NETIPX_IPX_H 1 -#include -#include +#include + +#include +#include + +__BEGIN_DECLS #define SOL_IPX 256 /* sockopt level */ -#define IPX_TYPE 1 + +#define IPX_TYPE 1 +#define IPX_NODE_LEN 6 +#define IPX_MTU 576 + +struct sockaddr_ipx + { + sa_family_t sipx_family; + u_int16_t sipx_port; + u_int32_t sipx_network; + unsigned char sipx_node[IPX_NODE_LEN]; + u_int8_t sipx_type; + unsigned char sipx_zero; /* 16 byte fill */ + }; + +/* + * So we can fit the extra info for SIOCSIFADDR into the address nicely + */ + +#define sipx_special sipx_port +#define sipx_action sipx_zero +#define IPX_DLTITF 0 +#define IPX_CRTITF 1 + +typedef struct ipx_route_definition + { + unsigned long ipx_network; + unsigned long ipx_router_network; + unsigned char ipx_router_node[IPX_NODE_LEN]; + } +ipx_route_definition; + +typedef struct ipx_interface_definition + { + unsigned long ipx_network; + unsigned char ipx_device[16]; + unsigned char ipx_dlink_type; +#define IPX_FRAME_NONE 0 +#define IPX_FRAME_SNAP 1 +#define IPX_FRAME_8022 2 +#define IPX_FRAME_ETHERII 3 +#define IPX_FRAME_8023 4 +#define IPX_FRAME_TR_8022 5 + unsigned char ipx_special; +#define IPX_SPECIAL_NONE 0 +#define IPX_PRIMARY 1 +#define IPX_INTERNAL 2 + unsigned char ipx_node[IPX_NODE_LEN]; + } +ipx_interface_definition; + +typedef struct ipx_config_data + { + unsigned char ipxcfg_auto_select_primary; + unsigned char ipxcfg_auto_create_interfaces; + } +ipx_config_data; + +/* + * OLD Route Definition for backward compatibility. + */ + +struct ipx_route_def + { + unsigned long ipx_network; + unsigned long ipx_router_network; +#define IPX_ROUTE_NO_ROUTER 0 + unsigned char ipx_router_node[IPX_NODE_LEN]; + unsigned char ipx_device[16]; + unsigned short ipx_flags; +#define IPX_RT_SNAP 8 +#define IPX_RT_8022 4 +#define IPX_RT_BLUEBOOK 2 +#define IPX_RT_ROUTED 1 + }; + +#define SIOCAIPXITFCRT (SIOCPROTOPRIVATE) +#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE + 1) +#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE + 2) + +__END_DECLS #endif /* netipx/ipx.h */ diff --git a/sysdeps/unix/sysv/linux/posix_opt.h b/sysdeps/unix/sysv/linux/posix_opt.h deleted file mode 100644 index a467acf..0000000 --- a/sysdeps/unix/sysv/linux/posix_opt.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Define POSIX options for Linux. - Copyright (C) 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _POSIX_OPT_H -#define _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 1 - -/* Synchronizing file data is supported. */ -#define _POSIX_SYNCHRONIZED_IO 1 - -/* The fsync function is present. */ -#define _POSIX_FSYNC 1 - -/* Mapping of files to memory is supported. */ -#define _POSIX_MAPPED_FILES 1 - -/* Locking of all memory is supported. */ -#define _POSIX_MEMLOCK 1 - -/* Locking of ranges of memory is supported. */ -#define _POSIX_MEMLOCK_RANGE 1 - -/* Setting of memory protections is supported. */ -#define _POSIX_MEMORY_PROTECTION 1 - -/* Implementation supports `poll' function. */ -#define _POSIX_POLL 1 - -/* Implementation supports `select' and `pselect' functions. */ -#define _POSIX_SELECT 1 - -/* Only root can change owner of file. */ -#define _POSIX_CHOWN_RESTRICTED 1 - -/* `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 - -/* XPG4.2 shared memory is supported. */ -#define _XOPEN_SHM 1 - -#endif /* posix_opt.h */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h new file mode 100644 index 0000000..9e26956 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h @@ -0,0 +1 @@ +#include diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h new file mode 100644 index 0000000..4c6073b --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h @@ -0,0 +1,280 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _TERMBITS_H +#define _TERMBITS_H 1 + +typedef unsigned char cc_t; +typedef unsigned int speed_t; +typedef unsigned int tcflag_t; + +/* + * termios type and macro definitions. Be careful about adding stuff + * to this file since it's used in GNU libc and there are strict rules + * concerning namespace pollution. + */ + +#define NCCS 32 +struct termios { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_line; /* line discipline (== c_cc[19]) */ + cc_t c_cc[NCCS]; /* control characters */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ +}; + +/* c_cc characters */ +#define VINTR 0 +#define VQUIT 1 +#define VERASE 2 +#define VKILL 3 +#define VEOF 4 +#define VMIN 5 +#define VEOL 6 +#define VTIME 7 +#define VEOL2 8 +#define VSWTC 9 + +#define VWERASE 10 +#define VREPRINT 11 +#define VSUSP 12 +#define VSTART 13 +#define VSTOP 14 +#define VLNEXT 15 +#define VDISCARD 16 + +/* c_iflag bits */ +#define IGNBRK 0000001 +#define BRKINT 0000002 +#define IGNPAR 0000004 +#define PARMRK 0000010 +#define INPCK 0000020 +#define ISTRIP 0000040 +#define INLCR 0000100 +#define IGNCR 0000200 +#define ICRNL 0000400 +#define IXON 0001000 +#define IXOFF 0002000 +#if !defined(KERNEL) || defined(__USE_BSD) + /* POSIX.1 doesn't want these... */ +# define IXANY 0004000 +# define IUCLC 0010000 +# define IMAXBEL 0020000 +#endif + +/* c_oflag bits */ +#define OPOST 0000001 +#define ONLCR 0000002 +#define OLCUC 0000004 + +#define OCRNL 0000010 +#define ONOCR 0000020 +#define ONLRET 0000040 + +#define OFILL 00000100 +#define OFDEL 00000200 +#define NLDLY 00001400 +#define NL0 00000000 +#define NL1 00000400 +#define NL2 00001000 +#define NL3 00001400 +#define TABDLY 00006000 +#define TAB0 00000000 +#define TAB1 00002000 +#define TAB2 00004000 +#define TAB3 00006000 +#define CRDLY 00030000 +#define CR0 00000000 +#define CR1 00010000 +#define CR2 00020000 +#define CR3 00030000 +#define FFDLY 00040000 +#define FF0 00000000 +#define FF1 00040000 +#define BSDLY 00100000 +#define BS0 00000000 +#define BS1 00100000 +#define VTDLY 00200000 +#define VT0 00000000 +#define VT1 00200000 +#define XTABS 01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */ + +/* c_cflag bit meaning */ +#define CBAUD 0000377 +#define B0 0000000 /* hang up */ +#define B50 0000001 +#define B75 0000002 +#define B110 0000003 +#define B134 0000004 +#define B150 0000005 +#define B200 0000006 +#define B300 0000007 +#define B600 0000010 +#define B1200 0000011 +#define B1800 0000012 +#define B2400 0000013 +#define B4800 0000014 +#define B9600 0000015 +#define B19200 0000016 +#define B38400 0000017 +#define EXTA B19200 +#define EXTB B38400 +#define CBAUDEX 0000020 +#define B57600 00020 +#define B115200 00021 +#define B230400 00022 +#define B460800 00023 + +#define CSIZE 00001400 +#define CS5 00000000 +#define CS6 00000400 +#define CS7 00001000 +#define CS8 00001400 + +#define CSTOPB 00002000 +#define CREAD 00004000 +#define PARENB 00010000 +#define PARODD 00020000 +#define HUPCL 00040000 + +#define CLOCAL 00100000 +#define CRTSCTS 020000000000 /* flow control */ + +/* c_lflag bits */ +#define ISIG 0x00000080 +#define ICANON 0x00000100 +#define XCASE 0x00004000 +#define ECHO 0x00000008 +#define ECHOE 0x00000002 +#define ECHOK 0x00000004 +#define ECHONL 0x00000010 +#define NOFLSH 0x80000000 +#define TOSTOP 0x00400000 +#define ECHOCTL 0x00000040 +#define ECHOPRT 0x00000020 +#define ECHOKE 0x00000001 +#define FLUSHO 0x00800000 +#define PENDIN 0x20000000 +#define IEXTEN 0x00000400 + +/* Values for the ACTION argument to `tcflow'. */ +#define TCOOFF 0 +#define TCOON 1 +#define TCIOFF 2 +#define TCION 3 + +/* Values for the QUEUE_SELECTOR argument to `tcflush'. */ +#define TCIFLUSH 0 +#define TCOFLUSH 1 +#define TCIOFLUSH 2 + +/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ +#define TCSANOW 0 +#define TCSADRAIN 1 +#define TCSAFLUSH 2 + +struct sgttyb { + char sg_ispeed; + char sg_ospeed; + char sg_erase; + char sg_kill; + short sg_flags; +}; + +struct tchars { + char t_intrc; + char t_quitc; + char t_startc; + char t_stopc; + char t_eofc; + char t_brkc; +}; + +struct ltchars { + char t_suspc; + char t_dsuspc; + char t_rprntc; + char t_flushc; + char t_werasc; + char t_lnextc; +}; + +/* Used for packet mode */ +#define TIOCPKT_DATA 0 +#define TIOCPKT_FLUSHREAD 1 +#define TIOCPKT_FLUSHWRITE 2 +#define TIOCPKT_STOP 4 +#define TIOCPKT_START 8 +#define TIOCPKT_NOSTOP 16 +#define TIOCPKT_DOSTOP 32 + +struct winsize { + unsigned short ws_row; + unsigned short ws_col; + unsigned short ws_xpixel; + unsigned short ws_ypixel; +}; + +#define NCC 10 +struct termio { + unsigned short c_iflag; /* input mode flags */ + unsigned short c_oflag; /* output mode flags */ + unsigned short c_cflag; /* control mode flags */ + unsigned short c_lflag; /* local mode flags */ + unsigned char c_line; /* line discipline */ + unsigned char c_cc[NCC]; /* control characters */ +}; + +/* c_cc characters */ +#define _VINTR 0 +#define _VQUIT 1 +#define _VERASE 2 +#define _VKILL 3 +#define _VEOF 4 +#define _VMIN 5 +#define _VEOL 6 +#define _VTIME 7 +#define _VEOL2 8 +#define _VSWTC 9 + +/* 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 */ +#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ + +/* line disciplines */ +#define N_TTY 0 +#define N_SLIP 1 +#define N_MOUSE 2 +#define N_PPP 3 + +#endif /* _TERMBITS_H */ diff --git a/sysdeps/unix/sysv/linux/powerpc/clone.S b/sysdeps/unix/sysv/linux/powerpc/clone.S index 068b14c..cca63fe 100644 --- a/sysdeps/unix/sysv/linux/powerpc/clone.S +++ b/sysdeps/unix/sysv/linux/powerpc/clone.S @@ -19,7 +19,7 @@ #include #define _ERRNO_H 1 -#include +#include /* This is the only really unusual system call in PPC linux, but not because of any weirdness in the system call itself; because of diff --git a/sysdeps/unix/sysv/linux/powerpc/ioctl-types.h b/sysdeps/unix/sysv/linux/powerpc/ioctl-types.h deleted file mode 100644 index 9e26956..0000000 --- a/sysdeps/unix/sysv/linux/powerpc/ioctl-types.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel_termios.h b/sysdeps/unix/sysv/linux/powerpc/kernel_termios.h index acf62a4..9a5e830 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel_termios.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel_termios.h @@ -1,9 +1,27 @@ -#ifndef _SYS_KERNEL_TERMIOS_H -#define _SYS_KERNEL_TERMIOS_H 1 +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _KERNEL_TERMIOS_H +#define _KERNEL_TERMIOS_H 1 /* The following corresponds to the values from the Linux 2.0.28 kernel. */ /* We need the definition of tcflag_t, cc_t, and speed_t. */ -#include +#include #define __KERNEL_NCCS 19 @@ -22,4 +40,4 @@ struct __kernel_termios #define _HAVE_C_ISPEED 1 #define _HAVE_C_OSPEED 1 -#endif /* sys/kernel_termios.h */ +#endif /* kernel_termios.h */ diff --git a/sysdeps/unix/sysv/linux/powerpc/socket.S b/sysdeps/unix/sysv/linux/powerpc/socket.S index 305aba9..904bca4 100644 --- a/sysdeps/unix/sysv/linux/powerpc/socket.S +++ b/sysdeps/unix/sysv/linux/powerpc/socket.S @@ -17,7 +17,7 @@ Boston, MA 02111-1307, USA. */ #include -#include +#include #define P(a, b) P2(a, b) #define P2(a, b) a##b diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/kernel_termios.h b/sysdeps/unix/sysv/linux/powerpc/sys/kernel_termios.h deleted file mode 100644 index c5e9e26..0000000 --- a/sysdeps/unix/sysv/linux/powerpc/sys/kernel_termios.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SYS_KERNEL_TERMIOS_H -#define _SYS_KERNEL_TERMIOS_H 1 -/* The following corresponds to the values from the Linux 2.0.28 kernel. */ - -/* We need the definition of tcflag_t, cc_t, and speed_t. */ -#include - -#define __KERNEL_NCCS 19 - -struct __kernel_termios - { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_cc[__KERNEL_NCCS]; /* control characters */ - cc_t c_line; /* line discipline */ - int c_ispeed; /* input speed */ - int c_ospeed; /* output speed */ - }; - -#define _HAVE_C_ISPEED 1 -#define _HAVE_C_OSPEED 1 - -#endif /* sys/kernel_termios.h */ diff --git a/sysdeps/unix/sysv/linux/powerpc/termbits.h b/sysdeps/unix/sysv/linux/powerpc/termbits.h deleted file mode 100644 index 4c6073b..0000000 --- a/sysdeps/unix/sysv/linux/powerpc/termbits.h +++ /dev/null @@ -1,280 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _TERMBITS_H -#define _TERMBITS_H 1 - -typedef unsigned char cc_t; -typedef unsigned int speed_t; -typedef unsigned int tcflag_t; - -/* - * termios type and macro definitions. Be careful about adding stuff - * to this file since it's used in GNU libc and there are strict rules - * concerning namespace pollution. - */ - -#define NCCS 32 -struct termios { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline (== c_cc[19]) */ - cc_t c_cc[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - -/* c_cc characters */ -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VMIN 5 -#define VEOL 6 -#define VTIME 7 -#define VEOL2 8 -#define VSWTC 9 - -#define VWERASE 10 -#define VREPRINT 11 -#define VSUSP 12 -#define VSTART 13 -#define VSTOP 14 -#define VLNEXT 15 -#define VDISCARD 16 - -/* c_iflag bits */ -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IXON 0001000 -#define IXOFF 0002000 -#if !defined(KERNEL) || defined(__USE_BSD) - /* POSIX.1 doesn't want these... */ -# define IXANY 0004000 -# define IUCLC 0010000 -# define IMAXBEL 0020000 -#endif - -/* c_oflag bits */ -#define OPOST 0000001 -#define ONLCR 0000002 -#define OLCUC 0000004 - -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 - -#define OFILL 00000100 -#define OFDEL 00000200 -#define NLDLY 00001400 -#define NL0 00000000 -#define NL1 00000400 -#define NL2 00001000 -#define NL3 00001400 -#define TABDLY 00006000 -#define TAB0 00000000 -#define TAB1 00002000 -#define TAB2 00004000 -#define TAB3 00006000 -#define CRDLY 00030000 -#define CR0 00000000 -#define CR1 00010000 -#define CR2 00020000 -#define CR3 00030000 -#define FFDLY 00040000 -#define FF0 00000000 -#define FF1 00040000 -#define BSDLY 00100000 -#define BS0 00000000 -#define BS1 00100000 -#define VTDLY 00200000 -#define VT0 00000000 -#define VT1 00200000 -#define XTABS 01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */ - -/* c_cflag bit meaning */ -#define CBAUD 0000377 -#define B0 0000000 /* hang up */ -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 -#define EXTA B19200 -#define EXTB B38400 -#define CBAUDEX 0000020 -#define B57600 00020 -#define B115200 00021 -#define B230400 00022 -#define B460800 00023 - -#define CSIZE 00001400 -#define CS5 00000000 -#define CS6 00000400 -#define CS7 00001000 -#define CS8 00001400 - -#define CSTOPB 00002000 -#define CREAD 00004000 -#define PARENB 00010000 -#define PARODD 00020000 -#define HUPCL 00040000 - -#define CLOCAL 00100000 -#define CRTSCTS 020000000000 /* flow control */ - -/* c_lflag bits */ -#define ISIG 0x00000080 -#define ICANON 0x00000100 -#define XCASE 0x00004000 -#define ECHO 0x00000008 -#define ECHOE 0x00000002 -#define ECHOK 0x00000004 -#define ECHONL 0x00000010 -#define NOFLSH 0x80000000 -#define TOSTOP 0x00400000 -#define ECHOCTL 0x00000040 -#define ECHOPRT 0x00000020 -#define ECHOKE 0x00000001 -#define FLUSHO 0x00800000 -#define PENDIN 0x20000000 -#define IEXTEN 0x00000400 - -/* Values for the ACTION argument to `tcflow'. */ -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -/* Values for the QUEUE_SELECTOR argument to `tcflush'. */ -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -struct sgttyb { - char sg_ispeed; - char sg_ospeed; - char sg_erase; - char sg_kill; - short sg_flags; -}; - -struct tchars { - char t_intrc; - char t_quitc; - char t_startc; - char t_stopc; - char t_eofc; - char t_brkc; -}; - -struct ltchars { - char t_suspc; - char t_dsuspc; - char t_rprntc; - char t_flushc; - char t_werasc; - char t_lnextc; -}; - -/* Used for packet mode */ -#define TIOCPKT_DATA 0 -#define TIOCPKT_FLUSHREAD 1 -#define TIOCPKT_FLUSHWRITE 2 -#define TIOCPKT_STOP 4 -#define TIOCPKT_START 8 -#define TIOCPKT_NOSTOP 16 -#define TIOCPKT_DOSTOP 32 - -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define NCC 10 -struct termio { - unsigned short c_iflag; /* input mode flags */ - unsigned short c_oflag; /* output mode flags */ - unsigned short c_cflag; /* control mode flags */ - unsigned short c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCC]; /* control characters */ -}; - -/* c_cc characters */ -#define _VINTR 0 -#define _VQUIT 1 -#define _VERASE 2 -#define _VKILL 3 -#define _VEOF 4 -#define _VMIN 5 -#define _VEOL 6 -#define _VTIME 7 -#define _VEOL2 8 -#define _VSWTC 9 - -/* 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 */ -#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ - -/* line disciplines */ -#define N_TTY 0 -#define N_SLIP 1 -#define N_MOUSE 2 -#define N_PPP 3 - -#endif /* _TERMBITS_H */ diff --git a/sysdeps/unix/sysv/linux/resourcebits.h b/sysdeps/unix/sysv/linux/resourcebits.h deleted file mode 100644 index 05cae83..0000000 --- a/sysdeps/unix/sysv/linux/resourcebits.h +++ /dev/null @@ -1,186 +0,0 @@ -/* Bit values & structures for resource limits. Linux version. - Copyright (C) 1994, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include - -/* 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 = RLIMIT_CPU, -#undef RLIMIT_CPU - RLIMIT_CPU = _RLIMIT_CPU, -#define RLIMIT_CPU RLIMIT_CPU - - /* Largest file that can be created, in bytes. */ - _RLIMIT_FSIZE = RLIMIT_FSIZE, -#undef RLIMIT_FSIZE - RLIMIT_FSIZE = _RLIMIT_FSIZE, -#define RLIMIT_FSIZE RLIMIT_FSIZE - - /* Maximum size of data segment, in bytes. */ - _RLIMIT_DATA = RLIMIT_DATA, -#undef RLIMIT_DATA - RLIMIT_DATA = _RLIMIT_DATA, -#define RLIMIT_DATA RLIMIT_DATA - - /* Maximum size of stack segment, in bytes. */ - _RLIMIT_STACK = RLIMIT_STACK, -#undef RLIMIT_STACK - RLIMIT_STACK = _RLIMIT_STACK, -#define RLIMIT_STACK RLIMIT_STACK - - /* Largest core file that can be created, in bytes. */ - _RLIMIT_CORE = RLIMIT_CORE, -#undef RLIMIT_CORE - RLIMIT_CORE = _RLIMIT_CORE, -#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 = RLIMIT_RSS, -#undef RLIMIT_RSS - RLIMIT_RSS = _RLIMIT_RSS, -#define RLIMIT_RSS RLIMIT_RSS - - /* Number of open files. */ - _RLIMIT_NOFILE = RLIMIT_NOFILE, -#undef RLIMIT_NOFILE - RLIMIT_NOFILE = _RLIMIT_NOFILE, - RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ -#define RLIMIT_NOFILE RLIMIT_NOFILE -#define RLIMIT_OFILE RLIMIT_OFILE - - /* Address space limit (?) */ - _RLIMIT_AS = RLIMIT_AS, -#undef RLIMIT_AS - RLIMIT_AS = _RLIMIT_AS, -#define RLIMIT_AS RLIMIT_AS - - /* Number of processes. */ - _RLIMIT_NPROC = RLIMIT_NPROC, -#undef RLIMIT_NPROC - RLIMIT_NPROC = _RLIMIT_NPROC, -#define RLIMIT_NPROC RLIMIT_NPROC - - /* Locked-in-memory address space. */ - _RLIMIT_MEMLOCK = RLIMIT_MEMLOCK, -#undef RLIMIT_MEMLOCK - RLIMIT_MEMLOCK = _RLIMIT_MEMLOCK, -#define RLIMIT_MEMLOCK RLIMIT_MEMLOCK - - RLIMIT_NLIMITS = RLIM_NLIMITS, -#undef RLIM_NLIMITS - RLIM_NLIMITS = RLIMIT_NLIMITS, -#define RLIMIT_NLIMITS RLIMIT_NLIMITS -#define RLIM_NLIMITS RLIM_NLIMITS - - /* Value to indicate that there is no limit. */ - RLIM_INFINITY = (long int)(~0UL >> 1) -#define RLIM_INFINITY RLIM_INFINITY -}; - -struct rlimit -{ - /* The current (soft) limit. */ - long int rlim_cur; - /* The hard limit. */ - long int rlim_max; -}; - -/* 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 - - /* Both. */ - RUSAGE_BOTH = -2 -#define RUSAGE_BOTH RUSAGE_BOTH -}; - -#include /* For `struct timeval'. */ - -/* Structure which says how much of each resource has been used. */ -struct rusage -{ - /* Total amount of user time used. */ - struct timeval ru_utime; - /* Total amount of system time used. */ - struct timeval ru_stime; - /* Maximum resident set size (in kilobytes). */ - long int ru_maxrss; - /* Amount of sharing of text segment memory - with other processes (kilobyte-seconds). */ - long int ru_ixrss; - /* Amount of data segment memory used (kilobyte-seconds). */ - long int ru_idrss; - /* Amount of stack memory used (kilobyte-seconds). */ - long int ru_isrss; - /* Number of soft page faults (i.e. those serviced by reclaiming - a page from the list of pages awaiting reallocation. */ - long int ru_minflt; - /* Number of hard page faults (i.e. those that required I/O). */ - long int ru_majflt; - /* Number of times a process was swapped out of physical memory. */ - long int ru_nswap; - /* Number of input operations via the file system. Note: This - and `ru_oublock' do not include operations with the cache. */ - long int ru_inblock; - /* Number of output operations via the file system. */ - long int ru_oublock; - /* Number of IPC messages sent. */ - long int ru_msgsnd; - /* Number of IPC messages received. */ - long int ru_msgrcv; - /* Number of signals delivered. */ - long int ru_nsignals; - /* Number of voluntary context switches, i.e. because the process - gave up the process before it had to (usually to wait for some - resource to be available). */ - long int ru_nvcsw; - /* Number of involuntary context switches, i.e. a higher priority process - became runnable or the current process used up its time slice. */ - long int ru_nivcsw; -}; - -/* 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. */ - PRIO_PGRP = 1, /* WHO is a process group ID. */ - PRIO_USER = 2 /* WHO is a user ID. */ -}; diff --git a/sysdeps/unix/sysv/linux/schedbits.h b/sysdeps/unix/sysv/linux/schedbits.h deleted file mode 100644 index fccb5d8..0000000 --- a/sysdeps/unix/sysv/linux/schedbits.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Definitions of constants and data structure for POSIX 1003.1b-1993 - scheduling interface. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SCHEDBITS_H - -#define _SCHEDBITS_H 1 -#include - -/* Scheduling algorithms. */ -#define SCHED_OTHER 0 -#define SCHED_FIFO 1 -#define SCHED_RR 2 - -/* Data structure to describe a process' schedulability. */ -struct sched_param - { - int sched_priority; - }; - -/* 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_PID 0x00001000 /* Set if pid shared. */ - - -/* Clone current process. */ -extern int __clone __P ((int (*__fn) (void *__arg), void *__child_stack, - int __flags, void *__arg)); -#ifdef __USE_MISC -extern int clone __P ((int (*__fn) (void *__arg), void *__child_stack, - int __flags, void *__arg)); -#endif - - -#endif /* schedbits.h */ diff --git a/sysdeps/unix/sysv/linux/sigaction.h b/sysdeps/unix/sysv/linux/sigaction.h deleted file mode 100644 index 13a6a03..0000000 --- a/sysdeps/unix/sysv/linux/sigaction.h +++ /dev/null @@ -1,54 +0,0 @@ -/* The proper definitions for Linux's sigaction. - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* Structure describing the action to be taken when a signal arrives. */ -struct sigaction - { - /* Signal handler. */ - __sighandler_t sa_handler; - - /* Additional set of signals to be blocked. */ - __sigset_t sa_mask; - - /* Special flags. */ - int sa_flags; - - /* Restore handler. */ - void (*sa_restorer) __P ((void)); - }; - -/* Bits in `sa_flags'. */ -#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */ -#ifdef __USE_MISC -#define SA_STACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ -#define SA_RESTART 0x10000000 /* Don't restart syscall on signal return. */ -#define SA_INTERRUPT 0x20000000 /* Historical no-op. */ -#define SA_NODEFER 0x40000000 /* Don't automatically block the signal when - its handler is being executed. */ -#define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ - -/* Some aliases for the SA_ constants. */ -#define SA_NOMASK SA_NODEFER -#define SA_ONESHOT SA_RESETHAND -#endif - -/* Values for the HOW argument to `sigprocmask'. */ -#define SIG_BLOCK 0 /* Block signals. */ -#define SIG_UNBLOCK 1 /* Unblock signals. */ -#define SIG_SETMASK 2 /* Set the set of blocked signals. */ diff --git a/sysdeps/unix/sysv/linux/sigcontext.h b/sysdeps/unix/sysv/linux/sigcontext.h deleted file mode 100644 index 71afc76..0000000 --- a/sysdeps/unix/sysv/linux/sigcontext.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SIGCONTEXT_H -#define _SIGCONTEXT_H 1 - -/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but - we need sigcontext. */ -#define sigcontext_struct sigcontext - -#include - - -#endif /* sigcontext.h */ diff --git a/sysdeps/unix/sysv/linux/signum.h b/sysdeps/unix/sysv/linux/signum.h deleted file mode 100644 index d8a716f..0000000 --- a/sysdeps/unix/sysv/linux/signum.h +++ /dev/null @@ -1,66 +0,0 @@ -/* Signal number definitions. Linux version. - Copyright (C) 1995, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef _SIGNAL_H - -/* Fake signal functions. */ -#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ -#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ -#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ - - -/* Signals. */ -#define SIGHUP 1 /* Hangup (POSIX). */ -#define SIGINT 2 /* Interrupt (ANSI). */ -#define SIGQUIT 3 /* Quit (POSIX). */ -#define SIGILL 4 /* Illegal instruction (ANSI). */ -#define SIGTRAP 5 /* Trace trap (POSIX). */ -#define SIGABRT 6 /* Abort (ANSI). */ -#define SIGIOT 6 /* IOT trap (4.2 BSD). */ -#define SIGBUS 7 /* BUS error (4.2 BSD). */ -#define SIGFPE 8 /* Floating-point exception (ANSI). */ -#define SIGKILL 9 /* Kill, unblockable (POSIX). */ -#define SIGUSR1 10 /* User-defined signal 1 (POSIX). */ -#define SIGSEGV 11 /* Segmentation violation (ANSI). */ -#define SIGUSR2 12 /* User-defined signal 2 (POSIX). */ -#define SIGPIPE 13 /* Broken pipe (POSIX). */ -#define SIGALRM 14 /* Alarm clock (POSIX). */ -#define SIGTERM 15 /* Termination (ANSI). */ -#define SIGSTKFLT 16 /* ??? */ -#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ -#define SIGCHLD 17 /* Child status has changed (POSIX). */ -#define SIGCONT 18 /* Continue (POSIX). */ -#define SIGSTOP 19 /* Stop, unblockable (POSIX). */ -#define SIGTSTP 20 /* Keyboard stop (POSIX). */ -#define SIGTTIN 21 /* Background read from tty (POSIX). */ -#define SIGTTOU 22 /* Background write to tty (POSIX). */ -#define SIGURG 23 /* Urgent condition on socket (4.2 BSD). */ -#define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */ -#define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */ -#define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */ -#define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */ -#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ -#define SIGPOLL SIGIO /* Pollable event occurred (System V). */ -#define SIGIO 29 /* I/O now possible (4.2 BSD). */ -#define SIGPWR 30 /* Power failure restart (System V). */ -#define SIGUNUSED 31 - -#define _NSIG 32 /* Biggest signal number + 1. */ - -#endif /* included. */ diff --git a/sysdeps/unix/sysv/linux/sigset.h b/sysdeps/unix/sysv/linux/sigset.h deleted file mode 100644 index 741ff9a..0000000 --- a/sysdeps/unix/sysv/linux/sigset.h +++ /dev/null @@ -1,123 +0,0 @@ -/* __sig_atomic_t, __sigset_t, and related definitions. Linux version. - Copyright (C) 1991, 1992, 1994, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SIGSET_H_types -#define _SIGSET_H_types 1 - -typedef int __sig_atomic_t; - -/* A `sigset_t' has a bit for each signal. */ - -#define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) -typedef struct - { - unsigned long int __val[_SIGSET_NWORDS]; - } __sigset_t; - -#endif - - -/* We only want to define these functions if was actually - included; otherwise we were included just to define the types. Since we - are namespace-clean, it wouldn't hurt to define extra macros. But - trouble can be caused by functions being defined (e.g., any global - register vars declared later will cause compilation errors). */ - -#if !defined (_SIGSET_H_fns) && defined (_SIGNAL_H) -#define _SIGSET_H_fns 1 - -#ifndef _EXTERN_INLINE -#define _EXTERN_INLINE extern __inline -#endif - -/* Return a mask that includes the bit for SIG only. */ -#define __sigmask(sig) \ - (((unsigned long) 1) << (((sig) - 1) % (8 * sizeof (unsigned long int)))) - -/* Return the word index for SIG. */ -#define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int))) - -#if defined __GNUC__ && __GNUC__ >= 2 -# define __sigemptyset(set) \ - (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ - sigset_t *__set = (set); \ - while (--__cnt >= 0) __set->__val[__cnt] = 0; \ - 0; })) -# define __sigfillset(set) \ - (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ - sigset_t *__set = (set); \ - while (--__cnt >= 0) __set->__val[__cnt] = ~0UL; \ - 0; })) - -# ifdef _GNU_SOURCE -/* The POSIX does not specify for handling the whole signal set in one - command. This is often wanted and so we define three more functions - here. */ -# define __sigisemptyset(set) \ - (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ - const sigset_t *__set = (set); \ - int __ret = __set->__val[--__cnt]; \ - while (!__ret && --__cnt >= 0) \ - __ret = __set->__val[__cnt]; \ - __ret == 0; })) -# define __sigandset(dest, left, right) \ - (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ - sigset_t *__dest = (dest); \ - const sigset_t *__left = (left); \ - const sigset_t *__right = (right); \ - while (--__cnt >= 0) \ - __dest->__val[__cnt] = (__left->__val[__cnt] \ - & __right->__val[__cnt]); \ - 0; })) -# define __sigorset(dest, left, right) \ - (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ - sigset_t *__dest = (dest); \ - const sigset_t *__left = (left); \ - const sigset_t *__right = (right); \ - while (--__cnt >= 0) \ - __dest->__val[__cnt] = (__left->__val[__cnt] \ - | __right->__val[__cnt]); \ - 0; })) -# endif -#endif - -/* These functions needn't check for a bogus signal number -- error - checking is done in the non __ versions. */ - -extern int __sigismember (__const __sigset_t *, int); -extern int __sigaddset (__sigset_t *, int); -extern int __sigdelset (__sigset_t *, int); - -#define __SIGSETFN(NAME, BODY, CONST) \ - _EXTERN_INLINE int \ - NAME (CONST __sigset_t *__set, int __sig) \ - { \ - unsigned long int __mask = __sigmask (__sig); \ - unsigned long int __word = __sigword (__sig); \ - return BODY; \ - } - -__SIGSETFN (__sigismember, (__set->__val[__word] & __mask) ? 1 : 0, __const) -__SIGSETFN (__sigaddset, ((__set->__val[__word] |= __mask), 0), ) -__SIGSETFN (__sigdelset, ((__set->__val[__word] &= ~__mask), 0), ) - -#undef __SIGSETFN - - -#endif /* ! _SIGSET_H_fns. */ diff --git a/sysdeps/unix/sysv/linux/socketbits.h b/sysdeps/unix/sysv/linux/socketbits.h deleted file mode 100644 index e60f903..0000000 --- a/sysdeps/unix/sysv/linux/socketbits.h +++ /dev/null @@ -1,205 +0,0 @@ -/* System-specific socket constants and types. Linux version. - Copyright (C) 1991, 92, 94, 95, 96, 97 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SOCKETBITS_H - -#define _SOCKETBITS_H 1 -#include - -#define __need_size_t -#define __need_NULL -#include - - -__BEGIN_DECLS - -/* Types of sockets. */ -enum __socket_type -{ - SOCK_STREAM = 1, /* Sequenced, reliable, connection-based - byte streams. */ -#define SOCK_STREAM SOCK_STREAM - SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams - of fixed maximum length. */ -#define SOCK_DGRAM SOCK_DGRAM - SOCK_RAW = 3, /* Raw protocol interface. */ -#define SOCK_RAW SOCK_RAW - SOCK_RDM = 4, /* Reliably-delivered messages. */ -#define SOCK_RDM SOCK_RDM - SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based, - datagrams of fixed maximum length. */ -#define SOCK_SEQPACKET SOCK_SEQPACKET - SOCK_PACKET = 10 /* Linux specific way of getting packets - at the dev level. For writing rarp and - other similar things on the user level. */ -#define SOCK_PACKET SOCK_PACKET -}; - -/* Protocol families. */ -#define PF_UNSPEC 0 /* Unspecified. */ -#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */ -#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */ -#define PF_FILE PF_LOCAL /* POSIX name for PF_LOCAL. */ -#define PF_INET 2 /* IP protocol family. */ -#define PF_AX25 3 /* Amateur Radio AX.25. */ -#define PF_IPX 4 /* Novell Internet Protocol. */ -#define PF_APPLETALK 5 /* Don't use this. */ -#define PF_NETROM 6 /* Amateur radio NetROM. */ -#define PF_BRIDGE 7 /* Multiprotocol bridge. */ -#define PF_AAL5 8 /* Reserved for Werner's ATM. */ -#define PF_X25 9 /* Reserved for X.25 project. */ -#define PF_INET6 10 /* IP version 6. */ -#define PF_MAX 12 /* For now.. */ - -/* Address families. */ -#define AF_UNSPEC PF_UNSPEC -#define AF_LOCAL PF_LOCAL -#define AF_UNIX PF_UNIX -#define AF_FILE PF_FILE -#define AF_INET PF_INET -#define AF_AX25 PF_AX25 -#define AF_IPX PF_IPX -#define AF_APPLETALK PF_APPLETALK -#define AF_NETROM PF_NETROM -#define AF_BRIDGE PF_BRIDGE -#define AF_AAL5 PF_AAL5 -#define AF_X25 PF_X25 -#define AF_INET6 PF_INET6 -#define AF_MAX PF_MAX - -/* Socket level values. Others are defined in the appropriate headers. - - XXX These definitions also should go into the appropriate headers as - far as they are available. */ -#define SOL_IPV6 41 -#define SOL_ICMPV6 58 -#define SOL_RAW 255 -#define SOL_AX25 257 -#define SOL_ATALK 258 -#define SOL_NETROM 259 -#define SOL_ROSE 260 -#define SOL_DECNET 261 -#define SOL_X25 262 - -/* Maximum queue length specifiable by listen. */ -#define SOMAXCONN 128 - -/* Get the definition of the macro to define the common sockaddr members. */ -#include - -/* Structure describing a generic socket address. */ -struct sockaddr - { - __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */ - char sa_data[14]; /* Address data. */ - }; - - -/* Bits in the FLAGS argument to `send', `recv', et al. */ -enum - { - MSG_OOB = 0x01, /* Process out-of-band data. */ - MSG_PEEK = 0x02, /* Peek at incoming messages. */ - MSG_DONTROUTE = 0x04, /* Don't use local routing. */ - MSG_CTRUNC = 0x08, /* Control data lost before delivery. */ - MSG_PROXY = 0x10 /* Supply or ask second address. */ - }; - - -/* Structure describing messages sent by - `sendmsg' and received by `recvmsg'. */ -struct msghdr - { - __ptr_t msg_name; /* Address to send to/receive from. */ - int msg_namelen; /* Length of address data. */ - /* XXX Should be type `size_t' according to POSIX.1g. */ - - struct iovec *msg_iov; /* Vector of data to send/receive into. */ - size_t msg_iovlen; /* Number of elements in the vector. */ - - __ptr_t msg_control; /* Ancillary data (eg BSD filedesc passing). */ - size_t msg_controllen; /* Ancillary data buffer length. */ - int msg_flags; /* Flags on received message. */ - }; - -/* Structure used for storage of ancillary data object information. */ -struct cmsghdr - { - size_t cmsg_len; /* Length of data in cmsg_data plus length - of cmsghdr structure. */ - int cmsg_level; /* Originating protocol. */ - int cmsg_type; /* Protocol specific type. */ -#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2 - unsigned char __cmsg_data[0]; /* Ancillary data. */ -#endif - }; - -/* Ancillary data object manipulation macros. */ -#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2 -# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data) -#else -# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1)) -#endif -#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg) -#define CMSG_FIRSTHDR(mhdr) \ - ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \ - ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL) -#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \ - & ~(sizeof (size_t) - 1)) -#define CMSG_SPACE(len) (CMSG_ALIGN (len) \ - + CMSG_ALIGN (sizeof (struct cmsghdr))) -#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len)) - -#ifndef _EXTERN_INLINE -# define _EXTERN_INLINE extern __inline -#endif -extern struct cmsghdr *__cmsg_nxthdr __P ((struct msghdr *__mhdr, - struct cmsghdr *__cmsg)); -_EXTERN_INLINE struct cmsghdr * -__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) -{ - unsigned char *__p; - - if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr)) - /* The kernel header does this so there may be a reason. */ - return NULL; - - __p = (((unsigned char *) __cmsg) - + ((__cmsg->cmsg_len + sizeof (long int) - 1) & ~sizeof (long int))); - if (__p >= (unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen) - /* No more entries. */ - return NULL; - return (struct cmsghdr *) __p; -} - - -/* Get socket manipulation related informations from kernel headers. */ -#include - - -/* Structure used to manipulate the SO_LINGER option. */ -struct linger - { - int l_onoff; /* Nonzero to linger on close. */ - int l_linger; /* Time to linger. */ - }; - -__END_DECLS - -#endif /* socketbits.h */ diff --git a/sysdeps/unix/sysv/linux/socketcall.h b/sysdeps/unix/sysv/linux/socketcall.h new file mode 100644 index 0000000..9aaca7a --- /dev/null +++ b/sysdeps/unix/sysv/linux/socketcall.h @@ -0,0 +1,48 @@ +/* ID for functions called via socketcall system call. + Copyright (C) 1995, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_SOCKETCALL_H + +#define _SYS_SOCKETCALL_H 1 + +/* Define unique numbers for the operations permitted on socket. Linux + uses a single system call for all these functions. The relevant code + file is /usr/include/linux/net.h. + We cannot use a enum here because the values are used in assembler + code. */ + +#define SOCKOP_socket 1 +#define SOCKOP_bind 2 +#define SOCKOP_connect 3 +#define SOCKOP_listen 4 +#define SOCKOP_accept 5 +#define SOCKOP_getsockname 6 +#define SOCKOP_getpeername 7 +#define SOCKOP_socketpair 8 +#define SOCKOP_send 9 +#define SOCKOP_recv 10 +#define SOCKOP_sendto 11 +#define SOCKOP_recvfrom 12 +#define SOCKOP_shutdown 13 +#define SOCKOP_setsockopt 14 +#define SOCKOP_getsockopt 15 +#define SOCKOP_sendmsg 16 +#define SOCKOP_recvmsg 17 + +#endif /* _SYS_SOCKETCALL_H */ diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h new file mode 100644 index 0000000..3fc7240 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h @@ -0,0 +1,96 @@ +/* O_*, F_*, FD_* bit values for Linux/SPARC. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FCNTLBITS_H +#define _FCNTLBITS_H 1 + +#include + +/* In GNU, read and write are bits (unlike BSD). */ +#ifdef __USE_GNU +#define O_READ O_RDONLY /* Open for reading. */ +#define O_WRITE O_WRONLY /* Open for writing. */ +#endif + +/* open/fcntl - O_SYNC is only implemented on blocks devices and on files + located on an ext2 file system */ +#define O_RDONLY 0x0000 +#define O_WRONLY 0x0001 +#define O_RDWR 0x0002 +#define O_ACCMODE 0x0003 +#define O_APPEND 0x0008 +#define O_CREAT 0x0200 /* not fcntl */ +#define O_TRUNC 0x0400 /* not fcntl */ +#define O_EXCL 0x0800 /* not fcntl */ +#define O_SYNC 0x2000 +#define O_NONBLOCK 0x4000 +#define O_NDELAY (0x0004 | O_NONBLOCK) +#define O_NOCTTY 0x8000 /* not fcntl */ + +#define F_DUPFD 0 /* dup */ +#define F_GETFD 1 /* get f_flags */ +#define F_SETFD 2 /* set f_flags */ +#define F_GETFL 3 /* more flags (cloexec) */ +#define F_SETFL 4 +#define F_GETOWN 5 /* for sockets. */ +#define F_SETOWN 6 /* for sockets. */ +#define F_GETLK 7 +#define F_SETLK 8 +#define F_SETLKW 9 + +/* for F_[GET|SET]FL */ +#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ + +/* for posix fcntl() and lockf() */ +#define F_RDLCK 1 +#define F_WRLCK 2 +#define F_UNLCK 3 + +/* for old implementation of bsd flock () */ +#define F_EXLCK 4 /* or 3 */ +#define F_SHLCK 8 /* or 4 */ + +/* 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 */ + +struct flock + { + short int l_type; + short int l_whence; + __off_t l_start; + __off_t l_len; + __pid_t l_pid; + short int __unused; + }; + +/* Define some more compatibility macros to be backward compatible with + BSD systems which did not managed to hide these kernel macros. */ +#ifdef __USE_BSD +#define FAPPEND O_APPEND +#define FFSYNC O_FSYNC +#define FASYNC O_ASYNC +#define FNONBLOCK O_NONBLOCK +#define FNDELAY O_NDELAY +#endif /* Use BSD. */ + +#endif diff --git a/sysdeps/unix/sysv/linux/sparc/bits/ioctls.h b/sysdeps/unix/sysv/linux/sparc/bits/ioctls.h new file mode 100644 index 0000000..8a14f99 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/bits/ioctls.h @@ -0,0 +1,43 @@ +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_IOCTLS_H +#define _BITS_IOCTLS_H 1 + +/* Use the definitions from the kernel header files. */ +#include +#include + +/* Oh well, this is necessary since the kernel data structure is + different from the user-level version. */ +#undef TCGETS +#undef TCSETS +#undef TCSETSW +#undef TCSETSF +#define TCGETS _IOR ('t', 19, struct __kernel_termios) +#define TCSETS _IOW ('t', 20, struct __kernel_termios) +#define TCSETSW _IOW ('t', 21, struct __kernel_termios) +#define TCSETSF _IOW ('t', 22, struct __kernel_termios) + +#include + +#endif /* bits/ioctls.h */ diff --git a/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h b/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h new file mode 100644 index 0000000..19aa7e3 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h @@ -0,0 +1,52 @@ +/* The proper definitions for Linux/SPARC sigaction. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Structure describing the action to be taken when a signal arrives. */ +struct sigaction + { + /* Signal handler. */ + __sighandler_t sa_handler; + + /* Additional set of signals to be blocked. */ + __sigset_t sa_mask; + + /* Special flags. */ + unsigned int sa_flags; + }; + + +/* Bits in `sa_flags'. */ +#define SA_NOCLDSTOP 0x00000008 /* Don't send SIGCHLD when children stop. */ +#ifdef __USE_MISC +#define SA_STACK 0x00000001 /* Use signal stack by using `sa_restorer'. */ +#define SA_RESTART 0x00000002 /* Don't restart syscall on signal return. */ +#define SA_INTERRUPT 0x00000010 /* Historical no-op. */ +#define SA_NOMASK 0x00000020 /* Don't automatically block the signal when + its handler is being executed. */ +#define SA_ONESHOT 0x00000004 /* Reset to SIG_DFL on entry to handler. */ + +/* Some aliases for the SA_ constants. */ +#define SA_NODEFER SA_NOMASK +#define SA_RESETHAND SA_ONESHOT +#endif + +/* Values for the HOW argument to `sigprocmask'. */ +#define SIG_BLOCK 1 /* Block signals. */ +#define SIG_UNBLOCK 2 /* Unblock signals. */ +#define SIG_SETMASK 4 /* Set the set of blocked signals. */ diff --git a/sysdeps/unix/sysv/linux/sparc/bits/signum.h b/sysdeps/unix/sysv/linux/sparc/bits/signum.h new file mode 100644 index 0000000..3437c16 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/bits/signum.h @@ -0,0 +1,69 @@ +/* Signal number definitions. Linux/SPARC version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifdef _SIGNAL_H + +/* Fake signal functions. */ +#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ +#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ +#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ + +/* + * Linux/SPARC has different signal numbers that Linux/i386: I'm trying + * to make it OSF/1 binary compatible, at least for normal binaries. + */ +#define _NSIG 32 /* Biggest signal number + 1. */ + +#define SIGHUP 1 +#define SIGINT 2 +#define SIGQUIT 3 +#define SIGILL 4 +#define SIGTRAP 5 +#define SIGABRT 6 +#define SIGIOT 6 +#define SIGEMT 7 +#define SIGFPE 8 +#define SIGKILL 9 +#define SIGBUS 10 +#define SIGSEGV 11 +#define SIGSYS 12 +#define SIGPIPE 13 +#define SIGALRM 14 +#define SIGTERM 15 +#define SIGURG 16 + +/* SunOS values which deviate from the Linux/i386 ones */ +#define SIGSTOP 17 +#define SIGTSTP 18 +#define SIGCONT 19 +#define SIGCHLD 20 +#define SIGTTIN 21 +#define SIGTTOU 22 +#define SIGIO 23 +#define SIGPOLL SIGIO /* SysV name for SIGIO */ +#define SIGXCPU 24 +#define SIGXFSZ 25 +#define SIGVTALRM 26 +#define SIGPROF 27 +#define SIGWINCH 28 +#define SIGLOST 29 +#define SIGUSR1 30 +#define SIGUSR2 31 + +#endif /* included. */ diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/sysdeps/unix/sysv/linux/sparc/bits/termios.h new file mode 100644 index 0000000..bf7aa14 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/bits/termios.h @@ -0,0 +1,217 @@ +/* termios type and macro definitions. Linux/SPARC version. + Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SPARC_TERMBITS_H +#define _SPARC_TERMBITS_H 1 + +typedef unsigned char cc_t; +typedef unsigned int speed_t; +typedef unsigned long tcflag_t; + +#define NCCS 17 +struct termios + { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_line; /* line discipline */ + cc_t c_cc[NCCS]; /* control characters */ +#ifdef __KERNEL__ +#define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t)) + cc_t _x_cc[2]; /* We need them to hold vmin/vtime */ +#endif + }; + +/* c_cc characters */ +#define VINTR 0 +#define VQUIT 1 +#define VERASE 2 +#define VKILL 3 +#define VEOF 4 +#define VEOL 5 +#define VEOL2 6 +#define VSWTC 7 +#define VSTART 8 +#define VSTOP 9 + + + +#define VSUSP 10 +#define VDSUSP 11 /* SunOS POSIX nicety I do believe... */ +#define VREPRINT 12 +#define VDISCARD 13 +#define VWERASE 14 +#define VLNEXT 15 + +/* Kernel keeps vmin/vtime separated, user apps assume vmin/vtime is + * shared with eof/eol + */ +#ifdef __KERNEL__ +#define VMIN 16 +#define VTIME 17 +#else +#define VMIN VEOF +#define VTIME VEOL +#endif + +/* c_iflag bits */ +#define IGNBRK 0x00000001 +#define BRKINT 0x00000002 +#define IGNPAR 0x00000004 +#define PARMRK 0x00000008 +#define INPCK 0x00000010 +#define ISTRIP 0x00000020 +#define INLCR 0x00000040 +#define IGNCR 0x00000080 +#define ICRNL 0x00000100 +#define IUCLC 0x00000200 +#define IXON 0x00000400 +#define IXANY 0x00000800 +#define IXOFF 0x00001000 +#define IMAXBEL 0x00002000 + +/* c_oflag bits */ +#define OPOST 0x00000001 +#define OLCUC 0x00000002 +#define ONLCR 0x00000004 +#define OCRNL 0x00000008 +#define ONOCR 0x00000010 +#define ONLRET 0x00000020 +#define OFILL 0x00000040 +#define OFDEL 0x00000080 +#define NLDLY 0x00000100 +#define NL0 0x00000000 +#define NL1 0x00000100 +#define CRDLY 0x00000600 +#define CR0 0x00000000 +#define CR1 0x00000200 +#define CR2 0x00000400 +#define CR3 0x00000600 +#define TABDLY 0x00001800 +#define TAB0 0x00000000 +#define TAB1 0x00000800 +#define TAB2 0x00001000 +#define TAB3 0x00001800 +#define XTABS 0x00001800 +#define BSDLY 0x00002000 +#define BS0 0x00000000 +#define BS1 0x00002000 +#define VTDLY 0x00004000 +#define VT0 0x00000000 +#define VT1 0x00004000 +#define FFDLY 0x00008000 +#define FF0 0x00000000 +#define FF1 0x00008000 +#define PAGEOUT 0x00010000 /* SUNOS specific */ +#define WRAP 0x00020000 /* SUNOS specific */ + +/* c_cflag bit meaning */ +#define CBAUD 0x0000000f +#define B0 0x00000000 /* hang up */ +#define B50 0x00000001 +#define B75 0x00000002 +#define B110 0x00000003 +#define B134 0x00000004 +#define B150 0x00000005 +#define B200 0x00000006 +#define B300 0x00000007 +#define B600 0x00000008 +#define B1200 0x00000009 +#define B1800 0x0000000a +#define B2400 0x0000000b +#define B4800 0x0000000c +#define B9600 0x0000000d +#define B19200 0x0000000e +#define B38400 0x0000000f +#define EXTA B19200 +#define EXTB B38400 +#define CSIZE 0x00000030 +#define CS5 0x00000000 +#define CS6 0x00000010 +#define CS7 0x00000020 +#define CS8 0x00000030 +#define CSTOPB 0x00000040 +#define CREAD 0x00000080 +#define PARENB 0x00000100 +#define PARODD 0x00000200 +#define HUPCL 0x00000400 +#define CLOCAL 0x00000800 +/* We'll never see these speeds with the Zilogs' but for completeness... */ +#define CBAUDEX 0x00010000 +#define B57600 0x00010001 +#define B115200 0x00010002 +#define B230400 0x00010003 +#define B460800 0x00010004 +#define CIBAUD 0x000f0000 /* input baud rate (not used) */ +#define CMSPAR 010000000000 /* mark or space (stick) parity */ +#define CRTSCTS 0x80000000 /* flow control */ + +/* c_lflag bits */ +#define ISIG 0x00000001 +#define ICANON 0x00000002 +#define XCASE 0x00000004 +#define ECHO 0x00000008 +#define ECHOE 0x00000010 +#define ECHOK 0x00000020 +#define ECHONL 0x00000040 +#define NOFLSH 0x00000080 +#define TOSTOP 0x00000100 +#define ECHOCTL 0x00000200 +#define ECHOPRT 0x00000400 +#define ECHOKE 0x00000800 +#define DEFECHO 0x00001000 /* SUNOS thing, what is it? */ +#define FLUSHO 0x00002000 +#define PENDIN 0x00004000 +#define IEXTEN 0x00008000 + +/* 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 */ +#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ + + +/* tcflow() and TCXONC use these */ +#define TCOOFF 0 +#define TCOON 1 +#define TCIOFF 2 +#define TCION 3 + +/* tcflush() and TCFLSH use these */ +#define TCIFLUSH 0 +#define TCOFLUSH 1 +#define TCIOFLUSH 2 + +/* tcsetattr uses these */ +#define TCSANOW 0 +#define TCSADRAIN 1 +#define TCSAFLUSH 2 + +#endif /* !(_SPARC_TERMBITS_H) */ diff --git a/sysdeps/unix/sysv/linux/sparc/fcntlbits.h b/sysdeps/unix/sysv/linux/sparc/fcntlbits.h deleted file mode 100644 index 3fc7240..0000000 --- a/sysdeps/unix/sysv/linux/sparc/fcntlbits.h +++ /dev/null @@ -1,96 +0,0 @@ -/* O_*, F_*, FD_* bit values for Linux/SPARC. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _FCNTLBITS_H -#define _FCNTLBITS_H 1 - -#include - -/* In GNU, read and write are bits (unlike BSD). */ -#ifdef __USE_GNU -#define O_READ O_RDONLY /* Open for reading. */ -#define O_WRITE O_WRONLY /* Open for writing. */ -#endif - -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_RDONLY 0x0000 -#define O_WRONLY 0x0001 -#define O_RDWR 0x0002 -#define O_ACCMODE 0x0003 -#define O_APPEND 0x0008 -#define O_CREAT 0x0200 /* not fcntl */ -#define O_TRUNC 0x0400 /* not fcntl */ -#define O_EXCL 0x0800 /* not fcntl */ -#define O_SYNC 0x2000 -#define O_NONBLOCK 0x4000 -#define O_NDELAY (0x0004 | O_NONBLOCK) -#define O_NOCTTY 0x8000 /* not fcntl */ - -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get f_flags */ -#define F_SETFD 2 /* set f_flags */ -#define F_GETFL 3 /* more flags (cloexec) */ -#define F_SETFL 4 -#define F_GETOWN 5 /* for sockets. */ -#define F_SETOWN 6 /* for sockets. */ -#define F_GETLK 7 -#define F_SETLK 8 -#define F_SETLKW 9 - -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - -/* for posix fcntl() and lockf() */ -#define F_RDLCK 1 -#define F_WRLCK 2 -#define F_UNLCK 3 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* 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 */ - -struct flock - { - short int l_type; - short int l_whence; - __off_t l_start; - __off_t l_len; - __pid_t l_pid; - short int __unused; - }; - -/* Define some more compatibility macros to be backward compatible with - BSD systems which did not managed to hide these kernel macros. */ -#ifdef __USE_BSD -#define FAPPEND O_APPEND -#define FFSYNC O_FSYNC -#define FASYNC O_ASYNC -#define FNONBLOCK O_NONBLOCK -#define FNDELAY O_NDELAY -#endif /* Use BSD. */ - -#endif diff --git a/sysdeps/unix/sysv/linux/sparc/ioctls.h b/sysdeps/unix/sysv/linux/sparc/ioctls.h deleted file mode 100644 index 80b2e62..0000000 --- a/sysdeps/unix/sysv/linux/sparc/ioctls.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _IOCTLS_H -#define _IOCTLS_H 1 - -/* Use the definitions from the kernel header files. */ -#include -#include - -/* Oh well, this is necessary since the kernel data structure is - different from the user-level version. */ -#undef TCGETS -#undef TCSETS -#undef TCSETSW -#undef TCSETSF -#define TCGETS _IOR ('t', 19, struct __kernel_termios) -#define TCSETS _IOW ('t', 20, struct __kernel_termios) -#define TCSETSW _IOW ('t', 21, struct __kernel_termios) -#define TCSETSF _IOW ('t', 22, struct __kernel_termios) - -#include - -#endif /* ioctls.h */ diff --git a/sysdeps/unix/sysv/linux/sparc/profil-counter.h b/sysdeps/unix/sysv/linux/sparc/profil-counter.h index 258df5b..1bd0648 100644 --- a/sysdeps/unix/sysv/linux/sparc/profil-counter.h +++ b/sysdeps/unix/sysv/linux/sparc/profil-counter.h @@ -17,7 +17,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include void profil_counter (int signo, __siginfo_t si) diff --git a/sysdeps/unix/sysv/linux/sparc/sigaction.h b/sysdeps/unix/sysv/linux/sparc/sigaction.h deleted file mode 100644 index 19aa7e3..0000000 --- a/sysdeps/unix/sysv/linux/sparc/sigaction.h +++ /dev/null @@ -1,52 +0,0 @@ -/* The proper definitions for Linux/SPARC sigaction. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* Structure describing the action to be taken when a signal arrives. */ -struct sigaction - { - /* Signal handler. */ - __sighandler_t sa_handler; - - /* Additional set of signals to be blocked. */ - __sigset_t sa_mask; - - /* Special flags. */ - unsigned int sa_flags; - }; - - -/* Bits in `sa_flags'. */ -#define SA_NOCLDSTOP 0x00000008 /* Don't send SIGCHLD when children stop. */ -#ifdef __USE_MISC -#define SA_STACK 0x00000001 /* Use signal stack by using `sa_restorer'. */ -#define SA_RESTART 0x00000002 /* Don't restart syscall on signal return. */ -#define SA_INTERRUPT 0x00000010 /* Historical no-op. */ -#define SA_NOMASK 0x00000020 /* Don't automatically block the signal when - its handler is being executed. */ -#define SA_ONESHOT 0x00000004 /* Reset to SIG_DFL on entry to handler. */ - -/* Some aliases for the SA_ constants. */ -#define SA_NODEFER SA_NOMASK -#define SA_RESETHAND SA_ONESHOT -#endif - -/* Values for the HOW argument to `sigprocmask'. */ -#define SIG_BLOCK 1 /* Block signals. */ -#define SIG_UNBLOCK 2 /* Unblock signals. */ -#define SIG_SETMASK 4 /* Set the set of blocked signals. */ diff --git a/sysdeps/unix/sysv/linux/sparc/signum.h b/sysdeps/unix/sysv/linux/sparc/signum.h deleted file mode 100644 index 3437c16..0000000 --- a/sysdeps/unix/sysv/linux/sparc/signum.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Signal number definitions. Linux/SPARC version. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef _SIGNAL_H - -/* Fake signal functions. */ -#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ -#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ -#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ - -/* - * Linux/SPARC has different signal numbers that Linux/i386: I'm trying - * to make it OSF/1 binary compatible, at least for normal binaries. - */ -#define _NSIG 32 /* Biggest signal number + 1. */ - -#define SIGHUP 1 -#define SIGINT 2 -#define SIGQUIT 3 -#define SIGILL 4 -#define SIGTRAP 5 -#define SIGABRT 6 -#define SIGIOT 6 -#define SIGEMT 7 -#define SIGFPE 8 -#define SIGKILL 9 -#define SIGBUS 10 -#define SIGSEGV 11 -#define SIGSYS 12 -#define SIGPIPE 13 -#define SIGALRM 14 -#define SIGTERM 15 -#define SIGURG 16 - -/* SunOS values which deviate from the Linux/i386 ones */ -#define SIGSTOP 17 -#define SIGTSTP 18 -#define SIGCONT 19 -#define SIGCHLD 20 -#define SIGTTIN 21 -#define SIGTTOU 22 -#define SIGIO 23 -#define SIGPOLL SIGIO /* SysV name for SIGIO */ -#define SIGXCPU 24 -#define SIGXFSZ 25 -#define SIGVTALRM 26 -#define SIGPROF 27 -#define SIGWINCH 28 -#define SIGLOST 29 -#define SIGUSR1 30 -#define SIGUSR2 31 - -#endif /* included. */ diff --git a/sysdeps/unix/sysv/linux/sparc/socket.S b/sysdeps/unix/sysv/linux/sparc/socket.S index 24aba3f..bdfc2fc 100644 --- a/sysdeps/unix/sysv/linux/sparc/socket.S +++ b/sysdeps/unix/sysv/linux/sparc/socket.S @@ -18,7 +18,7 @@ Boston, MA 02111-1307, USA. */ #include -#include +#include #define P(a, b) P2(a, b) #define P2(a, b) a##b diff --git a/sysdeps/unix/sysv/linux/sparc/termbits.h b/sysdeps/unix/sysv/linux/sparc/termbits.h deleted file mode 100644 index bf7aa14..0000000 --- a/sysdeps/unix/sysv/linux/sparc/termbits.h +++ /dev/null @@ -1,217 +0,0 @@ -/* termios type and macro definitions. Linux/SPARC version. - Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SPARC_TERMBITS_H -#define _SPARC_TERMBITS_H 1 - -typedef unsigned char cc_t; -typedef unsigned int speed_t; -typedef unsigned long tcflag_t; - -#define NCCS 17 -struct termios - { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ -#ifdef __KERNEL__ -#define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t)) - cc_t _x_cc[2]; /* We need them to hold vmin/vtime */ -#endif - }; - -/* c_cc characters */ -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VEOL 5 -#define VEOL2 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 - - - -#define VSUSP 10 -#define VDSUSP 11 /* SunOS POSIX nicety I do believe... */ -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 - -/* Kernel keeps vmin/vtime separated, user apps assume vmin/vtime is - * shared with eof/eol - */ -#ifdef __KERNEL__ -#define VMIN 16 -#define VTIME 17 -#else -#define VMIN VEOF -#define VTIME VEOL -#endif - -/* c_iflag bits */ -#define IGNBRK 0x00000001 -#define BRKINT 0x00000002 -#define IGNPAR 0x00000004 -#define PARMRK 0x00000008 -#define INPCK 0x00000010 -#define ISTRIP 0x00000020 -#define INLCR 0x00000040 -#define IGNCR 0x00000080 -#define ICRNL 0x00000100 -#define IUCLC 0x00000200 -#define IXON 0x00000400 -#define IXANY 0x00000800 -#define IXOFF 0x00001000 -#define IMAXBEL 0x00002000 - -/* c_oflag bits */ -#define OPOST 0x00000001 -#define OLCUC 0x00000002 -#define ONLCR 0x00000004 -#define OCRNL 0x00000008 -#define ONOCR 0x00000010 -#define ONLRET 0x00000020 -#define OFILL 0x00000040 -#define OFDEL 0x00000080 -#define NLDLY 0x00000100 -#define NL0 0x00000000 -#define NL1 0x00000100 -#define CRDLY 0x00000600 -#define CR0 0x00000000 -#define CR1 0x00000200 -#define CR2 0x00000400 -#define CR3 0x00000600 -#define TABDLY 0x00001800 -#define TAB0 0x00000000 -#define TAB1 0x00000800 -#define TAB2 0x00001000 -#define TAB3 0x00001800 -#define XTABS 0x00001800 -#define BSDLY 0x00002000 -#define BS0 0x00000000 -#define BS1 0x00002000 -#define VTDLY 0x00004000 -#define VT0 0x00000000 -#define VT1 0x00004000 -#define FFDLY 0x00008000 -#define FF0 0x00000000 -#define FF1 0x00008000 -#define PAGEOUT 0x00010000 /* SUNOS specific */ -#define WRAP 0x00020000 /* SUNOS specific */ - -/* c_cflag bit meaning */ -#define CBAUD 0x0000000f -#define B0 0x00000000 /* hang up */ -#define B50 0x00000001 -#define B75 0x00000002 -#define B110 0x00000003 -#define B134 0x00000004 -#define B150 0x00000005 -#define B200 0x00000006 -#define B300 0x00000007 -#define B600 0x00000008 -#define B1200 0x00000009 -#define B1800 0x0000000a -#define B2400 0x0000000b -#define B4800 0x0000000c -#define B9600 0x0000000d -#define B19200 0x0000000e -#define B38400 0x0000000f -#define EXTA B19200 -#define EXTB B38400 -#define CSIZE 0x00000030 -#define CS5 0x00000000 -#define CS6 0x00000010 -#define CS7 0x00000020 -#define CS8 0x00000030 -#define CSTOPB 0x00000040 -#define CREAD 0x00000080 -#define PARENB 0x00000100 -#define PARODD 0x00000200 -#define HUPCL 0x00000400 -#define CLOCAL 0x00000800 -/* We'll never see these speeds with the Zilogs' but for completeness... */ -#define CBAUDEX 0x00010000 -#define B57600 0x00010001 -#define B115200 0x00010002 -#define B230400 0x00010003 -#define B460800 0x00010004 -#define CIBAUD 0x000f0000 /* input baud rate (not used) */ -#define CMSPAR 010000000000 /* mark or space (stick) parity */ -#define CRTSCTS 0x80000000 /* flow control */ - -/* c_lflag bits */ -#define ISIG 0x00000001 -#define ICANON 0x00000002 -#define XCASE 0x00000004 -#define ECHO 0x00000008 -#define ECHOE 0x00000010 -#define ECHOK 0x00000020 -#define ECHONL 0x00000040 -#define NOFLSH 0x00000080 -#define TOSTOP 0x00000100 -#define ECHOCTL 0x00000200 -#define ECHOPRT 0x00000400 -#define ECHOKE 0x00000800 -#define DEFECHO 0x00001000 /* SUNOS thing, what is it? */ -#define FLUSHO 0x00002000 -#define PENDIN 0x00004000 -#define IEXTEN 0x00008000 - -/* 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 */ -#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ - - -/* tcflow() and TCXONC use these */ -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -/* tcflush() and TCFLSH use these */ -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -/* tcsetattr uses these */ -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -#endif /* !(_SPARC_TERMBITS_H) */ diff --git a/sysdeps/unix/sysv/linux/statbuf.h b/sysdeps/unix/sysv/linux/statbuf.h deleted file mode 100644 index 15ffe63..0000000 --- a/sysdeps/unix/sysv/linux/statbuf.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _STATBUF_H -#define _STATBUF_H 1 - -/* Versions of the `struct stat' data structure. */ -#define _STAT_VER_LINUX_OLD 1 -#define _STAT_VER_SVR4 2 -#define _STAT_VER_LINUX 3 -#define _STAT_VER _STAT_VER_LINUX /* The one defined below. */ - -/* Versions of the `xmknod' interface. */ -#define _MKNOD_VER_LINUX 1 -#define _MKNOD_VER_SVR4 2 -#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ - - -struct stat - { - __dev_t st_dev; /* Device. */ - unsigned short int __pad1; - __ino_t st_ino; /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - unsigned short int __pad2; - __off_t st_size; /* Size of file, in bytes. */ - unsigned long int st_blksize; /* Optimal block size for I/O. */ -#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */ - - unsigned long int st_blocks; /* Number of 512-byte blocks allocated. */ - __time_t st_atime; /* Time of last access. */ - unsigned long int __unused1; - __time_t st_mtime; /* Time of last modification. */ - unsigned long int __unused2; - __time_t st_ctime; /* Time of last status change. */ - unsigned long int __unused3; - unsigned long int __unused4; - unsigned long int __unused5; - }; - -/* Encoding of the file mode. */ - -#define __S_IFMT 0170000 /* These bits determine file type. */ - -/* File types. */ -#define __S_IFDIR 0040000 /* Directory. */ -#define __S_IFCHR 0020000 /* Character device. */ -#define __S_IFBLK 0060000 /* Block device. */ -#define __S_IFREG 0100000 /* Regular file. */ -#define __S_IFIFO 0010000 /* FIFO. */ - -/* These don't actually exist on System V, but having them doesn't hurt. */ -#define __S_IFLNK 0120000 /* Symbolic link. */ -#define __S_IFSOCK 0140000 /* Socket. */ - -/* Protection bits. */ - -#define __S_ISUID 04000 /* Set user ID on execution. */ -#define __S_ISGID 02000 /* Set group ID on execution. */ -#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ -#define __S_IREAD 0400 /* Read by owner. */ -#define __S_IWRITE 0200 /* Write by owner. */ -#define __S_IEXEC 0100 /* Execute by owner. */ - -#endif /* statbuf.h */ diff --git a/sysdeps/unix/sysv/linux/statfsbuf.h b/sysdeps/unix/sysv/linux/statfsbuf.h deleted file mode 100644 index 7e1aa55..0000000 --- a/sysdeps/unix/sysv/linux/statfsbuf.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _STATFSBUF_H -#define _STATFSBUF_H - -#include /* for __fsid_t */ - -struct statfs - { - int f_type; - int f_bsize; - int f_blocks; - int f_bfree; - int f_bavail; - int f_files; - int f_ffree; - __fsid_t f_fsid; - int f_namelen; - int f_spare[6]; - }; - -#endif /* statfsbuf.h */ diff --git a/sysdeps/unix/sysv/linux/sys/ipc_buf.h b/sysdeps/unix/sysv/linux/sys/ipc_buf.h deleted file mode 100644 index f5fea0d..0000000 --- a/sysdeps/unix/sysv/linux/sys/ipc_buf.h +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , August 1995. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SYS_IPC_BUF_H - -#define _SYS_IPC_BUF_H 1 -#include - -#include - -/* 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. */ -#define IPC_INFO 3 /* See ipcs. */ - - -__BEGIN_DECLS - -/* 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. */ - unsigned short int uid; /* Owner's user ID. */ - unsigned short int gid; /* Owner's group ID. */ - unsigned short int cuid; /* Creator's user ID. */ - unsigned short int cgid; /* Creator's group ID. */ - unsigned short int mode; /* Read/write permission. */ - unsigned short int __seq; /* Sequence number. */ - }; - - -/* Kludge to work around Linux' restriction of only up to five - arguments to a system call. */ -struct ipc_kludge - { - void *msgp; - long int msgtyp; - }; - -/* The actual system call: all functions are multiplexed by this. */ -extern int __ipc __P ((int __call, int __first, int __second, int __third, - void *__ptr)); - -/* The codes for the functions to use the multiplexer `__ipc'. */ -#define IPCOP_semop 1 -#define IPCOP_semget 2 -#define IPCOP_semctl 3 -#define IPCOP_msgsnd 11 -#define IPCOP_msgrcv 12 -#define IPCOP_msgget 13 -#define IPCOP_msgctl 14 -#define IPCOP_shmat 21 -#define IPCOP_shmdt 22 -#define IPCOP_shmget 23 -#define IPCOP_shmctl 24 - -__END_DECLS - -#endif /* _SYS_IPC_BUF_H */ diff --git a/sysdeps/unix/sysv/linux/sys/kernel_termios.h b/sysdeps/unix/sysv/linux/sys/kernel_termios.h deleted file mode 100644 index 629508e..0000000 --- a/sysdeps/unix/sysv/linux/sys/kernel_termios.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _SYS_KERNEL_TERMIOS_H -#define _SYS_KERNEL_TERMIOS_H 1 -/* The following corresponds to the values from the Linux 2.1.20 kernel. */ - -/* We need the definition of tcflag_t, cc_t, and speed_t. */ -#include - -#define __KERNEL_NCCS 19 - -struct __kernel_termios - { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[__KERNEL_NCCS]; /* control characters */ - }; - -#endif /* sys/kernel_termios.h */ diff --git a/sysdeps/unix/sysv/linux/sys/mman.h b/sysdeps/unix/sysv/linux/sys/mman.h index 367b906..dc9f8f7 100644 --- a/sysdeps/unix/sysv/linux/sys/mman.h +++ b/sysdeps/unix/sysv/linux/sys/mman.h @@ -22,7 +22,7 @@ #define _SYS_MMAN_H 1 #include -#include +#include #define __need_size_t #include diff --git a/sysdeps/unix/sysv/linux/sys/msq_buf.h b/sysdeps/unix/sysv/linux/sys/msq_buf.h deleted file mode 100644 index 0abc10f..0000000 --- a/sysdeps/unix/sysv/linux/sys/msq_buf.h +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , August 1995. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SYS_MSQ_BUF_H - -#define _SYS_MSQ_BUF_H 1 -#include - -#include - -/* Define options for message queue functions. */ -#define MSG_NOERROR 010000 /* no error if message is too big */ -#define MSG_EXCEPT 020000 /* recv any msg except of specified type */ - - -__BEGIN_DECLS - -/* 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 */ - struct msg *__msg_first; /* pointer to first message on queue */ - struct msg *__msg_last; /* pointer to last message on queue */ - __time_t msg_stime; /* time of last msgsnd command */ - __time_t msg_rtime; /* time of last msgrcv command */ - __time_t msg_ctime; /* time of last change */ - struct wait_queue *__wwait; /* ??? */ - struct wait_queue *__rwait; /* ??? */ - unsigned short int __msg_cbytes;/* current number of bytes on queue */ - unsigned short int msg_qnum; /* number of messages currently on queue */ - unsigned short int msg_qbytes;/* max number of bytes allowed on queue */ - int msg_lspid; /* pid of last msgsnd() */ - int msg_lrpid; /* pid of last msgrcv() */ -}; - -#ifdef __USE_MISC - -#define msg_cbytes __msg_cbytes - -/* ipcs ctl commands */ -#define MSG_STAT 11 -#define MSG_INFO 12 - -/* buffer for msgctl calls IPC_INFO, MSG_INFO */ -struct msginfo -{ - int msgpool; - int msgmap; - int msgmax; - int msgmnb; - int msgmni; - int msgssz; - int msgtql; - ushort msgseg; -}; - -#endif /* __USE_MISC */ - -__END_DECLS - -#endif /* _SYS_MSQ_BUF_H */ diff --git a/sysdeps/unix/sysv/linux/sys/sem_buf.h b/sysdeps/unix/sysv/linux/sys/sem_buf.h deleted file mode 100644 index 049a71b..0000000 --- a/sysdeps/unix/sysv/linux/sys/sem_buf.h +++ /dev/null @@ -1,88 +0,0 @@ -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , August 1995. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SYS_SEM_BUF_H - -#define _SYS_SEM_BUF_H 1 -#include - -#include - -/* 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 */ - - -__BEGIN_DECLS - -/* Data structure describing a set of semaphores. */ -struct semid_ds -{ - struct ipc_perm sem_perm; /* operation permission struct */ - __time_t sem_otime; /* last semop() time */ - __time_t sem_ctime; /* last time changed by semctl() */ - struct sem *__sembase; /* ptr to first semaphore in array */ - struct sem_queue *__sem_pending; /* pending operations */ - struct sem_queue *__sem_pending_last; /* last pending operation */ - struct sem_undo *__undo; /* ondo requests on this array */ - unsigned short int sem_nsems; /* number of semaphores in set */ -}; - -/* Union used for argument 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 */ -}; - -#ifdef __USE_MISC - -/* ipcs ctl cmds */ -#define SEM_STAT 18 -#define SEM_INFO 19 - -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 */ - -__END_DECLS - -#endif /* _SYS_SEM_BUF_H */ diff --git a/sysdeps/unix/sysv/linux/sys/shm_buf.h b/sysdeps/unix/sysv/linux/sys/shm_buf.h deleted file mode 100644 index 642b7bd..0000000 --- a/sysdeps/unix/sysv/linux/sys/shm_buf.h +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , August 1995. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SYS_SHM_BUF_H - -#define _SYS_SHM_BUF_H 1 -#include - -#include - -/* Permission flag for shmget. */ -#define SHM_R 0400 /* or S_IRUGO from */ -#define SHM_W 0200 /* or S_IWUGO from */ - -/* 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 */ - -/* Commands for `shmctl'. */ -#define SHM_LOCK 11 /* lock segment (root only) */ -#define SHM_UNLOCK 12 /* unlock segment (root only) */ - - -__BEGIN_DECLS - -/* Data structure describing a set of semaphores. */ -struct shmid_ds -{ - struct ipc_perm shm_perm; /* operation permission struct */ - int shm_segsz; /* size of segment in bytes */ - __time_t shm_atime; /* time of last shmat() */ - __time_t shm_dtime; /* time of last shmdt() */ - __time_t shm_ctime; /* time of last change by shmctl() */ - int shm_cpid; /* pid of creator */ - int shm_lpid; /* pid of last shmop */ - unsigned short int shm_nattch; /* number of current attaches */ - unsigned short int __shm_npages; /* size of segment (pages) */ - unsigned long int *__shm_pages; /* array of ptrs to frames -> SHMMAX */ - struct vm_area_struct *__attaches; /* descriptors for attaches */ -}; - -#ifdef __USE_MISC - -/* ipcs ctl commands */ -#define SHM_STAT 13 -#define SHM_INFO 14 - -/* 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 */ - -struct shminfo -{ - int shmmax; - int shmmin; - int shmmni; - int shmseg; - int shmall; -}; - -struct shm_info -{ - int used_ids; - ulong shm_tot; /* total allocated shm */ - ulong shm_rss; /* total resident shm */ - ulong shm_swp; /* total swapped shm */ - ulong swap_attempts; - ulong swap_successes; -}; - -#endif /* __USE_MISC */ - -__END_DECLS - -#endif /* _SYS_SHM_BUF_H */ diff --git a/sysdeps/unix/sysv/linux/sys/socketcall.h b/sysdeps/unix/sysv/linux/sys/socketcall.h deleted file mode 100644 index 9aaca7a..0000000 --- a/sysdeps/unix/sysv/linux/sys/socketcall.h +++ /dev/null @@ -1,48 +0,0 @@ -/* ID for functions called via socketcall system call. - Copyright (C) 1995, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SYS_SOCKETCALL_H - -#define _SYS_SOCKETCALL_H 1 - -/* Define unique numbers for the operations permitted on socket. Linux - uses a single system call for all these functions. The relevant code - file is /usr/include/linux/net.h. - We cannot use a enum here because the values are used in assembler - code. */ - -#define SOCKOP_socket 1 -#define SOCKOP_bind 2 -#define SOCKOP_connect 3 -#define SOCKOP_listen 4 -#define SOCKOP_accept 5 -#define SOCKOP_getsockname 6 -#define SOCKOP_getpeername 7 -#define SOCKOP_socketpair 8 -#define SOCKOP_send 9 -#define SOCKOP_recv 10 -#define SOCKOP_sendto 11 -#define SOCKOP_recvfrom 12 -#define SOCKOP_shutdown 13 -#define SOCKOP_setsockopt 14 -#define SOCKOP_getsockopt 15 -#define SOCKOP_sendmsg 16 -#define SOCKOP_recvmsg 17 - -#endif /* _SYS_SOCKETCALL_H */ diff --git a/sysdeps/unix/sysv/linux/sys/syscall.h b/sysdeps/unix/sysv/linux/sys/syscall.h index cef91f6..d6b14fc 100644 --- a/sysdeps/unix/sysv/linux/sys/syscall.h +++ b/sysdeps/unix/sysv/linux/sys/syscall.h @@ -27,9 +27,9 @@ #ifndef _LIBC /* The Linux kernel header file defines macros `__NR_', but some programs expect the traditional form `SYS_'. So in building libc - we scan the kernel's list and produce with macros for + we scan the kernel's list and produce with macros for all the `SYS_' names. */ -#include +#include #endif #endif diff --git a/sysdeps/unix/sysv/linux/tcgetattr.c b/sysdeps/unix/sysv/linux/tcgetattr.c index 9578c4b..7866183 100644 --- a/sysdeps/unix/sysv/linux/tcgetattr.c +++ b/sysdeps/unix/sysv/linux/tcgetattr.c @@ -23,7 +23,7 @@ /* The difference here is that the termios structure used in the kernel is not the same as we use in the libc. Therefore we must translate it here. */ -#include +#include /* Put the state of FD into *TERMIOS_P. */ int diff --git a/sysdeps/unix/sysv/linux/tcsetattr.c b/sysdeps/unix/sysv/linux/tcsetattr.c index 6c12811..0b9fee2 100644 --- a/sysdeps/unix/sysv/linux/tcsetattr.c +++ b/sysdeps/unix/sysv/linux/tcsetattr.c @@ -24,7 +24,7 @@ /* The difference here is that the termios structure used in the kernel is not the same as we use in the libc. Therefore we must translate it here. */ -#include +#include /* Set the state of FD to *TERMIOS_P. */ diff --git a/sysdeps/unix/sysv/linux/termbits.h b/sysdeps/unix/sysv/linux/termbits.h deleted file mode 100644 index 8224ac5..0000000 --- a/sysdeps/unix/sysv/linux/termbits.h +++ /dev/null @@ -1,184 +0,0 @@ -/* termios type and macro definitions. Linux version. - Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _TERMBITS_H -#define _TERMBITS_H 1 - -typedef unsigned char cc_t; -typedef unsigned int speed_t; -typedef unsigned int tcflag_t; - -#define NCCS 32 -struct termios - { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ - }; - -/* c_cc characters */ -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VTIME 5 -#define VMIN 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VEOL 11 -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 -#define VEOL2 16 - -/* c_iflag bits */ -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IUCLC 0001000 -#define IXON 0002000 -#define IXANY 0004000 -#define IXOFF 0010000 -#define IMAXBEL 0020000 - -/* c_oflag bits */ -#define OPOST 0000001 -#define OLCUC 0000002 -#define ONLCR 0000004 -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#define NLDLY 0000400 -#define NL0 0000000 -#define NL1 0000400 -#define CRDLY 0003000 -#define CR0 0000000 -#define CR1 0001000 -#define CR2 0002000 -#define CR3 0003000 -#define TABDLY 0014000 -#define TAB0 0000000 -#define TAB1 0004000 -#define TAB2 0010000 -#define TAB3 0014000 -#define XTABS 0014000 -#define BSDLY 0020000 -#define BS0 0000000 -#define BS1 0020000 -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 -#define FFDLY 0100000 -#define FF0 0000000 -#define FF1 0100000 - -/* c_cflag bit meaning */ -#define CBAUD 0010017 -#define B0 0000000 /* hang up */ -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 -#define EXTA B19200 -#define EXTB B38400 -#define CSIZE 0000060 -#define CS5 0000000 -#define CS6 0000020 -#define CS7 0000040 -#define CS8 0000060 -#define CSTOPB 0000100 -#define CREAD 0000200 -#define PARENB 0000400 -#define PARODD 0001000 -#define HUPCL 0002000 -#define CLOCAL 0004000 -#define CBAUDEX 0010000 -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define CIBAUD 002003600000 /* input baud rate (not used) */ -#define CRTSCTS 020000000000 /* flow control */ - -/* c_lflag bits */ -#define ISIG 0000001 -#define ICANON 0000002 -#define XCASE 0000004 -#define ECHO 0000010 -#define ECHOE 0000020 -#define ECHOK 0000040 -#define ECHONL 0000100 -#define NOFLSH 0000200 -#define TOSTOP 0000400 -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0010000 -#define PENDIN 0040000 -#define IEXTEN 0100000 - -/* tcflow() and TCXONC use these */ -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -/* tcflush() and TCFLSH use these */ -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -/* tcsetattr uses these */ -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - - -#define _IOT_termios /* Hurd ioctl type field. */ \ - _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) - -#endif /* termbits.h */ diff --git a/sysdeps/unix/sysv/linux/timebits.h b/sysdeps/unix/sysv/linux/timebits.h deleted file mode 100644 index de30a6f..0000000 --- a/sysdeps/unix/sysv/linux/timebits.h +++ /dev/null @@ -1,52 +0,0 @@ -/* System-dependent timing definitions. Linux version. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef __need_timeval -# undef __need_timeval -# ifndef _STRUCT_TIMEVAL -# define _STRUCT_TIMEVAL 1 -/* A time value that is accurate to the nearest - microsecond but also has a range of years. */ -struct timeval - { - time_t tv_sec; /* Seconds. */ - time_t tv_usec; /* Microseconds. */ - }; -# endif /* struct timeval */ -#endif /* need timeval */ - - -#ifndef _TIMEBITS_H -# define _TIMEBITS_H 1 - -/* ISO/IEC 9899:1990 7.12.1: - The macro `CLOCKS_PER_SEC' is the number per second of the value - returned by the `clock' function. */ -/* CAE XSH, Issue 4, Version 2: - The value of CLOCKS_PER_SEC is required to be 1 million on all - XSI-conformant systems. */ -# define CLOCKS_PER_SEC 1000000 - -# ifndef __STRICT_ANSI__ -/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK - presents the real value for clock ticks per second for the system. */ -# define CLK_TCK 100 -# endif - -#endif /* timebits.h */ diff --git a/sysdeps/unix/sysv/linux/ustatbits.h b/sysdeps/unix/sysv/linux/ustatbits.h deleted file mode 100644 index 526069a..0000000 --- a/sysdeps/unix/sysv/linux/ustatbits.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include - -struct ustat - { - __daddr_t f_tfree; - __ino_t f_tinode; - char f_fname[6]; - char f_fpack[6]; - }; diff --git a/sysdeps/unix/sysv/linux/utsnamelen.h b/sysdeps/unix/sysv/linux/utsnamelen.h deleted file mode 100644 index 64e2ab5..0000000 --- a/sysdeps/unix/sysv/linux/utsnamelen.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* Length of the entries in `struct utsname' is 65. */ -#define _UTSNAME_LENGTH 65 - -/* Linux provides as additional information in the `struct utsname' - the name of the current domain. Define _UTSNAME_DOMAIN_LENGTH - to a value != 0 to activate this entry. */ -#define _UTSNAME_DOMAIN_LENGTH _UTSNAME_LENGTH diff --git a/sysdeps/unix/sysv/linux/waitflags.h b/sysdeps/unix/sysv/linux/waitflags.h deleted file mode 100644 index a60d172..0000000 --- a/sysdeps/unix/sysv/linux/waitflags.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Definitions of flag bits for `waitpid' et al. - Copyright (C) 1992, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _WAITFLAGS_H - -#define _WAITFLAGS_H 1 - -/* Bits in the third argument to `waitpid'. */ -#define WNOHANG 1 /* Don't block waiting. */ -#define WUNTRACED 2 /* Report status of stopped children. */ - -#define __WCLONE 0x80000000 /* Wait for cloned process. */ - -#endif /* waitflags.h */ diff --git a/sysdeps/unix/sysv/local_lim.h b/sysdeps/unix/sysv/local_lim.h deleted file mode 100644 index a370928..0000000 --- a/sysdeps/unix/sysv/local_lim.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 1992, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#define NGROUPS_MAX 0 /* No supplementary groups. */ -#define ARG_MAX 5120 -#define CHILD_MAX 25 -#define OPEN_MAX 60 -#define LINK_MAX 1000 -#define MAX_CANON 256 - -/* For SVR3, this is 14. For SVR4, it is 255, at least on ufs - file systems, even though the System V limits.h incorrectly - defines it as 14. Giving it a value which is too large - is harmless (it is a maximum). */ -#define NAME_MAX 255 - -#define PATH_MAX 1024 diff --git a/sysdeps/unix/sysv/minix/bits/sigaction.h b/sysdeps/unix/sysv/minix/bits/sigaction.h new file mode 100644 index 0000000..6b0c460 --- /dev/null +++ b/sysdeps/unix/sysv/minix/bits/sigaction.h @@ -0,0 +1,49 @@ +/* Copyright (C) 1992, 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* Structure describing the action to be taken when a signal arrives. */ +struct sigaction + { + /* Signal handler. */ + __sighandler_t sa_handler; + + /* Additional set of signals to be blocked. */ + __sigset_t sa_mask; + + /* Special flags. */ + int sa_flags; + }; + +/* Bits in `sa_flags'. */ +#ifdef __USE_MISC +#define SA_ONSTACK 0x1 /* Take signal on signal stack. */ +#define SA_RESETHAND 0x2 /* Reset signal handler when signal caught. */ +#define SA_NODEFER 0x4 /* Don't block signal while catching it. */ +#define SA_RESTART 0x8 /* Don't restart syscall on signal return. */ +#define SA_SIGINFO 0x10 /* Extended signal handling. */ +#define SA_NOCLDWAIT 0x20 /* Don't create zombies. */ +#define SA_COMPAT 0x80 /* Internal flag for old signal catchers. */ +#define SA_DISABLE 0x100 /* Disable alternate signal stack. */ +#endif +#define SA_NOCLDSTOP 0x40 /* Don't send SIGCHLD when children stop. */ + + +/* Values for the HOW argument to `sigprocmask'. */ +#define SIG_BLOCK 0 /* Block signals. */ +#define SIG_UNBLOCK 1 /* Unblock signals. */ +#define SIG_SETMASK 2 /* Set the set of blocked signals. */ diff --git a/sysdeps/unix/sysv/minix/sigaction.h b/sysdeps/unix/sysv/minix/sigaction.h deleted file mode 100644 index 6b0c460..0000000 --- a/sysdeps/unix/sysv/minix/sigaction.h +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright (C) 1992, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* Structure describing the action to be taken when a signal arrives. */ -struct sigaction - { - /* Signal handler. */ - __sighandler_t sa_handler; - - /* Additional set of signals to be blocked. */ - __sigset_t sa_mask; - - /* Special flags. */ - int sa_flags; - }; - -/* Bits in `sa_flags'. */ -#ifdef __USE_MISC -#define SA_ONSTACK 0x1 /* Take signal on signal stack. */ -#define SA_RESETHAND 0x2 /* Reset signal handler when signal caught. */ -#define SA_NODEFER 0x4 /* Don't block signal while catching it. */ -#define SA_RESTART 0x8 /* Don't restart syscall on signal return. */ -#define SA_SIGINFO 0x10 /* Extended signal handling. */ -#define SA_NOCLDWAIT 0x20 /* Don't create zombies. */ -#define SA_COMPAT 0x80 /* Internal flag for old signal catchers. */ -#define SA_DISABLE 0x100 /* Disable alternate signal stack. */ -#endif -#define SA_NOCLDSTOP 0x40 /* Don't send SIGCHLD when children stop. */ - - -/* Values for the HOW argument to `sigprocmask'. */ -#define SIG_BLOCK 0 /* Block signals. */ -#define SIG_UNBLOCK 1 /* Unblock signals. */ -#define SIG_SETMASK 2 /* Set the set of blocked signals. */ diff --git a/sysdeps/unix/sysv/sco3.2.4/bits/confname.h b/sysdeps/unix/sysv/sco3.2.4/bits/confname.h new file mode 100644 index 0000000..0408951 --- /dev/null +++ b/sysdeps/unix/sysv/sco3.2.4/bits/confname.h @@ -0,0 +1,50 @@ +/* `sysconf', `pathconf', and `confstr' NAME values. Generic version. +Copyright (C) 1993 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 Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* Values for the NAME argument to `pathconf' and `fpathconf'. */ +#define _PC_LINK_MAX 0 +#define _PC_MAX_CANON 1 +#define _PC_MAX_INPUT 2 +#define _PC_NAME_MAX 3 +#define _PC_PATH_MAX 4 +#define _PC_PIPE_BUF 5 +#define _PC_CHOWN_RESTRICTED 6 +#define _PC_NO_TRUNC 7 +#define _PC_VDISABLE 8 + +/* Values for the argument to `sysconf'. */ +#define _SC_ARG_MAX 0 +#define _SC_CHILD_MAX 1 +#define _SC_CLK_TCK 2 +#define _SC_NGROUPS_MAX 3 +#define _SC_OPEN_MAX 4 +#define _SC_JOB_CONTROL 5 +#define _SC_SAVED_IDS 6 +#define _SC_VERSION 7 +#define _SC_PASS_MAX 8 +#define _SC_XOPEN_VERSION 9 +#define _SC_TZNAME_MAX 666 /* Not handled by SCO's system call. */ + +#ifdef __USE_POSIX2 +/* Values for the NAME argument to `confstr'. */ +enum + { + _CS_PATH /* The default search path. */ + }; +#endif diff --git a/sysdeps/unix/sysv/sco3.2.4/bits/sigaction.h b/sysdeps/unix/sysv/sco3.2.4/bits/sigaction.h new file mode 100644 index 0000000..c21b928 --- /dev/null +++ b/sysdeps/unix/sysv/sco3.2.4/bits/sigaction.h @@ -0,0 +1,39 @@ +/* The proper definitions for SCO's sigaction. +Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* Structure describing the action to be taken when a signal arrives. */ +struct sigaction + { + /* Signal handler. */ + __sighandler_t sa_handler; + + /* Additional set of signals to be blocked. */ + __sigset_t sa_mask; + + /* Special flags. */ + int sa_flags; + }; + +/* Bits in `sa_flags'. */ +#define SA_NOCLDSTOP 0x01 /* Don't send SIGCHLD when children stop. */ + +/* Values for the HOW argument to `sigprocmask'. */ +#define SIG_SETMASK 0 /* Set the set of blocked signals. */ +#define SIG_BLOCK 1 /* Block signals. */ +#define SIG_UNBLOCK 2 /* Unblock signals. */ diff --git a/sysdeps/unix/sysv/sco3.2.4/confname.h b/sysdeps/unix/sysv/sco3.2.4/confname.h deleted file mode 100644 index 0408951..0000000 --- a/sysdeps/unix/sysv/sco3.2.4/confname.h +++ /dev/null @@ -1,50 +0,0 @@ -/* `sysconf', `pathconf', and `confstr' NAME values. Generic version. -Copyright (C) 1993 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 Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* Values for the NAME argument to `pathconf' and `fpathconf'. */ -#define _PC_LINK_MAX 0 -#define _PC_MAX_CANON 1 -#define _PC_MAX_INPUT 2 -#define _PC_NAME_MAX 3 -#define _PC_PATH_MAX 4 -#define _PC_PIPE_BUF 5 -#define _PC_CHOWN_RESTRICTED 6 -#define _PC_NO_TRUNC 7 -#define _PC_VDISABLE 8 - -/* Values for the argument to `sysconf'. */ -#define _SC_ARG_MAX 0 -#define _SC_CHILD_MAX 1 -#define _SC_CLK_TCK 2 -#define _SC_NGROUPS_MAX 3 -#define _SC_OPEN_MAX 4 -#define _SC_JOB_CONTROL 5 -#define _SC_SAVED_IDS 6 -#define _SC_VERSION 7 -#define _SC_PASS_MAX 8 -#define _SC_XOPEN_VERSION 9 -#define _SC_TZNAME_MAX 666 /* Not handled by SCO's system call. */ - -#ifdef __USE_POSIX2 -/* Values for the NAME argument to `confstr'. */ -enum - { - _CS_PATH /* The default search path. */ - }; -#endif diff --git a/sysdeps/unix/sysv/sco3.2.4/sigaction.h b/sysdeps/unix/sysv/sco3.2.4/sigaction.h deleted file mode 100644 index c21b928..0000000 --- a/sysdeps/unix/sysv/sco3.2.4/sigaction.h +++ /dev/null @@ -1,39 +0,0 @@ -/* The proper definitions for SCO's sigaction. -Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* Structure describing the action to be taken when a signal arrives. */ -struct sigaction - { - /* Signal handler. */ - __sighandler_t sa_handler; - - /* Additional set of signals to be blocked. */ - __sigset_t sa_mask; - - /* Special flags. */ - int sa_flags; - }; - -/* Bits in `sa_flags'. */ -#define SA_NOCLDSTOP 0x01 /* Don't send SIGCHLD when children stop. */ - -/* Values for the HOW argument to `sigprocmask'. */ -#define SIG_SETMASK 0 /* Set the set of blocked signals. */ -#define SIG_BLOCK 1 /* Block signals. */ -#define SIG_UNBLOCK 2 /* Unblock signals. */ diff --git a/sysdeps/unix/sysv/sco3.2.4/sysconf.S b/sysdeps/unix/sysv/sco3.2.4/sysconf.S index 631e5e9..44c89f2 100644 --- a/sysdeps/unix/sysv/sco3.2.4/sysconf.S +++ b/sysdeps/unix/sysv/sco3.2.4/sysconf.S @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include -#include +#include .globl __tzname_max ENTRY (__sysconf) diff --git a/sysdeps/unix/sysv/sco3.2/bits/local_lim.h b/sysdeps/unix/sysv/sco3.2/bits/local_lim.h new file mode 100644 index 0000000..365858c --- /dev/null +++ b/sysdeps/unix/sysv/sco3.2/bits/local_lim.h @@ -0,0 +1,37 @@ +/* Copyright (C) 1993, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _BITS_LOCAL_LIM_H +#define _BITS_LOCAL_LIM_H 1 + +#define NGROUPS_MAX 8 /* Maximum number of supplementary groups. */ +#define ARG_MAX 5120 +#define CHILD_MAX 25 +#define OPEN_MAX 60 +#define LINK_MAX 1000 +#define MAX_CANON 256 + +/* For SVR3, this is 14. For SVR4, it is 255, at least on ufs + file systems, even though the System V limits.h incorrectly + defines it as 14. Giving it a value which is too large + is harmless (it is a maximum). */ +#define NAME_MAX 255 + +#define PATH_MAX 1024 + +#endif /* bits/local_lim.h */ diff --git a/sysdeps/unix/sysv/sco3.2/local_lim.h b/sysdeps/unix/sysv/sco3.2/local_lim.h deleted file mode 100644 index e456816..0000000 --- a/sysdeps/unix/sysv/sco3.2/local_lim.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 1993, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _LOCAL_LIM_H -#define _LOCAL_LIM_H 1 - -#define NGROUPS_MAX 8 /* Maximum number of supplementary groups. */ -#define ARG_MAX 5120 -#define CHILD_MAX 25 -#define OPEN_MAX 60 -#define LINK_MAX 1000 -#define MAX_CANON 256 - -/* For SVR3, this is 14. For SVR4, it is 255, at least on ufs - file systems, even though the System V limits.h incorrectly - defines it as 14. Giving it a value which is too large - is harmless (it is a maximum). */ -#define NAME_MAX 255 - -#define PATH_MAX 1024 - -#endif /* local_lim.h */ diff --git a/sysdeps/unix/sysv/signum.h b/sysdeps/unix/sysv/signum.h deleted file mode 100644 index 088ca2a..0000000 --- a/sysdeps/unix/sysv/signum.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Signal number definitions. System V version. - Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef _SIGNAL_H - -/* This file defines the fake signal functions and signal - number constants for System V release 3. */ - -/* Fake signal functions. */ -#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ -#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ -#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ - - -/* Signals. */ -#define SIGHUP 1 /* Hangup (POSIX). */ -#define SIGINT 2 /* Interrupt (ANSI). */ -#define SIGQUIT 3 /* Quit (POSIX). */ -#define SIGILL 4 /* Illegal instruction (ANSI). */ -#define SIGABRT SIGIOT /* Abort (ANSI). */ -#define SIGTRAP 5 /* Trace trap (POSIX). */ -#define SIGIOT 6 /* IOT trap (4.2 BSD). */ -#define SIGEMT 7 /* EMT trap (4.2 BSD). */ -#define SIGFPE 8 /* Floating-point exception (ANSI). */ -#define SIGKILL 9 /* Kill, unblockable (POSIX). */ -#define SIGBUS 10 /* Bus error (4.2 BSD). */ -#define SIGSEGV 11 /* Segmentation violation (ANSI). */ -#define SIGSYS 12 /* Bad argument to system call (4.2 BSD)*/ -#define SIGPIPE 13 /* Broken pipe (POSIX). */ -#define SIGALRM 14 /* Alarm clock (POSIX). */ -#define SIGTERM 15 /* Termination (ANSI). */ -#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */ -#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */ -#define SIGCHLD 18 /* Child status has changed (POSIX). */ -#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ -#define SIGPWR 19 /* Power failure restart (System V). */ - -#endif /* included. */ - -#define _NSIG 20 /* Biggest signal number + 1. */ diff --git a/sysdeps/unix/sysv/statbuf.h b/sysdeps/unix/sysv/statbuf.h deleted file mode 100644 index f74943c..0000000 --- a/sysdeps/unix/sysv/statbuf.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (C) 1992, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _STATBUF_H -#define _STATBUF_H 1 - -struct stat - { - short int st_dev; - unsigned short int st_ino; - unsigned short int st_mode; - short int st_nlink; - unsigned short int st_uid; - unsigned short int st_gid; - short int st_rdev; - long int st_size; - long int st_atime; - long int st_mtime; - long int st_ctime; - }; - -/* Encoding of the file mode. */ - -#define __S_IFMT 0170000 /* These bits determine file type. */ - -/* File types. */ -#define __S_IFDIR 0040000 /* Directory. */ -#define __S_IFCHR 0020000 /* Character device. */ -#define __S_IFBLK 0060000 /* Block device. */ -#define __S_IFREG 0100000 /* Regular file. */ -#define __S_IFIFO 0010000 /* FIFO. */ - -/* These don't actually exist on System V, but having them doesn't hurt. */ -#define __S_IFLNK 0120000 /* Symbolic link. */ -#define __S_IFSOCK 0140000 /* Socket. */ - -/* Protection bits. */ - -#define __S_ISUID 04000 /* Set user ID on execution. */ -#define __S_ISGID 02000 /* Set group ID on execution. */ -#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ -#define __S_IREAD 0400 /* Read by owner. */ -#define __S_IWRITE 0200 /* Write by owner. */ -#define __S_IEXEC 0100 /* Execute by owner. */ - -#endif /* statbuf.h */ diff --git a/sysdeps/unix/sysv/sysv4/bits/sigaction.h b/sysdeps/unix/sysv/sysv4/bits/sigaction.h new file mode 100644 index 0000000..1305ba6 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/bits/sigaction.h @@ -0,0 +1,51 @@ +/* The proper definitions for SVR4's sigaction. +Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* Structure describing the action to be taken when a signal arrives. */ +struct sigaction + { + /* Special flags. */ + int sa_flags; + + /* Signal handler. */ + __sighandler_t sa_handler; + + /* Additional set of signals to be blocked. */ + __sigset_t sa_mask; + + /* Padding. */ + int sa_resv[2]; + }; + +/* Bits in `sa_flags'. */ +#ifdef __USE_MISC +#define SA_ONSTACK 0x1 /* Take signal on signal stack. */ +#define SA_RESETHAND 0x2 /* Reset to SIG_DFL on entry to handler. */ +#define SA_RESTART 0x4 /* Don't restart syscall on signal return. */ +#define SA_SIGINFO 0x8 /* Provide additional info to the handler. */ +#define SA_NODEFER 0x10 /* Don't automatically block the signal when + its handler is being executed. */ +#define SA_NOCLDWAIT 0x10000 /* Don't save zombie processes. */ +#endif +#define SA_NOCLDSTOP 0x20000 /* Don't send SIGCHLD when children stop. */ + +/* Values for the HOW argument to `sigprocmask'. */ +#define SIG_BLOCK 1 /* Block signals. */ +#define SIG_UNBLOCK 2 /* Unblock signals. */ +#define SIG_SETMASK 3 /* Set the set of blocked signals. */ diff --git a/sysdeps/unix/sysv/sysv4/bits/signum.h b/sysdeps/unix/sysv/sysv4/bits/signum.h new file mode 100644 index 0000000..f11c731 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/bits/signum.h @@ -0,0 +1,66 @@ +/* Signal number definitions. SVR4 version. + Copyright (C) 1994, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifdef _SIGNAL_H + +/* Fake signal functions. */ +#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ +#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ +#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ + + +/* Signals. */ +#define SIGHUP 1 /* Hangup (POSIX). */ +#define SIGINT 2 /* Interrupt (ANSI). */ +#define SIGQUIT 3 /* Quit (POSIX). */ +#define SIGILL 4 /* Illegal instruction (ANSI). */ +#define SIGABRT SIGIOT /* Abort (ANSI). */ +#define SIGTRAP 5 /* Trace trap (POSIX). */ +#define SIGIOT 6 /* IOT trap (4.2 BSD). */ +#define SIGEMT 7 /* EMT trap (4.2 BSD). */ +#define SIGFPE 8 /* Floating-point exception (ANSI). */ +#define SIGKILL 9 /* Kill, unblockable (POSIX). */ +#define SIGBUS 10 /* Bus error (4.2 BSD). */ +#define SIGSEGV 11 /* Segmentation violation (ANSI). */ +#define SIGSYS 12 /* Bad argument to system call (4.2 BSD)*/ +#define SIGPIPE 13 /* Broken pipe (POSIX). */ +#define SIGALRM 14 /* Alarm clock (POSIX). */ +#define SIGTERM 15 /* Termination (ANSI). */ +#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */ +#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */ +#define SIGCHLD 18 /* Child status has changed (POSIX). */ +#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ +#define SIGPWR 19 /* Power failure restart (System V). */ +#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */ +#define SIGURG 21 /* Urgent condition on socket (4.2 BSD).*/ +#define SIGPOLL 22 /* Pollable event occurred (System V). */ +#define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */ +#define SIGSTOP 23 /* Stop, unblockable (POSIX). */ +#define SIGTSTP 24 /* Keyboard stop (POSIX). */ +#define SIGCONT 25 /* Continue (POSIX). */ +#define SIGTTIN 26 /* Background read from tty (POSIX). */ +#define SIGTTOU 27 /* Background write to tty (POSIX). */ +#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */ +#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */ +#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */ +#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */ + +#endif /* included. */ + +#define _NSIG 32 /* Biggest signal number + 1. */ diff --git a/sysdeps/unix/sysv/sysv4/bits/sigset.h b/sysdeps/unix/sysv/sysv4/bits/sigset.h new file mode 100644 index 0000000..1461c93 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/bits/sigset.h @@ -0,0 +1,96 @@ +/* __sig_atomic_t, __sigset_t, and related definitions. SVR4 version. + Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SIGSET_H_types +#define _SIGSET_H_types 1 + +typedef int __sig_atomic_t; + +/* A `sigset_t' has a bit for each signal. */ +typedef struct + { + unsigned long int __sigbits[4]; + } __sigset_t; + +#endif /* ! _SIGSET_H_types */ + +/* We only want to define these functions if was actually + included; otherwise we were included just to define the types. Since we + are namespace-clean, it wouldn't hurt to define extra macros. But + trouble can be caused by functions being defined (e.g., any global + register vars declared later will cause compilation errors). */ + +#if !defined (_SIGSET_H_fns) && defined (_SIGNAL_H) +#define _SIGSET_H_fns 1 + +/* Return a mask that includes SIG only. */ +#define __sigmask(sig) (1 << ((sig) - 1)) + + +/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ +#define __NSSBITS (sizeof (__sigset_t) * 8) +#define __SSELT(s) ((s) / __NSSBITS) +#define __SSMASK(s) (1 << ((s) % __NSSBITS)) + +#ifndef _EXTERN_INLINE +#define _EXTERN_INLINE extern __inline +#endif + +_EXTERN_INLINE int +__sigemptyset (__sigset_t *__set) +{ + __set->__sigbits[0] = __set->__sigbits[1] = + __set->__sigbits[2] = __set->__sigbits[3] = 0L; + return 0; +} + +_EXTERN_INLINE int +__sigfillset (__sigset_t *__set) +{ + /* SVR4 has a system call for `sigfillset' (!), and it only sets the bits + for signals [1,31]. Setting bits for unimplemented signals seems + harmless (and we will find out if it really is). */ + __set->__sigbits[0] = __set->__sigbits[1] = + __set->__sigbits[2] = __set->__sigbits[3] = ~0L; + return 0; +} + +_EXTERN_INLINE int +__sigaddset (__sigset_t *__set, int __sig) +{ + __set->__sigbits[__SSELT (__sig)] |= __SSMASK (__sig); + return 0; +} + +_EXTERN_INLINE int +__sigdelset (__sigset_t *__set, int __sig) +{ + __set->__sigbits[__SSELT (__sig)] &= ~__SSMASK (__sig); + return 0; +} + +_EXTERN_INLINE int +__sigismember (__const __sigset_t *__set, int __sig) +{ + if (__set->__sigbits[__SSELT (__sig)] & __SSMASK (__sig)) + return 1; + return 0; +} + +#endif /* ! _SIGSET_H_fns */ diff --git a/sysdeps/unix/sysv/sysv4/bits/utsname.h b/sysdeps/unix/sysv/sysv4/bits/utsname.h new file mode 100644 index 0000000..9dcc618 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/bits/utsname.h @@ -0,0 +1 @@ +#define _UTSNAME_LENGTH 257 diff --git a/sysdeps/unix/sysv/sysv4/bits/waitflags.h b/sysdeps/unix/sysv/sysv4/bits/waitflags.h new file mode 100644 index 0000000..29ff566 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/bits/waitflags.h @@ -0,0 +1,34 @@ +/* Definitions of flag bits for `waitpid' et al. + Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Brendan Kehoe (brendan@zen.org). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_WAIT_H +#error "Never use directly; include instead." +#endif + + +/* Bits in the third argument to `waitpid'. */ +#define WNOHANG 64 /* Don't block waiting. */ +#define WUNTRACED 4 /* Report status of stopped children. */ + +#ifdef __USE_SVID +#define WEXITED 1 /* Look for children that have exited. */ +#define WTRAPPED 2 /* Look for processes that stopped + while tracing. */ +#endif diff --git a/sysdeps/unix/sysv/sysv4/i386/bits/stat.h b/sysdeps/unix/sysv/sysv4/i386/bits/stat.h new file mode 100644 index 0000000..9b6fed0 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/i386/bits/stat.h @@ -0,0 +1,94 @@ +/* Copyright (C) 1993, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Brendan Kehoe (brendan@zen.org). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H 1 + +#include + +/* Versions of the `struct stat' data structure and + the bits of the `xmknod' interface. */ +#define _STAT_VER 2 +#define _MKNOD_VER 2 + +/* Structure describing file characteristics. */ +struct stat + { + unsigned long st_dev; /* Device. */ + long st_filler1[3]; + unsigned long st_ino; /* File serial number. */ + unsigned long st_mode; /* File mode. */ + unsigned long st_nlink; /* Link count. */ + long st_uid; /* User ID of the file's owner. */ + long st_gid; /* Group ID of the file's group.*/ + unsigned long st_rdev; /* Device number, if device. */ + long st_filler2[2]; + + long st_size; /* Size of file, in bytes. */ + /* SVR4 added this extra long to allow for expansion of off_t. */ + long st_filler3; + + long st_atime; /* Time of last access. */ + unsigned long st_atime_usec; + long st_mtime; /* Time of last modification. */ + unsigned long st_mtime_usec; + long st_ctime; /* Time of last status change. */ + unsigned long st_ctime_usec; + + long st_blksize; /* Optimal block size for I/O. */ +#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */ + + long st_blocks; /* Number of 512-byte blocks allocated. */ + char st_fstype[16]; /* The type of this filesystem. */ + int st_aclcnt; + unsigned long st_level; + unsigned long st_flags; + unsigned long st_cmwlevel; + long st_filler4[4]; + }; + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFIFO 0010000 /* FIFO. */ + +/* These don't actually exist on System V, but having them doesn't hurt. */ +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + +#endif /* bits/stat.h */ diff --git a/sysdeps/unix/sysv/sysv4/i386/statbuf.h b/sysdeps/unix/sysv/sysv4/i386/statbuf.h deleted file mode 100644 index 9354d67..0000000 --- a/sysdeps/unix/sysv/sysv4/i386/statbuf.h +++ /dev/null @@ -1,90 +0,0 @@ -/* Copyright (C) 1993, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _STATBUF_H -#define _STATBUF_H 1 - -#include - -/* Versions of the `struct stat' data structure and - the bits of the `xmknod' interface. */ -#define _STAT_VER 2 -#define _MKNOD_VER 2 - -/* Structure describing file characteristics. */ -struct stat - { - unsigned long st_dev; /* Device. */ - long st_filler1[3]; - unsigned long st_ino; /* File serial number. */ - unsigned long st_mode; /* File mode. */ - unsigned long st_nlink; /* Link count. */ - long st_uid; /* User ID of the file's owner. */ - long st_gid; /* Group ID of the file's group.*/ - unsigned long st_rdev; /* Device number, if device. */ - long st_filler2[2]; - - long st_size; /* Size of file, in bytes. */ - /* SVR4 added this extra long to allow for expansion of off_t. */ - long st_filler3; - - long st_atime; /* Time of last access. */ - unsigned long st_atime_usec; - long st_mtime; /* Time of last modification. */ - unsigned long st_mtime_usec; - long st_ctime; /* Time of last status change. */ - unsigned long st_ctime_usec; - - long st_blksize; /* Optimal block size for I/O. */ -#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */ - - long st_blocks; /* Number of 512-byte blocks allocated. */ - char st_fstype[16]; /* The type of this filesystem. */ - int st_aclcnt; - unsigned long st_level; - unsigned long st_flags; - unsigned long st_cmwlevel; - long st_filler4[4]; - }; - -/* Encoding of the file mode. */ - -#define __S_IFMT 0170000 /* These bits determine file type. */ - -/* File types. */ -#define __S_IFDIR 0040000 /* Directory. */ -#define __S_IFCHR 0020000 /* Character device. */ -#define __S_IFBLK 0060000 /* Block device. */ -#define __S_IFREG 0100000 /* Regular file. */ -#define __S_IFIFO 0010000 /* FIFO. */ - -/* These don't actually exist on System V, but having them doesn't hurt. */ -#define __S_IFLNK 0120000 /* Symbolic link. */ -#define __S_IFSOCK 0140000 /* Socket. */ - -/* Protection bits. */ - -#define __S_ISUID 04000 /* Set user ID on execution. */ -#define __S_ISGID 02000 /* Set group ID on execution. */ -#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ -#define __S_IREAD 0400 /* Read by owner. */ -#define __S_IWRITE 0200 /* Write by owner. */ -#define __S_IEXEC 0100 /* Execute by owner. */ - -#endif /* statbuf.h */ diff --git a/sysdeps/unix/sysv/sysv4/i386/sysdep.h b/sysdeps/unix/sysv/sysv4/i386/sysdep.h index 1e0cd69..ad262e2 100644 --- a/sysdeps/unix/sysv/sysv4/i386/sysdep.h +++ b/sysdeps/unix/sysv/sysv4/i386/sysdep.h @@ -24,7 +24,7 @@ Cambridge, MA 02139, USA. */ #ifndef _ERRNO_H #define _ERRNO_H #endif -#include +#include #undef PSEUDO #define PSEUDO(name, syscall_name, args) \ diff --git a/sysdeps/unix/sysv/sysv4/sigaction.h b/sysdeps/unix/sysv/sysv4/sigaction.h deleted file mode 100644 index 1305ba6..0000000 --- a/sysdeps/unix/sysv/sysv4/sigaction.h +++ /dev/null @@ -1,51 +0,0 @@ -/* The proper definitions for SVR4's sigaction. -Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* Structure describing the action to be taken when a signal arrives. */ -struct sigaction - { - /* Special flags. */ - int sa_flags; - - /* Signal handler. */ - __sighandler_t sa_handler; - - /* Additional set of signals to be blocked. */ - __sigset_t sa_mask; - - /* Padding. */ - int sa_resv[2]; - }; - -/* Bits in `sa_flags'. */ -#ifdef __USE_MISC -#define SA_ONSTACK 0x1 /* Take signal on signal stack. */ -#define SA_RESETHAND 0x2 /* Reset to SIG_DFL on entry to handler. */ -#define SA_RESTART 0x4 /* Don't restart syscall on signal return. */ -#define SA_SIGINFO 0x8 /* Provide additional info to the handler. */ -#define SA_NODEFER 0x10 /* Don't automatically block the signal when - its handler is being executed. */ -#define SA_NOCLDWAIT 0x10000 /* Don't save zombie processes. */ -#endif -#define SA_NOCLDSTOP 0x20000 /* Don't send SIGCHLD when children stop. */ - -/* Values for the HOW argument to `sigprocmask'. */ -#define SIG_BLOCK 1 /* Block signals. */ -#define SIG_UNBLOCK 2 /* Unblock signals. */ -#define SIG_SETMASK 3 /* Set the set of blocked signals. */ diff --git a/sysdeps/unix/sysv/sysv4/signum.h b/sysdeps/unix/sysv/sysv4/signum.h deleted file mode 100644 index f11c731..0000000 --- a/sysdeps/unix/sysv/sysv4/signum.h +++ /dev/null @@ -1,66 +0,0 @@ -/* Signal number definitions. SVR4 version. - Copyright (C) 1994, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef _SIGNAL_H - -/* Fake signal functions. */ -#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ -#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ -#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ - - -/* Signals. */ -#define SIGHUP 1 /* Hangup (POSIX). */ -#define SIGINT 2 /* Interrupt (ANSI). */ -#define SIGQUIT 3 /* Quit (POSIX). */ -#define SIGILL 4 /* Illegal instruction (ANSI). */ -#define SIGABRT SIGIOT /* Abort (ANSI). */ -#define SIGTRAP 5 /* Trace trap (POSIX). */ -#define SIGIOT 6 /* IOT trap (4.2 BSD). */ -#define SIGEMT 7 /* EMT trap (4.2 BSD). */ -#define SIGFPE 8 /* Floating-point exception (ANSI). */ -#define SIGKILL 9 /* Kill, unblockable (POSIX). */ -#define SIGBUS 10 /* Bus error (4.2 BSD). */ -#define SIGSEGV 11 /* Segmentation violation (ANSI). */ -#define SIGSYS 12 /* Bad argument to system call (4.2 BSD)*/ -#define SIGPIPE 13 /* Broken pipe (POSIX). */ -#define SIGALRM 14 /* Alarm clock (POSIX). */ -#define SIGTERM 15 /* Termination (ANSI). */ -#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */ -#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */ -#define SIGCHLD 18 /* Child status has changed (POSIX). */ -#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ -#define SIGPWR 19 /* Power failure restart (System V). */ -#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */ -#define SIGURG 21 /* Urgent condition on socket (4.2 BSD).*/ -#define SIGPOLL 22 /* Pollable event occurred (System V). */ -#define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */ -#define SIGSTOP 23 /* Stop, unblockable (POSIX). */ -#define SIGTSTP 24 /* Keyboard stop (POSIX). */ -#define SIGCONT 25 /* Continue (POSIX). */ -#define SIGTTIN 26 /* Background read from tty (POSIX). */ -#define SIGTTOU 27 /* Background write to tty (POSIX). */ -#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */ -#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */ -#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */ -#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */ - -#endif /* included. */ - -#define _NSIG 32 /* Biggest signal number + 1. */ diff --git a/sysdeps/unix/sysv/sysv4/sigset.h b/sysdeps/unix/sysv/sysv4/sigset.h deleted file mode 100644 index 1461c93..0000000 --- a/sysdeps/unix/sysv/sysv4/sigset.h +++ /dev/null @@ -1,96 +0,0 @@ -/* __sig_atomic_t, __sigset_t, and related definitions. SVR4 version. - Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SIGSET_H_types -#define _SIGSET_H_types 1 - -typedef int __sig_atomic_t; - -/* A `sigset_t' has a bit for each signal. */ -typedef struct - { - unsigned long int __sigbits[4]; - } __sigset_t; - -#endif /* ! _SIGSET_H_types */ - -/* We only want to define these functions if was actually - included; otherwise we were included just to define the types. Since we - are namespace-clean, it wouldn't hurt to define extra macros. But - trouble can be caused by functions being defined (e.g., any global - register vars declared later will cause compilation errors). */ - -#if !defined (_SIGSET_H_fns) && defined (_SIGNAL_H) -#define _SIGSET_H_fns 1 - -/* Return a mask that includes SIG only. */ -#define __sigmask(sig) (1 << ((sig) - 1)) - - -/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ -#define __NSSBITS (sizeof (__sigset_t) * 8) -#define __SSELT(s) ((s) / __NSSBITS) -#define __SSMASK(s) (1 << ((s) % __NSSBITS)) - -#ifndef _EXTERN_INLINE -#define _EXTERN_INLINE extern __inline -#endif - -_EXTERN_INLINE int -__sigemptyset (__sigset_t *__set) -{ - __set->__sigbits[0] = __set->__sigbits[1] = - __set->__sigbits[2] = __set->__sigbits[3] = 0L; - return 0; -} - -_EXTERN_INLINE int -__sigfillset (__sigset_t *__set) -{ - /* SVR4 has a system call for `sigfillset' (!), and it only sets the bits - for signals [1,31]. Setting bits for unimplemented signals seems - harmless (and we will find out if it really is). */ - __set->__sigbits[0] = __set->__sigbits[1] = - __set->__sigbits[2] = __set->__sigbits[3] = ~0L; - return 0; -} - -_EXTERN_INLINE int -__sigaddset (__sigset_t *__set, int __sig) -{ - __set->__sigbits[__SSELT (__sig)] |= __SSMASK (__sig); - return 0; -} - -_EXTERN_INLINE int -__sigdelset (__sigset_t *__set, int __sig) -{ - __set->__sigbits[__SSELT (__sig)] &= ~__SSMASK (__sig); - return 0; -} - -_EXTERN_INLINE int -__sigismember (__const __sigset_t *__set, int __sig) -{ - if (__set->__sigbits[__SSELT (__sig)] & __SSMASK (__sig)) - return 1; - return 0; -} - -#endif /* ! _SIGSET_H_fns */ diff --git a/sysdeps/unix/sysv/sysv4/solaris2/bits/signum.h b/sysdeps/unix/sysv/sysv4/solaris2/bits/signum.h new file mode 100644 index 0000000..4e55764 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/solaris2/bits/signum.h @@ -0,0 +1,73 @@ +/* Signal number definitions. Solaris 2 version. + Copyright (C) 1994, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifdef _SIGNAL_H + +/* Fake signal functions. */ +#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ +#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ +#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ + + +/* Signals. */ +#define SIGHUP 1 /* Hangup (POSIX). */ +#define SIGINT 2 /* Interrupt (ANSI). */ +#define SIGQUIT 3 /* Quit (POSIX). */ +#define SIGILL 4 /* Illegal instruction (ANSI). */ +#define SIGABRT SIGIOT /* Abort (ANSI). */ +#define SIGTRAP 5 /* Trace trap (POSIX). */ +#define SIGIOT 6 /* IOT trap (4.2 BSD). */ +#define SIGEMT 7 /* EMT trap (4.2 BSD). */ +#define SIGFPE 8 /* Floating-point exception (ANSI). */ +#define SIGKILL 9 /* Kill, unblockable (POSIX). */ +#define SIGBUS 10 /* Bus error (4.2 BSD). */ +#define SIGSEGV 11 /* Segmentation violation (ANSI). */ +#define SIGSYS 12 /* Bad argument to system call (4.2 BSD)*/ +#define SIGPIPE 13 /* Broken pipe (POSIX). */ +#define SIGALRM 14 /* Alarm clock (POSIX). */ +#define SIGTERM 15 /* Termination (ANSI). */ +#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */ +#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */ +#define SIGCHLD 18 /* Child status has changed (POSIX). */ +#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ +#define SIGPWR 19 /* Power failure restart (System V). */ +#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */ +#define SIGURG 21 /* Urgent condition on socket (4.2 BSD).*/ +#define SIGPOLL 22 /* Pollable event occurred (System V). */ +#define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */ +#define SIGSTOP 23 /* Stop, unblockable (POSIX). */ +#define SIGTSTP 24 /* Keyboard stop (POSIX). */ +#define SIGCONT 25 /* Continue (POSIX). */ +#define SIGTTIN 26 /* Background read from tty (POSIX). */ +#define SIGTTOU 27 /* Background write to tty (POSIX). */ +#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */ +#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */ +#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */ +#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */ +/* The following signals are new in Solaris 2. */ +#define SIGWAITING 32 /* Process's lwps are blocked. */ +#define SIGLWP 33 /* Special signal used by thread library. */ +#define SIGFREEZE 34 /* Special signal used by CPR. */ +#define SIGTHAW 35 /* Special signal used by CPR. */ +#define _SIGRTMIN 36 /* First (highest-priority) realtime signal. */ +#define _SIGRTMAX 43 /* Last (lowest-priority) realtime signal. */ + +#endif /* included. */ + +#define _NSIG 44 /* Biggest signal number + 1. */ diff --git a/sysdeps/unix/sysv/sysv4/solaris2/bits/stat.h b/sysdeps/unix/sysv/sysv4/solaris2/bits/stat.h new file mode 100644 index 0000000..ea5f1f4 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/solaris2/bits/stat.h @@ -0,0 +1,87 @@ +/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Brendan Kehoe (brendan@zen.org). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H 1 + +#include + +/* Structure describing file characteristics. */ +struct stat + { + unsigned long int st_dev; + long st_filler1[3]; + __ino_t st_ino; /* File serial number. */ + unsigned long int st_mode; /* File mode. */ + /* This is unsigned long instead of __nlink_t, since SVR4 has + a long nlink_t, not a short one. */ + unsigned long int st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + unsigned long int st_rdev; /* Device number, if device. */ + long st_filler2[2]; + + __off_t st_size; /* Size of file, in bytes. */ + /* SVR4 added this extra long to allow for expansion of off_t. */ + long st_filler3; + + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atime_usec; + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtime_usec; + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctime_usec; + + long st_blksize; /* Optimal block size for I/O. */ +#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */ + + long st_blocks; /* Number of 512-byte blocks allocated. */ + char st_fstype[16]; + long st_filler4[8]; + }; + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFIFO 0010000 /* FIFO. */ + +/* These don't actually exist on System V, but having them doesn't hurt. */ +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + +#endif /* bits/stat.h */ diff --git a/sysdeps/unix/sysv/sysv4/solaris2/signum.h b/sysdeps/unix/sysv/sysv4/solaris2/signum.h deleted file mode 100644 index 4e55764..0000000 --- a/sysdeps/unix/sysv/sysv4/solaris2/signum.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Signal number definitions. Solaris 2 version. - Copyright (C) 1994, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef _SIGNAL_H - -/* Fake signal functions. */ -#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ -#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ -#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ - - -/* Signals. */ -#define SIGHUP 1 /* Hangup (POSIX). */ -#define SIGINT 2 /* Interrupt (ANSI). */ -#define SIGQUIT 3 /* Quit (POSIX). */ -#define SIGILL 4 /* Illegal instruction (ANSI). */ -#define SIGABRT SIGIOT /* Abort (ANSI). */ -#define SIGTRAP 5 /* Trace trap (POSIX). */ -#define SIGIOT 6 /* IOT trap (4.2 BSD). */ -#define SIGEMT 7 /* EMT trap (4.2 BSD). */ -#define SIGFPE 8 /* Floating-point exception (ANSI). */ -#define SIGKILL 9 /* Kill, unblockable (POSIX). */ -#define SIGBUS 10 /* Bus error (4.2 BSD). */ -#define SIGSEGV 11 /* Segmentation violation (ANSI). */ -#define SIGSYS 12 /* Bad argument to system call (4.2 BSD)*/ -#define SIGPIPE 13 /* Broken pipe (POSIX). */ -#define SIGALRM 14 /* Alarm clock (POSIX). */ -#define SIGTERM 15 /* Termination (ANSI). */ -#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */ -#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */ -#define SIGCHLD 18 /* Child status has changed (POSIX). */ -#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ -#define SIGPWR 19 /* Power failure restart (System V). */ -#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */ -#define SIGURG 21 /* Urgent condition on socket (4.2 BSD).*/ -#define SIGPOLL 22 /* Pollable event occurred (System V). */ -#define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */ -#define SIGSTOP 23 /* Stop, unblockable (POSIX). */ -#define SIGTSTP 24 /* Keyboard stop (POSIX). */ -#define SIGCONT 25 /* Continue (POSIX). */ -#define SIGTTIN 26 /* Background read from tty (POSIX). */ -#define SIGTTOU 27 /* Background write to tty (POSIX). */ -#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */ -#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */ -#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */ -#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */ -/* The following signals are new in Solaris 2. */ -#define SIGWAITING 32 /* Process's lwps are blocked. */ -#define SIGLWP 33 /* Special signal used by thread library. */ -#define SIGFREEZE 34 /* Special signal used by CPR. */ -#define SIGTHAW 35 /* Special signal used by CPR. */ -#define _SIGRTMIN 36 /* First (highest-priority) realtime signal. */ -#define _SIGRTMAX 43 /* Last (lowest-priority) realtime signal. */ - -#endif /* included. */ - -#define _NSIG 44 /* Biggest signal number + 1. */ diff --git a/sysdeps/unix/sysv/sysv4/solaris2/sparc/bits/sigcontext.h b/sysdeps/unix/sysv/sysv4/solaris2/sparc/bits/sigcontext.h new file mode 100644 index 0000000..7402704 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/solaris2/sparc/bits/sigcontext.h @@ -0,0 +1 @@ +#include diff --git a/sysdeps/unix/sysv/sysv4/solaris2/sparc/sigcontext.h b/sysdeps/unix/sysv/sysv4/solaris2/sparc/sigcontext.h deleted file mode 100644 index 532b379..0000000 --- a/sysdeps/unix/sysv/sysv4/solaris2/sparc/sigcontext.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.S b/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.S index da3cd6b..edefad0 100644 --- a/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.S +++ b/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.S @@ -18,7 +18,7 @@ Cambridge, MA 02139, USA. */ #include #define _ERRNO_H -#include +#include ENTRY(syscall_error) /* If it was a syscall that got interrupted, but can diff --git a/sysdeps/unix/sysv/sysv4/solaris2/statbuf.h b/sysdeps/unix/sysv/sysv4/solaris2/statbuf.h deleted file mode 100644 index e4e2ab8..0000000 --- a/sysdeps/unix/sysv/sysv4/solaris2/statbuf.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (C) 1993, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _STATBUF_H -#define _STATBUF_H 1 - -#include - -/* Structure describing file characteristics. */ -struct stat - { - unsigned long int st_dev; - long st_filler1[3]; - __ino_t st_ino; /* File serial number. */ - unsigned long int st_mode; /* File mode. */ - /* This is unsigned long instead of __nlink_t, since SVR4 has - a long nlink_t, not a short one. */ - unsigned long int st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - unsigned long int st_rdev; /* Device number, if device. */ - long st_filler2[2]; - - __off_t st_size; /* Size of file, in bytes. */ - /* SVR4 added this extra long to allow for expansion of off_t. */ - long st_filler3; - - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atime_usec; - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtime_usec; - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctime_usec; - - long st_blksize; /* Optimal block size for I/O. */ -#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */ - - long st_blocks; /* Number of 512-byte blocks allocated. */ - char st_fstype[16]; - long st_filler4[8]; - }; - -/* Encoding of the file mode. */ - -#define __S_IFMT 0170000 /* These bits determine file type. */ - -/* File types. */ -#define __S_IFDIR 0040000 /* Directory. */ -#define __S_IFCHR 0020000 /* Character device. */ -#define __S_IFBLK 0060000 /* Block device. */ -#define __S_IFREG 0100000 /* Regular file. */ -#define __S_IFIFO 0010000 /* FIFO. */ - -/* These don't actually exist on System V, but having them doesn't hurt. */ -#define __S_IFLNK 0120000 /* Symbolic link. */ -#define __S_IFSOCK 0140000 /* Socket. */ - -/* Protection bits. */ - -#define __S_ISUID 04000 /* Set user ID on execution. */ -#define __S_ISGID 02000 /* Set group ID on execution. */ -#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ -#define __S_IREAD 0400 /* Read by owner. */ -#define __S_IWRITE 0200 /* Write by owner. */ -#define __S_IEXEC 0100 /* Execute by owner. */ - -#endif /* statbuf.h */ diff --git a/sysdeps/unix/sysv/sysv4/utsnamelen.h b/sysdeps/unix/sysv/sysv4/utsnamelen.h deleted file mode 100644 index 9dcc618..0000000 --- a/sysdeps/unix/sysv/sysv4/utsnamelen.h +++ /dev/null @@ -1 +0,0 @@ -#define _UTSNAME_LENGTH 257 diff --git a/sysdeps/unix/sysv/sysv4/waitflags.h b/sysdeps/unix/sysv/sysv4/waitflags.h deleted file mode 100644 index f5613c1..0000000 --- a/sysdeps/unix/sysv/sysv4/waitflags.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Definitions of flag bits for `waitpid' et al. - Copyright (C) 1993, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _WAITFLAGS_H - -#define _WAITFLAGS_H 1 - -/* Bits in the third argument to `waitpid'. */ -#define WNOHANG 64 /* Don't block waiting. */ -#define WUNTRACED 4 /* Report status of stopped children. */ - -#ifdef __USE_SVID -#define WEXITED 1 /* Look for children that have exited. */ -#define WTRAPPED 2 /* Look for processes that stopped - while tracing. */ -#endif - -#endif /* waitflags.h */ diff --git a/sysdeps/unix/sysv/utmpbits.h b/sysdeps/unix/sysv/utmpbits.h deleted file mode 100644 index 3d2ccf3..0000000 --- a/sysdeps/unix/sysv/utmpbits.h +++ /dev/null @@ -1,58 +0,0 @@ -/* The `struct utmp' type, describing entries in the utmp file. System V. -Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#ifndef _UTMPBITS_H - -#define _UTMPBITS_H 1 - -#include - -#define _PATH_UTMP "/var/adm/utmp" -#define _PATH_WTMP "/var/adm/wtmp" -#define _PATH_LASTLOG "/var/adm/lastlog" - -__BEGIN_DECLS - -struct utmp - { -#define ut_name ut_user - char ut_user[8]; - char ut_id[4]; - char ut_line[12]; - short ut_pid; - short ut_type; - struct exit_status - { - short e_termination; - short e_exit; - } ut_exit; - time_t ut_time; - }; - - -/* Tell the user that we have a modern system with UT_HOST, UT_TYPE, UT_ID - and UT_TV fields. */ -#define _HAVE_UT_TYPE 1 -#define _HAVE_UT_ID 1 -#define _HAVE_UT_TV 1 -#define _HAVE_UT_HOST 1 - -__END_DECLS - -#endif /* utmpbits.h */ diff --git a/sysdeps/unix/sysv/utsnamelen.h b/sysdeps/unix/sysv/utsnamelen.h deleted file mode 100644 index 31473cf..0000000 --- a/sysdeps/unix/sysv/utsnamelen.h +++ /dev/null @@ -1 +0,0 @@ -#define _UTSNAME_LENGTH 9 diff --git a/sysdeps/vax/bits/huge_val.h b/sysdeps/vax/bits/huge_val.h new file mode 100644 index 0000000..f323049 --- /dev/null +++ b/sysdeps/vax/bits/huge_val.h @@ -0,0 +1,26 @@ +/* `HUGE_VAL' constant for Vaxen. + Used by and functions for overflow. + Copyright (C) 1992, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _MATH_H +#error "Never use directly; include instead." +#endif + + +#define HUGE_VAL 1.70141182460469227e38 diff --git a/sysdeps/vax/bits/setjmp.h b/sysdeps/vax/bits/setjmp.h new file mode 100644 index 0000000..7adecd9 --- /dev/null +++ b/sysdeps/vax/bits/setjmp.h @@ -0,0 +1,7 @@ +/* Define the machine-dependent type `jmp_buf'. Vax version. */ + +typedef struct + { + PTR __fp; + PTR __pc; + } __jmp_buf[1]; diff --git a/sysdeps/vax/huge_val.h b/sysdeps/vax/huge_val.h deleted file mode 100644 index 02cafb0..0000000 --- a/sysdeps/vax/huge_val.h +++ /dev/null @@ -1,26 +0,0 @@ -/* `HUGE_VAL' constant for Vaxen. - Used by and functions for overflow. - Copyright (C) 1992, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _HUGE_VAL_H -#define _HUGE_VAL_H 1 - -#define HUGE_VAL 1.70141182460469227e38 - -#endif /* huge_val.h */ diff --git a/sysdeps/vax/jmp_buf.h b/sysdeps/vax/jmp_buf.h deleted file mode 100644 index 7adecd9..0000000 --- a/sysdeps/vax/jmp_buf.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Define the machine-dependent type `jmp_buf'. Vax version. */ - -typedef struct - { - PTR __fp; - PTR __pc; - } __jmp_buf[1]; diff --git a/sysdeps/wordsize-32/bits/elfclass.h b/sysdeps/wordsize-32/bits/elfclass.h new file mode 100644 index 0000000..49411d6 --- /dev/null +++ b/sysdeps/wordsize-32/bits/elfclass.h @@ -0,0 +1,5 @@ +/* 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. */ + +#define __ELF_NATIVE_CLASS 32 diff --git a/sysdeps/wordsize-32/elfclass.h b/sysdeps/wordsize-32/elfclass.h deleted file mode 100644 index 49411d6..0000000 --- a/sysdeps/wordsize-32/elfclass.h +++ /dev/null @@ -1,5 +0,0 @@ -/* 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. */ - -#define __ELF_NATIVE_CLASS 32 diff --git a/sysdeps/wordsize-32/inttypes.h b/sysdeps/wordsize-32/inttypes.h index f3029cc..a2648bf 100644 --- a/sysdeps/wordsize-32/inttypes.h +++ b/sysdeps/wordsize-32/inttypes.h @@ -28,10 +28,15 @@ /* Exact integral types. */ /* Signed. */ + +/* There is some amount of overlap with as known by inet code */ +#ifndef __int8_t_defined +#define __int8_t_defined typedef signed char int8_t; typedef short int int16_t; typedef int int32_t; typedef long long int int64_t; +#endif /* Unsigned. */ typedef unsigned char uint8_t; diff --git a/sysdeps/wordsize-64/bits/elfclass.h b/sysdeps/wordsize-64/bits/elfclass.h new file mode 100644 index 0000000..ac52904 --- /dev/null +++ b/sysdeps/wordsize-64/bits/elfclass.h @@ -0,0 +1,5 @@ +/* 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. */ + +#define __ELF_NATIVE_CLASS 64 diff --git a/sysdeps/wordsize-64/elfclass.h b/sysdeps/wordsize-64/elfclass.h deleted file mode 100644 index ac52904..0000000 --- a/sysdeps/wordsize-64/elfclass.h +++ /dev/null @@ -1,5 +0,0 @@ -/* 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. */ - -#define __ELF_NATIVE_CLASS 64 diff --git a/sysdeps/wordsize-64/inttypes.h b/sysdeps/wordsize-64/inttypes.h index b94aff0..07680d0 100644 --- a/sysdeps/wordsize-64/inttypes.h +++ b/sysdeps/wordsize-64/inttypes.h @@ -28,10 +28,15 @@ /* Exact integral types. */ /* Signed. */ + +/* There is some amount of overlap with as known by inet code */ +#ifndef __int8_t_defined +#define __int8_t_defined typedef signed char int8_t; typedef short int int16_t; typedef int int32_t; typedef long int int64_t; +#endif /* Unsigned. */ typedef unsigned char uint8_t; -- cgit v1.1