Commit Graph

11 Commits

Author SHA1 Message Date
Sebastian Huber 9d4a6534fb Move RTEMS and XMK specific type definitions
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2019-02-19 09:06:22 +01:00
Sebastian Huber 9bb91b6c6b Resurrect <machine/types.h> for <sys/types.h>
Resurrect <machine/_user_types.h> for use in <sys/types.h>.  Newlib
targets may provide an own version of <machine/types.h> in their machine
directory to add custom user types for <sys/types.h>.  Check the
_SYS_TYPES_H header guard to prevent a direct include of
<machine/types.h>, since the <machine/types.h> file is a Newlib
speciality.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-21 10:08:19 +02:00
Sebastian Huber 477463a201 Eliminate use of Newlib-specific <machine/types.h>
This change solves a glibc/BSD compatibility problem.

glibc and BSD use double underscore types for internal types.  The Linux
port of Newlib uses some glibc provided internal type definitions which
are not protected by guard defines, e.g. __off_t.  To avoid a conflict
Newlib uses single underscore types for some internal types, e.g.
_off_t.  However, for BSD compatibility we have to define the internal
types with double underscore names in <sys/_types.h>.

The header file <machine/types.h> is Newlib-specific.  It was used
instead of <sys/_types.h> to provide the internal type definitions
_CLOCK_T, _TIME_T_, _CLOCKID_T_, _TIMER_T_, and __suseconds_t.  Move
these definitions to <sys/_types.h> (there exist two instances of this
file, one for Linux and one for all other targets).  This makes the
_HAVE_SYSTYPES configuration define obsolete (could possibly break the
__RDOS__ target).  Use the standard <sys/_types.h> include throughout.

Move __loff_t defintion to default (non-Linux) <sys/_types.h>.  Define
it via _off64_t to avoid a dependency on the compiler.

Provide the __off_t definition via default (non-Linux) <sys/_types.h>
based on _off_t for all systems except Cygwin.  For Cygwin use _off64_t.
Define off_t via __off_t.

Provide the __pid_t definition via default (non-Linux) <sys/_types.h>.
This prevents a potential __pid_t and pid_t incompatibility.  Add BSD
guard defines for pid_t.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-13 13:30:27 +02:00
Sebastian Huber bb01594897
Merge parts of <sys/time.h> from FreeBSD
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-13 13:17:34 +01:00
Jeff Johnston f2f8a9a229 2005-02-24 Ralf Corsepious <ralf.corsepius@rtems.org>
* libc/include/sys/types.h [__rtems__]: Include new
        header file machine/_types.h.
        * libc/include/machine/types.h: Ditto.
        * libc/sys/rtems/machine/_types.h: New file.
2005-02-24 18:29:31 +00:00
Jeff Johnston c3e92877a9 2003-01-16 Joel Sherrill <joel@OARcorp.com>
* libc/sys/rtems/include/limits.h, libc/sys/rtems/sys/param.h,
        libc/sys/rtems/sys/syslimits.h: Update to be in sync with what
        constants are defined in each file in the shared versions in
        libc/include.
        * libc/sys/rtems/crt0.c: Define extra symbols on SH and HP-PA to
        autoconf can link programs.
        * libc/include/machine/types.h: Explicitly specify signed on
        intXX_t types to ensure they are signed.
2003-01-16 22:37:54 +00:00
Jeff Johnston dd7ee147db 2002-11-07 Joel Sherrill <joel@OARcorp.com>
* libc/sys/rtems/machine: New directory.
        * libc/sys/rtems/machine/limits.h, libc/sys/rtems/machine/param.h,
        libc/sys/rtems/sys/param.h, libc/sys/rtems/sys/syslimits.h,
        libc/sys/rtems/sys/utime.h: New files added to make *-rtems newlib
        targets more BSD like when installed without requiring files to
        be overwritten at install point when RTEMS itself is installed.
        * Makefile.am: Pick up system dependent machine .h files such as
        might be found on a BSD-ish system.
        * Makefile.in: Regenerate.
        * libc/include/machine/types.h: When on an RTEMS target, define a
        few BSD flavor types.
2002-11-07 19:27:36 +00:00
Jeff Johnston 35728d4f14 2002-06-21 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/math.h: Add <sys/types.h> to get _uint32_t definition.
        * libc/include/machine/types.h: Skip __off_t, __pid_t, and
        __loff_t definitions if special _HAVE_SYSTYPES macro defined.
        * libc/include/sys/config.h: Removed _uint*, _int* definitions.
        * libc/include/sys/param.h: Remove i386 case which is handled
        by default case.
        (BIG_ENDIAN, LITTLE_ENDIAN): Protect
        definitions in case they are already defined.
        (BYTE_ORDER): Add default case using _IEEE_BIG_ENDIAN and
        _IEEE_LITTLE_ENDIAN flags.
        * libc/include/sys/reent.h: Change __uint32_t references to
        use _ULong instead.
        (_REENT_GETDATE_REENT_P): New macro.
        * libc/include/sys/types.h (__int16_t, __uint16_t): Added.
        (__int32_t, __uint32_t, __int64_t, __uint64_t): Ditto.
        * libc/search/hash.h: Add default setting of BYTE_ORDER,
        LITTLE_ENDIAN, and BIG_ENDIAN, if not already defined.
        * libc/sys/linux/sys/types.h: Include <sys/_types.h>.  Define
        ssize_t based on _ssize_t.  Remove __socklen_t, __uintptr_t,
        pid_t, off_t, loff_t, caddr_t, and daddr_t type
        definitions which are done by subsequent glibc headers.
        Add macro definitions to prevent subsequent header files from
        defining pid_t, off_t, ssize_t, and key_t.  Move uintptr_t and
        intptr_t to after glibc definitions of types they are based on.
2002-06-21 18:15:56 +00:00
Jeff Johnston b9f9f69937 2002-04-23 Jeff Johnston <jjohnstn@redhat.com>
*  libc/include/machine/types.h (__pid_t, __off_t, __loff_t): Added.
        *  libc/sys/linux/Makefile.am: Add support for mmap.c.
        *  libc/sys/linux/Makefile.in: Regenerated.
        *  libc/sys/linux/mmap.c: New file.
        *  libc/sys/linux/machine/i386/syscall.h: Add _syscall6 macro.
        *  libc/sys/linux/sys/types.h (pid_t, off_t, loff_t): Added.
2002-04-23 21:33:41 +00:00
Jeff Johnston 8fb3796385 2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
        * libc/sys/rtems/include/signal.h: Removed.
        * libc/sys/rtems/include/time.h: Removed.
        * libc/sys/rtems/sys/features.h: Removed.
        * libc/sys/rtems/sys/sched.h: Removed.
        * libc/sys/rtems/sys/siginfo.h: Removed.
        * libc/sys/rtems/sys/signal.h: Removed.
        * libc/sys/rtems/sys/time.h: Removed.
        * libc/sys/rtems/sys/times.h: Removed.
        definitions for time_t and clock_t since these are
        no longer in time.h.
        * libc/include/pthread.h: New file.
        * libc/include/sys/sched.h: New file.
        * libc/include/sys/features.h: New file.
        * libc/include/time.h: Removed duplicate definition of clock_t
        and time_t, get them from <sys/types.h> instead.  Add prototypes        for POSIX clock and timer functionality.
        * libc/sys/linux/sys/types.h: Changed to include
        * libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
        * libc/include/sys/signal.h: Add more complete set of POSIX
        signal functionality including real-time and threaded signals.
        * libc/include/sys/types.h: Add clock_t, time_t, struct
        timespec, and struct itimerspec.  Centralizing these makes
        things cleaner.  RTEMS uses 64-bit dev_t.
        Added numerous primitive definitions
        for pthreads including macros, pthread_attr_t,
        pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
        pthread_once_t, and pthread_t.
        * libc/include/sys/unistd.h: Added getlogin_r() prototype.
        If RTEMS follow POSIX on read(), write() and sbrk() prototype.
        Feature flags removed and moved to new file <sys/features.h>.
        Full set of POSIX sysconf() constants
2000-12-12 01:24:09 +00:00
Christopher Faylor 8a0efa53e4 import newlib-2000-02-17 snapshot 2000-02-17 19:39:52 +00:00