aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-11-13 00:21:19 +0000
committerUlrich Drepper <drepper@redhat.com>1997-11-13 00:21:19 +0000
commitfe0ec73edb48eff3785f29ddbac75cae5f8b361b (patch)
treed862765d3e48bfde1ee82de94b4e4f039ee7f205 /sysdeps
parentcc3fa755128c70f8afc2d604936f33e4d7d652d8 (diff)
downloadglibc-fe0ec73edb48eff3785f29ddbac75cae5f8b361b.tar
glibc-fe0ec73edb48eff3785f29ddbac75cae5f8b361b.tar.gz
glibc-fe0ec73edb48eff3785f29ddbac75cae5f8b361b.tar.bz2
glibc-fe0ec73edb48eff3785f29ddbac75cae5f8b361b.zip
1997-11-13 01:07 Ulrich Drepper <drepper@cygnus.com> * manual/arith.texi: Update documentation according to most recent ISO C 9X draft. Document fma, fdim, fmin, and fmax. * manual/math.texi: Allow multiple defitino of mul etc. * math/complex.h (I): Define using _Complex_U not _Imaginary_I. * math/libm-test.c: Add tests for fma. * math/math.h: Describe DECIMAL_DIG macro. Pretty print. * sysdeps/alpha/fpu/bits/mathdef.h: Define INFINITY as of type float. Define DECIMAL_DIG. * sysdeps/generic/bits/mathdef.h: Likewise. * sysdeps/i386/bits/mathdef.h: Likewise. * sysdeps/m68k/fpu/bits/mathdef.h: Likewise. * sysdeps/powerpc/bits/mathdef.h: Likewise. * sysdeps/sparc/fpu/bits/mathdef.h: Likewise. * sysdeps/ieee754/bits/nan.h: Define NAN as of type float. * sysdeps/m68k/bits/nan.h. Likewise. Remove NANF and NANL. 1997-11-12 17:50 Ulrich Drepper <drepper@cygnus.com> * sunrpc/xcrypt.c: Don't process #ident preprocessor instruction. Reported by Philip Blundell <pb@nexus.co.uk>. * string/strndup.c: Use K&R like definition. * sysdeps/unix/sysv/linux/getcwd.c: New file. Use kernel information instead of longish search for the name. * sysdeps/posix/getcwd.c: Add support for use of the code as a backup solution. 1997-11-12 15:31 Philip Blundell <pb@nexus.co.uk> * sysdeps/unix/sysv/linux/arm/sysdep.h (SYS_ify): Don't add SWI_BASE in twice. * sysdeps/unix/sysv/linux/arm/profil-counter.h (profil_counter): Use correct name to access PC. * sysdeps/unix/arm/sysdep.S: Include <bits/errno.h> not <errnos.h>. * sysdeps/generic/bits/types.h: Add __ino64_t and __off64_t. * sysdeps/generic/bits/stat.h: Add struct stat64. 1997-11-12 16:08 Ulrich Drepper <drepper@cygnus.com> * intl/loadmsgcat.c [_LIBC] (fstat): Don't define as __fstat since now we have a definition as _fxstat. * libio/fileops.c: Likewise. * libio/oldfileops.c: Likewise. Reported by Andreas Jaeger <aj@arthur.rhein-neckar.de>. 1997-11-12 Andreas Jaeger <aj@arthur.rhein-neckar.de> * sysdeps/wordsize-32/inttypes.h (SIG_ATOMIC_MAX): Correct value. * sysdeps/wordsize-64/inttypes.h (SIG_ATOMIC_MAX): Likewise. 1997-11-11 Paul Eggert <eggert@twinsun.com> Add overflow checking for 64-bit time_t and 32-bit int. * time/time.h (__offtime): Now returns int. * time/offtime.c (__offtime): Return nonzero if successful; check for tm_year overflow. (DIV): New macro. (LEAPS_THRU_END_OF): Handle negative years correctly. * time/tzset.c (__tz_convert): Return NULL if offtime cannot convert. * time/mktime.c (ranged_convert): New function. (ydhms_tm_diff): Return nonzero if TP is null. (__mktime_internal): Handle cases correctly even if they are near or past the limits of time_t values that can be broken down to struct tm. (print_tm, check_result, main): Diagnose localtime failures. * manual/time.texi: Document the fact that localtime returns 0 if the time can't be represented. 1997-11-12 06:03 Ulrich Drepper <drepper@cygnus.com> * time/strftime.c (memset_space, memset_zero): Use MEMPCPY, not mempcpy. Patch by Ken'ichi Handa <handa@etl.go.jp>. * manual/time.texi: Document %F and %f format for strftime. * manual/arith.texi: Document copysign, nextafter and nan. 1997-11-06 Andreas Jaeger <aj@arthur.rhein-neckar.de> * test-installation.pl: New file. Tests for some installation problems.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/alpha/fpu/bits/mathdef.h29
-rw-r--r--sysdeps/generic/bits/mathdef.h7
-rw-r--r--sysdeps/generic/bits/stat.h20
-rw-r--r--sysdeps/generic/bits/types.h2
-rw-r--r--sysdeps/i386/fpu/bits/mathdef.h12
-rw-r--r--sysdeps/ieee754/bits/nan.h23
-rw-r--r--sysdeps/m68k/bits/nan.h59
-rw-r--r--sysdeps/m68k/fpu/bits/mathdef.h7
-rw-r--r--sysdeps/posix/getcwd.c7
-rw-r--r--sysdeps/powerpc/bits/mathdef.h29
-rw-r--r--sysdeps/sparc/fpu/bits/mathdef.h29
-rw-r--r--sysdeps/unix/arm/sysdep.S6
-rw-r--r--sysdeps/unix/sysv/linux/arm/profil-counter.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/getcwd.c94
-rw-r--r--sysdeps/wordsize-32/inttypes.h2
-rw-r--r--sysdeps/wordsize-64/inttypes.h2
17 files changed, 198 insertions, 136 deletions
diff --git a/sysdeps/alpha/fpu/bits/mathdef.h b/sysdeps/alpha/fpu/bits/mathdef.h
index 0bc9c94ecc..1c259403f5 100644
--- a/sysdeps/alpha/fpu/bits/mathdef.h
+++ b/sysdeps/alpha/fpu/bits/mathdef.h
@@ -17,38 +17,38 @@
Boston, MA 02111-1307, USA. */
#ifndef _MATH_H
-#error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+# error "Never use <bits/mathdef.h> directly; include <math.h> 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
+# 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 FLT_EVAL_METHOD 0
-/* Define `INFINITY' as value of type `float_t'. */
-#define INFINITY HUGE_VALF
+/* Define `INFINITY' as value of type `float'. */
+# define INFINITY HUGE_VALF
-#else
+# 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 FLT_EVAL_METHOD 1
-/* Define `INFINITY' as value of type `float_t'. */
-#define INFINITY HUGE_VAL
+/* Define `INFINITY' as value of type `float'. */
+# define INFINITY HUGE_VALF
-#endif
+# endif
#else
/* Wild guess at types for float_t and double_t. */
@@ -56,9 +56,12 @@ typedef double float_t;
typedef double double_t;
/* Strange compiler, we don't know how it works. */
-#define FLT_EVAL_METHOD -1
+# define FLT_EVAL_METHOD -1
-/* Define `INFINITY' as value of type `float_t'. */
-#define INFINITY HUGE_VAL
+/* Define `INFINITY' as value of type `float'. */
+# define INFINITY HUGE_VALF
#endif
+
+/* Number of decimal digits for the `double' type. */
+#define DECIMAL_DIG 15
diff --git a/sysdeps/generic/bits/mathdef.h b/sysdeps/generic/bits/mathdef.h
index 93b60bd25f..15140997c0 100644
--- a/sysdeps/generic/bits/mathdef.h
+++ b/sysdeps/generic/bits/mathdef.h
@@ -31,10 +31,13 @@ typedef double double_t; /* `double' expressions are evaluated as
/* Signal that both types are `double'. */
#define FLT_EVAL_METHOD 1
-/* Define `INFINITY' as value of type `float_t'. */
-#define INFINITY HUGE_VAL
+/* Define `INFINITY' as value of type `float'. */
+#define INFINITY HUGE_VALF
/* The values returned by `ilogb' for 0 and NaN respectively. */
#define FP_ILOGB0 0x80000001
#define FP_ILOGBNAN 0x7fffffff
+
+/* Number of decimal digits for the `double' type. */
+#define DECIMAL_DIG 15
diff --git a/sysdeps/generic/bits/stat.h b/sysdeps/generic/bits/stat.h
index dab0cd00cb..3648fed738 100644
--- a/sysdeps/generic/bits/stat.h
+++ b/sysdeps/generic/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1996 Free Software Foundation, Inc.
+/* 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
@@ -70,5 +70,23 @@ struct stat
#define __S_IWRITE 0200 /* Write by owner. */
#define __S_IEXEC 0100 /* Execute by owner. */
+#ifdef __USE_LARGEFILE64
+struct stat64
+ {
+ __dev_t st_dev; /* Device. */
+
+ __ino64_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.*/
+ __off64_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. */
+ };
+#endif
+
#endif /* bits/stat.h */
diff --git a/sysdeps/generic/bits/types.h b/sysdeps/generic/bits/types.h
index fdb36f0b54..51fadd196e 100644
--- a/sysdeps/generic/bits/types.h
+++ b/sysdeps/generic/bits/types.h
@@ -67,6 +67,8 @@ typedef __u_quad_t __fsid_t; /* Type of file system IDs. */
typedef long int __clock_t; /* Type of CPU usage counts. */
typedef long int __rlim_t; /* Type for resource measurement. */
typedef __quad_t __rlim64_t; /* Type for resource measurement (LFS). */
+typedef __quad_t __ino64_t; /* Type for file serial numbers. */
+typedef __loff_t __off64_t; /* Type of file izes and offsets. */
/* Everythin' else. */
typedef long int __daddr_t; /* The type of a disk address. */
diff --git a/sysdeps/i386/fpu/bits/mathdef.h b/sysdeps/i386/fpu/bits/mathdef.h
index 2387a39510..9d0bd840a3 100644
--- a/sysdeps/i386/fpu/bits/mathdef.h
+++ b/sysdeps/i386/fpu/bits/mathdef.h
@@ -22,8 +22,8 @@
/* 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: */
+ 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
@@ -32,10 +32,12 @@ typedef long double double_t; /* `double' expressions are evaluated as
/* Signal that both types are `long double'. */
#define FLT_EVAL_METHOD 2
-/* Define `INFINITY' as value of type `float_t'. */
-#define INFINITY HUGE_VALL
-
+/* Define `INFINITY' as value of type `float'. */
+#define INFINITY HUGE_VALF
/* The values returned by `ilogb' for 0 and NaN respectively. */
#define FP_ILOGB0 0x80000000
#define FP_ILOGBNAN 0x80000000
+
+/* Number of decimal digits for the `long double' type. */
+#define DECIMAL_DIG 18
diff --git a/sysdeps/ieee754/bits/nan.h b/sysdeps/ieee754/bits/nan.h
index 94988ced9c..05a9d6af2a 100644
--- a/sysdeps/ieee754/bits/nan.h
+++ b/sysdeps/ieee754/bits/nan.h
@@ -26,12 +26,7 @@
#ifdef __GNUC__
-# define NAN \
- (__extension__ \
- ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
- { __l: 0x7ff8000000000000ULL }).__d)
-
-# define NANF \
+# define NAN \
(__extension__ \
((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \
{ __l: 0x7fc00000UL }).__d)
@@ -41,23 +36,13 @@
# include <endian.h>
# if __BYTE_ORDER == __BIG_ENDIAN
-# define __nan_bytes { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 }
-# define __nanf_bytes { 0x7f, 0xc0, 0, 0 }
+# define __nan_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 }
+# define __nan_bytes { 0, 0, 0xc0, 0x7f }
# endif
-static union { unsigned char __c[8]; double __d; } __nan = { __nan_bytes };
+static union { unsigned char __c[4]; 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/m68k/bits/nan.h b/sysdeps/m68k/bits/nan.h
deleted file mode 100644
index b4efddfe91..0000000000
--- a/sysdeps/m68k/bits/nan.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* `NAN' constants for m68k.
- 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 _NAN_H
-
-#define _NAN_H 1
-
-/* IEEE Not A Number. */
-
-#ifdef __GNUC__
-
-#define NAN \
- (__extension__ \
- ((union { unsigned long long __l; double __d; }) \
- { __l: 0x7fffffffffffffffULL }).__d)
-
-#define NANF \
- (__extension__ \
- ((union { unsigned long __l; float __f; }) \
- { __l: 0x7fffffffUL }).__f)
-
-#define NANL \
- (__extension__ \
- ((union { unsigned long __l[3]; long double __ld; }) \
- { __l: { 0x7fff0000UL, 0xffffffffUL, 0xffffffffUL } }).__ld)
-
-#else
-
-static union { unsigned char __c[8]; double __d; } __nan =
- { { 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } };
-#define NAN (__nan.__d)
-
-static union { unsigned char __c[4]; float __f; } __nanf =
- { { 0x7f, 0xff, 0xff, 0xff } };
-#define NANF (__nanf.__f)
-
-static union { unsigned char __c[12]; long double __ld; } __nanl =
- { { 0x7f, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } };
-#define NANL (__nanl.__ld)
-
-#endif /* GCC. */
-
-#endif /* nan.h */
diff --git a/sysdeps/m68k/fpu/bits/mathdef.h b/sysdeps/m68k/fpu/bits/mathdef.h
index c2b4eff920..e3d33a53a2 100644
--- a/sysdeps/m68k/fpu/bits/mathdef.h
+++ b/sysdeps/m68k/fpu/bits/mathdef.h
@@ -32,9 +32,12 @@ typedef long double double_t; /* `double' expressions are evaluated as
/* Signal that both types are `long double'. */
#define FLT_EVAL_METHOD 2
-/* Define `INFINITY' as value of type `float_t'. */
-#define INFINITY HUGE_VALL
+/* Define `INFINITY' as value of type `float'. */
+#define INFINITY HUGE_VALF
/* The values returned by `ilogb' for 0 and NaN respectively. */
#define FP_ILOGB0 0x80000000
#define FP_ILOGBNAN 0x7fffffff
+
+/* Number of decimal digits for the `long double' type. */
+#define DECIMAL_DIG 18
diff --git a/sysdeps/posix/getcwd.c b/sysdeps/posix/getcwd.c
index 2ae3c1e897..d40d8d6822 100644
--- a/sysdeps/posix/getcwd.c
+++ b/sysdeps/posix/getcwd.c
@@ -190,12 +190,17 @@ extern char *alloca ();
# define __getcwd getcwd
#endif
+#ifndef GETCWD_STORAGE_CLASS
+# define GETCWD_STORAGE_CLASS
+#endif
+
/* Get the pathname of the current working directory, and put it in SIZE
bytes of BUF. Returns NULL if the directory couldn't be determined or
SIZE was too small. If successful, returns BUF. In GNU, if BUF is
NULL, an array is allocated with `malloc'; the array is SIZE bytes long,
unless SIZE <= 0, in which case it is as big as necessary. */
+GETCWD_STORAGE_CLASS
char *
__getcwd (buf, size)
char *buf;
@@ -396,6 +401,6 @@ __getcwd (buf, size)
return NULL;
}
-#ifdef _LIBC
+#if defined _LIBC && !defined __getcwd
weak_alias (__getcwd, getcwd)
#endif
diff --git a/sysdeps/powerpc/bits/mathdef.h b/sysdeps/powerpc/bits/mathdef.h
index 9f91863333..3923a5401a 100644
--- a/sysdeps/powerpc/bits/mathdef.h
+++ b/sysdeps/powerpc/bits/mathdef.h
@@ -17,7 +17,7 @@
Boston, MA 02111-1307, USA. */
#ifndef _MATH_H
-#error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
#endif
@@ -28,7 +28,7 @@
gcc! */
#ifdef __GNUC__
-#if __STDC__ == 1
+# if __STDC__ == 1
/* In GNU or ANSI mode, gcc leaves `float' expressions as-is. */
typedef float float_t; /* `float' expressions are evaluated as
@@ -37,12 +37,12 @@ typedef double double_t; /* `double' expressions are evaluated as
`double'. */
/* Signal that types stay as they were declared. */
-#define FLT_EVAL_METHOD 0
+# define FLT_EVAL_METHOD 0
-/* Define `INFINITY' as value of type `float_t'. */
-#define INFINITY HUGE_VALF
+/* Define `INFINITY' as value of type `float'. */
+# define INFINITY HUGE_VALF
-#else
+# else
/* For `gcc -traditional', `float' expressions are evaluated as `double'. */
typedef double float_t; /* `float' expressions are evaluated as
@@ -51,12 +51,12 @@ typedef double double_t; /* `double' expressions are evaluated as
`double'. */
/* Signal that both types are `double'. */
-#define FLT_EVAL_METHOD 1
+# define FLT_EVAL_METHOD 1
-/* Define `INFINITY' as value of type `float_t'. */
-#define INFINITY HUGE_VAL
+/* Define `INFINITY' as value of type `float'. */
+# define INFINITY HUGE_VALF
-#endif
+# endif
#else
/* Wild guess at types for float_t and double_t. */
@@ -64,13 +64,16 @@ typedef double float_t;
typedef double double_t;
/* Strange compiler, we don't know how it works. */
-#define FLT_EVAL_METHOD -1
+# define FLT_EVAL_METHOD -1
-/* Define `INFINITY' as value of type `float_t'. */
-#define INFINITY HUGE_VAL
+/* Define `INFINITY' as value of type `float'. */
+# define INFINITY HUGE_VALF
#endif
/* The values returned by `ilogb' for 0 and NaN respectively. */
#define FP_ILOGB0 0x80000001
#define FP_ILOGBNAN 0x7fffffff
+
+/* Number of decimal digits for the `double' type. */
+#define DECIMAL_DIG 15
diff --git a/sysdeps/sparc/fpu/bits/mathdef.h b/sysdeps/sparc/fpu/bits/mathdef.h
index 505d724fd0..135531067b 100644
--- a/sysdeps/sparc/fpu/bits/mathdef.h
+++ b/sysdeps/sparc/fpu/bits/mathdef.h
@@ -17,38 +17,38 @@
Boston, MA 02111-1307, USA. */
#ifndef _MATH_H
-#error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+# error "Never use <bits/mathdef.h> directly; include <math.h> 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
+# 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 FLT_EVAL_METHOD 0
-/* Define `INFINITY' as value of type `float_t'. */
-#define INFINITY HUGE_VALF
+/* Define `INFINITY' as value of type `float'. */
+# define INFINITY HUGE_VALF
-#else
+# 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 FLT_EVAL_METHOD 1
-/* Define `INFINITY' as value of type `float_t'. */
-#define INFINITY HUGE_VAL
+/* Define `INFINITY' as value of type `float'. */
+# define INFINITY HUGE_VALF
-#endif
+# endif
#else
/* Wild guess at types for float_t and double_t. */
@@ -56,13 +56,16 @@ typedef double float_t;
typedef double double_t;
/* Strange compiler, we don't know how it works. */
-#define FLT_EVAL_METHOD -1
+# define FLT_EVAL_METHOD -1
-/* Define `INFINITY' as value of type `float_t'. */
-#define INFINITY HUGE_VAL
+/* Define `INFINITY' as value of type `float'. */
+# define INFINITY HUGE_VALF
#endif
/* The values returned by `ilogb' for 0 and NaN respectively. */
#define FP_ILOGB0 0x80000001
#define FP_ILOGBNAN 0x7fffffff
+
+/* Number of decimal digits for the `double' type. */
+#define DECIMAL_DIG 15
diff --git a/sysdeps/unix/arm/sysdep.S b/sysdeps/unix/arm/sysdep.S
index 5d3ad551c6..d59500e47a 100644
--- a/sysdeps/unix/arm/sysdep.S
+++ b/sysdeps/unix/arm/sysdep.S
@@ -18,13 +18,13 @@
#include <sysdep.h>
#define _ERRNO_H
-#include <errnos.h>
+#include <bits/errno.h>
.globl C_SYMBOL_NAME(errno)
.globl syscall_error
_errno_loc: .long C_SYMBOL_NAME(errno)
-
+
#undef syscall_error
#ifdef NO_UNDERSCORES
__syscall_error:
@@ -39,7 +39,7 @@ syscall_error:
moveq r0, $EAGAIN /* Yes; translate it to EAGAIN. */
#endif
#ifndef PIC
- ldr r1, _errno_loc
+ ldr r1, _errno_loc
str r0, [r1]
#endif
mvn r0, $0
diff --git a/sysdeps/unix/sysv/linux/arm/profil-counter.h b/sysdeps/unix/sysv/linux/arm/profil-counter.h
index 802cbd5d63..d84e70e7ff 100644
--- a/sysdeps/unix/sysv/linux/arm/profil-counter.h
+++ b/sysdeps/unix/sysv/linux/arm/profil-counter.h
@@ -22,5 +22,5 @@
void
profil_counter (int signo, struct sigcontext sc)
{
- profil_count ((void *) sc.eip);
+ profil_count ((void *) sc.reg.ARM_pc);
}
diff --git a/sysdeps/unix/sysv/linux/arm/sysdep.h b/sysdeps/unix/sysv/linux/arm/sysdep.h
index 0aa085d351..af08277a63 100644
--- a/sysdeps/unix/sysv/linux/arm/sysdep.h
+++ b/sysdeps/unix/sysv/linux/arm/sysdep.h
@@ -29,8 +29,8 @@
of the kernel. But these symbols do not follow the SYS_* syntax
so we have to redefine the `SYS_ify' macro here. */
#undef SYS_ify
-#define SWI_BASE (9 << 20)
-#define SYS_ify(syscall_name) (SWI_BASE + __NR_##syscall_name)
+#define SWI_BASE (0x900000)
+#define SYS_ify(syscall_name) (__NR_##syscall_name)
#ifdef ASSEMBLER
diff --git a/sysdeps/unix/sysv/linux/getcwd.c b/sysdeps/unix/sysv/linux/getcwd.c
new file mode 100644
index 0000000000..eea0b469e1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/getcwd.c
@@ -0,0 +1,94 @@
+/* Determine current working directory. Linux version.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 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. */
+
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+/* #define NDEBUG 1 */
+#include <assert.h>
+
+/* The "proc" filesystem provides an easy method to retrieve the value.
+ For each process, the corresponding directory contains a symbolic link
+ named `cwd'. Reading the content of this link immediate gives us the
+ information. But we have to take care for systems which do not have
+ the proc filesystem mounted. Use the POSIX implementation in this case. */
+static char *generic_getcwd (char *buf, size_t size);
+
+char *
+__getcwd (char *buf, size_t size)
+{
+ int save_errno;
+ char *path;
+ int n;
+ char *result;
+
+ if (size == 0)
+ {
+ if (buf != NULL)
+ {
+ __set_errno (EINVAL);
+ return NULL;
+ }
+
+ size = PATH_MAX + 1;
+ }
+
+ if (buf != NULL)
+ path = buf;
+ else
+ {
+ path = malloc (size);
+ if (path == NULL)
+ return NULL;
+ }
+
+ save_errno = errno;
+ n = __readlink ("/proc/self/cwd", path, size);
+ if (n != -1)
+ {
+ if (n >= size)
+ {
+ /* This should never happen when we allocate the buffer here. */
+ assert (buf == NULL);
+ __set_errno (ERANGE);
+ return NULL;
+ }
+ path[n] = '\0';
+ return buf ?: (char *) realloc (path, (size_t) n + 1);
+ }
+
+ /* Something went wrong. Restore the error number and use the generic
+ version. */
+ __set_errno (save_errno);
+ result = generic_getcwd (path, size);
+
+ if (result == NULL && buf == NULL)
+ free (path);
+
+ return result;
+}
+weak_alias (__getcwd, getcwd)
+
+/* Get the code for the generic version. */
+#define GETCWD_STORAGE_CLASS static
+#define __getcwd generic_getcwd
+#include <sysdeps/posix/getcwd.c>
diff --git a/sysdeps/wordsize-32/inttypes.h b/sysdeps/wordsize-32/inttypes.h
index 7bb8cbd5bc..371b40bb3d 100644
--- a/sysdeps/wordsize-32/inttypes.h
+++ b/sysdeps/wordsize-32/inttypes.h
@@ -353,7 +353,7 @@ typedef unsigned long long int uint_fast64_t;
/* Limits of `sig_atomic_t'. */
#define SIG_ATOMIC_MIN (-2147483647-1)
-#define SIG_ATOMIC_MAX (-2147483647-1)
+#define SIG_ATOMIC_MAX (2147483647)
/* Limit of `size_t' type. */
#define SIZE_MAX (4294967295U)
diff --git a/sysdeps/wordsize-64/inttypes.h b/sysdeps/wordsize-64/inttypes.h
index 9967fc0844..5f11fc9cb1 100644
--- a/sysdeps/wordsize-64/inttypes.h
+++ b/sysdeps/wordsize-64/inttypes.h
@@ -353,7 +353,7 @@ typedef unsigned long int uint_fast64_t;
/* Limits of `sig_atomic_t'. */
#define SIG_ATOMIC_MIN (-2147483647-1)
-#define SIG_ATOMIC_MAX (-2147483647-1)
+#define SIG_ATOMIC_MAX (2147483647)
/* Limit of `size_t' type. */
#define SIZE_MAX (18446744073709551615uL)