Commit Graph

502 Commits

Author SHA1 Message Date
Jeff Johnston baa9e037cc 2008-10-15 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/include/sys/unistd.h: Enable ttyname_r() for RTEMS.
2008-10-15 21:37:54 +00:00
Jeff Johnston 6b35caa257 Fix typo and make C99 check the same as is used in math.h 2008-10-15 20:49:56 +00:00
Jeff Johnston bc5585e6e5 2008-10-15 Craig Howland <howland@LGSInnovations.com>
* libc/include/ctype.h (isblank):  isblank is C99.
	* libc/ctype/isblank.c (isblank comments):  ditto.  isblank does not
	have a macro version (as was claimed in the description).
2008-10-15 20:36:26 +00:00
Jeff Johnston 9d36d24f6e 2008-10-02 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/reent.h[_REENT_SMALL](_REENT_INIT_RAND48): Add
        initialization of _rand_next to 1.
2008-10-02 16:43:23 +00:00
Jeff Johnston 610eefefdd 2008-09-25 Raphael Derossa Pereira <raphaelpereira@gmail.com>
* libc/include/pthread.h[_UNIX98_THREAD_MUTEX_ATTRIBUTES]: Add
        new pthread_mutexattr_gettype and pthread_mutexattr_settype
        prototypes.
        * libc/include/sys/types.h[_UNIX98_THREAD_MUTEX_ATTRIBUTES]: Add
        new mutex type values.
        (pthread_mutexattr_t)[_UNIX98_THREAD_MUTEX_ATTRIBUTES]: Add type
        field.
2008-09-26 16:15:50 +00:00
Jeff Johnston 37f996a2b2 2008-09-24 Pawel Veselov <pawel.veselov@gmail.com>
Fix setenv/getenv/unsetenv to be OpenGroup compliant:
        * libc/include/stdlib.h (unsetenv, _unsetenv_r): Redefine with integer
        return types.
        * libc/stdlib/getenv_r.c (_findenv_r): Do no special processing with
        names that contain equal chars.
        * libc/stdlib/setenv.c: Redefine _unsetenv_r as returning int.
        * libc/stdlib/setenv_r.c (_setenv_r): Return -1 and set errno to
        EINVAL if name contains an equal sign.  Do not remove any equal signs
        from the value.
        (_unsetenv_r): Modified to return int.  Return -1 and set EINVAL
        if name contains equal sign.  Return -1 if no variable(s) were found
        and return 0 otherwise.
2008-09-25 01:23:08 +00:00
Jeff Johnston 29212ab3cd 2008-09-19 Eric Blake <ebb9@byu.net>
Supply missing POSIX errno values.
        * libc/include/sys/errno.h (ENOTRECOVERABLE, EOWNERDEAD): Define.
        * libc/string/strerror.c (strerror): Decode them, and ECANCELED.
2008-09-19 16:11:35 +00:00
Jeff Johnston 410c1d122d 2008-07-24 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/ctype.h (_ctype_): Restore for C++ backward
        compatability only.
2008-07-24 17:55:26 +00:00
Jeff Johnston fa914bf8ab 2008-07-21 Jeff Johnston <jjohnstn@redhat.com>
* libc/ctype/ctype_.c: Add new pointer __ctype_ptr__ which is one
        less than the old __ctype_ptr.
        * libc/ctype/isalnum.c: Use __ctype_ptr__.
        * libc/ctype/isalpha.c: Ditto.
        * libc/ctype/iscntrl.c: Ditto.
        * libc/ctype/isdigit.c: Ditto.
        * libc/ctype/islower.c: Ditto.
        * libc/ctype/isprint.c: Ditto.
        * libc/ctype/ispunct.c: Ditto.
        * libc/ctype/isspace.c: Ditto.
        * libc/ctype/isupper.c: Ditto.
        * libc/ctype/isxdigit.c: Ditto.
        * libc/include/ctype.h: Change ctype macros to use new __ctype_ptr__
        and add declaration of __ctype_ptr__.  Remove older ctype table pointers
        from here even though they can still work.
2008-07-21 21:28:34 +00:00
Jeff Johnston d2af9effc5 2008-07-17 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/assert.h (__ASSERT_FUNC): Define to __FUNCTION__ when
        __STDC_VERSION__ < 199901L and __GNUC__ >= 2.
2008-07-17 20:56:51 +00:00
Corinna Vinschen eb3f08acf8 * libc/include/machine/setjmp.h (_longjmp): Define as function on
Cygwin.
	(_setjmp): Ditto.
2008-06-21 18:48:45 +00:00
Eric Blake 8fa475e4b1 Per Posix, strsignal returns non-const char*.
* libc/include/string.h (strsignal): Fix return type.
2008-06-18 15:27:41 +00:00
Jeff Johnston 2b4c1b417f 2008-06-11 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/machine/_default_types.h: Fix GNUC check to
        handle 4.0 and greater.
2008-06-11 22:14:54 +00:00
Corinna Vinschen 1fc3031588 * libc/include/sys/_default_fcntl.h: Include <sys/time.h> on Cygwin. 2008-05-23 12:33:50 +00:00
Jeff Johnston 3c77dcff9e 2008-05-22 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/reent.h: Add _h_errno field.
	* libc/sys/linux/libc-symbols.h: Add default stubs for new libc macros
	now used in net directory.
	* libc/sys/linux/bits/libc-lock.h: Always define _IO_MTSAFE_IO.
	* libc/sys/linux/include/hesiod.h: Add needed macros for new code
	in net directory.
	* libc/sys/linux/include/netdb.h: Ditto.
	* libc/sys/linux/include/resolv.h: Ditto.
	* libc/sys/linux/include/stdint.h: Ditto.
	* libc/sys/linux/include/arpa/nameser.h: Ditto.
	* libc/sys/linux/include/net/ethernet.h: Ditto.
	* libc/sys/linux/include/net/if_ppp.h: Ditto.
	* libc/sys/linux/include/netinet/if_ether.h: Ditto.
	* libc/sys/linux/machine/i386/get_clockfreq.c: Remove static memmem.
	* libc/sys/linux/machine/i386/include/endian.h: Protect macros with
	flags to avoid duplicate definition.
	* libc/sys/linux/machine/i386/include/param.h: Ditto.
	* libc/sys/linux/net/Makefile.am: Modified to account for removed and
	added files.
	* libc/sys/linux/net/Makefile.in: Regenerated.
	* libc/sys/linux/net/base64.c: Replaced with glibc version of code.
	* libc/sys/linux/net/getaddrinfo.c: Ditto.
	* libc/sys/linux/net/getnameinfo.c: Ditto.
	* libc/sys/linux/net/getproto.c: Ditto.
	* libc/sys/linux/net/getservent.c: Ditto.
	* libc/sys/linux/net/inet_netof.c: Ditto.
	* libc/sys/linux/net/inet_lnaof.c: Ditto.
	* libc/sys/linux/net/ns_name.c: Ditto.
	* libc/sys/linux/net/ns_netint.c: Ditto.
	* libc/sys/linux/net/inet_ntoa.c: Ditto.
	* libc/sys/linux/net/ns_parse.c: Ditto.
	* libc/sys/linux/net/ns_print.c: Ditto.
	* libc/sys/linux/net/ns_ttl.c: Ditto.
	* libc/sys/linux/net/nsap_addr.c: Ditto.
	* libc/sys/linux/net/rcmd.c: Ditto.
	* libc/sys/linux/net/res_comp.c: Ditto.
	* libc/sys/linux/net/res_data.c: Ditto.
	* libc/sys/linux/net/res_debug.c: Ditto.
	* libc/sys/linux/net/res_init.c: Ditto.
	* libc/sys/linux/net/res_mkquery.c: Ditto.
	* libc/sys/linux/net/res_query.c: Ditto.
	* libc/sys/linux/net/res_send.c: Ditto.
	* libc/sys/linux/net/send.c: Ditto.
	* libc/sys/linux/stdlib/collate.c: Ditto.
	* libc/sys/linux/sys/ioctl.h: Ditto.
	* libc/sys/linux/sys/socket.h: Ditto.
	* libc/sys/linux/sys/unistd.h: Ditto.
	* libc/sys/linux/iconv/iconvconfig.c: Removed either because no longer
	used or because licensing includes advertising clause that cannot be
	ignored.
	* libc/sys/linux/iconv/strtab.c: Ditto.
	* libc/sys/linux/include/libc_private.h: Ditto.
	* libc/sys/linux/include/nsswitch.h: Ditto.
	* libc/sys/linux/include/net/if_atm.h: Ditto.
	* libc/sys/linux/include/net/if_media.h: Ditto.
	* libc/sys/linux/include/net/if_pppvar.h: Ditto.
	* libc/sys/linux/include/netinet/if_atm.h: Ditto.
	* libc/sys/linux/include/netinet/ip_flow.h: Ditto.
	* libc/sys/linux/intl/locale.alias: Ditto.
	* libc/sys/linux/net/addr2ascii.3: Ditto.
	* libc/sys/linux/net/bindresvport.c: Ditto.
	* libc/sys/linux/net/byteorder.3: Ditto.
	* libc/sys/linux/net/res_config.h: Ditto.
	* libc/sys/linux/net/ether_addr.c: Ditto.
	* libc/sys/linux/net/ethers.3: Ditto.
	* libc/sys/linux/net/getaddrinfo.3: Ditto.
	* libc/sys/linux/net/gethostbydns.c: Ditto.
	* libc/sys/linux/net/gethostbyht.c: Ditto.
	* libc/sys/linux/net/gethostbyname.3: Ditto.
	* libc/sys/linux/net/gethostbynis.c: Ditto.
	* libc/sys/linux/net/gethostnamadr.c: Ditto.
	* libc/sys/linux/net/getifaddrs.3: Ditto.
	* libc/sys/linux/net/getifaddrs.c: Ditto.
	* libc/sys/linux/net/getipnodebyname.3: Ditto.
	* libc/sys/linux/net/getnameinfo.3: Ditto.
	* libc/sys/linux/net/getnetbydns.c: Ditto.
	* libc/sys/linux/net/getnetbyht.c: Ditto.
	* libc/sys/linux/net/getnetbynis.c: Ditto.
	* libc/sys/linux/net/getnetent.3: Ditto.
	* libc/sys/linux/net/getnetnamadr.c: Ditto.
	* libc/sys/linux/net/getprotoent.3: Ditto.
	* libc/sys/linux/net/getprotoent.c: Ditto.
	* libc/sys/linux/net/getprotoname.c: Ditto.
	* libc/sys/linux/net/getservbyname.c: Ditto.
	* libc/sys/linux/net/getservbyport.c: Ditto.
	* libc/sys/linux/net/getservent.3: Ditto.
	* libc/sys/linux/net/herror.c: Ditto.
	* libc/sys/linux/net/hesiod.3: Ditto.
	* libc/sys/linux/net/hesiod.c: Ditto.
	* libc/sys/linux/net/if_indextoname.3: Ditto.
	* libc/sys/linux/net/inet.3: Ditto.
	* libc/sys/linux/net/inet6_option_space.3: Ditto.
	* libc/sys/linux/net/inet6_rthdr_space.3: Ditto.
	* libc/sys/linux/net/inet_makeaddr.c: Ditto.
	* libc/sys/linux/net/inet_net.3: Ditto.
	* libc/sys/linux/net/inet_network.c: Ditto.
	* libc/sys/linux/net/innetgr-stub.c: Ditto.
	* libc/sys/linux/net/ip6opt.c: Ditto.
	* libc/sys/linux/net/iso_addr.3: Ditto.
	* libc/sys/linux/net/iso_addr.c: Ditto.
	* libc/sys/linux/net/linkaddr.3: Ditto.
	* libc/sys/linux/net/linkaddr.c: Ditto.
	* libc/sys/linux/net/map_v4v6.c: Ditto.
	* libc/sys/linux/net/name6.c: Ditto.
	* libc/sys/linux/net/namespace.h: Ditto.
	* libc/sys/linux/net/ns.3: Ditto.
	* libc/sys/linux/net/ns_addr.c: Ditto.
	* libc/sys/linux/net/ns_ntoa.c: Ditto.
	* libc/sys/linux/net/nsdispatch.3: Ditto.
	* libc/sys/linux/net/nsdispatch.c: Ditto.
	* libc/sys/linux/net/nslexer.c: Ditto.
	* libc/sys/linux/net/nslexer.l: Ditto.
	* libc/sys/linux/net/nsparser.c: Ditto.
	* libc/sys/linux/net/nsparser.h: Ditto.
	* libc/sys/linux/net/nsparser.y: Ditto.
	* libc/sys/linux/net/rcmd.3: Ditto.
	* libc/sys/linux/net/rcmdsh.3: Ditto.
	* libc/sys/linux/net/res_mkupdate.c: Ditto.
	* libc/sys/linux/net/res_update.c: Ditto.
	* libc/sys/linux/net/resolver.3: Ditto.
	* libc/sys/linux/net/rthdr.c: Ditto.
	* libc/sys/linux/net/vars.c: Ditto.
	* libc/sys/linux/shlib-compat.h: New file.
	* libc/sys/linux/machine/i386/atomic.h: Ditto.
	* libc/sys/linux/net/XXX-lookup.c: Ditto.
	* libc/sys/linux/net/alias-lookup.c: Ditto.
	* libc/sys/linux/net/res_libc.c: Ditto.
	* libc/sys/linux/net/aliases.h: Ditto.
	* libc/sys/linux/net/check_pf.c: Ditto.
	* libc/sys/linux/net/databases.def: Ditto.
	* libc/sys/linux/net/digits_dots.c: Ditto.
	* libc/sys/linux/net/ether_aton.c: Ditto.
	* libc/sys/linux/net/ether_aton_r.c: Ditto.
	* libc/sys/linux/net/ether_hton.c: Ditto.
	* libc/sys/linux/net/ether_line.c: Ditto.
	* libc/sys/linux/net/ether_ntoa.c: Ditto.
	* libc/sys/linux/net/ether_ntoa_r.c: Ditto.
	* libc/sys/linux/net/ether_ntoh.c: Ditto.
	* libc/sys/linux/net/etherent.h: Ditto.
	* libc/sys/linux/net/ethers-lookup.c: Ditto.
	* libc/sys/linux/net/function.def: Ditto.
	* libc/sys/linux/net/getXXbyYY.c: Ditto.
	* libc/sys/linux/net/getXXbyYY_r.c: Ditto.
	* libc/sys/linux/net/getXXent.c: Ditto.
	* libc/sys/linux/net/getXXent_r.c: Ditto.
	* libc/sys/linux/net/getaliasent.c: Ditto.
	* libc/sys/linux/net/getaliasent_r.c: Ditto.
	* libc/sys/linux/net/getaliasname.c: Ditto.
	* libc/sys/linux/net/getaliasname_r.c: Ditto.
	* libc/sys/linux/net/gethstbyad.c: Ditto.
	* libc/sys/linux/net/gethstbyad_r.c: Ditto.
	* libc/sys/linux/net/gethstbynm.c: Ditto.
	* libc/sys/linux/net/gethstbynm2.c: Ditto.
	* libc/sys/linux/net/gethstbynm2_r.c: Ditto.
	* libc/sys/linux/net/gethstbynm_r.c: Ditto.
	* libc/sys/linux/net/gethstent.c: Ditto.
	* libc/sys/linux/net/gethstent_r.c: Ditto.
	* libc/sys/linux/net/getnetbyad.c: Ditto.
	* libc/sys/linux/net/getnetbyad_r.c: Ditto.
	* libc/sys/linux/net/getnetbynm.c: Ditto.
	* libc/sys/linux/net/getnetbynm_r.c: Ditto.
	* libc/sys/linux/net/getnetent.c: Ditto.
	* libc/sys/linux/net/getnetent_r.c: Ditto.
	* libc/sys/linux/net/getnetgrent.c: Ditto.
	* libc/sys/linux/net/getnetgrent_r.c: Ditto.
	* libc/sys/linux/net/getnssent.c: Ditto.
	* libc/sys/linux/net/getnssent_r.c: Ditto.
	* libc/sys/linux/net/getproto_r.c: Ditto.
	* libc/sys/linux/net/getprtent.c: Ditto.
	* libc/sys/linux/net/getprtent_r.c: Ditto.
	* libc/sys/linux/net/getprtname.c: Ditto.
	* libc/sys/linux/net/getprtname_r.c: Ditto.
	* libc/sys/linux/net/getrpcbyname.c: Ditto.
	* libc/sys/linux/net/getrpcbyname_r.c: Ditto.
	* libc/sys/linux/net/getrpcbynumber.c: Ditto.
	* libc/sys/linux/net/getrpcbynumber_r.c: Ditto.
	* libc/sys/linux/net/getrpcent.c: Ditto.
	* libc/sys/linux/net/getrpcent_r.c: Ditto.
	* libc/sys/linux/net/getservent_r.c: Ditto.
	* libc/sys/linux/net/getsrvbynm.c: Ditto.
	* libc/sys/linux/net/getsrvbynm_r.c: Ditto.
	* libc/sys/linux/net/getsrvbypt.c: Ditto.
	* libc/sys/linux/net/getsrvbypt_r.c: Ditto.
	* libc/sys/linux/net/grp-lookup.c: Ditto.
	* libc/sys/linux/net/herrno.c: Ditto.
	* libc/sys/linux/net/hosts-lookup.c: Ditto.
	* libc/sys/linux/net/ifaddrs.h: Ditto.
	* libc/sys/linux/net/ifreq.c: Ditto.
	* libc/sys/linux/net/ifreq.h: Ditto.
	* libc/sys/linux/net/in6_addr.c: Ditto.
	* libc/sys/linux/net/inet6_option.c: Ditto.
	* libc/sys/linux/net/inet_mkadr.c: Ditto.
	* libc/sys/linux/net/inet_net.c: Ditto.
	* libc/sys/linux/net/key-lookup.c: Ditto.
	* libc/sys/linux/net/local.h: Ditto.
	* libc/sys/linux/net/netgroup.h: Ditto.
	* libc/sys/linux/net/netgrp-lookup.c: Ditto.
	* libc/sys/linux/net/network-lookup.c: Ditto.
	* libc/sys/linux/net/not-cancel.h: Ditto.
	* libc/sys/linux/net/ns_samedomain.c: Ditto.
	* libc/sys/linux/net/nscd-types.h: Ditto.
	* libc/sys/linux/net/nss.h: Ditto.
	* libc/sys/linux/net/nsswitch.c: Ditto.
	* libc/sys/linux/net/nsswitch.h: Ditto.
	* libc/sys/linux/net/opensock.c: Ditto.
	* libc/sys/linux/net/proto-lookup.c: Ditto.
	* libc/sys/linux/net/pwd-lookup.c: Ditto.
	* libc/sys/linux/net/res_debug.h: Ditto.
	* libc/sys/linux/net/res_hconf.c: Ditto.
	* libc/sys/linux/net/res_hconf.h: Ditto.
	* libc/sys/linux/net/rexec.c: Ditto.
	* libc/sys/linux/net/rpc-lookup.c: Ditto.
	* libc/sys/linux/net/ruserpass.c: Ditto.
	* libc/sys/linux/net/service-lookup.c: Ditto.
	* libc/sys/linux/net/spwd-lookup.c: Ditto.
	* libc/sys/linux/net/nscd/nscd-client.h: Ditto.
	* libc/sys/linux/net/nscd/nscd_proto.h: Ditto.
2008-05-22 21:30:28 +00:00
Jeff Johnston 26432b0bb5 2008-05-14 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/reent.h: Change _REENT_INIT... macros to
        access macro parameter with parentheses around it.
2008-05-14 22:09:10 +00:00
Mark Mitchell df93e6f193 * libc/include/stdint.h (SIZE_MIN): Remove.
(SIZE_MAX): Define.
	* testsuite/newlib.stdlib/stdlib.exp: New.
	* testsuite/newlib.stdlib/size_max.c: Likewise.
2008-05-02 14:52:56 +00:00
Corinna Vinschen 78970a51f3 * libc/include/sys/stat.h: Guard at-functions with !__INSIDE_CYGWIN__.
(fstatat): Fix type of third parameter.
2008-04-26 07:49:39 +00:00
Nick Clifton 51bef6a9c6 * libc/include/machine/ieeefp.h: Fix typo: _DOUBLE_IS_32_BITS
should be _DOUBLE_IS_32BITS.
2008-04-24 11:26:41 +00:00
Corinna Vinschen 0d02384a48 * libc/include/sys/stat.h (UTIME_NOW): Define for Cygwin.
(UTIME_OMIT): Ditto.
	(utimensat): Declare for Cygwin.
	(futimens): Ditto.
2008-04-24 09:39:21 +00:00
Jeff Johnston e2af45bfd1 2008-04-23 Ken Werner <ken.werner@de.ibm.com>
* libc/include/_ansi.h: _LONG_LONG renamed to _LONG_LONG_TYPE.
        * libc/include/math.h: Likewise.
2008-04-23 23:10:54 +00:00
Corinna Vinschen ca48eb65e9 * libc/include/stdio.h (renameat): Declare for Cygwin.
(symlinkat): Ditto.
	* libc/include/sys/unistd.h (readlink): Align declaration to POSIX.
	(faccessat): Declare for Cygwin.
	(fchownat): Ditto.
	(linkat): Ditto.
	(readlinkat): Ditto.
	* libc/include/sys/_default_fcntl.h (AT_FDCWD): Define for Cygwin.
	(AT_EACCESS): Ditto.
	(AT_SYMLINK_NOFOLLOW): Ditto.
	(AT_SYMLINK_FOLLOW): Ditto.
	(AT_REMOVEDIR): Ditto.
	(futimesat): Declare for Cygwin.
	(openat): Ditto.
	(unlinkat): Ditto.
	* libc/include/sys/stat.h (fchmodat): Ditto.
	(fstatat): Ditto.
	(mkdirat): Ditto.
	(mkfifoat): Ditto.
	(mknodat): Ditto.
2008-04-23 11:13:24 +00:00
Jeff Johnston 3ab380aaa8 2008-03-27 Patrick Mansfield <patmans@us.ibm.com>
* libc/include/reent.h: Define _func_r functions in this file to
        func if REENTRANT_SYSCALLS_PROVIDED and MISSING_SYSCALL_NAMES are
        defined.
2008-03-27 23:28:17 +00:00
Corinna Vinschen 4af0c5e8f3 * libc/include/sys/unistd.h: Declare lockf(2) and define lockf
constants when building for Cygwin.
2008-03-27 09:55:05 +00:00
Jeff Johnston c622842865 2008-03-07 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/getopt.h: Hide newlib extensions under
        the __need_getopt_newlib flag.
        * libc/stdlib/getopt.c: #define __need_getopt_newlib before including
        getopt.h.  Put entire code under !HAVE_GETOPT to support platforms
        with their own getopt implementation.
        * configure.host: Specify HAVE_GETOPT for x86-linux.
2008-03-07 18:16:35 +00:00
Jeff Johnston 0382d26727 2008-03-07 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/reent.h(_REENT_SMALL_CHECK_INIT): Specify
        this macro completely instead of referring to CHECK_STD_INIT which
        is only found in libc/stdio/local.h.
        * libc/stdio/dprintf.c: Add include of local.h.
        * libc/stdio/vdprintf.c: Ditto.
        * libc/stdio/vdiprintf.c: Ditto.
2008-03-07 16:45:04 +00:00
Jeff Johnston be62101c60 2008-03-02 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/getopt.h (no_argument): Added for glibc compatibility.
        (required_argument, optional_argument): Ditto.
2008-03-03 19:47:59 +00:00
Jeff Johnston 76ff710cfa 2008-02-29 Gregory Pietsch <gpietsch@comcast.net>
* libc/stdlib/getopt.c (getopt_internal): Rewrite to accept
        data area so as to support reentrant calls.  Change all callers
        to fill in data area with global values and restore any changes
        to the global values after call.
        (__getopt_r, __getopt_long_r, __getopt_long_only_r): New routines
        to support reentrancy that add a data area argument.
        * libc/include/getopt.h: Add new _r routines and provide macros
        so they can be called with using double-underscores.
2008-02-29 21:11:57 +00:00
Corinna Vinschen 12df8a5b53 * libc/include/machine/setjmp.h (__SIGMASK_FUNC): Define as
pthread_sigmask or sigprocmask depending on _POSIX_THREADS.
	(sigsetjmp): Use __SIGMASK_FUNC.
	(siglongjmp): Ditto.
	(_setjmp): Define as macro.
	(_longjmp): Ditto.
2008-01-15 09:41:06 +00:00
Eric Blake 40617efc8b Make strstr and strcasestr O(n), not O(n^2); add memmem.
* libc/string/str-two-way.h: New file.
* libc/string/memmem.c (memmem): New file.
* libc/include/string.h (memmem): Declare for all platforms.
* libc/string/strstr.c (strstr): Provide O(n) implementation when
not optimizing for space.
* libc/string/strcasestr.c (strcasestr): Likewise.
* libc/string/Makefile.am (ELIX_SOURCES): Rename to...
(ELIX_2_SOURCES): ...this.
(ELIX_4_SOURCES): New category, for memmem.
(lib_a_SOURCES, libstring_la_SOURCES): Build new file.
(CHEWOUT_FILES): Build documentation for memmem.
* libc/string/strings.tex: Include new docs.
2008-01-12 04:25:55 +00:00
Jeff Johnston a639937a9a 2008-01-03 Jeff Johnston <jjohnstn@redhat.com>
Make isatty syscall handling consistent with other newlib syscalls.

        * libc/include/_syslist.h: Add _isatty.
        * libc/include/reent.h: Add _isatty_r.
        * libc/include/sys/unistd.h: Add _isatty.
        * libc/posix/Makefile.am: Add new _isatty.c file.
        * libc/posix/Makefile.in: Regenerated.
        * libc/posix/_isatty.c: New file.
        * libc/posix/isatty.c: Changed to call _isatty().
        * libc/reent/Makefile.am: Add new isattyr.c file.
        * libc/reent/Makefile.in: Regenerated.
        * libc/reent/isattyr.c: New file.
        * libc/stdio/freopen.c: Changed to call _isatty_r().
        * libc/stdio/makebuf.c: Ditto.
        * libc/sys/a29khif/_isatty.S: Change isatty to _isatty.
        * libc/sys/arc/isatty.c: Ditto.
        * libc/sys/arm/syscalls.c: Ditto.
        * libc/sys/d10v/syscalls.c: Ditto.
        * libc/sys/h8300hms/syscalls.c: Ditto.
        * libc/sys/h8500hms/syscalls.c: Ditto.
        * libc/sys/linux/Makefile.am: Add new isatty.c file.
        * libc/sys/linux/Makefile.in: Regenerated.
        * libc/sys/linux/isatty.c: New file.
        * libc/syscalls/Makefile.am: Add new sysisatty.c file.
        * libc/syscalls/Makefile.in: Regenerated.
        * libc/syscalls/sysisatty.c: New file.
2008-01-03 22:33:37 +00:00
Jeff Johnston 3cc8a378d1 2007-12-19 Dave Korn <dave.korn@artimi.com>
Jeff Johnston  <jjohnstn@redhhat.com>

        * libc/include/_ansi.h: Add _LONG_LONG definition.
        * libc/include/math.h (llrint, llrintf, rintl, lrintl, llrintl): Add
        prototypes.
        * libc/machine/i386/machine/fastmath.h: Add support for new i386
        fast math versions of rint, lrint, and llrint family functions.
        * libm/machine/i386/Makefile.am: Add new files.
        * libm/machine/i386/Makefile.in: Regenerated.
        * libm/machine/i386/f_llrint.c, libm/machine/i386/f_lrint.c,
        libm/machine/i386/f_rint.c, libm/machine/i386/f_llrintf.c,
        libm/machine/i386/f_lrintf.c, libm/machine/i386/f_rintf.c,
        libm/machine/i386/f_llrintl.c, libm/machine/i386/f_lrintl.c,
        libm/machine/i386/f_rintl.c:  New files with fast math implementations.
2007-12-19 22:20:25 +00:00
Jeff Johnston 41e94f2488 2007-12-19 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/features.h: Add checks for C90 compilers using
        -ansi.
2007-12-19 18:51:19 +00:00
Jeff Johnston 7f9b49e427 2007-11-15 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/_default_fcntl.h: New header file that
        is the default version of sys/fcntl.h.
        * libc/include/sys/fcntl.h: Changed to simply include
        sys/_default_fcntl.h.
        * libc/sys/arm/sys/fcntl.h: New file that includes
        sys/_default_fcntl.h and defines O_BINARY.
2007-12-19 18:49:17 +00:00
Corinna Vinschen ac26b72723 * libc/include/wchar.h: Add prototypes for wcpcpy and wcpncpy.
* libc/string/Makefile.am (ELIX_SOURCES): Add wcpcpy.c and
	wcpncpy.c.
	(CHEWOUT_FILES): Add wcpcpy.def and wcpncpy.def.
	* libc/string/Makefile.in: Regenerate.
	* libc/string/wcpcpy.c: New file.
	* libc/string/wcpncpy.c: New file.
	* libc/string/wcstrings.tex: Add wcpcpy and wcpncpy.
2007-12-19 17:33:12 +00:00
Corinna Vinschen 815774e87f * libc/include/sys/unistd.h: Remove Cygwin definition of MAXPATHLEN. 2007-11-08 16:20:12 +00:00
Dave Brolley 7b4cad4ae6 2007-11-07 Dave Brolley <brolley@redhat.com>
* libc/machine/configure: Regenerated to pick up mep-elf changes.

        * Contribute mep-elf from Red Hat
        2006-10-27  DJ Delorie  <dj@redhat.com>

        * libc/include/machine/setjmp.h: Add MeP support.

        2003-04-17  DJ Delorie  <dj@redhat.com>

        * configure.host (mep-*-*): Support "long long" type.

        2001-06-06  DJ Delorie  <dj@redhat.com>

        * libc/include/machine/ieeefp.h (mep): Support little endian too.

        2001-05-14  DJ Delorie  <dj@redhat.com>

        * configure.host: Add mep's machine_dir.
        * libc/include/setjmp.h: Add mep support.
        * libc/machine/mep: New.
        * libc/machine/mep/setjmp.S: New, support mep's setjmp/longjmp.

        2001-05-04  DJ Delorie  <dj@redhat.com>

        * configure.host: Add mep.
        * libc/include/machine/ieeefp.h: Ditto.
2007-11-07 21:42:24 +00:00
Jeff Johnston 2f3d28fca2 2007-09-21 Patrick Mansfield <patmans@us.ibm.com>
* libc/include/sched.h: New file, just include sys/sched.h.
        * libc/machine/spu/sys/sched.h: New file, has just sched_yield
        prototype.
        * libc/machine/spu/sys/utime.h: New file, has utime prototype and
        struct utimbuf definition.
2007-09-21 21:02:15 +00:00
Jeff Johnston cebf33e402 2007-09-18 Patrick Mansfield <patmans@us.ibm.com>
* libc/include/sys/types.h: Use __dev_t, __uid_t, and __gid_t to
        typedef dev_t, gid_t, and uid_t.
        * libc/include/sys/_types.h: Move previous dev_t, uid_t and gid_t
        types.h code to here, but typedef __dev_t, __uid_t, and __gid_t instead.
        Change to lower case for all __foo_t_defined names.
        * libc/machine/spu/machine/_types.h: Add SPU specific __dev_t,
        __uid_t, and __gid_t making them all four bytes. Change to lower case
        for all __foo_t_defined names.
2007-09-18 20:05:17 +00:00
Jeff Johnston e5ae72300f 2007-09-07 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/_types.h: Protect all types with flag
        checks to allow definition in machine/_types.h.
2007-09-07 21:24:55 +00:00
Jeff Johnston dde223343c 2007-09-07 Patrick Mansfield <patmans@us.ibm.com>
* libc/include/machine/_default_types.h: New file, contains what
	was previously in libc/include/machine/_types.h.
	* libc/include/machine/_types.h: Now only includes
	machine/_default_types.h.
	* libc/include/sys/reent.h: Remove _fpos_t and _fpos64_t.
	* libc/include/sys/_types.h: Move _fpos_t and _fpos64_t to here,
	with conditional declarations.
	* libc/machine/spu/machine/_types.h: New file, add SPU specific
	typedefs for _fpos_t and _fpos64_t.
2007-09-07 21:16:25 +00:00
Jeff Johnston 78e66fb978 2007-09-07 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/math.h (_M_LOG2E): Replace with..
        (_M_LOG2_E): New macro.
        (log2, log2f, M_LOG2_E): Use _M_LOG2_E.
2007-09-07 15:30:59 +00:00
Jeff Johnston e65aa07ac6 Fix typo in ChangeLog and math.h. 2007-09-06 19:55:34 +00:00
Jeff Johnston 6494ee837c 2007-09-06 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/math.h (_M_LOG2E): New log2 of e macro.
        (log2): Use _M_LOG2E instead of M_LOG2E.
        (log2f): Ditto.
        (M_LOG2E): Define to be _M_LOG2E.
2007-09-06 19:51:46 +00:00
Jeff Johnston d4a2788652 2007-08-28 Hans Kester <hans.kester@ellips.nl>
* configure.host: Added support for x86_64.
        * libc/include/machine/ieeefp.h: Define __IEEE_LITTLE_ENDIAN for x86_64.
        * libc/include/machine/setjmp.h: Define _JBTYPE and _JBLEN for x86_64.
        * libc/machine/x86_64/aclocal.m4: Generated.
        * libc/machine/x86_64/configure.in: New.
        * libc/machine/x86_64/configure: Generated.
        * libc/machine/x86_64/Makefile.am: New.
        * libc/machine/x86_64/Makefile.in: Generated.
        * libc/machine/x86_64/setjmp.S: New.
        * libc/machine/x86_64/memcpy.S: New.
        * libc/machine/x86_64/memset.S: New.
        * libc/machine/configure.in: Added support for x86_64.
        * libc/machine/configure: Regenerated.
2007-08-28 21:56:50 +00:00
Jeff Johnston 90c6084b56 2007-08-03 Ralf Corsepius <ralf.corsepius@rtems.org>
* libc/include/tar.h: New.
2007-08-03 21:03:40 +00:00
Eric Blake 6ddcdb9da5 Implement fmemopen and open_memstream.
* libc/stdio/fmemopen.c (_fmemopen_r, fmemopen): New file.
* libc/stdio/open_memstream.c (_open_memstream_r, open_memstream):
New file.
* libc/stdio/fopencookie.c (fcwriter): Minor optimization.
* libc/include/stdio.h (dprintf, vdprintf): Group all POSIX 200x
functions together.
(fmemopen, open_memstream): Declare new functions.
* libc/stdio/stdio.tex: Document them.
* libc/stdio/Makefile.am (ELIX_4_SOURCES, CHEWOUT_FILES): Add
fmemopen and open_memstream.
* libc/stdio/Makefile.in: Regenerate.
2007-08-02 20:23:06 +00:00
Eric Blake 08146e5adb Fix fflush issues.
* libc/stdio/fflush.c (_fflush_r): New function.
(fflush): Fix reentrancy and large offset behavior.
* libc/include/stdio.h (_fflush_r): Add prototype.
* libc/stdio/fclose.c (_fclose_r): All fflush callers changed.
* libc/stdio/freopen.c (_freopen_r): Likewise.
* libc/stdio/fseek.c (_fseek_r): Likewise.
* libc/stdio/ftell.c (_ftell_r): Likewise.
* libc/stdio/fvwrite.c (__sfvwrite_r): Likewise.
* libc/stdio/refill.c (__srefill_r): Likewise.
* libc/stdio/setvbuf.c (setvbuf): Likewise.
* libc/stdio/ungetc.c (_ungetc_r): Likewise.
* libc/stdio/vfprintf.c (__sbprintf): Likewise.
* libc/stdio/wbuf.c (__swbuf_r): Likewise.
* libc/stdio64/freopen64.c (_freopen64_r): Likewise.
* libc/stdio64/fseeko64.c (_fseeko64_r): Likewise.  Defer to
32-bit version if not large file.
* libc/stdio64/ftello64.c (_ftello64_r): Likewise.
* libc/stdio64/tmpfile64.c (_tmpfile64_r): Avoid compile warning.
2007-07-13 20:37:53 +00:00
Jeff Johnston c4ccbcce6c 2007-07-11 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/math.h: Fix so C99 functions/macros are accessible
        when -std=c99 is used when compiling and not when using C89.
2007-07-11 18:09:08 +00:00
Corinna Vinschen dec27025b2 * libc/include/wchar.h: Declare wcstol, wcstoll, wcstoul,
wcstoull, _wcstol_r, _wcstoll_r, _wcstoul_r and _wcstoull_r.
	* libc/stdlib/Makefile.am (GENERAL_SOURCES): Add wcstol.c and wcstoul.c.
	(EXTENDED_SOURCES): Add wcstoll.c, wcstoll_r.c, wcstoull.c and
	wcstoull_r.c.
	(CHEWOUT_FILES): Add .def files accordingly.
	* libc/stdlib/Makefile.in: Regenerate.
	* libc/stdlib/stdlib.tex: Add documentation links for above functions.
	* libc/stdlib/strtoll.c: Fix portability note.
	* libc/stdlib/strtoull.c: Ditto.
	* libc/stdlib/wcstol.c: New file.
	* libc/stdlib/wcstoll.c: New file.
	* libc/stdlib/wcstoll_r.c: New file.
	* libc/stdlib/wcstoul.c: New file.
	* libc/stdlib/wcstoull.c: New file.
	* libc/stdlib/wcstoull_r.c: New file.
2007-07-06 20:03:28 +00:00
Jeff Johnston 0be2bc94e7 2007-07-06 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/time.h (gettimeofday): Change to proper
        prototype where second parameter is void *.
        * libc/reent/gettimeofdayr.c (_gettimeofday_r): Change prototype
        accordingly.
        * libc/include/reent.h: Fix prototype for _gettimeofday_r.
        * libc/sys/arm/syscalls.c: Fix gettimeofday function signature.
        * libc/sys/rdos/gettod.c: Ditto.
        * libc/sys/sh/syscalls.c: Ditto.
        * libc/time/time.c (time): Change call to _gettimeofday_r
        to pass NULL as 2nd argument.
2007-07-06 16:56:30 +00:00
Corinna Vinschen a37215120b * libc/include/wchar.h: Add prototype for wcsxfrm.
* libc/string/Makefile.am (GENERAL_SOURCES): Add wcsxfrm.c.
	(CHEWOUT_FILES): Add wcsxfrm.def.
	* libc/string/Makefile.in: Regenerate.
	* libc/string/wcsxfrm.c: New file.
	* libc/string/wcstrings.tex: Add wcsxfrm.
2007-07-04 16:18:34 +00:00
Corinna Vinschen 5d8b97a694 * libc/include/string.h: Add prototypes for stpcpy and stpncpy.
* libc/string/Makefile.am (ELIX_SOURCES): Add stpcpy.c and
	stpncpy.c.
	(CHEWOUT_FILES): Add stpcpy.def and stpncpy.def.
	* libc/string/Makefile.in: Regenerate.
	* libc/string/stpcpy.c: New file.
	* libc/string/stpncpy.c: New file.
	* libc/string/strings.tex: Add stpcpy and stpncpy.
2007-06-28 17:07:23 +00:00
Eric Blake 3473e6bd7b Support __func__ in assert, as required by C99.
* libc/stdlib/assert.c (__assert_func): New function.
	(__assert): Use __assert_func.
	* libc/include/assert.h (assert) [!NDEBUG]: Use __assert_func when
	possible.
2007-06-27 12:44:41 +00:00
Jeff Johnston d360ef1865 2007-06-20 Patrick Mansfield <patmans@us.ibm.com>
* libc/include/sys/unistd.h[__SPU__]: Add lockf prototype and related
        defines; expose ftruncate, truncate and sync prototypes.
2007-06-20 21:49:06 +00:00
Jeff Johnston f75c75183f 2007-06-20 Patrick Mansfield <patmans@us.ibm.com>
* libc/include/sys/unistd.h[__SPU__]: Make fchdir prototype visible.
        * libc/include/sys/stat.h[__SPU__]: Make mknod and lstat prototypes
        visible.
2007-06-20 17:30:58 +00:00
Jeff Johnston a8b08518c1 2007-06-13 Patrick Mansfield <patmans@us.ibm.com>
* libc/include/sys/features.h: Define _POSIX_TIMERS for spu.
        * libc/include/sys/unistd.h: Change usleep prototype to Posix
        form and move outside of OS flag checks.
        * libc/machine/spu/Makefile.am: Add sleep and usleep.
        * libc/machine/spu/Makefile.in: Regenerate.
        * libc/machine/spu/sleep.c: Copy libc/posix/sleep.c.
        * libc/machine/spu/usleep.c: Copy libc/posix/usleep.c.
2007-06-13 17:44:24 +00:00
Corinna Vinschen f4cd2a1d71 * libc/include/sys/unistd.h: Declare confstr for Cygwin.
Define confstr constants for Cygwin.  Add comment.
2007-06-11 17:33:43 +00:00
Jeff Johnston 6fb374754d 2007-06-08 Jeff Johnston <jjohnstn@redhat.com>
* libc/string/strcasestr.c: New file.
        * libc/include/string.h: Add strcasestr.
        * libc/string/strings.tex: Add strcasestr.
        * libc/string/Makefile.am: Ditto.
        * libc/string/Makefile.in: Regenerated.
2007-06-08 18:38:51 +00:00
Eric Blake 17c61d6a2c Implement funopen, fopencookie.
* libc/include/sys/reent.h (struct __sFILE, struct __sFILE64):
Switch to reentrant callbacks.
* libc/include/stdio.h (funopen): Fix declaration.
(fopencookie): Declare.
* libc/stdio/local.h (__sread, __swrite, __sseek, __sclose)
(__sseek64, __swrite64): Fix prototypes.
[__SCLE]: Pull in setmode declaration.
* libc/stdio/stdio.c (__sread, __swrite, __sseek, __sclose): Fix
reentrancy.
* libc/stdio64/stdio64.c (__sseek64_r, __swrite64_r): Delete.
(__sseek64, __swrite64): Fix reentrancy.
* libc/stdio/fseek.c (_fseek_r): Account for overflow, and fix
reentrancy.
* libc/stdio/ftell.c (_ftell_r): Likewise.
* libc/stdio/flags.c (__sflags): Don't lose __SAPP on "a+".
* libc/stdio/fclose.c (_fclose_r): Fix reentrancy.
* libc/stdio/freopen.c (_freopen_r): Likewise.
* libc/stdio/fvwrite.c (__sfvwrite_r): Likewise.
* libc/stdio/refill.c (__srefill_r): Likewise.
* libc/stdio/siscanf.c (eofread): Likewise.
* libc/stdio/sscanf.c (eofread): Likewise.
* libc/stdio/vsiscanf.c (eofread1): Likewise.
* libc/stdio/vsscanf.c (eofread1): Likewise.
* libc/stdio64/freopen64.c (_freopen64_r): Likewise.
* libc/stdio64/fseeko64.c (_fseeko64_r): Likewise.
* libc/stdio64/ftello64.c (_ftello64_r): Likewise.
* libc/stdio/fflush.c (fflush): Improve reentrancy, although more
could be fixed.
* libc/stdio/fopencookie.c (_fopencookie_r, fopencookie): New file.
* libc/stdio/funopen.c (_funopen_r, funopen): New file.
* libc/stdio/Makefile.am (ELIX_4_SOURCES, CHEWOUT_FILES): Build
new files.
* libc/stdio/Makefile.in: Regenerate.
2007-06-04 18:10:17 +00:00
Corinna Vinschen d48670ed78 * libc/argz/argz_create_sep.c (argz_create_sep): Initialize *argz_len
to zero.
	* libc/include/argz.h: Guard against multiple inclusion.  Guard for
	use with C++.
2007-05-23 16:36:23 +00:00
Jeff Johnston e0500490bc 2007-05-17 Yaakov Selkowitz <yselkowitz <at> users.sourceforge.net>
* libm/common/Makefile.am: Add support for exp10, exp10f,
        pow10, and pow10f functions.
        * libm/common/Makefile.in: Regenerated.
        * libm/common/s_pow10.c: New file.
        * libm/common/sf_pow10.c: Ditto.
        * libm/common/s_exp10.c: Ditto.
        * libm/common/sf_exp10.c: Ditto.
        * libc/include/math.h [!pow10]: New pow10 prototype.
        [!pow10f]: New pow10f prototype.
        [!exp10]: New exp10 prototype.
        [!exp10f]: New exp10f prototype.
2007-05-17 18:50:57 +00:00
Eric Blake 895d76fed6 * libc/include/math.h (INFINITY, NAN, FP_ILOGB0, FP_ILOGBNAN)
(MATH_ERRNO, MATH_ERREXCEPT, math_errhandling): Add macros
	required by POSIX.
	* libc/stdlib/ldtoa.c (USE_INFINITY): Rename from INFINITY, to
	avoid clash with <math.h>.
2007-05-16 19:59:40 +00:00
Eric Blake b9db529222 Add support for asnprintf, and improve *printf documentation.
* libc/stdio/Makefile.am (ELIX_SOURCES): Rename...
	(ELIX_2_SOURCES): ...to this.
	(ELIX_4_SOURCES): Add new variable.  Build asnprintf.
	(GENERAL_SOURCES): Move dprintf to ELIX_4_SOURCES.
	(CHEWOUT_FILES): Include diprintf in documentation.
	* libc/stdio/Makefile.in: Regenerate.
	* libc/stdio/diprintf.c: Improve documentation.
	* libc/stdio/dprintf.c: Likewise.
	* libc/stdio/siprintf.c: Likewise.
	* libc/stdio/sprintf.c: Likewise.
	* libc/stdio/vfprintf.c: Likewise.
	* libc/stdio/viprintf.c: Likewise.
	* libc/stdio/vsniprintf.c: Consolidate documentation.
	* libc/stdio/asiprintf.c: Refer to documentation.
	* libc/stdio/asprintf.c: Likewise.
	* libc/stdio/fiprintf.c: Likewise.
	* libc/stdio/fprintf.c: Likewise.
	* libc/stdio/iprintf.c: Likewise.
	* libc/stdio/printf.c: Likewise.
	* libc/stdio/sniprintf.c: Likewise.
	* libc/stdio/vdiprintf.c: Likewise.
	* libc/stdio/vdprintf.c: Likewise.
	* libc/stdio/vsiprintf.c: Likewise.
	* libc/stdio/fvwrite.c (__sfvwrite_r): Handle asnprintf.
	* libc/stdio/asniprintf.c (asniprintf, _asniprintf_r): New file.
	* libc/stdio/asnprintf.c (asnprintf, _asnprintf_r): New file.
	* libc/stdio/vasniprintf.c (vasniprintf, _vasniprintf_r): New
	file.
	* libc/stdio/vasnprintf.c (vasnprintf, _vasnprintf_r): New file.
	* libc/stdio/vdprintf.c (_vdprintf_r): Rewrite to avoid malloc in
	typical case.
	* libc/stdio/vdiprintf.c (_vdiprintf_r): Likewise.
	* libc/include/stdio.h: Add prototypes for new functions; sort
	existing functions.
2007-05-04 02:55:16 +00:00
Jeff Johnston 976e9d281b 2007-04-26 Patrick Mansfield <patmans@us.ibm.com>
* libc/include/ieeefp.h: use prefixed __ieeefp_ macros that can be
        overridden via machine/ieeefp.h.
        * libc/include/machine/ieeefp.h: Add SPU specific C99 and ieeefp
        macros for isnan and related macros.
        * libc/include/math.h: Allow C99 isfinite, isinf, and isnan to be
        overridden via machine/ieeefp.h.
        * libm/machine/spu/Makefile.am: Add new files.
        * libm/machine/spu/Makefile.in: Autogenerate with new files.
        * libm/machine/spu/sf_fpclassify.c: Add SPU specific __fpclassifyf.
        * libm/machine/spu/sf_finite.c: Add SPU specific finitef.
        * libm/machine/spu/sf_isinf.c: Add SPU specific isinff.
        * libm/machine/spu/sf_isinff.c: Add SPU specific __isinff.
        * libm/machine/spu/sf_isnan.c: Add SPU specific isnanf.
        * libm/machine/spu/sf_isnanf.c: Add SPU specific __isnanf.
        * libm/machine/spu/sf_nan.c: Add SPU specific nanf.
2007-04-26 19:23:37 +00:00
Eric Blake 68f2517f72 * libc/include/limits.h (NL_ARGMAX): Define a default value.
* libc/stdio/vfprintf.c (MAX_POS_ARGS): Define in terms of
	NL_ARGMAX, if present.
2007-04-24 16:01:15 +00:00
Eric Blake 503e2d1c76 * libc/include/stdio.h (_ELIDABLE_INLINE): Work even when using
CFLAGS=-O0.
2007-04-10 12:49:18 +00:00
Eric Blake 17c0c97d7c * libc/include/stdio.h: Add gcc format attributes to printf and
scanf families.
2007-04-10 12:47:13 +00:00
Jeff Johnston db7aa4b168 2007-04-04 Eric Blake <ebb9@byu.net>
* libc/stdio/asiprintf.c (_asiprintf_r): Fix reentrancy.
	(asiprintf): Avoid overhead.
	* libc/stdio/asprintf.c (_asprintf_r): Fix reentrancy.
	(asprintf): Avoid overhead.
	* libc/stdio/diprintf.c (_diprintf_r, diprintf): New file.
	* libc/stdio/dprintf.c (_dprintf_r, dprintf): Use _DEFUN.
	* libc/stdio/fiprintf.c (_fiprintf_r): Add reentrant version.
	(fiprintf): Avoid overhead.
	* libc/stdio/fprintf.c (_fprintf_r): Add reentrant version.
	(fprintf): Avoid overhead.
	* libc/stdio/iprintf.c (_iprintf_r): Use _DEFUN.
	(iprintf): Avoid overhead.
	* libc/stdio/printf.c (_printf_r): Use _DEFUN.
	(printf): Avoid overhead.
	* libc/stdio/vasiprintf.c (vasiprintf): Reduce binary size.
	* libc/stdio/vasprintf.c (vasprintf): Reduce binary size.
	* libc/stdio/vdiprintf.c (_vdiprintf_r, vdiprintf): New file.
	* libc/stdio/vdprintf.c (vdprintf): Avoid overhead.
	* libc/stdio/vsiprintf.c (vsiprintf): Reduce binary size.
	* libc/stdio/vsniprintf.c (vsniprintf): Reduce binary size.
	* libc/stdio/vsnprintf.c (vsnprintf): Reduce binary size.
	* libc/stdio/vsprintf.c (vsprintf): Reduce binary size.
	* libc/stdio/Makefile.am (GENERAL_SOURCES): Add diprintf.c,
	vdiprintf.c.
	* libc/include/stdio.h (diprintf, _diprintf_r, vdiprintf)
	(_vdiprintf_r, _fiprintf_r, _vfiprintf_r): Add prototypes.
2007-04-04 18:32:49 +00:00
Dave Korn 2c58b5a5e8 2007-03-30 Dave Korn <dave.korn@artimi.com>
* libc/include/stdio.h (_ELIDABLE_INLINE):  New macro to conceal
	conflicting inline semantics between C99 and GNU89.
	(__sgetc_r):  Replace static inline with _ELIDABLE_INLINE to be
	compatible with -fkeep-inline-functions usage.
	(__sputc_r):  Likewise for consistency even though disabled.
2007-03-30 00:49:56 +00:00
Jeff Johnston 826b5591dd 2007-03-15 Jeff Johnston <jjohnstn@redhat.com>
* configure.in: Add new --enable-newlib-reent-small option.
        * configure: Regenerated.
        * acconfig.h: Add _WANT_REENT_SMALL.
        * newlib.hin: Regenerated minus PACKAGE macros to add
        _WANT_REENT_SMALL macro.
        * libc/include/sys/config.h[_WANT_REENT_SMALL]: Set _REENT_SMALL
        if not already set.
        * libc/stdio/fflush.c[_REENT_SMALL]: Return immediately if
        there is no buffer.
        * libc/stdio/local.h[_REENT_SMALL]: Fix CHECK_INIT macro to
        use reentrant pointer passed in when resetting the file
        pointer to one of the std streams.
2007-03-15 21:32:13 +00:00
Jeff Johnston 960e5d8f19 2007-02-20 Kazunori Asayama <asayama@sm.sony.co.jp>
* libc/include/stdio.h: Add declaration for vsiprintf.
2007-02-20 20:53:35 +00:00
Corinna Vinschen 4f7e59f268 * libc/include/sys/features.h: Add _POSIX_MESSAGE_PASSING for
Cygwin.
2007-02-14 10:07:02 +00:00
Corinna Vinschen d7e4c7a807 * libc/include/sys/features.h: Add _POSIX_SHARED_MEMORY_OBJECTS for
Cygwin.  Fix value of _POSIX_SEMAPHORES.  Fix formatting.
2007-02-08 13:34:20 +00:00
Corinna Vinschen 0e37a2e6e5 * libc/include/sys/features.h: Add definition of all supported
_POSIX_xxx values for Cygwin.
	* libc/include/sys/types.h (pthread_rwlock_t): Omit definition
	on Cygwin.
	(pthread_rwlockattr_t): Ditto.
	* libc/include/sys/unistd.h: Define all _SC_xxx values as
	required by SUSv3.  Unify formatting.
2007-02-07 17:19:35 +00:00
Jeff Johnston 6699fabb91 2007-02-02 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/include/sys/errno.h: Add ECANCELED.
2007-02-02 16:22:28 +00:00
Jeff Johnston 7d592bb178 2007-02-01 Joel Schopp <jschopp@austin.ibm.com>
Kazunori Asayama <asayama@sm.sony.co.jp>

        * configure.host: Enable SPU specific stdio directory.
        * libc/machine/spu/Makefile.am: Add objects.
        * libc/machine/spu/Makefile.in: Regenerated.
        * libc/machine/spu/c99ppe.h: Add macros and function
        declarations to initialize SPU specific stdio stuffs.
        * libc/machine/spu/stdio.c: Add functions to manage Cell SPU
        specific FILE structures.
        * libc/machine/spu/perror.c: Add initialization routine of
        stdio stuffs.
        * libc/machine/spu/printf.c: Ditto.
        * libc/machine/spu/putchar.c: Ditto.
        * libc/machine/spu/puts.c: Ditto.
        * libc/machine/spu/vprintf.c: Ditto.
        * libc/machine/spu/clearerr.c: New file. Add a stdio function
        implementation.
        * libc/machine/spu/feof.c: Ditto.
        * libc/machine/spu/ferror.c: Ditto.
        * libc/machine/spu/fileno.c: Ditto.
        * libc/machine/spu/fopen.c: Ditto.
        * libc/machine/spu/fclose.c: Ditto.
        * libc/machine/spu/freopen.c: Ditto.
        * libc/machine/spu/fflush.c: Ditto.
        * libc/machine/spu/fseek.c: Ditto.
        * libc/machine/spu/ftell.c: Ditto.
        * libc/machine/spu/rewind.c: Ditto.
        * libc/machine/spu/fgetpos.c: Ditto.
        * libc/machine/spu/fsetpos.c: Ditto.
        * libc/machine/spu/fread.c: Ditto.
        * libc/machine/spu/fwrite.c: Ditto.
        * libc/machine/spu/getc.c: Ditto.
        * libc/machine/spu/getchar.c: Ditto.
        * libc/machine/spu/gets.c: Ditto.
        * libc/machine/spu/fgetc.c: Ditto.
        * libc/machine/spu/fgets.c: Ditto.
        * libc/machine/spu/ungetc.c: Ditto.
        * libc/machine/spu/putc.c: Ditto.
        * libc/machine/spu/fputc.c: Ditto.
        * libc/machine/spu/fputs.c: Ditto.
        * libc/machine/spu/vfprintf.c: Ditto.
        * libc/machine/spu/vfscanf.c: Ditto.
        * libc/machine/spu/fprintf.c: Ditto.
        * libc/machine/spu/fscanf.c: Ditto.
        * libc/machine/spu/scanf.c: Ditto.
        * libc/machine/spu/vscanf.c: Ditto.
        * libc/machine/spu/setbuf.c: Ditto.
        * libc/machine/spu/setvbuf.c: Ditto.
        * libc/machine/spu/tmpfile.c: Ditto.

2007-02-01  Jeff Johnston  <jjohnstn@redhat.com>

        * libc/include/sys/config.h[__SPU__]: Define __CUSTOM_FILE_IO__.
        * libc/include/stdio.h[!__CUSTOM_FILE_IO__]: Add flag check
        around stdio macros that manipulate fields in the normal file
        structure.
        * libc/include/sys/reent.h[__CUSTOM_FILE_IO__]: Include
        <sys/custom_file.h> to define custom FILE structure.
        * libc/include/sys/custom_file.h: New default header file
        that generates error if not overridden when __CUSTOM_FILE_IO__ set.
        * libc/machine/spu/sys/custom_file.h: New file.
2007-02-01 16:33:05 +00:00
Jeff Johnston 9b354d7f3b 2006-12-18 Kazunori Asayama <asayama@sm.sony.co.jp>
* libc/include/machine/setjmp.h: Replace vector with __vector.
2006-12-18 16:48:03 +00:00
Jeff Johnston dd52bb72fb 2006-12-13 Joel Schopp <jschopp@austin.ibm.com>
* newlib/include/alloca.h: add undef alloca to work with xlc
2006-12-13 23:01:21 +00:00
Jeff Johnston 4e051d914a 2006-12-12 Joel Schopp <jschopp@austin.ibm.com>
* libc/include/machine/setjmp.h[__SPU__]: Redefine _JBTYPE for
        cell spu
2006-12-13 19:36:17 +00:00
Jeff Johnston 75190a8fa2 2006-11-30 Lev Bishop <lev.bishop@gmail.com>
* libc/include/math.h: Allow C99 functions/macros to be
        defined for C++ even when __STRICT_ANSI__.
2006-11-30 23:40:12 +00:00
Jeff Johnston 292f8e2328 2006-11-08 Jie Zhang <jzhang918@gmail.com>
* configure.host: Add support for bfin.
        * libc/include/machine/ieeefp.h: Define __IEEE_LITTLE_ENDIAN for bfin.
        * libc/include/machine/setjmp.h: Define _JBLEN for bfin.
        * libc/machine/bfin/aclocal.m4: Generate.
        * libc/machine/bfin/configure.in: New.
        * libc/machine/bfin/configure: Generate.
        * libc/machine/bfin/Makefile.am: New.
        * libc/machine/bfin/Makefile.in: Generate.
        * libc/machine/bfin/setjmp.S: New.
        * libc/machine/bfin/longjmp.S: New.
        * libc/machine/configure.in: Add bfin support.
        * libc/machine/configure: Generate.
2006-11-08 19:26:43 +00:00
Corinna Vinschen b1755fe736 * libc/include/sys/unistd.h (_SC_STREAM_MAX): Define on Cygwin.
(_PC_FILESIZEBITS): Add definition.
	(_PC_2_SYMLINKS): Ditto.
	(_PC_SYMLINK_MAX): Ditto.
2006-11-07 15:33:40 +00:00
Jeff Johnston 884dc68fe0 2006-10-25 Vladimir Prus <vladimir@codesourcery.com>
* libc/include/math.h: (exception): Add a comment
        telling fixincludes that we handle C vs. C++ issue.
2006-10-25 18:46:40 +00:00
Jeff Johnston f8fe93f9b8 2006-10-11 Yang Tse <yangsita@gmail.com>
* setjmp.h: Use __extension__ keyword for gcc's braced-groups.
2006-10-11 19:20:31 +00:00
Jeff Johnston e5e148d15b 2006-09-26 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h[_REENT_SMALL]: Do not allow macros
        for clearerr, feof, or fileno.
        * libc/include/sys/reent.h[_REENT_SMALL](struct _reent): Change
        the dummy std stream scheme to use pointers to const external
        fake files, one for each standard stream.
        * libc/stdio/local.h (CHECK_INIT): Change to take a file pointer
        argument.  For _REENT_SMALL, reset the file pointer if it
        matches one of the fake std stream pointers.
        * libc/stdio/clearerr.c: Fix CHECK_INIT macro to add file pointer
        argument.
        * libc/stdio/fclose.c: Ditto.
        * libc/stdio/feof.c: Ditto.
        * libc/stdio/ferror.c: Ditto.
        * libc/stdio/fflush.c: Ditto.
        * libc/stdio/fgetc.c: Ditto.
        * libc/stdio/fgets.c: Ditto.
        * libc/stdio/fileno.c: Ditto.
        * libc/stdio/findfp.c: Ditto.
        * libc/stdio/fputc.c: Ditto.
        * libc/stdio/fputs.c: Ditto.
        * libc/stdio/fread.c: Ditto.
        * libc/stdio/freopen.c: Ditto.
        * libc/stdio/fseek.c: Ditto.
        * libc/stdio/ftell.c: Ditto.
        * libc/stdio/fwrite.c: Ditto.
        * libc/stdio/getc.c: Ditto.
        * libc/stdio/getdelim.c: Ditto.
        * libc/stdio/putc.c: Ditto.
        * libc/stdio/refill.c: Ditto.
        * libc/stdio/setvbuf.c: Ditto.
        * libc/stdio/ungetc.c: Ditto.
        * libc/stdio/vfprintf.c: Ditto.
        * libc/stdio/vfscanf.c: Ditto.
        * libc/stdio/wbuf.c: Ditto.: Ditto.
        * libc/stdio/wsetup.c: Ditto.
        * libc/stdio64/freopen64.c: Ditto.
        * libc/stdio64/fseeko64.c: Ditto.
        * libc/stdio64/ftello64.c: Ditto.
        * libc/machine/powerpc/vfprintf.c: Ditto.
        * libc/machine/powerpc/vfscanf.c: Ditto.
2006-09-26 21:22:19 +00:00
Jeff Johnston e83c3d0ae5 2006-09-22 Paul Brook <paul@codesourcery.com>
* libc/include/sys/reent.h: Define and use __reent_assert.
2006-09-22 19:33:11 +00:00
Jeff Johnston 23754b33c3 2006-09-13 Joel Sherrill <joel@oarcorp.com>
* libc/include/pthread.h: Add pthread barriers,
        rwlocks, and spinlocks.  Change const to
        _CONST and prefix parameter names with
        an underscore.
        * libc/include/sys/types.h: Add id and attribute
        types for barriers, wrlocks, and spinlocks.
        * libc/include/sys/features.h: Enable barriers,
        wrlocks, and spinlocks for RTEMS.
2006-09-13 22:09:27 +00:00
Jeff Johnston ba1bb1b368 2006-09-13 Patrick Mansfield <patmans@us.ibm.com>
* libc/include/math.h: Remove _CONST from _LIB_VERSION, as it is
        supposed to be writable.
        * libm/common/s_lib_ver.c: Ditto.
2006-09-13 22:06:43 +00:00
Jeff Johnston 859742654a 2006-08-29 Paul Brook <paul@codesourcery.com>
* libc/include/sys/config.h: Define _REENT_SMALL for Thumb-2.
2006-08-29 21:00:59 +00:00
Christopher Faylor a0922fcb04 * sys/types.h: Correct syntax error caused by missing '\' on #ifdef line. 2006-08-19 16:13:23 +00:00
Jeff Johnston 734e841435 2006-08-16 Joel Schopp <jschopp@austin.ibm.com>
* configure.host: Add spu support.
        * libc/include/stdint.h: Ditto.
        * libc/include/machine/ieeefp.h: Ditto.
        * libc/include/machine/setjmp.h: Ditto.
        * libc/include/sys/config.h: Ditto.
        * libc/include/sys/types.h: Ditto.
        * libc/machine/spu/Makefile.am: New file.
        * libc/machine/spu/Makefile.in: Ditto.
        * libc/machine/spu/aclocal.m4: Ditto.
        * libc/machine/spu/configure: Ditto.
        * libc/machine/spu/configure.in: Ditto.
        * libc/machine/spu/memcpy.c: Ditto.
        * libc/machine/spu/setjmp.S: Ditto.
2006-08-16 21:39:43 +00:00
Jeff Johnston a121349405 2006-08-01 Thiemo Seufer <ths@mips.com>
Nigel Stephens  <nigel@mips.com>

	* libc/include/sys/config.h (__ATTRIBUTE_IMPURE_PTR__): For MIPS
	define this to force _impure_ptr to live in the .sdata section.
2006-08-01 15:54:04 +00:00
Jeff Johnston c8956c6fec 2006-06-15 Corinna Vinschen <corinna@vinschen.de>
* libc/include/stdio.h (__sgetc_r): Fix typo.
        * libc/stdio/fread.c (_fread_r): Convert crlf calls to crlf_r.
        * libc/stdio/rget.c (__srbuf): Reinstantiate.
        * libc/stdio/wbuf.c (__swbuf): Ditto.
2006-06-15 16:08:09 +00:00
Jeff Johnston 4dc0c0c4e5 2006-06-14 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h: Add new reentrant I/O prototypes for
        read/write functions.  Change getc/putc macros to have reentrant underlying
        macros/functions.  This includes __sgetc_raw_r, __sgetc_r, and __sputc_r.
        * libc/stdio/fgetc.c: Fix and/or add reentrant version to call
        new reentrant I/O functions/macros for reading/writing.
        * libc/stdio/fgets.c: Ditto.
        * libc/stdio/fputc.c: Ditto.
        * libc/stdio/fputs.c: Ditto.
        * libc/stdio/fread.c: Ditto.
        * libc/stdio/fseek.c: Ditto.
        * libc/stdio64/fseeko64.c: Ditto.
        * libc/stdio/fwrite.c: Ditto.
        * libc/stdio/getc.c: Ditto.
        * libc/stdio/getc_u.c: Ditto.
        * libc/stdio/getchar.c: Ditto.
        * libc/stdio/getchar_u.c: Ditto.
        * libc/stdio/putc.c: Ditto.
        * libc/stdio/putc_u.c: Ditto.
        * libc/stdio/putchar.c: Ditto.
        * libc/stdio/puts.c: Ditto.
        * libc/stdio/vfprintf.c: Ditto.
        * libc/stdio/vfscanf.c: Ditto.
        * libc/stdio/fvwrite.c: Change __sfvwrite into reentrant __sfvwrite_r.
        Change all previous callers of __sfvwrite.  Set errno to EBADF and
        set error flag on if attempt is made to write to file that does not
        allow writing.
        * libc/stdio/fvwrite.h: Fix new reentrant prototypes.
        * libc/stdio/local.h: Ditto.
        * libc/stdio/refill.c: Turn __srefill into reentrant __srefill_r.
        Set errno to EBADF and the error flag on if attempt is made to
        read unreadable file.  Change all previous callers of __srefill.
        * libc/stdio/rget.c
        * libc/stdio/wbuf.c: Turn __swbuf into reentrant __swbuf_r.  Change
        all previous callers of __swbuf.
        * libc/sys/linux/machine/i386/huge_val.h: Ifdef out file contents since
        huge value macros are already defined correctly for i386 by <math.h>.
2006-06-14 20:49:11 +00:00
Jeff Johnston 8eeee74e95 2006-05-23 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h: Protect dprintf prototype
        with #ifndef dprintf so as to not interfere with
        historical code defining their own dprintf macro.
2006-05-23 19:57:31 +00:00
Jeff Johnston dc7798c6b0 2006-05-18 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h: Add prototypes for fiscanf,
        iscanf, and siscanf.
2006-05-18 18:07:19 +00:00
Jeff Johnston e163e3e138 2006-04-18 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/signal.h (sigdelset, sigfillset, sigismember): New macros.
        (sigaddset, sigemptyset): Add return code.
2006-04-18 20:06:09 +00:00
Jeff Johnston e48682cff5 2006-02-27 Jeff Johnston <jjohnstn@redhat.com>
* Makefile.am (MATHOBJS_IN_LIBC): Add s_isinfd, sf_isinff,
        s_isnand, and sf_isnanf object files.
        * Makefile.in: Regenerated.
        * libc/include/ieeefp.h: Undef isnan and isinf to avoid
        conflict if <math.h> has previously been included.
        * libc/include/math.h
        * libm/common/Makefile.am: Add new s_isinfd, s_isnand, sf_isinff,
        and sf_isnanf files.  Also support s_isnan, sf_isnan, s_isinf, and
        sf_isinf files which have been moved from math/mathfp directories.
        * libm/common/Makefile.in: Regenerated.
        * libm/common/s_isinfd.c: New file.
        * libm/common/s_isnand.c: Ditto.
        * libm/common/sf_isinff.c: Ditto.
        * libm/common/sf_isnanf.c: Ditto.
        * libm/common/s_isinf.c: Moved from libm/math directory.
        * libm/common/s_isnan.c: Ditto.
        * libm/common/sf_isinf.c: Ditto.
        * libm/common/sf_isnan.c: Ditto.
        * libm/math/Makefile.am: Remove isinf and isnan family functions
        which have been moved into common directory.
        * libm/mathfp/Makefile.am: Ditto.
        * libm/math/Makefile.in: Regenerated.
        * libm/mathfp/Makefile.in: Ditto.
        * libm/math/s_isinf.c: Removed.
        * libm/math/s_isnan.c: Ditto.
        * libm/math/sf_isinf.c: Ditto.
        * libm/math/sf_isnan.c: Ditto.
        * libm/mathfp/s_isinf.c: Ditto.
        * libm/mathfp/s_isnan.c: Ditto.
        * libm/mathfp/sf_isinf.c: Ditto.
        * libm/mathfp/sf_isnan.c: Ditto.
2006-02-27 23:51:28 +00:00
Corinna Vinschen 680e0f1ffd * libc/include/sys/time.h (struct timeval): Change member types
according to SUSv3.
	* libc/include/sys/types.h (useconds_t): Change to unsigned
	according to SUSv3.
	(suseconds_t): Define type.
2006-02-15 10:26:30 +00:00