mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 04:19:21 +08:00
477463a201
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>
32 lines
616 B
C
32 lines
616 B
C
#ifndef _SYS_TIMES_H
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
#define _SYS_TIMES_H
|
|
|
|
#include <_ansi.h>
|
|
#include <sys/_types.h>
|
|
|
|
#ifndef __clock_t_defined
|
|
typedef _CLOCK_T_ clock_t;
|
|
#define __clock_t_defined
|
|
#endif
|
|
|
|
/* Get Process Times, P1003.1b-1993, p. 92 */
|
|
struct tms {
|
|
clock_t tms_utime; /* user time */
|
|
clock_t tms_stime; /* system time */
|
|
clock_t tms_cutime; /* user time, children */
|
|
clock_t tms_cstime; /* system time, children */
|
|
};
|
|
|
|
clock_t _EXFUN(times,(struct tms *));
|
|
#ifdef _COMPILING_NEWLIB
|
|
clock_t _EXFUN(_times,(struct tms *));
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* !_SYS_TIMES_H */
|